diff --git a/reportbuilder/tests/behat/audience.feature b/reportbuilder/tests/behat/audience.feature index fb8c7ea90e9..f62789da82a 100644 --- a/reportbuilder/tests/behat/audience.feature +++ b/reportbuilder/tests/behat/audience.feature @@ -31,17 +31,16 @@ Feature: Configure access to reports based on intended audience Then I click on "Add audience 'Manually added users'" "link" And I should see "Added audience 'Manually added users'" And I set the field "Add users manually" to "User 1,User 3" - # It would be better to reference the report table directly, but we can't because of MDL-73011. - And I click on "Save changes" "button" in the "[role=tabpanel].active" "css_element" + And I press "Save changes" And I should see "Audience saved" And I should see "User 1" And I should not see "User 2" And I should see "User 3" And I should not see "Add an audience to this report" And I click on the "Access" dynamic tab - And I should see "User 1" in the "[role=tabpanel].active" "css_element" - And I should not see "User 2" in the "[role=tabpanel].active" "css_element" - And I should see "User 3" in the "[role=tabpanel].active" "css_element" + And I should see "User 1" in the "reportbuilder-table" "table" + And I should not see "User 2" in the "reportbuilder-table" "table" + And I should see "User 3" in the "reportbuilder-table" "table" Scenario: Configure report audience with has system role audience type Given the following "roles" exist: @@ -55,15 +54,14 @@ Feature: Configure access to reports based on intended audience When I click on "Add audience 'Assigned system role'" "link" And I should see "Added audience 'Assigned system role'" And I set the field "Select a role" to "Test role" - # It would be better to reference the report table directly, but we can't because of MDL-73011. - And I click on "Save changes" "button" in the "[role=tabpanel].active" "css_element" + And I press "Save changes" Then I should see "Audience saved" And I should see "Test role" And I should not see "Add an audience to this report" And I click on the "Access" dynamic tab - And I should not see "User 1" in the "[role=tabpanel].active" "css_element" - And I should see "User 2" in the "[role=tabpanel].active" "css_element" - And I should not see "User 3" in the "[role=tabpanel].active" "css_element" + And I should not see "User 1" in the "reportbuilder-table" "table" + And I should see "User 2" in the "reportbuilder-table" "table" + And I should not see "User 3" in the "reportbuilder-table" "table" Scenario: Configure report audience with Member of cohort audience type Given the following "cohorts" exist: @@ -77,19 +75,18 @@ Feature: Configure access to reports based on intended audience When I click on "Add audience 'Member of cohort'" "link" And I should see "Added audience 'Member of cohort'" And I set the field "Select members from cohort" to "Cohort1" - # It would be better to reference the report table directly, but we can't because of MDL-73011. - And I click on "Save changes" "button" in the "[role=tabpanel].active" "css_element" + And I press "Save changes" Then I should see "Audience saved" And I should see "Cohort1" And I should not see "Add an audience to this report" And I click on the "Access" dynamic tab - And I should not see "User 1" in the "[role=tabpanel].active" "css_element" - And I should not see "User 2" in the "[role=tabpanel].active" "css_element" - And I should see "User 3" in the "[role=tabpanel].active" "css_element" + And I should not see "User 1" in the "reportbuilder-table" "table" + And I should not see "User 2" in the "reportbuilder-table" "table" + And I should see "User 3" in the "reportbuilder-table" "table" Scenario: Configure report audience with Member of cohort audience type with no cohorts available Given I am on the "My report" "reportbuilder > Editor" page logged in as "admin" - And I click on the "Audience" dynamic tab + When I click on the "Audience" dynamic tab Then "Add audience 'All users'" "link" should exist # This audience type should be disabled because there are no cohorts available. And "Add audience 'Member of cohort'" "link" should not exist @@ -98,8 +95,7 @@ Feature: Configure access to reports based on intended audience Given I am on the "My report" "reportbuilder > Editor" page logged in as "admin" And I click on the "Audience" dynamic tab And I click on "Add audience 'All users'" "link" - # It would be better to reference the report table directly, but we can't because of MDL-73011. - And I click on "Save changes" "button" in the "[role=tabpanel].active" "css_element" + And I press "Save changes" When I click on "Delete audience 'All users'" "button" And I click on "Delete" "button" in the "Delete audience 'All users'" "dialogue" Then I should see "Deleted audience 'All users'" @@ -111,21 +107,20 @@ Feature: Configure access to reports based on intended audience And I should see "Nothing to display" And I click on the "Audience" dynamic tab And I should see "Add an audience to this report" - Then I click on "Add audience 'Manually added users'" "link" + And I click on "Add audience 'Manually added users'" "link" And I set the field "Add users manually" to "User 1,User 3" - # It would be better to reference the report table directly, but we can't because of MDL-73011. - And I click on "Save changes" "button" in the "[role=tabpanel].active" "css_element" - And I press "Edit audience 'Manually added users'" + And I press "Save changes" + When I press "Edit audience 'Manually added users'" And I set the field "Add users manually" to "User 2" - And I click on "Save changes" "button" in the "[role=tabpanel].active" "css_element" - And I should see "Audience saved" - And I should not see "User 1" in the "[role=tabpanel].active" "css_element" - And I should see "User 2" in the "[role=tabpanel].active" "css_element" - And I should not see "User 3" in the "[role=tabpanel].active" "css_element" + And I press "Save changes" + Then I should see "Audience saved" + And I should not see "User 1" + And I should see "User 2" + And I should not see "User 3" And I click on the "Access" dynamic tab - And I should not see "User 1" in the "[role=tabpanel].active" "css_element" - And I should see "User 2" in the "[role=tabpanel].active" "css_element" - And I should not see "User 3" in the "[role=tabpanel].active" "css_element" + And I should not see "User 1" in the "reportbuilder-table" "table" + And I should see "User 2" in the "reportbuilder-table" "table" + And I should not see "User 3" in the "reportbuilder-table" "table" Scenario: View report as a user with no edit capability and set in the report audience Given the following "core_reportbuilder > Reports" exist: @@ -156,8 +151,7 @@ Feature: Configure access to reports based on intended audience And I should see "Add an audience to this report" Then I click on "Add audience 'Manually added users'" "link" And I set the field "Add users manually" to "User 1" - # It would be better to reference the report table directly, but we can't because of MDL-73011. - And I click on "Save changes" "button" in the "[role=tabpanel].active" "css_element" + And I press "Save changes" And I log out And I log in as "user1" And I navigate to "Reports > Report builder > Custom reports" in site administration @@ -201,8 +195,7 @@ Feature: Configure access to reports based on intended audience And I should see "Add an audience to this report" Then I click on "Add audience 'Manually added users'" "link" And I set the field "Add users manually" to "User 1" - # It would be better to reference the report table directly, but we can't because of MDL-73011. - And I click on "Save changes" "button" in the "[role=tabpanel].active" "css_element" + And I press "Save changes" And I log out And I log in as "user1" And I navigate to "Reports > Report builder > Custom reports" in site administration