Skip to content

Instantly share code, notes, and snippets.

View klamping's full-sized avatar

Kevin Lamping klamping

View GitHub Profile
@klamping
klamping / wdio.conf.js
Last active June 28, 2018 21:16
Pass in local browser names via command line `wdio --caps=chrome,firefox`
const argv = require('yargs').argv;
let capabilities = [
{
browserName: 'chrome',
},
{
browserName: 'firefox',
},
{
@klamping
klamping / 0-ElevatorPitch.md
Last active May 8, 2018 13:17
Collaborating with Front-end Developers using WebdriverIO

Can you turn front-end developers in to front-end testers? Pairing up with your front-end teammates promotes functional testing through all phases of development. And, by writing your tests using WebdriverIO, your front-end team will find test writing fun and intuitive.

@klamping
klamping / commands.js
Last active April 10, 2023 14:27
Adding custom WebdriverIO commands from a external file (note 'before' hook on line 168 of conf file)
module.exports = {
getUrlAndTitle: function (customVar) {
return {
url: this.getUrl(),
title: this.getTitle(),
customVar: customVar
};
},
otherCommand: function () {
// do something else
@klamping
klamping / wdio.conf.js
Created March 15, 2018 16:27
WDIO BaseURL Customization
// This is the base wdio.conf.js file with all your commong configs
exports.config = {
specs: [
'./test/specs/**/*.js'
],
capabilities: [{
browserName: 'firefox'
}],
// ... more configs here ...
@klamping
klamping / upload.js
Created February 21, 2018 22:32
Sauce Labs Node.js Upload Script
const path = require('path');
const sync = require('synchronize');
const request = require('request');
const fs = require('fs');
const { APP_PATH, SAUCE_USERNAME, SAUCE_ACCESS_KEY } = process.env;
const authToken = Buffer(`${SAUCE_USERNAME}:${SAUCE_ACCESS_KEY}`).toString(
'base64'
);
@klamping
klamping / version-1.js
Created May 9, 2017 00:26
wdio.conf.js extend options
// require prod configuration
var prodConfig = require('./wdio.conf.js').config;
// Custom properties
var localConfig = {
capabilities: [{
browserName: 'chrome'
}],
baseUrl: 'http://localhost:8303'
services: ['selenium-standalone']
@klamping
klamping / events.md
Last active October 11, 2016 19:03
KEEN Events Setup

Event Categories:

/wp-admin/edit-tags.php?taxonomy=tribe_events_cat&post_type=tribe_events&paged=1

  • Should have single "Featured" category

Events Settings:

General: /wp-admin/edit.php?post_type=tribe_events&page=tribe-common

@klamping
klamping / homepage.js
Created August 24, 2016 17:49
WebdriverIO Wednesday #1
var assert = require('assert');
var request = require('request');
describe('webdriver.io page', function() {
it('should have the right title', function () {
browser.url('/');
var title = browser.getTitle();
assert.equal(title, 'WebdriverIO - Selenium 2.0 javascript bindings for nodejs');
});
@klamping
klamping / proposal.md
Last active June 27, 2016 14:27
Automated UI Testing Proposal

Talk Title: We need a better way to test

Description:

Testing can be a real pain! Isn't it good enough that it looks fine in Chrome? Should I really have to test the login page for a change to the contact form?

As a front-end dev, I've lazily assumed that testing is the realm of QA. Sure, I'll begrudgingly check my site in IE to see how much repair it needs, but I confess to cutting corners when testing and saying "That shouldn't break anything..."

This worked okay while I was building small sites, but now that I'm working with multiple teams on large projects, cutting corners doesn't work. The edge case always comes in to play and things that probably won't break do.

@klamping
klamping / wdio.conf.js
Created June 10, 2016 02:13
Hook and retries
module.exports = {
//
// Framework to run your tests with.
framework: "mocha",
//
// Options to be passed to Mocha.
// See the full list at http://mochajs.org/
mochaOpts: {
ui: "bdd",
timeout: 270000,