SlideShare a Scribd company logo
Cross Browser testing JavaScript
Alan Parkinson
CEO, Hindsight Software Ltd
@alan_parkinson
Cross browser Testing JavaScript
You don’t need to run your Selenium Test
suite with every browser*
The Truth
• No visual testing
• Low JavaScript code coverage
• Costly to improve coverage
Rendering Compatibility
JavaScript/DOM Compatibility
What do we achieve?
• JavaScript and DOM compatibility
• Good code coverage
• Reusing a development artifact
Run all JavaScript unit tests cross browser
Simple Answer
• Average Test: 8 Seconds
• Test Suite: 5 minutes
• Average Test: 0.1 seconds
• Test suite: 11 seconds
Functional Tests
JavaScript Unit Tests
Looking at the numbers
Do we meet our compatibility objective?
Code Coverage has a use
• Too many JavaScript files
• Order of loading files
Not everything will be picked up by Unit
Tests
*The qualifier
Only run critical functional tests cross-
browser
JAVASCRIPT TEST RUNNERS
Reusing your Selenium infrastructure
• Testing Framework Agnostic
• Continuous Integration
• Code coverage with Instanbul
• Launch Browsers
• Manually connect browsers
Spectacular Test Runner for JavaScript
Real Browsers
Karma
• Connects Remote WebDriver Instances
• Selenium Grid 2
• Supports Desired Capabilities
Reusing your Selenium Infrastructure
Karma WebDriver Launcher
Karma in action
$ npm install -g karma
$ npm install -g karma-webdriver-launcher
Continuous Integration
Override karma.conf.js from the command line
singleRun: true
reporters: [‘junit’]
• Code Coverage
• Feedback time
• Meeting our objective - Compatibility
• Karma Runner
• Use your existing WebDriver infrastructure
• Use code coverage to validate the majority of your code
is compatibility tested.
Functional tests have poor performance:
Cross-browser unit test JavaScript
Summary
http://karma-runner.github.io/
https://github.com/hindsightsoftware/karma-
webdriver-example
Thank you
Alan Parkinson
@alan_parkinson

More Related Content

Cross browser Testing JavaScript

Editor's Notes

  1. Start-upFollow Learn Start-upBuilt a MVP on top of JIRA – Consequence is customers install on there own hardwareWe pratitice CD during product development and always looking to get feature into customers handsMobile app developers may face similar issues to us as there are many parallels