Skip to content

Instantly share code, notes, and snippets.

View ddavison's full-sized avatar
🌐
Working Remotely

Dj ddavison

🌐
Working Remotely
View GitHub Profile
return String.format(
"[qa-id='%s[%d]'] [qa-class~='%s']," +
"[qa-id='%s[%d]'] [data-qa-class~='%s']," +
"[data-qa-id='%s[%d]'] [qa-class~='%s']," +
"[data-qa-id='%s[%d]'] [data-qa-class~='%s']," +
"[qa-class~='%s']:nth-of-type(%d) [qa-class~='%s']," +
"[qa-class~='%s']:nth-of-type(%d) [data-qa-class~='%s']," +
"[data-qa-class~='%s']:nth-of-type(%d) [qa-class~='%s']," +
"[data-qa-class~='%s']:nth-of-type(%d) [data-qa-class~='%s']," +
"[qa-class~='%s']:nth-child(%d) [qa-class~='%s']," +
@ddavison
ddavison / bookmarklet.js
Created September 4, 2015 13:54
Selenium CLA Quick-Check Bookmarklet
javascript:var n=prompt('Enter the username to check');if(n){location.href="https://github.com/seleniumhq/selenium/commits?author="+n}
require 'rails_helper'
LOG_NAME = 'spec'
LOG_FILE = "#{Rails.root}/log/spec.log"
describe 'DashboardLogger' do
let(:logger) { DashboardLogger.new LOG_NAME }
before(:each) {
begin
@ddavison
ddavison / gist:0a4dc970e6a93beeb34a
Created July 9, 2015 13:44
Selenium Commit Signoff
$ git fetch origin
$ git cherry-pick -s c168370237300fa9ce4babd8817654bf8a4aca3c
$ git pull --rebase origin master
$ git log
$ git push origin master
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");
@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
[:hello, :test].each do |m|
define_method m do
puts 'these methods were created dynamically'
end
end
hello()
// 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();
@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
@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