Commit d00758b1 authored by Robert Lyon's avatar Robert Lyon

Bug 1465462: more behat fixes - this time in group section

Change-Id: I70974af717a97d838b60ff9289d68a74a94e8789
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 1a877ebe
......@@ -61,7 +61,7 @@ var Paginator = function(id, datatable, heading, script, extradata) {
};
this.rewritePaginatorLinks = function() {
forEach(getElementsByTagAndClassName('span', 'pagination', self.id), function(i) {
forEach(getElementsByTagAndClassName('li', null, self.id), function(i) {
var a = getFirstElementByTagAndClassName('a', null, i);
// If there is a link
......
......@@ -69,7 +69,7 @@ class BehatGeneral extends BehatBase {
public function i_logout() {
return array(
new Given('I wait until the page is ready'),
new When('I follow "Logout" in the "//div[@id=\'header\']//li[contains(concat(\' \', normalize-space(@class), \' \'), \' btn-logout \')]" "xpath_element"'),
new When('I follow "Logout" in the "//header//li[contains(concat(\' \', normalize-space(@class), \' \'), \' btn-logout \')]" "xpath_element"'),
);
}
......
......@@ -39,8 +39,8 @@ class BehatView extends BehatBase {
'The block "' . $blocktitle . '"');
$xpath = "//div[@id='column-container']"
. "//div[contains(concat(' ', normalize-space(@class), ' '), concat(' ', 'blockinstance', ' '))]"
. "//div[contains(concat(' ', normalize-space(@class), ' '), concat(' ', 'blockinstance-header', ' '))]"
. "/h2[normalize-space(.)=" . $nodetextliteral . "]";
. "//span[contains(concat(' ', normalize-space(@class), ' '), concat(' ', 'blockinstance-header', ' '))]"
. "[normalize-space(.)=" . $nodetextliteral . "]";
$titlenode = $this->find('xpath', $xpath, $exception);
$blocknode = $titlenode->getParent()->getParent();
......@@ -56,10 +56,10 @@ class BehatView extends BehatBase {
public function i_configure_block($blocktitle) {
$block = $this->get_block($blocktitle);
$exception = new ElementNotFoundException($this->getSession(),
'The configuration div of block "' . $blocktitle . '"');
'The configuration span of block "' . $blocktitle . '"');
$blockconfigbutton = $this->find('xpath',
"/div[contains(concat(' ', normalize-space(@class), ' '), concat(' ', 'blockinstance-controls', ' '))]"
. "/input[contains(concat(' ', normalize-space(@class), ' '), concat(' ', 'configurebutton', ' '))]",
"//span[contains(concat(' ', normalize-space(@class), ' '), concat(' ', 'blockinstance-controls', ' '))]"
. "//button[contains(concat(' ', normalize-space(@class), ' '), concat(' ', 'configurebutton', ' '))]",
$exception,
$block
);
......@@ -75,10 +75,10 @@ class BehatView extends BehatBase {
public function i_delete_block($blocktitle) {
$block = $this->get_block($blocktitle);
$exception = new ElementNotFoundException($this->getSession(),
'The configuration div of block "' . $blocktitle . '"');
'The configuration span of block "' . $blocktitle . '"');
$blockconfigbutton = $this->find('xpath',
"/div[contains(concat(' ', normalize-space(@class), ' '), concat(' ', 'blockinstance-controls', ' '))]"
. "/input[contains(concat(' ', normalize-space(@class), ' '), concat(' ', 'deletebutton', ' '))]",
"//span[contains(concat(' ', normalize-space(@class), ' '), concat(' ', 'blockinstance-controls', ' '))]"
. "//button[contains(concat(' ', normalize-space(@class), ' '), concat(' ', 'deletebutton', ' '))]",
$exception,
$block
);
......
......@@ -11,7 +11,7 @@
{/if}
<td class="narrow">
{if $membership && (!$forum->subscribed || $moderator)}
<input type="checkbox" name="checked[{$topic->id}]" class="topic-checkbox mtl">
<input type="checkbox" name="checked[{$topic->id}]" id="topic_{$topic->id}" class="topic-checkbox mtl">
{/if}
</td>
<td class="topic">
......@@ -27,9 +27,11 @@
{/if}
</div>
<h3 class="title text-inline">
{if $membership && (!$forum->subscribed || $moderator)}<label for="topic_{$topic->id}">{/if}
<a href="{$WWWROOT}interaction/forum/topic.php?id={$topic->id}">
{$topic->subject}
</a>
{if $membership && (!$forum->subscribed || $moderator)}</label>{/if}
<span class="metadata text-small">
{str tag=by section=view}
<a href="{profile_url($topic->poster)}" class="forumuser{if in_array($topic->poster, $groupadmins)} groupadmin{elseif $topic->moderator} moderator{/if}">
......
......@@ -25,7 +25,7 @@
<div class="btn-action-list">
<div class="groupuserstatus text-right btn-top-right btn-group btn-group-top">
{if $viewid}
<a href="{$WWWROOT}view/blocks.php?id={$viewid}&{$group->id}" title="{str tag=editcontentandlayout section='view'}" class="btn btn-default">
<a href="{$WWWROOT}view/blocks.php?id={$viewid}&group={$group->id}" title="{str tag=editcontentandlayout section='view'}" class="btn btn-default">
<span class="icon icon-pencil icon-lg text-default"></span>
<span class="btn-title pls hide-small">{str tag=editthisview section='view'}</span>
</a>
......
......@@ -43,19 +43,19 @@ Scenario: Creating groups and deleting them (Selenium)
# Deleting groups and verifying they are deleted
Then I follow "Groups"
And I follow "Admin Test Group"
And I follow "Delete group"
And I follow "Delete \"Admin Test Group\""
And I press "Yes"
And I should see "Group deleted successfully"
And I follow "Controlled groups"
And I follow "Delete group"
And I follow "Delete \"Controlled groups\""
And I press "Yes"
And I should see "Group deleted successfully"
And I follow "Admin VIP Group"
And I follow "Delete group"
And I follow "Delete \"Admin VIP Group\""
And I press "Yes"
And I should see "Group deleted successfully"
And I follow "Public discussion"
And I follow "Delete group"
And I follow "Delete \"Public discussion\""
And I press "Yes"
And I should see "Group deleted successfully"
# Verifying none of the deleted groups can be seen
......
......@@ -41,6 +41,6 @@ Scenario: Create groups and limit display on profile page (Bug 1426983)
And I set the following fields to these values:
| Maximum number of groups to display | 3 |
And I press "Save"
And I follow "Display page"
And I follow "Portfolio"
And I follow "Profile page"
And I should see "11 groups"
......@@ -31,7 +31,7 @@ Scenario: Uploading groups via CSV and editing as an admin (Bug 1420590)
And I follow "Groups"
And I follow "Group Two"
# Editing the group
And I follow "Edit group"
And I follow "Edit \"Group Two\" Settings"
And I fill in the following:
| Group name | Group awesome sauce |
Then I press "Save group"
......@@ -53,7 +53,7 @@ Scenario: Uploading groups via CSV and editing as an admin (Bug 1420590)
And I follow "Groups"
And I follow "group 01"
# Editing the group
And I follow "Edit group"
And I follow "Edit \"group 01\" Settings"
And I fill in the following:
| Group name | Group awesome sauce |
Then I press "Save group"
......@@ -67,4 +67,4 @@ Scenario: Uploading groups via CSV and editing as an admin (Bug 1420590)
And I follow "Groups"
And I follow "Group awesome sauce"
# Making sure I cant edit a group I am not owner of
And I should not see "Edit group"
And I should not see "Edit this page"
......@@ -98,62 +98,64 @@ These list must take into account the sort option choosen in the block config (B
And I should see "Group Z"
And I follow "Group Z"
# Group pages
And I should see "Page Group Z_01" in the "div#groupviewlist" "css_element"
And I should see "Page Group Z_05" in the "div#groupviewlist" "css_element"
And I should not see "Page Group Z_06" in the "div#groupviewlist" "css_element"
And I follow "Next" in the "div#groupviews_pagination" "css_element"
And I should see "Page Group Z_06" in the "div#groupviewlist" "css_element"
And I should see "Page Group Z_08" in the "div#groupviewlist" "css_element"
And I should not see "Page Group Z_05" in the "div#groupviewlist" "css_element"
And I should see "Page Group Z_01" in the "ul#groupviewlist" "css_element"
And I should see "Page Group Z_05" in the "ul#groupviewlist" "css_element"
And I should not see "Page Group Z_06" in the "ul#groupviewlist" "css_element"
And I follow "Next page" in the "div#groupviews_pagination" "css_element"
And I should see "Page Group Z_06" in the "ul#groupviewlist" "css_element"
And I should see "Page Group Z_08" in the "ul#groupviewlist" "css_element"
And I should not see "Page Group Z_05" in the "ul#groupviewlist" "css_element"
# Shared pages
And I should see "Page userA_01" in the "div#sharedviewlist" "css_element"
And I should see "Page userA_05" in the "div#sharedviewlist" "css_element"
And I should not see "Page userB_01" in the "div#sharedviewlist" "css_element"
And I should see "Page userA_01" in the "ul#sharedviewlist" "css_element"
And I should see "Page userA_05" in the "ul#sharedviewlist" "css_element"
And I should not see "Page userB_01" in the "ul#sharedviewlist" "css_element"
And I follow "2" in the "div#sharedviews_pagination" "css_element"
And I should see "Page userB_01" in the "div#sharedviewlist" "css_element"
And I should see "Page userB_05" in the "div#sharedviewlist" "css_element"
And I should not see "Page userA_05" in the "div#sharedviewlist" "css_element"
And I should not see "Page userB_06" in the "div#sharedviewlist" "css_element"
And I should see "Page userB_01" in the "ul#sharedviewlist" "css_element"
And I should see "Page userB_05" in the "ul#sharedviewlist" "css_element"
And I should not see "Page userA_05" in the "ul#sharedviewlist" "css_element"
And I should not see "Page userB_06" in the "ul#sharedviewlist" "css_element"
And I follow "3" in the "div#sharedviews_pagination" "css_element"
And I should see "Page userB_06" in the "div#sharedviewlist" "css_element"
And I should see "Page userB_07" in the "div#sharedviewlist" "css_element"
And I should not see "Page userA_01" in the "div#sharedviewlist" "css_element"
And I should not see "Page userB_01" in the "div#sharedviewlist" "css_element"
And I should see "Page userB_06" in the "ul#sharedviewlist" "css_element"
And I should see "Page userB_07" in the "ul#sharedviewlist" "css_element"
And I should not see "Page userA_01" in the "ul#sharedviewlist" "css_element"
And I should not see "Page userB_01" in the "ul#sharedviewlist" "css_element"
# Shared collections
And I should see "Collection userA_01" in the "div#sharedcollectionlist" "css_element"
And I should see "Collection userA_05" in the "div#sharedcollectionlist" "css_element"
And I should not see "Collection userA_06" in the "div#sharedcollectionlist" "css_element"
And I should see "Collection userA_01" in the "ul#sharedcollectionlist" "css_element"
And I should see "Collection userA_05" in the "ul#sharedcollectionlist" "css_element"
And I should not see "Collection userA_06" in the "ul#sharedcollectionlist" "css_element"
And I follow "2" in the "div#sharedcollections_pagination" "css_element"
And I should see "Collection userA_06" in the "div#sharedcollectionlist" "css_element"
And I should not see "Collection userA_05" in the "div#sharedcollectionlist" "css_element"
And I should see "Collection userA_06" in the "ul#sharedcollectionlist" "css_element"
And I should not see "Collection userA_05" in the "ul#sharedcollectionlist" "css_element"
And I log out
# Change the sort options in the "Group pages" block
Given I log in as "userA" with password "Password1"
And I should see "Group Z"
And I follow "Group Z"
And I follow "Pages" in the "ul.in-page-tabs" "css_element"
And I click on "Edit content and layout" in "Group homepage" row
And I follow "Pages" in the "ul.nav-inpage" "css_element"
And I click on "Edit \"Group homepage\""
And I configure the block "Group pages"
And I wait "1" seconds
And I select "Most recently updated" from "Sort group pages by"
And I select "Most recently updated" from "Sort shared pages and collections by"
And I select "Most recently submitted" from "Sort submitted pages and collections by"
And I press "Save"
And I follow "Display page"
# Update the group page "Page Group Z_06"
And I follow "Pages" in the "ul.in-page-tabs" "css_element"
And I click on "Edit content and layout" in "Page Group Z_06" row
And I follow "Pages" in the "ul.nav-inpage" "css_element"
And I click on "Edit \"Page Group Z_06\""
And I follow "Edit title and description"
And I set the field "Page description" to "<p>Group page 06 (updated)</p>"
And I press "Save"
And I follow "Display page"
# Check if it is now in the first page of the list of group pages
And I follow "About" in the "ul.in-page-tabs" "css_element"
And I should see "Page Group Z_06" in the "div#groupviewlist" "css_element"
And I follow "Groups"
And I follow "Group Z"
And I should see "Page Group Z_06" in the "ul#groupviewlist" "css_element"
And I follow "Next" in the "div#groupviews_pagination" "css_element"
And I should not see "Page Group Z_06" in the "div#groupviewlist" "css_element"
And I should not see "Page Group Z_06" in the "ul#groupviewlist" "css_element"
# Update the shared page "Page userA_01"
And I choose "Portfolio"
And I click on "Edit content and layout" in "Page userA_01" row
And I click on "Edit \"Page userA_01\""
And I follow "Edit title and description"
And I set the field "Page description" to "<p>This is the page 01 (updated)</p>"
And I press "Save"
......@@ -161,22 +163,22 @@ These list must take into account the sort option choosen in the block config (B
# Check if it is now in the first page of the list of shared pages
And I choose "Groups"
And I follow "Group Z"
And I should see "Page userA_01" in the "div#sharedviewlist" "css_element"
And I should see "Page userA_01" in the "ul#sharedviewlist" "css_element"
And I follow "2" in the "div#sharedviews_pagination" "css_element"
And I should not see "Page userA_01" in the "div#sharedviewlist" "css_element"
And I should not see "Page userA_01" in the "ul#sharedviewlist" "css_element"
And I follow "3" in the "div#sharedviews_pagination" "css_element"
And I should not see "Page userA_01" in the "div#sharedviewlist" "css_element"
And I should not see "Page userA_01" in the "ul#sharedviewlist" "css_element"
# Update the shared collection "Collection userA_06"
And I choose "Collections" in "Portfolio"
And I click on "Edit title and description" in "Collection userA_06" row
And I click on "Edit \"Collection userA_06\""
And I set the field "Collection description" to "This is the collection 06 (updated)"
And I press "Save"
# Check if it is now in the first page of the list of shared collections
And I choose "Groups"
And I follow "Group Z"
And I should see "Collection userA_06" in the "div#sharedcollectionlist" "css_element"
And I should see "Collection userA_06" in the "ul#sharedcollectionlist" "css_element"
And I follow "2" in the "div#sharedcollections_pagination" "css_element"
And I should not see "Collection userA_06" in the "div#sharedcollectionlist" "css_element"
And I should not see "Collection userA_06" in the "ul#sharedcollectionlist" "css_element"
# Submit some pages and collections to the group "Group Z"
And I select "Page userA_01" from "group_view_submission_form_2_options"
And I press "Submit"
......@@ -210,12 +212,12 @@ These list must take into account the sort option choosen in the block config (B
# Check the list of submitted pages/collections
Given I log in as "userA" with password "Password1"
And I follow "Group Z"
And I should see "Page userB_02" in the "div#allsubmissionlist" "css_element"
And I should see "Page userB_01" in the "div#allsubmissionlist" "css_element"
And I should see "Collection userA_03" in the "div#allsubmissionlist" "css_element"
And I should not see "Page userA_03" in the "div#allsubmissionlist" "css_element"
And I should see "Page userB_02" in the "ul#allsubmissionlist" "css_element"
And I should see "Page userB_01" in the "ul#allsubmissionlist" "css_element"
And I should see "Collection userA_03" in the "ul#allsubmissionlist" "css_element"
And I should not see "Page userA_03" in the "ul#allsubmissionlist" "css_element"
And I follow "2" in the "div#allsubmitted_pagination" "css_element"
And I should see "Page userA_03" in the "div#allsubmissionlist" "css_element"
And I should see "Page userA_01" in the "div#allsubmissionlist" "css_element"
And I should not see "Page userB_02" in the "div#allsubmissionlist" "css_element"
And I should see "Page userA_03" in the "ul#allsubmissionlist" "css_element"
And I should see "Page userA_01" in the "ul#allsubmissionlist" "css_element"
And I should not see "Page userB_02" in the "ul#allsubmissionlist" "css_element"
And I log out
\ No newline at end of file
......@@ -16,13 +16,13 @@ Scenario: Moving pages within a group (Bug 1426983)
| Group name | Testing Group 1 |
And I press "Save group"
# Creating a forum
And I follow "Forums(tab)"
And I follow "Forums (tab)"
And I follow "New forum"
And I fill in the following:
| Title | Testing forum 1 |
And I fill in "Testing forum" in WYSIWYG editor "edit_interaction_description_ifr"
And I press "Save"
And I follow "Forums(tab selected)"
And I follow "Forums (tab selected)"
And I follow "General discussion"
And I follow "New topic"
And I fill in the following:
......
......@@ -41,6 +41,7 @@ Scenario Outline: When quota notification threshold is changed, send notificatio
And I attach the file "Image2.png" to "Upload file"
And I attach the file "Image3.png" to "Upload file"
# Verifying notification for reaching user quota threshold have been received
And I am on homepage
And I follow "Inbox"
# Regression testing for previous errors
And I should not see "Call stack"
......
......@@ -26,12 +26,11 @@ Scenario: Leaving feedback on a group page (Bug 1426983)
Given I log in as "bob" with password "Password1"
And I follow "Groups"
And I follow "Test group 1"
And I follow "Pages(tab)"
And I follow "Pages (tab)"
# And I click on "Pages"
And I follow "Testing group page 01"
And I follow "Place feedback"
And I fill in "Testing feedback notifications" in WYSIWYG editor "add_feedback_form_message_ifr"
And I press "Place feedback"
And I press "Comment"
# Log out as user 1
And I follow "Logout"
# Log in as "Admin" user
......
......@@ -31,7 +31,7 @@ Scenario: Turning on and off switches on Group Edit page (Bug 1431569)
| Feedback notifications | All group members |
| Send forum posts immediately | 0 |
And I press "Save group"
And I follow "Edit group"
And I follow "Edit \"The Avengers\" Settings"
# Checking all the switches can all be changed
And I set the following fields to these values:
| Open | 0 |
......@@ -49,7 +49,7 @@ Scenario: Turning on and off switches on Group Edit page (Bug 1431569)
| Auto-add users | 1 |
| Send forum posts immediately | 1 |
And I press "Save group"
And I follow "Edit group"
And I follow "Edit \"The Avengers\" Settings"
# Checking all the switches can all be changed back
And I set the following fields to these values:
| Open | 1 |
......
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