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 / 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 / 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 / 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 / test.js
Created November 12, 2014 00:41
new syntactic sugar for WebdriverIO commands
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 / WDIO.xunit.phantomjs.32442.xml
Created May 21, 2015 00:42
WebdriverIO example xunit report
<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 / expected.json
Created September 9, 2015 17:51
microsoftedge driver array/object bug
[{
"a": 1,
"b": 2
}, {
"c": 3,
"d": [1, 2, 3, 4, 5],
"e": [{
"some": "object",
"other": "thing"
}]
@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": {
@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 / 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 / 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',