Skip to content

Instantly share code, notes, and snippets.

View christian-bromann's full-sized avatar
🕵️‍♂️
Testing All The Things™

Christian Bromann christian-bromann

🕵️‍♂️
Testing All The Things™
View GitHub Profile
@christian-bromann
christian-bromann / webdriverio.js
Created September 24, 2014 16:02
chromeoptions in webdriverio
var client = require("webdriverio").remote({
desiredCapabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['window-size=2880,1800']
}
}
})
@christian-bromann
christian-bromann / getAttribute.js
Last active August 29, 2015 14:02
getAttribute
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 August 29, 2015 14:00
new execute command
/**
* old depcrecated version
*/
client.execute(function(arg1,arg2){
// do soemthing
},[arg1,arg2]);
// -----------------------------------------
/**
@christian-bromann
christian-bromann / chrome.css
Created April 20, 2014 14:36
webdriver computed css attributes
/**
* got list with 253 entries
*/
div {
background-attachment : scroll;
background-clip : border-box;
background-color : rgba(0, 0, 0, 0);
background-image : none;
background-origin : padding-box;
@christian-bromann
christian-bromann / my-feature.feature
Last active December 22, 2015 04:28
run WebdriverJS with Cucumber.js
Feature: Example feature
As a user of webdriverjs
I should be able to use different commands
to get informations about elements on the page
Scenario: Get size of an element
Given I go on the website "https://github.com/"
When I use getElementSize() on the element ".header-logo-wordmark"
Then I should get a width of "89" and height of "32"
@christian-bromann
christian-bromann / webdriverjs.with.vows.js
Created September 2, 2013 20:17
run WebdriverJS with Vows
var vows = require('vows'),
assert = require('assert'),
webdriverjs = require('webdriverjs'),
fs = require('fs');
var client;
// Create a Test Suite
vows.describe('my github tests').addBatch({
@christian-bromann
christian-bromann / webdriverjs.with.nodeunit.js
Created September 2, 2013 20:16
run WebdriverJS with NodeUnit
var webdriverjs = require('webdriverjs'),
assert = require('assert');
module.exports = {
setUp: function (callback) {
client = webdriverjs.remote({ desiredCapabilities: {browserName: 'phantomjs'} });
client.init();
callback();
@christian-bromann
christian-bromann / webdriverjs.with.mocha.js
Created September 2, 2013 20:15
run WebdriverJS with Mocha
var webdriverjs = require('webdriverjs'),
assert = require('assert');
describe('my webdriverjs tests', function(){
this.timeout(99999999);
var client = {};
before(function(){
client = webdriverjs.remote({ desiredCapabilities: {browserName: 'phantomjs'} });
@christian-bromann
christian-bromann / webdriverjs.with.mocha.and.chai.js
Created September 2, 2013 20:15
run WebdriverJS with Mocha and Chai
var chai = require('chai'),
assert = chai.assert,
expect = chai.expect,
webdriverjs = require('webdriverjs');
describe('my webdriverjs tests', function(){
this.timeout(99999999);
var client = {};
@christian-bromann
christian-bromann / webdriverjs.with.jasmine.spec.js
Created September 2, 2013 20:13
run WebdriverJS with Jasmine
var webdriverjs = require('webdriverjs');
describe('my webdriverjs tests', function() {
var client = {};
jasmine.DEFAULT_TIMEOUT_INTERVAL = 9999999;
beforeEach(function() {
client = webdriverjs.remote({ desiredCapabilities: {browserName: 'phantomjs'} });
client.init();