Merge pull request #41 from moodlehq/MOBILE-3807

MOBILE-3807: Adapt tests to new account menu
main
Noel De Martin 2021-11-03 14:46:27 +01:00 committed by GitHub
commit 67ec08edea
6 changed files with 50 additions and 33 deletions

View File

@ -17,7 +17,7 @@ Feature: Test basic usage of login in app
| student2 | C1 | student |
| teacher1 | C1 | editingteacher |
Scenario: Add a new site in the app & Site name in displayed when adding a new site
Scenario: Add a new account in the app & Site name in displayed when adding a new account
When I enter the app
And I press the back button in the app
And I set the field "Your site" to "$WWWROOT" in the app
@ -30,28 +30,40 @@ Feature: Test basic usage of login in app
Then I should find "Acceptance test site" in the app
But I should not find "Log in" in the app
Scenario: Add a non existing site
Scenario: Add a non existing account
When I enter the app
And I log in as "student1"
And I press the main menu button in the app
And I press "Change site" in the app
And I press the accounts menu button in the app
And I press "Log out" in the app
And I wait the app to restart
And I press "Add" in the app
And I press "Add a new account" in the app
And I set the field "Your site" to "Wrong Site Address" in the app
And I press enter in the app
Then I should find "Cannot connect" in the app
And I should find "Wrong Site Address" in the app
Scenario: Delete a site
Scenario: Add a non existing account from accounts switcher
When I enter the app
And I log in as "student1"
And I press the main menu button in the app
And I press "Change site" in the app
And I press the accounts menu button in the app
And I press "Switch account" in the app
And I press "Add a new account" in the app
And I wait the app to restart
And I set the field "Your site" to "Wrong Site Address" in the app
And I press enter in the app
Then I should find "Cannot connect" in the app
And I should find "Wrong Site Address" in the app
Scenario: Delete an account
When I enter the app
And I log in as "student1"
And I press the accounts menu button in the app
And I press "Log out" in the app
And I wait the app to restart
Then I should find "Acceptance test site" in the app
And I press "Delete" in the app
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
And I press "Edit accounts list" in the app
And I press "Remove account" near "Acceptance test site" in the app
And I press "Delete" near "Are you sure you want to remove the account on 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

View File

@ -63,8 +63,3 @@ Feature: Attempt a quiz in app
And I press "Submit all and finish" in the app
And I press "OK" near "Once you submit" in the app
And I should find "Review" in the app
And I press "Home" in the app
And I should find "Are you sure" in the app
And I should find "OK" in the app
And I press "OK" in the app
And I should find "Acceptance test site" in the app

View File

@ -514,10 +514,13 @@
break;
case 'main menu':
foundButton = findElementsBasedOnText({
text: 'more',
text: 'More',
near: { text: 'Notifications' },
})[0];
break;
case 'accounts menu' :
foundButton = findElementsBasedOnText({ text: 'Account' })[0];
break;
case 'page menu':
foundButton = findElementsBasedOnText({ text: 'Display options' })[0];
break;

View File

@ -541,7 +541,7 @@ class behat_app extends behat_base {
/**
* Presses standard buttons in the app.
*
* @Given /^I press the (back|main menu|page menu) button in the app$/
* @Given /^I press the (back|main menu|page menu|accounts menu) button in the app$/
* @param string $button Button type
* @throws DriverException If the button push doesn't work
*/

View File

@ -25,10 +25,10 @@ Feature: It navigates properly using deep links.
Scenario: Receive a push notification
When I enter the app
And I log in as "student2"
And I press the main menu button in the app
And I press the accounts menu button in the app
And I press "Log out" in the app
And I wait the app to restart
And I press "Add" in the app
And I press "Add a new account" in 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 log in as "student1"

View File

@ -24,12 +24,12 @@ Feature: It navigates properly in pages with a split-view component.
Scenario: Navigate in grades tab on mobile
# Open more tab
# Open accounts menu
Given I enter the app
And I log in as "student1"
And I press the main menu button in the app
And I press the accounts menu button in the app
# Open grades tab
# Open grades page
When I press "Grades" in the app
Then the header should be "Grades" in the app
And I should find "Course 1" in the app
@ -51,7 +51,7 @@ Feature: It navigates properly in pages with a split-view component.
Then the header should be "Grades" in the app
And I should find "Grade category C1" in the app
# Go back to grades tab
# Go back to grades page
When I press the back button in the app
Then the header should be "Grades" in the app
And I should find "Course 1" in the app
@ -73,26 +73,27 @@ Feature: It navigates properly in pages with a split-view component.
Then the header should be "Grades" in the app
And I should find "Grade category C2" in the app
# Go back to grades tab
# Go back to grades page
When I press the back button in the app
Then the header should be "Grades" in the app
And I should find "Course 1" in the app
And I should find "Course 2" in the app
# Go back to more tab
# Go back to main page
When I press the back button in the app
Then I should find "Grades" in the app
And I should find "App settings" in the app
Then I should find "Acceptance test site" in the app
And I should find "Account" in the app
But I should not find "Back" in the app
Scenario: Navigate in grades tab on tablet
# Open more tab
# Open accounts menu
Given I enter the app
And I change viewport size to "1200x640"
And I log in as "student1"
And I press the accounts menu button in the app
# Open grades tab
# Open grades page
When I press "Grades" in the app
Then the header should be "Grades" in the app
And I should find "Course 1" in the app
@ -106,7 +107,7 @@ Feature: It navigates properly in pages with a split-view component.
And I should find "20" near "Range" in the app
And I should find "40" near "Range" in the app
# Go back to grades tab
# Go back to grades page
When I press the back button in the app
Then the header should be "Grades" in the app
And I should find "Course 1" in the app
@ -125,9 +126,15 @@ Feature: It navigates properly in pages with a split-view component.
And I should find "60" near "Range" in the app
And I should find "80" near "Range" in the app
# Go back to grades tab
# Go back to grades page
When I press the back button in the app
Then the header should be "Grades" in the app
And I should find "Course 1" in the app
And I should find "Course 2" in the app
But I should not find "Back" in the app
And I should find "Back" in the app
# Go back to main page
When I press the back button in the app
Then I should find "Acceptance test site" in the app
And I should find "Account" in the app
But I should not find "Back" in the app