Created
July 11, 2015 15:36
-
-
Save fand/6060e0599df64af40015 to your computer and use it in GitHub Desktop.
WDIO3 multi browser test
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
'use strict'; | |
var webdriverio = require('webdriverio'); | |
var assert = require('assert'); | |
describe('top page', function () { | |
var chrome, firefox; | |
before(function *() { | |
chrome = webdriverio.remote({ desiredCapabilities : {browserName : 'chrome'} }); | |
firefox = webdriverio.remote({ desiredCapabilities : {browserName : 'firefox'} }); | |
yield chrome.init(); | |
yield firefox.init(); | |
}); | |
describe('chrome', function() { | |
it('should do something', function *() { | |
yield chrome | |
.url('https://duckduckgo.com/') | |
.setValue('#search_form_input_homepage', 'WebdriverIO') | |
.click('#search_button_homepage'); | |
var title = yield chrome.getTitle(); | |
console.log(title); // outputs: "Title is: WebdriverIO (Software) at DuckDuckGo" | |
}); | |
}); | |
describe('firefox', function() { | |
it('should do something', function *() { | |
yield firefox | |
.url('https://duckduckgo.com/') | |
.setValue('#search_form_input_homepage', 'WebdriverIO') | |
.click('#search_button_homepage'); | |
var title = yield firefox.getTitle(); | |
console.log(title); // outputs: "Title is: WebdriverIO (Software) at DuckDuckGo" | |
}); | |
}); | |
after(function* () { | |
yield chrome.end(); | |
yield firefox.end(); | |
}); | |
}); |
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
'use strict'; | |
var webdriverio = require('webdriverio'); | |
var assert = require('assert'); | |
var matrix = webdriverio.multiremote({ | |
chrome : { | |
desiredCapabilities : {browserName : 'chrome'} | |
}, | |
firefox : { | |
desiredCapabilities : {browserName : 'firefox'} | |
}, | |
}); | |
describe('top page', function () { | |
var chrome, firefox; | |
before(function *() { | |
yield matrix.init(); | |
chrome = matrix.select('chrome'); | |
firefox = matrix.select('firefox'); | |
}); | |
describe('chrome', function() { | |
it('should do something', function *() { | |
yield chrome | |
.url('https://duckduckgo.com/') | |
.setValue('#search_form_input_homepage', 'WebdriverIO') | |
.click('#search_button_homepage'); | |
var title = yield chrome.getTitle(); | |
console.log(title); // outputs: "Title is: WebdriverIO (Software) at DuckDuckGo" | |
}); | |
}); | |
describe('firefox', function() { | |
it('should do something', function *() { | |
yield firefox | |
.url('https://duckduckgo.com/') | |
.setValue('#search_form_input_homepage', 'WebdriverIO') | |
.click('#search_button_homepage'); | |
var title = yield firefox.getTitle(); | |
console.log(title); // outputs: "Title is: WebdriverIO (Software) at DuckDuckGo" | |
}); | |
}); | |
after(function* () { | |
yield matrix.end(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment