Skip to content

Instantly share code, notes, and snippets.

View ddavison's full-sized avatar
🌐
Working Remotely

Dj ddavison

🌐
Working Remotely
View GitHub Profile
@ddavison
ddavison / docker-compose.yml
Created February 20, 2017 20:11
Quick Start Docker
---
hub:
image: selenium/hub
ports:
- 4444:4444
chrome:
image: selenium/node-chrome
links:
- hub
firefox:
@ddavison
ddavison / dummy-web-server.py
Created February 3, 2016 19:37 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
package com.company.seleniumframework.functional;
import com.company.seleniumframework.AutomationTest;
import com.company.seleniumframework.Browser;
import com.company.seleniumframework.Config;
import org.junit.Test;
import org.openqa.selenium.By;
@Config(url="http://aviprobo.doorfree.com/control.html", browser= Browser.CHROME)
public class TextArea extends AutomationTest {
package com.company.seleniumframework.functional;
import com.company.seleniumframework.AutomationTest;
import com.company.seleniumframework.Browser;
import com.company.seleniumframework.Config;
import org.junit.Test;
import org.openqa.selenium.By;
@Config(url="https://collaboration.skype.com/promotion/?cm_mmc=AFCJ%7C1250_B1-_-11129583-1225267", browser= Browser.CHROME)
public class SkypeTest extends AutomationTest {
@ddavison
ddavison / test.md
Last active December 31, 2015 08:13

Hi there

This is an inline code block

This is a

public void JavaCodeBlock() {}
class Color
attr_reader :r, :g, :b
def initialize(r,g,b)
@r = r
@g = g
@b = b
end
def brightness_index
@ddavison
ddavison / MySite.java
Created October 3, 2013 16:41
This example shows a very common jUnit Selenium 2 test structure using the project at http://github.com/ddavison/getting-started-with-selenium
/**
* This tests My Site
*/
@Config(url="http://mysite.com", browser=CHROME)
public class TestMySite extends AutomationTest {
@Test
public void testSomething() {
click(By.linkText("something"))
.validateText(By.cssSelector("input"), "something");
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