Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Executable specification of the Watir API
Ruby HTML JavaScript
tree: 04c63a7f93

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
html
lib
.gitignore
LICENSE
README.markdown
area_spec.rb
areas_spec.rb
browser_spec.rb
button_spec.rb
buttons_spec.rb
checkbox_spec.rb
checkboxes_spec.rb
collections_spec.rb
cookies_spec.rb
dd_spec.rb
dds_spec.rb
del_spec.rb
dels_spec.rb
div_spec.rb
divs_spec.rb
dl_spec.rb
dls_spec.rb
drag_and_drop_spec.rb
dt_spec.rb
dts_spec.rb
element_spec.rb
em_spec.rb
ems_spec.rb
filefield_spec.rb
filefields_spec.rb
font_spec.rb
form_spec.rb
forms_spec.rb
frame_spec.rb
frames_spec.rb
hidden_spec.rb
hiddens_spec.rb
hn_spec.rb
hns_spec.rb
image_spec.rb
images_spec.rb
ins_spec.rb
inses_spec.rb
label_spec.rb
labels_spec.rb
li_spec.rb
link_spec.rb
links_spec.rb
lis_spec.rb
map_spec.rb
maps_spec.rb
meta_spec.rb
metas_spec.rb
modal_dialog_spec.rb
ol_spec.rb
ols_spec.rb
option_spec.rb
p_spec.rb
pre_spec.rb
pres_spec.rb
ps_spec.rb
radio_spec.rb
radios_spec.rb
select_list_spec.rb
select_lists_spec.rb
span_spec.rb
spans_spec.rb
spec_helper.rb
strong_spec.rb
strongs_spec.rb
table_nesting_spec.rb
table_spec.rb
tables_spec.rb
tbody_spec.rb
tbodys_spec.rb
td_spec.rb
tds_spec.rb
text_field_spec.rb
text_fields_spec.rb
textarea_spec.rb
tfoot_spec.rb
tfoots_spec.rb
thead_spec.rb
theads_spec.rb
tr_spec.rb
trs_spec.rb
ul_spec.rb
uls_spec.rb
watirspec.rake
window_switching_spec.rb

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.