I want to use story framework for driving my (functional) Watir tests. I want to start with something simple, like logging in. I had an hour today to try it, and I did not get very far. (I have found <a href="http://rspec.info/documentation/stories.html">http://rspec.info/documentation/stories.html</a> and I will take a look at it tomorrow.)<br>
<br>I have found basic information about story framework at <a href="http://rspec.info">rspec.info</a> and modified example from there. Am I on the right track?<br><br>login.txt:<br><br>Story: login user<br> As registered user<br>
I want to log in<br> So I can use the application<br> <br> Scenario: user name and password are correct<br> Given my user name and password are correct<br> When I enter user name and password at login page and click login button<br>
I should be logged in<br><br><br><br>define.rb:<br><br>steps_for(:user) do<br> Given("my $username and $password are correct") do |username, password|<br> member = User.new(username, password)<br> end<br>
When("I enter $username and $password at login page and click login button") do |member|<br> member.log_in<br> end<br> Then("I should be logged in") do |member|<br> member.should be_logged_in<br>
end<br>end<br><br><br><br>run.rb:<br><br>with_steps_for :user do<br> run 'rspec'<br>end<br><br><br><br>Ċ½eljko Filipin<br>-- <br>ZeljkoFilipin.com