Commit 5d13f48b authored by Steven Spinelli's avatar Steven Spinelli Committed by Robert Lyon
Browse files

Bug 1774504: behat test for Profile page can be shared publicly

updated script

Change-Id: I9258cc18ff48d3c360666c95b08ad916f76721fc
parent 05a22db6
......@@ -1304,6 +1304,29 @@ EOF;
$this->visitPath("/view/view.php?id={$view->id}");
}
/**
* Visit a Mahara Profile Page with the specified owner
*
* @Given /^I go to the profile page of "([^"]*)"$/
*/
public function i_go_to_profile_view($user) {
// Find the page's ID number
$views = get_records_sql_array("SELECT v.id FROM {view} v
JOIN {usr} u ON u.id = v.owner
WHERE (u.username = ? OR CONCAT(u.firstname, ' ', u.lastname) = ?)
AND v.type = ?", array($user, $user, 'profile'));
if (!$views) {
throw new Exception(sprintf('Invalid user name. No profile view found for "%s".', $user));
}
if (count($views) > 1) {
throw new Exception(sprintf('Invalid useer name. More than one profile view found for "%s".', $user));
}
$view = reset($views);
// success
$this->visitPath("/view/view.php?id={$view->id}");
}
/**
* Visit a Mahara group Page with the specified Group name
......
@javascript @core
Feature: Profile page can be shared publicly
As a user
I want to sahre my Portfolio pages on my public profile page
So that visitors can quickly browse to see them
Background:
Given the following "users" exist:
| username | password | email | firstname | lastname | institution | authname | role |
| UserA | Kupuh1pa! | UserA@example.org | Angela | User | mahara | internal | member |
And the following "pages" exist:
| title | description| ownertype | ownername |
| Page UserA_01 | Page 01 | user | UserA |
| Page UserA_02 | Page 01 | user | UserA |
| Page UserA_03 | Page 01 | user | UserA |
| Page UserA_04 | Page 01 | user | UserA |
| Page UserA_05 | Page 01 | user | UserA |
| Page UserA_06 | Page 01 | user | UserA |
| Page UserA_07 | Page 01 | user | UserA |
| Page UserA_08 | Page 01 | user | UserA |
| Page UserA_09 | Page 01 | user | UserA |
| Page UserA_10 | Page 01 | user | UserA |
| Page UserA_11 | Page 01 | user | UserA |
| Page UserA_12 | Page 01 | user | UserA |
Scenario: User checks pagination on profile page for shared portfolio pages
Given I log in as "UserA" with password "Kupuh1pa!"
And I choose "Shared by me" in "Portfolio" from main menu
# Edit access for Page UserA_01
And I click on "Edit access" in "Page UserA_01" row
And I set the select2 value "Page UserA_01, Page UserA_02, Page UserA_03, Page UserA_04, Page UserA_05, Page UserA_06, Page UserA_07, Page UserA_08, Page UserA_09, Page UserA_10, Page UserA_11, Page UserA_12" for "editaccess_views"
And I select "Public" from "accesslist[0][searchtype]"
And I press "Save"
And I click on "Edit access" in "Profile page" row
And I select "Public" from "accesslist[1][searchtype]"
And I press "Save"
And I log out
# Go to UserA's prrofile page when logged out
When I go to the profile page of "UserA"
Then I should see "Page UserA_01"
And I should not see "Page UserA_12"
When I jump to page "2" of the list "myviews_pagination"
Then I should see "Page UserA_11"
And I should not see "Page UserA_07"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment