So, I've been researching this topic on and off for months now, and have basically gotten nowhere. What we desperately need at 18F is a good browser ("functional") testing tool that we can easily add to our projects. My ideal would be one that does the following:
- Uses Selenium (both locally and remotely)
- Supports cloud services like Sauce Labs or BrowserStack out of the box
- Runs easily on CI services like Travis and Circle
The CI requirement is tricky, as I've documented in this pull request, especially when your app needs to run alongside the test suite with a language other than Node. So, in addition to just identifying a tool, we should also provide some recipes and/or boilerplate for the following matrix of environments:
- Running tests on different Selenium environments:
- with local browsers (including PhantomJS) using Selenium Server
- with virtual browsers on cloud services like Sauce Labs
- Running tests against different app/site URLs:
- a static, public URL
- a local URL over a tunnel, e.g. with Sauce Connect
- an "ephemeral" local server URL, e.g. when you run your app server alongside the test suite on CI services
- A series of target browsers, hopefully identified via analytics and/or research, on one or more of the above environments, for instance:
- Chrome and Firefox (theoretically the same on all platforms, locally or virtually)
- Internet Explorer (9, 10, 11, Edge, etc.) on Windows, virtually
- Safari on iOS (virtually)
- Chrome on Android (virtually)
Also, I think it would be good for this cookbook to help people avoid writing tons of browser tests by writing better unit tests to cover "core" JavaScript, and only browser test the parts of their code that interface with browser APIs. This should help us avoid writing bloated, difficult-to-maintain browser test suites and save a bunch of time waiting for the tests to run on (potentially) lots of different browsers.
It feels to me like I'm the wrong person for this job, not only because I'm relatively new to testing, but because I also just don't have any time for it right now. So I'm tapping @DavidEBest, @yozlet, @jmcarp, @msecret and @vzvenyach because they have some interest and/or experience with this stuff, and I wholeheartedly defer to their judgement. Feel free to rope in other folks who know about this, and share thoughts or resources here.
I mentioned to Yoz that I've had a hard time finding any good examples of browser testing tools like Nightwatch and WebDriverIO in practice (as used on an actual site, as opposed to just usage examples), so that might be a good place to start. It's also probably worth listing the testing needs of projects that we've all worked on so that we can get a better sense of what our needs as an organization are. I'm happy to contribute those for the projects I've worked on so far.