-
Notifications
You must be signed in to change notification settings - Fork 3
Commands
MauravdL edited this page Sep 13, 2010
·
14 revisions
The following commands can be used in tests or in script\console
-
browser– access the browser -
goto url– go to a url; url is relative to the base url. -
site.config[:url]– returns the base url of the environment (see also Configuration Options)
These are two different ways of doing the same thing:
browser.goto site.config[:url] goto ''
In addition, you can access any page; e.g. home_page will return an instance of HomePage. See Pages
These commands will work in any “execution context”. WatirCraft supplies several execution contexts:
- Inside an
itblock in an Rspec test - Inside a
beforeorafterblock in an Rspec test - Inside a step definition for a Cucumber test
- At the script\console prompt (after
irb START) - Inside your
initialize_browsermethod definition for your Site. - Inside a project method