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 / 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();
@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.buster.js
Created September 2, 2013 20:12
run WebdriverJS with Buster.JS
var buster = require("buster"),
webdriverjs = require('webdriverjs');
buster.testCase("my webdriverjs tests", {
'setUp': function() {
this.timeout = 9999999;
client = webdriverjs.remote({ desiredCapabilities: {browserName: 'phantomjs'} });
client.init();
@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.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 / webdriver.js
Last active December 21, 2015 19:59
Use Webdriverjs with Browserstack (example)
var webdriverjs = require('../index'),
client = webdriverjs.remote({
host: 'hub.browserstack.com',
port: 80,
logLevel: 'silent',
desiredCapabilities: {
'browser': 'IE',
'browser_version': '7.0',
'os': 'Windows',
'os_version': 'XP',
@christian-bromann
christian-bromann / streetview.js
Last active December 16, 2015 06:39
enable keyboard accessibility of Google Maps in StreetView mode (APIv3) after page load
/**
* Google StreetView provides keyboard accessibility to navigate with the arrow keys.
* Unfortunately you have to click on the map manually beforehand to activate this.
* This script enables that automatically.
*
* @requires Google Maps API v3
*/
/**
@christian-bromann
christian-bromann / gist:5372928
Created April 12, 2013 15:35
activate keyboard bindings after page load on Google Maps APIv2
new GKeyboardHandler(map);
var mapContainer = document.getElementById("map_canvas");
GEvent.trigger(document, "click", {srcElement: mapContainer, target: mapContainer, nodeType: 1});
@christian-bromann
christian-bromann / Manifest.json
Created September 3, 2012 20:48
[Chrome Extension] Remove all cookie data
{
"manifest_version": 2,
"name": "MyExtension",
"version": "0.1",
"description": "My awesome chrome extension!",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "index.html"
},
"background": {