[QA] repeating tests for logged in and anon users

Željko Filipin zfilipin at wikimedia.org
Thu Aug 29 13:39:31 UTC 2013


On Wed, Aug 28, 2013 at 7:05 AM, Amir E. Aharoni <
amir.aharoni at mail.huji.ac.il> wrote:

> It basically repeats the same tests for logged in and for anon users.
> Is there a more robust way to do it?
>

One thing that comes to my mind is cucumber scenario outlines[1].

So for example this two scenarios:

  Scenario: Page without interlanguage links has cog icon and language
selector
    Given I am on a page without interlanguage links
    When I click the cog icon by Languages in the sidebar
    Then I see the anonymous Language Settings panel

  Scenario: Page without interlanguage links has cog icon and language
selector
    Given I am logged in
      And I am on a page without interlanguage links
    When I click the cog icon by Languages in the sidebar
    Then I see the Language Settings panel

could be refactored like this:

  Scenario Outline: Page without interlanguage links has cog icon and
language selector
    Given I am <user>
      And I am on a page without interlanguage links
    When I click the cog icon by Languages in the sidebar
    Then I see the <user> Language Settings panel

  Examples:
  | user |
  | anonymous |
  | logged in |

Željko
--
1: https://github.com/cucumber/cucumber/wiki/Scenario-Outlines
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wikimedia.org/pipermail/qa/attachments/20130829/bbaba777/attachment.html>


More information about the QA mailing list