mirrored from git://git.moodle.org/moodle.git
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-63977 Behat: Allow Behat testing of the Moodle mobile app
This change allows you to write and run Behat tests that cover the mobile app. These should have the @app tag. They will be run in the Chrome browser using an Ionic server on the local machine. See config-dist.php for configuration settings, or full docs here: https://docs.moodle.org/dev/Acceptance_testing_for_the_mobile_app
- Loading branch information
1 parent
694513e
commit 1959e16
Showing
8 changed files
with
1,447 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
@core @core_course @app @javascript | ||
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: Student is registered on one course | ||
When I enter the app | ||
And I log in as "student1" in the app | ||
Then I should see "Course 1" | ||
And I should not see "Course 2" | ||
|
||
Scenario: Student is registered on two courses (shortnames not displayed) | ||
When I enter the app | ||
And I log in as "student2" in the app | ||
Then I should see "Course 1" | ||
And I should see "Course 2" | ||
And I should not see "C1" | ||
And I should not see "C2" | ||
|
||
Scenario: Student is registered on two courses (shortnames displayed) | ||
Given the following config values are set as admin: | ||
| courselistshortnames | 1 | | ||
When I enter the app | ||
And I log in as "student2" in the app | ||
Then I should see "Course 1" | ||
And I should see "Course 2" | ||
And I should see "C1" | ||
And I should see "C2" | ||
|
||
Scenario: Student uses course list to enter course, then leaves it again | ||
When I enter the app | ||
And I log in as "student2" in the app | ||
And I press "Course 2" in the app | ||
Then the header should be "Course 2" in the app | ||
And I press the back button in the app | ||
Then the header should be "Acceptance test site" in the app | ||
|
||
Scenario: Student uses filter feature to reduce course list | ||
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 | | ||
When I enter the app | ||
And I log in as "student2" in the app | ||
Then I should see "C1" | ||
And I should see "C2" | ||
And I should see "C3" | ||
And I should see "C4" | ||
And I should see "C5" | ||
And I should see "C6" | ||
And I press "Filter my courses" in the app | ||
And I set the field "Filter my courses" to "fr" in the app | ||
Then I should not see "C1" | ||
And I should not see "C2" | ||
And I should see "C3" | ||
And I should see "C4" | ||
And I should not see "C5" | ||
And I should not see "C6" | ||
And I press "Filter my courses" in the app | ||
Then I should see "C1" | ||
And I should see "C2" | ||
And I should see "C3" | ||
And I should see "C4" | ||
And I should see "C5" | ||
And I should see "C6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.