Skip to content

Instantly share code, notes, and snippets.

View DylanLacey's full-sized avatar

The Gentlehacker DylanLacey

View GitHub Profile
@DylanLacey
DylanLacey / driver.rb
Created July 25, 2017 08:02
Appium Lib v9+ with Test Object
require "appium_lib"
def desired_capabilities
{
caps: {
# Required: Must be present to authenticate
"testobject_api_key": 'SOMETHING',
platformName: 'Android',
deviceName: 'LG Nexus 5X',
@DylanLacey
DylanLacey / Gemfile
Last active March 21, 2017 06:52
Demonstrate limited storage on Sauce Labs machines
source "https://www.rubygems.org"
gem "selenium-webdriver"
gem "net-http-persistent"
@DylanLacey
DylanLacey / sauce_helper.rb
Last active March 2, 2017 03:44
Prevent Capybara from opening sessions just to close them again
# Allow browser creation to be turned off when calling the 'browser' method.
# This lets us check if a browser has been created, without creating on in the
# process. Which is less gross then `instance_variable_get` IMO.
#
# Default of `true` means standard behavior still exists
module SauceBrowserCheck
def browser allow_creation: true
if (@browser || allow_creation)
super()
else
@DylanLacey
DylanLacey / env.rb
Last active February 17, 2017 02:46
Log Session ID
# REMOVE ME
# This is a hacky monkeypatch for diagnosing
# https://saucelabs.zendesk.com/agent/tickets/35719
# It isn't needed once that issue is resolved
# And is kinda gross. Dylan from Sauce is sorry for what he's done.
module RackSessionAccess
module Capybara
alias_method :original_set_rack_session, :set_rack_session
@DylanLacey
DylanLacey / blank.rb
Created January 28, 2017 01:20
Blank Selenium Skellington
##Blank Selenium Test
require "selenium/webdriver"
require 'selenium/webdriver/remote/http/persistent'
def un
ENV["SAUCE_USERNAME"]
end
def ak
puts `("platform=\"#{platform}\" browserName=\"#{browser}\" version=\"#{version}\" JUNIT_DIR=\"#{junit_dir}\" parallel_cucumber features -n 20")`
#!/bin/bash
defaults write com.apple.Safari WarnAboutFraudulentWebsites false
source "http://www.rubygems.org"
gem "selenium-webdriver"
@DylanLacey
DylanLacey / Gemfile
Last active October 4, 2017 09:14
Marionette Doesn't Like Expiry
source "https://www.rubygems.org"
gem "selenium-webdriver"
@DylanLacey
DylanLacey / loadimg.sh
Last active May 13, 2016 21:45
Load an image onto an Android emulator
#!/bin/bash
cd $ANDROID_HOME/platform-tools
echo `adb devices`
curl -O http://i.imgur.com/0H5GsQV.png
adb push 0H5GsQV.png /sdcard/Download
echo $ANDROID_HOME