Skip to content

Commit

Permalink
MDL-49417 enrol_cohort: fix behat test to use new autocomplete.
Browse files Browse the repository at this point in the history
  • Loading branch information
danmarsden committed Mar 12, 2018
1 parent 1a11bf3 commit 6b7d740
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions cohort/tests/behat/access_visible_cohorts.feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,20 @@ Feature: Access visible and hidden cohorts
| user | course | role |
| teacher | C1 | editingteacher |

@javascript
Scenario: Teacher can see visible cohorts defined in the above contexts
When I log in as "teacher"
And I am on "Course 1" course homepage
And I navigate to "Enrolment methods" node in "Course administration > Users"
And I select "Cohort sync" from the "Add method" singleselect
Then the "Cohort" select box should contain "Cohort in category 1"
And the "Cohort" select box should contain "System cohort"
And the "Cohort" select box should not contain "Cohort hidden in category 1"
And the "Cohort" select box should not contain "System hidden cohort"
And the "Cohort" select box should not contain "Cohort in category 2"
And the "Cohort" select box should contain "Cohort empty in category 1"
And the "Cohort" select box should contain "System empty cohort"
And I open the autocomplete suggestions list
Then "Cohort in category 1" "autocomplete_suggestions" should exist
And "System cohort" "autocomplete_suggestions" should exist
And "Cohort hidden in category 1" "autocomplete_suggestions" should not exist
And "System hidden cohort" "autocomplete_suggestions" should not exist
And "Cohort in category 2" "autocomplete_suggestions" should not exist
And "Cohort empty in category 1" "autocomplete_suggestions" should exist
And "System empty cohort" "autocomplete_suggestions" should exist
And I set the field "Cohort" to "System cohort"
And I press "Add method"
And I am on "Course 1" course homepage
Expand All @@ -72,18 +74,20 @@ Feature: Access visible and hidden cohorts
And the "Select members from cohort" select box should not contain "Cohort empty in category 1"
And the "Select members from cohort" select box should not contain "System empty cohort"

@javascript
Scenario: System manager can see all cohorts defined in the above contexts
When I log in as "user1"
And I am on "Course 1" course homepage
And I navigate to "Enrolment methods" node in "Course administration > Users"
And I select "Cohort sync" from the "Add method" singleselect
Then the "Cohort" select box should contain "Cohort in category 1"
And the "Cohort" select box should contain "System cohort"
And the "Cohort" select box should contain "Cohort hidden in category 1"
And the "Cohort" select box should contain "System hidden cohort"
And the "Cohort" select box should not contain "Cohort in category 2"
And the "Cohort" select box should contain "Cohort empty in category 1"
And the "Cohort" select box should contain "System empty cohort"
And I open the autocomplete suggestions list
Then "Cohort in category 1" "autocomplete_suggestions" should exist
And "System cohort" "autocomplete_suggestions" should exist
And "Cohort hidden in category 1" "autocomplete_suggestions" should exist
And "System hidden cohort" "autocomplete_suggestions" should exist
And "Cohort in category 2" "autocomplete_suggestions" should not exist
And "Cohort empty in category 1" "autocomplete_suggestions" should exist
And "System empty cohort" "autocomplete_suggestions" should exist
And I set the field "Cohort" to "System cohort"
And I press "Add method"
And I navigate to "Enrolled users" node in "Course administration > Users"
Expand All @@ -98,18 +102,20 @@ Feature: Access visible and hidden cohorts
And the "Select members from cohort" select box should not contain "Cohort empty in category 1"
And the "Select members from cohort" select box should not contain "System empty cohort"

@javascript
Scenario: Category manager can see all cohorts defined in his category and visible cohorts defined above
When I log in as "user2"
And I am on "Course 1" course homepage
And I navigate to "Enrolment methods" node in "Course administration > Users"
And I select "Cohort sync" from the "Add method" singleselect
Then the "Cohort" select box should contain "Cohort in category 1"
And the "Cohort" select box should contain "System cohort"
And the "Cohort" select box should contain "Cohort hidden in category 1"
And the "Cohort" select box should not contain "System hidden cohort"
And the "Cohort" select box should not contain "Cohort in category 2"
And the "Cohort" select box should contain "Cohort empty in category 1"
And the "Cohort" select box should contain "System empty cohort"
And I open the autocomplete suggestions list
Then "Cohort in category 1" "autocomplete_suggestions" should exist
And "System cohort" "autocomplete_suggestions" should exist
And "Cohort hidden in category 1" "autocomplete_suggestions" should exist
And "System hidden cohort" "autocomplete_suggestions" should not exist
And "Cohort in category 2" "autocomplete_suggestions" should not exist
And "Cohort empty in category 1" "autocomplete_suggestions" should exist
And "System empty cohort" "autocomplete_suggestions" should exist
And I set the field "Cohort" to "System cohort"
And I press "Add method"
And I navigate to "Enrolled users" node in "Course administration > Users"
Expand Down

0 comments on commit 6b7d740

Please sign in to comment.