Selenium Conference 2013, BostonCross-browserunit testing JavaScriptAlan Parkinson@alan_parkinson #seconf
You want the Truth?You can’t handle the Truth
You don’t need to run your SeleniumTest suite with every browser*The Truth
• No visual testing• Low JavaScript code coverage• Costly to improve coverageRendering CompatibilityJavaScript/DOM Compati...
• JavaScript and DOM compatibility• Good code coverage• Reusing a development artifactRun all JavaScript unit tests cross ...
• Average Test: 8 Seconds• Test Suite: 5 minutes• Average Test: 0.1 seconds• Test suite: 11 secondsFunctional TestsJavaScr...
Do we meet our compatibility objective?Code Coverage has use
• Too many JavaScript files• Order of loading filesNot everything will be picked up by Unit Tests*The qualifierOnly run cr...
JavaScript Test RunnersReusing your Selenium infrastructure
• Testing Framework Agnostic• Continuous Integration• Code coverage with Instanbul• Launch Browsers• Manually connect brow...
• Connects Remote WebDriver Instances• Selenium Grid 2• Supports Desired CapabilitiesReusing your Selenium InfrastructureK...
Karma in action
• Code Coverage• Feedback time• Meeting our objective - Compatibility• Karma Runner• Reuse your existing Selenium WebDrive...
https://karma-runner.github.comhttps://github.com/hindsightsoftware/karma-webdriver-launcherhttps://github.com/hindsightso...
Upcoming SlideShare
Loading in …5
×

Cross-browser unit testing JavaScript

1,472 views

Published on

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,472
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Cross-browser unit testing JavaScript

  1. 1. Selenium Conference 2013, BostonCross-browserunit testing JavaScriptAlan Parkinson@alan_parkinson #seconf
  2. 2. You want the Truth?You can’t handle the Truth
  3. 3. You don’t need to run your SeleniumTest suite with every browser*The Truth
  4. 4. • No visual testing• Low JavaScript code coverage• Costly to improve coverageRendering CompatibilityJavaScript/DOM CompatibilityWhat do we achieve?
  5. 5. • JavaScript and DOM compatibility• Good code coverage• Reusing a development artifactRun all JavaScript unit tests cross browserSimple Answer
  6. 6. • Average Test: 8 Seconds• Test Suite: 5 minutes• Average Test: 0.1 seconds• Test suite: 11 secondsFunctional TestsJavaScript Unit TestsLooking at the numbers
  7. 7. Do we meet our compatibility objective?Code Coverage has use
  8. 8. • Too many JavaScript files• Order of loading filesNot everything will be picked up by Unit Tests*The qualifierOnly run critical functional tests cross-browser
  9. 9. JavaScript Test RunnersReusing your Selenium infrastructure
  10. 10. • Testing Framework Agnostic• Continuous Integration• Code coverage with Instanbul• Launch Browsers• Manually connect browsersSpectacular Test Runner for JavaScriptReal BrowsersKarma
  11. 11. • Connects Remote WebDriver Instances• Selenium Grid 2• Supports Desired CapabilitiesReusing your Selenium InfrastructureKarma WebDriver Launcher
  12. 12. Karma in action
  13. 13. • Code Coverage• Feedback time• Meeting our objective - Compatibility• Karma Runner• Reuse your existing Selenium WebDriver infrastructure• Use code coverage to validate the majority of your code iscompatibility tested.Functional tests have poor performance:Cross-browser unit test JavaScriptSummary
  14. 14. https://karma-runner.github.comhttps://github.com/hindsightsoftware/karma-webdriver-launcherhttps://github.com/hindsightsoftware/karma-webdriver-exampleThank youAlan Parkinsonalan.parkinson@hindsightsoftware.co.uk@alan_parkinson

×