Skip to content

Instantly share code, notes, and snippets.

View asciidisco's full-sized avatar
🏠
Working from home

Sebastian Golasch asciidisco

🏠
Working from home
View GitHub Profile
@asciidisco
asciidisco / gist:8731237
Last active August 29, 2015 13:55
Check existence of attributes with Dalek
test.execute(function () {
var nl = document.querySelectorAll(".menubar a[href]");
var as = Array.prototype.slice.call(nl);
as.foreach(function (el) {
var attr = el.getAttribute('data-tracking-id');
this.assert.ok((attr !== null), 'Attribute exists for:' + el.outerHTML);
}.bind(this))
})
// given that the Logout function looks something like this:
// contents of functions.js
module.exports = {
Logout: function (aVar, bVar, test) {
console.log('Im logging the 2nd argument, just for fun:', bVar);
test
.click('#logout' + aVar)
.done();
}
};
@asciidisco
asciidisco / iap.js
Created March 11, 2014 13:18
Integrated Appium Server
// using appium 0.9.something it was paossible to do this
// appium server (this file doesn't exist anymore)
var appium = require('appium/server');
// some args
var appiumArgs = {
app: null,
ipa: null,
quiet: true,
@asciidisco
asciidisco / dcu.js
Created March 28, 2014 17:25
Dalek/Chosen urghhh
'use strict';
module.exports = {
'Can fill out form': function (test) {
test.open('http://tentoring.com/')
.type('#name', 'Sebastian Golasch')
.type('#email', 'public@asciidisco.com')
.execute(function () {
// use "in Browser" javascript to select the items
@asciidisco
asciidisco / collect_links.js
Created March 30, 2014 23:15
This code is not tested, but at least should give you an inspiration on how to solve your issue.
Headline: Local Bower Registry
Description: As a developer, I want to be able to maintain & version private modules & dependencies in the frontend
Estimation: 8SP
Acceptance criteria:
∆ A local bower registry is up & running
∆ The registry can be accessed from the developer machine (onsite & from home office)
∆ The CI server can access the registry
∆ Modules can be uploaded
∆ Modules are stored in every version ever published
var myLoopedFn = function (test) {
test.open('http://google.de')
.click('#hugendubel')
.assert.text('#hugendubel', 'Steinlaus')
.wait(2000)
.assert.text('#hugendubel', 'Weinlaus')
.done();
};
var myObj = {};
// how to install/first steps http://dalekjs.com/pages/getStarted.html#install
// how to use it within grunt: https://www.npmjs.org/package/grunt-dalek
module.exports = {
'Can access the DOM': function (test) {
test.open('http://dalekjs.com/')
// the execute method executes JavaScript within a browser & also has
// full access to the DOM
.execute(function (message) {
// the "data" method is a simple wrapper around a key/value store

Keybase proof

I hereby claim:

  • I am asciidisco on github.
  • I am asciidisco (https://keybase.io/asciidisco) on keybase.
  • I have a public key whose fingerprint is 6522 51A3 ED08 44B6 F854 31BE C359 803B ACA6 CFD7

To claim this, I am signing this object: