2021-06-08 15:53:04 +00:00
|
|
|
@mod @mod_login @app @javascript
|
2020-03-02 09:46:24 +00:00
|
|
|
Feature: Test basic usage of login in app
|
|
|
|
I need basic login functionality to work
|
|
|
|
|
|
|
|
Background:
|
|
|
|
Given the following "courses" exist:
|
|
|
|
| fullname | shortname |
|
|
|
|
| Course 1 | C1 |
|
|
|
|
And the following "users" exist:
|
|
|
|
| username | firstname | lastname |
|
|
|
|
| student1 | david | student |
|
|
|
|
| student2 | pau | student2 |
|
|
|
|
| teacher1 | juan | teacher |
|
|
|
|
And the following "course enrolments" exist:
|
|
|
|
| user | course | role |
|
|
|
|
| student1 | C1 | student |
|
|
|
|
| student2 | C1 | student |
|
|
|
|
| teacher1 | C1 | editingteacher |
|
|
|
|
|
2020-06-15 15:11:16 +00:00
|
|
|
Scenario: Add a new site in the app & Site name in displayed when adding a new site
|
|
|
|
When I enter the app
|
|
|
|
And I press the back button in the app
|
2021-06-08 15:53:04 +00:00
|
|
|
And I set the field "Your site" to "$WWWROOT" in the app
|
2020-06-15 15:11:16 +00:00
|
|
|
And I press "Connect to your site" in the app
|
2021-06-08 15:53:04 +00:00
|
|
|
Then I should find "Acceptance test site" in the app
|
2020-06-15 15:11:16 +00:00
|
|
|
|
|
|
|
When I set the field "Username" to "student1" in the app
|
|
|
|
And I set the field "Password" to "student1" in the app
|
|
|
|
And I press "Log in" near "Forgotten your username or password?" in the app
|
2021-06-08 15:53:04 +00:00
|
|
|
Then I should find "Acceptance test site" in the app
|
|
|
|
But I should not find "Log in" in the app
|
2020-06-15 15:11:16 +00:00
|
|
|
|
2020-06-04 11:19:15 +00:00
|
|
|
Scenario: Add a non existing site
|
2020-03-02 09:46:24 +00:00
|
|
|
When I enter the app
|
|
|
|
And I log in as "student1"
|
2021-06-08 15:53:04 +00:00
|
|
|
And I press the main menu button in the app
|
2020-03-02 09:46:24 +00:00
|
|
|
And I press "Change site" in the app
|
2021-06-08 15:53:04 +00:00
|
|
|
And I press "Add" in the app
|
|
|
|
And I set the field "Your site" to "Wrong Site Address" in the app
|
2020-06-04 11:19:15 +00:00
|
|
|
And I press enter in the app
|
2021-06-08 15:53:04 +00:00
|
|
|
Then I should find "Cannot connect" in the app
|
2021-09-22 12:11:56 +00:00
|
|
|
And I should find "Wrong Site Address" in the app
|
2020-03-02 09:46:24 +00:00
|
|
|
|
2020-06-04 11:19:15 +00:00
|
|
|
Scenario: Delete a site
|
2020-03-02 09:46:24 +00:00
|
|
|
When I enter the app
|
|
|
|
And I log in as "student1"
|
2021-06-08 15:53:04 +00:00
|
|
|
And I press the main menu button in the app
|
2020-03-02 09:46:24 +00:00
|
|
|
And I press "Change site" in the app
|
2021-06-08 15:53:04 +00:00
|
|
|
Then I should find "Acceptance test site" in the app
|
2020-03-02 09:46:24 +00:00
|
|
|
And I press "Delete" in the app
|
2021-06-08 15:53:04 +00:00
|
|
|
And I press "Delete" near "Acceptance test site" in the app
|
|
|
|
And I press "Delete" near "Are you sure you want to delete the site Acceptance test site?" in the app
|
|
|
|
Then I should find "Connect to Moodle" in the app
|
|
|
|
But I should not find "Acceptance test site" in the app
|
2020-03-02 09:46:24 +00:00
|
|
|
|
2020-06-15 15:11:16 +00:00
|
|
|
Scenario: Require minium version of the app for a site
|
2021-06-08 15:53:04 +00:00
|
|
|
|
|
|
|
# Log in with a previous required version
|
2021-09-01 10:55:49 +00:00
|
|
|
Given the following config values are set as admin:
|
|
|
|
| minimumversion | 3.8.1 | tool_mobile |
|
2020-03-02 09:46:24 +00:00
|
|
|
When I enter the app
|
2021-06-08 15:53:04 +00:00
|
|
|
Then I should not find "App update required" in the app
|
|
|
|
|
|
|
|
# Log in with a future required version
|
2021-09-01 10:55:49 +00:00
|
|
|
Given the following config values are set as admin:
|
|
|
|
| minimumversion | 11.0.0 | tool_mobile |
|
|
|
|
When I enter the app
|
2021-06-08 15:53:04 +00:00
|
|
|
Then I should find "App update required" in the app
|