Skip to content

Instantly share code, notes, and snippets.

View jarib's full-sized avatar

Jari Bakken jarib

View GitHub Profile
module Button
extend ElementHelper
add_specifier :tag_name => 'input', :types => %w[button submit image reset]
add_specifier :tag_name => 'button'
container_method :button
container_collection_method :buttons
end
@jarib
jarib / todo.markdown
Created October 11, 2009 15:34
WatirSpec results + todo

Discussion

  • [bug guard WTR-346] Should Image#{width,height,file_size} return String or Integer?
  • [bug guard WTR-347] {Button,Image}#src returns full path in IE, actual attribute in Celerity - add deviation guard? (This also affects the Image#file_created_date spec)
  • [deviation guard] Element#style returns actual style string on Celerity, calculated style in IE
  • [bug guard WTR-348] Browser#status does not return the value of window.status
  • [bug guard WTR-350] Element#to_s includes tag name in Celerity, not in Watir. Perhaps these should be changed anyway?
  • [bug guard WTR-351] Element.new raises ArgumentError with wrong message
  • [deviation guard] Div#text should return an empty string if the div is hidden. Or should it?
@jarib
jarib / cukeq.markdown
Created October 14, 2009 08:27
CukeQ notes

Interface

cukeq-master --broker «host:port» --report-to http://«host:port» --scm {svn,git}://«url»

cukeq-slave --broker «host:port»

Master

@jarib
jarib / ruby.js
Created October 14, 2009 08:35
ruby.js
/*
** ruby.js -- Ruby-style object extensions for JavaScript
** Copyright (c) 2006 Florian Gross <[email protected]>
** Copyright (c) 2007 Ralf S. Engelschall <[email protected]>
** Licensed under GPL <http://www.gnu.org/licenses/gpl.txt>
**
** This is derived from the Florian Gross' "ruby.js", version 0.4.0 as
** of 2005-09-05 from http://flgr.0x42.net/ruby.js/, which implements
** some of Ruby's standard library functions in JavaScript. It was
** reformatted and cleaned up (especially semicolons additions to allow
ptr = FFI::MemoryPointer.new(:pointer)
ptr.put_string(0, "some string") # => IndexError: Memory access offset=0 size=18 is out of bounds
require "rubygems"
require "java"
require "json"
require "rack"
require "thread"
Dir['build/*.jar'].each { |e| require e }
require "remote/common/lib/runtime/json-20080701.jar"
{
screen: "null",
"message":"Unable to locate element:
{
\"method\":\"id\",
\"selector\":\"nonexistant\"
}
\nSystem info: os.name: 'Mac OS X',
os.arch: 'x86_64',
os.version: '10.6.1',
When /^I search for "(.+?)"$/ do |keyword|
@site.action_for(context.vertical, context.sub_vertical, context.search_type).search keyword
end
Error: [Exception... "Component returned failure code: 0x80570018 (NS_ERROR_XPC_BAD_IID) [nsIJSCID.getService]" nsresult: "0x80570018 (NS_ERROR_XPC_BAD_IID)" location: "JS frame :: chrome://fxdriver/content/server.js :: anonymous :: line 35" data: no]
Source File: chrome://fxdriver/content/server.js
Line: 48
=============
#
# Which I guess is the cause of this:
class ...BlackListPage
text_field(:email) { @browser.text_field(:id, "emailField") }
button(:search) { @browser.button(:id, 'search') }
def fill(params = {})
self.email = params[:email]
search!
end