Can you turn front-end developers in to front-end testers? Pairing up with your front-end teammates promotes functional testing through all phases of development. And, by writing your tests using WebdriverIO, your front-end team will find test writing fun and intuitive.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const argv = require('yargs').argv; | |
let capabilities = [ | |
{ | |
browserName: 'chrome', | |
}, | |
{ | |
browserName: 'firefox', | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
getUrlAndTitle: function (customVar) { | |
return { | |
url: this.getUrl(), | |
title: this.getTitle(), | |
customVar: customVar | |
}; | |
}, | |
otherCommand: function () { | |
// do something else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is the base wdio.conf.js file with all your commong configs | |
exports.config = { | |
specs: [ | |
'./test/specs/**/*.js' | |
], | |
capabilities: [{ | |
browserName: 'firefox' | |
}], | |
// ... more configs here ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const sync = require('synchronize'); | |
const request = require('request'); | |
const fs = require('fs'); | |
const { APP_PATH, SAUCE_USERNAME, SAUCE_ACCESS_KEY } = process.env; | |
const authToken = Buffer(`${SAUCE_USERNAME}:${SAUCE_ACCESS_KEY}`).toString( | |
'base64' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require prod configuration | |
var prodConfig = require('./wdio.conf.js').config; | |
// Custom properties | |
var localConfig = { | |
capabilities: [{ | |
browserName: 'chrome' | |
}], | |
baseUrl: 'http://localhost:8303' | |
services: ['selenium-standalone'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var assert = require('assert'); | |
var request = require('request'); | |
describe('webdriver.io page', function() { | |
it('should have the right title', function () { | |
browser.url('/'); | |
var title = browser.getTitle(); | |
assert.equal(title, 'WebdriverIO - Selenium 2.0 javascript bindings for nodejs'); | |
}); |
Testing can be a real pain! Isn't it good enough that it looks fine in Chrome? Should I really have to test the login page for a change to the contact form?
As a front-end dev, I've lazily assumed that testing is the realm of QA. Sure, I'll begrudgingly check my site in IE to see how much repair it needs, but I confess to cutting corners when testing and saying "That shouldn't break anything..."
This worked okay while I was building small sites, but now that I'm working with multiple teams on large projects, cutting corners doesn't work. The edge case always comes in to play and things that probably won't break do.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
// | |
// Framework to run your tests with. | |
framework: "mocha", | |
// | |
// Options to be passed to Mocha. | |
// See the full list at http://mochajs.org/ | |
mochaOpts: { | |
ui: "bdd", | |
timeout: 270000, |