I am using a cucumber with webrat / mechanize to test a PHP site, and I am trying to improve the speed of the tests by avoiding unnecessary steps.
I want to use a script scheme to check access to many pages depending on the user who has registered:
Scenario Outline: Check page access is secure Given I am logged in as "<user>" And I am on <page> Then I should see "<message>" Examples: |user |page |message | |admin |home page |Welcome to my site | |admin |admin page|Site administration | |editor|home page |Welcome to my site | |editor|admin page|Access denied | |guest |home page |Please login | |guest |admin page|Access denied | ...
This works, but given that I have 10 roles and hundreds of pages to check, there is a lot of overhead when starting the login step every time the outline works.
I am wondering if there is a way to start the login step once for each role and then visit each page in turn without having to log in every time. ie run "login, visit 1, visit 2, visit 3" instead of "login, visit 1, log in, visit 2, log in, visit 3".
I tried using interceptors and Background, but can't find an approach that works. Is it possible?
cucumber
simoncoggins
source share