History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WTR-129
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Bret Pettichord
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Watir

Automatically wrap watir commands in a test case

Created: 17/Jan/07 09:16 PM   Updated: 31/Jan/07 08:07 PM
Component/s: None
Affects Version/s: None
Fix Version/s: Future

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Dependency
This issue Depends on:
WTR-126 Simple Block Syntax to make quick-scr... Trivial Closed
 
Relationship
 
This issue Relates to:
WTR-127 Make it easier to use write simple te... Major Open


 Description  « Hide
Simple test case

class MyTest < Watir::TestCase
    def my_test
      goto('http://www.google.com')
      text_field(:name, 'q').set 'ruby'
      button(:name, 'btnG').click
      assert(text.include? 'pickaxe')
    end
  end

Putting it all together

test1.rb:
      goto('http://www.google.com')
      text_field(:name, 'q').set 'ruby'
      button(:name, 'btnG').click
      assert(text.include? 'pickaxe')

test2.rb:
      goto('http://www.google.com')
      text_field(:name, 'q').set 'watir'
      button(:name, 'btnG').click
      assert(text.include? 'Holy Grail')

From the command line:
  > watir -t test*.rb

This would automatically run the tests, creating a testcase wrapper for each test and then executing the combined suite.

Reusing browsers between tests

The "automatic" test suites will reuse a browser between tests, blanking the window, and recreate it if necessary. This is really the best way to use Watir.
* Possibly provide option to close and reopen between tests, but this is hard to make reliable!



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.