From f58c9590913bf30a23b95afa9a55308c6bf659e4 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Thu, 17 Nov 2022 15:37:46 +0100 Subject: [PATCH] MOBILE-4081 behat: Fix tests for 3.11 --- .../course/tests/behat/relative_dates.feature | 2 +- .../grades/tests/behat/view-311.feature | 73 +++++++++++++++++++ .../features/grades/tests/behat/view.feature | 2 +- .../tests/behat/activity_reminders.feature | 4 +- 4 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 src/core/features/grades/tests/behat/view-311.feature diff --git a/src/core/features/course/tests/behat/relative_dates.feature b/src/core/features/course/tests/behat/relative_dates.feature index 5ed164db7..c688a3f0a 100644 --- a/src/core/features/course/tests/behat/relative_dates.feature +++ b/src/core/features/course/tests/behat/relative_dates.feature @@ -1,4 +1,4 @@ -@core @core_course @app @javascript +@core @core_course @app @javascript @lms_from4.0 Feature: Check relative dates feature. Background: diff --git a/src/core/features/grades/tests/behat/view-311.feature b/src/core/features/grades/tests/behat/view-311.feature new file mode 100644 index 000000000..f72577c3a --- /dev/null +++ b/src/core/features/grades/tests/behat/view-311.feature @@ -0,0 +1,73 @@ +@app @javascript @lms_upto3.11 +Feature: View grades + + Background: + Given the following "users" exist: + | username | firstname | lastname | + | student1 | Student | first | + And the following "scales" exist: + | name | scale | + | Scale | Good, Bad | + And the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + And the following "grade categories" exist: + | fullname | course | + | Category 1 | C1 | + | Category 2 | C1 | + And the following "grade outcomes" exist: + | fullname | shortname | course | scale | + | Outcome | outcome | C1 | Scale | + And the following "grade items" exist: + | gradecategory | itemname | course | grademin | grademax | + | Category 1 | Item 1.1 | C1 | 60 | 80 | + | Category 1 | Item 1.2 | C1 | 10 | 90 | + | Category 2 | Item 2.1 | C1 | 0 | 100 | + And the following "activities" exist: + | gradecategory | name | course | activity | idnumber | grade | gradepass | + | Category 1 | Assignment 1 | C1 | assign | assign1 | 100 | 50 | + | Category 1 | Assignment 2 | C1 | assign | assign2 | 100 | 50 | + And the following "grade items" exist: + | gradecategory | itemname | course | outcome | + | Category 1 | Outcome | C1 | outcome | + And the following "grade grades" exist: + | gradeitem | user | grade | + | Item 1.1 | student1 | 70 | + | Item 1.2 | student1 | 20 | + | Item 2.1 | student1 | 40 | + | Assignment 1 | student1 | 80 | + | Assignment 2 | student1 | 35 | + | Outcome | student1 | 1 | + And the following config values are set as admin: + | enableoutcomes | 1 | + + Scenario: View individual grades and the grade report + Given I entered the course "Course 1" as "student1" in the app + + When I press "Assignment 1" in the app + And I press "Information" in the app + Then I should find "80" within "Gradebook" "ion-list" in the app + + When I press "Close" in the app + And I press the back button in the app + And I press "Assignment 2" in the app + And I press "Information" in the app + Then I should find "35" within "Gradebook" "ion-list" in the app + + When I press "Close" in the app + And I press the back button in the app + And I press "Grades" in the app + Then I should find "Category 1" in the app + And I should find "70" within "Item 1.1" "tr" in the app + And I should find "20" within "Item 1.2" "tr" in the app + And I should find "80" within "Assignment 1" "tr" in the app + And I should find "35" within "Assignment 2" "tr" in the app + And I should find "Good" within "Outcome" "tr" in the app + And I should find "205" within "Category 1 total" "tr" in the app + And I should find "Category 2" in the app + And I should find "40" within "Item 2.1" "tr" in the app + And I should find "40" within "Category 2 total" "tr" in the app + And I should find "245" within "Course total" "tr" in the app diff --git a/src/core/features/grades/tests/behat/view.feature b/src/core/features/grades/tests/behat/view.feature index 72be6a21e..891702569 100644 --- a/src/core/features/grades/tests/behat/view.feature +++ b/src/core/features/grades/tests/behat/view.feature @@ -1,4 +1,4 @@ -@app @javascript +@app @javascript @lms_from4.0 Feature: View grades Background: diff --git a/src/core/features/reminders/tests/behat/activity_reminders.feature b/src/core/features/reminders/tests/behat/activity_reminders.feature index d9d7d657e..c59fcc7eb 100644 --- a/src/core/features/reminders/tests/behat/activity_reminders.feature +++ b/src/core/features/reminders/tests/behat/activity_reminders.feature @@ -1,4 +1,4 @@ -@app @javascript @core_reminders +@app @javascript @core_reminders @lms_from4.0 Feature: Set a new reminder on activity Background: @@ -89,7 +89,7 @@ Feature: Set a new reminder on activity When I wait "50" seconds Then a notification with title "Due: Assignment 01" is not present in the app -Scenario: Check toast is correct + Scenario: Check toast is correct Given I entered the assign activity "Assignment 02" on course "Course 1" as "student1" in the app When I press "Set a reminder for \"Assignment 02\" (Due)" in the app