Skip to content

Instantly share code, notes, and snippets.

@testingbot
testingbot / gist:3566237
Created September 1, 2012 07:09
ie rspec
require 'rspec'
require 'capybara/rspec'
require 'testingbot'
require 'testingbot/capybara'
TestingBot::config do |config|
config[:desired_capabilities] = { :browserName => "internet explorer", :version => 9, :platform => "WINDOWS" }
end
describe "People", :type => :request do
@testingbot
testingbot / gist:3491672
Created August 27, 2012 19:41
blacklist host
caps = {
:browserName => "firefox",
:platform => "WINDOWS",
:blacklist => 'www.chegg.com'
}
urlhub = "http://key:secret@hub.testingbot.com:4444/wd/hub"
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 120
@webdriver = Selenium::WebDriver.for :remote,:url => urlhub , :desired_capabilities => caps,:http_client => client
@testingbot
testingbot / python_parallel_webdriver.py
Created August 3, 2012 16:36
python parallel webdriver testing on testingbot
from threading import Thread
from selenium import webdriver
import time
API_KEY = "key"
API_SECRET = "secret"
def get_browser(caps):
return webdriver.Remote(
desired_capabilities=caps,
@testingbot
testingbot / gist:3172407
Created July 24, 2012 20:23
websockify.rb with SSL
--- a/other/websocket.rb
+++ b/other/websocket.rb
@@ -13,11 +13,12 @@ require 'stringio'
require 'digest/md5'
require 'digest/sha1'
require 'base64'
+require 'openssl'
class EClose < Exception
end
@testingbot
testingbot / gist:3085330
Created July 10, 2012 18:26
example click login
require "rubygems"
require 'testingbot'
gem "selenium-client"
gem "selenium-webdriver"
require "selenium-webdriver"
require "selenium/client"
caps = {
:browserName => "firefox",
:version => "13",
@testingbot
testingbot / gist:2919685
Created June 12, 2012 19:43
ipad capybara
require 'rspec'
require 'capybara/rspec'
require 'testingbot'
require 'testingbot/capybara'
TestingBot::config do |config|
config[:desired_capabilities] = { :browserName => "ipad", :platform => "MAC" }
end
describe "People", :type => :request do
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 120
@webdriver = Selenium::WebDriver.for :remote,:url => urlhub , :desired_capabilities => caps, :http_client => client
@webdriver.navigate.to "https://m.xoom.com/"
wait = Selenium::WebDriver::Wait.new(:timeout => 30)
wait.until { @webdriver.find_element(:link_text => "Log In").displayed? }
@testingbot
testingbot / gist:2771740
Created May 22, 2012 21:31
tunnel example
TestingBot::config do |config|
config[:host] = "localhost"
config[:port] = 4445
end
@testingbot
testingbot / gist:2721226
Created May 17, 2012 19:53
phpunit custom junit logger
phpunit.xml
------------------
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
backupGlobals="false"
colors="true">
<testsuites>
@testingbot
testingbot / gist:2593676
Created May 4, 2012 09:49
php send mail on failure
<?php
class SimpleTest extends PHPUnit_Extensions_TestingBotTestCase
{
protected function onNotSuccessfulTest(Exception $e)
{
mail("mail@mail.com", "Failed test", $e->getMessage());
parent::onNotSuccessfulTest($e);
}