Skip to content

Commit

Permalink
MDL-75553 lang: Fix Behat regressions in scenario files
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Sep 6, 2022
1 parent 7d2fada commit aa49eb2
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 70 deletions.
Expand Up @@ -21,7 +21,7 @@ Feature: Restore Moodle 2 course backups with different user data settings
| data | Test database name | n | C1 | data1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I add a "Text input" field to "Test database name" database and I fill the form with:
And I add a "Short text" field to "Test database name" database and I fill the form with:
| Field name | Test field name |
| Field description | Test field description |
And I navigate to "Templates" in current page administration
Expand Down
Expand Up @@ -26,26 +26,26 @@ Feature: The my overview block allows admins to easily configure the students' c
| student1 | C4 | student |
| student1 | C5 | student |

Scenario: Enable 'All (including archived)' course filter option
Scenario: Enable 'All (including removed from view)' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All (including archived)" to "1"
And I set the field "All (including removed from view)" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
# We have to check for the data attribute instead of the list element text as we would get false positives from the "All" element otherwise
Then "All (including archived)" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Then "All (including removed from view)" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Disable 'All (including archived)' course filter option
Scenario: Disable 'All (including removed from view)' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All (including archived)" to "0"
And I set the field "All (including removed from view)" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "All (including archived)" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Then "All (including removed from view)" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Enable 'All' course filter option
Given I log in as "admin"
Expand Down Expand Up @@ -76,7 +76,7 @@ Feature: The my overview block allows admins to easily configure the students' c
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
# We have to check for the data attribute instead of the list element text as we would get false negatives "All (including archived)" element otherwise
# We have to check for the data attribute instead of the list element text as we would get false negatives "All (including removed from view)" element otherwise
Then "In progress" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Disable 'In progress' course filter option
Expand Down Expand Up @@ -152,33 +152,33 @@ Feature: The my overview block allows admins to easily configure the students' c
Scenario: Enable 'Removed courses' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Archived" to "1"
And I set the field "Removed from view" to "1"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "Archived" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"
Then "Removed from view" "list_item" should exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Disable 'Removed courses' course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "Archived" to "0"
And I set the field "Removed from view" to "0"
And I press "Save"
And I log out
Then I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
Then "Archived" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"
Then "Removed from view" "list_item" should not exist in the ".block_myoverview .dropdown-menu" "css_element"

Scenario: Disable all course filter options
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All (including archived)" to "0"
And I set the field "All (including removed from view)" to "0"
And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "0"
And I set the field "In progress" to "0"
And I set the field "Future" to "0"
And I set the field "Past" to "0"
And I set the field "Starred" to "0"
And I set the field "Archived" to "0"
And I set the field "Removed from view" to "0"
And I press "Save"
And I log out
And I am on the "My courses" page logged in as "student1"
Expand All @@ -192,13 +192,13 @@ Feature: The my overview block allows admins to easily configure the students' c
Scenario: Disable all but one course filter option
Given I log in as "admin"
And I navigate to "Plugins > Blocks > Course overview" in site administration
And I set the field "All (including archived)" to "0"
And I set the field "All (including removed from view)" to "0"
And I set the field "All" in the "//*[@id=\"admin-displaygroupingall\"]" "xpath_element" to "0"
And I set the field "In progress" to "1"
And I set the field "Future" to "0"
And I set the field "Past" to "0"
And I set the field "Starred" to "0"
And I set the field "Archived" to "0"
And I set the field "Removed from view" to "0"
And I press "Save"
And I log out
And I am on the "My courses" page logged in as "student1"
Expand Down
18 changes: 9 additions & 9 deletions blocks/myoverview/tests/behat/block_myoverview_dashboard.feature
Expand Up @@ -66,13 +66,13 @@ Feature: The my overview block allows users to easily access their courses
Then I should see "Course 4" in the "Course overview" "block"
Then I should see "Course 5" in the "Course overview" "block"

Scenario: View all (including archived) courses
Scenario: View all (including removed from view) courses
Given the following config values are set as admin:
| config | value | plugin |
| displaygroupingallincludinghidden | 1 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
# We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (including archived)" element instead
# We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (including removed from view)" element instead
When I click on "[data-value='allincludinghidden']" "css_element" in the "Course overview" "block"
Then I should see "Course 1" in the "Course overview" "block"
Then I should see "Course 2" in the "Course overview" "block"
Expand Down Expand Up @@ -203,7 +203,7 @@ Feature: The my overview block allows users to easily access their courses
When I click on "In progress" "link" in the "Course overview" "block"
And I hover "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I reload the page
Then I should see "Course 3" in the "Course overview" "block"
Then I should see "Course 4" in the "Course overview" "block"
Expand All @@ -217,7 +217,7 @@ Feature: The my overview block allows users to easily access their courses
When I click on "Past" "link" in the "Course overview" "block"
And I hover "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 1')]" "xpath_element"
And I reload the page
Then I should not see "Course 1" in the "Course overview" "block"
And I should not see "Course 2" in the "Course overview" "block"
Expand All @@ -231,7 +231,7 @@ Feature: The my overview block allows users to easily access their courses
When I click on "Future" "link" in the "Course overview" "block"
And I hover "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I reload the page
Then I should not see "Course 5" in the "Course overview" "block"
And I should not see "Course 1" in the "Course overview" "block"
Expand All @@ -245,25 +245,25 @@ Feature: The my overview block allows users to easily access their courses
When I click on "All" "link" in the "Course overview" "block"
And I hover "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I reload the page
Then I should not see "Course 5" in the "Course overview" "block"
And I should see "Course 1" in the "Course overview" "block"
And I should see "Course 2" in the "Course overview" "block"
And I should see "Course 3" in the "Course overview" "block"
And I should see "Course 4" in the "Course overview" "block"

Scenario: View all (including archived) courses with hide persistent functionality
Scenario: View all (including removed from view) courses with hide persistent functionality
Given the following config values are set as admin:
| config | value | plugin |
| displaygroupingallincludinghidden | 1 | block_myoverview |
And I am on the "My courses" page logged in as "student1"
And I click on "All" "button" in the "Course overview" "block"
# We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (including archived)" element instead
# We have to click on the data attribute instead of the button element text as we might risk to click on the false positive "All (including removed from view)" element instead
When I click on "[data-value='allincludinghidden']" "css_element" in the "Course overview" "block"
And I hover "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Archive" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 5')]" "xpath_element"
And I reload the page
Then I should see "Course 5" in the "Course overview" "block"
And I should see "Course 1" in the "Course overview" "block"
Expand Down

0 comments on commit aa49eb2

Please sign in to comment.