<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 17, 2013 at 4:26 PM, Jeff Hall <span dir="ltr"><<a href="mailto:jhall@wikimedia.org" target="_blank">jhall@wikimedia.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I want to create a browser test (for Visual Editor) that will repro a single continuous session where the user makes multiple edits to the same page. As I understand it, Cucumber "Scenarios" each equate to a new user session, which is not what I want, so the alternative seems to be to construct a long, continuous scenario like the following:<br>
<br>
<br>
Scenario:<br>
Given I am logged in<br>
When I am at my user page<br>
And I click Edit for VisualEditor<br>
And I insert the text "My first edit. "<br>
And I click Save page<br>
And I click This is a minor edit<br>
And I click Review your changes<br>
And I click Return to save form<br>
And I click Save page the second time<br>
Then Page should contain My first edit.<br>
<br>
Given I click Edit for VisualEditor<br>
When I insert the text "My second edit. "<br>
And I click Save page<br>
And I click Save page another time<br>
Then Page should contain My second edit. My first edit.<br>
<br>
<and on and on...><br></blockquote><div><br></div><div>You can build compound steps out of other steps. I might suggest making a step like<br></div><div>When(/^I insert (.*)( as a minor edit)$/ do |text, minor_edit|<br>
</div><div> ruby code here that does what you want<br></div><div>or<br></div><div> step('When I am at my user page')<br></div><div> step('And I click Edit for VisualEditor')<br> ...<br></div><div>or<br>
steps %Q{<br></div><div> When I am at my user page<br></div><div> And I click Edit for VisualEditor<br></div><div> }<br>end<br><br></div><div>The second two implementations are somewhat debated. Some cucumber folks hate steps calling steps and some love it. I'm can see merit in both arguments.<br>
<br>Nik<br></div><div><br></div></div></div></div>