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>&nbsp; As registered user<br>
&nbsp; I want to log in<br>&nbsp; So I can use the application<br>&nbsp; <br>&nbsp; Scenario: user name and password are correct<br>&nbsp;&nbsp;&nbsp; Given my user name and password are correct<br>&nbsp;&nbsp;&nbsp; When I enter user name and password at login page and click login button<br>
&nbsp;&nbsp;&nbsp; I should be logged in<br><br><br><br>define.rb:<br><br>steps_for(:user) do<br>&nbsp; Given(&quot;my $username and $password are correct&quot;) do |username, password|<br>&nbsp;&nbsp;&nbsp; member = User.new(username, password)<br>&nbsp; end<br>
&nbsp; When(&quot;I enter $username and $password at login page and click login button&quot;) do |member|<br>&nbsp;&nbsp;&nbsp; member.log_in<br>&nbsp; end<br>&nbsp; Then(&quot;I should be logged in&quot;) do |member|<br>&nbsp;&nbsp;&nbsp; member.should be_logged_in<br>
&nbsp; end<br>end<br><br><br><br>run.rb:<br><br>with_steps_for :user do<br>&nbsp; run &#39;rspec&#39;<br>end<br><br><br><br>Ċ½eljko Filipin<br>-- <br>ZeljkoFilipin.com