commit
3278d5a77f
|
@ -467,7 +467,7 @@ class behat_app extends behat_app_helper {
|
|||
/**
|
||||
* Presses standard buttons in the app.
|
||||
*
|
||||
* @When /^I press the (back|more menu|page menu|user menu|main menu) button in the app$/
|
||||
* @When /^I press the (back|more menu|page menu|user menu) button in the app$/
|
||||
* @param string $button Button type
|
||||
* @throws DriverException If the button push doesn't work
|
||||
*/
|
||||
|
@ -485,6 +485,51 @@ class behat_app extends behat_app_helper {
|
|||
$this->wait_for_pending_js();
|
||||
}
|
||||
|
||||
/**
|
||||
* Presses go back repeatedly in the app.
|
||||
*
|
||||
* @When /^I go back( (\d+) times)? in the app$/
|
||||
* @param int $times
|
||||
* @throws DriverException If the navigation doesn't work
|
||||
*/
|
||||
public function i_go_back_x_times_in_the_app(?string $unused = null, ?int $times = 1) {
|
||||
if ($times < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->spin(function() use ($times) {
|
||||
$result = $this->runtime_js("goBackTimes($times)");
|
||||
|
||||
if ($result !== 'OK') {
|
||||
throw new DriverException('Error navigating back - ' . $result);
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
$this->wait_for_pending_js();
|
||||
}
|
||||
|
||||
/**
|
||||
* Presses go back repeatedly until the app is in the main menu.
|
||||
*
|
||||
* @When /^I go back to the root page in the app$/
|
||||
* @throws DriverException If the navigation doesn't work
|
||||
*/
|
||||
public function i_go_back_to_root_in_the_app() {
|
||||
$this->spin(function() {
|
||||
$result = $this->runtime_js("goBackToRoot()");
|
||||
|
||||
if ($result !== 'OK') {
|
||||
throw new DriverException('Error navigating to root - ' . $result);
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
$this->wait_for_pending_js();
|
||||
}
|
||||
|
||||
/**
|
||||
* Receives push notifications.
|
||||
*
|
||||
|
|
|
@ -72,12 +72,12 @@
|
|||
"student": {
|
||||
"url": "https://school.moodledemo.net",
|
||||
"username": "student",
|
||||
"password": "moodle"
|
||||
"password": "moodle2024"
|
||||
},
|
||||
"teacher": {
|
||||
"url": "https://school.moodledemo.net",
|
||||
"username": "teacher",
|
||||
"password": "moodle"
|
||||
"password": "moodle2024"
|
||||
}
|
||||
},
|
||||
"defaultZoomLevel": "none",
|
||||
|
|
|
@ -23,7 +23,7 @@ Feature: Test creation of calendar events in app
|
|||
# This test is flaky due to timestamp.
|
||||
Scenario: Create user event as student from monthly view
|
||||
Given I entered the app as "student1"
|
||||
When I press "More" in the app
|
||||
When I press the more menu button in the app
|
||||
And I press "Calendar" in the app
|
||||
And I press "New event" in the app
|
||||
# Flaky step, sometimes it fails due to minute change when checking.
|
||||
|
|
|
@ -115,9 +115,7 @@ Feature: Test competency navigation
|
|||
But I should not find "Cakes" in the app
|
||||
|
||||
# Learning plans
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back to the root page in the app
|
||||
And I press the user menu button in the app
|
||||
And I press "Learning plans" in the app
|
||||
Then I should find "Cookery" in the app
|
||||
|
@ -236,9 +234,7 @@ Feature: Test competency navigation
|
|||
But I should not find "Cakes" in the app
|
||||
|
||||
# User learning plans
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back to the root page in the app
|
||||
And I press "Messages" in the app
|
||||
And I press "Search people and messages" in the app
|
||||
And I set the field "Search" to "student" in the app
|
||||
|
@ -482,7 +478,7 @@ Feature: Test competency navigation
|
|||
When I entered the course "Course 1" as "student1" in the app
|
||||
Then I should not find "Competencies" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back to the root page in the app
|
||||
And I press the user menu button in the app
|
||||
|
||||
Then I should not find "Learning plans" in the app
|
||||
|
|
|
@ -52,12 +52,12 @@ Feature: Test basic usage of messages in app
|
|||
And I replace "/.*/" within ".message-time" with "[Date]"
|
||||
Then the UI should match the snapshot
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Contacts" near "No contact requests" in the app
|
||||
Then the header should be "Contacts" in the app
|
||||
And I should find "Teacher teacher" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Teacher teacher" in the app
|
||||
Then the header should be "Teacher teacher" in the app
|
||||
And I should find "heeey student" in the app
|
||||
|
@ -160,8 +160,7 @@ Feature: Test basic usage of messages in app
|
|||
And I press "Remove from contacts" in the app
|
||||
And I press "Remove" in the app
|
||||
And I wait loading to finish in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I go back 2 times in the app
|
||||
And I press "Display options" in the app
|
||||
Then I should find "Add to contacts" in the app
|
||||
|
||||
|
@ -188,7 +187,7 @@ Feature: Test basic usage of messages in app
|
|||
Then I should find "byee" in the app
|
||||
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Student1 student1" in the app
|
||||
Then I should find "heeey student" in the app
|
||||
And I should find "byee" in the app
|
||||
|
@ -279,7 +278,7 @@ Feature: Test basic usage of messages in app
|
|||
When I press "star message" in the app
|
||||
And I press "Display options" in the app
|
||||
And I press "Star conversation" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
Then I should find "Private (1)" in the app
|
||||
And I should find "Starred (2)" in the app
|
||||
|
||||
|
@ -345,7 +344,8 @@ Feature: Test basic usage of messages in app
|
|||
When I press "Mute" in the app
|
||||
Then I should find "Muted conversation" in the app
|
||||
|
||||
When I press "Messages" in the app
|
||||
When I go back to the root page in the app
|
||||
And I press "Messages" in the app
|
||||
And I press "Private (1)" in the app
|
||||
And I press "Student2 student2" in the app
|
||||
Then I should find "test message" in the app
|
||||
|
@ -367,7 +367,7 @@ Feature: Test basic usage of messages in app
|
|||
Then I should find "self conversation offline" in the app
|
||||
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Student1 student1" in the app
|
||||
And I press "Display options" in the app
|
||||
Then I should find "Show delete messages" in the app
|
||||
|
@ -394,7 +394,7 @@ Feature: Test basic usage of messages in app
|
|||
Then I should not find "self conversation online" in the app
|
||||
And I should not find "self conversation offline" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Search people and messages" in the app
|
||||
And I set the field "Search" to "Student1 student1" in the app
|
||||
And I press "Search" "button" in the app
|
||||
|
@ -403,8 +403,7 @@ Feature: Test basic usage of messages in app
|
|||
And I press "Send" in the app
|
||||
Then I should find "auto search test" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I press "Private" in the app
|
||||
And I press "Student1 student1" in the app
|
||||
Then I should find "auto search test" in the app
|
||||
|
|
|
@ -37,6 +37,5 @@ Feature: Test messages navigation in the app
|
|||
Then I should not find "User info" in the app
|
||||
|
||||
When I close the popup in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I go back 2 times in the app
|
||||
Then I should find "Hi there" in the app
|
||||
|
|
|
@ -53,7 +53,7 @@ Feature: Test basic usage of assignment activity in 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
|
||||
When I press "Student student" in the app
|
||||
Then I should find "Online text submissions" in the app
|
||||
And I should find "Submission test edited" in the app
|
||||
And the following events should have been logged for "student1" in the app:
|
||||
|
@ -87,7 +87,7 @@ Feature: Test basic usage of assignment activity in app
|
|||
# Allow more attempts as a teacher
|
||||
Given I entered the assign activity "assignment1" on course "Course 1" as "teacher1" in the app
|
||||
When I press "Participants" in the app
|
||||
And I press "Student student" near "assignment1" in the app
|
||||
And I press "Student student" in the app
|
||||
And I press "Grade" in the app
|
||||
And I press "Allow another attempt" in the app
|
||||
And I press "Done" in the app
|
||||
|
@ -116,7 +116,7 @@ Feature: Test basic usage of assignment activity in app
|
|||
Given I entered the assign activity "assignment1" on course "Course 1" as "teacher1" in the app
|
||||
When I press "Participants" in the app
|
||||
And I pull to refresh in the app
|
||||
And I press "Student student" near "assignment1" in the app
|
||||
And I press "Student student" in the app
|
||||
Then I should find "Online text submissions" in the app
|
||||
And I should find "Submission test 2nd attempt" in the app
|
||||
|
||||
|
@ -131,7 +131,7 @@ Feature: Test basic usage of assignment activity in app
|
|||
Then I should find "This Assignment has offline data to be synchronised." in the app
|
||||
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "assignment1" in the app
|
||||
And I press "Information" in the app
|
||||
And I press "Refresh" in the app
|
||||
|
@ -159,7 +159,7 @@ Feature: Test basic usage of assignment activity in app
|
|||
Then I should find "This Assignment has offline data to be synchronised." in the app
|
||||
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "assignment1" in the app
|
||||
Then I should find "Submitted for grading" in the app
|
||||
And I should find "Submission test edited offline" in the app
|
||||
|
|
|
@ -84,7 +84,7 @@ Feature: Test marking workflow in assignment activity in app
|
|||
And the field "Grade out of 100" matches value "50" in the app
|
||||
And I should not find "Graded by" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Student3" in the app
|
||||
And I press "Grade" in the app
|
||||
Then I should find "Submitted for grading" in the app
|
||||
|
@ -109,7 +109,7 @@ Feature: Test marking workflow in assignment activity in app
|
|||
And I should find "In review" within "Marking workflow state" "ion-item" in the app
|
||||
And the field "Grade out of 100" matches value "60" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Student3" in the app
|
||||
And I press "Grade" in the app
|
||||
When I set the field "Grade out of 100" to "80" in the app
|
||||
|
|
|
@ -45,7 +45,8 @@ Feature: Test marking workflow in assignment activity in app
|
|||
And I am on the "Group Assign" "assign activity" page logged in as teacher1
|
||||
And I navigate to "Submissions" in current page administration
|
||||
And I change window size to "large"
|
||||
And I click on "Grade" "link" in the "Student1" "table_row"
|
||||
And I go to "Student1" "Group Assign" activity advanced grading page
|
||||
|
||||
And I set the field "Grade out of 100" to "50"
|
||||
And I set the field "Marking workflow state" to "In review"
|
||||
And I set the field "Feedback comments" to "Great job! Lol, not really."
|
||||
|
@ -53,7 +54,7 @@ Feature: Test marking workflow in assignment activity in app
|
|||
And I press "Save changes"
|
||||
And I am on the "Group Assign" "assign activity" page
|
||||
And I navigate to "Submissions" in current page administration
|
||||
And I click on "Grade" "link" in the "Student3" "table_row"
|
||||
And I go to "Student3" "Group Assign" activity advanced grading page
|
||||
And I set the field "Grade out of 100" to "30"
|
||||
And I set the field "Marking workflow state" to "Released"
|
||||
And I set the field "Feedback comments" to "Needs to be improved."
|
||||
|
@ -84,7 +85,7 @@ Feature: Test marking workflow in assignment activity in app
|
|||
And the field "Grade out of 100" matches value "50" in the app
|
||||
And I should not find "Graded by" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Student3" in the app
|
||||
And I press "Grade" in the app
|
||||
Then I should find "Submitted for grading" in the app
|
||||
|
@ -109,7 +110,7 @@ Feature: Test marking workflow in assignment activity in app
|
|||
And I should find "In review" within "Marking workflow state" "ion-item" in the app
|
||||
And the field "Grade out of 100" matches value "60" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Student3" in the app
|
||||
And I press "Grade" in the app
|
||||
When I set the field "Grade out of 100" to "80" in the app
|
||||
|
|
|
@ -72,8 +72,7 @@ Feature: Test assignments navigation
|
|||
And I should not find "Second Student" in the app
|
||||
|
||||
# Drafts
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I press "Drafts" in the app
|
||||
Then I should find "First Student" in the app
|
||||
And I should find "Third Student" in the app
|
||||
|
@ -97,8 +96,7 @@ Feature: Test assignments navigation
|
|||
And I should not find "Second Student" in the app
|
||||
|
||||
# Filter groups in assignment page
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I press "Separate groups" in the app
|
||||
And I press "Group 1" in the app
|
||||
Then I should find "2" near "Participants" in the app
|
||||
|
@ -126,7 +124,7 @@ Feature: Test assignments navigation
|
|||
And I should not find "Third Student" in the app
|
||||
|
||||
# Filter groups in submissions page
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Separate groups" in the app
|
||||
And I press "Group 2" in the app
|
||||
Then I should find "Second Student" in the app
|
||||
|
@ -176,7 +174,7 @@ Feature: Test assignments navigation
|
|||
And I should not find "Third Student" inside the split-view content in the app
|
||||
|
||||
# Drafts
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Drafts" in the app
|
||||
Then I should find "First Student" in the app
|
||||
And I should find "Third Student" in the app
|
||||
|
@ -193,7 +191,7 @@ Feature: Test assignments navigation
|
|||
And I should not find "Second Student" in the app
|
||||
|
||||
# Filter groups in assignment page
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Separate groups" in the app
|
||||
And I press "Group 1" in the app
|
||||
Then I should find "2" near "Participants" in the app
|
||||
|
|
|
@ -29,12 +29,12 @@ Feature: Test basic usage of BBB activity in app
|
|||
Then I should find "The session has not started yet." in the app
|
||||
And I should find "Saturday, 1 January 2050, 12:00 AM" within "Open" "ion-item" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "BBB 2" in the app
|
||||
Then I should find "The session has ended." in the app
|
||||
And I should find "Saturday, 1 January 2000, 12:00 AM" within "Close" "ion-item" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "BBB 3" in the app
|
||||
Then I should find "This room is ready. You can join the session now." in the app
|
||||
And I should find "Saturday, 1 January 2000, 12:00 AM" within "Open" "ion-item" in the app
|
||||
|
@ -113,13 +113,13 @@ Feature: Test basic usage of BBB activity in app
|
|||
And I should find "Recordings" in the app
|
||||
And I should find "There are no recordings available." in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Room only" in the app
|
||||
Then I should find "This room is ready. You can join the session now." in the app
|
||||
And I should be able to press "Join session" in the app
|
||||
But I should not find "Recordings" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Recordings only" in the app
|
||||
Then I should find "Recordings" in the app
|
||||
But I should not find "This room is ready. You can join the session now." in the app
|
||||
|
|
|
@ -86,7 +86,7 @@ Feature: Test basic usage of book activity in app
|
|||
And the UI should match the snapshot
|
||||
But I should not find "This is the second chapter" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Chapt 2" in the app
|
||||
Then I should find "Chapt 2" in the app
|
||||
And I should find "This is the second chapter" in the app
|
||||
|
@ -265,8 +265,7 @@ Feature: Test basic usage of book activity in app
|
|||
And I should find "3. Chapt 3" in the app
|
||||
|
||||
When I press "Close" in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I go back 2 times in the app
|
||||
And I press "Bull book" in the app
|
||||
Then I should find "• Chapt 1" in the app
|
||||
But I should not find "1. Chapt 1" in the app
|
||||
|
@ -277,8 +276,7 @@ Feature: Test basic usage of book activity in app
|
|||
But I should not find "1. Chapt 1" in the app
|
||||
|
||||
When I press "Close" in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I go back 2 times in the app
|
||||
And I press "Ind book" in the app
|
||||
Then I should find "Chapt 1" in the app
|
||||
But I should not find "• Chapt 1" in the app
|
||||
|
@ -291,8 +289,7 @@ Feature: Test basic usage of book activity in app
|
|||
And I should not find "1. Chapt 1" in the app
|
||||
|
||||
When I press "Close" in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I go back 2 times in the app
|
||||
And I press "None book" in the app
|
||||
Then I should find "Chapt 1" in the app
|
||||
But I should not find "• Chapt 1" in the app
|
||||
|
|
|
@ -37,7 +37,7 @@ Feature: Test basic usage of chat in 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 go back in the app
|
||||
And I press "OK" in the app
|
||||
|
||||
# Read messages, view connected users, send beep and reply as student2
|
||||
|
@ -76,7 +76,7 @@ Feature: Test basic usage of chat in 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 go back in the app
|
||||
And I press "OK" in the app
|
||||
|
||||
# Read messages from past sessions as student2
|
||||
|
|
|
@ -26,7 +26,7 @@ Feature: Test chat navigation
|
|||
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 go back in the app
|
||||
And I press "OK" in the app
|
||||
|
||||
Scenario: Tablet navigation on chat
|
||||
|
|
|
@ -33,7 +33,7 @@ Feature: Test basic usage of choice activity in app
|
|||
And I should find "Option 3: 0" in the app
|
||||
But I should not find "Remove my choice" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test single choice name" in the app
|
||||
Then I should find "Option 1: 0" in the app
|
||||
And I should find "Option 2: 1" in the app
|
||||
|
@ -82,7 +82,7 @@ Feature: Test basic usage of choice activity in app
|
|||
Then I should find "Are you sure" in the app
|
||||
|
||||
When I press "OK" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Test single choice name" in the app
|
||||
Then I should find "This Choice has offline data to be synchronised." in the app
|
||||
But I should not find "Option 1: 0" in the app
|
||||
|
@ -90,7 +90,7 @@ Feature: Test basic usage of choice activity in app
|
|||
And I should not find "Option 3: 0" in the app
|
||||
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Test single choice name" in the app
|
||||
Then I should find "Test single choice description" in the app
|
||||
|
||||
|
@ -135,21 +135,21 @@ Feature: Test basic usage of choice activity in app
|
|||
When I press "Course downloads" in the app
|
||||
When I press "Download" within "Test single choice name" "ion-item" in the app
|
||||
Then I should find "Downloaded" within "Test single choice name" "ion-item" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
|
||||
When I switch network connection to offline
|
||||
And I press "Test multi choice name" in the app
|
||||
Then I should find "There was a problem connecting to the site. Please check your connection and try again." in the app
|
||||
|
||||
When I press "OK" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Test single choice name" in the app
|
||||
And I select "Option 2" in the app
|
||||
And I press "Save my choice" in the app
|
||||
Then I should find "Are you sure" in the app
|
||||
|
||||
When I press "OK" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Test single choice name" in the app
|
||||
Then I should find "This Choice has offline data to be synchronised." in the app
|
||||
But I should not find "Option 1: 0" in the app
|
||||
|
@ -157,7 +157,7 @@ Feature: Test basic usage of choice activity in app
|
|||
And I should not find "Option 3: 0" in the app
|
||||
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Test single choice name" in the app
|
||||
Then I should find "Option 1: 0" in the app
|
||||
And I should find "Option 2: 1" in the app
|
||||
|
|
|
@ -75,7 +75,7 @@ Feature: Users can manage entries in database activities
|
|||
Then I should find "Moodle community site" in the app
|
||||
But I should not find "Moodle Cloud" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I should find "Moodle community site" in the app
|
||||
And I should find "Moodle Cloud" in the app
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ Feature: Users can store entries in database activities when offline and sync wh
|
|||
Then I should find "https://moodle.org/" in the app
|
||||
And I should find "Moodle community site" in the app
|
||||
And I should find "This Database has offline data to be synchronised" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I switch network connection to wifi
|
||||
And I press "Web links" near "General" in the app
|
||||
And I should find "https://moodle.org/" in the app
|
||||
|
@ -72,7 +72,7 @@ Feature: Users can store entries in database activities when offline and sync wh
|
|||
And I should find "https://moodlecloud.com/" in the app
|
||||
And I should find "Moodle Cloud" in the app
|
||||
And I should find "This Database has offline data to be synchronised" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I switch network connection to wifi
|
||||
And I press "Web links" near "General" in the app
|
||||
And I should not find "https://moodle.org/" in the app
|
||||
|
@ -91,7 +91,7 @@ Feature: Users can store entries in database activities when offline and sync wh
|
|||
And I should find "https://moodlecloud.com/" in the app
|
||||
And I should find "Moodle Cloud" in the app
|
||||
And I should find "This Database has offline data to be synchronised" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I switch network connection to wifi
|
||||
And I press "Web links" near "General" in the app
|
||||
And I should not find "https://moodlecloud.com/" in the app
|
||||
|
@ -122,7 +122,7 @@ Feature: Users can store entries in database activities when offline and sync wh
|
|||
And I should find "This Database has offline data to be synchronised" in the app
|
||||
And I press "Actions menu" in the app
|
||||
And I press "Restore" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I switch network connection to wifi
|
||||
And I press "Web links" near "General" in the app
|
||||
Then I should find "https://moodle.org/" in the app
|
||||
|
|
|
@ -282,7 +282,7 @@ Feature: Test feedback navigation
|
|||
Then I should find "Anonymous" within "Mode" "ion-item" in the app
|
||||
|
||||
# Analysis
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Analysis" in the app
|
||||
Then I should find "student01 response" in the app
|
||||
And I should find "student75 response" in the app
|
||||
|
@ -325,14 +325,13 @@ Feature: Test feedback navigation
|
|||
When I swipe to the left in the app
|
||||
Then I should find "student03 response" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Student 21" in the app
|
||||
And I swipe to the left in the app
|
||||
Then I should find "student22 response" in the app
|
||||
|
||||
# By group
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I press "Separate groups" in the app
|
||||
And I press "Group 1" in the app
|
||||
Then I should find "22" near "Submitted answers" in the app
|
||||
|
@ -369,7 +368,7 @@ Feature: Test feedback navigation
|
|||
Then I should find "student31 response" in the app
|
||||
|
||||
# Reset group
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
When I press "Group 1" in the app
|
||||
And I press "All participants" in the app
|
||||
Then I should find "Non anonymous entries (21)" in the app
|
||||
|
@ -392,7 +391,7 @@ Feature: Test feedback navigation
|
|||
Then I should find "Anonymous" within "Mode" "ion-item" in the app
|
||||
|
||||
# Analysis
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Analysis" in the app
|
||||
Then I should find "student01 response" in the app
|
||||
And I should find "student75 response" in the app
|
||||
|
@ -434,7 +433,7 @@ Feature: Test feedback navigation
|
|||
And I should find "student22 response" inside the split-view content in the app
|
||||
|
||||
# By group
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Separate groups" in the app
|
||||
And I press "Group 1" in the app
|
||||
Then I should find "22" near "Submitted answers" in the app
|
||||
|
|
|
@ -109,7 +109,7 @@ Feature: Test basic usage of forum activity in app
|
|||
When I press "Initial discussion" in the app
|
||||
Then I should find "Reply" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I switch network connection to offline
|
||||
And I press "Initial discussion" in the app
|
||||
And I press "Reply" in the app
|
||||
|
@ -125,7 +125,7 @@ Feature: Test basic usage of forum activity in app
|
|||
And I should find "This Discussion has offline data to be synchronised" in the app
|
||||
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Initial discussion" in the app
|
||||
Then I should not find "Not sent" in the app
|
||||
And I should not find "This Discussion has offline data to be synchronised" in the app
|
||||
|
@ -237,7 +237,7 @@ Feature: Test basic usage of forum activity in app
|
|||
And I should find "Average of ratings: 1" in the app
|
||||
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
Then I should find "This Forum has offline data to be synchronised." in the app
|
||||
|
||||
When I press "Information" in the app
|
||||
|
@ -268,7 +268,7 @@ Feature: Test basic usage of forum activity in app
|
|||
And I should find "ReplyMessage" in the app
|
||||
And I should find "Not sent" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I switch network connection to wifi
|
||||
And I press "Initial discussion" in the app
|
||||
Then I should find "Initial discussion message" in the app
|
||||
|
@ -288,7 +288,7 @@ Feature: Test basic usage of forum activity in app
|
|||
And I should find "This Forum has offline data to be synchronised." in the app
|
||||
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Test forum name" in the app
|
||||
And I press "Information" in the app
|
||||
And I press "Refresh" in the app
|
||||
|
@ -327,7 +327,7 @@ Feature: Test basic usage of forum activity in app
|
|||
And I press "Download" within "Test forum name" "ion-item" in the app
|
||||
Then I should find "Downloaded" within "Test forum name" "ion-item" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I switch network connection to offline
|
||||
And I press "Test forum name" in the app
|
||||
Then I should find "Initial discussion" in the app
|
||||
|
@ -336,16 +336,16 @@ Feature: Test basic usage of forum activity in app
|
|||
Then I should find "Initial discussion" in the app
|
||||
And I should find "Initial discussion message" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Add discussion topic" in the app
|
||||
Then I should not find "There was a problem connecting to the site. Please check your connection and try again." in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Sort by last post creation date in descending order" in the app
|
||||
And I press "Sort by last post creation date in ascending order" in the app
|
||||
Then I should find "Forum not available in this sorting order" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test forum name" in the app
|
||||
Then I should find "Forum not available in this sorting order" in the app
|
||||
And I should find "Sort by last post creation date in ascending order" in the app
|
||||
|
|
|
@ -46,7 +46,7 @@ Feature: Test usage of forum activity with groups in app
|
|||
And I should not find "Group 2" in the app
|
||||
|
||||
When I press "Group 1" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Visible groups forum" in the app
|
||||
And I press "Visible groups" in the app
|
||||
Then I should find "All participants" in the app
|
||||
|
@ -88,7 +88,7 @@ Feature: Test usage of forum activity with groups in app
|
|||
And I should find "Disc sep ALL" in the app
|
||||
But I should not find "Disc sep G1" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Visible groups forum" in the app
|
||||
And I press "Visible groups" in the app
|
||||
Then I should find "All participants" in the app
|
||||
|
@ -125,7 +125,7 @@ Feature: Test usage of forum activity with groups in app
|
|||
Then I should find "Your post was successfully added" in the app
|
||||
And I should find "My happy subject" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Visible groups forum" in the app
|
||||
And I press "Visible groups" in the app
|
||||
And I press "All participants" in the app
|
||||
|
@ -221,7 +221,7 @@ Feature: Test usage of forum activity with groups in app
|
|||
And I press "Group 2" in the app
|
||||
Then I should find "My third subject" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Visible groups forum" in the app
|
||||
And I press "Visible groups" in the app
|
||||
And I press "All participants" in the app
|
||||
|
@ -300,7 +300,7 @@ Feature: Test usage of forum activity with groups in app
|
|||
And I press "Group 2" in the app
|
||||
Then I should find "My happy subject" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Visible groups forum" in the app
|
||||
And I press "Visible groups" in the app
|
||||
And I press "Group 1" in the app
|
||||
|
@ -346,7 +346,7 @@ Feature: Test usage of forum activity with groups in app
|
|||
Then I should find "Downloaded" within "Separate groups" "ion-item" in the app
|
||||
And I should find "Downloaded" within "Visible groups" "ion-item" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I switch offline mode to "true"
|
||||
And I press "Separate groups forum" in the app
|
||||
Then I should find "Disc sep G1" in the app
|
||||
|
@ -356,8 +356,7 @@ Feature: Test usage of forum activity with groups in app
|
|||
Then I should find "Disc sep G1" in the app
|
||||
And I should find "Disc sep G1 content" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I press "Visible groups forum" in the app
|
||||
Then I should find "Disc vis ALL" in the app
|
||||
And I should find "Disc vis G1" in the app
|
||||
|
|
|
@ -70,7 +70,7 @@ Feature: Test forum navigation
|
|||
Then I should find "Discussion 20 message" in the app
|
||||
|
||||
# By creation date
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I scroll to "Discussion 05" in the app
|
||||
And I press "Sort" in the app
|
||||
And I press "Sort by creation date in descending order" in the app
|
||||
|
@ -101,7 +101,7 @@ Feature: Test forum navigation
|
|||
Then I should find "Discussion 18 message" in the app
|
||||
|
||||
# Offline
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Add discussion topic" in the app
|
||||
And I switch network connection to offline
|
||||
And I set the following fields to these values in the app:
|
||||
|
|
|
@ -59,7 +59,7 @@ Feature: Test basic usage of glossary in app
|
|||
And I should find "Potato" in the app
|
||||
And I should find "Raddish" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test forum name" in the app
|
||||
And I press "Add discussion topic" in the app
|
||||
And I set the field "Subject" to "Testing auto-link glossary"
|
||||
|
@ -72,7 +72,7 @@ Feature: Test basic usage of glossary in app
|
|||
Then the header should be "Raddish" in the app
|
||||
And I should find "Raphanus sativus" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Potato" in the app
|
||||
Then the header should be "Potato" in the app
|
||||
And I should find "To make chips" in the app
|
||||
|
@ -115,7 +115,7 @@ Feature: Test basic usage of glossary in app
|
|||
Given I entered the course "Course 1" as "student1" in the app
|
||||
When I press "Course downloads" in the app
|
||||
When I press "Download" within "Test glossary" "ion-item" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I switch network connection to offline
|
||||
And I press "Test glossary" in the app
|
||||
Then the header should be "Test glossary" in the app
|
||||
|
@ -201,7 +201,7 @@ Feature: Test basic usage of glossary in app
|
|||
And I should find "stub3.txt" in the app
|
||||
But I should not find "stub2.txt" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Coconut" in the app
|
||||
And I should find "Potato" in the app
|
||||
But I should not find "Cucumber" in the app
|
||||
|
@ -257,7 +257,7 @@ 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
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Pickle" in the app
|
||||
And I should find "Potato" in the app
|
||||
But I should not find "Broccoli" in the app
|
||||
|
@ -369,7 +369,7 @@ Feature: Test basic usage of glossary in app
|
|||
And I should find "Average of ratings: 1" in the app
|
||||
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
Then I should find "This Glossary has offline data to be synchronised." in the app
|
||||
|
||||
When I press "Information" in the app
|
||||
|
|
|
@ -114,7 +114,7 @@ Feature: Test glossary navigation
|
|||
Then I should find "Apricots are a fruit" in the app
|
||||
|
||||
# By author
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I scroll to "Acerola" in the app
|
||||
And I press "Browse entries" in the app
|
||||
And I press "Group by author" in the app
|
||||
|
@ -143,7 +143,7 @@ Feature: Test glossary navigation
|
|||
Then I should find "Banana is a fruit" in the app
|
||||
|
||||
# Search
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I scroll to "Acerola" in the app
|
||||
And I press "Search" in the app
|
||||
And I set the field "Search query" to "something" in the app
|
||||
|
@ -170,7 +170,7 @@ Feature: Test glossary navigation
|
|||
Then I should find "Watermelon is a fruit" in the app
|
||||
|
||||
# Offline
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Clear search" in the app
|
||||
And I press "Add a new entry" in the app
|
||||
And I switch network connection to offline
|
||||
|
@ -206,7 +206,7 @@ Feature: Test glossary navigation
|
|||
And I press "Save" in the app
|
||||
Then I should find "Tomato is a fruit" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Tomato" in the app
|
||||
And I should find "Cashew" in the app
|
||||
And I should find "Acerola" in the app
|
||||
|
|
|
@ -102,7 +102,7 @@ Feature: Test decimal separators in lesson
|
|||
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
|
||||
When I go back 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
|
||||
|
@ -131,7 +131,7 @@ Feature: Test decimal separators in lesson
|
|||
And I press "Download" within "Offline lesson" "ion-item" in the app
|
||||
Then I should find "Downloaded" within "Offline lesson" "ion-item" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Offline lesson" in the app
|
||||
And I switch network connection to offline
|
||||
And I press "Start" in the app
|
||||
|
@ -153,7 +153,7 @@ Feature: Test decimal separators in lesson
|
|||
And I should find "Your score is 1 (out of 1)." in the app
|
||||
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
Then I should find "An offline attempt was synchronised" in the app
|
||||
|
||||
Scenario: Attempt an offline lesson successfully as a student (custom separator)
|
||||
|
@ -167,7 +167,7 @@ Feature: Test decimal separators in lesson
|
|||
And I press "Download" within "Offline lesson" "ion-item" in the app
|
||||
Then I should find "Downloaded" within "Offline lesson" "ion-item" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Offline lesson" in the app
|
||||
And I switch network connection to offline
|
||||
And I press "Start" in the app
|
||||
|
@ -184,7 +184,7 @@ Feature: Test decimal separators in lesson
|
|||
And I should find "Your score is 1 (out of 1)." in the app
|
||||
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
Then I should find "An offline attempt was synchronised" in the app
|
||||
|
||||
When I switch network connection to offline
|
||||
|
|
|
@ -150,7 +150,7 @@ Feature: Attempt a quiz in app
|
|||
| \mod_quiz\event\attempt_reviewed | quiz | Quiz 1 | Course 1 | |
|
||||
| \mod_quiz\event\attempt_summary_viewed | quiz | Quiz 1 | Course 1 | |
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Attempt 1" in the app
|
||||
Then I should find "1" within "Attempt" "ion-item" in the app
|
||||
And I should find "Finished" within "Status" "ion-item" in the app
|
||||
|
|
|
@ -53,35 +53,33 @@ Feature: Users can only review attempts that are allowed to be reviewed
|
|||
And I press "Attempt 1" in the app
|
||||
Then I should not be able to press "Review" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Quiz review only immed" in the app
|
||||
And I press "Attempt 1" in the app
|
||||
And I press "Review" in the app
|
||||
Then I should find "Question 1" in the app
|
||||
|
||||
# Wait the "immediate after" time and check that now the behaviour is the opposite.
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I wait "120" seconds
|
||||
And I press "Quiz review only immed" in the app
|
||||
And I press "Attempt 1" in the app
|
||||
Then I should find "You are not allowed to review this attempt" in the app
|
||||
And I should not be able to press "Review" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Quiz review after immed" in the app
|
||||
And I press "Attempt 1" in the app
|
||||
And I press "Review" in the app
|
||||
Then I should find "Question 1" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I press "Quiz never review" in the app
|
||||
And I press "Attempt 1" in the app
|
||||
Then I should find "You are not allowed to review this attempt" in the app
|
||||
And I should not be able to press "Review" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Quiz review when closed" in the app
|
||||
And I press "Attempt 1" in the app
|
||||
Then I should find "Available 31/12/35, 23:59" in the app
|
||||
|
|
|
@ -33,16 +33,14 @@ Feature: Test appearance options of SCORM activity in app
|
|||
And I press "Disable fullscreen" in the app
|
||||
# Then the UI should match the snapshot
|
||||
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I press "New window px SCORM" in the app
|
||||
And I press "Enter" in the app
|
||||
And I press "Disable fullscreen" in the app
|
||||
# Then the UI should match the snapshot
|
||||
|
||||
# SCORMs with percentage sizes are displayed with full size in the app. See MOBILE-3426 for details.
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I press "New window perc SCORM" in the app
|
||||
And I press "Enter" in the app
|
||||
And I press "Disable fullscreen" in the app
|
||||
|
@ -58,25 +56,23 @@ Feature: Test appearance options of SCORM activity in app
|
|||
When I press "No skip SCORM" in the app
|
||||
Then I should be able to press "Enter" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Skip first access SCORM" in the app
|
||||
And I press "Disable fullscreen" in the app
|
||||
Then I should find "2 / 11" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I press "Skip first access SCORM" in the app
|
||||
Then I should be able to press "Enter" in the app
|
||||
And I should not be able to press "Disable fullscreen" in the app
|
||||
And I should not find "3 / 11" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Always skip SCORM" in the app
|
||||
And I press "Disable fullscreen" in the app
|
||||
Then I should find "2 / 11" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I press "Always skip SCORM" in the app
|
||||
And I press "Disable fullscreen" in the app
|
||||
# Then I should find "3 / 11" in the app
|
||||
|
@ -90,7 +86,7 @@ Feature: Test appearance options of SCORM activity in app
|
|||
When I press "SCORM without preview" in the app
|
||||
Then I should not be able to press "Preview" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "SCORM with preview" in the app
|
||||
Then I should be able to press "Preview" in the app
|
||||
|
||||
|
@ -103,7 +99,7 @@ Feature: Test appearance options of SCORM activity in app
|
|||
When I press "SCORM without structure" in the app
|
||||
Then I should not find "Other Scoring Systems" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "SCORM with structure" in the app
|
||||
Then I should find "Other Scoring Systems" in the app
|
||||
|
||||
|
@ -123,8 +119,7 @@ Feature: Test appearance options of SCORM activity in app
|
|||
Then I should find "Other Scoring Systems" in the app
|
||||
|
||||
When I press "Close" in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I go back 2 times in the app
|
||||
And I press "SCORM Hidden" in the app
|
||||
And I press "Enter" in the app
|
||||
And I press "Disable fullscreen" in the app
|
||||
|
@ -132,8 +127,7 @@ Feature: Test appearance options of SCORM activity in app
|
|||
Then I should find "Other Scoring Systems" in the app
|
||||
|
||||
When I press "Close" in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I go back 2 times in the app
|
||||
And I press "SCORM Drop Down" in the app
|
||||
And I press "Enter" in the app
|
||||
And I press "Disable fullscreen" in the app
|
||||
|
@ -141,8 +135,7 @@ Feature: Test appearance options of SCORM activity in app
|
|||
Then I should find "Other Scoring Systems" in the app
|
||||
|
||||
When I press "Close" in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I go back 2 times in the app
|
||||
And I press "SCORM Disabled" in the app
|
||||
And I press "Enter" in the app
|
||||
And I press "Disable fullscreen" in the app
|
||||
|
@ -160,14 +153,14 @@ Feature: Test appearance options of SCORM activity in app
|
|||
When I press "SCORM no attempt status" in the app
|
||||
Then I should not find "Number of attempts allowed" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "SCORM both att status" in the app
|
||||
Then I should find "Number of attempts allowed" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "SCORM dashb att status" in the app
|
||||
Then I should find "Number of attempts allowed" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "SCORM entry att status" in the app
|
||||
Then I should find "Number of attempts allowed" in the app
|
||||
|
|
|
@ -42,14 +42,14 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
And I press "Next" in the app
|
||||
And I press "Next" in the app
|
||||
And I press "Next" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
|
||||
Then I should find "1" within "Number of attempts you have made" "ion-item" in the app
|
||||
And I should find "You have reached the maximum number of attempts." in the app
|
||||
And I should not be able to press "Enter" in the app
|
||||
And I should not be able to press "Preview" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "SCORM 1 att no lock" in the app
|
||||
And I press "Enter" in the app
|
||||
And I press "Disable fullscreen" in the app
|
||||
|
@ -61,7 +61,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
And I press "Next" in the app
|
||||
And I press "Next" in the app
|
||||
And I press "Next" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
Then I should find "1" within "Number of attempts you have made" "ion-item" in the app
|
||||
And I should find "You have reached the maximum number of attempts." in the app
|
||||
And I should not find "Start a new attempt" in the app
|
||||
|
@ -74,10 +74,10 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# Then I should find "Review mode" in the app
|
||||
|
||||
When I press "Close" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
Then I should find "1" within "Number of attempts you have made" "ion-item" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "SCORM 2 attempts" in the app
|
||||
And I press "Enter" in the app
|
||||
And I press "Disable fullscreen" in the app
|
||||
|
@ -89,7 +89,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
And I press "Next" in the app
|
||||
And I press "Next" in the app
|
||||
And I press "Next" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
Then I should find "1" within "Number of attempts you have made" "ion-item" in the app
|
||||
And I should not find "You have reached the maximum number of attempts." in the app
|
||||
|
||||
|
@ -104,12 +104,12 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I press "Next" in the app
|
||||
# And I press "Next" in the app
|
||||
# And I press "Next" in the app
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "2" within "Number of attempts you have made" "ion-item" in the app
|
||||
# And I should find "You have reached the maximum number of attempts." in the app
|
||||
# And I should not find "Start a new attempt" in the app
|
||||
|
||||
# When I press the back button in the app
|
||||
# When I go back in the app
|
||||
# And I press "SCORM unlimited" in the app
|
||||
# Then I should find "Unlimited" within "Number of attempts allowed" "ion-item" in the app
|
||||
|
||||
|
@ -131,7 +131,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
And I press "Next" in the app
|
||||
And I press "Next" in the app
|
||||
And I press "Next" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
Then I should find "1" within "Number of attempts you have made" "ion-item" in the app
|
||||
# And I should find "Start a new attempt" in the app
|
||||
|
||||
|
@ -141,7 +141,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# Then I should find "Review mode" in the app
|
||||
|
||||
When I press "Close" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
Then I should find "1" within "Number of attempts you have made" "ion-item" in the app
|
||||
|
||||
# When I press "Start a new attempt" in the app
|
||||
|
@ -151,11 +151,11 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# Then I should not find "Review mode" in the app
|
||||
|
||||
# When I press "Close" in the app
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "2" within "Number of attempts you have made" "ion-item" in the app
|
||||
# And I should not find "Start a new attempt" in the app
|
||||
|
||||
# When I press the back button in the app
|
||||
# When I go back in the app
|
||||
# When I press "SCORM when completed" in the app
|
||||
# And I press "Enter" in the app
|
||||
# And I press "Disable fullscreen" in the app
|
||||
|
@ -167,7 +167,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I press "Next" in the app
|
||||
# And I press "Next" in the app
|
||||
# And I press "Next" in the app
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "1" within "Number of attempts you have made" "ion-item" in the app
|
||||
# And I should not find "Start a new attempt" in the app
|
||||
|
||||
|
@ -177,23 +177,23 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# Then I should not find "Review mode" in the app
|
||||
|
||||
# When I press "Close" in the app
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "2" within "Number of attempts you have made" "ion-item" in the app
|
||||
# And I should not find "Start a new attempt" in the app
|
||||
|
||||
# When I press the back button in the app
|
||||
# When I go back in the app
|
||||
# When I press "SCORM always force" in the app
|
||||
# And I press "Enter" in the app
|
||||
# And I press "Disable fullscreen" in the app
|
||||
# And I press "Next" in the app
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "1" within "Number of attempts you have made" "ion-item" in the app
|
||||
# And I should not find "Start a new attempt" in the app
|
||||
|
||||
# When I press "Enter" in the app
|
||||
# And I press "Disable fullscreen" in the app
|
||||
# And I press "Next" in the app
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "2" within "Number of attempts you have made" "ion-item" in the app
|
||||
# And I should not find "Start a new attempt" in the app
|
||||
|
||||
|
@ -293,12 +293,12 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I should find "Completed" within "SCO with prerequisite (first and secon SCO)" "ion-item" in the app
|
||||
|
||||
# When I press "Close" in the app
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "5" within "Grade reported" "ion-item" in the app
|
||||
# And I should find "Score: 8" within "The first content (one SCO)" "ion-item" in the app
|
||||
|
||||
# # Case 2: SCORM with highest grade as grading method
|
||||
# When I press the back button in the app
|
||||
# When I go back in the app
|
||||
# And I press "SCORM highest" in the app
|
||||
# And I press "Enter" in the app
|
||||
# And I press "Disable fullscreen" in the app
|
||||
|
@ -372,11 +372,11 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I click on "#ui-id-25" "css_element"
|
||||
# And I press "Commit changes"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "10" within "Grade reported" "ion-item" in the app
|
||||
|
||||
# # Case 3: SCORM with average grade as grading method
|
||||
# When I press the back button in the app
|
||||
# When I go back in the app
|
||||
# And I press "SCORM average" in the app
|
||||
# And I press "Enter" in the app
|
||||
# And I press "Disable fullscreen" in the app
|
||||
|
@ -450,11 +450,11 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I click on "#ui-id-25" "css_element"
|
||||
# And I press "Commit changes"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "6.17%" within "Grade reported" "ion-item" in the app
|
||||
|
||||
# # Case 4: SCORM with sum grade as grading method and a max grade of 100
|
||||
# When I press the back button in the app
|
||||
# When I go back in the app
|
||||
# And I press "SCORM sum 100" in the app
|
||||
# And I press "Enter" in the app
|
||||
# And I press "Disable fullscreen" in the app
|
||||
|
@ -528,11 +528,11 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I click on "#ui-id-25" "css_element"
|
||||
# And I press "Commit changes"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "37%" within "Grade reported" "ion-item" in the app
|
||||
|
||||
# # Case 5: SCORM with sum grade as grading method and a max grade of 50
|
||||
# When I press the back button in the app
|
||||
# When I go back in the app
|
||||
# And I press "SCORM sum 50" in the app
|
||||
# And I press "Enter" in the app
|
||||
# And I press "Disable fullscreen" in the app
|
||||
|
@ -606,7 +606,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I click on "#ui-id-25" "css_element"
|
||||
# And I press "Commit changes"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "74%" within "Grade reported" "ion-item" in the app
|
||||
|
||||
# Scenario: SCORM grade is calculated right based on 'Attempts grading' setting
|
||||
|
@ -653,7 +653,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I switch to "scorm_object" iframe
|
||||
# And I press "Exit"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# And I press "Grades" in the app
|
||||
# Then I should find "27%" within "Grade reported" "ion-item" in the app
|
||||
# And I should find "27%" within "Grade for attempt 1" "ion-item" in the app
|
||||
|
@ -691,7 +691,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I switch to "scorm_object" iframe
|
||||
# And I press "Exit"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "40%" within "Grade reported" "ion-item" in the app
|
||||
# And I should find "27%" within "Grade for attempt 1" "ion-item" in the app
|
||||
# And I should find "40%" within "Grade for attempt 2" "ion-item" in the app
|
||||
|
@ -726,14 +726,14 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I switch to "scorm_object" iframe
|
||||
# And I press "Exit"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "40%" within "Grade reported" "ion-item" in the app
|
||||
# And I should find "27%" within "Grade for attempt 1" "ion-item" in the app
|
||||
# And I should find "40%" within "Grade for attempt 2" "ion-item" in the app
|
||||
# And I should find "20%" within "Grade for attempt 3" "ion-item" in the app
|
||||
|
||||
# # Case 2: perform 2 attempts in 'SCORM average' and check the average grade is used.
|
||||
# When I press the back button in the app
|
||||
# When I go back in the app
|
||||
# And I press "SCORM average" in the app
|
||||
# Then I should find "Average attempts" within "Grading method" "ion-item" in the app
|
||||
# And I should find "Grade couldn't be calculated" within "Grade reported" "ion-item" in the app
|
||||
|
@ -767,7 +767,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I switch to "scorm_object" iframe
|
||||
# And I press "Exit"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# And I press "Grades" in the app
|
||||
# Then I should find "20%" within "Grade reported" "ion-item" in the app
|
||||
# And I should find "20%" within "Grade for attempt 1" "ion-item" in the app
|
||||
|
@ -805,13 +805,13 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I switch to "scorm_object" iframe
|
||||
# And I press "Exit"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "30%" within "Grade reported" "ion-item" in the app
|
||||
# And I should find "20%" within "Grade for attempt 1" "ion-item" in the app
|
||||
# And I should find "40%" within "Grade for attempt 2" "ion-item" in the app
|
||||
|
||||
# # Case 3: perform 2 attempts in 'SCORM first' and check the first attempt is used.
|
||||
# When I press the back button in the app
|
||||
# When I go back in the app
|
||||
# And I press "SCORM first" in the app
|
||||
# Then I should find "First attempt" within "Grading method" "ion-item" in the app
|
||||
# And I should find "Grade couldn't be calculated" within "Grade reported" "ion-item" in the app
|
||||
|
@ -846,7 +846,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I switch to "scorm_object" iframe
|
||||
# And I press "Exit"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# And I press "Grades" in the app
|
||||
# Then I should find "27%" within "Grade reported" "ion-item" in the app
|
||||
# And I should find "27%" within "Grade for attempt 1" "ion-item" in the app
|
||||
|
@ -884,13 +884,13 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I switch to "scorm_object" iframe
|
||||
# And I press "Exit"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "27%" within "Grade reported" "ion-item" in the app
|
||||
# And I should find "27%" within "Grade for attempt 1" "ion-item" in the app
|
||||
# And I should find "40%" within "Grade for attempt 2" "ion-item" in the app
|
||||
|
||||
# # Case 4: perform 3 attempts in 'SCORM last' and check the last completed attempt is used.
|
||||
# When I press the back button in the app
|
||||
# When I go back in the app
|
||||
# And I press "SCORM last" in the app
|
||||
# Then I should find "Last completed attempt" within "Grading method" "ion-item" in the app
|
||||
# And I should find "Grade couldn't be calculated" within "Grade reported" "ion-item" in the app
|
||||
|
@ -935,7 +935,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I switch to "scorm_object" iframe
|
||||
# And I press "Exit"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# And I press "Grades" in the app
|
||||
# Then I should find "87%" within "Grade reported" "ion-item" in the app
|
||||
# And I should find "87%" within "Grade for attempt 1" "ion-item" in the app
|
||||
|
@ -971,7 +971,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I switch to "scorm_object" iframe
|
||||
# And I press "Exit"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# # Grade reported belongs to attempt 1 because the second attempt's only SCO is failed.
|
||||
# Then I should find "87%" within "Grade reported" "ion-item" in the app
|
||||
# And I should find "87%" within "Grade for attempt 1" "ion-item" in the app
|
||||
|
@ -1016,7 +1016,7 @@ Feature: Test attempts and grading settings of SCORM activity in app
|
|||
# And I switch to "scorm_object" iframe
|
||||
# And I press "Exit"
|
||||
# And I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "73%" within "Grade reported" "ion-item" in the app
|
||||
# And I should find "87%" within "Grade for attempt 1" "ion-item" in the app
|
||||
# And I should find "27%" within "Grade for attempt 2" "ion-item" in the app
|
||||
|
|
|
@ -28,13 +28,13 @@ Feature: Test availability options of SCORM activity in app
|
|||
And I should find "## yesterday ##%d %B %Y, %I:%M %p##" near "Closed:" in the app
|
||||
And I should not be able to press "Enter" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Current SCORM" in the app
|
||||
Then I should find "## yesterday ##%d %B %Y, %I:%M %p##" near "Opened:" in the app
|
||||
And I should find "## tomorrow ##%d %B %Y, %I:%M %p##" near "Closes:" in the app
|
||||
And I should be able to press "Enter" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Future SCORM" in the app
|
||||
Then I should find "Sorry, this activity is not available until ## tomorrow ##%A, %d %B %Y, %I:%M %p##" in the app
|
||||
And I should find "## tomorrow ##%d %B %Y, %I:%M %p##" near "Opens:" in the app
|
||||
|
|
|
@ -40,7 +40,7 @@ Feature: Test basic usage of SCORM activity in app
|
|||
# And I should see "Scoring"
|
||||
|
||||
# When I switch to the main frame
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "1" within "Number of attempts you have made" "ion-item" in the app
|
||||
# And I should find "3" within "Grade reported" "ion-item" in the app
|
||||
|
||||
|
@ -103,7 +103,7 @@ Feature: Test basic usage of SCORM activity in app
|
|||
# And I should find "Not attempted" within "Having Fun Quiz" "ion-item" in the app
|
||||
|
||||
# When I press "Close" in the app
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "Completed" within "How to Play" "ion-item" in the app
|
||||
# And I should find "Completed" within "Par?" "ion-item" in the app
|
||||
# And I should find "Not attempted" within "Keeping Score" "ion-item" in the app
|
||||
|
@ -143,7 +143,7 @@ Feature: Test basic usage of SCORM activity in app
|
|||
And I press "Next" in the app
|
||||
Then I should find "11 / 11" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "1" within "Number of attempts you have made" "ion-item" in the app
|
||||
# And I should find "9" within "Grade reported" "ion-item" in the app
|
||||
|
||||
|
@ -156,7 +156,7 @@ Feature: Test basic usage of SCORM activity in app
|
|||
# And I should find "Complete" within "Having Fun Quiz" "ion-item" in the app
|
||||
|
||||
# When I press "Close" in the app
|
||||
# And I press the back button in the app
|
||||
# And I go back in the app
|
||||
# Then I should find "1" within "Number of attempts you have made" "ion-item" in the app
|
||||
|
||||
Scenario: Unsupported SCORM
|
||||
|
|
|
@ -245,7 +245,7 @@ Feature: Test basic usage of survey activity in 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 go back 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
|
||||
|
@ -260,13 +260,13 @@ Feature: Test basic usage of survey activity in app
|
|||
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 go back 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 go back 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
|
||||
|
|
|
@ -134,5 +134,5 @@ Feature: Test basic usage of workshop activity in app
|
|||
When I press "Information" in the app
|
||||
And I press "Download" in the app
|
||||
And I press "Close" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
Then I should find "Downloaded" in the app
|
||||
|
|
|
@ -59,12 +59,12 @@ Feature: Notifications
|
|||
Then I should find "Push 01" in the app
|
||||
|
||||
# Open notification detail
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test 30" in the app
|
||||
Then I should find "Test 30 description" in the app
|
||||
|
||||
# Go back and open other notification
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Test 10" in the app
|
||||
When I press "Test 10" in the app
|
||||
Then I should find "Test 10 description" in the app
|
||||
|
|
|
@ -221,6 +221,10 @@ export class CoreFormatTextDirective implements OnChanges, OnDestroy, AsyncDirec
|
|||
* @param img Image to adapt.
|
||||
*/
|
||||
protected adaptImage(img: HTMLElement): void {
|
||||
if (img.classList.contains('texrender')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Element to wrap the image.
|
||||
const container = document.createElement('span');
|
||||
const originalWidth = img.attributes.getNamedItem('width');
|
||||
|
|
|
@ -41,7 +41,7 @@ Feature: Test basic usage of comments in app
|
|||
Then I should find "Comment created" in the app
|
||||
And I should find "comment test teacher" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I should find "Comments (1)" in the app
|
||||
|
||||
# Create and delete comments as a student
|
||||
|
@ -55,7 +55,7 @@ Feature: Test basic usage of comments in app
|
|||
And I should find "comment test teacher" in the app
|
||||
And I should find "comment test student" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Comments (2)" in the app
|
||||
And I press "Toggle delete buttons" in the app
|
||||
And I press "Delete" near "comment test student" in the app
|
||||
|
@ -64,7 +64,7 @@ Feature: Test basic usage of comments in app
|
|||
And I should find "comment test teacher" in the app
|
||||
But I should not see "comment test student"
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Comments (1)" in the app
|
||||
|
||||
Scenario: Add comments offline & Delete comments offline & Sync comments (database)
|
||||
|
@ -82,7 +82,7 @@ Feature: Test basic usage of comments in app
|
|||
And I should find "There are offline comments to be synchronised." in the app
|
||||
And I should find "comment test" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Comments (0)" in the app
|
||||
And I switch network connection to wifi
|
||||
And I press "Display options" in the app
|
||||
|
@ -91,7 +91,7 @@ Feature: Test basic usage of comments in app
|
|||
Then I should find "comment test" in the app
|
||||
But I should not see "There are offline comments to be synchronised."
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Comments (1)" in the app
|
||||
And I switch network connection to offline
|
||||
And I press "Toggle delete buttons" in the app
|
||||
|
@ -102,7 +102,7 @@ Feature: Test basic usage of comments in app
|
|||
And I should find "Deleted offline" in the app
|
||||
And I should find "comment test" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Comments (1)" in the app
|
||||
And I switch network connection to wifi
|
||||
And I press "Display options" in the app
|
||||
|
@ -111,7 +111,7 @@ Feature: Test basic usage of comments in app
|
|||
Then I should not see "There are offline comments to be synchronised."
|
||||
And I should not see "comment test"
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I should find "Comments (0)" in the app
|
||||
|
||||
Scenario: Add comments & delete comments (glossary)
|
||||
|
@ -128,7 +128,7 @@ Feature: Test basic usage of comments in app
|
|||
And I press "Send" in the app
|
||||
Then I should find "Comment created" in the app
|
||||
And I should find "comment test teacher" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I should find "Comments (1)" in the app
|
||||
|
||||
# Create and delete comments as a student
|
||||
|
@ -142,7 +142,7 @@ Feature: Test basic usage of comments in app
|
|||
And I should find "comment test teacher" in the app
|
||||
And I should find "comment test student" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Comments (2)" in the app
|
||||
And I press "Toggle delete buttons" in the app
|
||||
And I press "Delete" near "comment test student" in the app
|
||||
|
@ -151,7 +151,7 @@ Feature: Test basic usage of comments in app
|
|||
And I should find "comment test teacher" in the app
|
||||
But I should not see "comment test student"
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I should find "Comments (1)" in the app
|
||||
|
||||
Scenario: Add comments offline & Delete comments offline & Sync comments (glossary)
|
||||
|
@ -170,7 +170,7 @@ Feature: Test basic usage of comments in app
|
|||
And I should find "There are offline comments to be synchronised." in the app
|
||||
And I should find "comment test" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Comments (0)" in the app
|
||||
And I switch network connection to wifi
|
||||
And I press "Display options" in the app
|
||||
|
@ -179,7 +179,7 @@ Feature: Test basic usage of comments in app
|
|||
Then I should find "comment test" in the app
|
||||
But I should not see "There are offline comments to be synchronised."
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Comments (1)" in the app
|
||||
And I switch network connection to offline
|
||||
And I press "Toggle delete buttons" in the app
|
||||
|
@ -190,7 +190,7 @@ Feature: Test basic usage of comments in app
|
|||
And I should find "Deleted offline" in the app
|
||||
And I should find "comment test" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Comments (1)" in the app
|
||||
And I switch network connection to wifi
|
||||
And I press "Display options" in the app
|
||||
|
@ -199,7 +199,7 @@ Feature: Test basic usage of comments in app
|
|||
Then I should not see "There are offline comments to be synchronised."
|
||||
And I should not see "comment test"
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I should find "Comments (0)" in the app
|
||||
|
||||
Scenario: Add comments & Delete comments (blogs)
|
||||
|
@ -221,7 +221,7 @@ Feature: Test basic usage of comments in app
|
|||
Then I should find "Comment created" in the app
|
||||
And I should find "comment test" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Comments (1)" in the app
|
||||
And I press "Toggle delete buttons" in the app
|
||||
And I press "Delete" in the app
|
||||
|
@ -229,7 +229,7 @@ Feature: Test basic usage of comments in app
|
|||
Then I should find "Comment deleted" in the app
|
||||
But I should not see "comment test"
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Comments (0)" in the app
|
||||
|
||||
Scenario: Add comments offline & Delete comments offline & Sync comments (blogs)
|
||||
|
@ -253,7 +253,7 @@ Feature: Test basic usage of comments in app
|
|||
And I should find "There are offline comments to be synchronised." in the app
|
||||
And I should find "comment test" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Comments (0)" in the app
|
||||
And I switch network connection to wifi
|
||||
And I press "Display options" in the app
|
||||
|
@ -262,7 +262,7 @@ Feature: Test basic usage of comments in app
|
|||
Then I should find "comment test" in the app
|
||||
But I should not see "There are offline comments to be synchronised."
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Comments (1)" in the app
|
||||
And I switch network connection to offline
|
||||
And I press "Toggle delete buttons" in the app
|
||||
|
@ -273,7 +273,7 @@ Feature: Test basic usage of comments in app
|
|||
And I should find "Deleted offline" in the app
|
||||
And I should find "comment test" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Comments (1)" in the app
|
||||
And I switch network connection to wifi
|
||||
And I press "Display options" in the app
|
||||
|
@ -282,5 +282,5 @@ Feature: Test basic usage of comments in app
|
|||
Then I should not see "There are offline comments to be synchronised."
|
||||
And I should not see "comment test"
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Comments (0)" in the app
|
||||
|
|
|
@ -119,11 +119,11 @@ Feature: Test basic usage of one course in app
|
|||
When I press "Test forum name" in the app
|
||||
Then the header should be "Test forum name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test wiki name" in the app
|
||||
Then the header should be "Test wiki name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Course index" in the app
|
||||
And I press "Topic 1" in the app
|
||||
Then I should find "Choice course 1" in the app
|
||||
|
@ -144,19 +144,19 @@ Feature: Test basic usage of one course in app
|
|||
When I press "Choice course 1" in the app
|
||||
Then the header should be "Choice course 1" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "assignment" in the app
|
||||
Then the header should be "assignment" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test external name" in the app
|
||||
Then the header should be "Test external name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test survey name" in the app
|
||||
Then the header should be "Test survey name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Course index" in the app
|
||||
And I press "Topic 2" in the app
|
||||
Then I should find "Quiz 1" in the app
|
||||
|
@ -177,15 +177,15 @@ Feature: Test basic usage of one course in app
|
|||
When I press "Test chat name" in the app
|
||||
Then the header should be "Test chat name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Quiz 1" in the app
|
||||
Then the header should be "Quiz 1" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test scorm name" in the app
|
||||
Then the header should be "Test scorm name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Course index" in the app
|
||||
And I press "Topic 3" in the app
|
||||
Then I should find "Test feedback name" in the app
|
||||
|
@ -207,15 +207,15 @@ Feature: Test basic usage of one course in app
|
|||
And I press "OK" in the app
|
||||
Then the header should be "Test feedback name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test lesson name" in the app
|
||||
Then the header should be "Test lesson name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test workshop name" in the app
|
||||
Then the header should be "Test workshop name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Course index" in the app
|
||||
And I press "Topic 4" in the app
|
||||
Then I should find "Web links" in the app
|
||||
|
@ -236,7 +236,7 @@ Feature: Test basic usage of one course in app
|
|||
When I press "Web links" in the app
|
||||
Then the header should be "Web links" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Course index" in the app
|
||||
And I press "Topic 5" in the app
|
||||
Then I should find "Test glossary" in the app
|
||||
|
|
|
@ -127,57 +127,57 @@ Feature: Test basic usage of one course in app
|
|||
When I press "Choice course 1" in the app
|
||||
Then the header should be "Choice course 1" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "assignment" in the app
|
||||
Then the header should be "assignment" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test forum name" in the app
|
||||
Then the header should be "Test forum name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test chat name" in the app
|
||||
Then the header should be "Test chat name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Web links" in the app
|
||||
Then the header should be "Web links" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test external name" in the app
|
||||
And I press "Launch the activity" in the app
|
||||
And I wait loading to finish in the app
|
||||
Then the header should be "Test external name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test feedback name" in the app
|
||||
Then the header should be "Test feedback name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test glossary" in the app
|
||||
Then the header should be "Test glossary" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Quiz 1" in the app
|
||||
Then the header should be "Quiz 1" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test survey name" in the app
|
||||
Then the header should be "Test survey name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test wiki name" in the app
|
||||
Then the header should be "Test wiki name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test lesson name" in the app
|
||||
Then the header should be "Test lesson name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test scorm name" in the app
|
||||
Then the header should be "Test scorm name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test workshop name" in the app
|
||||
Then the header should be "Test workshop name" in the app
|
||||
And the following events should have been logged for "student1" in the app:
|
||||
|
@ -237,11 +237,11 @@ Feature: Test basic usage of one course in app
|
|||
When I press "Test forum name" in the app
|
||||
Then the header should be "Test forum name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test wiki name" in the app
|
||||
Then the header should be "Test wiki name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Course index" in the app
|
||||
And I press "Section 1" in the app
|
||||
Then I should find "Choice course 1" in the app
|
||||
|
@ -262,19 +262,19 @@ Feature: Test basic usage of one course in app
|
|||
When I press "Choice course 1" in the app
|
||||
Then the header should be "Choice course 1" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "assignment" in the app
|
||||
Then the header should be "assignment" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test external name" in the app
|
||||
Then the header should be "Test external name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test survey name" in the app
|
||||
Then the header should be "Test survey name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Course index" in the app
|
||||
And I press "Section 2" in the app
|
||||
Then I should find "Quiz 1" in the app
|
||||
|
@ -295,15 +295,15 @@ Feature: Test basic usage of one course in app
|
|||
When I press "Test chat name" in the app
|
||||
Then the header should be "Test chat name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Quiz 1" in the app
|
||||
Then the header should be "Quiz 1" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test scorm name" in the app
|
||||
Then the header should be "Test scorm name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Course index" in the app
|
||||
And I press "Section 3" in the app
|
||||
Then I should find "Test feedback name" in the app
|
||||
|
@ -324,15 +324,15 @@ Feature: Test basic usage of one course in app
|
|||
When I press "Test feedback name" in the app
|
||||
Then the header should be "Test feedback name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test lesson name" in the app
|
||||
Then the header should be "Test lesson name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test workshop name" in the app
|
||||
Then the header should be "Test workshop name" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Course index" in the app
|
||||
And I press "Section 4" in the app
|
||||
Then I should find "Web links" in the app
|
||||
|
@ -353,7 +353,7 @@ Feature: Test basic usage of one course in app
|
|||
When I press "Web links" in the app
|
||||
Then the header should be "Web links" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Course index" in the app
|
||||
And I press "Section 5" in the app
|
||||
Then I should find "Test glossary" in the app
|
||||
|
|
|
@ -54,13 +54,12 @@ Feature: Test basic usage of courses in 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
|
||||
When I go back to the root page 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
|
||||
When I go back 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
|
||||
|
|
|
@ -81,13 +81,12 @@ Feature: Test basic usage of courses in 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
|
||||
When I go back to the root page 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
|
||||
When I go back 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
|
||||
|
@ -108,7 +107,7 @@ Feature: Test basic usage of courses in app
|
|||
Then I should find "Course 4" in the app
|
||||
And I should find "Course summary" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I set the field "Search" to "Course" in the app
|
||||
And I press "Search" "button" in the app
|
||||
Then I should find "Course 1" in the app
|
||||
|
@ -128,8 +127,7 @@ Feature: Test basic usage of courses in app
|
|||
When I press "Add submission" in the app
|
||||
Then I should find "Online text submissions" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I press "Add submission" in the app
|
||||
Then I should find "Online text submissions" in the app
|
||||
|
||||
|
|
|
@ -24,4 +24,4 @@ Feature: Contact the privacy officer
|
|||
Scenario: Contacting the privacy officer when not enabled
|
||||
When I entered the app as "student1"
|
||||
And I press the user menu button in the app
|
||||
Then I should not find ""Data privacy" in the app
|
||||
Then I should not find "Data privacy" in the app
|
||||
|
|
|
@ -19,6 +19,6 @@ Feature: Manage my own data requests
|
|||
And I set the field "Message" to "Hello DPO!" in the app
|
||||
And I press "Send" in the app
|
||||
Then I should find "Your request has been submitted to the privacy officer" in the app
|
||||
When I press "Cancel" near "Hello DPO!" in the app
|
||||
When I press "Cancel request" near "Hello DPO!" in the app
|
||||
And I press "Cancel request" "button" in the app
|
||||
Then I should find "Cancelled" near "Hello DPO!" in the app
|
||||
|
|
|
@ -83,14 +83,13 @@ Feature: Grades navigation
|
|||
Then I should find "Blog entries" in the app
|
||||
And I should find "Grades" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Student second" in the app
|
||||
Then I should find "Blog entries" in the app
|
||||
But I should not find "Grades" in the app
|
||||
|
||||
# User grades
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back to the root page in the app
|
||||
And I press the user menu button in the app
|
||||
And I press "Grades" in the app
|
||||
Then the header should be "Grades" in the app
|
||||
|
@ -148,7 +147,7 @@ Feature: Grades navigation
|
|||
Then I should find "Course 1" in the app
|
||||
But I should not find "Course 2" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Course 1" in the app
|
||||
And I should find "Course 2" in the app
|
||||
And the following events should have been logged for "student1" in the app:
|
||||
|
@ -212,7 +211,7 @@ Feature: Grades navigation
|
|||
And I should not find "Percentage" in the app
|
||||
|
||||
# Profile grades
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Participants" in the app
|
||||
And I press "Student first" in the app
|
||||
And I press "Grades" in the app
|
||||
|
|
|
@ -53,13 +53,13 @@ Feature: View grades
|
|||
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 go back 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 go back 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
|
||||
|
|
|
@ -36,10 +36,7 @@ Feature: Test showloginform setting in the app
|
|||
And I press "Moodle Mobile" in the app
|
||||
And I press "Developer options" in the app
|
||||
And I press "Always show login form" in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I go back 4 times in the app
|
||||
Then the header should be "Log in" in the app
|
||||
And I should find "Log in" "ion-button" in the app
|
||||
|
||||
|
@ -51,10 +48,7 @@ Feature: Test showloginform setting in the app
|
|||
And I press "Moodle Mobile" in the app
|
||||
And I press "Developer options" in the app
|
||||
And I press "Always show login form" in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I go back 4 times in the app
|
||||
And I press "david student" in the app
|
||||
Then the header should be "Reconnect" in the app
|
||||
And I should find "Log in" "ion-button" in the app
|
||||
|
|
|
@ -34,7 +34,7 @@ Feature: Main Menu opens the right page
|
|||
Given the following config values are set as admin:
|
||||
| defaulthomepage | 3 |
|
||||
And I entered the app as "student"
|
||||
Then "My courses" near "Home" should be selected in the app
|
||||
Then "My courses" "ion-tab-button" should be selected in the app
|
||||
And I should find "Course 1" in the app
|
||||
And "My courses" "text" should appear before "Home" "text" in the ".mainmenu-tabs" "css_element"
|
||||
|
||||
|
|
|
@ -153,7 +153,7 @@ Feature: Test accepting pending policies on signup
|
|||
But I should not find "Accepted" in the app
|
||||
|
||||
# Test tablet view now.
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I change viewport size to "1200x640" in the app
|
||||
And I press "User account" in the app
|
||||
And I press "Policies and agreements" in the app
|
||||
|
|
|
@ -75,7 +75,7 @@ Feature: Test Global Search
|
|||
When I press "Test page 01" in the app
|
||||
Then I should find "Test page content" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And global search expects the query "forum" and will return:
|
||||
| type | idnumber |
|
||||
| activity | forum |
|
||||
|
@ -87,7 +87,7 @@ Feature: Test Global Search
|
|||
When I press "Test forum" in the app
|
||||
Then I should find "Test forum intro" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Clear search" in the app
|
||||
Then I should find "What are you searching for?" in the app
|
||||
But I should not find "Test forum" in the app
|
||||
|
|
|
@ -10,7 +10,7 @@ Feature: It navigates properly within settings.
|
|||
Given I entered the app as "student1"
|
||||
|
||||
# Settings
|
||||
When I press "More" in the app
|
||||
When I press the more menu button in the app
|
||||
And I press "App settings" in the app
|
||||
Then I should find "General" in the app
|
||||
And I should find "Space usage" in the app
|
||||
|
@ -22,14 +22,13 @@ Feature: It navigates properly within settings.
|
|||
Then I should find "Language" in the app
|
||||
And I should find "Text size" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "About" in the app
|
||||
Then I should find "Moodle Mobile" in the app
|
||||
And I should find "Privacy policy" in the app
|
||||
|
||||
# Preferences
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back to the root page in the app
|
||||
And I press the user menu button in the app
|
||||
And I press "Preferences" in the app
|
||||
Then I should find "Messages" in the app
|
||||
|
@ -41,7 +40,7 @@ Feature: It navigates properly within settings.
|
|||
Then I should find "Accept messages from" in the app
|
||||
And I should find "Notification preferences" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Manage downloads" in the app
|
||||
Then I should find "Total space used" in the app
|
||||
|
||||
|
@ -50,7 +49,7 @@ Feature: It navigates properly within settings.
|
|||
And I change viewport size to "1200x640" in the app
|
||||
|
||||
# Settings
|
||||
When I press "More" in the app
|
||||
When I press the more menu button in the app
|
||||
And I press "App settings" in the app
|
||||
Then I should find "General" in the app
|
||||
And I should find "Space usage" in the app
|
||||
|
|
|
@ -27,8 +27,7 @@ Feature: It synchronise sites properly
|
|||
Then I should find "This Choice has offline data to be synchronised." in the app
|
||||
|
||||
# Cannot sync in offline
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back to the root page in the app
|
||||
And I press the user menu button in the app
|
||||
And I press "Preferences" in the app
|
||||
Then I should find "Your device is offline. Connect to the internet to synchronise sites." in the app
|
||||
|
@ -43,15 +42,14 @@ Feature: It synchronise sites properly
|
|||
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 go back in the app
|
||||
And I entered the course "Course 1" in the app
|
||||
And I press "Sync choice" in the app
|
||||
Then I should not find "This Choice has offline data to be synchronised." in the app
|
||||
|
||||
# Check limited sync.
|
||||
When I switch network connection to cellular
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I go back to the root page in the app
|
||||
And I press the user menu button in the app
|
||||
And I press "Preferences" in the app
|
||||
|
||||
|
@ -104,7 +102,8 @@ Feature: It synchronise sites properly
|
|||
Scenario: Sync logged in and logged out sites
|
||||
Given I entered the app as "student1"
|
||||
And I log out in the app
|
||||
And I entered the choice activity "Sync choice" on course "Course 1" as "student2" in the app
|
||||
And I entered the course "Course 1" as "student2" in the app
|
||||
And I press "Sync choice" in the app
|
||||
|
||||
# Add something offline
|
||||
When I switch network connection to offline
|
||||
|
@ -113,8 +112,7 @@ Feature: It synchronise sites properly
|
|||
And I press "OK" in the app
|
||||
Then I should find "This Choice has offline data to be synchronised." in the app
|
||||
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back to the root page in the app
|
||||
And I press the more menu button in the app
|
||||
And I press "App settings" in the app
|
||||
And I press "Synchronisation" in the app
|
||||
|
@ -125,14 +123,13 @@ Feature: It synchronise sites properly
|
|||
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
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I entered the course "Course 1" in the app
|
||||
And I press "Sync choice" in the app
|
||||
Then I should not find "This Choice has offline data to be synchronised." in the app
|
||||
|
||||
# Test log in to sync
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back to the root page in the app
|
||||
And I press the more menu button in the app
|
||||
And I press "App settings" in the app
|
||||
And I press "Synchronisation" in the app
|
||||
|
|
|
@ -103,8 +103,7 @@ Feature: Test basic usage of user features
|
|||
Then I should find "Europe/Madrid" in the app
|
||||
And I should not find "Asia/Shanghai" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
And I press the back button in the app
|
||||
When I go back 2 times in the app
|
||||
And I press "John Smith" in the app
|
||||
And I press "Details" in the app
|
||||
Then I should find "Asia/Shanghai" in the app
|
||||
|
|
|
@ -42,6 +42,6 @@ Feature: User Tours work properly.
|
|||
When I press "Got it" in the app
|
||||
Then I should not find "Swipe left and right to navigate around" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Student First" in the app
|
||||
Then I should not find "Swipe left and right to navigate around" in the app
|
||||
|
|
|
@ -48,7 +48,7 @@ export class CoreModalsService {
|
|||
// eslint-disable-next-line max-len
|
||||
// See https://github.com/ionic-team/ionic-framework/blob/a9b12a5aa4c150a1f8a80a826dda0df350bc0092/core/src/utils/overlays.ts#L39
|
||||
|
||||
const overlays = document.querySelectorAll<HTMLElement>(
|
||||
const overlays = document.body.querySelectorAll<HTMLElement>(
|
||||
'ion-action-sheet, ion-alert, ion-loading, ion-modal, ion-picker, ion-popover, ion-toast',
|
||||
);
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ Feature: It navigates properly within activities.
|
|||
And I press "Go to label" in the app
|
||||
Then I should find "Label description" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Go to label" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Label description" in the app
|
||||
|
|
|
@ -42,7 +42,7 @@ Feature: It navigates properly using deep links.
|
|||
And I should find "Forum message" in the app
|
||||
But I should not find "Site home" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Site home" in the app
|
||||
But I should not find "Forum topic" in the app
|
||||
And I should not find "Forum message" in the app
|
||||
|
@ -58,7 +58,7 @@ Feature: It navigates properly using deep links.
|
|||
And I should find "Forum message" in the app
|
||||
But I should not find "Site home" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Site home" in the app
|
||||
But I should not find "Forum topic" in the app
|
||||
And I should not find "Forum message" in the app
|
||||
|
@ -75,6 +75,6 @@ Feature: It navigates properly using deep links.
|
|||
And I press "Log in" in the app
|
||||
Then I should find "Test forum" in the app
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Site home" in the app
|
||||
But I should not find "Test forum" in the app
|
||||
|
|
|
@ -30,7 +30,7 @@ Feature: It opens external links properly.
|
|||
Then the app should have opened a browser tab with url "moodle.org"
|
||||
|
||||
When I close the browser tab opened by the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Information" in the app
|
||||
And I press "Open in browser" in the app
|
||||
Then the app should have opened a browser tab
|
||||
|
|
|
@ -45,7 +45,7 @@ Feature: It navigates properly in pages with a split-view component.
|
|||
And I should find "40" near "Range" in the app
|
||||
|
||||
# Go back to grades page
|
||||
When I press the back button in the app
|
||||
When I go back 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
|
||||
|
@ -61,13 +61,13 @@ Feature: It navigates properly in pages with a split-view component.
|
|||
And I should find "80" near "Range" in the app
|
||||
|
||||
# Go back to grades page
|
||||
When I press the back button in the app
|
||||
When I go back 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 main page
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Acceptance test site" in the app
|
||||
And I should find "User account" in the app
|
||||
But I should not find "Back" in the app
|
||||
|
@ -106,7 +106,7 @@ Feature: It navigates properly in pages with a split-view component.
|
|||
And I should find "80" near "Range" in the app
|
||||
|
||||
# Go back to main page
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
Then I should find "Acceptance test site" in the app
|
||||
And I should find "User account" in the app
|
||||
But I should not find "Back" in the app
|
||||
|
|
|
@ -29,7 +29,7 @@ Feature: It opens files properly.
|
|||
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 go back in the app
|
||||
And I press "Test RTF" in the app
|
||||
And I press "Open" in the app
|
||||
Then I should find "This file may not work as expected on this device" in the app
|
||||
|
@ -48,7 +48,7 @@ Feature: It opens files properly.
|
|||
Then I should not find "This file may not work as expected on this device" in the app
|
||||
And the app should have opened url "^blob:" with contents "Test resource A rtf.rtf file" 3 times
|
||||
|
||||
When I press the back button in the app
|
||||
When I go back in the app
|
||||
And I press "Test DOC" in the app
|
||||
And I press "Open" in the app
|
||||
Then I should find "This file may not work as expected on this device" in the app
|
||||
|
@ -73,7 +73,7 @@ Feature: It opens files properly.
|
|||
Then the app should have opened a browser tab with url "dummy.pdf"
|
||||
|
||||
When I close the browser tab opened by the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Page with embedded web" in the app
|
||||
And I press "Open in browser" in the app
|
||||
And I press "OK" in the app
|
||||
|
@ -85,16 +85,15 @@ Feature: It opens files properly.
|
|||
Then I should find "There was a problem connecting to the site. Please check your connection and try again." in the app
|
||||
|
||||
When I press "OK" in the app
|
||||
And I press the back button in the app
|
||||
And I go back in the app
|
||||
And I press "Page with embedded PDF" in the app
|
||||
And I press "Open PDF file" in the app
|
||||
Then the app should have opened a browser tab with url "^blob"
|
||||
|
||||
When I close the browser tab opened by the app
|
||||
When I switch network connection to wifi
|
||||
And I press the back button in the app
|
||||
And I press the back button in the app
|
||||
And I press "More" in the app
|
||||
And I go back to the root page in the app
|
||||
And I press the more menu button in the app
|
||||
And I press "PDF item" in the app
|
||||
And I press "Open PDF file" in the app
|
||||
Then the app should have opened a browser tab with url "dummy.pdf"
|
||||
|
|
|
@ -45,6 +45,6 @@ export async function fixOverlayAriaHidden(
|
|||
]);
|
||||
|
||||
if (!overlays.find(overlay => overlay !== undefined)) {
|
||||
document.querySelector('ion-router-outlet')?.removeAttribute('aria-hidden');
|
||||
document.body.querySelector('ion-router-outlet')?.removeAttribute('aria-hidden');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,8 +14,18 @@
|
|||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { CoreWait } from '@singletons/wait';
|
||||
import { makeSingleton, NgZone } from '@singletons';
|
||||
import { makeSingleton, NgZone, Router } from '@singletons';
|
||||
import { BehatTestsWindow, TestingBehatRuntime } from './behat-runtime';
|
||||
import {
|
||||
GuardsCheckEnd,
|
||||
GuardsCheckStart,
|
||||
NavigationCancel,
|
||||
NavigationEnd,
|
||||
NavigationError,
|
||||
NavigationStart,
|
||||
} from '@angular/router';
|
||||
import { Subscription, filter } from 'rxjs';
|
||||
import { CoreNavigator } from '@services/navigator';
|
||||
|
||||
/**
|
||||
* Behat block JS manager.
|
||||
|
@ -24,10 +34,12 @@ import { BehatTestsWindow, TestingBehatRuntime } from './behat-runtime';
|
|||
export class TestingBehatBlockingService {
|
||||
|
||||
protected waitingBlocked = false;
|
||||
protected waitingGuardEnd = false;
|
||||
protected recentMutation = false;
|
||||
protected lastMutation = 0;
|
||||
protected initialized = false;
|
||||
protected keyIndex = 0;
|
||||
protected navSubscription?: Subscription;
|
||||
|
||||
/**
|
||||
* Listen to mutations and override XML Requests.
|
||||
|
@ -48,6 +60,47 @@ export class TestingBehatBlockingService {
|
|||
win.M.util = win.M.util ?? {};
|
||||
win.M.util.pending_js = win.M.util.pending_js ?? [];
|
||||
|
||||
this.navSubscription = Router.events
|
||||
.pipe(filter(event =>
|
||||
event instanceof NavigationStart ||
|
||||
event instanceof NavigationEnd ||
|
||||
event instanceof NavigationError ||
|
||||
event instanceof NavigationCancel ||
|
||||
event instanceof GuardsCheckStart ||
|
||||
event instanceof GuardsCheckEnd))
|
||||
.subscribe(async (event) => {
|
||||
if (!('id' in event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const blockName = `navigation-${event.id}`;
|
||||
if (event instanceof NavigationStart) {
|
||||
this.block(blockName);
|
||||
} else if (event instanceof GuardsCheckStart) {
|
||||
// This event is triggered before the guards are checked, so we need to wait for the end.
|
||||
this.waitingGuardEnd = CoreNavigator.currentRouteCanBlockLeave();
|
||||
|
||||
// No deactivation needed.
|
||||
if (!this.waitingGuardEnd) {
|
||||
return;
|
||||
}
|
||||
|
||||
await CoreWait.wait(500);
|
||||
|
||||
if (this.waitingGuardEnd) {
|
||||
// The guard is still running (this case can unexpetedly unblock the tests)
|
||||
// or a user confirmation is shown. Unblock.
|
||||
this.waitingGuardEnd = false;
|
||||
this.unblock(blockName);
|
||||
}
|
||||
} else if (event instanceof GuardsCheckEnd) {
|
||||
// Guards check ended.
|
||||
this.waitingGuardEnd = false;
|
||||
} else {
|
||||
this.unblock(blockName);
|
||||
}
|
||||
});
|
||||
|
||||
TestingBehatRuntime.log('Initialized!');
|
||||
}
|
||||
|
||||
|
@ -282,6 +335,13 @@ export class TestingBehatBlockingService {
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Wait for pending list to be empty.
|
||||
*/
|
||||
async waitForPending(): Promise<void> {
|
||||
await CoreWait.waitFor(() => this.pendingList.length === 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const TestingBehatBlocking = makeSingleton(TestingBehatBlockingService);
|
||||
|
|
|
@ -44,7 +44,26 @@ export class TestingBehatDomUtilsService {
|
|||
* @returns Whether the element is visible or not.
|
||||
*/
|
||||
isElementVisible(element: HTMLElement, container?: HTMLElement): boolean {
|
||||
if (element.getAttribute('aria-hidden') === 'true' || getComputedStyle(element).display === 'none') {
|
||||
if (element.getAttribute('aria-hidden') === 'true') {
|
||||
if (
|
||||
element.tagName === 'ION-ROUTER-OUTLET' &&
|
||||
element === document.body.querySelector('ion-app > ion-router-outlet') &&
|
||||
(document.body.querySelector('ion-toast.hydrated:not(.overlay-hidden)') ||
|
||||
!document.body.querySelector(
|
||||
'ion-action-sheet.hydrated:not(.overlay-hidden), ion-alert.hydrated:not(.overlay-hidden)\
|
||||
ion-loading.hydrated:not(.overlay-hidden), ion-modal.hydrated:not(.overlay-hidden),\
|
||||
ion-picker.hydrated:not(.overlay-hidden), ion-popover.hydrated:not(.overlay-hidden)',
|
||||
))
|
||||
) {
|
||||
// Main ion-router-outlet is aria-hidden when a toast is open but the UI is not blocked...
|
||||
// It also may be hidden due to an error in Ionic. See fixOverlayAriaHidden function.
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getComputedStyle(element).display === 'none') {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -356,11 +375,12 @@ export class TestingBehatDomUtilsService {
|
|||
return element;
|
||||
}
|
||||
|
||||
if (element === container || !element.parentElement) {
|
||||
const parent = this.getParentElement(element);
|
||||
if (element === container || !parent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.getClosestMatching(element.parentElement, selector, container);
|
||||
return this.getClosestMatching(parent, selector, container);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -369,25 +389,22 @@ export class TestingBehatDomUtilsService {
|
|||
* @param containerName Whether to search inside the a container name.
|
||||
* @returns Found top container elements.
|
||||
*/
|
||||
protected getCurrentTopContainerElements(containerName: string): HTMLElement[] {
|
||||
const topContainers: HTMLElement[] = [];
|
||||
let containers = Array.from(document.querySelectorAll<HTMLElement>([
|
||||
'ion-alert.hydrated',
|
||||
'ion-popover.hydrated',
|
||||
'ion-action-sheet.hydrated',
|
||||
'ion-modal.hydrated',
|
||||
protected getCurrentTopContainerElements(containerName?: string): HTMLElement[] {
|
||||
let containers = Array.from(document.body.querySelectorAll<HTMLElement>([
|
||||
'ion-alert.hydrated:not(.overlay-hidden)',
|
||||
'ion-popover.hydrated:not(.overlay-hidden)',
|
||||
'ion-action-sheet.hydrated:not(.overlay-hidden)',
|
||||
'ion-modal.hydrated:not(.overlay-hidden)',
|
||||
'core-user-tours-user-tour.is-active',
|
||||
'ion-toast.hydrated',
|
||||
'page-core-mainmenu',
|
||||
'ion-app',
|
||||
'ion-toast.hydrated:not(.overlay-hidden)',
|
||||
'page-core-mainmenu > ion-tabs:not(.tabshidden) > .mainmenu-tabs',
|
||||
'page-core-mainmenu > .core-network-message',
|
||||
'.ion-page:not(.ion-page-hidden)',
|
||||
].join(', ')));
|
||||
const ionApp = document.querySelector<HTMLElement>('ion-app') ?? undefined;
|
||||
|
||||
containers = containers
|
||||
.filter(container => {
|
||||
if (!this.isElementVisible(container)) {
|
||||
// Ignore containers not visible.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (container.tagName === 'ION-ALERT') {
|
||||
// For some reason, in Behat sometimes alerts aren't removed from DOM, the close animation doesn't finish.
|
||||
|
@ -395,32 +412,40 @@ export class TestingBehatDomUtilsService {
|
|||
return container.style.pointerEvents !== 'none';
|
||||
}
|
||||
|
||||
// Ignore pages that are inside other visible pages.
|
||||
return container.tagName !== 'ION-PAGE' || !container.closest('.ion-page.ion-page-hidden');
|
||||
// Avoid searching in the whole app.
|
||||
if (container.tagName === 'ION-APP' || container.tagName === 'PAGE-CORE-MAINMENU') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ignore not visible containers.
|
||||
return this.isElementVisible(container, ionApp);
|
||||
})
|
||||
// Sort them by z-index.
|
||||
.sort((a, b) => Number(getComputedStyle(b).zIndex) - Number(getComputedStyle(a).zIndex));
|
||||
|
||||
if (containerName === 'split-view content') {
|
||||
|
||||
let splitViewContainer: HTMLElement | null = null;
|
||||
|
||||
// Find non hidden pages inside the containers.
|
||||
containers.some(container => {
|
||||
if (!container.classList.contains('ion-page')) {
|
||||
return false;
|
||||
}
|
||||
if (container.closest('ion-router-outlet.content-outlet')) {
|
||||
splitViewContainer = container;
|
||||
|
||||
const pageContainers = Array.from(container.querySelectorAll<HTMLElement>('.ion-page:not(.ion-page-hidden)'));
|
||||
let topContainer = pageContainers.find((page) => !page.closest('.ion-page.ion-page-hidden')) ?? null;
|
||||
return true;
|
||||
}
|
||||
|
||||
topContainer = (topContainer || container).querySelector<HTMLElement>('core-split-view ion-router-outlet');
|
||||
topContainer && topContainers.push(topContainer);
|
||||
|
||||
return !!topContainer;
|
||||
return false;
|
||||
});
|
||||
|
||||
return topContainers;
|
||||
return splitViewContainer ? [splitViewContainer] : [];
|
||||
}
|
||||
|
||||
// Get containers until one blocks other views.
|
||||
const topContainers: HTMLElement[] = [];
|
||||
containers.some(container => {
|
||||
if (container.tagName === 'ION-TOAST') {
|
||||
container = container.shadowRoot?.querySelector('.toast-container') || container;
|
||||
|
@ -446,7 +471,7 @@ export class TestingBehatDomUtilsService {
|
|||
|
||||
let input = this.findElementBasedOnText(
|
||||
{ text: field, selector },
|
||||
{ onlyClickable: false, containerName: '' },
|
||||
{ onlyClickable: false },
|
||||
);
|
||||
|
||||
if (input?.tagName === 'CORE-RICH-TEXT-EDITOR') {
|
||||
|
@ -459,7 +484,7 @@ export class TestingBehatDomUtilsService {
|
|||
|
||||
const label = this.findElementBasedOnText(
|
||||
{ text: field, selector: 'label' },
|
||||
{ onlyClickable: false, containerName: '' },
|
||||
{ onlyClickable: false },
|
||||
);
|
||||
|
||||
if (label) {
|
||||
|
@ -473,7 +498,7 @@ export class TestingBehatDomUtilsService {
|
|||
|
||||
// Search the ion-datetime associated with the button.
|
||||
const datetimeId = (<HTMLIonDatetimeButtonElement> element).datetime;
|
||||
const datetime = document.querySelector<HTMLElement>(`ion-datetime#${datetimeId}`);
|
||||
const datetime = document.body.querySelector<HTMLElement>(`ion-datetime#${datetimeId}`);
|
||||
|
||||
return datetime || undefined;
|
||||
}
|
||||
|
@ -539,7 +564,7 @@ export class TestingBehatDomUtilsService {
|
|||
timeout: number = 2000,
|
||||
retryFrequency: number = 100,
|
||||
): Promise<T> {
|
||||
const element = document.querySelector<T>(selector);
|
||||
const element = document.body.querySelector<T>(selector);
|
||||
|
||||
if (!element) {
|
||||
if (timeout < retryFrequency) {
|
||||
|
@ -565,15 +590,14 @@ export class TestingBehatDomUtilsService {
|
|||
locator: TestingBehatElementLocator,
|
||||
options: TestingBehatFindOptions,
|
||||
): HTMLElement[] {
|
||||
const topContainers = this.getCurrentTopContainerElements(options.containerName ?? '');
|
||||
const topContainers = this.getCurrentTopContainerElements(options.containerName);
|
||||
let elements: HTMLElement[] = [];
|
||||
|
||||
for (let i = 0; i < topContainers.length; i++) {
|
||||
elements = elements.concat(this.findElementsBasedOnTextInContainer(locator, topContainers[i], options));
|
||||
if (elements.length) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
topContainers.some((container) => {
|
||||
elements = this.findElementsBasedOnTextInContainer(locator, container, options);
|
||||
|
||||
return elements.length > 0;
|
||||
});
|
||||
|
||||
return elements;
|
||||
}
|
||||
|
|
|
@ -172,6 +172,33 @@ export class TestingBehatRuntimeService {
|
|||
const promises = coreLoadingsPromises.concat(ionLoadingsPromises);
|
||||
|
||||
await Promise.all(promises);
|
||||
|
||||
// Wait for ion-spinner to be removed from the DOM after loadings because loadings can contain spinners.
|
||||
const ionSpinnerPromises: Promise<unknown>[] =
|
||||
Array.from(document.body.querySelectorAll<HTMLIonSpinnerElement>('ion-spinner'))
|
||||
.filter((element) => CoreDom.isElementVisible(element))
|
||||
.map((element) =>
|
||||
// Wait to the spinner to be removed from the DOM.
|
||||
new Promise<void>((resolve) => {
|
||||
const parentElement = element.parentElement;
|
||||
|
||||
if (!parentElement) {
|
||||
resolve();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const observer = new MutationObserver(() => {
|
||||
if (!parentElement.contains(element)) {
|
||||
observer.disconnect();
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
|
||||
observer.observe(parentElement, { childList: true });
|
||||
}));
|
||||
|
||||
await Promise.all(ionSpinnerPromises);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -184,18 +211,23 @@ export class TestingBehatRuntimeService {
|
|||
async pressStandard(button: string): Promise<string> {
|
||||
this.log('Action - Click standard button: ' + button);
|
||||
|
||||
// @deprecated usage, use goBack instead.
|
||||
if (button === 'back') {
|
||||
const success = await this.goBack();
|
||||
if (success) {
|
||||
return 'OK';
|
||||
} else {
|
||||
return 'ERROR: Back button not found';
|
||||
}
|
||||
}
|
||||
|
||||
// Find button
|
||||
let foundButton: HTMLElement | undefined;
|
||||
const options: TestingBehatFindOptions = {
|
||||
onlyClickable: true,
|
||||
containerName: '',
|
||||
};
|
||||
|
||||
switch (button) {
|
||||
case 'back':
|
||||
foundButton = TestingBehatDomUtils.findElementBasedOnText({ text: 'Back' }, options);
|
||||
break;
|
||||
case 'main menu': // Deprecated name.
|
||||
case 'more menu':
|
||||
foundButton = TestingBehatDomUtils.findElementBasedOnText({
|
||||
text: 'More',
|
||||
|
@ -225,6 +257,76 @@ export class TestingBehatRuntimeService {
|
|||
return 'OK';
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to go back the maximum number of times possible.
|
||||
*
|
||||
* @returns OK if successful, or ERROR: followed by message.
|
||||
*/
|
||||
async goBackToRoot(): Promise<string> {
|
||||
this.log('Action - Go back to root');
|
||||
|
||||
let success = true;
|
||||
|
||||
do {
|
||||
success = await this.goBack();
|
||||
|
||||
await TestingBehatBlocking.waitForPending();
|
||||
} while (success);
|
||||
|
||||
return 'OK';
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to go back many times in the app.
|
||||
*
|
||||
* @param times How many times to go back.
|
||||
* @returns OK if successful, or ERROR: followed by message.
|
||||
*/
|
||||
async goBackTimes(times = 1): Promise<string> {
|
||||
this.log(`Action - Go back ${times} times`);
|
||||
|
||||
for (let i = 0; i < times; i++) {
|
||||
const success = await this.goBack();
|
||||
|
||||
if (!success) {
|
||||
return 'ERROR: Back button not found';
|
||||
}
|
||||
|
||||
await TestingBehatBlocking.waitForPending();
|
||||
}
|
||||
|
||||
return 'OK';
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to go back in the app.
|
||||
*
|
||||
* @returns Whether the action is successful or not.
|
||||
*/
|
||||
protected async goBack(): Promise<boolean> {
|
||||
const options: TestingBehatFindOptions = {
|
||||
onlyClickable: true,
|
||||
containerName: '',
|
||||
};
|
||||
|
||||
const foundButton = TestingBehatDomUtils.findElementBasedOnText({
|
||||
text: 'Back',
|
||||
selector: 'ion-back-button',
|
||||
}, options);
|
||||
|
||||
if (!foundButton) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Click button
|
||||
await TestingBehatDomUtils.pressElement(foundButton);
|
||||
|
||||
// Block Behat for at least 500ms, WS calls or DOM changes might not begin immediately.
|
||||
TestingBehatBlocking.wait(500);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* When there is a popup, clicks on the backdrop.
|
||||
*
|
||||
|
@ -235,11 +337,11 @@ export class TestingBehatRuntimeService {
|
|||
|
||||
const backdrops = [
|
||||
...Array
|
||||
.from(document.querySelectorAll('ion-popover, ion-modal'))
|
||||
.from(document.body.querySelectorAll('ion-popover, ion-modal'))
|
||||
.map(popover => popover.shadowRoot?.querySelector('ion-backdrop'))
|
||||
.filter(backdrop => !!backdrop),
|
||||
...Array
|
||||
.from(document.querySelectorAll('ion-backdrop'))
|
||||
.from(document.body.querySelectorAll('ion-backdrop'))
|
||||
.filter(backdrop => !!backdrop.offsetParent),
|
||||
];
|
||||
|
||||
|
@ -272,7 +374,6 @@ export class TestingBehatRuntimeService {
|
|||
try {
|
||||
const element = TestingBehatDomUtils.findElementBasedOnText(locator, {
|
||||
onlyClickable: false,
|
||||
containerName: '',
|
||||
...options,
|
||||
});
|
||||
|
||||
|
@ -298,7 +399,7 @@ export class TestingBehatRuntimeService {
|
|||
this.log('Action - scrollTo', { locator });
|
||||
|
||||
try {
|
||||
let element = TestingBehatDomUtils.findElementBasedOnText(locator, { onlyClickable: false, containerName: '' });
|
||||
let element = TestingBehatDomUtils.findElementBasedOnText(locator, { onlyClickable: false });
|
||||
|
||||
if (!element) {
|
||||
return 'ERROR: No element matches element to scroll to.';
|
||||
|
@ -365,7 +466,7 @@ export class TestingBehatRuntimeService {
|
|||
|
||||
try {
|
||||
const infiniteLoading = Array
|
||||
.from(document.querySelectorAll<HTMLElement>('core-infinite-loading'))
|
||||
.from(document.body.querySelectorAll<HTMLElement>('core-infinite-loading'))
|
||||
.find(element => !element.closest('.ion-page-hidden'));
|
||||
|
||||
if (!infiniteLoading) {
|
||||
|
@ -411,7 +512,7 @@ export class TestingBehatRuntimeService {
|
|||
this.log('Action - Is Selected', locator);
|
||||
|
||||
try {
|
||||
const element = TestingBehatDomUtils.findElementBasedOnText(locator, { onlyClickable: false, containerName: '' });
|
||||
const element = TestingBehatDomUtils.findElementBasedOnText(locator, { onlyClickable: false });
|
||||
|
||||
if (!element) {
|
||||
return 'ERROR: No element matches locator to find.';
|
||||
|
@ -441,7 +542,7 @@ export class TestingBehatRuntimeService {
|
|||
this.log('Action - Press', locator);
|
||||
|
||||
try {
|
||||
const found = TestingBehatDomUtils.findElementBasedOnText(locator, { onlyClickable: true, containerName: '' });
|
||||
const found = TestingBehatDomUtils.findElementBasedOnText(locator, { onlyClickable: true });
|
||||
|
||||
if (!found) {
|
||||
return 'ERROR: No element matches locator to press.';
|
||||
|
@ -523,7 +624,7 @@ export class TestingBehatRuntimeService {
|
|||
getHeader(): string {
|
||||
this.log('Action - Get header');
|
||||
|
||||
const getBySelector = (selector: string ) => Array.from(document.querySelectorAll<HTMLElement>(selector))
|
||||
const getBySelector = (selector: string ) => Array.from(document.body.querySelectorAll<HTMLElement>(selector))
|
||||
.filter((title) => TestingBehatDomUtils.isElementVisible(title, document.body))
|
||||
.map((title) => title.innerText.trim())
|
||||
.filter((title) => title.length > 0);
|
||||
|
@ -650,7 +751,6 @@ export class TestingBehatRuntimeService {
|
|||
if (referenceLocator) {
|
||||
startingElement = TestingBehatDomUtils.findElementBasedOnText(referenceLocator, {
|
||||
onlyClickable: false,
|
||||
containerName: '',
|
||||
});
|
||||
|
||||
if (!startingElement) {
|
||||
|
|
Loading…
Reference in New Issue