automated-testing-final

36
Ben Emmons Web & Mobile Services, UITS Automated Testing

Upload: azwildcat

Post on 08-Aug-2015

21 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: automated-testing-final

Ben EmmonsWeb & Mobile Services, UITSAutomated Testing

Page 2: automated-testing-final

10/28/2014

Why automation?

Page 3: automated-testing-final

10/28/2014

“Any time you have a human at a keyboard doing

ANYTHING, that process will not scale.”

- Chad Smith, Global Knowledge

Page 4: automated-testing-final

10/28/2014

One Site

Page 5: automated-testing-final

10/28/2014

Easy Patching

Page 6: automated-testing-final

10/28/2014

One Multisite

Page 7: automated-testing-final

10/28/2014

Medium Patching

Page 8: automated-testing-final

10/28/2014

Multiple Environments

Page 9: automated-testing-final

10/28/2014

Arduous Patching

Page 10: automated-testing-final

10/28/2014

340+ Sites

Page 11: automated-testing-final

10/28/2014

Sisyphean Patching

Page 12: automated-testing-final

10/28/2014

Solution?

Page 13: automated-testing-final

10/28/2014

Automate Security Audits

Page 14: automated-testing-final

10/28/2014

Automate Patching

Page 15: automated-testing-final

10/28/2014

Automate Syncing

…and clearing cache, and renewing SLAs,

and security scan reminders,and customer notifications,

and…

Page 16: automated-testing-final

10/28/2014

Automated Testing

Page 17: automated-testing-final

10/28/2014

Why is that so hard?

Page 18: automated-testing-final

10/28/2014

First, pick engine(s)

Gotchas:• IE can only run reliably on a Windows OS

Ramification: testing solution requires Windows• Latest Safari will only run on Mac hardware

Ramification: no AWS option and good luck hosting a Mac in the UITS server room…

Page 19: automated-testing-final

10/28/2014

Next, pick driver

Gotchas:• IE Compatibility Mode is not reliable: http://stackoverflow.com/a/11418046

• TrifleJS is “very much in beta” and cannot emulate versions on Windows Server 2012

• WebDriver is slow• Node.js solutions target a specific layout engine• Very little Sahi documentation and small community

Page 20: automated-testing-final

10/28/2014

Unit testing?

Page 21: automated-testing-final

10/28/2014

… How about Functional?

Page 22: automated-testing-final

10/28/2014

… Ready to run the tests?

Page 23: automated-testing-final

10/28/2014

… Don’t forget your CSS!

Page 25: automated-testing-final

10/28/2014

Making the right choice• Avoid choice paralysis http://addyosmani.com/blog/front-end-choice-paralysis/

“The challenge is that when presented with an abundance of choice, you can feel increasingly unsure of whether yours is the right one. Instead of being happy with our decisions, we’re filled with anxiety. Did I pick the wrong one? Would I have been better off with something else? What would my friends have used? ... If you’re an experienced developer speaking to someone stuck on a decision, try to help them simplify their options.” - Addy Osmani

• Unit vs. Functional http://www.helpscout.net/blog/functional-testing-casperjs/ “No one cares that your Unit tests are passing if your application doesn’t function. Unit testing makes sure you are using quality ingredients. Functional testing makes sure your application doesn't taste like crap. ... [In] the real world, most developers barely have time for one kind of automated test, let alone two. If that describes you, I would strongly encourage you to go with Functional testing.” - Brett Jones

Page 26: automated-testing-final

10/28/2014

Our Stack• Amazon Web Services: https://aws.amazon.com/

• Selenium Grid: https://code.google.com/p/selenium/wiki/Grid2

• IE, Ff, Ch: https://github.com/conceptsandtraining/modernie_selenium

• Safari: UITS Mac colo or Sauce Labs free• Mobile: http://appium.io/

• WebdriverIO: http://webdriver.io/

• Unit Testing: Buster.jshttps://github.com/webdriverio/webdriverio/blob/master/examples/webdriverjs.with.buster.js

• WebdriverCSS: https://github.com/webdriverio/webdrivercss

• WebdriverCSS Adminpanel: https://github.com/webdriverio/webdrivercss-adminpanel

Page 27: automated-testing-final

10/28/2014

Eas(ier) Button

• Getting a test environment up and running is half the battle. Do yourself a favor and just pay out.• If getting budgetary approval is akin to an act of

Congress, at the very least use our AWS CloudFormation template: https://bitbucket.org/uitsweb/selenium-grid-ec2

Page 28: automated-testing-final

10/28/2014

Demo

Page 29: automated-testing-final

10/28/2014

Demo

Page 30: automated-testing-final

10/28/2014

Demo

Page 31: automated-testing-final

10/28/2014

Demo

Page 32: automated-testing-final

10/28/2014

Demo

http://www.whatsmybrowser.org/ node wdio.js

Page 33: automated-testing-final

10/28/2014

Demo

http://coolepochcountdown.com/ node wdcss.js

Page 34: automated-testing-final

10/28/2014

Demo

http://coolepochcountdown.com/ node wdcss.js

Page 35: automated-testing-final

10/28/2014

Next Steps• Update Selenium Grid template to use NAT private

subnet• Firewall exception to allow AWS Selenium Grid to

access test sites (or use SSH reverse proxy)• Update Selenium Grid template to use Modern.IE VMs• Drush script for dynamically obtaining top menu links• Update our Drupal automation tool to launch (and

respond to) automated testing of top site pages• Set up Appium on Mac OS X server and arrange colo• Profit!

Page 36: automated-testing-final

10/28/2014

Questions?