diff --git a/blocks/glossary_random/tests/behat/glossary_random.feature b/blocks/glossary_random/tests/behat/glossary_random.feature index 423c1952fae..e74de4acd77 100644 --- a/blocks/glossary_random/tests/behat/glossary_random.feature +++ b/blocks/glossary_random/tests/behat/glossary_random.feature @@ -100,7 +100,7 @@ Feature: Random glossary entry block is used in a course And I am on "Course 1" course homepage And I should see "There are no entries yet in the chosen glossary" in the "ManualGlossaryblock" "block" And I follow "GlossaryManual" - And I follow "Waiting approval" + And I follow "Pending approval" And I follow "Approve" And I click on "Course 1" "link" in the "#page-navbar" "css_element" And I should see "Concept1" in the "ManualGlossaryblock" "block" diff --git a/blocks/glossary_random/tests/behat/glossary_random_global.feature b/blocks/glossary_random/tests/behat/glossary_random_global.feature index 85d82226db7..ad8993b74be 100644 --- a/blocks/glossary_random/tests/behat/glossary_random_global.feature +++ b/blocks/glossary_random/tests/behat/glossary_random_global.feature @@ -30,7 +30,7 @@ Feature: Random glossary entry block linking to global glossary When I log in as "admin" And I am on "Course 2" course homepage And I follow "Tips and Tricks" - And I press "Add a new entry" + And I press "Add entry" And I set the following fields to these values: | Concept | Never come late | | Definition | Come in time for your classes | diff --git a/lib/form/tests/behat/graderescale_for_glossary_pointscale.feature b/lib/form/tests/behat/graderescale_for_glossary_pointscale.feature index 5c182e7627e..d3e06d544b1 100644 --- a/lib/form/tests/behat/graderescale_for_glossary_pointscale.feature +++ b/lib/form/tests/behat/graderescale_for_glossary_pointscale.feature @@ -26,7 +26,7 @@ Feature: Using the glossary activities which support point scale @javascript Scenario: Glossary rescale grade should not be possible when users are graded Given I am on the "Test glossary name" "glossary activity" page logged in as student1 - And I press "Add a new entry" + And I press "Add entry" And I set the following fields to these values: | Concept | Testing score | | Definition | Scoring high on tests | diff --git a/mod/glossary/tests/behat/behat_mod_glossary.php b/mod/glossary/tests/behat/behat_mod_glossary.php index 9ff7c2afb12..63d03af91e9 100644 --- a/mod/glossary/tests/behat/behat_mod_glossary.php +++ b/mod/glossary/tests/behat/behat_mod_glossary.php @@ -46,7 +46,7 @@ class behat_mod_glossary extends behat_base { * @param TableNode $data */ public function i_add_a_glossary_entry_with_the_following_data(TableNode $data) { - $this->execute("behat_forms::press_button", get_string('addentry', 'mod_glossary')); + $this->execute("behat_forms::press_button", get_string('addsingleentry', 'mod_glossary')); $this->execute("behat_forms::i_set_the_following_fields_to_these_values", $data); @@ -60,9 +60,11 @@ class behat_mod_glossary extends behat_base { * @param string $categoryname Category name */ public function i_add_a_glossary_entries_category_named($categoryname) { - - $this->execute("behat_navigation::go_to_breadcrumb_location", get_string('categoryview', 'mod_glossary')); - + $params = [ + get_string('categoryview', 'mod_glossary'), + get_string('explainalphabet', 'glossary') + ]; + $this->execute("behat_forms::i_select_from_the_singleselect", $params); $this->execute("behat_forms::press_button", get_string('editcategories', 'mod_glossary')); $this->execute("behat_forms::press_button", get_string('addcategory', 'glossary')); diff --git a/mod/glossary/tests/behat/categories.feature b/mod/glossary/tests/behat/categories.feature index 14b49a460a9..edf1d40f4d5 100644 --- a/mod/glossary/tests/behat/categories.feature +++ b/mod/glossary/tests/behat/categories.feature @@ -31,7 +31,7 @@ Feature: Glossary entries can be organised in categories And "a.glossary.autolink" "css_element" should not exist # Create, edit and delete categories And I am on the MyGlossary "glossary activity" page - And I follow "Browse by category" + And I select "Browse by category" from the "Browse the glossary using this index" singleselect And I press "Edit categories" And I press "Add category" And I set the field "name" to "CategoryNoLinks" @@ -69,14 +69,14 @@ Feature: Glossary entries can be organised in categories | Concept | EntryCategoryAL | | Definition | Definition | | Categories | CategoryAutoLinks | - And I press "Add a new entry" + And I press "Add entry" And I set the following fields to these values: | Concept | EntryCategoryBoth | | Definition | Definition | | Categories | CategoryAutoLinks,CategoryNoLinks | And I press "Save changes" # Make sure entries appear in their categories - And I follow "Browse by category" + And I select "Browse by category" from the "Browse the glossary using this index" singleselect And "//h3[contains(.,'CATEGORYAUTOLINKS')]" "xpath_element" should appear before "//h3[contains(.,'CATEGORYNOLINKS')]" "xpath_element" And "//h4[contains(.,'EntryCategoryAL')]" "xpath_element" should appear before "//h3[contains(.,'CATEGORYNOLINKS')]" "xpath_element" And "(//h4[contains(.,'EntryCategoryBoth')])[1]" "xpath_element" should appear before "//h3[contains(.,'CATEGORYNOLINKS')]" "xpath_element" @@ -97,7 +97,7 @@ Feature: Glossary entries can be organised in categories And "//a[contains(.,'CategoryNoLinks')]" "xpath_element" should not exist # Delete a category with entries And I am on the MyGlossary "glossary activity" page - And I follow "Browse by category" + And I select "Browse by category" from the "Browse the glossary using this index" singleselect And I press "Edit categories" And I should see "2 Entries" in the "CategoryNoLinks" "table_row" And I should see "2 Entries" in the "CategoryAutoLinks" "table_row" @@ -105,7 +105,7 @@ Feature: Glossary entries can be organised in categories And I press "Yes" And I wait to be redirected And I am on the MyGlossary "glossary activity" page - And I follow "Browse by category" + And I select "Browse by category" from the "Browse the glossary using this index" singleselect And I should see "EntryCategoryNL" And I should not see "EntryNoCategory" And I should not see "EntryCategoryAL" diff --git a/mod/glossary/tests/behat/edit_tags.feature b/mod/glossary/tests/behat/edit_tags.feature index 6f0d069fba6..59b2a1a850e 100644 --- a/mod/glossary/tests/behat/edit_tags.feature +++ b/mod/glossary/tests/behat/edit_tags.feature @@ -24,7 +24,7 @@ Feature: Edited glossary entries handle tags correctly Scenario: Glossary entry edition of custom tags works as expected Given I am on the "Test glossary" "glossary activity" page logged in as teacher1 - And I press "Add a new entry" + And I press "Add entry" And I set the following fields to these values: | Concept | Dummy first entry | | Definition | Dream is the start of a journey | @@ -49,7 +49,7 @@ Feature: Edited glossary entries handle tags correctly And I press "Continue" And I log out Given I am on the "Test glossary" "glossary activity" page logged in as teacher1 - And I press "Add a new entry" + And I press "Add entry" And I expand all fieldsets And I open the autocomplete suggestions list And I should see "OT1" in the ".form-autocomplete-suggestions" "css_element" diff --git a/mod/glossary/tests/behat/entries_require_approval.feature b/mod/glossary/tests/behat/entries_require_approval.feature index 29ebe48e220..4b12dbdd0ab 100644 --- a/mod/glossary/tests/behat/entries_require_approval.feature +++ b/mod/glossary/tests/behat/entries_require_approval.feature @@ -40,7 +40,7 @@ Feature: A teacher can choose whether glossary entries require approval And I log out # Approve the entry. And I am on the "Test glossary name" "glossary activity" page logged in as teacher1 - And I follow "Waiting approval" + And I follow "Pending approval" Then I should see "(this entry is currently hidden)" And I follow "Approve" And I am on the "Test glossary name" "glossary activity" page diff --git a/mod/glossary/tests/behat/glossary_activity_completion.feature b/mod/glossary/tests/behat/glossary_activity_completion.feature index a2eeff3bd11..21058fab17a 100644 --- a/mod/glossary/tests/behat/glossary_activity_completion.feature +++ b/mod/glossary/tests/behat/glossary_activity_completion.feature @@ -47,7 +47,7 @@ Feature: View activity completion in the glossary activity And the "Make entries: 1" completion condition of "Music history" is displayed as "todo" And the "Receive a grade" completion condition of "Music history" is displayed as "todo" And I am on the "Music history" "glossary activity" page - And I press "Add a new entry" + And I press "Add entry" And I set the following fields to these values: | Concept | Blast beats | | Definition | Repeated fast tempo hits combining bass, snare and cymbal | diff --git a/mod/glossary/tests/behat/glossary_activity_completion_pass_grade.feature b/mod/glossary/tests/behat/glossary_activity_completion_pass_grade.feature index 1544057470f..7ffd5405008 100644 --- a/mod/glossary/tests/behat/glossary_activity_completion_pass_grade.feature +++ b/mod/glossary/tests/behat/glossary_activity_completion_pass_grade.feature @@ -65,7 +65,7 @@ Feature: Pass grade completion in the glossary activity And the "Receive a passing grade" completion condition of "Music history" is displayed as "todo" When I am on "Course 1" course homepage And I follow "Music history" - And I press "Add a new entry" + And I press "Add entry" And I set the following fields to these values: | Concept | Blast beats | | Definition | Repeated fast tempo hits combining bass, snare and cymbal | @@ -93,7 +93,7 @@ Feature: Pass grade completion in the glossary activity And the "Receive a passing grade" completion condition of "Music history" is displayed as "todo" When I am on "Course 1" course homepage And I follow "Music history" - And I press "Add a new entry" + And I press "Add entry" And I set the following fields to these values: | Concept | Blast beats | | Definition | Repeated fast tempo hits combining bass, snare and cymbal | diff --git a/mod/glossary/tests/behat/prevent_duplicate_entries.feature b/mod/glossary/tests/behat/prevent_duplicate_entries.feature index d9f42a210ba..d43cd135725 100644 --- a/mod/glossary/tests/behat/prevent_duplicate_entries.feature +++ b/mod/glossary/tests/behat/prevent_duplicate_entries.feature @@ -25,7 +25,7 @@ Feature: A teacher can choose whether to allow duplicate entries in a glossary And I add a glossary entry with the following data: | Concept | Unique concept | | Definition | I'm the definition of an unique concept | - When I press "Add a new entry" + When I press "Add entry" And I set the following fields to these values: | Concept | Unique concept | | Definition | There is no definition restriction | diff --git a/mod/glossary/tests/behat/print_friendly_version.feature b/mod/glossary/tests/behat/print_friendly_version.feature index 63dc6731577..cb47d14eb3a 100644 --- a/mod/glossary/tests/behat/print_friendly_version.feature +++ b/mod/glossary/tests/behat/print_friendly_version.feature @@ -29,10 +29,9 @@ Feature: A teacher can choose whether to provide a printer-friendly glossary ent When I add a glossary entry with the following data: | Concept | Just a test concept | | Definition | Concept definition | - Then "Printer-friendly version" "link" should exist - And "//*[contains(concat(' ', normalize-space(@class), ' '), ' printicon ')][contains(@href, 'print.php')]" "xpath_element" should exist - And I follow "Printer-friendly version" - And I should see "Just a test concept" + And I click on "Export entries" "button" + And I click on "Print" "link" + Then I should see "Just a test concept" @javascript Scenario: Printer-friendly glossary view disabled @@ -46,5 +45,4 @@ Feature: A teacher can choose whether to provide a printer-friendly glossary ent When I add a glossary entry with the following data: | Concept | Just a test concept | | Definition | Concept definition | - Then "Printer-friendly version" "link" should not exist - And "//*[contains(concat(' ', normalize-space(@class), ' '), ' printicon ')][contains(@href, 'print.php')]" "xpath_element" should not exist + And "//select[contains(concat(' ', normalize-space(@class), ' '), ' urlselect ')]" "xpath_element" should not exist diff --git a/mod/glossary/tests/behat/search_entries.feature b/mod/glossary/tests/behat/search_entries.feature index b403a0f1b10..be92ad73923 100644 --- a/mod/glossary/tests/behat/search_entries.feature +++ b/mod/glossary/tests/behat/search_entries.feature @@ -50,7 +50,7 @@ Feature: Glossary entries can be searched or browsed by alphabet, category, date @javascript Scenario: Browse by category - When I follow "Browse by category" + When I select "Browse by category" from the "Browse the glossary using this index" singleselect And I set the field "Categories" to "The ones I like" Then I should see "Sweet cucumber" And I should not see "Sour eggplants" @@ -60,7 +60,7 @@ Feature: Glossary entries can be searched or browsed by alphabet, category, date @javascript Scenario: Browse by date - When I follow "Browse by date" + When I select "Browse by date" from the "Browse the glossary using this index" singleselect And I follow "By creation date" Then "Delete entry: Eggplant" "link" should appear before "Delete entry: Cucumber" "link" And I follow "By last update" @@ -69,7 +69,7 @@ Feature: Glossary entries can be searched or browsed by alphabet, category, date @javascript Scenario: Browse by author - When I follow "Browse by Author" + When I select "Browse by Author" from the "Browse the glossary using this index" singleselect And I click on "T" "link" in the ".entrybox" "css_element" Then I should see "Teacher 1" And I should see "Sour eggplants"