Skip to content

Instantly share code, notes, and snippets.

View jarib's full-sized avatar

Jari Bakken jarib

View GitHub Profile
require 'selenium-webdriver'
require 'rack'
require 'rack/handler/thin'
class IframeServer
def start
@pid = fork { Rack::Handler::Thin.run(self, :Port => 9292) }
poller = Selenium::WebDriver::SocketPoller.new("localhost", 9292, 30)
raise "could not start #{self.inspect}" unless poller.connected?
@jarib
jarib / gist:1065474
Created July 5, 2011 18:20 — forked from anonymous/gist:1065472
Patch to start creating a c++ main
Index: cpp/IEDriver/IEDriver.vcxproj
===================================================================
--- cpp/IEDriver/IEDriver.vcxproj (revision 12745)
+++ cpp/IEDriver/IEDriver.vcxproj (working copy)
@@ -25,26 +25,30 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <ConfigurationType>Application</ConfigurationType>
require "selenium-webdriver"
require "selenium/rspec/spec_helper" # where is this coming from? what does it do? (jari)
require "spec/test/unit" # this looks outdated - should just be require "rspec" (jari)
describe "base.sel" do
before(:all) do
@verification_errors = []
@driver = Selenium::WebDriver.for :firefox
@driver.manage.timeouts.implicit_wait = 30
<!DOCTYPE html>
<body>
<a id="js_button" class="no_event_fired">Click</a>
<a href="http://google.com">Link</a>
<script>
var el = document.getElementById( "js_button" );
el.addEventListener( "click", function() {
this.className = "addEventListener";
}, false);
</script>
Then /^I should be able to ssh to the Ubuntu server as the "([^"]*)" user$/ do |ssh_user|
Given 'I have the following public keys', table(%{
| keyfile |
| /root/.ssh/#{ssh_user}-test-key |
})
Then 'I can ssh to the following hosts with these credentials', table(%{
| hostname | username |
| 192.168.20.20 | #{ssh_user} |
})
end
module CrazyFunDotNet
class DotNetLibrary < Tasks
private
def reference_assemblies_dir()
@reference_assemblies_dir ||= (
program_files_dir = find_env(['ProgramFiles(x86)', 'programfiles(x86)', 'PROGRAMFILES(X86)'], "C:/Program Files (x86)")
unless File.exists? program_files_dir
program_files_dir = find_env(['ProgramFiles', 'programfiles', 'PROGRAMFILES'], "C:/Program Files")
require 'rubygems'
require 'watir-webdriver'
b = Watir::Browser.new(:firefox)
b.goto('http://mysite')
b.link(:text,'Where to go').click
puts 'See all tournaments, cause by default only then are shown'
b.link(:text,'see all').click
hrefs = b.links(:class, 'pn-title').map { |link| link.href }
hrefs.each do |href|
{:version=>"0.0.5.9"}
Mar 8, 2009 6:37:30 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Obsolete content type encountered: 'text/javascript'.
Mar 8, 2009 6:37:31 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Obsolete content type encountered: 'text/javascript'.
.Mar 8, 2009 6:37:35 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Obsolete content type encountered: 'text/javascript'.
Mar 8, 2009 6:37:37 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify
WARNING: Obsolete content type encountered: 'text/javascript'.
Mar 8, 2009 6:37:37 PM com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify