Project

watirspec

0.0
No commit activity in last 3 years
No release in over 3 years
Combines best features of Watir, RSpec and Ruby for browser-based functional testing.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

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