Giter Club home page Giter Club logo

watirspec's Introduction

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

watirspec's People

Contributors

aderyabin avatar bret avatar durrantm avatar jarib avatar jarmo avatar jkotests avatar jondruse avatar l2g avatar mattparlane avatar p0deje avatar proppy avatar titusfortner avatar vladimirtcats avatar wincent avatar zeljkofilipin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.