New Behat step for visiting a specific view

Bug #1484361 reported by Aaron Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Aaron Wells
15.04
Fix Released
Medium
Aaron Wells
15.10
Fix Released
Medium
Aaron Wells

Bug Description

While writing a Behat test that requires placing comments by anonymous users on a portfolio page, I realized there is no easy way to visit a portfolio page while you're logged out.

For logged in users, I've been relying on the fact that the default Dashboard page includes the "latest views" block, which in normal test cases will show the small number of pages created for the test. But a logged-out user has no such dashboard. They need to get to the page directly by its URL. But we can't rely on the URL being the same every time because it contains an ID number, and MySQL doesn't reset the automatically assigned ID numbers back to 0 between each test.

So, what we need is a step like this:

Given I go to portfolio page "This is my page"

The step can then look up the page's ID, and send you to the correct URL.

Tags: behat
Revision history for this message
Aaron Wells (u-aaronw) wrote :

I considered adding authorship information as well (like "Given I go to portfolio page "hello" by user "user1"") but on further reflection, in a test case all the pages in the site have been created by the test and have known titles. So the only case where you'd need to identify the page by title & author is if you're writing a test and you specifically create multiple pages with the same title. That situation seems unlikely, so I'm not going to go to the extra effort of implementing it.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/5096

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5096
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/fba3c512fb2df015879d0168b54fa7122b6e7832
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit fba3c512fb2df015879d0168b54fa7122b6e7832
Author: Aaron Wells <email address hidden>
Date: Thu Aug 13 17:31:10 2015 +1200

New Behat Step for visiting a specific Portfolio page "bug 1484361"

Change-Id: I676a4c4c5bac56673e02bf6e0c95283edab54feb
behatnotneeded: Tested in subsequent patches

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "15.04_STABLE" branch: https://reviews.mahara.org/5097

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5097
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/cc352035594e5053bee11927baf34d994d07bc25
Submitter: Aaron Wells (<email address hidden>)
Branch: 15.04_STABLE

commit cc352035594e5053bee11927baf34d994d07bc25
Author: Aaron Wells <email address hidden>
Date: Thu Aug 13 17:31:10 2015 +1200

New Behat Step for visiting a specific Portfolio page "bug 1484361"

Change-Id: I676a4c4c5bac56673e02bf6e0c95283edab54feb
behatnotneeded: Tested in subsequent patches
(cherry picked from commit fba3c512fb2df015879d0168b54fa7122b6e7832)

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/5140

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.