Skip to content

Commit

Permalink
Merge pull request #3958 from NoelDeMartin/MOBILE-4470
Browse files Browse the repository at this point in the history
MOBILE-4470 course: Fix behat tests
  • Loading branch information
dpalou authored Mar 11, 2024
2 parents 93a6680 + 2f2a884 commit 1c93299
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 48 deletions.
84 changes: 42 additions & 42 deletions src/core/features/course/tests/behat/basic_usage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Feature: Test basic usage of one course in app
| student1 | Student | student | student1@example.com |
| student2 | Student2 | student2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| fullname | shortname | category | initsections |
| Course 1 | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
Expand Down Expand Up @@ -212,7 +212,7 @@ Feature: Test basic usage of one course in app

When I press the back button in the app
And I press "Course index" in the app
And I press "Topic 1" in the app
And I press "Section 1" in the app
Then 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
Expand Down Expand Up @@ -245,7 +245,7 @@ Feature: Test basic usage of one course in app

When I press the back button in the app
And I press "Course index" in the app
And I press "Topic 2" in the app
And I press "Section 2" in the app
Then I should find "Quiz 1" in the app
And I should find "Test chat name" in the app
And I should find "Test scorm name" in the app
Expand Down Expand Up @@ -274,7 +274,7 @@ Feature: Test basic usage of one course in app

When I press the back button in the app
And I press "Course index" in the app
And I press "Topic 3" in the app
And I press "Section 3" in the app
Then 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
Expand Down Expand Up @@ -304,7 +304,7 @@ Feature: Test basic usage of one course in app

When I press the back button in the app
And I press "Course index" in the app
And I press "Topic 4" in the app
And I press "Section 4" in the app
Then I should find "Web links" in the app
But I should not find "Choice course 1" in the app
And I should not find "assignment" in the app
Expand All @@ -325,7 +325,7 @@ Feature: Test basic usage of one course in app

When I press the back button in the app
And I press "Course index" in the app
And I press "Topic 5" in the app
And I press "Section 5" in the app
Then I should find "Test glossary" in the app
But I should not find "Choice course 1" in the app
And I should not find "assignment" in the app
Expand Down Expand Up @@ -365,61 +365,61 @@ Feature: Test basic usage of one course in app
When I press "Course index" in the app
And I press "General" in the app
Then I should find "General" in the app
And I should find "Next: Topic 1" in the app
But I should not find "Topic 2" in the app
And I should not find "Topic 3" in the app
And I should not find "Topic 4" in the app
And I should not find "Topic 5" in the app
And I should find "Next: Section 1" in the app
But I should not find "Section 2" in the app
And I should not find "Section 3" in the app
And I should not find "Section 4" in the app
And I should not find "Section 5" in the app
And I should not find "Previous:" in the app

When I press "Next:" in the app
Then I should find "Topic 1" in the app
Then I should find "Section 1" in the app
And I should find "Previous: General" in the app
And I should find "Next: Topic 2" in the app
But I should not find "Topic 3" in the app
And I should not find "Topic 4" in the app
And I should not find "Topic 5" in the app
And I should find "Next: Section 2" in the app
But I should not find "Section 3" in the app
And I should not find "Section 4" in the app
And I should not find "Section 5" in the app

When I press "Next:" in the app
Then I should find "Topic 2" in the app
And I should find "Previous: Topic 1" in the app
And I should find "Next: Topic 3" in the app
Then I should find "Section 2" in the app
And I should find "Previous: Section 1" in the app
And I should find "Next: Section 3" in the app
But I should not find "General" in the app
And I should not find "Topic 4" in the app
And I should not find "Topic 5" in the app
And I should not find "Section 4" in the app
And I should not find "Section 5" in the app

When I press "Next:" in the app
Then I should find "Topic 3" in the app
And I should find "Previous: Topic 2" in the app
And I should find "Next: Topic 4" in the app
Then I should find "Section 3" in the app
And I should find "Previous: Section 2" in the app
And I should find "Next: Section 4" in the app
But I should not find "General" in the app
And I should not find "Topic 1" in the app
And I should not find "Topic 5" in the app
And I should not find "Section 1" in the app
And I should not find "Section 5" in the app

When I press "Next:" in the app
Then I should find "Topic 4" in the app
And I should find "Previous: Topic 3" in the app
And I should find "Next: Topic 5" in the app
Then I should find "Section 4" in the app
And I should find "Previous: Section 3" in the app
And I should find "Next: Section 5" in the app
But I should not find "General" in the app
And I should not find "Topic 1" in the app
And I should not find "Topic 2" in the app
And I should not find "Section 1" in the app
And I should not find "Section 2" in the app

When I press "Next:" in the app
Then I should find "Topic 5" in the app
And I should find "Previous: Topic 4" in the app
Then I should find "Section 5" in the app
And I should find "Previous: Section 4" in the app
But I should not find "General" in the app
And I should not find "Topic 1" in the app
And I should not find "Topic 2" in the app
And I should not find "Topic 3" in the app
And I should not find "Section 1" in the app
And I should not find "Section 2" in the app
And I should not find "Section 3" in the app
And I should not find "Next:" in the app

When I press "Previous:" in the app
Then I should find "Topic 4" in the app
And I should find "Previous: Topic 3" in the app
And I should find "Next: Topic 5" in the app
Then I should find "Section 4" in the app
And I should find "Previous: Section 3" in the app
And I should find "Next: Section 5" in the app
But I should not find "General" in the app
And I should not find "Topic 1" in the app
And I should not find "Topic 2" in the app
And I should not find "Section 1" in the app
And I should not find "Section 2" in the app

@lms_from4.0
Scenario: Self enrol
Expand Down
12 changes: 6 additions & 6 deletions src/core/features/course/tests/behat/relative_dates.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Feature: Check relative dates feature.
| student1 | Student | 1 | student1@example.com |
| teacher1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category | startdate | enddate | relativedatesmode | showactivitydates |
| Course 1 | C1 | 0 | ## 1 January 2022 ## | ## 1 January 2023 ## | 1 | 1 |
| fullname | shortname | category | startdate | enddate | relativedatesmode | showactivitydates | initsections |
| Course 1 | C1 | 0 | ## 1 January 2022 ## | ## 1 January 2023 ## | 1 | 1 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
Expand All @@ -23,23 +23,23 @@ Feature: Check relative dates feature.
Scenario: Relative dates (student)
Given I entered the course "Course 1" as "student1" in the app
When I press "Course index" in the app
And I press "Topic 1" in the app
And I press "Section 1" in the app
Then I should find "20 January 2022, 12:00 AM" near "Opened:" in the app
And I should find "31 July 2022, 12:00 AM" near "Due:" in the app

When I press "Course index" in the app
And I press "Topic 2" in the app
And I press "Section 2" in the app
And I should find "1 December 2021, 12:00 AM" near "Opened:" in the app
And I should find "31 January 2023, 10:00 AM" near "Due:" in the app

Scenario: Relative dates (teacher)
Given I entered the course "Course 1" as "teacher1" in the app
When I press "Course index" in the app
And I press "Topic 1" in the app
And I press "Section 1" in the app
Then I should find "19 days after course start" near "Opened:" in the app
And I should find "211 days after course start" near "Due:" in the app

When I press "Course index" in the app
And I press "Topic 2" in the app
And I press "Section 2" in the app
And I should find "31 days before course start" near "Opened:" in the app
And I should find "1 year 30 days 10 hours after course start" near "Due:" in the app
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1c93299

Please sign in to comment.