Skip to content

Instantly share code, notes, and snippets.

View ddavison's full-sized avatar
💭
🇺🇸

Dj ddavison

💭
🇺🇸
View GitHub Profile
@ddavison
ddavison / test.java
Created March 19, 2015 12:46
WebElement caching?
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
/**
* @author ddavison
* @since Mar 18, 2015
*/
@ddavison
ddavison / disable_java.py
Created March 20, 2015 13:58
firefox profile disable java selenium
import os
from selenium import webdriver
fp = webdriver.FirefoxProfile()
fp.set_preference("extensions.blocklist.enabled",False)
browser = webdriver.Firefox(firefox_profile=fp)
@ddavison
ddavison / .gitconfig
Last active August 29, 2015 14:17
Git Commit Signoff
[remote "origin"]
url = <repo>
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
@ddavison
ddavison / gist:8deea7fcff0518a2ff98
Created April 16, 2015 22:35
Ron Swanson Government Quote
Government is a greedy piglet that suckles on a taxpayers teet until they have sore chapped nipples.
@ddavison
ddavison / doit.sh
Created April 24, 2015 16:53
Minimal setup for Selenium Grid
# Open 2 terminals.
# TERMINAL 1:
$ cd /path/to/selenium
$ ls
selenium-server-standalone.jar
$ java -jar selenium-server-standalone.jar -role hub
# TERMINAL 2:
$ cd /path/to/selenium
@ddavison
ddavison / gundebate
Last active August 29, 2015 14:20
debate
The perennial gun-control debate in America did not begin here.
The same arguments for and against were made in the 1920s in the chaos of Germany’s Weimar Republic, which opted for gun registration.
Law-abiding persons complied with the law, but the Communists and Nazis committing acts of political violence did not.
In 1931, Weimar authorities discovered plans for a Nazi takeover in which Jews would be denied food and persons refusing to surrender their guns within 24 hours would be executed. They were written by Werner Best, a future Gestapo official.
In reaction to such threats, the government authorized the registration of all firearms and the confiscation thereof, if required for “public safety.”
The interior minister warned that the records must not fall into the hands of any extremist group.
In 1933, the ultimate extremist group, led by Adolf Hitler, seized power and used the records to identify, disarm, and attack political opponents and Jews. Constitutional rights were suspended, and mass sear
// Create a super class, that all your tests will be based off of.
@Config(
url = "about:blank",
browser = Browser.CHROME
)
public class AutomationTest extends Locomotive {
public AutomationTest() {
baseUrl = TestEnvironment.getUrl();
[:hello, :test].each do |m|
define_method m do
puts 'these methods were created dynamically'
end
end
hello()
@ddavison
ddavison / run.sh
Created June 16, 2015 12:19
selenium crazy-fun run client tests
./go //java/client/test/org/openqa/selenium/remote:client-tests:run offline=true haltonerror=false haltonfailure=false log=true
use std::io;
fn main() {
println!("What's your name?");
let mut name = String::new();
io::stdin().read_line(&mut name)
.ok()
.expect("Failed to read line");