<div dir="ltr"><div class="gmail_extra">On Wed, Aug 28, 2013 at 7:05 AM, Amir E. Aharoni <span dir="ltr"><<a href="mailto:amir.aharoni@mail.huji.ac.il" target="_blank">amir.aharoni@mail.huji.ac.il</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div id=":6qo" style="overflow:hidden">
It basically repeats the same tests for logged in and for anon users.<br>
Is there a more robust way to do it?</div></blockquote></div><br>One thing that comes to my mind is cucumber scenario outlines[1].</div><div class="gmail_extra"><br></div><div class="gmail_extra">So for example this two scenarios:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra"> Scenario: Page without interlanguage links has cog icon and language selector</div><div class="gmail_extra"> Given I am on a page without interlanguage links</div>
<div class="gmail_extra"> When I click the cog icon by Languages in the sidebar</div><div class="gmail_extra"> Then I see the anonymous Language Settings panel</div><div class="gmail_extra"><br></div><div class="gmail_extra">
<div class="gmail_extra"> Scenario: Page without interlanguage links has cog icon and language selector</div><div class="gmail_extra"> Given I am logged in<br></div><div class="gmail_extra"> And I am on a page without interlanguage links</div>
<div class="gmail_extra"> When I click the cog icon by Languages in the sidebar</div><div class="gmail_extra"> Then I see the Language Settings panel</div></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">
could be refactored like this:</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra"> Scenario Outline: Page without interlanguage links has cog icon and language selector</div><div class="gmail_extra">
Given I am <user></div><div class="gmail_extra"> And I am on a page without interlanguage links</div><div class="gmail_extra"> When I click the cog icon by Languages in the sidebar</div><div class="gmail_extra">
Then I see the <user> Language Settings panel</div><div class="gmail_extra"><br></div><div class="gmail_extra"> Examples:</div><div class="gmail_extra"> | user |</div><div class="gmail_extra"> | anonymous |<br>
</div><div class="gmail_extra"> | logged in |<br></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">Željko</div><div class="gmail_extra">--</div><div class="gmail_extra">1: <a href="https://github.com/cucumber/cucumber/wiki/Scenario-Outlines">https://github.com/cucumber/cucumber/wiki/Scenario-Outlines</a></div>
</div>