Skip to content

Commit

Permalink
replace mnemonic tables' labels with md5 strings in all behat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
semteacher committed Nov 29, 2023
1 parent 8ff46cc commit 32fd074
Show file tree
Hide file tree
Showing 5 changed files with 187 additions and 187 deletions.
96 changes: 48 additions & 48 deletions tests/behat/filtering.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,71 +41,71 @@ Feature: Filtering functionality of wunderbyte_table works as expected
Scenario: Filter tables on different tabs using input field
Given I log in as "admin"
When I visit "/local/wunderbyte_table/demo.php"
And I follow "Users"
And I set the field "search-Users" to "teacher"
And I follow "Demo table 1"
And I set the field "search-fa5e95f7721ad449d1cdd30f461d1cec" to "teacher"
And I wait "1" seconds
And I should see "teacher1" in the "#Users_r1" "css_element"
And I set the field "search-Users" to "admin"
And I should see "teacher1" in the "#fa5e95f7721ad449d1cdd30f461d1cec_r1" "css_element"
And I set the field "search-fa5e95f7721ad449d1cdd30f461d1cec" to "admin"
And I wait "1" seconds
And I should see "admin" in the "#Users_r1" "css_element"
And I set the field "search-Users" to "guest"
And I should see "admin" in the "#fa5e95f7721ad449d1cdd30f461d1cec_r1" "css_element"
And I set the field "search-fa5e95f7721ad449d1cdd30f461d1cec" to "guest"
And I wait "1" seconds
And I should see "guest" in the "#Users_r1" "css_element"
And I follow "Course"
And I set the field "search-Course" to "course"
And I should see "guest" in the "#fa5e95f7721ad449d1cdd30f461d1cec_r1" "css_element"
And I follow "Demo table 2"
And I set the field "search-d82aa03a37e6ab3d58369289ffadc665" to "course"
And I wait "1" seconds
And I should see "Course 1" in the "#Course_r1" "css_element"
And I set the field "search-Course" to "site"
And I should see "Course 1" in the "#d82aa03a37e6ab3d58369289ffadc665_r1" "css_element"
And I set the field "search-d82aa03a37e6ab3d58369289ffadc665" to "site"
And I wait "1" seconds
And I should see "Acceptance test site" in the "#Course_r1" "css_element"
And I should see "Acceptance test site" in the "#d82aa03a37e6ab3d58369289ffadc665_r1" "css_element"

@javascript
Scenario: Filter users table by username via sidebar filter controls
Given I log in as "admin"
When I visit "/local/wunderbyte_table/demo.php"
And I follow "Users"
And I should see "guest" in the "#Users_r2" "css_element"
And I follow "Demo table 1"
And I should see "guest" in the "#fa5e95f7721ad449d1cdd30f461d1cec_r2" "css_element"
And I click on "[aria-controls=\"id_collapse_username\"]" "css_element"
And I should see "admin" in the "#id_collapse_username" "css_element"
And I set the field "admin" in the "#id_collapse_username" "css_element" to "checked"
And I wait "1" seconds
And I should see "admin" in the "#Users_r1" "css_element"
And "//*[contains(@id, 'Users')]//tr[@id, 'Users_r2']" "xpath_element" should not exist
And I should see "admin" in the "#fa5e95f7721ad449d1cdd30f461d1cec_r1" "css_element"
And "//*[contains(@id, 'fa5e95f7721ad449d1cdd30f461d1cec')]//tr[@id, 'fa5e95f7721ad449d1cdd30f461d1cec_r2']" "xpath_element" should not exist
And I set the field "guest" in the "#id_collapse_username" "css_element" to "checked"
And I wait "1" seconds
And I should see "guest" in the "#Users_r2" "css_element"
And I should see "guest" in the "#fa5e95f7721ad449d1cdd30f461d1cec_r2" "css_element"
## And "//*[contains(@id, 'Users')]//tr[@id, 'Users_r3']" "xpath_element" should not exist
And I should see "2 of 24 records found" in the "#Users.active .wb-records-count-label" "css_element"
And I should see "2 of 24 records found" in the "#fa5e95f7721ad449d1cdd30f461d1cec.active .wb-records-count-label" "css_element"
And I set the field "admin" in the "#id_collapse_username" "css_element" to ""
And I wait "1" seconds
And I should see "guest" in the "#Users_r1" "css_element"
And "//*[contains(@id, 'Users')]//tr[@id, 'Users_r2']" "xpath_element" should not exist
And I should see "guest" in the "#fa5e95f7721ad449d1cdd30f461d1cec_r1" "css_element"
And "//*[contains(@id, 'fa5e95f7721ad449d1cdd30f461d1cec')]//tr[@id, 'fa5e95f7721ad449d1cdd30f461d1cec_r2']" "xpath_element" should not exist
And I set the field "guest" in the "#id_collapse_username" "css_element" to ""
And I wait "1" seconds
And I should see "24 of 24 records found" in the "#Users.active .wb-records-count-label" "css_element"
And I should see "24 of 24 records found" in the "#fa5e95f7721ad449d1cdd30f461d1cec.active .wb-records-count-label" "css_element"

@javascript
Scenario: Filter users table by username and reset filter
Given I log in as "admin"
When I visit "/local/wunderbyte_table/demo.php"
And I follow "Users"
And I follow "Demo table 1"
And I click on "[aria-controls=\"id_collapse_username\"]" "css_element"
And I set the field "admin" in the "#id_collapse_username" "css_element" to "checked"
And I set the field "user15" in the "#id_collapse_username" "css_element" to "checked"
And I wait until the page is ready
And I should see "admin" in the "#Users_r1" "css_element"
And I should see "user15" in the "#Users_r2" "css_element"
And I should see "2 of 24 records found" in the "#Users.active .wb-records-count-label" "css_element"
And I should see "2 filter(s) on: Username" in the "#Users.active .wb-records-count-label" "css_element"
And I should see "admin" in the "#fa5e95f7721ad449d1cdd30f461d1cec_r1" "css_element"
And I should see "user15" in the "#fa5e95f7721ad449d1cdd30f461d1cec_r2" "css_element"
And I should see "2 of 24 records found" in the "#fa5e95f7721ad449d1cdd30f461d1cec.active .wb-records-count-label" "css_element"
And I should see "2 filter(s) on: Username" in the "#fa5e95f7721ad449d1cdd30f461d1cec.active .wb-records-count-label" "css_element"
And I follow "Show all records"
And I wait until the page is ready
And I should see "24 of 24 records found" in the "#Users.active .wb-records-count-label" "css_element"
And I should see "24 of 24 records found" in the "#fa5e95f7721ad449d1cdd30f461d1cec.active .wb-records-count-label" "css_element"

@javascript
Scenario: Search username in sidebar filter controls and filter by it
Given I log in as "admin"
When I visit "/local/wunderbyte_table/demo.php"
And I follow "Users"
And I follow "Demo table 1"
And I click on "[aria-controls=\"id_collapse_username\"]" "css_element"
Then "//input[@name='filtersearch-username']" "xpath_element" should exist
And I set the field "filtersearch-username" in the "#id_collapse_username" "css_element" to "user15"
Expand All @@ -114,47 +114,47 @@ Feature: Filtering functionality of wunderbyte_table works as expected
And I should not see "user16" in the "#id_collapse_username" "css_element"
And I set the field "user15" in the "#id_collapse_username" "css_element" to "checked"
And I wait "1" seconds
And I should see "user15" in the "#Users_r1" "css_element"
And I should see "1 of 24 records found" in the "#Users.active .wb-records-count-label" "css_element"
And I should see "user15" in the "#fa5e95f7721ad449d1cdd30f461d1cec_r1" "css_element"
And I should see "1 of 24 records found" in the "#fa5e95f7721ad449d1cdd30f461d1cec.active .wb-records-count-label" "css_element"
## Remove filter and search
And I set the field "user15" in the "#id_collapse_username" "css_element" to ""
And I set the field "filtersearch-username" in the "#id_collapse_username" "css_element" to ""
And I wait "1" seconds
And I should see "user14" in the "#id_collapse_username" "css_element"
And I should see "user15" in the "#id_collapse_username" "css_element"
And I should see "user16" in the "#id_collapse_username" "css_element"
And I should see "24 of 24 records found" in the "#Users.active .wb-records-count-label" "css_element"
And I should see "24 of 24 records found" in the "#fa5e95f7721ad449d1cdd30f461d1cec.active .wb-records-count-label" "css_element"

@javascript
Scenario: Filter multiple tables consequently using sidebar filter controls
Given I log in as "admin"
When I visit "/local/wunderbyte_table/demo.php"
## Filter panel being hidden by default on the Infinite Scroll tab
And I follow "Users_InfiniteScroll"
And I press "asidecollapse-Users_InfiniteScroll"
And I should see "Teacher" in the "#Users_InfiniteScroll_r3" "css_element"
And I click on ".Users_InfiniteScroll [aria-controls=\"id_collapse_firstname\"]" "css_element"
And I should see "Teacher" in the ".Users_InfiniteScroll #id_collapse_firstname" "css_element"
And I set the field "Teacher" in the ".Users_InfiniteScroll #id_collapse_firstname" "css_element" to "checked"
And I follow "Demo table 4"
And I press "asidecollapse-7ef0620c51db513cad089dcd596522bc"
And I should see "Teacher" in the "#7ef0620c51db513cad089dcd596522bc_r3" "css_element"
And I click on ".7ef0620c51db513cad089dcd596522bc [aria-controls=\"id_collapse_firstname\"]" "css_element"
And I should see "Teacher" in the ".7ef0620c51db513cad089dcd596522bc #id_collapse_firstname" "css_element"
And I set the field "Teacher" in the ".7ef0620c51db513cad089dcd596522bc #id_collapse_firstname" "css_element" to "checked"
And I wait until the page is ready
And I should see "Teacher" in the "#Users_InfiniteScroll_r1" "css_element"
And "//*[contains(@id, 'Users_InfiniteScroll')]//tr[@id, 'Users_InfiniteScroll_r2']" "xpath_element" should not exist
And I should see "Teacher" in the "#7ef0620c51db513cad089dcd596522bc_r1" "css_element"
And "//*[contains(@id, '7ef0620c51db513cad089dcd596522bc')]//tr[@id, '7ef0620c51db513cad089dcd596522bc_r2']" "xpath_element" should not exist
## Filter panel being hidden by default on the Users tab
And I follow "Users"
And I should see "guest" in the "#Users_r2" "css_element"
And I follow "Demo table 1"
And I should see "guest" in the "#fa5e95f7721ad449d1cdd30f461d1cec_r2" "css_element"
And I click on "[aria-controls=\"id_collapse_username\"]" "css_element"
And I should see "admin" in the "#id_collapse_username" "css_element"
And I set the field "admin" in the "#id_collapse_username" "css_element" to "checked"
And I wait "1" seconds
And I should see "admin" in the "#Users_r1" "css_element"
And "//*[contains(@id, 'Users')]//tr[@id, 'Users_r2']" "xpath_element" should not exist
And I should see "admin" in the "#fa5e95f7721ad449d1cdd30f461d1cec_r1" "css_element"
And "//*[contains(@id, 'fa5e95f7721ad449d1cdd30f461d1cec')]//tr[@id, 'fa5e95f7721ad449d1cdd30f461d1cec_r2']" "xpath_element" should not exist
## Filter panel being hidden by default on the Course tab
And I follow "Course"
And I press "asidecollapse-Course"
And I should see "Course 1" in the "#Course_r2" "css_element"
And I follow "Demo table 2"
And I press "asidecollapse-d82aa03a37e6ab3d58369289ffadc665"
And I should see "Course 1" in the "#d82aa03a37e6ab3d58369289ffadc665_r2" "css_element"
And I click on "[aria-controls=\"id_collapse_fullname\"]" "css_element"
And I should see "Course 1" in the "#id_collapse_fullname" "css_element"
And I set the field "Course 1" in the "#id_collapse_fullname" "css_element" to "checked"
And I wait "1" seconds
And I should see "Course 1" in the "#Course_r1" "css_element"
And "//*[contains(@id, 'Course')]//tr[@id, 'Course_r2']" "xpath_element" should not exist
And I should see "Course 1" in the "#d82aa03a37e6ab3d58369289ffadc665_r1" "css_element"
And "//*[contains(@id, 'd82aa03a37e6ab3d58369289ffadc665')]//tr[@id, 'd82aa03a37e6ab3d58369289ffadc665_r2']" "xpath_element" should not exist
Loading

0 comments on commit 32fd074

Please sign in to comment.