From 31ac9c10acb99b54d67649bf424db767560a0b02 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 7 May 2024 09:17:28 +0200 Subject: [PATCH 1/9] MOBILE-4470 enrol: Remove 4.4 TODOs --- src/core/features/enrol/services/enrol.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/features/enrol/services/enrol.ts b/src/core/features/enrol/services/enrol.ts index c0a478258..b840b457e 100644 --- a/src/core/features/enrol/services/enrol.ts +++ b/src/core/features/enrol/services/enrol.ts @@ -97,7 +97,6 @@ export class CoreEnrolService { await Promise.all([ site.invalidateWsCacheForKey(this.getCourseEnrolmentMethodsCacheKey(courseId)), - site.invalidateWsCacheForKey(`mmCourses:enrolmentmethods:${courseId}`), // @todo 4.4 Remove after 4.3 release. ]); } From bb4736a5b7e5bdafd87dde454af453673d678eb1 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 7 May 2024 09:19:08 +0200 Subject: [PATCH 2/9] MOBILE-4470 behat: Fix tests for 4.1- --- src/addons/mod/quiz/tests/behat/attempts_list.feature | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/addons/mod/quiz/tests/behat/attempts_list.feature b/src/addons/mod/quiz/tests/behat/attempts_list.feature index 8082926e5..dea9c5de4 100644 --- a/src/addons/mod/quiz/tests/behat/attempts_list.feature +++ b/src/addons/mod/quiz/tests/behat/attempts_list.feature @@ -2,7 +2,8 @@ Feature: View list of attempts in the app Background: - Given the following "courses" exist: + Given the Moodle site is compatible with this feature + And the following "courses" exist: | fullname | shortname | | Course 1 | C1 | And the following "users" exist: @@ -45,6 +46,7 @@ Feature: View list of attempts in the app And I should find "1/1" within "Marks" "ion-item" in the app And I should be able to press "Review" in the app + @lms_from4.2 Scenario: View abandoned attempts Given the attempt at "Quiz 1" by "student1" was never submitted And I entered the quiz activity "Quiz 1" on course "Course 1" as "student1" in the app From f6b5cd9d7954331920177c1d1dff98da88d96b91 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 13 May 2024 13:15:30 +0200 Subject: [PATCH 3/9] MOBILE-4470 behat: Fix header step --- src/testing/services/behat-runtime.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/testing/services/behat-runtime.ts b/src/testing/services/behat-runtime.ts index 8a71e9a8f..265d7e3de 100644 --- a/src/testing/services/behat-runtime.ts +++ b/src/testing/services/behat-runtime.ts @@ -509,16 +509,16 @@ export class TestingBehatRuntimeService { getHeader(): string { this.log('Action - Get header'); - let titles = Array.from(document.querySelectorAll('.ion-page:not(.ion-page-hidden) > ion-header h1')) + const getBySelector = (selector: string ) => Array.from(document.querySelectorAll(selector)) .filter((title) => TestingBehatDomUtils.isElementVisible(title, document.body)) - .map((title) => title.innerText.trim()); + .map((title) => title.innerText.trim()) + .filter((title) => title.length > 0); + + let titles = getBySelector('.ion-page:not(.ion-page-hidden) > ion-header h1'); // Collapsed title, get the floating title. - if (titles.length < 0 || (titles.length === 1 && titles[0] === '')) { - titles = Array.from(document.querySelectorAll( - '.ion-page:not(.ion-page-hidden) h1.collapsible-header-floating-title', - )).filter((title) => TestingBehatDomUtils.isElementVisible(title, document.body)) - .map((title) => title.innerText.trim()); + if (titles.length === 0) { + titles = getBySelector('.ion-page:not(.ion-page-hidden) h1.collapsible-header-floating-title'); } if (titles.length > 1) { From 4cd4fa6fd67e0b5ed38895765b295d37d8782ca4 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 13 May 2024 13:18:29 +0200 Subject: [PATCH 4/9] MOBILE-4470 behat: Fix tests for 4.1 and older --- .../blog/tests/behat/edit-entry.feature | 3 +- src/addons/blog/tests/behat/entries.feature | 3 +- .../competency/tests/behat/navigation.feature | 8 +- .../tests/behat/navigation-311.feature | 78 +++++ .../tests/behat/navigation.feature | 5 +- .../chat/tests/behat/basic_usage-311.feature | 94 ++++++ .../mod/chat/tests/behat/basic_usage.feature | 5 +- .../chat/tests/behat/navigation-311.feature | 47 +++ .../mod/chat/tests/behat/navigation.feature | 5 +- .../mod/data/tests/behat/entries.feature | 35 +-- src/addons/mod/data/tests/behat/sync.feature | 35 +-- .../feedback/tests/behat/navigation.feature | 5 +- .../mod/forum/tests/behat/groups.feature | 5 +- .../mod/forum/tests/behat/search.feature | 3 +- .../quiz/tests/behat/attempts_list.feature | 2 +- .../quiz/tests/behat/basic_usage-311.feature | 2 +- .../quiz/tests/behat/basic_usage-39.feature | 9 +- .../tests/behat/basic_usage-311.feature | 277 ++++++++++++++++++ .../survey/tests/behat/basic_usage.feature | 5 +- .../workshop/tests/behat/basic_usage.feature | 1 + .../tests/behat/notifications.feature | 5 +- .../comments/tests/behat/basic_usage.feature | 5 +- .../tests/behat/basic_usage-311.feature | 128 -------- .../course/tests/behat/basic_usage.feature | 3 +- .../course/tests/behat/guest_access.feature | 1 - .../grades/tests/behat/navigation-401.feature | 5 +- .../grades/tests/behat/navigation.feature | 5 +- .../grades/tests/behat/view-311.feature | 73 ----- .../features/grades/tests/behat/view.feature | 3 +- .../features/login/tests/behat/signup.feature | 6 +- .../settings/tests/behat/sync.feature | 5 +- .../user/tests/behat/basic_usage.feature | 5 +- ...sage-of-user-features-view-profile_22.png} | Bin src/core/tests/behat/open_files-309.feature | 17 +- src/core/tests/behat/open_files.feature | 5 +- 35 files changed, 603 insertions(+), 290 deletions(-) create mode 100644 src/addons/coursecompletion/tests/behat/navigation-311.feature create mode 100644 src/addons/mod/chat/tests/behat/basic_usage-311.feature create mode 100644 src/addons/mod/chat/tests/behat/navigation-311.feature create mode 100644 src/addons/mod/survey/tests/behat/basic_usage-311.feature delete mode 100755 src/core/features/course/tests/behat/basic_usage-311.feature delete mode 100644 src/core/features/grades/tests/behat/view-311.feature rename src/core/features/user/tests/behat/snapshots/{test-basic-usage-of-user-features-view-profile_21.png => test-basic-usage-of-user-features-view-profile_22.png} (100%) diff --git a/src/addons/blog/tests/behat/edit-entry.feature b/src/addons/blog/tests/behat/edit-entry.feature index 23ee7020e..a2e1d8112 100644 --- a/src/addons/blog/tests/behat/edit-entry.feature +++ b/src/addons/blog/tests/behat/edit-entry.feature @@ -3,7 +3,8 @@ Feature: Edit blog entries In order to add or edit blog entries as User Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | firstname | lastname | email | | testuser | Test | User | moodle@example.com | | testuser2 | Test | User2 | moodle@example.com | diff --git a/src/addons/blog/tests/behat/entries.feature b/src/addons/blog/tests/behat/entries.feature index b26f50809..3c8d49341 100644 --- a/src/addons/blog/tests/behat/entries.feature +++ b/src/addons/blog/tests/behat/entries.feature @@ -4,7 +4,8 @@ Feature: Blog entries As a user Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | firstname | lastname | email | | testuser | Test | User | moodle@example.com | And the following "core_blog > entries" exist: diff --git a/src/addons/competency/tests/behat/navigation.feature b/src/addons/competency/tests/behat/navigation.feature index 344812f1e..002d8f63c 100644 --- a/src/addons/competency/tests/behat/navigation.feature +++ b/src/addons/competency/tests/behat/navigation.feature @@ -1,8 +1,9 @@ -@addon_competency @app @javascript +@addon_competency @app @javascript @lms_from3.11 Feature: Test competency navigation Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | firstname | lastname | | student1 | Student | first | | student2 | Student | second | @@ -475,8 +476,7 @@ Feature: Test competency navigation @lms_from4.4 Scenario: Disable features - Given the Moodle site is compatible with this feature - And the following config values are set as admin: + Given the following config values are set as admin: | enabled | 0 | core_competency | When I entered the course "Course 1" as "student1" in the app diff --git a/src/addons/coursecompletion/tests/behat/navigation-311.feature b/src/addons/coursecompletion/tests/behat/navigation-311.feature new file mode 100644 index 000000000..e132c373d --- /dev/null +++ b/src/addons/coursecompletion/tests/behat/navigation-311.feature @@ -0,0 +1,78 @@ +@addon_coursecompletion @app @javascript @lms_upto3.11 +Feature: Course completion navigation + + Background: + Given the Moodle site is compatible with this feature + And the following "users" exist: + | username | firstname | lastname | email | idnumber | + | teacher1 | Teacher | 1 | teacher1@example.com | T1 | + | student1 | Student | 1 | student1@example.com | S1 | + And the following "courses" exist: + | fullname | shortname | category | enablecompletion | showcompletionconditions | + | Course 1 | C1 | 0 | 1 | 1 | + | Course 2 | C2 | 0 | | | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + | teacher1 | C2 | editingteacher | + | student1 | C1 | student | + | student1 | C2 | student | + And the following "activity" exists: + | activity | assign | + | course | C1 | + | name | Test assignment name | + | assignsubmission_onlinetext_enabled | 1 | + | grade[modgrade_type] | Point | + | grade[modgrade_point] | 100 | + | gradepass | 70 | + | completion | 2 | + | completionusegrade | 1 | + | completionpassgrade | 1 | + And the following "activity" exists: + | activity | page | + | course | C2 | + | name | P1 | + And the following "blocks" exist: + | blockname | contextlevel | reference | + | completionstatus | Course | C1 | + | selfcompletion | Course | C1 | + | activity_modules | Course | C1 | + | completionstatus | Course | C2 | + | selfcompletion | Course | C2 | + | activity_modules | Course | C2 | + And the following config values are set as admin: + | enablecompletion | 1 | + And I am on the "Course 1" course page logged in as teacher1 + And I navigate to "Course completion" in current page administration + And I click on "Condition: Activity completion" "link" + And I set the field "Assignment - Test assignment name" to "1" + And I expand all fieldsets + And I set the following fields to these values: + | id_criteria_self | 1 | + And I press "Save changes" + + Scenario: Completion is available only when enabled for the course + Given I entered the course "Course 1" as "student1" in the app + When I press "Open block drawer" in the app + Then I should find "Course completion status" in the app + And I should find "Self completion" in the app + When I press "Close" in the app + And I press "Completion" in the app + Then I should find "Status" in the app + + Given I entered the course "Course 2" as "student1" in the app + When I press "Open block drawer" in the app + Then I should not find "Course completion status" in the app + And I should not find "Self completion" in the app + When I press "Close" in the app + Then I should not find "Completion" in the app + + Given the following config values are set as admin: + | enablecompletion | 0 | + Then I entered the course "Course 1" as "student1" in the app + And I pull to refresh in the app + When I press "Open block drawer" in the app + Then I should not find "Course completion status" in the app + And I should not find "Self completion" in the app + When I press "Close" in the app + Then I should not find "Completion" in the app diff --git a/src/addons/coursecompletion/tests/behat/navigation.feature b/src/addons/coursecompletion/tests/behat/navigation.feature index 7d8969f16..06d223e67 100644 --- a/src/addons/coursecompletion/tests/behat/navigation.feature +++ b/src/addons/coursecompletion/tests/behat/navigation.feature @@ -1,8 +1,9 @@ -@addon_coursecompletion @app @javascript +@addon_coursecompletion @app @javascript @lms_from4.0 Feature: Course completion navigation Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | firstname | lastname | email | idnumber | | teacher1 | Teacher | 1 | teacher1@example.com | T1 | | student1 | Student | 1 | student1@example.com | S1 | diff --git a/src/addons/mod/chat/tests/behat/basic_usage-311.feature b/src/addons/mod/chat/tests/behat/basic_usage-311.feature new file mode 100644 index 000000000..731e5ad65 --- /dev/null +++ b/src/addons/mod/chat/tests/behat/basic_usage-311.feature @@ -0,0 +1,94 @@ +@addon_mod_chat @app @javascript @lms_upto3.11 +Feature: Test basic usage of chat in app + As a student + I need basic chat functionality to work + + Background: + Given the Moodle site is compatible with this feature + And the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "users" exist: + | username | firstname | lastname | + | student1 | david | student | + | student2 | pau | student2 | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + | student2 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | chat | Test chat name | Test chat | C1 | chat | 0 | + + Scenario: Receive and send messages & See connected users, beep and talk to + # Send messages as student1 + Given I entered the chat activity "Test chat name" on course "Course 1" as "student1" in the app + Then I should find "Enter the chat" in the app + And I should find "Past sessions" in the app + + When I press "Enter the chat" in the app + And I set the field "New message" to "Hi!" in the app + And I press "Send" in the app + Then I should find "Hi!" in the app + + When I set the field "New message" to "I am David" in the app + And I press "Send" in the app + Then I should find "Hi!" in the app + And I should find "I am David" in the app + # Confirm leave the page + And I press the back button in the app + And I press "OK" in the app + + # Read messages, view connected users, send beep and reply as student2 + Given I entered the chat activity "Test chat name" on course "Course 1" as "student2" in the app + And I press "Enter the chat" in the app + Then I should find "Hi!" in the app + And I should find "I am David" in the app + + When I press "Users" in the app + Then I should find "david student" in the app + + When I press "Beep" in the app + Then I should find "You beeped david student" in the app + + When I set the field "New message" to "Hi David, I am Pau." in the app + And I press "Send" in the app + Then I should find "Hi David, I am Pau." in the app + And the following events should have been logged for "student1" in the app: + | name | activity | activityname | course | + | \mod_chat\event\course_module_viewed | chat | Test chat name | Course 1 | + | \mod_chat\event\message_sent | chat | Test chat name | Course 1 | + And the following events should have been logged for "student2" in the app: + | name | activity | activityname | course | + | \mod_chat\event\course_module_viewed | chat | Test chat name | Course 1 | + | \mod_chat\event\message_sent | chat | Test chat name | Course 1 | + + Scenario: Past sessions shown + # Send messages as student1 + Given I entered the chat activity "Test chat name" on course "Course 1" as "student1" in the app + When I press "Enter the chat" in the app + And I set the field "New message" to "Hi!" in the app + And I press "Send" in the app + Then I should find "Hi!" in the app + + When I set the field "New message" to "I am David" in the app + And I press "Send" in the app + Then I should find "I am David" in the app + # Confirm leave the page + And I press the back button in the app + And I press "OK" in the app + + # Read messages from past sessions as student2 + Given I entered the chat activity "Test chat name" on course "Course 1" as "student2" in the app + When I press "Past sessions" in the app + And I press "Show incomplete sessions" in the app + And I press "david student" near "(2)" in the app + Then I should find "Hi!" in the app + And I should find "I am David" in the app + + Scenario: Prefetch chat + # Only check that the chat is marked as downloaded to test that lazy handler is working. + Given I entered the course "Course 1" as "student1" in the app + When I press "Course downloads" in the app + And I press "Download" within "Test chat name" "ion-item" in the app + Then I should not be able to press "Download" within "Test chat name" "ion-item" in the app diff --git a/src/addons/mod/chat/tests/behat/basic_usage.feature b/src/addons/mod/chat/tests/behat/basic_usage.feature index 432913c61..35d8792fb 100755 --- a/src/addons/mod/chat/tests/behat/basic_usage.feature +++ b/src/addons/mod/chat/tests/behat/basic_usage.feature @@ -1,10 +1,11 @@ -@addon_mod_chat @app @javascript +@addon_mod_chat @app @javascript @lms_from4.0 Feature: Test basic usage of chat in app As a student I need basic chat functionality to work Background: - Given the following "courses" exist: + Given the Moodle site is compatible with this feature + And the following "courses" exist: | fullname | shortname | | Course 1 | C1 | And the following "users" exist: diff --git a/src/addons/mod/chat/tests/behat/navigation-311.feature b/src/addons/mod/chat/tests/behat/navigation-311.feature new file mode 100644 index 000000000..ebcc7fdb0 --- /dev/null +++ b/src/addons/mod/chat/tests/behat/navigation-311.feature @@ -0,0 +1,47 @@ +@addon_mod_chat @app @javascript @lms_upto3.11 +Feature: Test chat navigation + + Background: + Given the Moodle site is compatible with this feature + And the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "users" exist: + | username | firstname | lastname | + | student1 | Student | first | + | student2 | Student | second | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + | student2 | C1 | student | + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | chat | Test chat name | Test chat | C1 | chat | 0 | + # Create sessions + # TODO use generator instead + And I entered the chat activity "Test chat name" on course "Course 1" as "student1" in the app + And I press "Enter the chat" in the app + And I set the field "New message" to "Test message" in the app + And I press "Send" in the app + Then I should find "Test message" in the app + # Confirm leave the page + And I press the back button in the app + And I press "OK" in the app + + Scenario: Tablet navigation on chat + Given I entered the course "Course 1" as "student2" in the app + And I change viewport size to "1200x640" in the app + + # Sessions + When I press "Test chat name" in the app + And I press "Past sessions" in the app + Then I should find "No sessions found" in the app + + # Sessions — split view + When I press "Show incomplete sessions" in the app + Then "Student first" should be selected in the app + And I should find "Test message" in the app + + When I press "Show incomplete sessions" in the app + Then I should not find "Student first" in the app + And I should not find "Test message" in the app diff --git a/src/addons/mod/chat/tests/behat/navigation.feature b/src/addons/mod/chat/tests/behat/navigation.feature index aa41a3637..76bd66584 100644 --- a/src/addons/mod/chat/tests/behat/navigation.feature +++ b/src/addons/mod/chat/tests/behat/navigation.feature @@ -1,8 +1,9 @@ -@addon_mod_chat @app @javascript +@addon_mod_chat @app @javascript @lms_from4.0 Feature: Test chat navigation Background: - Given the following "courses" exist: + Given the Moodle site is compatible with this feature + And the following "courses" exist: | fullname | shortname | | Course 1 | C1 | And the following "users" exist: diff --git a/src/addons/mod/data/tests/behat/entries.feature b/src/addons/mod/data/tests/behat/entries.feature index dd8093e59..5a1d0b033 100644 --- a/src/addons/mod/data/tests/behat/entries.feature +++ b/src/addons/mod/data/tests/behat/entries.feature @@ -1,30 +1,31 @@ -@addon_mod_data @app @javascript +@addon_mod_data @app @javascript @lms_from3.11 Feature: Users can manage entries in database activities In order to populate databases As a user I need to add and manage entries to databases Background: - Given the following "users" exist: - | username | firstname | lastname | email | - | student1 | Student | 1 | student1@example.com | - | student2 | Student | 2 | student2@example.com | - | teacher1 | Teacher | 1 | teacher1@example.com | + Given the Moodle site is compatible with this feature + And the following "users" exist: + | username | firstname | lastname | email | + | student1 | Student | 1 | student1@example.com | + | student2 | Student | 2 | student2@example.com | + | teacher1 | Teacher | 1 | teacher1@example.com | And the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | + | fullname | shortname | category | + | Course 1 | C1 | 0 | And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | student1 | C1 | student | - | student2 | C1 | student | + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + | student2 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | comments | - | data | Web links | Useful links | C1 | data1 | 0 | + | activity | name | intro | course | idnumber | comments | + | data | Web links | Useful links | C1 | data1 | 0 | And the following "mod_data > fields" exist: - | database | type | name | description | - | data1 | text | URL | URL link | - | data1 | text | Description | Link description | + | database | type | name | description | + | data1 | text | URL | URL link | + | data1 | text | Description | Link description | Scenario: Create entry Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app diff --git a/src/addons/mod/data/tests/behat/sync.feature b/src/addons/mod/data/tests/behat/sync.feature index f1e4f8a00..94da99e3c 100644 --- a/src/addons/mod/data/tests/behat/sync.feature +++ b/src/addons/mod/data/tests/behat/sync.feature @@ -1,30 +1,31 @@ -@addon_mod_data @app @javascript +@addon_mod_data @app @javascript @lms_from3.11 Feature: Users can store entries in database activities when offline and sync when online In order to populate databases while offline As a user I need to add and manage entries to databases and sync then when online Background: - Given the following "users" exist: - | username | firstname | lastname | email | - | student1 | Student | 1 | student1@example.com | - | student2 | Student | 2 | student2@example.com | - | teacher1 | Teacher | 1 | teacher1@example.com | + Given the Moodle site is compatible with this feature + And the following "users" exist: + | username | firstname | lastname | email | + | student1 | Student | 1 | student1@example.com | + | student2 | Student | 2 | student2@example.com | + | teacher1 | Teacher | 1 | teacher1@example.com | And the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | + | fullname | shortname | category | + | Course 1 | C1 | 0 | And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | student1 | C1 | student | - | student2 | C1 | student | + | user | course | role | + | teacher1 | C1 | editingteacher | + | student1 | C1 | student | + | student2 | C1 | student | And the following "activities" exist: - | activity | name | intro | course | idnumber | - | data | Web links | Useful links | C1 | data1 | + | activity | name | intro | course | idnumber | + | data | Web links | Useful links | C1 | data1 | And the following "mod_data > fields" exist: - | database | type | name | description | - | data1 | text | URL | URL link | - | data1 | text | Description | Link description | + | database | type | name | description | + | data1 | text | URL | URL link | + | data1 | text | Description | Link description | Scenario: Create entry (offline) Given I entered the data activity "Web links" on course "Course 1" as "student1" in the app diff --git a/src/addons/mod/feedback/tests/behat/navigation.feature b/src/addons/mod/feedback/tests/behat/navigation.feature index c808c5f47..fbb6e8baa 100644 --- a/src/addons/mod/feedback/tests/behat/navigation.feature +++ b/src/addons/mod/feedback/tests/behat/navigation.feature @@ -1,8 +1,9 @@ -@addon_mod_feedback @app @javascript +@addon_mod_feedback @app @javascript @lms_from3.11 Feature: Test feedback navigation Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | firstname | lastname | | teacher1 | Teacher | teacher | | student01 | Student | 01 | diff --git a/src/addons/mod/forum/tests/behat/groups.feature b/src/addons/mod/forum/tests/behat/groups.feature index a8912f610..48bb5f3ce 100755 --- a/src/addons/mod/forum/tests/behat/groups.feature +++ b/src/addons/mod/forum/tests/behat/groups.feature @@ -2,7 +2,8 @@ Feature: Test usage of forum activity with groups in app Background: - Given the following "courses" exist: + Given the Moodle site is compatible with this feature + And the following "courses" exist: | fullname | shortname | | Course 1 | C1 | And the following "users" exist: @@ -33,6 +34,7 @@ Feature: Test usage of forum activity with groups in app | forum2 | Disc vis G2 | Disc vis G2 | Disc vis G2 content | G2 | | forum2 | Disc vis ALL | Disc vis ALL | Disc vis ALL content | All participants | + @lms_from4.1 Scenario: Student can only see the right groups Given I entered the forum activity "Separate groups forum" on course "Course 1" as "student1" in the app Then I should find "Disc sep G1" in the app @@ -63,6 +65,7 @@ Feature: Test usage of forum activity with groups in app And I should find "Disc vis ALL" in the app But I should not find "Disc vis G2" in the app + @lms_from4.1 Scenario: Teacher can see all groups Given I entered the forum activity "Separate groups forum" on course "Course 1" as "teacher1" in the app When I press "Separate groups" in the app diff --git a/src/addons/mod/forum/tests/behat/search.feature b/src/addons/mod/forum/tests/behat/search.feature index da09546b4..99adbfd59 100644 --- a/src/addons/mod/forum/tests/behat/search.feature +++ b/src/addons/mod/forum/tests/behat/search.feature @@ -2,7 +2,8 @@ Feature: Test Forum Search Background: - Given solr is installed + Given the Moodle site is compatible with this feature + And solr is installed And the following config values are set as admin: | enableglobalsearch | 1 | | searchengine | solr | diff --git a/src/addons/mod/quiz/tests/behat/attempts_list.feature b/src/addons/mod/quiz/tests/behat/attempts_list.feature index dea9c5de4..176cbcacb 100644 --- a/src/addons/mod/quiz/tests/behat/attempts_list.feature +++ b/src/addons/mod/quiz/tests/behat/attempts_list.feature @@ -1,4 +1,4 @@ -@addon_mod_quiz @app @javascript +@addon_mod_quiz @app @javascript @lms_from3.11 Feature: View list of attempts in the app Background: diff --git a/src/addons/mod/quiz/tests/behat/basic_usage-311.feature b/src/addons/mod/quiz/tests/behat/basic_usage-311.feature index be10f47fb..a0fb9ae7e 100644 --- a/src/addons/mod/quiz/tests/behat/basic_usage-311.feature +++ b/src/addons/mod/quiz/tests/behat/basic_usage-311.feature @@ -1,4 +1,4 @@ -@addon_mod_quiz @app @javascript @lms_from3.10 @lms_upto3.11 +@addon_mod_quiz @app @javascript @lms_from3.11 @lms_upto3.11 Feature: Attempt a quiz in app As a student In order to demonstrate what I know diff --git a/src/addons/mod/quiz/tests/behat/basic_usage-39.feature b/src/addons/mod/quiz/tests/behat/basic_usage-39.feature index 4004a74cd..a0771668a 100644 --- a/src/addons/mod/quiz/tests/behat/basic_usage-39.feature +++ b/src/addons/mod/quiz/tests/behat/basic_usage-39.feature @@ -89,12 +89,9 @@ Feature: Attempt a quiz in app And I press "Next" in the app And I press "True" in the app And I press "Next" in the app - And I press "Choose... , frog" in the app - And I press "amphibian" in the app - And I press "Choose... , newt" in the app - And I press "insect" in the app - And I press "Choose... , cat" in the app - And I press "mammal" in the app + And I set the field "frog" to "amphibian" in the app + And I set the field "newt" to "insect" in the app + And I set the field "cat" to "mammal" in the app And I press "Next" in the app Then I should find "Text of the eighth question" in the app diff --git a/src/addons/mod/survey/tests/behat/basic_usage-311.feature b/src/addons/mod/survey/tests/behat/basic_usage-311.feature new file mode 100644 index 000000000..7d3a217c8 --- /dev/null +++ b/src/addons/mod/survey/tests/behat/basic_usage-311.feature @@ -0,0 +1,277 @@ +@addon_mod_survey @app @javascript @lms_upto3.11 +Feature: Test basic usage of survey activity in app + In order to participate in surveys while using the mobile app + As a student + I need basic survey functionality to work + + Background: + Given the Moodle site is compatible with this feature + And the following "courses" exist: + | fullname | shortname | + | Course 1 | C1 | + And the following "users" exist: + | username | + | student1 | + | teacher1 | + And the following "course enrolments" exist: + | user | course | role | + | student1 | C1 | student | + | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | idnumber | groupmode | + | survey | Test survey name | Test survey | C1 | survey | 0 | + + Scenario: Answer a survey & View results (ATTLS) + Given I entered the survey activity "Test survey name" on course "Course 1" as "student1" in the app + And I set the following fields to these values in the app: + | 1. In evaluating what someone says, I focus on the quality of their argument, not on the person who's presenting it. | Strongly agree | + | 2. I like playing devil's advocate - arguing the opposite of what someone is saying. | Strongly disagree | + | 3. I like to understand where other people are 'coming from', what experiences have led them to feel the way they do. | Somewhat agree | + | 4. The most important part of my education has been learning to understand people who are very different to me. | Somewhat disagree | + | 5. I feel that the best way for me to achieve my own identity is to interact with a variety of other people. | Somewhat agree | + | 6. I enjoy hearing the opinions of people who come from backgrounds different to mine - it helps me to understand how the same things can be seen in such different ways. | Somewhat agree | + | 7. I find that I can strengthen my own position through arguing with someone who disagrees with me. | Somewhat agree | + | 8. I am always interested in knowing why people say and believe the things they do. | Somewhat agree | + | 9. I often find myself arguing with the authors of books that I read, trying to logically figure out why they're wrong. | Somewhat agree | + | 10. It's important for me to remain as objective as possible when I analyze something. | Somewhat agree | + | 11. I try to think with people instead of against them. | Somewhat agree | + | 12. I have certain criteria I use in evaluating arguments. | Somewhat agree | + | 13. I'm more likely to try to understand someone else's opinion than to try to evaluate it. | Somewhat agree | + | 14. I try to point out weaknesses in other people's thinking to help them clarify their arguments. | Somewhat agree | + | 15. I tend to put myself in other people's shoes when discussing controversial issues, to see why they think the way they do. | Somewhat agree | + | 16. One could call my way of analysing things 'putting them on trial' because I am careful to consider all the evidence. | Somewhat agree | + | 17. I value the use of logic and reason over the incorporation of my own concerns when solving problems. | Somewhat agree | + | 18. I can obtain insight into opinions that differ from mine through empathy. | Somewhat agree | + | 19. When I encounter people whose opinions seem alien to me, I make a deliberate effort to 'extend' myself into that person, to try to see how they could have those opinions. | Somewhat agree | + | 20. I spend time figuring out what's 'wrong' with things. For example, I'll look for something in a literary interpretation that isn't argued well enough. | Somewhat agree | + And I press "Submit" in the app + And I press "OK" in the app + And I press "Results" in the app + And I press "OK" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." + And I should see "1 people have completed this survey so far" + And the following events should have been logged for "student1" in the app: + | name | activity | activityname | course | + | \mod_survey\event\course_module_viewed | survey | Test survey name | Course 1 | + | \mod_survey\event\response_submitted | survey | Test survey name | Course 1 | + + Scenario: Answer a survey & View results (Critical incidents) + Given the following "activities" exist: + | activity | name | intro | template |course | idnumber | groupmode | + | survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 | + Given I entered the survey activity "Test survey critical incidents" on course "Course 1" as "student1" in the app + And I set the following fields to these values in the app: + | At what moment in class were you most engaged as a learner? | 1st answer | + | At what moment in class were you most distanced as a learner? | 2nd answer | + | What action from anyone in the forums did you find most affirming or helpful? | 3rd answer | + | What action from anyone in the forums did you find most puzzling or confusing? | 4th answer | + | What event surprised you most? | 5th answer | + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "Results" + + When I press "Results" in the app + And I press "OK" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "Test survey critical incidents" + And I should see "1st answer" + And I should see "2nd answer" + And I should see "3rd answer" + And I should see "4th answer" + And I should see "5th answer" + + Scenario: Answer a survey & View results (Colles actual) + Given the following "activities" exist: + | activity | name | intro | template |course | idnumber | groupmode | + | survey | Test survey Colles (actual) | Test survey1 | 1 | C1 | survey1 | 0 | + Given I entered the survey activity "Test survey Colles (actual)" on course "Course 1" as "student1" in the app + And I set the following fields to these values in the app: + | 1. my learning focuses on issues that interest me. | Sometimes | + | 2. what I learn is important for my professional practice. | Sometimes | + | 3. I learn how to improve my professional practice. | Sometimes | + | 4. what I learn connects well with my professional practice. | Sometimes | + | 5. I think critically about how I learn. | Sometimes | + | 6. I think critically about my own ideas. | Sometimes | + | 7. I think critically about other students' ideas. | Sometimes | + | 8. I think critically about ideas in the readings. | Sometimes | + | 9. I explain my ideas to other students. | Sometimes | + | 10. I ask other students to explain their ideas. | Sometimes | + | 11. other students ask me to explain my ideas. | Sometimes | + | 12. other students respond to my ideas. | Sometimes | + | 13. the tutor stimulates my thinking. | Sometimes | + | 14. the tutor encourages me to participate. | Sometimes | + | 15. the tutor models good discourse. | Sometimes | + | 16. the tutor models critical self-reflection. | Sometimes | + | 17. other students encourage my participation. | Sometimes | + | 18. other students praise my contribution. | Sometimes | + | 19. other students value my contribution. | Sometimes | + | 20. other students empathise with my struggle to learn. | Sometimes | + | 21. I make good sense of other students' messages. | Sometimes | + | 22. other students make good sense of my messages. | Sometimes | + | 23. I make good sense of the tutor's messages. | Sometimes | + | 24. the tutor makes good sense of my messages. | Sometimes | + | 25. How long did this survey take you to complete? | under 1 min | + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "You have completed this survey" + + When I press "Results" in the app + And I press "OK" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." + And I should see "1 people have completed this survey so far" + + Scenario: Answer a survey & View results (Colles preferred) + Given the following "activities" exist: + | activity | name | intro | template | course | idnumber | groupmode | + | survey | Test survey Colles (preferred) | Test survey1 | 2 | C1 | survey1 | 0 | + Given I entered the survey activity "Test survey Colles (preferred)" on course "Course 1" as "student1" in the app + And I set the following fields to these values in the app: + | 1. my learning focuses on issues that interest me. | Sometimes | + | 2. what I learn is important for my professional practice. | Sometimes | + | 3. I learn how to improve my professional practice. | Sometimes | + | 4. what I learn connects well with my professional practice. | Sometimes | + | 5. I think critically about how I learn. | Sometimes | + | 6. I think critically about my own ideas. | Sometimes | + | 7. I think critically about other students' ideas. | Sometimes | + | 8. I think critically about ideas in the readings. | Sometimes | + | 9. I explain my ideas to other students. | Sometimes | + | 10. I ask other students to explain their ideas. | Sometimes | + | 11. other students ask me to explain my ideas. | Sometimes | + | 12. other students respond to my ideas. | Sometimes | + | 13. the tutor stimulates my thinking. | Sometimes | + | 14. the tutor encourages me to participate. | Sometimes | + | 15. the tutor models good discourse. | Sometimes | + | 16. the tutor models critical self-reflection. | Sometimes | + | 17. other students encourage my participation. | Sometimes | + | 18. other students praise my contribution. | Sometimes | + | 19. other students value my contribution. | Sometimes | + | 20. other students empathise with my struggle to learn. | Sometimes | + | 21. I make good sense of other students' messages. | Sometimes | + | 22. other students make good sense of my messages. | Sometimes | + | 23. I make good sense of the tutor's messages. | Sometimes | + | 24. the tutor makes good sense of my messages. | Sometimes | + | 25. How long did this survey take you to complete? | under 1 min | + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "You have completed this survey" + + When I press "Results" in the app + And I press "OK" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." + And I should see "1 people have completed this survey so far" + + Scenario: Answer a survey & View results (Colles preferred and actual) + Given the following "activities" exist: + | activity | name | intro | template | course | idnumber | groupmode | + | survey | Test survey Colles (preferred and actual) | Test survey1 | 3 | C1 | survey1 | 0 | + Given I entered the survey activity "Test survey Colles (preferred and actual)" on course "Course 1" as "student1" in the app + And I set the following fields to these values in the app: + | 1. I prefer that my learning focuses on issues that interest me. | Sometimes | + | 2. I found that my learning focuses on issues that interest me. | Sometimes | + | 3. I prefer that what I learn is important for my professional practice. | Sometimes | + | 4. I found that what I learn is important for my professional practice. | Sometimes | + | 5. I prefer that I learn how to improve my professional practice. | Sometimes | + | 6. I found that I learn how to improve my professional practice. | Sometimes | + | 7. I prefer that what I learn connects well with my professional practice. | Sometimes | + | 8. I found that what I learn connects well with my professional practice. | Sometimes | + | 9. I prefer that I think critically about how I learn. | Sometimes | + | 10. I found that I think critically about how I learn. | Sometimes | + | 11. I prefer that I think critically about my own ideas. | Sometimes | + | 12. I found that I think critically about my own ideas. | Sometimes | + | 13. I prefer that I think critically about other students' ideas. | Sometimes | + | 14. I found that I think critically about other students' ideas. | Sometimes | + | 15. I prefer that I think critically about ideas in the readings. | Sometimes | + | 16. I found that I think critically about ideas in the readings. | Sometimes | + | 17. I prefer that I explain my ideas to other students. | Sometimes | + | 18. I found that I explain my ideas to other students. | Sometimes | + | 19. I prefer that I ask other students to explain their ideas. | Sometimes | + | 20. I found that I ask other students to explain their ideas. | Sometimes | + | 21. I prefer that other students ask me to explain my ideas. | Sometimes | + | 22. I found that other students ask me to explain my ideas. | Sometimes | + | 23. I prefer that other students respond to my ideas. | Sometimes | + | 24. I found that other students respond to my ideas. | Sometimes | + | 25. I prefer that the tutor stimulates my thinking. | Sometimes | + | 26. I found that the tutor stimulates my thinking. | Sometimes | + | 27. I prefer that the tutor encourages me to participate. | Sometimes | + | 28. I found that the tutor encourages me to participate. | Sometimes | + | 29. I prefer that the tutor models good discourse. | Sometimes | + | 30. I found that the tutor models good discourse. | Sometimes | + | 31. I prefer that the tutor models critical self-reflection. | Sometimes | + | 32. I found that the tutor models critical self-reflection. | Sometimes | + | 33. I prefer that other students encourage my participation. | Sometimes | + | 34. I found that other students encourage my participation. | Sometimes | + | 35. I prefer that other students praise my contribution. | Sometimes | + | 36. I found that other students praise my contribution. | Sometimes | + | 37. I prefer that other students value my contribution. | Sometimes | + | 38. I found that other students value my contribution. | Sometimes | + | 39. I prefer that other students empathise with my struggle to learn. | Sometimes | + | 40. I found that other students empathise with my struggle to learn. | Sometimes | + | 41. I prefer that I make good sense of other students' messages. | Sometimes | + | 42. I found that I make good sense of other students' messages. | Sometimes | + | 43. I prefer that other students make good sense of my messages. | Sometimes | + | 44. I found that other students make good sense of my messages. | Sometimes | + | 45. I prefer that I make good sense of the tutor's messages. | Sometimes | + | 46. I found that I make good sense of the tutor's messages. | Sometimes | + | 47. I prefer that the tutor makes good sense of my messages. | Sometimes | + | 48. I found that the tutor makes good sense of my messages. | Sometimes | + | 49. How long did this survey take you to complete? | 1-2 min | + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "You have completed this survey" + + When I press "Results" in the app + And I press "OK" in the app + And I switch to the browser tab opened by the app + And I log in as "student1" + Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." + And I should see "1 people have completed this survey so far" + + Scenario: Answer survey offline & Sync survey + Given the following "activities" exist: + | activity | name | intro | template | course | idnumber | groupmode | + | survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 | + Given I entered the survey activity "Test survey critical incidents" on course "Course 1" as "student1" in the app + And I switch network connection to offline + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "This Survey has offline data to be synchronised." + + When I switch network connection to wifi + And I press the back button in the app + And I press "Test survey critical incidents" in the app + And I press "Information" in the app + And I press "Refresh" in the app + Then I should see "Results" + And I should see "You have completed this survey." + But I should not see "This Survey has offline data to be synchronised." + + Scenario: Prefetch & Auto-sync survey + Given the following "activities" exist: + | activity | name | intro | template | course | idnumber | groupmode | + | survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 | + Given I entered the course "Course 1" as "student1" in the app + And I press "Course downloads" in the app + And I press "Download" within "Test survey critical incidents" "ion-item" in the app + And I press the back button in the app + And I switch network connection to offline + And I press "Test survey name" in the app + Then I should see "There was a problem connecting to the site. Please check your connection and try again." + + When I press "OK" in the app + And I press the back button in the app + And I press "Test survey critical incidents" in the app + And I press "Submit" in the app + And I press "OK" in the app + Then I should see "This Survey has offline data to be synchronised." + + When I switch network connection to wifi + And I run cron tasks in the app + Then I should not see "This Survey has offline data to be synchronised." + And I should see "You have completed this survey." diff --git a/src/addons/mod/survey/tests/behat/basic_usage.feature b/src/addons/mod/survey/tests/behat/basic_usage.feature index bb570d8f1..6b58767dc 100755 --- a/src/addons/mod/survey/tests/behat/basic_usage.feature +++ b/src/addons/mod/survey/tests/behat/basic_usage.feature @@ -1,11 +1,12 @@ -@addon_mod_survey @app @javascript +@addon_mod_survey @app @javascript @lms_from4.0 Feature: Test basic usage of survey activity in app In order to participate in surveys while using the mobile app As a student I need basic survey functionality to work Background: - Given the following "courses" exist: + Given the Moodle site is compatible with this feature + And the following "courses" exist: | fullname | shortname | | Course 1 | C1 | And the following "users" exist: diff --git a/src/addons/mod/workshop/tests/behat/basic_usage.feature b/src/addons/mod/workshop/tests/behat/basic_usage.feature index c9c7e07b5..1ba761a3b 100644 --- a/src/addons/mod/workshop/tests/behat/basic_usage.feature +++ b/src/addons/mod/workshop/tests/behat/basic_usage.feature @@ -19,6 +19,7 @@ Feature: Test basic usage of workshop activity in app | activity | name | intro | course | idnumber | | workshop | Test workshop | Workshop description | C1 | workshop | + @lms_from3.11 Scenario: Take a workshop # Setup phase diff --git a/src/addons/notifications/tests/behat/notifications.feature b/src/addons/notifications/tests/behat/notifications.feature index 01fa69272..bc7255565 100644 --- a/src/addons/notifications/tests/behat/notifications.feature +++ b/src/addons/notifications/tests/behat/notifications.feature @@ -1,8 +1,9 @@ -@addon_notifications @app @javascript +@addon_notifications @app @javascript @lms_from3.11 Feature: Notifications Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | firstname | lastname | | student1 | First | Student | | student2 | Second | Student | diff --git a/src/core/features/comments/tests/behat/basic_usage.feature b/src/core/features/comments/tests/behat/basic_usage.feature index c4272f945..cdfc98e76 100644 --- a/src/core/features/comments/tests/behat/basic_usage.feature +++ b/src/core/features/comments/tests/behat/basic_usage.feature @@ -1,11 +1,12 @@ -@core_comments @app @javascript +@core_comments @app @javascript @lms_from3.11 Feature: Test basic usage of comments in app In order to participate in the comments while using the mobile app As a student I need basic comments functionality to work Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | firstname | lastname | email | | teacher1 | Teacher | teacher | teacher1@example.com | | student1 | Student | student | student1@example.com | diff --git a/src/core/features/course/tests/behat/basic_usage-311.feature b/src/core/features/course/tests/behat/basic_usage-311.feature deleted file mode 100755 index 21e549608..000000000 --- a/src/core/features/course/tests/behat/basic_usage-311.feature +++ /dev/null @@ -1,128 +0,0 @@ -@core_course @app @javascript @lms_upto3.11 -Feature: Test basic usage of one course in app - In order to participate in one course while using the mobile app - As a student - I need basic course functionality to work - - Background: - Given the Moodle site is compatible with this feature - And the following "users" exist: - | username | firstname | lastname | email | - | teacher1 | Teacher | teacher | teacher1@example.com | - | student1 | Student | student | student1@example.com | - | student2 | Student2 | student2 | student2@example.com | - And the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | - And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | student1 | C1 | student | - And the following "activities" exist: - | activity | name | intro | course | idnumber | option | section | - | choice | Choice course 1 | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 1 | - And the following "activities" exist: - | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | section | - | assign | C1 | assign1 | assignment | Test assignment description | 1 | 1 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | assessed | scale[modgrade_type] | - | forum | Test forum name | Test forum | C1 | forum | 0 | 5 | Point | - And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | section | - | chat | Test chat name | Test chat | C1 | chat | 0 | 2 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | section | - | data | Web links | Useful links | C1 | data1 | 4 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | section | - | lti | Test external name | Test external | C1 | external | 0 | 1 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | section | - | feedback | Test feedback name | Test feedback | C1 | feedback | 0 | 3 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | section | - | glossary | Test glossary | glossary description | C1 | gloss1 | 5 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | section | - | quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 2 | - And the following "question categories" exist: - | contextlevel | reference | name | - | Course | C1 | Test questions | - And the following "questions" exist: - | questioncategory | qtype | name | questiontext | - | Test questions | truefalse | TF1 | Text of the first question | - | Test questions | truefalse | TF2 | Text of the second question | - And quiz "Quiz 1" contains the following questions: - | question | page | - | TF1 | 1 | - | TF2 | 2 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | section | - | survey | Test survey name | Test survey | C1 | survey | 0 | 1 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | wiki | Test wiki name | Test wiki | C1 | wiki | 0 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | section | - | lesson | Test lesson name | Test lesson | C1 | lesson | 0 | 3 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | section | - | scorm | Test scorm name | Test scorm | C1 | scorm | 0 | 2 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | section | - | workshop | Test workshop name | Test workshop | C1 | workshop | 0 | 3 | - - Scenario: Self enrol - Given I log in as "teacher1" - And I am on "Course 1" course homepage - And I add "Self enrolment" enrolment method with: - | Custom instance name | Student self enrolment | - And I entered the app as "student2" - When I press "Site home" in the app - And I press "Available courses" in the app - And I press "Course 1" in the app - And I press "Enrol me" in the app - And I press "OK" in the app - And I wait loading to finish in the app - Then the header should be "Course 1" in the app - And I should find "Test forum name" in the app - And I should find "Test wiki name" in the app - And I should find "Choice course 1" in the app - And I should find "assignment" in the app - And I should find "Test external name" in the app - And I should find "Test survey name" in the app - And I should find "Test chat name" in the app - And I should find "Quiz 1" in the app - And I should find "Test scorm name" in the app - And I should find "Test feedback name" in the app - And I should find "Test lesson name" in the app - And I should find "Test workshop name" in the app - And I should not find "Web links" in the app - And I should not find "Test glossary" in the app - - Scenario: Guest access - Given I am on the "Course 1" "enrolment methods" page logged in as "teacher1" - And I click on "Enable" "icon" in the "Guest access" "table_row" - And I entered the app as "student2" - When I press "Site home" in the app - And I press "Available courses" in the app - And I press "Course 1" in the app - - Then I should find "Course summary" in the app - And I should find "Course" in the app - - When I press "View course" "ion-button" in the app - Then the header should be "Course 1" in the app - And I should find "Test forum name" in the app - And I should find "Test wiki name" in the app - And I should find "Choice course 1" in the app - And I should find "assignment" in the app - And I should find "Test survey name" in the app - And I should find "Test chat name" in the app - And I should find "Quiz 1" in the app - And I should find "Test scorm name" in the app - And I should find "Test feedback name" in the app - And I should find "Test lesson name" in the app - And I should find "Test workshop name" in the app - And I should not find "Web links" in the app - And I should not find "Test glossary" in the app diff --git a/src/core/features/course/tests/behat/basic_usage.feature b/src/core/features/course/tests/behat/basic_usage.feature index e758d96b9..6ba1371c2 100755 --- a/src/core/features/course/tests/behat/basic_usage.feature +++ b/src/core/features/course/tests/behat/basic_usage.feature @@ -1,4 +1,4 @@ -@core_course @app @javascript +@core_course @app @javascript @lms_from4.1 Feature: Test basic usage of one course in app In order to participate in one course while using the mobile app As a student @@ -459,7 +459,6 @@ Feature: Test basic usage of one course in app | \core\event\course_viewed | Course 1 | {"coursesectionnumber":4} | | \core\event\course_viewed | Course 1 | {"coursesectionnumber":5} | - @lms_from4.0 Scenario: Self enrol Given I log in as "teacher1" And I add "Self enrolment" enrolment method in "Course 1" with: diff --git a/src/core/features/course/tests/behat/guest_access.feature b/src/core/features/course/tests/behat/guest_access.feature index c6271f94c..67085d6a6 100644 --- a/src/core/features/course/tests/behat/guest_access.feature +++ b/src/core/features/course/tests/behat/guest_access.feature @@ -20,7 +20,6 @@ Feature: Test basic usage of guest access course in app | activity | name | intro | course | idnumber | groupmode | | wiki | Test wiki name | Test wiki | C1 | wiki | 0 | - @lms_from4.0 Scenario: Guest access without password (student) Given I am on the "Course 1" "enrolment methods" page logged in as "teacher1" diff --git a/src/core/features/grades/tests/behat/navigation-401.feature b/src/core/features/grades/tests/behat/navigation-401.feature index 61ef0b016..e0bea0d71 100644 --- a/src/core/features/grades/tests/behat/navigation-401.feature +++ b/src/core/features/grades/tests/behat/navigation-401.feature @@ -1,8 +1,9 @@ -@core_grades @app @javascript @lms_upto4.1 +@core_grades @app @javascript @lms_from3.11 @lms_upto4.1 Feature: Grades navigation Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | firstname | lastname | | student1 | Student | first | | student2 | Student | second | diff --git a/src/core/features/grades/tests/behat/navigation.feature b/src/core/features/grades/tests/behat/navigation.feature index 03b05c2b7..cdcf62133 100644 --- a/src/core/features/grades/tests/behat/navigation.feature +++ b/src/core/features/grades/tests/behat/navigation.feature @@ -1,8 +1,9 @@ -@core_grades @app @javascript +@core_grades @app @javascript @lms_from3.11 Feature: Grades navigation Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | firstname | lastname | | student1 | Student | first | | student2 | Student | second | diff --git a/src/core/features/grades/tests/behat/view-311.feature b/src/core/features/grades/tests/behat/view-311.feature deleted file mode 100644 index b31bd77bf..000000000 --- a/src/core/features/grades/tests/behat/view-311.feature +++ /dev/null @@ -1,73 +0,0 @@ -@core_grades @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 c6210c4bb..f9c386696 100644 --- a/src/core/features/grades/tests/behat/view.feature +++ b/src/core/features/grades/tests/behat/view.feature @@ -2,7 +2,8 @@ Feature: View grades Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | firstname | lastname | | student1 | Student | first | And the following "scales" exist: diff --git a/src/core/features/login/tests/behat/signup.feature b/src/core/features/login/tests/behat/signup.feature index 6704798b0..919614186 100755 --- a/src/core/features/login/tests/behat/signup.feature +++ b/src/core/features/login/tests/behat/signup.feature @@ -3,7 +3,8 @@ Feature: Test signup in app I need basic signup functionality to work Background: - Given the following config values are set as admin: + Given the Moodle site is compatible with this feature + And the following config values are set as admin: | registerauth | email | | auth_instructions | These are the authentication instructions. | | passwordpolicy | 0 | @@ -79,7 +80,7 @@ Feature: Test signup in app Then I should find "Spain" in the app And I should find "u1@u1.com" in the app - @lms_from3.10 + @lms_from4.1 Scenario: Check password policy in signup Given the following config values are set as admin: | passwordpolicy | 1 | @@ -114,6 +115,7 @@ Feature: Test signup in app And I press "Create my new account" in the app Then I should find "An email should have been sent to your address" in the app + @lms_from3.11 Scenario: Signup with custom profile fields # Use default options Yes/No for menu field because it's not possible to add new lines. See MDL-75788. Given the following "custom profile fields" exist: diff --git a/src/core/features/settings/tests/behat/sync.feature b/src/core/features/settings/tests/behat/sync.feature index c7a8d45e9..4f577f419 100644 --- a/src/core/features/settings/tests/behat/sync.feature +++ b/src/core/features/settings/tests/behat/sync.feature @@ -40,8 +40,9 @@ Feature: It synchronise sites properly # Check synced When I press "Synchronise now" "button" in the app - And I wait loading to finish in the app - And I switch network connection to offline + Then I should find "Site synchronisation completed" in the app + + When I switch network connection to offline And I press the back button in the app And I entered the course "Course 1" in the app And I press "Sync choice" in the app diff --git a/src/core/features/user/tests/behat/basic_usage.feature b/src/core/features/user/tests/behat/basic_usage.feature index 21a3f14d2..dfab7dc48 100755 --- a/src/core/features/user/tests/behat/basic_usage.feature +++ b/src/core/features/user/tests/behat/basic_usage.feature @@ -2,10 +2,12 @@ Feature: Test basic usage of user features Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | firstname | lastname | timezone | | student1 | Student | Student | 99 | + @lms_from4.1 Scenario: Complete missing fields Given the following "custom profile fields" exist: | datatype | shortname | name | required | param1 | @@ -54,6 +56,7 @@ Feature: Test basic usage of user features When I press "Reconnect" in the app Then I should find "Acceptance test site" in the app + @lms_from4.1 Scenario: View profile Given the following "custom profile fields" exist: | datatype | shortname | name | required | param1 | diff --git a/src/core/features/user/tests/behat/snapshots/test-basic-usage-of-user-features-view-profile_21.png b/src/core/features/user/tests/behat/snapshots/test-basic-usage-of-user-features-view-profile_22.png similarity index 100% rename from src/core/features/user/tests/behat/snapshots/test-basic-usage-of-user-features-view-profile_21.png rename to src/core/features/user/tests/behat/snapshots/test-basic-usage-of-user-features-view-profile_22.png diff --git a/src/core/tests/behat/open_files-309.feature b/src/core/tests/behat/open_files-309.feature index fa601b8d0..b755db26d 100644 --- a/src/core/tests/behat/open_files-309.feature +++ b/src/core/tests/behat/open_files-309.feature @@ -2,7 +2,8 @@ Feature: It opens files properly. Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | | student1 | And the following "courses" exist: @@ -29,16 +30,12 @@ Feature: It opens files properly. And I press the back button in the app And I press "Test RTF" in the app And I press "Open" in the app - Then the app should have opened a browser tab with url "^blob:" + Then the app should have opened url "^blob:" with contents "Test resource A rtf.rtf file" once - When I switch to the browser tab opened by the app - Then I should see "Test resource A rtf.rtf file" + When I press "Open" in the app + Then the app should have opened url "^blob:" with contents "Test resource A rtf.rtf file" 2 times - When I close the browser tab opened by the app - And I press the back button in the app + When I press the back button in the app And I press "Test DOC" in the app And I press "Open" in the app - Then the app should have opened a browser tab with url "^blob:" - - When I switch to the browser tab opened by the app - Then I should see "Test resource A doc.doc file" + Then the app should have opened url "^blob:" with contents "Test resource A doc.doc file" once diff --git a/src/core/tests/behat/open_files.feature b/src/core/tests/behat/open_files.feature index 4f3024903..ff2d6af62 100644 --- a/src/core/tests/behat/open_files.feature +++ b/src/core/tests/behat/open_files.feature @@ -2,7 +2,8 @@ Feature: It opens files properly. Background: - Given the following "users" exist: + Given the Moodle site is compatible with this feature + And the following "users" exist: | username | | student1 | And the following "courses" exist: @@ -12,7 +13,7 @@ Feature: It opens files properly. | user | course | role | | student1 | C1 | student | - @lms_from3.10 + @lms_from3.11 Scenario: Open a file Given the following "activities" exist: | activity | name | intro | display | course | defaultfilename | From 83e75e58dd0fa8049a91d0c792da55bfef4dc37c Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 13 May 2024 13:25:59 +0200 Subject: [PATCH 5/9] MOBILE-4470 behat: Clean up tests before 4.1 --- .../tests/behat/basic_usage-311.feature | 93 ------ .../timeline/tests/behat/basic_usage.feature | 2 - .../competency/tests/behat/navigation.feature | 2 +- .../tests/behat/navigation-311.feature | 78 ----- .../tests/behat/navigation.feature | 2 +- .../tests/behat/basic_usage-310.feature | 58 ---- .../assign/tests/behat/basic_usage.feature | 1 - .../tests/behat/marking_workflow.feature | 2 +- .../tests/behat/basic_usage.feature | 3 +- .../tests/behat/groups.feature | 2 +- .../chat/tests/behat/basic_usage-311.feature | 94 ------ .../mod/chat/tests/behat/basic_usage.feature | 2 +- .../chat/tests/behat/navigation-311.feature | 47 --- .../mod/chat/tests/behat/navigation.feature | 2 +- .../tests/behat/basic_usage-311.feature | 39 --- .../choice/tests/behat/basic_usage.feature | 1 - .../mod/data/tests/behat/entries.feature | 2 +- src/addons/mod/data/tests/behat/sync.feature | 2 +- .../feedback/tests/behat/navigation.feature | 2 +- .../mod/forum/tests/behat/groups.feature | 2 - .../glossary/tests/behat/basic_usage.feature | 2 - .../numerical_decimal_separator-311.feature | 98 ------- .../behat/numerical_decimal_separator.feature | 1 - .../quiz/tests/behat/attempts_list.feature | 2 +- .../quiz/tests/behat/basic-usage-403.feature | 2 +- .../quiz/tests/behat/basic_usage-311.feature | 211 ------------- .../quiz/tests/behat/basic_usage-39.feature | 116 -------- .../tests/behat/attempts_and_grading.feature | 1 - .../scorm/tests/behat/availability.feature | 1 - .../tests/behat/basic_usage-311.feature | 277 ------------------ .../survey/tests/behat/basic_usage.feature | 2 +- .../workshop/tests/behat/basic_usage.feature | 1 - .../tests/behat/notifications.feature | 2 +- .../comments/tests/behat/basic_usage.feature | 2 +- .../course/tests/behat/basic_usage.feature | 2 +- .../tests/behat/course_completion-310.feature | 34 --- .../tests/behat/course_completion.feature | 1 - .../course/tests/behat/courselist-311.feature | 118 -------- .../course/tests/behat/courselist.feature | 2 - .../course/tests/behat/guest_access.feature | 1 - .../tests/behat/relative_dates-403.feature | 2 +- .../tests/behat/basic-usage-402.feature | 1 - .../tests/behat/basic_usage-310.feature | 69 ----- .../tests/behat/basic_usage-311.feature | 113 ------- .../courses/tests/behat/basic_usage.feature | 3 - .../grades/tests/behat/navigation-401.feature | 2 +- .../grades/tests/behat/navigation.feature | 2 +- .../features/grades/tests/behat/view.feature | 2 +- .../login/tests/behat/basic-usage-400.feature | 19 -- .../login/tests/behat/basic_usage-311.feature | 19 -- .../login/tests/behat/basic_usage.feature | 1 - .../login/tests/behat/signup-309.feature | 45 --- .../features/login/tests/behat/signup.feature | 2 - .../mainmenu/tests/behat/mainmenu-311.feature | 23 -- .../mainmenu/tests/behat/mainmenu.feature | 4 - .../tests/behat/activity_reminders.feature | 2 +- .../tests/behat/reportbuilder.feature | 2 +- .../user/tests/behat/basic_usage.feature | 2 - .../user/tests/behat/support-311.feature | 13 - .../features/user/tests/behat/support.feature | 2 +- .../tests/behat/customlangstrings.feature | 2 +- src/core/tests/behat/open_files-309.feature | 41 --- src/core/tests/behat/open_files.feature | 1 - 63 files changed, 24 insertions(+), 1660 deletions(-) delete mode 100644 src/addons/block/timeline/tests/behat/basic_usage-311.feature delete mode 100644 src/addons/coursecompletion/tests/behat/navigation-311.feature delete mode 100755 src/addons/mod/assign/tests/behat/basic_usage-310.feature delete mode 100644 src/addons/mod/chat/tests/behat/basic_usage-311.feature delete mode 100644 src/addons/mod/chat/tests/behat/navigation-311.feature delete mode 100755 src/addons/mod/choice/tests/behat/basic_usage-311.feature delete mode 100755 src/addons/mod/lesson/tests/behat/numerical_decimal_separator-311.feature delete mode 100644 src/addons/mod/quiz/tests/behat/basic_usage-311.feature delete mode 100644 src/addons/mod/quiz/tests/behat/basic_usage-39.feature delete mode 100644 src/addons/mod/survey/tests/behat/basic_usage-311.feature delete mode 100644 src/core/features/course/tests/behat/course_completion-310.feature delete mode 100644 src/core/features/course/tests/behat/courselist-311.feature delete mode 100755 src/core/features/courses/tests/behat/basic_usage-310.feature delete mode 100755 src/core/features/courses/tests/behat/basic_usage-311.feature delete mode 100644 src/core/features/login/tests/behat/basic-usage-400.feature delete mode 100644 src/core/features/login/tests/behat/basic_usage-311.feature delete mode 100644 src/core/features/login/tests/behat/signup-309.feature delete mode 100644 src/core/features/mainmenu/tests/behat/mainmenu-311.feature delete mode 100644 src/core/features/user/tests/behat/support-311.feature delete mode 100644 src/core/tests/behat/open_files-309.feature diff --git a/src/addons/block/timeline/tests/behat/basic_usage-311.feature b/src/addons/block/timeline/tests/behat/basic_usage-311.feature deleted file mode 100644 index a9bc5c2ad..000000000 --- a/src/addons/block/timeline/tests/behat/basic_usage-311.feature +++ /dev/null @@ -1,93 +0,0 @@ -@addon_block_timeline @app @javascript @lms_upto3.11 -Feature: Timeline block. - - Background: - Given the following "users" exist: - | username | - | student1 | - And the following "courses" exist: - | fullname | shortname | - | Course 1 | C1 | - | Course 2 | C2 | - | Course 3 | C3 | - | Course 4 | C4 | - And the following "course enrolments" exist: - | user | course | role | - | student1 | C1 | student | - | student1 | C2 | student | - | student1 | C3 | student | - | student1 | Acceptance test site | student | - And the following "activities" exist: - | activity | course | idnumber | name | duedate | - | assign | Acceptance test site | assign00 | Assignment 00 | ##tomorrow## | - | assign | C2 | assign01 | Assignment 01 | ##yesterday## | - | assign | C1 | assign02 | Assignment 02 | ##tomorrow## | - | assign | C1 | assign03 | Assignment 03 | ##tomorrow## | - | assign | C2 | assign04 | Assignment 04 | ##+2 days## | - | assign | C1 | assign05 | Assignment 05 | ##+5 days## | - | assign | C2 | assign06 | Assignment 06 | ##+31 days## | - | assign | C2 | assign07 | Assignment 07 | ##+31 days## | - | assign | C3 | assign08 | Assignment 08 | ##+31 days## | - | assign | C2 | assign09 | Assignment 09 | ##+31 days## | - | assign | C1 | assign10 | Assignment 10 | ##+31 days## | - | assign | C1 | assign11 | Assignment 11 | ##+6 months## | - | assign | C1 | assign12 | Assignment 12 | ##+6 months## | - | assign | C1 | assign13 | Assignment 13 | ##+6 months## | - | assign | C2 | assign14 | Assignment 14 | ##+6 months## | - | assign | C2 | assign15 | Assignment 15 | ##+6 months## | - | assign | C2 | assign16 | Assignment 16 | ##+6 months## | - | assign | C3 | assign17 | Assignment 17 | ##+6 months## | - | assign | C3 | assign18 | Assignment 18 | ##+6 months## | - | assign | C3 | assign19 | Assignment 19 | ##+6 months## | - | assign | C1 | assign20 | Assignment 20 | ##+1 year## | - | assign | C1 | assign21 | Assignment 21 | ##+1 year## | - | assign | C2 | assign22 | Assignment 22 | ##+1 year## | - | assign | C2 | assign23 | Assignment 23 | ##+1 year## | - | assign | C3 | assign24 | Assignment 24 | ##+1 year## | - | assign | C3 | assign25 | Assignment 25 | ##+1 year## | - - Scenario: See courses inside block - Given I entered the app as "student1" - And I press "Open block drawer" in the app - Then I should find "Assignment 00" within "Timeline" "ion-card" in the app - And I should find "Assignment 02" within "Timeline" "ion-card" in the app - And I should find "Assignment 05" within "Timeline" "ion-card" in the app - And I should find "Course 1" within "Timeline" "ion-card" in the app - And I should find "Course 2" within "Timeline" "ion-card" in the app - But I should not find "Assignment 01" within "Timeline" "ion-card" in the app - And I should not find "Course 3" within "Timeline" "ion-card" in the app - - When I press "Filter timeline by date" in the app - And I press "Overdue" in the app - Then I should find "Assignment 01" within "Timeline" "ion-card" in the app - And I should find "Course 2" within "Timeline" "ion-card" in the app - But I should not find "Assignment 00" within "Timeline" "ion-card" in the app - And I should not find "Assignment 02" within "Timeline" "ion-card" in the app - And I should not find "Course 1" within "Timeline" "ion-card" in the app - And I should not find "Course 3" within "Timeline" "ion-card" in the app - - When I press "Filter timeline by date" in the app - And I press "All" in the app - Then I should find "Assignment 19" within "Timeline" "ion-card" in the app - And I should find "Course 3" within "Timeline" "ion-card" in the app - But I should not find "Assignment 20" within "Timeline" "ion-card" in the app - - When I press "Load more" in the app - Then I should find "Assignment 21" within "Timeline" "ion-card" in the app - And I should find "Assignment 25" within "Timeline" "ion-card" in the app - - When I press "Filter timeline by date" in the app - And I press "Next 7 days" in the app - And I press "Sort by" in the app - And I press "Sort by courses" in the app - Then I should find "Course 1" "h3" within "Timeline" "ion-card" in the app - And I should find "Course 2" "h3" within "Timeline" "ion-card" in the app - And I should find "Assignment 02" within "Timeline" "ion-card" in the app - And I should find "Assignment 04" within "Timeline" "ion-card" in the app - But I should not find "Course 3" within "Timeline" "ion-card" in the app - - When the following "activities" exist: - | activity | course | idnumber | name | duedate | - | assign | C1 | newassign | New Assignment | ##tomorrow## | - And I pull to refresh in the app - Then I should find "New Assignment" in the app diff --git a/src/addons/block/timeline/tests/behat/basic_usage.feature b/src/addons/block/timeline/tests/behat/basic_usage.feature index ad52541d8..10dc4fdcb 100644 --- a/src/addons/block/timeline/tests/behat/basic_usage.feature +++ b/src/addons/block/timeline/tests/behat/basic_usage.feature @@ -46,7 +46,6 @@ Feature: Timeline block. | assign | C3 | assign24 | Assignment 24 | ##+1 year## | | assign | C3 | assign25 | Assignment 25 | ##+1 year## | - @lms_from4.0 Scenario: See courses inside block Given I entered the app as "student1" Then I should find "Assignment 00" within "Timeline" "ion-card" in the app @@ -92,7 +91,6 @@ Feature: Timeline block. And I pull to refresh in the app Then I should find "New Assignment" in the app - @lms_from4.0 Scenario: Search Given I entered the app as "student1" Then I should find "Assignment 00" within "Timeline" "ion-card" in the app diff --git a/src/addons/competency/tests/behat/navigation.feature b/src/addons/competency/tests/behat/navigation.feature index 002d8f63c..17d5c1d84 100644 --- a/src/addons/competency/tests/behat/navigation.feature +++ b/src/addons/competency/tests/behat/navigation.feature @@ -1,4 +1,4 @@ -@addon_competency @app @javascript @lms_from3.11 +@addon_competency @app @javascript Feature: Test competency navigation Background: diff --git a/src/addons/coursecompletion/tests/behat/navigation-311.feature b/src/addons/coursecompletion/tests/behat/navigation-311.feature deleted file mode 100644 index e132c373d..000000000 --- a/src/addons/coursecompletion/tests/behat/navigation-311.feature +++ /dev/null @@ -1,78 +0,0 @@ -@addon_coursecompletion @app @javascript @lms_upto3.11 -Feature: Course completion navigation - - Background: - Given the Moodle site is compatible with this feature - And the following "users" exist: - | username | firstname | lastname | email | idnumber | - | teacher1 | Teacher | 1 | teacher1@example.com | T1 | - | student1 | Student | 1 | student1@example.com | S1 | - And the following "courses" exist: - | fullname | shortname | category | enablecompletion | showcompletionconditions | - | Course 1 | C1 | 0 | 1 | 1 | - | Course 2 | C2 | 0 | | | - And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | teacher1 | C2 | editingteacher | - | student1 | C1 | student | - | student1 | C2 | student | - And the following "activity" exists: - | activity | assign | - | course | C1 | - | name | Test assignment name | - | assignsubmission_onlinetext_enabled | 1 | - | grade[modgrade_type] | Point | - | grade[modgrade_point] | 100 | - | gradepass | 70 | - | completion | 2 | - | completionusegrade | 1 | - | completionpassgrade | 1 | - And the following "activity" exists: - | activity | page | - | course | C2 | - | name | P1 | - And the following "blocks" exist: - | blockname | contextlevel | reference | - | completionstatus | Course | C1 | - | selfcompletion | Course | C1 | - | activity_modules | Course | C1 | - | completionstatus | Course | C2 | - | selfcompletion | Course | C2 | - | activity_modules | Course | C2 | - And the following config values are set as admin: - | enablecompletion | 1 | - And I am on the "Course 1" course page logged in as teacher1 - And I navigate to "Course completion" in current page administration - And I click on "Condition: Activity completion" "link" - And I set the field "Assignment - Test assignment name" to "1" - And I expand all fieldsets - And I set the following fields to these values: - | id_criteria_self | 1 | - And I press "Save changes" - - Scenario: Completion is available only when enabled for the course - Given I entered the course "Course 1" as "student1" in the app - When I press "Open block drawer" in the app - Then I should find "Course completion status" in the app - And I should find "Self completion" in the app - When I press "Close" in the app - And I press "Completion" in the app - Then I should find "Status" in the app - - Given I entered the course "Course 2" as "student1" in the app - When I press "Open block drawer" in the app - Then I should not find "Course completion status" in the app - And I should not find "Self completion" in the app - When I press "Close" in the app - Then I should not find "Completion" in the app - - Given the following config values are set as admin: - | enablecompletion | 0 | - Then I entered the course "Course 1" as "student1" in the app - And I pull to refresh in the app - When I press "Open block drawer" in the app - Then I should not find "Course completion status" in the app - And I should not find "Self completion" in the app - When I press "Close" in the app - Then I should not find "Completion" in the app diff --git a/src/addons/coursecompletion/tests/behat/navigation.feature b/src/addons/coursecompletion/tests/behat/navigation.feature index 06d223e67..27117112b 100644 --- a/src/addons/coursecompletion/tests/behat/navigation.feature +++ b/src/addons/coursecompletion/tests/behat/navigation.feature @@ -1,4 +1,4 @@ -@addon_coursecompletion @app @javascript @lms_from4.0 +@addon_coursecompletion @app @javascript Feature: Course completion navigation Background: diff --git a/src/addons/mod/assign/tests/behat/basic_usage-310.feature b/src/addons/mod/assign/tests/behat/basic_usage-310.feature deleted file mode 100755 index 42e1057b7..000000000 --- a/src/addons/mod/assign/tests/behat/basic_usage-310.feature +++ /dev/null @@ -1,58 +0,0 @@ -@addon_mod_assign @app @javascript @lms_upto3.10 -Feature: Test basic usage of assignment activity in app - In order to participate in the assignment while using the mobile app - I need basic assignment functionality to work - - Background: - Given the following "users" exist: - | username | firstname | lastname | email | - | teacher1 | Teacher | teacher | teacher1@example.com | - | student1 | Student | student | student1@example.com | - And the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | - And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | student1 | C1 | student | - And the following "activities" exist: - | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | attemptreopenmethod | - | assign | C1 | assign1 | assignment1 | Test assignment description1 | 1 | ## 20 August 2002 12:00 PM ## | manual | - - Scenario: View assign description, due date & View list of student submissions (as teacher) & View own submission or student submission - # Create, edit and submit as a student - Given I entered the assign activity "assignment1" on course "Course 1" as "student1" in the app - Then the header should be "assignment1" in the app - And I should find "Test assignment description1" in the app - And I should find "Due date" in the app - And I should find "Tuesday, 20 August 2002, 12:00 PM" in the app - - When I press "Add submission" in the app - And I set the field "Online text submissions" to "Submission test" in the app - And I press "Save" in the app - Then I should find "Draft (not submitted)" in the app - And I should find "Not graded" in the app - - When I press "Edit submission" in the app - And I set the field "Online text submissions" to "Submission test edited" in the app - And I press "Save" in the app - And I press "OK" in the app - Then I should find "Submission test edited" in the app - - When I press "Submit assignment" in the app - And I press "OK" in the app - Then I should find "Submitted for grading" in the app - And I should find "Not graded" in the app - And I should find "Submission test edited" in the app - - # View as a teacher - Given I entered the assign activity "assignment1" on course "Course 1" as "teacher1" in the app - Then the header should be "assignment1" in the app - - When I press "Submitted" in the app - Then I should find "Student student" in the app - And I should find "Not graded" in the app - - When I press "Student student" near "assignment1" in the app - Then I should find "Online text submissions" in the app - And I should find "Submission test edited" in the app diff --git a/src/addons/mod/assign/tests/behat/basic_usage.feature b/src/addons/mod/assign/tests/behat/basic_usage.feature index 4eef6ab7d..b34469326 100755 --- a/src/addons/mod/assign/tests/behat/basic_usage.feature +++ b/src/addons/mod/assign/tests/behat/basic_usage.feature @@ -19,7 +19,6 @@ Feature: Test basic usage of assignment activity in app | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | attemptreopenmethod | | assign | C1 | assign1 | assignment1 | Test assignment description1 | 1 | ## 20 August 2002 12:00 PM ## | manual | - @lms_from3.11 Scenario: View assign description, due date & View list of student submissions (as teacher) & View own submission or student submission # Create, edit and submit as a student Given I entered the assign activity "assignment1" on course "Course 1" as "student1" in the app diff --git a/src/addons/mod/assign/tests/behat/marking_workflow.feature b/src/addons/mod/assign/tests/behat/marking_workflow.feature index 0c893e31c..5bb39e488 100755 --- a/src/addons/mod/assign/tests/behat/marking_workflow.feature +++ b/src/addons/mod/assign/tests/behat/marking_workflow.feature @@ -1,4 +1,4 @@ -@addon_mod_assign @app @javascript @lms_from4.0 +@addon_mod_assign @app @javascript Feature: Test marking workflow in assignment activity in app Background: diff --git a/src/addons/mod/bigbluebuttonbn/tests/behat/basic_usage.feature b/src/addons/mod/bigbluebuttonbn/tests/behat/basic_usage.feature index 8cb59924e..84e49873b 100755 --- a/src/addons/mod/bigbluebuttonbn/tests/behat/basic_usage.feature +++ b/src/addons/mod/bigbluebuttonbn/tests/behat/basic_usage.feature @@ -1,4 +1,4 @@ -@addon_mod_bigbluebuttonbn @mod_bigbluebuttonbn @app @javascript @lms_from4.0 +@addon_mod_bigbluebuttonbn @mod_bigbluebuttonbn @app @javascript Feature: Test basic usage of BBB activity in app In order to join a BBB meeting while using the mobile app As a student @@ -97,7 +97,6 @@ Feature: Test basic usage of BBB activity in app And I press "Join session" in the app Then the app should have opened a browser tab with url "blindsidenetworks.com" - @lms_from4.1 Scenario: Display right info based on instance type Given the following "activities" exist: | activity | name | course | idnumber | type | diff --git a/src/addons/mod/bigbluebuttonbn/tests/behat/groups.feature b/src/addons/mod/bigbluebuttonbn/tests/behat/groups.feature index fb27d08a7..2cbedef60 100755 --- a/src/addons/mod/bigbluebuttonbn/tests/behat/groups.feature +++ b/src/addons/mod/bigbluebuttonbn/tests/behat/groups.feature @@ -1,4 +1,4 @@ -@addon_mod_bigbluebuttonbn @mod_bigbluebuttonbn @app @javascript @lms_from4.0 +@addon_mod_bigbluebuttonbn @mod_bigbluebuttonbn @app @javascript Feature: Test usage of BBB activity with groups in app Background: diff --git a/src/addons/mod/chat/tests/behat/basic_usage-311.feature b/src/addons/mod/chat/tests/behat/basic_usage-311.feature deleted file mode 100644 index 731e5ad65..000000000 --- a/src/addons/mod/chat/tests/behat/basic_usage-311.feature +++ /dev/null @@ -1,94 +0,0 @@ -@addon_mod_chat @app @javascript @lms_upto3.11 -Feature: Test basic usage of chat in app - As a student - I need basic chat functionality to work - - Background: - Given the Moodle site is compatible with this feature - And the following "courses" exist: - | fullname | shortname | - | Course 1 | C1 | - And the following "users" exist: - | username | firstname | lastname | - | student1 | david | student | - | student2 | pau | student2 | - And the following "course enrolments" exist: - | user | course | role | - | student1 | C1 | student | - | student2 | C1 | student | - And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | chat | Test chat name | Test chat | C1 | chat | 0 | - - Scenario: Receive and send messages & See connected users, beep and talk to - # Send messages as student1 - Given I entered the chat activity "Test chat name" on course "Course 1" as "student1" in the app - Then I should find "Enter the chat" in the app - And I should find "Past sessions" in the app - - When I press "Enter the chat" in the app - And I set the field "New message" to "Hi!" in the app - And I press "Send" in the app - Then I should find "Hi!" in the app - - When I set the field "New message" to "I am David" in the app - And I press "Send" in the app - Then I should find "Hi!" in the app - And I should find "I am David" in the app - # Confirm leave the page - And I press the back button in the app - And I press "OK" in the app - - # Read messages, view connected users, send beep and reply as student2 - Given I entered the chat activity "Test chat name" on course "Course 1" as "student2" in the app - And I press "Enter the chat" in the app - Then I should find "Hi!" in the app - And I should find "I am David" in the app - - When I press "Users" in the app - Then I should find "david student" in the app - - When I press "Beep" in the app - Then I should find "You beeped david student" in the app - - When I set the field "New message" to "Hi David, I am Pau." in the app - And I press "Send" in the app - Then I should find "Hi David, I am Pau." in the app - And the following events should have been logged for "student1" in the app: - | name | activity | activityname | course | - | \mod_chat\event\course_module_viewed | chat | Test chat name | Course 1 | - | \mod_chat\event\message_sent | chat | Test chat name | Course 1 | - And the following events should have been logged for "student2" in the app: - | name | activity | activityname | course | - | \mod_chat\event\course_module_viewed | chat | Test chat name | Course 1 | - | \mod_chat\event\message_sent | chat | Test chat name | Course 1 | - - Scenario: Past sessions shown - # Send messages as student1 - Given I entered the chat activity "Test chat name" on course "Course 1" as "student1" in the app - When I press "Enter the chat" in the app - And I set the field "New message" to "Hi!" in the app - And I press "Send" in the app - Then I should find "Hi!" in the app - - When I set the field "New message" to "I am David" in the app - And I press "Send" in the app - Then I should find "I am David" in the app - # Confirm leave the page - And I press the back button in the app - And I press "OK" in the app - - # Read messages from past sessions as student2 - Given I entered the chat activity "Test chat name" on course "Course 1" as "student2" in the app - When I press "Past sessions" in the app - And I press "Show incomplete sessions" in the app - And I press "david student" near "(2)" in the app - Then I should find "Hi!" in the app - And I should find "I am David" in the app - - Scenario: Prefetch chat - # Only check that the chat is marked as downloaded to test that lazy handler is working. - Given I entered the course "Course 1" as "student1" in the app - When I press "Course downloads" in the app - And I press "Download" within "Test chat name" "ion-item" in the app - Then I should not be able to press "Download" within "Test chat name" "ion-item" in the app diff --git a/src/addons/mod/chat/tests/behat/basic_usage.feature b/src/addons/mod/chat/tests/behat/basic_usage.feature index 35d8792fb..c420e5dc1 100755 --- a/src/addons/mod/chat/tests/behat/basic_usage.feature +++ b/src/addons/mod/chat/tests/behat/basic_usage.feature @@ -1,4 +1,4 @@ -@addon_mod_chat @app @javascript @lms_from4.0 +@addon_mod_chat @app @javascript Feature: Test basic usage of chat in app As a student I need basic chat functionality to work diff --git a/src/addons/mod/chat/tests/behat/navigation-311.feature b/src/addons/mod/chat/tests/behat/navigation-311.feature deleted file mode 100644 index ebcc7fdb0..000000000 --- a/src/addons/mod/chat/tests/behat/navigation-311.feature +++ /dev/null @@ -1,47 +0,0 @@ -@addon_mod_chat @app @javascript @lms_upto3.11 -Feature: Test chat navigation - - Background: - Given the Moodle site is compatible with this feature - And the following "courses" exist: - | fullname | shortname | - | Course 1 | C1 | - And the following "users" exist: - | username | firstname | lastname | - | student1 | Student | first | - | student2 | Student | second | - And the following "course enrolments" exist: - | user | course | role | - | student1 | C1 | student | - | student2 | C1 | student | - And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | chat | Test chat name | Test chat | C1 | chat | 0 | - # Create sessions - # TODO use generator instead - And I entered the chat activity "Test chat name" on course "Course 1" as "student1" in the app - And I press "Enter the chat" in the app - And I set the field "New message" to "Test message" in the app - And I press "Send" in the app - Then I should find "Test message" in the app - # Confirm leave the page - And I press the back button in the app - And I press "OK" in the app - - Scenario: Tablet navigation on chat - Given I entered the course "Course 1" as "student2" in the app - And I change viewport size to "1200x640" in the app - - # Sessions - When I press "Test chat name" in the app - And I press "Past sessions" in the app - Then I should find "No sessions found" in the app - - # Sessions — split view - When I press "Show incomplete sessions" in the app - Then "Student first" should be selected in the app - And I should find "Test message" in the app - - When I press "Show incomplete sessions" in the app - Then I should not find "Student first" in the app - And I should not find "Test message" in the app diff --git a/src/addons/mod/chat/tests/behat/navigation.feature b/src/addons/mod/chat/tests/behat/navigation.feature index 76bd66584..593f56324 100644 --- a/src/addons/mod/chat/tests/behat/navigation.feature +++ b/src/addons/mod/chat/tests/behat/navigation.feature @@ -1,4 +1,4 @@ -@addon_mod_chat @app @javascript @lms_from4.0 +@addon_mod_chat @app @javascript Feature: Test chat navigation Background: diff --git a/src/addons/mod/choice/tests/behat/basic_usage-311.feature b/src/addons/mod/choice/tests/behat/basic_usage-311.feature deleted file mode 100755 index a3ac822cd..000000000 --- a/src/addons/mod/choice/tests/behat/basic_usage-311.feature +++ /dev/null @@ -1,39 +0,0 @@ -@addon_mod_choice @app @javascript @lms_upto3.11 -Feature: Test basic usage of choice activity in app - In order to participate in the choice while using the mobile app - As a student - I need basic choice functionality to work - - Background: - Given the following "users" exist: - | username | firstname | lastname | email | - | teacher1 | Teacher | teacher | teacher1@example.com | - | student1 | Student | student | student1@example.com | - And the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | - And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | student1 | C1 | student | - - Scenario: Download students choice in text format - # Submit answer as student - Given the following "activities" exist: - | activity | name | intro | course | idnumber | option | - | choice | Choice name | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | - And I entered the choice activity "Choice name" on course "Course 1" as "student1" in the app - Then I select "Option 2" in the app - And I press "Save my choice" in the app - And I press "OK" in the app - - # Download answers as teacher - Given I entered the choice activity "Choice name" on course "Course 1" as "teacher1" in the app - Then I should find "Test choice description" in the app - - When I open a browser tab with url "$WWWROOT" - And I am on the "choice1" Activity page logged in as teacher1 - And I press "Actions menu" - And I follow "View 1 responses" - And I press "Download in text format" - # TODO Then I should find "..." in the downloads folder diff --git a/src/addons/mod/choice/tests/behat/basic_usage.feature b/src/addons/mod/choice/tests/behat/basic_usage.feature index 3f220aafc..07d187a99 100755 --- a/src/addons/mod/choice/tests/behat/basic_usage.feature +++ b/src/addons/mod/choice/tests/behat/basic_usage.feature @@ -165,7 +165,6 @@ Feature: Test basic usage of choice activity in app But I should not find "This Choice has offline data to be synchronised." in the app # TODO remove LMS UI steps in app tests - @lms_from4.0 Scenario: Download students choice in text format # Submit answer as student Given the following "activities" exist: diff --git a/src/addons/mod/data/tests/behat/entries.feature b/src/addons/mod/data/tests/behat/entries.feature index 5a1d0b033..857b73fc9 100644 --- a/src/addons/mod/data/tests/behat/entries.feature +++ b/src/addons/mod/data/tests/behat/entries.feature @@ -1,4 +1,4 @@ -@addon_mod_data @app @javascript @lms_from3.11 +@addon_mod_data @app @javascript Feature: Users can manage entries in database activities In order to populate databases As a user diff --git a/src/addons/mod/data/tests/behat/sync.feature b/src/addons/mod/data/tests/behat/sync.feature index 94da99e3c..b9b905b9c 100644 --- a/src/addons/mod/data/tests/behat/sync.feature +++ b/src/addons/mod/data/tests/behat/sync.feature @@ -1,4 +1,4 @@ -@addon_mod_data @app @javascript @lms_from3.11 +@addon_mod_data @app @javascript Feature: Users can store entries in database activities when offline and sync when online In order to populate databases while offline As a user diff --git a/src/addons/mod/feedback/tests/behat/navigation.feature b/src/addons/mod/feedback/tests/behat/navigation.feature index fbb6e8baa..575d37597 100644 --- a/src/addons/mod/feedback/tests/behat/navigation.feature +++ b/src/addons/mod/feedback/tests/behat/navigation.feature @@ -1,4 +1,4 @@ -@addon_mod_feedback @app @javascript @lms_from3.11 +@addon_mod_feedback @app @javascript Feature: Test feedback navigation Background: diff --git a/src/addons/mod/forum/tests/behat/groups.feature b/src/addons/mod/forum/tests/behat/groups.feature index 48bb5f3ce..394918835 100755 --- a/src/addons/mod/forum/tests/behat/groups.feature +++ b/src/addons/mod/forum/tests/behat/groups.feature @@ -34,7 +34,6 @@ Feature: Test usage of forum activity with groups in app | forum2 | Disc vis G2 | Disc vis G2 | Disc vis G2 content | G2 | | forum2 | Disc vis ALL | Disc vis ALL | Disc vis ALL content | All participants | - @lms_from4.1 Scenario: Student can only see the right groups Given I entered the forum activity "Separate groups forum" on course "Course 1" as "student1" in the app Then I should find "Disc sep G1" in the app @@ -65,7 +64,6 @@ Feature: Test usage of forum activity with groups in app And I should find "Disc vis ALL" in the app But I should not find "Disc vis G2" in the app - @lms_from4.1 Scenario: Teacher can see all groups Given I entered the forum activity "Separate groups forum" on course "Course 1" as "teacher1" in the app When I press "Separate groups" in the app diff --git a/src/addons/mod/glossary/tests/behat/basic_usage.feature b/src/addons/mod/glossary/tests/behat/basic_usage.feature index 330d626ff..95d4d181f 100644 --- a/src/addons/mod/glossary/tests/behat/basic_usage.feature +++ b/src/addons/mod/glossary/tests/behat/basic_usage.feature @@ -158,7 +158,6 @@ Feature: Test basic usage of glossary in app Then I should find "Garlic" in the app And I should find "Allium sativum" in the app - @lms_from3.10 Scenario: Edit entries Given I entered the glossary activity "Test glossary" on course "Course 1" as "student1" in the app @@ -275,7 +274,6 @@ Feature: Test basic usage of glossary in app But I should not find "stub2.txt" in the app And I should not find "Brassica oleracea var. italica" in the app - @lms_from3.10 Scenario: Delete entries Given I entered the glossary activity "Test glossary" on course "Course 1" as "student1" in the app diff --git a/src/addons/mod/lesson/tests/behat/numerical_decimal_separator-311.feature b/src/addons/mod/lesson/tests/behat/numerical_decimal_separator-311.feature deleted file mode 100755 index 9cd9c9709..000000000 --- a/src/addons/mod/lesson/tests/behat/numerical_decimal_separator-311.feature +++ /dev/null @@ -1,98 +0,0 @@ -@addon_mod_lesson @app @javascript @lms_upto3.11 -Feature: Test decimal separators in lesson - - Background: - Given the Moodle site is compatible with this feature - And the following "users" exist: - | username | firstname | lastname | email | - | teacher1 | Teacher | teacher | teacher1@example.com | - | student1 | Student | student | student1@example.com | - And the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | - And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | student1 | C1 | student | - And the following "activities" exist: - | activity | name | intro | course | idnumber | modattempts | review | maxattempts | retake | allowofflineattempts | - | lesson | Basic lesson | Basic lesson descr | C1 | lesson | 1 | 1 | 9 | 1 | 0 | - | lesson | Offline lesson | Offline lesson descr | C1 | lesson | 1 | 1 | 9 | 1 | 1 | - # Currently there are no generators for pages. See MDL-77581. - And I log in as "teacher1" - And I change window size to "small" - And I am on "Course 1" course homepage - And I follow "Basic lesson" - And I follow "Add a question page" - And I set the field "Select a question type" to "Numerical" - And I press "Add a question page" - And I set the following fields to these values: - | Page title | Hardest question ever | - | Page contents | 1 + 1.87? | - | id_answer_editor_0 | 2.87 | - | id_response_editor_0 | Correct answer | - | id_jumpto_0 | End of lesson | - | id_score_0 | 1 | - | id_answer_editor_1 | 2.1:2.8 | - | id_response_editor_1 | Incorrect answer | - | id_jumpto_1 | This page | - | id_score_1 | 0 | - And I press "Save page" - And I am on "Course 1" course homepage - And I follow "Offline lesson" - And I follow "Add a question page" - And I set the field "Select a question type" to "Numerical" - And I press "Add a question page" - And I set the following fields to these values: - | Page title | Hardest question ever | - | Page contents | 1 + 1.87? | - | id_answer_editor_0 | 2.87 | - | id_response_editor_0 | Correct answer | - | id_jumpto_0 | End of lesson | - | id_score_0 | 1 | - | id_answer_editor_1 | 2.1:2.8 | - | id_response_editor_1 | Incorrect answer | - | id_jumpto_1 | This page | - | id_score_1 | 0 | - And I press "Save page" - And I log out - - # This scenario needs to be duplicated because of MDL-77550 - Scenario: Attempt an online lesson successfully as a student (custom separator) and review as teacher - Given the following "language customisations" exist: - | component | stringid | value | - | core_langconfig | decsep | , | - And the following config values are set as admin: - | customlangstrings | "core.decsep|,|en" | tool_mobile | - And I entered the course "Course 1" as "student1" in the app - And I press "Basic lesson" in the app - When I press "Start" in the app - Then I should find "1 + 1.87?" in the app - - When I set the field "Your answer" to "2,87" in the app - And I press "Submit" in the app - Then I should find "Correct answer" in the app - And I should find "2.87" in the app - And I should not find "Incorrect answer" in the app - - When I press "Continue" in the app - Then I should find "Congratulations - end of lesson reached" in the app - And I should find "Your score is 1 (out of 1)." in the app - - When I press "Review lesson" in the app - Then the field "Your answer" matches value "2,87" in the app - - When I press the back button in the app - And I press "Start" in the app - And I set the field "Your answer" to "2.87" in the app - And I press "Submit" in the app - Then I should find "Correct answer" in the app - And I should find "2.87" in the app - And I should not find "Incorrect answer" in the app - - When I press "Continue" in the app - Then I should find "Congratulations - end of lesson reached" in the app - And I should find "Your score is 1 (out of 1)." in the app - - When I press "Review lesson" in the app - Then the field "Your answer" matches value "2,87" in the app diff --git a/src/addons/mod/lesson/tests/behat/numerical_decimal_separator.feature b/src/addons/mod/lesson/tests/behat/numerical_decimal_separator.feature index c86db6e71..faa0bd579 100755 --- a/src/addons/mod/lesson/tests/behat/numerical_decimal_separator.feature +++ b/src/addons/mod/lesson/tests/behat/numerical_decimal_separator.feature @@ -78,7 +78,6 @@ Feature: Test decimal separators in lesson Then I should find "Congratulations - end of lesson reached" in the app And I should find "Your score is 1 (out of 1)." in the app - @lms_from4.0 Scenario: Attempt an online lesson successfully as a student (custom separator) and review as teacher Given the following "language customisations" exist: | component | stringid | value | diff --git a/src/addons/mod/quiz/tests/behat/attempts_list.feature b/src/addons/mod/quiz/tests/behat/attempts_list.feature index 176cbcacb..dea9c5de4 100644 --- a/src/addons/mod/quiz/tests/behat/attempts_list.feature +++ b/src/addons/mod/quiz/tests/behat/attempts_list.feature @@ -1,4 +1,4 @@ -@addon_mod_quiz @app @javascript @lms_from3.11 +@addon_mod_quiz @app @javascript Feature: View list of attempts in the app Background: diff --git a/src/addons/mod/quiz/tests/behat/basic-usage-403.feature b/src/addons/mod/quiz/tests/behat/basic-usage-403.feature index b5a4719eb..f3b022799 100644 --- a/src/addons/mod/quiz/tests/behat/basic-usage-403.feature +++ b/src/addons/mod/quiz/tests/behat/basic-usage-403.feature @@ -1,4 +1,4 @@ -@addon_mod_quiz @app @javascript @lms_from4.0 @lms_upto4.3 +@addon_mod_quiz @app @javascript @lms_upto4.3 Feature: Attempt a quiz in app As a student In order to demonstrate what I know diff --git a/src/addons/mod/quiz/tests/behat/basic_usage-311.feature b/src/addons/mod/quiz/tests/behat/basic_usage-311.feature deleted file mode 100644 index a0fb9ae7e..000000000 --- a/src/addons/mod/quiz/tests/behat/basic_usage-311.feature +++ /dev/null @@ -1,211 +0,0 @@ -@addon_mod_quiz @app @javascript @lms_from3.11 @lms_upto3.11 -Feature: Attempt a quiz in app - As a student - In order to demonstrate what I know - I need to be able to attempt quizzes - - # These scenarios are duplicated from main because the manual quiz setup is not - # equivalent before 4.0. - Background: - Given the Moodle site is compatible with this feature - And the following "courses" exist: - | fullname | shortname | - | Course 1 | C1 | - And the following "users" exist: - | username | - | student1 | - | teacher1 | - And the following "course enrolments" exist: - | user | course | role | - | student1 | C1 | student | - | teacher1 | C1 | editingteacher | - And the following "activities" exist: - | activity | name | intro | course | idnumber | - | quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | - And the following "question categories" exist: - | contextlevel | reference | name | - | Course | C1 | Test questions | - And the following "questions" exist: - | questioncategory | qtype | name | questiontext | - | Test questions | truefalse | TF1 | Text of the first question | - | Test questions | truefalse | TF2 | Text of the second question | - And quiz "Quiz 1" contains the following questions: - | question | page | - | TF1 | 1 | - | TF2 | 2 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | - | quiz | Quiz 2 | Quiz 2 description | C1 | quiz2 | - And the following "question categories" exist: - | contextlevel | reference | name | - | Course | C1 | Test questions 2 | - And the following "questions" exist: - | questioncategory | qtype | name | questiontext | - | Test questions | multichoice | TF3 | Text of the first question | - | Test questions | shortanswer | TF4 | Text of the second question | - | Test questions | numerical | TF5 | Text of the third question | - | Test questions | essay | TF6 | Text of the fourth question | - | Test questions | ddwtos | TF7 | The [[1]] brown [[2]] jumped over the [[3]] dog. | - | Test questions | truefalse | TF8 | Text of the sixth question | - | Test questions | match | TF9 | Text of the seventh question | - | Test questions | description | TF10 | Text of the eighth question | - # TODO test calculated question type. - # The calculatedsimple type is implemented using the calculated type. - # The calculatedmulti type is implemented using the multichoice type. - # The randomsamatch type is implemented using the match type. - And the following "questions" exist: - | questioncategory | qtype | name | template | - | Test questions | gapselect | TF11 | missingchoiceno | - | Test questions | ddimageortext | TF12 | xsection | - | Test questions | ddmarker | TF13 | mkmap | - And quiz "Quiz 2" contains the following questions: - | question | page | - | TF3 | 1 | - | TF4 | 2 | - | TF5 | 3 | - | TF6 | 4 | - | TF7 | 5 | - | TF8 | 6 | - | TF9 | 7 | - | TF10 | 8 | - | TF11 | 9 | - | TF12 | 10 | - | TF13 | 11 | - - # TODO rewrite using generators. - And I am on the "Course 1" "core_question > course question bank" page logged in as teacher1 - And I add a "Embedded answers (Cloze)" question filling the form with: - | Question name | multianswer | - | Question text | {1:SHORTANSWER:=Berlin} is the capital of Germany. | - | General feedback | The capital of Germany is Berlin. | - And I am on the "quiz2" "Activity" page - And I click on "Actions menu" "link" - And I click on "Edit quiz" "link" - And I click on "Add" "link" - And I click on "from question bank" "link" - And I set the field with xpath "//tr[contains(normalize-space(.), 'multianswer')]//input[@type='checkbox']" to "1" - And I click on "Add selected questions to the quiz" "button" - And I log out - - Scenario: View a quiz entry page (attempts, status, etc.) - Given I entered the quiz activity "Quiz 1" on course "Course 1" as "student1" in the app - When I press "Attempt quiz now" in the app - Then I should find "Text of the first question" in the app - But I should not find "Text of the second question" in the app - - When I press "Next" in the app - Then I should find "Text of the second question" in the app - But I should not find "Text of the first question" in the app - - When I press "Previous" in the app - Then I should find "Text of the first question" in the app - But I should not find "Text of the second question" in the app - - When I press "Next" in the app - Then I should find "Text of the second question" in the app - But I should not find "Text of the first question" in the app - - When I press "Previous" in the app - Then I should find "Text of the first question" in the app - But I should not find "Text of the second question" in the app - - When I press "Next" in the app - And I press "Submit" in the app - Then I should find "Summary of attempt" in the app - - When I press "Not yet answered" within "2" "ion-item" in the app - Then I should find "Text of the second question" in the app - But I should not find "Text of the first question" in the app - - When I press "Submit" in the app - And I press "Submit all and finish" in the app - Then I should find "Once you submit" in the app - - When I press "Cancel" near "Once you submit" in the app - Then I should find "Summary of attempt" in the app - - When I press "Submit all and finish" in the app - And I press "Submit" near "Once you submit" in the app - Then I should find "Review" in the app - And I should find "Started" in the app - And I should find "Status" in the app - And I should find "Completed" in the app - And I should find "Duration" in the app - And I should find "Marks" in the app - And I should find "Grade" in the app - And I should find "Question 1" in the app - And I should find "Question 2" in the app - - Scenario: Attempt a quiz (all question types) - Given I entered the quiz activity "Quiz 2" on course "Course 1" as "student1" in the app - When I press "Attempt quiz now" in the app - And I press "Four" in the app - And I press "Three" in the app - And I set the field "Answer" to "Berlin" in the app - And I press "Next" in the app - And I set the field "Answer" to "testing" in the app - And I press "Next" in the app - And I set the field "Answer" to "5" in the app - And I press "Next" in the app - And I set the field "Answer" to "Testing an essay" in the app - And I press "Next" "ion-button" in the app - And I press "quick" ".drag" in the app - And I click on ".place1.drop" "css" - And I press "fox" ".drag" in the app - And I click on ".place2.drop" "css" - And I press "lazy" ".drag" in the app - And I click on ".place3.drop" "css" - And I press "Next" in the app - And I press "True" in the app - And I press "Next" in the app - And I set the field "frog" to "amphibian" in the app - And I set the field "newt" to "insect" in the app - And I set the field "cat" to "mammal" in the app - And I press "Next" in the app - Then I should find "Text of the eighth question" in the app - - When I press "Next" in the app - And I set the field "Blank 1" to "cat" in the app - And I set the field "Blank 2" to "mat" in the app - And I press "Next" in the app - And I press "abyssal" ".drag" in the app - And I click on ".place6.dropzone" "css" - And I press "trench" ".drag" in the app - And I click on ".place3.dropzone" "css" - And I press "Next" in the app - And I press "Railway station" ".marker" in the app - And I click on "img.dropbackground" "css" - And I press "Submit" in the app - Then I should find "Answer saved" in the app - And I should find "Incomplete answer" within "10" "ion-item" in the app - But I should not find "Not yet answered" in the app - - When I press "Submit all and finish" in the app - And I press "Submit" in the app - Then I should find "Review" in the app - And I should find "Finished" in the app - And I should find "Not yet graded" in the app - - When I press "Correct" within "Question 2" "ion-card" in the app - Then I should find "The correct answer is: Berlin" in the app - And I should find "Mark 1.00 out of 1.00" in the app - - Scenario: Submit a quiz & Review a quiz attempt - Given I entered the quiz activity "Quiz 1" on course "Course 1" as "student1" in the app - When I press "Attempt quiz now" in the app - Then I should find "Text of the first question" in the app - - When I press "True" in the app - And I press "Next" in the app - And I press "False" in the app - And I press "Submit" in the app - And I press "Submit all and finish" in the app - And I press "Submit" in the app - Then I should find "Review" in the app - - Given I open a browser tab with url "$WWWROOT" - When I am on the "quiz1" Activity page logged in as teacher1 - And I follow "Attempts: 1" - And I follow "Review attempt" - Then I should see "Finished" - And I should see "1.00/2.00" diff --git a/src/addons/mod/quiz/tests/behat/basic_usage-39.feature b/src/addons/mod/quiz/tests/behat/basic_usage-39.feature deleted file mode 100644 index a0771668a..000000000 --- a/src/addons/mod/quiz/tests/behat/basic_usage-39.feature +++ /dev/null @@ -1,116 +0,0 @@ -@addon_mod_quiz @app @javascript @lms_upto3.9 -Feature: Attempt a quiz in app - As a student - In order to demonstrate what I know - I need to be able to attempt quizzes - - Background: - Given the Moodle site is compatible with this feature - And the following "courses" exist: - | fullname | shortname | - | Course 1 | C1 | - And the following "users" exist: - | username | - | student1 | - | teacher1 | - And the following "course enrolments" exist: - | user | course | role | - | student1 | C1 | student | - | teacher1 | C1 | editingteacher | - And the following "activities" exist: - | activity | name | intro | course | idnumber | - | quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | - And the following "question categories" exist: - | contextlevel | reference | name | - | Course | C1 | Test questions | - And the following "questions" exist: - | questioncategory | qtype | name | questiontext | - | Test questions | truefalse | TF1 | Text of the first question | - | Test questions | truefalse | TF2 | Text of the second question | - And quiz "Quiz 1" contains the following questions: - | question | page | - | TF1 | 1 | - | TF2 | 2 | - And the following "activities" exist: - | activity | name | intro | course | idnumber | - | quiz | Quiz 2 | Quiz 2 description | C1 | quiz2 | - And the following "question categories" exist: - | contextlevel | reference | name | - | Course | C1 | Test questions 2 | - And the following "questions" exist: - | questioncategory | qtype | name | questiontext | - | Test questions | multichoice | TF3 | Text of the first question | - | Test questions | shortanswer | TF4 | Text of the second question | - | Test questions | numerical | TF5 | Text of the third question | - | Test questions | essay | TF6 | Text of the fourth question | - | Test questions | ddwtos | TF7 | The [[1]] brown [[2]] jumped over the [[3]] dog. | - | Test questions | truefalse | TF8 | Text of the sixth question | - | Test questions | match | TF9 | Text of the seventh question | - | Test questions | description | TF10 | Text of the eighth question | - And the following "questions" exist: - | questioncategory | qtype | name | template | - | Test questions | gapselect | TF11 | missingchoiceno | - | Test questions | ddimageortext | TF12 | xsection | - | Test questions | ddmarker | TF13 | mkmap | - And quiz "Quiz 2" contains the following questions: - | question | page | - | TF3 | 1 | - | TF4 | 2 | - | TF5 | 3 | - | TF6 | 4 | - | TF7 | 5 | - | TF8 | 6 | - | TF9 | 7 | - | TF10 | 8 | - | TF11 | 9 | - | TF12 | 10 | - | TF13 | 11 | - - # This scenario is duplicated from main because the description type question (the eighth) - # cannot be filled in 3.9, since the selects are missing accessible labels. - Scenario: Attempt a quiz (all question types) - Given I entered the quiz activity "Quiz 2" on course "Course 1" as "student1" in the app - When I press "Attempt quiz now" in the app - And I press "Four" in the app - And I press "Three" in the app - And I press "Next" in the app - And I set the field "Answer" to "testing" in the app - And I press "Next" in the app - And I set the field "Answer" to "5" in the app - And I press "Next" in the app - And I set the field "Answer" to "Testing an essay" in the app - And I press "Next" "ion-button" in the app - And I press "quick" ".drag" in the app - And I click on ".place1.drop" "css" - And I press "fox" ".drag" in the app - And I click on ".place2.drop" "css" - And I press "lazy" ".drag" in the app - And I click on ".place3.drop" "css" - And I press "Next" in the app - And I press "True" in the app - And I press "Next" in the app - And I set the field "frog" to "amphibian" in the app - And I set the field "newt" to "insect" in the app - And I set the field "cat" to "mammal" in the app - And I press "Next" in the app - Then I should find "Text of the eighth question" in the app - - When I press "Next" in the app - And I press "Next" in the app - And I press "abyssal" ".drag" in the app - And I click on ".place6.dropzone" "css" - And I press "trench" ".drag" in the app - And I click on ".place3.dropzone" "css" - And I press "Next" in the app - And I press "Railway station" ".marker" in the app - And I click on "img.dropbackground" "css" - And I press "Submit" in the app - Then I should find "Answer saved" in the app - And I should find "Not yet answered" within "8" "ion-item" in the app - And I should find "Incomplete answer" within "9" "ion-item" in the app - - When I press "Submit all and finish" in the app - And I press "Submit" in the app - Then I should find "Review" in the app - And I should find "Finished" in the app - And I should find "Not yet graded" in the app diff --git a/src/addons/mod/scorm/tests/behat/attempts_and_grading.feature b/src/addons/mod/scorm/tests/behat/attempts_and_grading.feature index ecca4cd07..966c07add 100755 --- a/src/addons/mod/scorm/tests/behat/attempts_and_grading.feature +++ b/src/addons/mod/scorm/tests/behat/attempts_and_grading.feature @@ -609,7 +609,6 @@ Feature: Test attempts and grading settings of SCORM activity in app # And I press the back button in the app # Then I should find "74%" within "Grade reported" "ion-item" in the app -# @lms_from4.1 # Scenario: SCORM grade is calculated right based on 'Attempts grading' setting # Given the following "activities" exist: # | activity | name | course | idnumber | packagefilepath | maxattempt | whatgrade | grademethod | forcenewattempt | diff --git a/src/addons/mod/scorm/tests/behat/availability.feature b/src/addons/mod/scorm/tests/behat/availability.feature index 8df3aad4e..00e9a47bf 100755 --- a/src/addons/mod/scorm/tests/behat/availability.feature +++ b/src/addons/mod/scorm/tests/behat/availability.feature @@ -20,7 +20,6 @@ Feature: Test availability options of SCORM activity in app | scorm | C1 | Current SCORM | mod/scorm/tests/packages/singlesco_scorm12.zip | ##yesterday## | ##tomorrow## | | scorm | C1 | Future SCORM | mod/scorm/tests/packages/singlesco_scorm12.zip | ##tomorrow## | ##+2 days## | - @lms_from4.1 Scenario: Only open SCORMs can be played Given I entered the course "Course 1" as "student1" in the app When I press "Past SCORM" in the app diff --git a/src/addons/mod/survey/tests/behat/basic_usage-311.feature b/src/addons/mod/survey/tests/behat/basic_usage-311.feature deleted file mode 100644 index 7d3a217c8..000000000 --- a/src/addons/mod/survey/tests/behat/basic_usage-311.feature +++ /dev/null @@ -1,277 +0,0 @@ -@addon_mod_survey @app @javascript @lms_upto3.11 -Feature: Test basic usage of survey activity in app - In order to participate in surveys while using the mobile app - As a student - I need basic survey functionality to work - - Background: - Given the Moodle site is compatible with this feature - And the following "courses" exist: - | fullname | shortname | - | Course 1 | C1 | - And the following "users" exist: - | username | - | student1 | - | teacher1 | - And the following "course enrolments" exist: - | user | course | role | - | student1 | C1 | student | - | teacher1 | C1 | editingteacher | - And the following "activities" exist: - | activity | name | intro | course | idnumber | groupmode | - | survey | Test survey name | Test survey | C1 | survey | 0 | - - Scenario: Answer a survey & View results (ATTLS) - Given I entered the survey activity "Test survey name" on course "Course 1" as "student1" in the app - And I set the following fields to these values in the app: - | 1. In evaluating what someone says, I focus on the quality of their argument, not on the person who's presenting it. | Strongly agree | - | 2. I like playing devil's advocate - arguing the opposite of what someone is saying. | Strongly disagree | - | 3. I like to understand where other people are 'coming from', what experiences have led them to feel the way they do. | Somewhat agree | - | 4. The most important part of my education has been learning to understand people who are very different to me. | Somewhat disagree | - | 5. I feel that the best way for me to achieve my own identity is to interact with a variety of other people. | Somewhat agree | - | 6. I enjoy hearing the opinions of people who come from backgrounds different to mine - it helps me to understand how the same things can be seen in such different ways. | Somewhat agree | - | 7. I find that I can strengthen my own position through arguing with someone who disagrees with me. | Somewhat agree | - | 8. I am always interested in knowing why people say and believe the things they do. | Somewhat agree | - | 9. I often find myself arguing with the authors of books that I read, trying to logically figure out why they're wrong. | Somewhat agree | - | 10. It's important for me to remain as objective as possible when I analyze something. | Somewhat agree | - | 11. I try to think with people instead of against them. | Somewhat agree | - | 12. I have certain criteria I use in evaluating arguments. | Somewhat agree | - | 13. I'm more likely to try to understand someone else's opinion than to try to evaluate it. | Somewhat agree | - | 14. I try to point out weaknesses in other people's thinking to help them clarify their arguments. | Somewhat agree | - | 15. I tend to put myself in other people's shoes when discussing controversial issues, to see why they think the way they do. | Somewhat agree | - | 16. One could call my way of analysing things 'putting them on trial' because I am careful to consider all the evidence. | Somewhat agree | - | 17. I value the use of logic and reason over the incorporation of my own concerns when solving problems. | Somewhat agree | - | 18. I can obtain insight into opinions that differ from mine through empathy. | Somewhat agree | - | 19. When I encounter people whose opinions seem alien to me, I make a deliberate effort to 'extend' myself into that person, to try to see how they could have those opinions. | Somewhat agree | - | 20. I spend time figuring out what's 'wrong' with things. For example, I'll look for something in a literary interpretation that isn't argued well enough. | Somewhat agree | - And I press "Submit" in the app - And I press "OK" in the app - And I press "Results" in the app - And I press "OK" in the app - And I switch to the browser tab opened by the app - And I log in as "student1" - Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." - And I should see "1 people have completed this survey so far" - And the following events should have been logged for "student1" in the app: - | name | activity | activityname | course | - | \mod_survey\event\course_module_viewed | survey | Test survey name | Course 1 | - | \mod_survey\event\response_submitted | survey | Test survey name | Course 1 | - - Scenario: Answer a survey & View results (Critical incidents) - Given the following "activities" exist: - | activity | name | intro | template |course | idnumber | groupmode | - | survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 | - Given I entered the survey activity "Test survey critical incidents" on course "Course 1" as "student1" in the app - And I set the following fields to these values in the app: - | At what moment in class were you most engaged as a learner? | 1st answer | - | At what moment in class were you most distanced as a learner? | 2nd answer | - | What action from anyone in the forums did you find most affirming or helpful? | 3rd answer | - | What action from anyone in the forums did you find most puzzling or confusing? | 4th answer | - | What event surprised you most? | 5th answer | - And I press "Submit" in the app - And I press "OK" in the app - Then I should see "Results" - - When I press "Results" in the app - And I press "OK" in the app - And I switch to the browser tab opened by the app - And I log in as "student1" - Then I should see "Test survey critical incidents" - And I should see "1st answer" - And I should see "2nd answer" - And I should see "3rd answer" - And I should see "4th answer" - And I should see "5th answer" - - Scenario: Answer a survey & View results (Colles actual) - Given the following "activities" exist: - | activity | name | intro | template |course | idnumber | groupmode | - | survey | Test survey Colles (actual) | Test survey1 | 1 | C1 | survey1 | 0 | - Given I entered the survey activity "Test survey Colles (actual)" on course "Course 1" as "student1" in the app - And I set the following fields to these values in the app: - | 1. my learning focuses on issues that interest me. | Sometimes | - | 2. what I learn is important for my professional practice. | Sometimes | - | 3. I learn how to improve my professional practice. | Sometimes | - | 4. what I learn connects well with my professional practice. | Sometimes | - | 5. I think critically about how I learn. | Sometimes | - | 6. I think critically about my own ideas. | Sometimes | - | 7. I think critically about other students' ideas. | Sometimes | - | 8. I think critically about ideas in the readings. | Sometimes | - | 9. I explain my ideas to other students. | Sometimes | - | 10. I ask other students to explain their ideas. | Sometimes | - | 11. other students ask me to explain my ideas. | Sometimes | - | 12. other students respond to my ideas. | Sometimes | - | 13. the tutor stimulates my thinking. | Sometimes | - | 14. the tutor encourages me to participate. | Sometimes | - | 15. the tutor models good discourse. | Sometimes | - | 16. the tutor models critical self-reflection. | Sometimes | - | 17. other students encourage my participation. | Sometimes | - | 18. other students praise my contribution. | Sometimes | - | 19. other students value my contribution. | Sometimes | - | 20. other students empathise with my struggle to learn. | Sometimes | - | 21. I make good sense of other students' messages. | Sometimes | - | 22. other students make good sense of my messages. | Sometimes | - | 23. I make good sense of the tutor's messages. | Sometimes | - | 24. the tutor makes good sense of my messages. | Sometimes | - | 25. How long did this survey take you to complete? | under 1 min | - And I press "Submit" in the app - And I press "OK" in the app - Then I should see "You have completed this survey" - - When I press "Results" in the app - And I press "OK" in the app - And I switch to the browser tab opened by the app - And I log in as "student1" - Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." - And I should see "1 people have completed this survey so far" - - Scenario: Answer a survey & View results (Colles preferred) - Given the following "activities" exist: - | activity | name | intro | template | course | idnumber | groupmode | - | survey | Test survey Colles (preferred) | Test survey1 | 2 | C1 | survey1 | 0 | - Given I entered the survey activity "Test survey Colles (preferred)" on course "Course 1" as "student1" in the app - And I set the following fields to these values in the app: - | 1. my learning focuses on issues that interest me. | Sometimes | - | 2. what I learn is important for my professional practice. | Sometimes | - | 3. I learn how to improve my professional practice. | Sometimes | - | 4. what I learn connects well with my professional practice. | Sometimes | - | 5. I think critically about how I learn. | Sometimes | - | 6. I think critically about my own ideas. | Sometimes | - | 7. I think critically about other students' ideas. | Sometimes | - | 8. I think critically about ideas in the readings. | Sometimes | - | 9. I explain my ideas to other students. | Sometimes | - | 10. I ask other students to explain their ideas. | Sometimes | - | 11. other students ask me to explain my ideas. | Sometimes | - | 12. other students respond to my ideas. | Sometimes | - | 13. the tutor stimulates my thinking. | Sometimes | - | 14. the tutor encourages me to participate. | Sometimes | - | 15. the tutor models good discourse. | Sometimes | - | 16. the tutor models critical self-reflection. | Sometimes | - | 17. other students encourage my participation. | Sometimes | - | 18. other students praise my contribution. | Sometimes | - | 19. other students value my contribution. | Sometimes | - | 20. other students empathise with my struggle to learn. | Sometimes | - | 21. I make good sense of other students' messages. | Sometimes | - | 22. other students make good sense of my messages. | Sometimes | - | 23. I make good sense of the tutor's messages. | Sometimes | - | 24. the tutor makes good sense of my messages. | Sometimes | - | 25. How long did this survey take you to complete? | under 1 min | - And I press "Submit" in the app - And I press "OK" in the app - Then I should see "You have completed this survey" - - When I press "Results" in the app - And I press "OK" in the app - And I switch to the browser tab opened by the app - And I log in as "student1" - Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." - And I should see "1 people have completed this survey so far" - - Scenario: Answer a survey & View results (Colles preferred and actual) - Given the following "activities" exist: - | activity | name | intro | template | course | idnumber | groupmode | - | survey | Test survey Colles (preferred and actual) | Test survey1 | 3 | C1 | survey1 | 0 | - Given I entered the survey activity "Test survey Colles (preferred and actual)" on course "Course 1" as "student1" in the app - And I set the following fields to these values in the app: - | 1. I prefer that my learning focuses on issues that interest me. | Sometimes | - | 2. I found that my learning focuses on issues that interest me. | Sometimes | - | 3. I prefer that what I learn is important for my professional practice. | Sometimes | - | 4. I found that what I learn is important for my professional practice. | Sometimes | - | 5. I prefer that I learn how to improve my professional practice. | Sometimes | - | 6. I found that I learn how to improve my professional practice. | Sometimes | - | 7. I prefer that what I learn connects well with my professional practice. | Sometimes | - | 8. I found that what I learn connects well with my professional practice. | Sometimes | - | 9. I prefer that I think critically about how I learn. | Sometimes | - | 10. I found that I think critically about how I learn. | Sometimes | - | 11. I prefer that I think critically about my own ideas. | Sometimes | - | 12. I found that I think critically about my own ideas. | Sometimes | - | 13. I prefer that I think critically about other students' ideas. | Sometimes | - | 14. I found that I think critically about other students' ideas. | Sometimes | - | 15. I prefer that I think critically about ideas in the readings. | Sometimes | - | 16. I found that I think critically about ideas in the readings. | Sometimes | - | 17. I prefer that I explain my ideas to other students. | Sometimes | - | 18. I found that I explain my ideas to other students. | Sometimes | - | 19. I prefer that I ask other students to explain their ideas. | Sometimes | - | 20. I found that I ask other students to explain their ideas. | Sometimes | - | 21. I prefer that other students ask me to explain my ideas. | Sometimes | - | 22. I found that other students ask me to explain my ideas. | Sometimes | - | 23. I prefer that other students respond to my ideas. | Sometimes | - | 24. I found that other students respond to my ideas. | Sometimes | - | 25. I prefer that the tutor stimulates my thinking. | Sometimes | - | 26. I found that the tutor stimulates my thinking. | Sometimes | - | 27. I prefer that the tutor encourages me to participate. | Sometimes | - | 28. I found that the tutor encourages me to participate. | Sometimes | - | 29. I prefer that the tutor models good discourse. | Sometimes | - | 30. I found that the tutor models good discourse. | Sometimes | - | 31. I prefer that the tutor models critical self-reflection. | Sometimes | - | 32. I found that the tutor models critical self-reflection. | Sometimes | - | 33. I prefer that other students encourage my participation. | Sometimes | - | 34. I found that other students encourage my participation. | Sometimes | - | 35. I prefer that other students praise my contribution. | Sometimes | - | 36. I found that other students praise my contribution. | Sometimes | - | 37. I prefer that other students value my contribution. | Sometimes | - | 38. I found that other students value my contribution. | Sometimes | - | 39. I prefer that other students empathise with my struggle to learn. | Sometimes | - | 40. I found that other students empathise with my struggle to learn. | Sometimes | - | 41. I prefer that I make good sense of other students' messages. | Sometimes | - | 42. I found that I make good sense of other students' messages. | Sometimes | - | 43. I prefer that other students make good sense of my messages. | Sometimes | - | 44. I found that other students make good sense of my messages. | Sometimes | - | 45. I prefer that I make good sense of the tutor's messages. | Sometimes | - | 46. I found that I make good sense of the tutor's messages. | Sometimes | - | 47. I prefer that the tutor makes good sense of my messages. | Sometimes | - | 48. I found that the tutor makes good sense of my messages. | Sometimes | - | 49. How long did this survey take you to complete? | 1-2 min | - And I press "Submit" in the app - And I press "OK" in the app - Then I should see "You have completed this survey" - - When I press "Results" in the app - And I press "OK" in the app - And I switch to the browser tab opened by the app - And I log in as "student1" - Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." - And I should see "1 people have completed this survey so far" - - Scenario: Answer survey offline & Sync survey - Given the following "activities" exist: - | activity | name | intro | template | course | idnumber | groupmode | - | survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 | - Given I entered the survey activity "Test survey critical incidents" on course "Course 1" as "student1" in the app - And I switch network connection to offline - And I press "Submit" in the app - And I press "OK" in the app - Then I should see "This Survey has offline data to be synchronised." - - When I switch network connection to wifi - And I press the back button in the app - And I press "Test survey critical incidents" in the app - And I press "Information" in the app - And I press "Refresh" in the app - Then I should see "Results" - And I should see "You have completed this survey." - But I should not see "This Survey has offline data to be synchronised." - - Scenario: Prefetch & Auto-sync survey - Given the following "activities" exist: - | activity | name | intro | template | course | idnumber | groupmode | - | survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 | - Given I entered the course "Course 1" as "student1" in the app - And I press "Course downloads" in the app - And I press "Download" within "Test survey critical incidents" "ion-item" in the app - And I press the back button in the app - And I switch network connection to offline - And I press "Test survey name" in the app - Then I should see "There was a problem connecting to the site. Please check your connection and try again." - - When I press "OK" in the app - And I press the back button in the app - And I press "Test survey critical incidents" in the app - And I press "Submit" in the app - And I press "OK" in the app - Then I should see "This Survey has offline data to be synchronised." - - When I switch network connection to wifi - And I run cron tasks in the app - Then I should not see "This Survey has offline data to be synchronised." - And I should see "You have completed this survey." diff --git a/src/addons/mod/survey/tests/behat/basic_usage.feature b/src/addons/mod/survey/tests/behat/basic_usage.feature index 6b58767dc..e30cf866b 100755 --- a/src/addons/mod/survey/tests/behat/basic_usage.feature +++ b/src/addons/mod/survey/tests/behat/basic_usage.feature @@ -1,4 +1,4 @@ -@addon_mod_survey @app @javascript @lms_from4.0 +@addon_mod_survey @app @javascript Feature: Test basic usage of survey activity in app In order to participate in surveys while using the mobile app As a student diff --git a/src/addons/mod/workshop/tests/behat/basic_usage.feature b/src/addons/mod/workshop/tests/behat/basic_usage.feature index 1ba761a3b..c9c7e07b5 100644 --- a/src/addons/mod/workshop/tests/behat/basic_usage.feature +++ b/src/addons/mod/workshop/tests/behat/basic_usage.feature @@ -19,7 +19,6 @@ Feature: Test basic usage of workshop activity in app | activity | name | intro | course | idnumber | | workshop | Test workshop | Workshop description | C1 | workshop | - @lms_from3.11 Scenario: Take a workshop # Setup phase diff --git a/src/addons/notifications/tests/behat/notifications.feature b/src/addons/notifications/tests/behat/notifications.feature index bc7255565..f5e17deb6 100644 --- a/src/addons/notifications/tests/behat/notifications.feature +++ b/src/addons/notifications/tests/behat/notifications.feature @@ -1,4 +1,4 @@ -@addon_notifications @app @javascript @lms_from3.11 +@addon_notifications @app @javascript Feature: Notifications Background: diff --git a/src/core/features/comments/tests/behat/basic_usage.feature b/src/core/features/comments/tests/behat/basic_usage.feature index cdfc98e76..a17afe8cf 100644 --- a/src/core/features/comments/tests/behat/basic_usage.feature +++ b/src/core/features/comments/tests/behat/basic_usage.feature @@ -1,4 +1,4 @@ -@core_comments @app @javascript @lms_from3.11 +@core_comments @app @javascript Feature: Test basic usage of comments in app In order to participate in the comments while using the mobile app As a student diff --git a/src/core/features/course/tests/behat/basic_usage.feature b/src/core/features/course/tests/behat/basic_usage.feature index 6ba1371c2..04ac75b4c 100755 --- a/src/core/features/course/tests/behat/basic_usage.feature +++ b/src/core/features/course/tests/behat/basic_usage.feature @@ -1,4 +1,4 @@ -@core_course @app @javascript @lms_from4.1 +@core_course @app @javascript Feature: Test basic usage of one course in app In order to participate in one course while using the mobile app As a student diff --git a/src/core/features/course/tests/behat/course_completion-310.feature b/src/core/features/course/tests/behat/course_completion-310.feature deleted file mode 100644 index 372e245ff..000000000 --- a/src/core/features/course/tests/behat/course_completion-310.feature +++ /dev/null @@ -1,34 +0,0 @@ -@core_course @app @javascript @lms_upto3.10 -Feature: Check course completion feature. - In order to track the progress of the course on mobile device - As a student - I need to be able to update the activity completion status. - - Background: - Given the following "users" exist: - | username | firstname | lastname | email | - | student1 | Student | 1 | student1@example.com | - And the following "courses" exist: - | fullname | shortname | category | enablecompletion | - | Course 1 | C1 | 0 | 1 | - And the following "course enrolments" exist: - | user | course | role | - | student1 | C1 | student | - - Scenario: Activity completion, marking the checkbox manually - Given the following "activities" exist: - | activity | name | course | idnumber | completion | completionview | - | forum | First forum | C1 | forum1 | 1 | 0 | - | forum | Second forum | C1 | forum2 | 1 | 0 | - And I entered the course "Course 1" as "student1" in the app - # Set activities as completed. - Then I should find "0%" in the app - And I click on "ion-button[title=\"Not completed: First forum. Select to mark as complete.\"]" "css" - And I should find "50%" in the app - And I click on "ion-button[title=\"Not completed: Second forum. Select to mark as complete.\"]" "css" - And I should find "100%" in the app - # Set activities as not completed. - And I click on "ion-button[title=\"Completed: First forum. Select to mark as not complete.\"]" "css" - And I should find "50%" in the app - And I click on "ion-button[title=\"Completed: Second forum. Select to mark as not complete.\"]" "css" - And I should find "0%" in the app diff --git a/src/core/features/course/tests/behat/course_completion.feature b/src/core/features/course/tests/behat/course_completion.feature index a6b4cc3eb..c8845734e 100644 --- a/src/core/features/course/tests/behat/course_completion.feature +++ b/src/core/features/course/tests/behat/course_completion.feature @@ -15,7 +15,6 @@ Feature: Check course completion feature. | user | course | role | | student1 | C1 | student | - @lms_from3.11 Scenario: Activity completion, marking the checkbox manually Given the following "activities" exist: | activity | name | course | idnumber | completion | completionview | diff --git a/src/core/features/course/tests/behat/courselist-311.feature b/src/core/features/course/tests/behat/courselist-311.feature deleted file mode 100644 index 1b423d164..000000000 --- a/src/core/features/course/tests/behat/courselist-311.feature +++ /dev/null @@ -1,118 +0,0 @@ -@core_course @app @javascript @lms_upto3.11 -Feature: Test course list shown on app start tab - In order to select a course - As a student - I need to see the correct list of courses - - Background: - Given the following "courses" exist: - | fullname | shortname | - | Course 1 | C1 | - | Course 2 | C2 | - And the following "users" exist: - | username | - | student1 | - | student2 | - And the following "course enrolments" exist: - | user | course | role | - | student1 | C1 | student | - | student2 | C1 | student | - | student2 | C2 | student | - - Scenario: View courses (shortnames not displayed) - Given I entered the app as "student1" - When I should find "Course 1" in the app - But I should not find "Course 2" in the app - But I should not find "C1" in the app - But I should not find "C2" in the app - - Given I entered the app as "student2" - When I should find "Course 1" in the app - And I should find "Course 2" in the app - But I should not find "C1" in the app - But I should not find "C2" in the app - - Scenario: Filter courses - Given the following config values are set as admin: - | courselistshortnames | 1 | - And the following "courses" exist: - | fullname | shortname | - | Frog 3 | C3 | - | Frog 4 | C4 | - | Course 5 | C5 | - | Toad 6 | C6 | - And the following "course enrolments" exist: - | user | course | role | - | student2 | C3 | student | - | student2 | C4 | student | - | student2 | C5 | student | - | student2 | C6 | student | - # Create bogus courses so that the main ones aren't shown in the 'recently accessed' part. - # Because these come later in alphabetical order, they may not be displayed in the lower part - # which is OK. - And the following "courses" exist: - | fullname | shortname | - | Zogus 1 | Z1 | - | Zogus 2 | Z2 | - | Zogus 3 | Z3 | - | Zogus 4 | Z4 | - | Zogus 5 | Z5 | - | Zogus 6 | Z6 | - | Zogus 7 | Z7 | - | Zogus 8 | Z8 | - | Zogus 9 | Z9 | - | Zogus 10 | Z10 | - And the following "course enrolments" exist: - | user | course | role | - | student2 | Z1 | student | - | student2 | Z2 | student | - | student2 | Z3 | student | - | student2 | Z4 | student | - | student2 | Z5 | student | - | student2 | Z6 | student | - | student2 | Z7 | student | - | student2 | Z8 | student | - | student2 | Z9 | student | - | student2 | Z10 | student | - Given I entered the app as "student2" - When I should find "C1" in the app - And I should find "C2" in the app - And I should find "C3" in the app - And I should find "C4" in the app - And I should find "C5" in the app - And I should find "C6" in the app - And I should find "Course 1" in the app - And I should find "Course 2" in the app - And I should find "Frog 3" in the app - And I should find "Frog 4" in the app - And I should find "Course 5" in the app - And I should find "Toad 6" in the app - - And I set the field "search text" to "fr" in the app - - Then I should find "C3" in the app - And I should find "C4" in the app - And I should find "Frog 3" in the app - And I should find "Frog 4" in the app - But I should not find "C1" in the app - And I should not find "C2" in the app - And I should not find "C5" in the app - And I should not find "C6" in the app - And I should not find "Course 1" in the app - And I should not find "Course 2" in the app - And I should not find "Course 5" in the app - And I should not find "Toad 6" in the app - - When I set the field "search text" to "" in the app - Then I should find "C1" in the app - And I should find "C2" in the app - And I should find "C3" in the app - And I should find "C4" in the app - And I should find "C5" in the app - And I should find "C6" in the app - And I should find "Course 1" in the app - And I should find "Course 2" in the app - And I should find "Frog 3" in the app - And I should find "Frog 4" in the app - And I should find "Course 5" in the app - And I should find "Toad 6" in the app diff --git a/src/core/features/course/tests/behat/courselist.feature b/src/core/features/course/tests/behat/courselist.feature index ec3bff356..f8ba5ead6 100644 --- a/src/core/features/course/tests/behat/courselist.feature +++ b/src/core/features/course/tests/behat/courselist.feature @@ -19,7 +19,6 @@ Feature: Test course list shown on app start tab | student2 | C1 | student | | student2 | C2 | student | - @lms_from4.0 Scenario: View courses (shortnames not displayed) Given I entered the app as "student1" When I press "My courses" in the app @@ -35,7 +34,6 @@ Feature: Test course list shown on app start tab But I should not find "C1" in the app But I should not find "C2" in the app - @lms_from4.0 Scenario: Filter courses Given the following config values are set as admin: | courselistshortnames | 1 | diff --git a/src/core/features/course/tests/behat/guest_access.feature b/src/core/features/course/tests/behat/guest_access.feature index 67085d6a6..b653ea2a7 100644 --- a/src/core/features/course/tests/behat/guest_access.feature +++ b/src/core/features/course/tests/behat/guest_access.feature @@ -20,7 +20,6 @@ Feature: Test basic usage of guest access course in app | activity | name | intro | course | idnumber | groupmode | | wiki | Test wiki name | Test wiki | C1 | wiki | 0 | - @lms_from4.0 Scenario: Guest access without password (student) Given I am on the "Course 1" "enrolment methods" page logged in as "teacher1" And I click on "Edit" "link" in the "Guest access" "table_row" diff --git a/src/core/features/course/tests/behat/relative_dates-403.feature b/src/core/features/course/tests/behat/relative_dates-403.feature index a78329421..46a97d11e 100644 --- a/src/core/features/course/tests/behat/relative_dates-403.feature +++ b/src/core/features/course/tests/behat/relative_dates-403.feature @@ -1,4 +1,4 @@ -@core_course @app @javascript @lms_from4.0 @lms_upto4.3 +@core_course @app @javascript @lms_upto4.3 Feature: Check relative dates feature. Background: diff --git a/src/core/features/courses/tests/behat/basic-usage-402.feature b/src/core/features/courses/tests/behat/basic-usage-402.feature index 0e15a20ec..4e6fc5b9d 100644 --- a/src/core/features/courses/tests/behat/basic-usage-402.feature +++ b/src/core/features/courses/tests/behat/basic-usage-402.feature @@ -38,7 +38,6 @@ Feature: Test basic usage of courses in app | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | gradingduedate | | assign | C1 | assign1 | assignment | Test assignment description | 1 | ##tomorrow## | ##tomorrow## | - @lms_from4.0 Scenario: See my courses Given I entered the app as "student1" When the header should be "Acceptance test site" in the app diff --git a/src/core/features/courses/tests/behat/basic_usage-310.feature b/src/core/features/courses/tests/behat/basic_usage-310.feature deleted file mode 100755 index 1f941e4f9..000000000 --- a/src/core/features/courses/tests/behat/basic_usage-310.feature +++ /dev/null @@ -1,69 +0,0 @@ -@core_courses @app @javascript @lms_upto3.10 -Feature: Test basic usage of courses in app - In order to participate in the courses while using the mobile app - As a student - I need basic courses functionality to work - - Background: - Given the following "users" exist: - | username | firstname | lastname | email | - | teacher1 | Teacher | teacher | teacher1@example.com | - | student1 | Student | student | student1@example.com | - And the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | - | Course 2 | C2 | 0 | - | Course 3 | C3 | 0 | - | Course 4 | C4 | 0 | - And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | teacher1 | C2 | editingteacher | - | teacher1 | C3 | editingteacher | - | teacher1 | C4 | editingteacher | - | student1 | C1 | student | - | student1 | C2 | student | - | student1 | C3 | student | - And the following "activities" exist: - | activity | name | intro | course | idnumber | option | - | choice | Choice course 1 | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | - | choice | Choice course 2 | Test choice description | C2 | choice1 | Option 1, Option 2, Option 3 | - | choice | Choice course 3 | Test choice description | C3 | choice1 | Option 1, Option 2, Option 3 | - | choice | Choice course 4 | Test choice description | C4 | choice1 | Option 1, Option 2, Option 3 | - And the following "activities" exist: - | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | gradingduedate | - | assign | C1 | assign1 | assignment | Test assignment description | 1 | ##tomorrow## | ##tomorrow## | - - Scenario: Links to actions in Timeline work for teachers/students - # Submit assignment as student - Given I entered the app as "student1" - When I press "Open block drawer" in the app - And I press "Add submission" in the app - Then the header should be "assignment" in the app - And I should find "Test assignment description" in the app - And I should find "No attempt" in the app - And I should find "Due date" in the app - - When I press "Add submission" in the app - And I set the field "Online text submissions" to "test" in the app - And I press "Save" in the app - And I press "Submit assignment" in the app - And I press "OK" in the app - Then the header should be "assignment" in the app - And I should find "Test assignment description" in the app - And I should find "Submitted for grading" in the app - And I should find "Due date" in the app - - # Grade assignment as teacher - Given I entered the app as "teacher1" - When I press "Open block drawer" in the app - And I press "Grade" in the app - Then the header should be "assignment" in the app - - When I pull to refresh in the app - Then I should find "Test assignment description" in the app - And I should find "Time remaining" in the app - - When I press "Needs grading" in the app - Then I should find "Student student" in the app - And I should find "Not graded" in the app diff --git a/src/core/features/courses/tests/behat/basic_usage-311.feature b/src/core/features/courses/tests/behat/basic_usage-311.feature deleted file mode 100755 index 9b039c22a..000000000 --- a/src/core/features/courses/tests/behat/basic_usage-311.feature +++ /dev/null @@ -1,113 +0,0 @@ -@core_courses @app @javascript @lms_upto3.11 -Feature: Test basic usage of courses in app - In order to participate in the courses while using the mobile app - As a student - I need basic courses functionality to work - - Background: - Given the following "users" exist: - | username | firstname | lastname | email | - | teacher1 | Teacher | teacher | teacher1@example.com | - | student1 | Student | student | student1@example.com | - And the following "courses" exist: - | fullname | shortname | category | - | Course 1 | C1 | 0 | - | Course 2 | C2 | 0 | - | Course 3 | C3 | 0 | - | Course 4 | C4 | 0 | - And the following "course enrolments" exist: - | user | course | role | - | teacher1 | C1 | editingteacher | - | teacher1 | C2 | editingteacher | - | teacher1 | C3 | editingteacher | - | teacher1 | C4 | editingteacher | - | student1 | C1 | student | - | student1 | C2 | student | - | student1 | C3 | student | - And the following "activities" exist: - | activity | name | intro | course | idnumber | option | - | choice | Choice course 1 | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | - | choice | Choice course 2 | Test choice description | C2 | choice1 | Option 1, Option 2, Option 3 | - | choice | Choice course 3 | Test choice description | C3 | choice1 | Option 1, Option 2, Option 3 | - | choice | Choice course 4 | Test choice description | C4 | choice1 | Option 1, Option 2, Option 3 | - And the following "activities" exist: - | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | gradingduedate | - | assign | C1 | assign1 | assignment | Test assignment description | 1 | ##tomorrow## | ##tomorrow## | - - Scenario: "Dashboard" tab displayed - Given I entered the app as "student1" - When I should see "Dashboard" - And the header should be "Acceptance test site" in the app - And I should find "Course 1" in the app - And I should find "Course 2" in the app - And I should find "Course 3" in the app - - When I press "Site home" in the app - Then I should find "Dashboard" in the app - And the header should be "Acceptance test site" in the app - - When I press "Dashboard" in the app - Then I should find "Course 1" in the app - And I should find "Course 2" in the app - And I should find "Course 3" in the app - - Scenario: See my courses - Given I entered the app as "student1" - When the header should be "Acceptance test site" in the app - And I should find "Course 1" in the app - And I should find "Course 2" in the app - And I should find "Course 3" in the app - - When I press "Course 1" in the app - Then I should find "Choice course 1" in the app - And the header should be "Course 1" in the app - - When I press "Choice course 1" in the app - Then I should find "Test choice description" in the app - And the header should be "Choice course 1" in the app - - When I press the back button in the app - And I press the back button in the app - And I press "Course 2" in the app - Then I should find "Choice course 2" in the app - And the header should be "Course 2" in the app - - When I press the back button in the app - And I press "Course 3" in the app - Then I should find "Choice course 3" in the app - And the header should be "Course 3" in the app - - @lms_from3.11 - Scenario: Links to actions in Timeline work for teachers/students - # Submit assignment as student - Given I entered the app as "student1" - When I press "Open block drawer" in the app - And I press "Add submission" in the app - Then the header should be "assignment" in the app - And I should find "Test assignment description" in the app - And I should find "No attempt" in the app - And I should find "Due:" in the app - - When I press "Add submission" in the app - And I set the field "Online text submissions" to "test" in the app - And I press "Save" in the app - And I press "Submit assignment" in the app - And I press "OK" in the app - Then the header should be "assignment" in the app - And I should find "Test assignment description" in the app - And I should find "Submitted for grading" in the app - And I should find "Due:" in the app - - # Grade assignment as teacher - Given I entered the app as "teacher1" - When I press "Open block drawer" in the app - And I press "Grade" in the app - Then the header should be "assignment" in the app - - When I pull to refresh in the app - Then I should find "Test assignment description" in the app - And I should find "Time remaining" in the app - - When I press "Needs grading" in the app - Then I should find "Student student" in the app - And I should find "Not graded" in the app diff --git a/src/core/features/courses/tests/behat/basic_usage.feature b/src/core/features/courses/tests/behat/basic_usage.feature index 0cc50f205..bc23c6f41 100755 --- a/src/core/features/courses/tests/behat/basic_usage.feature +++ b/src/core/features/courses/tests/behat/basic_usage.feature @@ -37,7 +37,6 @@ Feature: Test basic usage of courses in app | activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | gradingduedate | | assign | C1 | assign1 | assignment | Test assignment description | 1 | ##tomorrow## | ##tomorrow## | - @lms_from4.0 Scenario: "Dashboard" tab displayed Given I entered the app as "student1" When I should see "Dashboard" @@ -52,7 +51,6 @@ Feature: Test basic usage of courses in app And I should find "Course 2" in the app And I should find "Course 3" in the app - @lms_from4.0 Scenario: Hidden course is only accessible for teachers Given I entered the app as "teacher1" And I press "My courses" in the app @@ -118,7 +116,6 @@ Feature: Test basic usage of courses in app And I should find "Course 3" in the app And I should find "Course 4" in the app - @lms_from4.0 Scenario: Links to actions in Timeline work for teachers/students # Submit assignment as student Given I entered the app as "student1" diff --git a/src/core/features/grades/tests/behat/navigation-401.feature b/src/core/features/grades/tests/behat/navigation-401.feature index e0bea0d71..4cff19b5f 100644 --- a/src/core/features/grades/tests/behat/navigation-401.feature +++ b/src/core/features/grades/tests/behat/navigation-401.feature @@ -1,4 +1,4 @@ -@core_grades @app @javascript @lms_from3.11 @lms_upto4.1 +@core_grades @app @javascript @lms_upto4.1 Feature: Grades navigation Background: diff --git a/src/core/features/grades/tests/behat/navigation.feature b/src/core/features/grades/tests/behat/navigation.feature index cdcf62133..8182ee7f1 100644 --- a/src/core/features/grades/tests/behat/navigation.feature +++ b/src/core/features/grades/tests/behat/navigation.feature @@ -1,4 +1,4 @@ -@core_grades @app @javascript @lms_from3.11 +@core_grades @app @javascript Feature: Grades navigation Background: diff --git a/src/core/features/grades/tests/behat/view.feature b/src/core/features/grades/tests/behat/view.feature index f9c386696..bdab98ba5 100644 --- a/src/core/features/grades/tests/behat/view.feature +++ b/src/core/features/grades/tests/behat/view.feature @@ -1,4 +1,4 @@ -@core_grades @app @javascript @lms_from4.0 +@core_grades @app @javascript Feature: View grades Background: diff --git a/src/core/features/login/tests/behat/basic-usage-400.feature b/src/core/features/login/tests/behat/basic-usage-400.feature deleted file mode 100644 index 354ce54a2..000000000 --- a/src/core/features/login/tests/behat/basic-usage-400.feature +++ /dev/null @@ -1,19 +0,0 @@ -@core_login @app @javascript @lms_from4.0 @lms_upto4.0 -Feature: Test basic usage of login in app - I need basic login functionality to work - - Background: - Given the following "users" exist: - | username | firstname | lastname | - | student1 | david | student | - - Scenario: Forgot password - When I enter the app - And I press "Lost password?" in the app - And I set the field "Enter either username or email address" to "student1" - And I press "Search" in the app - Then I should find "Success" in the app - - When I press "OK" in the app - And I press "Lost password?" in the app - Then I should find "Contact support" in the app diff --git a/src/core/features/login/tests/behat/basic_usage-311.feature b/src/core/features/login/tests/behat/basic_usage-311.feature deleted file mode 100644 index 0f4ba6113..000000000 --- a/src/core/features/login/tests/behat/basic_usage-311.feature +++ /dev/null @@ -1,19 +0,0 @@ -@core_login @app @javascript @lms_upto3.11 -Feature: Test basic usage of login in app - I need basic login functionality to work - - Background: - Given the following "users" exist: - | username | firstname | lastname | - | student1 | david | student | - - Scenario: Forgot password - When I enter the app - And I press "Lost password?" in the app - And I set the field "Enter either username or email address" to "student1" - And I press "Search" in the app - Then I should find "Success" in the app - - When I press "OK" in the app - And I press "Lost password?" in the app - Then I should not find "Contact support" in the app diff --git a/src/core/features/login/tests/behat/basic_usage.feature b/src/core/features/login/tests/behat/basic_usage.feature index b1f4c57d6..ee070c9bb 100755 --- a/src/core/features/login/tests/behat/basic_usage.feature +++ b/src/core/features/login/tests/behat/basic_usage.feature @@ -146,7 +146,6 @@ Feature: Test basic usage of login in app When I press "Reconnect" in the app Then I should find "Acceptance test site" in the app - @lms_from4.1 Scenario: Forgot password Given the following config values are set as admin: | supportavailability | 2 | diff --git a/src/core/features/login/tests/behat/signup-309.feature b/src/core/features/login/tests/behat/signup-309.feature deleted file mode 100644 index b486f12e8..000000000 --- a/src/core/features/login/tests/behat/signup-309.feature +++ /dev/null @@ -1,45 +0,0 @@ -@core_login @app @javascript @lms_upto3.9 -Feature: Test signup in app - I need basic signup functionality to work - - # These scenarios are duplicated from main because the error message about - # non alpha-numeric characters has changed. - Background: - Given the following config values are set as admin: - | registerauth | email | - | auth_instructions | These are the authentication instructions. | - | passwordpolicy | 0 | - - Scenario: Check password policy in signup - Given the following config values are set as admin: - | passwordpolicy | 1 | - | minpasswordlength | 8 | - | minpassworddigits | 1 | - | minpasswordlower | 1 | - | minpasswordupper | 1 | - | minpasswordnonalphanum | 1 | - When I launch the app - And I set the field "Your site" to "$WWWROOT" in the app - And I press "Connect to your site" in the app - And I press "Create new account" in the app - Then I should find "The password must have at least 8 characters" in the app - And I set the following fields to these values in the app: - | Username | u1 | - | Password | pu1 | - | Email address | u1@u1.com | - | Email (again) | u1@u1.com | - | First name | User | - | Last name | Test | - | City/town | Barcelona | - | Country | Spain | - And I press "Create my new account" in the app - Then I should find "Error" in the app - And I should find "Passwords must be at least 8 characters long" in the app - And I should find "Passwords must have at least 1 upper case letter(s)" in the app - And I should find "Passwords must have at least 1 non-alphanumeric character(s)" in the app - But I should not find "An email should have been sent to your address" in the app - - When I press "OK" in the app - And I set the field "Password" to "Password1$" in the app - And I press "Create my new account" in the app - Then I should find "An email should have been sent to your address" in the app diff --git a/src/core/features/login/tests/behat/signup.feature b/src/core/features/login/tests/behat/signup.feature index 919614186..1ad41795e 100755 --- a/src/core/features/login/tests/behat/signup.feature +++ b/src/core/features/login/tests/behat/signup.feature @@ -80,7 +80,6 @@ Feature: Test signup in app Then I should find "Spain" in the app And I should find "u1@u1.com" in the app - @lms_from4.1 Scenario: Check password policy in signup Given the following config values are set as admin: | passwordpolicy | 1 | @@ -115,7 +114,6 @@ Feature: Test signup in app And I press "Create my new account" in the app Then I should find "An email should have been sent to your address" in the app - @lms_from3.11 Scenario: Signup with custom profile fields # Use default options Yes/No for menu field because it's not possible to add new lines. See MDL-75788. Given the following "custom profile fields" exist: diff --git a/src/core/features/mainmenu/tests/behat/mainmenu-311.feature b/src/core/features/mainmenu/tests/behat/mainmenu-311.feature deleted file mode 100644 index f07160209..000000000 --- a/src/core/features/mainmenu/tests/behat/mainmenu-311.feature +++ /dev/null @@ -1,23 +0,0 @@ -@core_mainmenu @app @javascript @lms_upto3.11 -Feature: Main Menu opens the right page - - Background: - Given the following "users" exist: - | username | - | student | - - Scenario: Opens Site Home when defaulthomepage is set to Site - Given the following config values are set as admin: - | defaulthomepage | 0 | - Given I entered the app as "student" - When "Site home" should be selected in the app - And I should find "Available courses" in the app - And "Site home" "text" should appear before "Dashboard" "text" in the ".core-tabs-bar" "css_element" - - Scenario: Opens Dashboard when defaulthomepage is set to Dashboard - Given the following config values are set as admin: - | defaulthomepage | 1 | - Given I entered the app as "student" - When "Dashboard" should be selected in the app - And I should find "Course overview" in the app - And "Dashboard" "text" should appear before "Site home" "text" in the ".core-tabs-bar" "css_element" diff --git a/src/core/features/mainmenu/tests/behat/mainmenu.feature b/src/core/features/mainmenu/tests/behat/mainmenu.feature index cb3835448..e1724643c 100644 --- a/src/core/features/mainmenu/tests/behat/mainmenu.feature +++ b/src/core/features/mainmenu/tests/behat/mainmenu.feature @@ -12,7 +12,6 @@ Feature: Main Menu opens the right page | user | course | role | | student | C1 | student | - @lms_from4.0 Scenario: Opens Site Home when defaulthomepage is set to Site Given the following config values are set as admin: | defaulthomepage | 0 | @@ -22,7 +21,6 @@ Feature: Main Menu opens the right page And "Site home" "text" should appear before "Dashboard" "text" in the ".core-tabs-bar" "css_element" And "Home" "text" should appear before "My courses" "text" in the ".mainmenu-tabs" "css_element" - @lms_from4.0 Scenario: Opens Dashboard when defaulthomepage is set to Dashboard Given the following config values are set as admin: | defaulthomepage | 1 | @@ -32,7 +30,6 @@ Feature: Main Menu opens the right page And "Dashboard" "text" should appear before "Site home" "text" in the ".core-tabs-bar" "css_element" And "Home" "text" should appear before "My courses" "text" in the ".mainmenu-tabs" "css_element" - @lms_from4.0 Scenario: Opens My Courses when defaulthomepage is set to My Courses Given the following config values are set as admin: | defaulthomepage | 3 | @@ -42,7 +39,6 @@ Feature: Main Menu opens the right page And "My courses" "text" should appear before "Home" "text" in the ".mainmenu-tabs" "css_element" # @todo MOBILE-4119: This test is too flaky to run in CI until the race condition is fixed. -# @lms_from4.0 # Scenario: Opens first tab after Site Home, Dashboard, and My Courses are disabled # Given I entered the app as "student" # Then "Dashboard" should be selected in the app diff --git a/src/core/features/reminders/tests/behat/activity_reminders.feature b/src/core/features/reminders/tests/behat/activity_reminders.feature index 5a9f41401..2fa6226e3 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 @@ -@core_reminders @app @javascript @lms_from4.0 +@core_reminders @app @javascript Feature: Set a new reminder on activity Background: diff --git a/src/core/features/reportbuilder/tests/behat/reportbuilder.feature b/src/core/features/reportbuilder/tests/behat/reportbuilder.feature index 77465a5b9..caf7d681d 100644 --- a/src/core/features/reportbuilder/tests/behat/reportbuilder.feature +++ b/src/core/features/reportbuilder/tests/behat/reportbuilder.feature @@ -1,4 +1,4 @@ -@core_reportbuilder @app @javascript @lms_from4.1 +@core_reportbuilder @app @javascript Feature: Report builder Background: diff --git a/src/core/features/user/tests/behat/basic_usage.feature b/src/core/features/user/tests/behat/basic_usage.feature index dfab7dc48..b64ebbb97 100755 --- a/src/core/features/user/tests/behat/basic_usage.feature +++ b/src/core/features/user/tests/behat/basic_usage.feature @@ -7,7 +7,6 @@ Feature: Test basic usage of user features | username | firstname | lastname | timezone | | student1 | Student | Student | 99 | - @lms_from4.1 Scenario: Complete missing fields Given the following "custom profile fields" exist: | datatype | shortname | name | required | param1 | @@ -56,7 +55,6 @@ Feature: Test basic usage of user features When I press "Reconnect" in the app Then I should find "Acceptance test site" in the app - @lms_from4.1 Scenario: View profile Given the following "custom profile fields" exist: | datatype | shortname | name | required | param1 | diff --git a/src/core/features/user/tests/behat/support-311.feature b/src/core/features/user/tests/behat/support-311.feature deleted file mode 100644 index d540b7855..000000000 --- a/src/core/features/user/tests/behat/support-311.feature +++ /dev/null @@ -1,13 +0,0 @@ -@core_user @app @javascript @lms_upto3.11 -Feature: Site support - - Background: - Given the following "users" exist: - | username | firstname | lastname | - | student1 | Student | Student | - - Scenario: Cannot contact support - Given I entered the app as "student1" - When I press the user menu button in the app - Then I should find "Blog entries" in the app - But I should not find "Support" in the app diff --git a/src/core/features/user/tests/behat/support.feature b/src/core/features/user/tests/behat/support.feature index 2b77e5cda..d426a9c04 100644 --- a/src/core/features/user/tests/behat/support.feature +++ b/src/core/features/user/tests/behat/support.feature @@ -1,4 +1,4 @@ -@core_user @app @javascript @lms_from4.0 +@core_user @app @javascript Feature: Site support Background: diff --git a/src/core/tests/behat/customlangstrings.feature b/src/core/tests/behat/customlangstrings.feature index bb40bf765..244cadf15 100644 --- a/src/core/tests/behat/customlangstrings.feature +++ b/src/core/tests/behat/customlangstrings.feature @@ -1,4 +1,4 @@ -@core @app @javascript @lms_from4.0 +@core @app @javascript Feature: Custom lang strings Background: diff --git a/src/core/tests/behat/open_files-309.feature b/src/core/tests/behat/open_files-309.feature deleted file mode 100644 index b755db26d..000000000 --- a/src/core/tests/behat/open_files-309.feature +++ /dev/null @@ -1,41 +0,0 @@ -@core @app @javascript @lms_upto3.9 -Feature: It opens files properly. - - Background: - Given the Moodle site is compatible with this feature - And the following "users" exist: - | username | - | student1 | - 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 "activities" exist: - | activity | name | intro | display | course | defaultfilename | - | resource | Test TXT | Test TXT description | 5 | C1 | A txt.txt | - | resource | Test RTF | Test RTF description | 5 | C1 | A rtf.rtf | - | resource | Test DOC | Test DOC description | 5 | C1 | A doc.doc | - - Scenario: Open a file - Given I entered the resource activity "Test TXT" on course "Course 1" as "student1" in the app - When I press "Open" in the app - Then the app should have opened a browser tab with url "^blob:" - - When I switch to the browser tab opened by the app - Then I should see "Test resource A txt.txt file" - - When I close the browser tab opened by the app - And I press the back button in the app - And I press "Test RTF" in the app - And I press "Open" in the app - Then the app should have opened url "^blob:" with contents "Test resource A rtf.rtf file" once - - When I press "Open" in the app - Then the app should have opened url "^blob:" with contents "Test resource A rtf.rtf file" 2 times - - When I press the back button in the app - And I press "Test DOC" in the app - And I press "Open" in the app - Then the app should have opened url "^blob:" with contents "Test resource A doc.doc file" once diff --git a/src/core/tests/behat/open_files.feature b/src/core/tests/behat/open_files.feature index ff2d6af62..bea27679f 100644 --- a/src/core/tests/behat/open_files.feature +++ b/src/core/tests/behat/open_files.feature @@ -13,7 +13,6 @@ Feature: It opens files properly. | user | course | role | | student1 | C1 | student | - @lms_from3.11 Scenario: Open a file Given the following "activities" exist: | activity | name | intro | display | course | defaultfilename | From daa16a32a48076e59652bba31dcc5c30bdcbf0fd Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 13 May 2024 13:26:52 +0200 Subject: [PATCH 6/9] MOBILE-4470 ui: Fix collapsible header This caused both headers to be hidden when navigating from a scrolled page content to a frozen page (without scroll) --- src/theme/components/collapsible-header.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/theme/components/collapsible-header.scss b/src/theme/components/collapsible-header.scss index c890beafb..b587f82e2 100644 --- a/src/theme/components/collapsible-header.scss +++ b/src/theme/components/collapsible-header.scss @@ -108,8 +108,9 @@ body:not(.core-iframe-fullscreen) .collapsible-header-page { display: none; } - .collapsible-header-expanded h1 { + .collapsible-header-expanded .collapsible-header-original-title { opacity: 1; + visibility: visible; } } From 77d3ac9d4348fdb595c8d636b91ebcc6b98d9e48 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 14 May 2024 11:38:34 +0200 Subject: [PATCH 7/9] MOBILE-4470 angular: Fix snapshot types Route snapshots are typed as non-optional, but we found a situation where it was undefined. Looking at the Angular source code, it seems like indeed snapshots can be undefined but they have been declared with a definite assignment assertion: https://github.com/angular/angular/blob/17.3.0/packages/router/src/router_state.ts#L231 --- patches/@angular+router+17.3.7.patch | 13 +++ src/addons/calendar/pages/event/event.ts | 4 +- .../pages/competency/competency.page.ts | 4 +- .../submission-review/submission-review.ts | 4 +- .../mod/feedback/pages/attempt/attempt.ts | 4 +- .../mod/forum/pages/discussion/discussion.ts | 6 +- .../pages/new-discussion/new-discussion.ts | 6 +- src/addons/mod/glossary/pages/entry/entry.ts | 6 +- .../mod/wiki/services/handlers/create-link.ts | 8 +- .../pages/notification/notification.ts | 4 +- .../items-management/list-items-manager.ts | 6 +- .../swipe-navigation-items-manager.ts | 4 +- .../swipe-navigation-items-manager.test.ts | 7 +- src/core/components/split-view/split-view.ts | 2 +- src/core/features/course/pages/index/index.ts | 4 +- src/core/features/course/services/course.ts | 2 +- .../grades/pages/course/course.page.ts | 6 +- .../features/user/pages/profile/profile.ts | 6 +- src/core/services/navigator.ts | 97 +++++++++++++++++-- 19 files changed, 135 insertions(+), 58 deletions(-) create mode 100644 patches/@angular+router+17.3.7.patch diff --git a/patches/@angular+router+17.3.7.patch b/patches/@angular+router+17.3.7.patch new file mode 100644 index 000000000..06367c788 --- /dev/null +++ b/patches/@angular+router+17.3.7.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/@angular/router/index.d.ts b/node_modules/@angular/router/index.d.ts +index b8d7cc8..6511edf 100755 +--- a/node_modules/@angular/router/index.d.ts ++++ b/node_modules/@angular/router/index.d.ts +@@ -58,7 +58,7 @@ export declare class ActivatedRoute { + /** The component of the route, a constant. */ + component: Type | null; + /** The current snapshot of this route */ +- snapshot: ActivatedRouteSnapshot; ++ snapshot?: ActivatedRouteSnapshot; + /** An Observable of the resolved route title */ + readonly title: Observable; + /** An observable of the URL segments matched by this route. */ diff --git a/src/addons/calendar/pages/event/event.ts b/src/addons/calendar/pages/event/event.ts index c4d62ace6..490aec001 100644 --- a/src/addons/calendar/pages/event/event.ts +++ b/src/addons/calendar/pages/event/event.ts @@ -675,9 +675,7 @@ class AddonCalendarEventsSwipeItemsManager extends CoreSwipeNavigationItemsManag * @inheritdoc */ protected getSelectedItemPathFromRoute(route: ActivatedRouteSnapshot | ActivatedRoute): string | null { - const snapshot = route instanceof ActivatedRouteSnapshot ? route : route.snapshot; - - return snapshot.params.id; + return CoreNavigator.getRouteParams(route).id; } } diff --git a/src/addons/competency/pages/competency/competency.page.ts b/src/addons/competency/pages/competency/competency.page.ts index c40a22c13..f7482a6ee 100644 --- a/src/addons/competency/pages/competency/competency.page.ts +++ b/src/addons/competency/pages/competency/competency.page.ts @@ -351,9 +351,7 @@ class AddonCompetencyCompetenciesSwipeManager * @inheritdoc */ protected getSelectedItemPathFromRoute(route: ActivatedRouteSnapshot | ActivatedRoute): string | null { - const snapshot = route instanceof ActivatedRouteSnapshot ? route : route.snapshot; - - return snapshot.params.competencyId; + return CoreNavigator.getRouteParams(route).competencyId; } } diff --git a/src/addons/mod/assign/pages/submission-review/submission-review.ts b/src/addons/mod/assign/pages/submission-review/submission-review.ts index 0c65440a7..a50111338 100644 --- a/src/addons/mod/assign/pages/submission-review/submission-review.ts +++ b/src/addons/mod/assign/pages/submission-review/submission-review.ts @@ -246,9 +246,7 @@ class AddonModAssignSubmissionSwipeItemsManager extends CoreSwipeNavigationItems * @inheritdoc */ protected getSelectedItemPathFromRoute(route: ActivatedRouteSnapshot | ActivatedRoute): string | null { - const snapshot = route instanceof ActivatedRouteSnapshot ? route : route.snapshot; - - return snapshot.params.submitId; + return CoreNavigator.getRouteParams(route).submitId; } } diff --git a/src/addons/mod/feedback/pages/attempt/attempt.ts b/src/addons/mod/feedback/pages/attempt/attempt.ts index 58c612a2d..540ee2f81 100644 --- a/src/addons/mod/feedback/pages/attempt/attempt.ts +++ b/src/addons/mod/feedback/pages/attempt/attempt.ts @@ -188,9 +188,7 @@ class AddonModFeedbackAttemptsSwipeManager extends CoreSwipeNavigationItemsManag * @inheritdoc */ protected getSelectedItemPathFromRoute(route: ActivatedRouteSnapshot | ActivatedRoute): string | null { - const snapshot = route instanceof ActivatedRouteSnapshot ? route : route.snapshot; - - return snapshot.params.attemptId; + return CoreNavigator.getRouteParams(route).attemptId; } } diff --git a/src/addons/mod/forum/pages/discussion/discussion.ts b/src/addons/mod/forum/pages/discussion/discussion.ts index 6828327f7..a4635b9dd 100644 --- a/src/addons/mod/forum/pages/discussion/discussion.ts +++ b/src/addons/mod/forum/pages/discussion/discussion.ts @@ -134,7 +134,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes async ngOnInit(): Promise { try { - const routeData = this.route.snapshot.data; + const routeData = CoreNavigator.getRouteData(this.route); this.courseId = CoreNavigator.getRouteNumberParam('courseId'); this.cmId = CoreNavigator.getRouteNumberParam('cmId'); this.forumId = CoreNavigator.getRouteNumberParam('forumId'); @@ -893,9 +893,9 @@ class AddonModForumDiscussionDiscussionsSwipeManager extends AddonModForumDiscus * @inheritdoc */ protected getSelectedItemPathFromRoute(route: ActivatedRouteSnapshot | ActivatedRoute): string | null { - const snapshot = route instanceof ActivatedRouteSnapshot ? route : route.snapshot; + const params = CoreNavigator.getRouteParams(route); - return this.getSource().DISCUSSIONS_PATH_PREFIX + snapshot.params.discussionId; + return this.getSource().DISCUSSIONS_PATH_PREFIX + params.discussionId; } } diff --git a/src/addons/mod/forum/pages/new-discussion/new-discussion.ts b/src/addons/mod/forum/pages/new-discussion/new-discussion.ts index 052397773..54e6512e7 100644 --- a/src/addons/mod/forum/pages/new-discussion/new-discussion.ts +++ b/src/addons/mod/forum/pages/new-discussion/new-discussion.ts @@ -125,7 +125,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea */ async ngOnInit(): Promise { try { - const routeData = this.route.snapshot.data; + const routeData = CoreNavigator.getRouteData(this.route); this.courseId = CoreNavigator.getRequiredRouteNumberParam('courseId'); this.cmId = CoreNavigator.getRequiredRouteNumberParam('cmId'); this.forumId = CoreNavigator.getRequiredRouteNumberParam('forumId'); @@ -700,9 +700,9 @@ class AddonModForumNewDiscussionDiscussionsSwipeManager extends AddonModForumDis * @inheritdoc */ protected getSelectedItemPathFromRoute(route: ActivatedRouteSnapshot | ActivatedRoute): string | null { - const snapshot = route instanceof ActivatedRouteSnapshot ? route : route.snapshot; + const params = CoreNavigator.getRouteParams(route); - return `${this.getSource().DISCUSSIONS_PATH_PREFIX}new/${snapshot.params.timeCreated}`; + return `${this.getSource().DISCUSSIONS_PATH_PREFIX}new/${params.timeCreated}`; } } diff --git a/src/addons/mod/glossary/pages/entry/entry.ts b/src/addons/mod/glossary/pages/entry/entry.ts index f4b946f77..4daad9772 100644 --- a/src/addons/mod/glossary/pages/entry/entry.ts +++ b/src/addons/mod/glossary/pages/entry/entry.ts @@ -103,7 +103,7 @@ export class AddonModGlossaryEntryPage implements OnInit, OnDestroy { this.cmId = CoreNavigator.getRequiredRouteNumberParam('cmId'); const entrySlug = CoreNavigator.getRequiredRouteParam('entrySlug'); - const routeData = this.route.snapshot.data; + const routeData = CoreNavigator.getRouteData(this.route); const source = CoreRoutedItemsManagerSourcesTracker.getOrCreateSource( AddonModGlossaryEntriesSource, [this.courseId, this.cmId, routeData.glossaryPathPrefix ?? ''], @@ -368,9 +368,9 @@ class AddonModGlossaryEntryEntriesSwipeManager * @inheritdoc */ protected getSelectedItemPathFromRoute(route: ActivatedRouteSnapshot | ActivatedRoute): string | null { - const snapshot = route instanceof ActivatedRouteSnapshot ? route : route.snapshot; + const params = CoreNavigator.getRouteParams(route); - return `${this.getSource().GLOSSARY_PATH_PREFIX}entry/${snapshot.params.entrySlug}`; + return `${this.getSource().GLOSSARY_PATH_PREFIX}entry/${params.entrySlug}`; } } diff --git a/src/addons/mod/wiki/services/handlers/create-link.ts b/src/addons/mod/wiki/services/handlers/create-link.ts index c25c37723..25f604ef9 100644 --- a/src/addons/mod/wiki/services/handlers/create-link.ts +++ b/src/addons/mod/wiki/services/handlers/create-link.ts @@ -49,8 +49,8 @@ export class AddonModWikiCreateLinkHandlerService extends CoreContentLinksHandle return false; } - const params = route.snapshot.params; - const queryParams = route.snapshot.queryParams; + const params = CoreNavigator.getRouteParams(route); + const queryParams = CoreNavigator.getRouteQueryParams(route); if (queryParams.subwikiId == subwikiId) { // Same subwiki, so it's same wiki. @@ -116,7 +116,9 @@ export class AddonModWikiCreateLinkHandlerService extends CoreContentLinksHandle if (isSameWiki) { // User is seeing the wiki, we can get the module from the wiki params. - path = path + `/${route.snapshot.params.courseId}/${route.snapshot.params.cmId}/edit`; + const routeParams = CoreNavigator.getRouteParams(route); + + path = path + `/${routeParams.courseId}/${routeParams.cmId}/edit`; } else if (wikiId) { // The URL specifies which wiki it belongs to. Get the module. const module = await CoreCourse.getModuleBasicInfoByInstance( diff --git a/src/addons/notifications/pages/notification/notification.ts b/src/addons/notifications/pages/notification/notification.ts index 79e674175..1a8c9ddc2 100644 --- a/src/addons/notifications/pages/notification/notification.ts +++ b/src/addons/notifications/pages/notification/notification.ts @@ -212,9 +212,7 @@ class AddonNotificationSwipeItemsManager extends CoreSwipeNavigationItemsManager * @inheritdoc */ protected getSelectedItemPathFromRoute(route: ActivatedRouteSnapshot | ActivatedRoute): string | null { - const snapshot = route instanceof ActivatedRouteSnapshot ? route : route.snapshot; - - return snapshot.params.id; + return CoreNavigator.getRouteParams(route).id; } } diff --git a/src/core/classes/items-management/list-items-manager.ts b/src/core/classes/items-management/list-items-manager.ts index 035d0b845..4761374d7 100644 --- a/src/core/classes/items-management/list-items-manager.ts +++ b/src/core/classes/items-management/list-items-manager.ts @@ -245,9 +245,7 @@ export class CoreListItemsManager< while (route.firstChild) { route = route.firstChild; - const snapshot = route instanceof ActivatedRouteSnapshot ? route : route.snapshot; - - segments.push(...snapshot.url); + segments.push(...CoreNavigator.getRouteUrl(route)); } return segments.map(segment => segment.path).join('/').replace(/\/+/, '/').trim() || null; @@ -276,7 +274,7 @@ export class CoreListItemsManager< */ private buildRouteMatcher(): (route: ActivatedRouteSnapshot) => boolean { if (this.pageRouteLocator instanceof ActivatedRoute) { - const pageRoutePath = CoreNavigator.getRouteFullPath(this.pageRouteLocator.snapshot); + const pageRoutePath = CoreNavigator.getRouteFullPath(this.pageRouteLocator); return route => CoreNavigator.getRouteFullPath(route) === pageRoutePath; } diff --git a/src/core/classes/items-management/swipe-navigation-items-manager.ts b/src/core/classes/items-management/swipe-navigation-items-manager.ts index 71e9cb201..66ec17612 100644 --- a/src/core/classes/items-management/swipe-navigation-items-manager.ts +++ b/src/core/classes/items-management/swipe-navigation-items-manager.ts @@ -85,9 +85,7 @@ export class CoreSwipeNavigationItemsManager< const segments: UrlSegment[] = []; while (route) { - const snapshot = route instanceof ActivatedRouteSnapshot ? route : route.snapshot; - - segments.push(...snapshot.url); + segments.push(...CoreNavigator.getRouteUrl(route)); if (!route.firstChild) { break; diff --git a/src/core/classes/tests/swipe-navigation-items-manager.test.ts b/src/core/classes/tests/swipe-navigation-items-manager.test.ts index 07ae31810..19cb1b9a6 100644 --- a/src/core/classes/tests/swipe-navigation-items-manager.test.ts +++ b/src/core/classes/tests/swipe-navigation-items-manager.test.ts @@ -13,10 +13,11 @@ // limitations under the License. import { mock, mockSingleton } from '@/testing/utils'; -import { ActivatedRoute, ActivatedRouteSnapshot, UrlSegment } from '@angular/router'; +import { ActivatedRoute, UrlSegment } from '@angular/router'; import { CoreRoutedItemsManagerSource } from '@classes/items-management/routed-items-manager-source'; import { CoreSwipeNavigationItemsManager } from '@classes/items-management/swipe-navigation-items-manager'; import { CoreNavigator } from '@services/navigator'; +import { BehaviorSubject } from 'rxjs'; interface Item { path: string; @@ -61,9 +62,7 @@ describe('CoreSwipeNavigationItemsManager', () => { mockSingleton(CoreNavigator, { navigate: jest.fn(), getCurrentRoute: () => mock({ - snapshot: mock({ - url: [mock({ path: currentPath })], - }), + url: new BehaviorSubject([mock({ path: currentPath })]), }), }); diff --git a/src/core/components/split-view/split-view.ts b/src/core/components/split-view/split-view.ts index fa23064be..e7d8fc6af 100644 --- a/src/core/components/split-view/split-view.ts +++ b/src/core/components/split-view/split-view.ts @@ -95,7 +95,7 @@ export class CoreSplitViewComponent implements AfterViewInit, OnDestroy { this.updateClasses(); - this.outletRouteSubject.next(outletRoute); + this.outletRouteSubject.next(outletRoute ?? null); } /** diff --git a/src/core/features/course/pages/index/index.ts b/src/core/features/course/pages/index/index.ts index fe16b6e3b..b784c977d 100644 --- a/src/core/features/course/pages/index/index.ts +++ b/src/core/features/course/pages/index/index.ts @@ -111,7 +111,7 @@ export class CoreCourseIndexPage implements OnInit, OnDestroy { */ async ngOnInit(): Promise { // Increase route depth. - const path = CoreNavigator.getRouteFullPath(this.route.snapshot); + const path = CoreNavigator.getRouteFullPath(this.route); CoreNavigator.increaseRouteDepth(path.replace(/(\/deep)+/, '')); @@ -247,7 +247,7 @@ export class CoreCourseIndexPage implements OnInit, OnDestroy { * @inheritdoc */ ngOnDestroy(): void { - const path = CoreNavigator.getRouteFullPath(this.route.snapshot); + const path = CoreNavigator.getRouteFullPath(this.route); CoreNavigator.decreaseRouteDepth(path.replace(/(\/deep)+/, '')); this.selectTabObserver?.off(); diff --git a/src/core/features/course/services/course.ts b/src/core/features/course/services/course.ts index 6542edd7f..4f8e01138 100644 --- a/src/core/features/course/services/course.ts +++ b/src/core/features/course/services/course.ts @@ -307,7 +307,7 @@ export class CoreCourseProvider { return false; } - return Number(route.snapshot.params.courseId) == courseId; + return Number(CoreNavigator.getRouteParams(route).courseId) == courseId; } /** diff --git a/src/core/features/grades/pages/course/course.page.ts b/src/core/features/grades/pages/course/course.page.ts index a715394c3..16f34780d 100644 --- a/src/core/features/grades/pages/course/course.page.ts +++ b/src/core/features/grades/pages/course/course.page.ts @@ -79,7 +79,7 @@ export class CoreGradesCoursePage implements AfterViewInit, OnDestroy { this.collapseLabel = Translate.instant('core.collapse'); this.useLegacyLayout = !CoreSites.getRequiredCurrentSite().isVersionGreaterEqualThan('4.1'); - switch (route.snapshot.data.swipeManagerSource ?? route.snapshot.parent?.data.swipeManagerSource) { + switch (route.snapshot?.data.swipeManagerSource ?? route.snapshot?.parent?.data.swipeManagerSource) { case 'courses': this.swipeManager = new CoreGradesCourseCoursesSwipeManager( CoreRoutedItemsManagerSourcesTracker.getOrCreateSource(CoreGradesCoursesSource, []), @@ -331,9 +331,7 @@ class CoreGradesCourseParticipantsSwipeManager extends CoreSwipeNavigationItemsM * @inheritdoc */ protected getSelectedItemPathFromRoute(route: ActivatedRouteSnapshot | ActivatedRoute): string | null { - const snapshot = route instanceof ActivatedRouteSnapshot ? route : route.snapshot; - - return snapshot.params.userId; + return CoreNavigator.getRouteParams(route).userId; } } diff --git a/src/core/features/user/pages/profile/profile.ts b/src/core/features/user/pages/profile/profile.ts index 8e61e47b9..1e5538dbb 100644 --- a/src/core/features/user/pages/profile/profile.ts +++ b/src/core/features/user/pages/profile/profile.ts @@ -117,7 +117,7 @@ export class CoreUserProfilePage implements OnInit, OnDestroy { this.courseId = undefined; } - if (this.courseId && this.route.snapshot.data.swipeManagerSource === 'participants') { + if (this.courseId && CoreNavigator.getRouteData(this.route).swipeManagerSource === 'participants') { const search = CoreNavigator.getRouteParam('search'); const source = CoreRoutedItemsManagerSourcesTracker.getOrCreateSource( CoreUserParticipantsSource, @@ -252,9 +252,7 @@ class CoreUserSwipeItemsManager extends CoreSwipeNavigationItemsManager { * @inheritdoc */ protected getSelectedItemPathFromRoute(route: ActivatedRouteSnapshot | ActivatedRoute): string | null { - const snapshot = route instanceof ActivatedRouteSnapshot ? route : route.snapshot; - - return snapshot.params.userId; + return CoreNavigator.getRouteParams(route).userId; } } diff --git a/src/core/services/navigator.ts b/src/core/services/navigator.ts index c94faf4ed..1e1001cd9 100644 --- a/src/core/services/navigator.ts +++ b/src/core/services/navigator.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injectable } from '@angular/core'; -import { ActivatedRoute, ActivatedRouteSnapshot, NavigationEnd, Params } from '@angular/router'; +import { ActivatedRoute, ActivatedRouteSnapshot, Data, NavigationEnd, Params, UrlSegment } from '@angular/router'; import { NavigationOptions } from '@ionic/angular/common/providers/nav-controller'; @@ -32,6 +32,7 @@ import { CoreMainMenuDelegate } from '@features/mainmenu/services/mainmenu-deleg import { CorePlatform } from '@services/platform'; import { filter } from 'rxjs/operators'; import { CorePromisedValue } from '@classes/promised-value'; +import { BehaviorSubject } from 'rxjs'; /** * Redirect payload. @@ -459,7 +460,7 @@ export class CoreNavigatorService { return route; } - if (routeData && CoreUtils.basicLeftCompare(routeData, route.snapshot.data, 3)) { + if (routeData && CoreUtils.basicLeftCompare(routeData, this.getRouteData(route), 3)) { return route; } @@ -477,11 +478,11 @@ export class CoreNavigatorService { * @returns Whether the route is active or not. */ isRouteActive(route: ActivatedRoute): boolean { - const routePath = this.getRouteFullPath(route.snapshot); + const routePath = this.getRouteFullPath(route); let activeRoute: ActivatedRoute | null = Router.routerState.root; while (activeRoute) { - if (this.getRouteFullPath(activeRoute.snapshot) === routePath) { + if (this.getRouteFullPath(activeRoute) === routePath) { return true; } @@ -650,13 +651,13 @@ export class CoreNavigatorService { * @param route Route snapshot. * @returns Path. */ - getRouteFullPath(route: ActivatedRouteSnapshot | null): string { + getRouteFullPath(route: ActivatedRouteSnapshot | ActivatedRoute | null): string { if (!route) { return ''; } - const parentPath = this.getRouteFullPath(route.parent); - const routePath = route.url.join('/'); + const parentPath = this.getRouteFullPath(this.getRouteParent(route)); + const routePath = this.getRouteUrl(route).join('/'); if (!parentPath && !routePath) { return ''; @@ -669,13 +670,63 @@ export class CoreNavigatorService { } } + /** + * Given a route, get url segments. + * + * @param route Route. + * @returns Url segments. + */ + getRouteUrl(route: ActivatedRouteSnapshot | ActivatedRoute): UrlSegment[] { + return this.getRouteProperty(route, 'url', []); + } + + /** + * Given a route, get its parent. + * + * @param route Route. + * @returns Parent. + */ + getRouteParent(route: ActivatedRouteSnapshot | ActivatedRoute): ActivatedRouteSnapshot | ActivatedRoute | null { + return this.getRouteProperty(route, 'parent', null); + } + + /** + * Given a route, get its data. + * + * @param route Route. + * @returns Data. + */ + getRouteData(route: ActivatedRouteSnapshot | ActivatedRoute): Data { + return this.getRouteProperty(route, 'data', {}); + } + + /** + * Given a route, get its params. + * + * @param route Route. + * @returns Params. + */ + getRouteParams(route: ActivatedRouteSnapshot | ActivatedRoute): Params { + return this.getRouteProperty(route, 'params', {}); + } + + /** + * Given a route, get its query params. + * + * @param route Route. + * @returns Query params. + */ + getRouteQueryParams(route: ActivatedRouteSnapshot | ActivatedRoute): Params { + return this.getRouteProperty(route, 'queryParams', {}); + } + /** * Check if the current route page can block leaving the route. * * @returns Whether the current route page can block leaving the route. */ currentRouteCanBlockLeave(): boolean { - return !!this.getCurrentRoute().snapshot.routeConfig?.canDeactivate?.length; + return !!this.getCurrentRoute().snapshot?.routeConfig?.canDeactivate?.length; } /** @@ -725,6 +776,36 @@ export class CoreNavigatorService { return '../'.repeat(depth); } + /** + * Given a route, get one of its properties. + * + * @param route Route. + * @param property Route property. + * @param defaultValue Fallback value if the property is not set. + * @returns Property value. + */ + private getRouteProperty( + route: ActivatedRouteSnapshot | ActivatedRoute, + property: T, + defaultValue: ActivatedRouteSnapshot[T], + ): ActivatedRouteSnapshot[T] { + if (route instanceof ActivatedRouteSnapshot) { + return route[property]; + } + + if (route.snapshot instanceof ActivatedRouteSnapshot) { + return route.snapshot[property]; + } + + const propertyObservable = route[property]; + + if (propertyObservable instanceof BehaviorSubject) { + return propertyObservable.value; + } + + return defaultValue; + } + } export const CoreNavigator = makeSingleton(CoreNavigatorService); From 888dd8bc0bac243a74a72275d8e3e0dd79b21e17 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 14 May 2024 13:33:53 +0200 Subject: [PATCH 8/9] MOBILE-4470 behat: Add coverage folder --- local_moodleappbehat/tests/behat/coverage/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 local_moodleappbehat/tests/behat/coverage/.gitkeep diff --git a/local_moodleappbehat/tests/behat/coverage/.gitkeep b/local_moodleappbehat/tests/behat/coverage/.gitkeep new file mode 100644 index 000000000..e69de29bb From ed7bd88e1a48aeeb4d0a2c9256b5a1703bce6be0 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Tue, 14 May 2024 13:54:34 +0200 Subject: [PATCH 9/9] MOBILE-4470 core: Fix double infinite-loading on scroll --- .../core-infinite-loading.html | 19 ++++++++++--------- .../infinite-loading/infinite-loading.ts | 9 ++++++++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/core/components/infinite-loading/core-infinite-loading.html b/src/core/components/infinite-loading/core-infinite-loading.html index 8f92c736f..0fd30d420 100644 --- a/src/core/components/infinite-loading/core-infinite-loading.html +++ b/src/core/components/infinite-loading/core-infinite-loading.html @@ -1,30 +1,31 @@ -
- +
+ {{ 'core.loadmore' | translate }} - + {{ 'core.tryagain' | translate }}
- - + + -
- +
+ {{ 'core.loadmore' | translate }} - + {{ 'core.tryagain' | translate }}
-
+
diff --git a/src/core/components/infinite-loading/infinite-loading.ts b/src/core/components/infinite-loading/infinite-loading.ts index 80cdd626f..0b519da2d 100644 --- a/src/core/components/infinite-loading/infinite-loading.ts +++ b/src/core/components/infinite-loading/infinite-loading.ts @@ -38,6 +38,7 @@ export class CoreInfiniteLoadingComponent implements OnChanges { @ViewChild(IonInfiniteScroll) infiniteScroll?: IonInfiniteScroll; loadingMore = false; // Hide button and avoid loading more. + loadingForced = false; // Whether loading is forced or happened on scroll. hostElement: HTMLElement; constructor(element: ElementRef) { @@ -96,13 +97,17 @@ export class CoreInfiniteLoadingComponent implements OnChanges { /** * Load More items calling the action provided. + * + * @param forced Whether loading happened on scroll or was forced. */ - loadMore(): void { + loadMore(forced: boolean = false): void { if (this.loadingMore) { return; } this.loadingMore = true; + this.loadingForced = forced; + this.action.emit(() => this.complete()); } @@ -121,6 +126,8 @@ export class CoreInfiniteLoadingComponent implements OnChanges { */ protected async completeLoadMore(): Promise { this.loadingMore = false; + this.loadingForced = false; + await this.infiniteScroll?.complete(); // More items loaded. If the list doesn't fill the full height, infinite scroll isn't triggered automatically.