Skip to content

Instantly share code, notes, and snippets.

Avatar
🕵️‍♂️
Testing All The Things™

Christian Bromann christian-bromann

🕵️‍♂️
Testing All The Things™
View GitHub Profile
@christian-bromann
christian-bromann / gatsby.e2e.js
Created Jul 18, 2020
Gatsby WebdriverIO Recipe
View gatsby.e2e.js
const GatsbyPage = require('../pageobjects/home.page');
describe('My home page', () => {
beforeEach(() => {
GatsbyPage.open();
})
it('make this test work', () => {
expect(GatsbyPage.header).toHaveText('Hello Gatsby');
});
@christian-bromann
christian-bromann / test.js
Created Nov 9, 2017
Actions API demo using WebdriverIO in standalone mode
View test.js
(async function () {
const webdriverio = require('webdriverio')
const browser = webdriverio.remote({
path: '/',
desiredCapabilities: {
browserName: 'firefox'
}
})
@christian-bromann
christian-bromann / Readme.md
Last active Aug 8, 2017
Run Chrome headless
View Readme.md

Run Chrome headless

The good old PhantomJS times are over. The project is not maintained anymore and it is recommended to switch over to Chrome headless. Just run a local Selenium standalone server:

$ java -jar Sites/selenium-server-standalone-3.4.0.jar
@christian-bromann
christian-bromann / package.json
Last active Jan 18, 2017
WebdriverIO example
View package.json
{
"name": "wdio-examples",
"version": "1.0.0",
"description": "WebdriverIO examples",
"dependencies": {
"wdio-sauce-service": "^0.3.0",
"wdio-selenium-standalone-service": "^0.0.7",
"wdio-spec-reporter": "0.0.3",
"webdriverio": "^4.4.0"
},
@christian-bromann
christian-bromann / expected.json
Created Sep 9, 2015
microsoftedge driver array/object bug
View expected.json
[{
"a": 1,
"b": 2
}, {
"c": 3,
"d": [1, 2, 3, 4, 5],
"e": [{
"some": "object",
"other": "thing"
}]
View WDIO.xunit.phantomjs.32442.xml
<testsuites name="phantomjs" tests="10" failures="2" errors="1" disabled="1" time="3.845">
<testsuite name="google page" tests="4" failures="1" skipped="0" disabled="0" time="2.754" timestamp="Thu May 21 2015 02:10:50 GMT+0200 (CEST)" id="1" file="/Users/christianbromann/Sites/Webprojekte/webdriverjs/DEV/specs/test.google.spec.js">
<testcase name="should have title1" disabled="false" time="0.977" id="2" file="/Users/christianbromann/Sites/Webprojekte/webdriverjs/DEV/specs/test.google.spec.js" status="passed">
<system-out type="command"><![CDATA[
POST http://0.0.0.0:4444/wd/hub/session/15787134-1f6b-4da7-a1c8-86c656c366e0/url - {"url":"http://localhost:8080"}
GET http://0.0.0.0:4444/wd/hub/session/15787134-1f6b-4da7-a1c8-86c656c366e0/title - {}
]]></system-out>
<system-out type="result"><![CDATA[
POST http://0.0.0.0:4444/wd/hub/session/15787134-1f6b-4da7-a1c8-86c656c366e0/url - {"state":"success","sessionId":"15787134-1f6b-4da7-a1c8-86c656c366e0","hCode":845403856,"value":null,"clas
@christian-bromann
christian-bromann / test.js
Created Nov 12, 2014
new syntactic sugar for WebdriverIO commands
View test.js
describe(function() {
it('should login', function() {
"#inputUsername".setValue('userA');
"#inputPassword".setValue('*****');
".submit".click();
return browser.getTitle().should.be.equal('Welcome userA');
});
@christian-bromann
christian-bromann / webdriverio.js
Created Sep 24, 2014
chromeoptions in webdriverio
View webdriverio.js
var client = require("webdriverio").remote({
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['window-size=2880,1800']
}
}
})
View getAttribute.js
describe('getAttribute', function() {
it('should test data attribute', function(done) {
client.getAttribute('#elem', 'data-type', function(err, attr) {
assert(err === null);
assert(attr === 'example'); // true
}).call(done);
});
});
@christian-bromann
christian-bromann / execute.js
Last active Aug 29, 2015
new execute command
View execute.js
/**
* old depcrecated version
*/
client.execute(function(arg1,arg2){
// do soemthing
},[arg1,arg2]);
// -----------------------------------------
/**