From f7732a74e4d6d802d2285ba4d2a65e38ab6f74b3 Mon Sep 17 00:00:00 2001 From: Kevin Percy Date: Fri, 7 Jul 2023 14:19:05 +0800 Subject: [PATCH] MDL-77640 gradebook: Updated behat for add items menu --- grade/tests/behat/grade_aggregation.feature | 10 +++++----- .../tests/behat/grade_calculated_grade_items.feature | 12 ++++++------ .../grade_calculated_grade_items_20150627.feature | 12 ++++++------ grade/tests/behat/grade_calculated_weights.feature | 2 +- .../grade_contribution_with_extra_credit.feature | 8 ++++---- grade/tests/behat/grade_grade_minmax_change.feature | 2 +- grade/tests/behat/grade_hidden_items.feature | 2 +- .../behat/grade_hidden_items_locked_category.feature | 8 ++++---- .../grade_item_pass_data_to_advanced_page.feature | 10 +++++----- grade/tests/behat/grade_item_validation.feature | 2 +- grade/tests/behat/grade_mingrade.feature | 12 ++++++------ grade/tests/behat/grade_minmax.feature | 10 +++++----- 12 files changed, 45 insertions(+), 45 deletions(-) diff --git a/grade/tests/behat/grade_aggregation.feature b/grade/tests/behat/grade_aggregation.feature index f0c1d7d7a41..63a2f350f6d 100644 --- a/grade/tests/behat/grade_aggregation.feature +++ b/grade/tests/behat/grade_aggregation.feature @@ -382,24 +382,24 @@ Feature: We can use calculated grade totals | Aggregation | Natural | | Exclude empty grades | 0 | And I navigate to "Setup > Gradebook setup" in the course gradebook - And I press "Add category" + And I choose the "Add category" item in the "Add" action menu And I set the following fields to these values: | Category name | Sub category 3 | | Aggregation | Natural | | Drop the lowest | 1 | And I click on "Save" "button" in the "New category" "dialogue" And I wait until the page is ready - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 1 | | Grade category | Sub category 3 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 2 | | Grade category | Sub category 3 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 3 | | Grade category | Sub category 3 | @@ -443,7 +443,7 @@ Feature: We can use calculated grade totals And I turn editing mode off And I should see "250.00 (25.25 %)" in the ".course" "css_element" And I navigate to "Setup > Gradebook setup" in the course gradebook - And I press "Add category" + And I choose the "Add category" item in the "Add" action menu And I set the following fields to these values: | Category name | Sub sub category 1 | | Parent category | Sub category 3 | diff --git a/grade/tests/behat/grade_calculated_grade_items.feature b/grade/tests/behat/grade_calculated_grade_items.feature index e0cb543278f..e3f7cb50658 100644 --- a/grade/tests/behat/grade_calculated_grade_items.feature +++ b/grade/tests/behat/grade_calculated_grade_items.feature @@ -22,12 +22,12 @@ Feature: Calculated grade items can be used in the gradebook @javascript Scenario: The max grade for a category item, with a calculation using Natural aggregation, can be changed - Given I press "Add category" + Given I choose the "Add category" item in the "Add" action menu And I set the following fields to these values: | Category name | Calc cat | And I click on "Save" "button" in the "New category" "dialogue" And I wait until the page is ready - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | grade item 1 | | Grade category | Calc cat | @@ -50,13 +50,13 @@ Feature: Calculated grade items can be used in the gradebook @javascript Scenario: Changing max grade for a category item with a calculation that has existing grades will display the same points with the new max grade values immediately. - Given I press "Add category" + Given I choose the "Add category" item in the "Add" action menu And I set the following fields to these values: | Category name | Calc cat | And I click on "Save" "button" in the "New category" "dialogue" And I wait until the page is ready And I should not see "Calculated grade" in the "Calc cat" "table_row" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | grade item 1 | | Grade category | Calc cat | @@ -116,11 +116,11 @@ Feature: Calculated grade items can be used in the gradebook @javascript Scenario: Values in calculated grade items are not always out of one hundred - Given I press "Add grade item" + Given I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | grade item 1 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | calc item | And I click on "Save" "button" in the "New grade item" "dialogue" diff --git a/grade/tests/behat/grade_calculated_grade_items_20150627.feature b/grade/tests/behat/grade_calculated_grade_items_20150627.feature index 070b19bd8aa..2157f99c6c7 100644 --- a/grade/tests/behat/grade_calculated_grade_items_20150627.feature +++ b/grade/tests/behat/grade_calculated_grade_items_20150627.feature @@ -23,12 +23,12 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506 @javascript Scenario: The max grade for a category item, with a calculation using Natural aggregation, can be changed - Given I press "Add category" + Given I choose the "Add category" item in the "Add" action menu And I set the following fields to these values: | Category name | Calc cat | And I click on "Save" "button" in the "New category" "dialogue" And I wait until the page is ready - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | grade item 1 | | Grade category | Calc cat | @@ -51,12 +51,12 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506 @javascript Scenario: Changing max grade for a category item with a calculation that has existing grades will display the same points with the new max grade values immediately. - Given I press "Add category" + Given I choose the "Add category" item in the "Add" action menu And I set the following fields to these values: | Category name | Calc cat | And I click on "Save" "button" in the "New category" "dialogue" And I wait until the page is ready - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | grade item 1 | | Grade category | Calc cat | @@ -115,11 +115,11 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506 @javascript Scenario: Values in calculated grade items are not always out of one hundred - Given I press "Add grade item" + Given I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | grade item 1 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | calc item | And I click on "Save" "button" in the "New grade item" "dialogue" diff --git a/grade/tests/behat/grade_calculated_weights.feature b/grade/tests/behat/grade_calculated_weights.feature index 1d3c7043929..6f2179887dc 100644 --- a/grade/tests/behat/grade_calculated_weights.feature +++ b/grade/tests/behat/grade_calculated_weights.feature @@ -40,7 +40,7 @@ Feature: We can understand the gradebook user report And I set the field "Show contribution to course total" to "Show" And I press "Save changes" And I navigate to "Setup > Gradebook setup" in the course gradebook - And I press "Add category" + And I choose the "Add category" item in the "Add" action menu And I set the field "Category name" to "Sub category" And I click on "Save" "button" in the "New category" "dialogue" And I wait until the page is ready diff --git a/grade/tests/behat/grade_contribution_with_extra_credit.feature b/grade/tests/behat/grade_contribution_with_extra_credit.feature index 5a823c442df..a4eae0a9e22 100644 --- a/grade/tests/behat/grade_contribution_with_extra_credit.feature +++ b/grade/tests/behat/grade_contribution_with_extra_credit.feature @@ -20,20 +20,20 @@ Feature: Extra credit contributions are normalised when going out of bounds And I set the following administration settings values: | grade_aggregations_visible | Simple weighted mean of grades,Mean of grades (with extra credits),Natural | And I am on the "Course 1" "grades > gradebook setup" page - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 1 | | Maximum grade | 150 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 2 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 3 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 4 | And I click on "Save" "button" in the "New grade item" "dialogue" diff --git a/grade/tests/behat/grade_grade_minmax_change.feature b/grade/tests/behat/grade_grade_minmax_change.feature index e53961a9e05..07724dd1470 100644 --- a/grade/tests/behat/grade_grade_minmax_change.feature +++ b/grade/tests/behat/grade_grade_minmax_change.feature @@ -20,7 +20,7 @@ Feature: We can change the maximum and minimum number of points for manual items | student1 | C1 | student | | student2 | C1 | student | And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 1 | | Minimum grade | 0 | diff --git a/grade/tests/behat/grade_hidden_items.feature b/grade/tests/behat/grade_hidden_items.feature index 97e22099cfb..6362959a22f 100644 --- a/grade/tests/behat/grade_hidden_items.feature +++ b/grade/tests/behat/grade_hidden_items.feature @@ -27,7 +27,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when | assign | C1 | a3 | Test assignment three | Submit something! | Sub category 2 | 100 | | assign | C1 | a4 | Test assignment four | Submit something! | Sub category 2 | 100 | And I am on the "Course 1" "grades > gradebook setup" page logged in as "admin" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | calculated | And I click on "Save" "button" in the "New grade item" "dialogue" diff --git a/grade/tests/behat/grade_hidden_items_locked_category.feature b/grade/tests/behat/grade_hidden_items_locked_category.feature index 200c670f9e8..d3967259e67 100644 --- a/grade/tests/behat/grade_hidden_items_locked_category.feature +++ b/grade/tests/behat/grade_hidden_items_locked_category.feature @@ -18,12 +18,12 @@ Feature: Hidden grade items should be hidden when grade category is locked, but | teacher1 | C1 | editingteacher | | student1 | C1 | student | And I am on the "Course 1" "grades > gradebook setup" page logged in as "admin" - And I press "Add category" + And I choose the "Add category" item in the "Add" action menu And I set the following fields to these values: | Category name | Test locked category | And I click on "Save" "button" in the "New category" "dialogue" And I wait until the page is ready - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Hidden item | | Hidden | 1 | @@ -56,12 +56,12 @@ Feature: Hidden grade items should be hidden when grade category is locked, but Scenario: Hidden grade items in overridden category should show Given I am on the "Course 1" "grades > gradebook setup" page - And I press "Add category" + And I choose the "Add category" item in the "Add" action menu And I set the following fields to these values: | Category name | Test overridden category B| And I click on "Save" "button" in the "New category" "dialogue" And I wait until the page is ready - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Cat b item | | Grade category | Test overridden category B | diff --git a/grade/tests/behat/grade_item_pass_data_to_advanced_page.feature b/grade/tests/behat/grade_item_pass_data_to_advanced_page.feature index 809c7764ca1..31058e20b0b 100644 --- a/grade/tests/behat/grade_item_pass_data_to_advanced_page.feature +++ b/grade/tests/behat/grade_item_pass_data_to_advanced_page.feature @@ -35,7 +35,7 @@ Feature: We carry over data from modal to advanced grade item settings And I log out And I am on the "Course 1" course page logged in as teacher1 And I navigate to "Setup > Gradebook setup" in the course gradebook - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu Scenario: Defaults are used when creating a new grade item Given I click on "Show more..." "link" in the ".modal-dialog" "css_element" @@ -48,7 +48,7 @@ Feature: We carry over data from modal to advanced grade item settings | Grade category | Course 1 | And I press "Cancel" And I wait until the page is ready - And I press "Add category" + And I choose the "Add category" item in the "Add" action menu And I click on "Show more..." "link" in the ".modal-dialog" "css_element" And the following fields match these values: | Category name | | @@ -58,7 +58,7 @@ Feature: We carry over data from modal to advanced grade item settings | Parent category | Course 1 | And I press "Cancel" And I wait until the page is ready - And I press "Add outcome item" + And I choose the "Add outcome item" item in the "Add" action menu And I click on "Show more..." "link" in the ".modal-dialog" "css_element" And the following fields match these values: | Item name | | @@ -84,7 +84,7 @@ Feature: We carry over data from modal to advanced grade item settings | Grade category | Some cool grade category | And I press "Cancel" And I wait until the page is ready - And I press "Add category" + And I choose the "Add category" item in the "Add" action menu And I set the following fields to these values: | Category name | Category 1 | | Aggregation | Mean of grades | @@ -104,7 +104,7 @@ Feature: We carry over data from modal to advanced grade item settings | Parent category | Some cool grade category | And I press "Cancel" And I wait until the page is ready - And I press "Add outcome item" + And I choose the "Add outcome item" item in the "Add" action menu And I set the following fields to these values: | Item name | Outcome item 1 | | Outcome | Outcome 2 | diff --git a/grade/tests/behat/grade_item_validation.feature b/grade/tests/behat/grade_item_validation.feature index 02a3118adf2..6d6633e3d27 100644 --- a/grade/tests/behat/grade_item_validation.feature +++ b/grade/tests/behat/grade_item_validation.feature @@ -32,7 +32,7 @@ Feature: Grade item validation | Scale | Disappointing, Good, Very good, Excellent | And I press "Save changes" And I am on the "Course 1" "grades > gradebook setup" page - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | MI 1 | And I click on "Save" "button" in the "New grade item" "dialogue" diff --git a/grade/tests/behat/grade_mingrade.feature b/grade/tests/behat/grade_mingrade.feature index 48885fe9e35..b669c6b43e5 100644 --- a/grade/tests/behat/grade_mingrade.feature +++ b/grade/tests/behat/grade_mingrade.feature @@ -26,38 +26,38 @@ Feature: We can use a minimum grade different than zero And I set the following administration settings values: | grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural | And I am on the "Course 1" "grades > gradebook setup" page - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 1 | | Minimum grade | -100 | | Grade category | Course 1 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 2 | | Minimum grade | 50 | | Grade category | Course 1 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 3 | | Maximum grade | 50 | | Minimum grade | -100 | | Grade category | Sub category 1 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 4 | | Minimum grade | -100 | | Grade category | Sub category 1 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 5 | | Minimum grade | 50 | | Grade category | Sub category 2 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | Manual item 6 | | Minimum grade | 50 | diff --git a/grade/tests/behat/grade_minmax.feature b/grade/tests/behat/grade_minmax.feature index 86d8ad2af62..8e8096d16d5 100644 --- a/grade/tests/behat/grade_minmax.feature +++ b/grade/tests/behat/grade_minmax.feature @@ -25,27 +25,27 @@ Feature: We can choose what min or max grade to use when aggregating grades. And I set the following administration settings values: | grade_minmaxtouse | Min and max grades as specified in grade item settings | And I am on the "C1" "grades > gradebook setup" page - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | MI 1 | | Grade category | C1 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | MI 2 | | Grade category | C1 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | MI 3 | | Grade category | CAT1 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | MI 4 | | Grade category | CAT1 | And I click on "Save" "button" in the "New grade item" "dialogue" - And I press "Add grade item" + And I choose the "Add grade item" item in the "Add" action menu And I set the following fields to these values: | Item name | MI 5 | | Grade category | C1 |