Skip to content
Executable specification of the Watir API
Ruby HTML JavaScript
Find file
Failed to load latest commit information.
html Fix "c++" class name which is not a valid class name
lib Bind to port above 8180
.gitignore added tests for wait timer
LICENSE Bump year in copyright
README.markdown Update to Ruby 2.0
after_hooks_spec.rb updates for safari tests passing on mac
alert_spec.rb updates for safari tests passing on mac
area_spec.rb Update to Ruby 2.0
areas_spec.rb Update to Ruby 2.0
browser_spec.rb Fix typo
button_spec.rb Remove :needs_server labels from url requests that don't need a server
buttons_spec.rb Update to Ruby 2.0
checkbox_spec.rb Update to Ruby 2.0
checkboxes_spec.rb Update to Ruby 2.0
collections_spec.rb Update to Ruby 2.0
cookies_spec.rb updates for safari tests passing on mac
dd_spec.rb Update to Ruby 2.0
dds_spec.rb Update to Ruby 2.0
del_spec.rb Update to Ruby 2.0
dels_spec.rb Update to Ruby 2.0
div_spec.rb updates for safari tests passing on mac
divs_spec.rb Update to Ruby 2.0
dl_spec.rb Update to Ruby 2.0
dls_spec.rb Update to Ruby 2.0
drag_and_drop_spec.rb updates for safari tests passing on mac
dt_spec.rb Update to Ruby 2.0
dts_spec.rb Update to Ruby 2.0
element_spec.rb Remove :needs_server labels from url requests that don't need a server
elements_spec.rb Update to Ruby 2.0
em_spec.rb Update to Ruby 2.0
ems_spec.rb Update to Ruby 2.0
filefield_spec.rb Remove :needs_server labels from url requests that don't need a server
filefields_spec.rb Update to Ruby 2.0
font_spec.rb Update to Ruby 2.0
form_spec.rb updates for safari tests passing on mac
forms_spec.rb Update to Ruby 2.0
frame_spec.rb Remove :needs_server labels from url requests that don't need a server
frames_spec.rb Update to Ruby 2.0
hidden_spec.rb Update to Ruby 2.0
hiddens_spec.rb Update to Ruby 2.0
hn_spec.rb Make hn specs compatible with latest rspec
hns_spec.rb Make hn specs compatible with latest rspec
iframe_spec.rb Remove :needs_server labels from url requests that don't need a server
iframes_spec.rb Update to Ruby 2.0
image_spec.rb Remove :needs_server labels from url requests that don't need a server
images_spec.rb Update to Ruby 2.0
ins_spec.rb Update to Ruby 2.0
inses_spec.rb Update to Ruby 2.0
label_spec.rb Update to Ruby 2.0
labels_spec.rb Update to Ruby 2.0
li_spec.rb Update to Ruby 2.0
link_spec.rb Update to Ruby 2.0
links_spec.rb Update to Ruby 2.0
lis_spec.rb Update to Ruby 2.0
map_spec.rb Update to Ruby 2.0
maps_spec.rb Update to Ruby 2.0
meta_spec.rb Update to Ruby 2.0
metas_spec.rb Update to Ruby 2.0
modal_dialog_spec.rb Update to Ruby 2.0
ol_spec.rb Update to Ruby 2.0
ols_spec.rb Update to Ruby 2.0
option_spec.rb change to identify as textarea
p_spec.rb Update to Ruby 2.0
pre_spec.rb Update to Ruby 2.0
pres_spec.rb Fix "c++" class name which is not a valid class name
ps_spec.rb Update to Ruby 2.0
radio_spec.rb Update to Ruby 2.0
radios_spec.rb Update to Ruby 2.0
screenshot_spec.rb Change from RSpect should syntax to expect syntax. Also from == to eq…
select_list_spec.rb Select list now raises when selecting disabled option
select_lists_spec.rb Update to Ruby 2.0
span_spec.rb Update to Ruby 2.0
spans_spec.rb Update to Ruby 2.0
spec_helper.rb Add SilentLogger to silence WEBrick once and for all. Closes #29.
strong_spec.rb Update to Ruby 2.0
strongs_spec.rb Update to Ruby 2.0
table_nesting_spec.rb Update to Ruby 2.0
table_spec.rb Update to Ruby 2.0
tables_spec.rb Update to Ruby 2.0
tbody_spec.rb Update to Ruby 2.0
tbodys_spec.rb Update to Ruby 2.0
td_spec.rb Update to Ruby 2.0
tds_spec.rb Update to Ruby 2.0
text_field_spec.rb Update to Ruby 2.0
text_fields_spec.rb Update to Ruby 2.0
textarea_spec.rb Update to Ruby 2.0
textareas_spec.rb Update to Ruby 2.0
tfoot_spec.rb Update to Ruby 2.0
tfoots_spec.rb Update to Ruby 2.0
thead_spec.rb Update to Ruby 2.0
theads_spec.rb Update to Ruby 2.0
tr_spec.rb Update to Ruby 2.0
trs_spec.rb Update to Ruby 2.0
ul_spec.rb Update to Ruby 2.0
uls_spec.rb Update to Ruby 2.0
wait_spec.rb Spec for chaining when_* decorators
watirspec.rake Merge branch 'master' into watir2
window_switching_spec.rb address race conditions with windows

README.markdown

What

This repository is intended to be used as a git submodule for projects that want to implement Watir's API.

The specs run a small Sinatra webapp (WatirSpec::Server) to simulate interacting with a web server. However, most specs use the file:// scheme to avoid hitting the server.

How to use

First add the submodule to spec/watirspec:

$ git submodule add git://github.com/watir/watirspec.git spec/watirspec

The specs will look for implementation.rb in its parent directory (i.e. spec/). In this file you need to define some details about your implementation that WatirSpec needs to know

Here's an example of what spec/implementation.rb would look like for the imaginary implementation AwesomeWatir:

$LOAD_PATH.unshift(«lib folder»)
require "awesomewatir"

include AwesomeWatir::Exception # needed for now..

WatirSpec::Implementation do |imp|
  imp.name = :awesome

  imp.browser_class = AwesomeWatir::Browser
  imp.browser_args  = [some: 'option']
end

WatirSpec.persistent_browser = false               # defaults to true, but can be disabled if needed
WatirSpec::Server.autorun    = false               # defaults to true, but can be disabled if needed

WatirSpec::Server.get("/my_route") { "content" }   # add routes to the server for implementation-specific specs

Implementation-specific specs should be placed at the root of the spec/ folder. To use the setup code from watirspec, simply require "watirspec/spec_helper" (which in turn will load your spec/spec_helper.rb).

Guards

WatirSpec includes a system to guard specs that are failing.

WRITE ME

Where

Something went wrong with that request. Please try again.