Selenium: What is it Good For?
Dallas Drupal Users Group Power User Meetup
September 17, 2012
Whatcha Gonna Do?
- Selenium IDE: A comprehensive walkthrough of the misunderstood IDE.
- Store and Run Tests: A guide to Automated Testing at it's most basic level.
- The Important Features: What we need to get Selenium working with PHPUnit.
- Translation from Selenium IDE: The first
steps to using PHPUnit for managing and running your tests.
- Continuous Integration
- Overview: What does it mean to be continuously integrated?
- Using Jenkins: A quick use case for using Continuous Integration.
What is Selenium?
Selenium automates browsers. That's it.
- Record Your Actions.
- Modify Your Targets.
- Fill In the Gaps With Tests.
- Store and Run Your Tests.
Record Your Actions.
Live Demo Time!
Warning: Conflicting Information!
If you plan to move on to more advanced testing:
Separate different features into different Test Suites.
If you plan to stick with what you got now:
Combine all features into the same Test Suite.
For both do:
- Separate tests into logical test cases.
- Share and reap the rewards!
- Make a backup of the database.
(Check out backup and migrate)
- Run the Tests!
- Restore if needed.
You are ready to move to the next level!
Where does PHPUnit come in?
PHPUnit allows you to make the process more automated!
Selenium Feature Overview
- You can run your old tests! (with massaging)
- You can now perform repetitive tasks!
- You can now chain running your tests to events!
Translation of Selenium tests
There are 2 ways!
- PHP Export Addon
- Throwing your selenese test cases into a directory and telling PHPUnit to run em.
Great... But how to do I use it?
You've leveled up twice in an hour!
You should feel proud of yourself... No, Really!
Continuous Integration (CI) there to help your work's quality by:
- Taking repetitive manual tasks and automating them
- Doing these tasks more frequently
- And doing these task faster!
Things That Now Become Easier and Possible
- Code standard checking
- Processing Tasks on events such as commits!
- More information in an already formatted report!
- Running Tests
To Complete This Level You Must...
- Install a CI system: Hudson, Jenkins, and Travis are all free with great documentation.
- Build a job: Usually tell it when to run. For instance, on git commit to github, or every night at midnight.
- Tell it what to do: Anything commandline will run. PHPUnit is commandline. Hudson, Travis, have Selenium built in!
You've made it to The End!
But wait there's one more thing...
What this means is that you now have a choice based on the following...
- How Automated do you want to go.
- What works for your team?
- How many resources do you have to dedicate to automation?
In the end, it is almost always best for your product to get to the last level.