Executable specification of the Watir API
Ruby HTML JavaScript
Permalink
Failed to load latest commit information.
html
lib
.gitignore
LICENSE
README.markdown update urls for repo Aug 6, 2016
after_hooks_spec.rb updates for windows compatibility Aug 6, 2016
alert_spec.rb Update guards for firefox to use geckodriver Aug 1, 2016
area_spec.rb
areas_spec.rb
browser_spec.rb
button_spec.rb remove all mobile tags Aug 1, 2016
buttons_spec.rb
checkbox_spec.rb
checkboxes_spec.rb
collections_spec.rb
cookies_spec.rb
dd_spec.rb
dds_spec.rb
del_spec.rb Update to Ruby 2.0 May 26, 2015
dels_spec.rb Remove references to celerity Mar 27, 2016
div_spec.rb
divs_spec.rb Remove references to celerity Mar 27, 2016
dl_spec.rb
dls_spec.rb Remove references to celerity Mar 27, 2016
drag_and_drop_spec.rb
dt_spec.rb
dts_spec.rb
element_hidden_spec.rb
element_spec.rb update specs to reflect added label tags Sep 10, 2016
elements_spec.rb
em_spec.rb
ems_spec.rb
filefield_spec.rb
filefields_spec.rb
font_spec.rb Remove references to celerity Mar 27, 2016
form_spec.rb
forms_spec.rb
frame_spec.rb
frames_spec.rb
hidden_spec.rb
hiddens_spec.rb Remove references to celerity Mar 27, 2016
hn_spec.rb
hns_spec.rb Remove references to celerity Mar 27, 2016
iframe_spec.rb remove all mobile tags Aug 1, 2016
iframes_spec.rb Remove references to celerity Mar 27, 2016
image_spec.rb this method not supported by selenium Sep 13, 2016
images_spec.rb Remove references to celerity Mar 27, 2016
ins_spec.rb Update to Ruby 2.0 May 26, 2015
inses_spec.rb Remove references to celerity Mar 27, 2016
label_spec.rb remove spec guards for Firefox now that getAttribute is better suppor… Aug 23, 2016
labels_spec.rb
li_spec.rb
link_spec.rb
links_spec.rb Remove references to celerity Mar 27, 2016
lis_spec.rb Remove references to celerity Mar 27, 2016
map_spec.rb Update to Ruby 2.0 May 26, 2015
maps_spec.rb
meta_spec.rb Update to Ruby 2.0 May 26, 2015
metas_spec.rb Remove references to celerity Mar 27, 2016
ol_spec.rb Update to Ruby 2.0 May 26, 2015
ols_spec.rb
option_spec.rb
p_spec.rb
pre_spec.rb
pres_spec.rb
ps_spec.rb
radio_spec.rb
radios_spec.rb Remove references to celerity Mar 27, 2016
screenshot_spec.rb Change from RSpect should syntax to expect syntax. Also from == to eq… Oct 27, 2013
select_list_spec.rb Update guards for firefox to use geckodriver Aug 1, 2016
select_lists_spec.rb Remove references to celerity Mar 27, 2016
span_spec.rb
spans_spec.rb
spec_helper.rb Add SilentLogger to silence WEBrick once and for all. Closes #29. Jan 7, 2013
strong_spec.rb Update to Ruby 2.0 May 26, 2015
strongs_spec.rb Remove references to celerity Mar 27, 2016
table_nesting_spec.rb Update guards for firefox to use geckodriver Aug 1, 2016
table_spec.rb
tables_spec.rb
tbody_spec.rb
tbodys_spec.rb Remove references to celerity Mar 27, 2016
td_spec.rb remove spec guards for Firefox now that getAttribute is better suppor… Aug 23, 2016
tds_spec.rb
text_field_spec.rb
text_fields_spec.rb
textarea_spec.rb remove spec guards for Firefox now that getAttribute is better suppor… Aug 23, 2016
textareas_spec.rb
tfoot_spec.rb Update to Ruby 2.0 May 26, 2015
tfoots_spec.rb Remove references to celerity Mar 27, 2016
thead_spec.rb
theads_spec.rb
tr_spec.rb update urls for repo Aug 6, 2016
trs_spec.rb Remove references to celerity Mar 27, 2016
ul_spec.rb
uls_spec.rb Remove references to celerity Mar 27, 2016
wait_spec.rb
watirspec.rake
window_switching_spec.rb updates for windows compatibility Aug 6, 2016

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