<br><br><div class="gmail_quote">2008/5/27 aidy lewis <<a href="mailto:aidy.lewis@googlemail.com">aidy.lewis@googlemail.com</a>>:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
Could anyone please tell me how I can parametise and pass values to this story?<br>
</blockquote><div><br>How about?<br><br>[:chese, :monkey, :dragon].each do |special_site|<br> Story "Login to #{special_site} site",<br> %(As an #{special_site} user I want to login to my site to view available content) do<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Scenario "The user inputs a correct username and login \n" do<br>
Given "the username and the password is correct" do<br>
@browser_wrapper = BrowserWrapper.new</blockquote><div><br>@its_not_important_what_this_is_called = "#{special_site.to_s.capitalize}Website".constantize.new(@browser_wrapper.browser)<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
puts "probably need to abstract these to a setup method"</blockquote><div><br>@browser_wrapper.goto("<a href="http://xxx.ui.systest" target="_blank">http://#{special_site}.ui.systest</a>")<br><br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
end<br>
When "the user submits the login form" do</blockquote><div><br>@its_not_important_what_this_is_called.welcome_page.login("foo", "bar")<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
end<br>
end<br>
end<br>
<font color="#888888"></font></blockquote><div><br>Of course, that might not really be what you meant (and also might not work). Also worth noting is that the .constantize bit means you need activesupport - but there would be an easy way to do it without that requirement; I'm just lazy.<br>
<br>Muz<br><br></div></div>