Merge pull request #7 from NoelDeMartin/MOBILE-3294

Mobile 3294
main
Juan Leyva 2020-06-10 17:22:47 +02:00 committed by GitHub
commit 233b18f87d
15 changed files with 3496 additions and 50 deletions

View File

@ -0,0 +1,174 @@
@mod @mod_assign @app @javascript
Feature: Test basic usage of assignment activity in app
In order to participate in the assignment while using the mobile app
I need basic assignment functionality to work
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | teacher | teacher1@example.com |
| student1 | Student | student | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | duedate | attemptreopenmethod |
| assign | C1 | assign1 | assignment1 | Test assignment description1 | 1 | 1029844800 | manual |
@app @3.8.0
Scenario: Create, edit and submit an assignment as a student, view it as a teacher
# Create, edit and submit as a student
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "assignment1" in the app
Then the header should be "assignment1" in the app
And I should see "Test assignment description1"
And I should see "Due date"
And I should see "Tuesday, 20 August 2002, 12:00 PM"
When I press "Add submission" in the app
And I set the field "Online text submissions" to "Submission test" in the app
And I press "Save" in the app
Then I should see "Draft (not submitted)"
And I should see "Not graded"
When I press "Edit submission" in the app
And I set the field "Online text submissions" to "Submission test edited" in the app
And I press "Save" in the app
And I press "OK" in the app
Then I should see "Submission test edited"
When I press "Submit assignment" in the app
And I press "OK" in the app
Then I should see "Submitted for grading"
And I should see "Not graded"
And I should see "Submission test edited"
# View as a teacher
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "assignment1" in the app
Then the header should be "assignment1" in the app
When I press "Submitted" in the app
Then I should see "Student student"
And I should see "Not graded"
When I press "Student student" near "assignment1" in the app
Then I should see "Online text submissions"
And I should see "Submission test edited"
@app @3.8.0
Scenario: Add new attempt from previous submission
# Submit first attempt as a student
Given I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "assignment1" in the app
And I press "Add submission" in the app
And I set the field "Online text submissions" to "Submission test 1st attempt" in the app
And I press "Save" in the app
And I press "Submit assignment" in the app
And I press "OK" in the app
# Allow more attempts as a teacher
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "assignment1" in the app
And I press "Participants" in the app
And I press "Student student" near "assignment1" in the app
And I press "Grade" in the app
And I press "Allow another attempt" in the app
And I press "Done"
Then I should see "Reopened"
And I should see "Not graded"
# Submit second attempt as a student
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "assignment1" in the app
Then I should see "Reopened"
And I should see "2 out of Unlimited"
And I should see "Add a new attempt based on previous submission"
And I should see "Add a new attempt"
When I press "Add a new attempt based on previous submission" in the app
And I press "OK" in the app
Then I should see "Submission test 1st attempt"
When I set the field "Online text submissions" to "Submission test 2nd attempt" in the app
And I press "Save" in the app
And I press "OK" in the app
And I press "Submit assignment" in the app
And I press "OK" in the app
# View second attempt as a teacher
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "assignment1" in the app
And I press "Participants" in the app
And I press "Student student" near "assignment1" in the app
Then I should see "Online text submissions"
And I should see "Submission test 2nd attempt"
@app @3.8.0
Scenario: Add offline submission and synchronise it
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "assignment1" in the app
And I press "Add submission" in the app
And I switch offline mode to "true"
And I set the field "Online text submissions" to "Submission test" in the app
And I press "Save" in the app
And I press "Submit assignment" in the app
And I press "OK" in the app
Then I should see "This Assignment has offline data to be synchronised."
When I switch offline mode to "false"
And I press the back button in the app
And I press "assignment1" in the app
And I press "Display options" in the app
And I press "Refresh" in the app
Then I should see "Submitted for grading"
But I should not see "This Assignment has offline data to be synchronised."
@app @3.8.0
Scenario: Edit an offline submission before synchronising it
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "assignment1" in the app
And I press "Add submission" in the app
And I switch offline mode to "true"
And I set the field "Online text submissions" to "Submission test original offline" in the app
And I press "Save" in the app
Then I should see "This Assignment has offline data to be synchronised."
And I should see "Submission test original offline"
When I press "Edit submission" in the app
And I set the field "Online text submissions" to "Submission test edited offline" in the app
And I press "Save" in the app
Then I should see "This Assignment has offline data to be synchronised."
And I should see "Submission test edited offline"
But I should not see "Submission test original offline"
When I press "Submit assignment" in the app
And I press "OK" in the app
Then I should see "This Assignment has offline data to be synchronised."
When I switch offline mode to "false"
And I press the back button in the app
And I press "assignment1" in the app
Then I should see "Submitted for grading"
And I should see "Submission test edited offline"
But I should not see "This Assignment has offline data to be synchronised."

View File

@ -0,0 +1,81 @@
@mod @mod_chat @app @javascript
Feature: Test basic usage of chat in app
As a student
I need basic chat functionality to work
Background:
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "users" exist:
| username | firstname | lastname |
| student1 | david | student |
| student2 | pau | student2 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode |
| chat | Test chat name | Test chat | C1 | chat | 0 |
@app @3.8.0
Scenario: Send and read messages, send beeps and view connected users
# Send messages as student1
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test chat name" in the app
Then I should see "Click here to enter the chat now"
And I should see "View past chat sessions"
When I press "Click here to enter the chat now" in the app
And I set the field "New message" to "Hi!"
And I press "Send" in the app
And I set the field "New message" to "I am David"
And I press "Send" in the app
Then I should see "Hi!"
And I should see "I am David"
# Read messages, view connected users, send beep and reply as student2
When I enter the app
And I log in as "student2"
And I press "Course 1" near "Course overview" in the app
And I press "Test chat name" in the app
And I press "Click here to enter the chat now" in the app
Then I should see "Hi!"
And I should see "I am David"
When I press "people" in the app
Then I should see "david student"
When I press "Beep" in the app
Then I should see "You beeped david student"
When I set the field "New message" to "Hi David, I am Pau."
And I press "Send" in the app
Then I should see "Hi David, I am Pau."
@app @3.8.0
Scenario: View past sessions shown for >=3.5
# Send messages as student1
Given I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test chat name" in the app
And I press "Click here to enter the chat now" in the app
And I set the field "New message" to "Hi!"
And I press "Send" in the app
And I set the field "New message" to "I am David"
And I press "Send" in the app
# Read messages from past sessions as student2
When I enter the app
And I log in as "student2"
And I press "Course 1" near "Course overview" in the app
And I press "Test chat name" in the app
And I press "View past chat sessions" in the app
And I press "Show incomplete sessions" in the app
And I press "david student (2)" in the app
Then I should see "Hi!"
And I should see "I am David"

View File

@ -1,23 +1,24 @@
@mod @mod_choice @app @javascript @mod @mod_choice @app @javascript
Feature: Test basic usage in app Feature: Test basic usage of choice activity in app
In order to participate in the choice while using the mobile app In order to participate in the choice while using the mobile app
As a student As a student
I need basic choice functionality to work I need basic choice functionality to work
Background: Background:
Given the following "courses" exist: Given the following "users" exist:
| fullname | shortname | | username | firstname | lastname | email |
| Course 1 | C1 | | teacher1 | Teacher | teacher | teacher1@example.com |
And the following "users" exist: | student1 | Student | student | student1@example.com |
| username | And the following "courses" exist:
| teacher1 | | fullname | shortname | category |
| student1 | | Course 1 | C1 | 0 |
And the following "course enrolments" exist: And the following "course enrolments" exist:
| user | course | role | | user | course | role |
| teacher1 | C1 | editingteacher | | teacher1 | C1 | editingteacher |
| student1 | C1 | student | | student1 | C1 | student |
Scenario: Student sends their single choice @app @3.8.0
Scenario: Student sends a single choice answer and views the results
Given the following "activities" exist: Given the following "activities" exist:
| activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults |
| choice | Test single choice name | Test single choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 0 | 0 | 1 | | choice | Test single choice name | Test single choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 0 | 0 | 1 |
@ -28,14 +29,22 @@ Feature: Test basic usage in app
And I press "Option 1" in the app And I press "Option 1" in the app
And I press "Option 2" in the app And I press "Option 2" in the app
And I press "Save my choice" in the app And I press "Save my choice" in the app
And I should see "Are you sure" Then I should see "Are you sure"
And I press "OK" in the app
When I press "OK" in the app
Then I should see "Option 1: 0" Then I should see "Option 1: 0"
And I should see "Option 2: 1" And I should see "Option 2: 1"
And I should see "Option 3: 0" And I should see "Option 3: 0"
And I should not see "Remove my choice" But I should not see "Remove my choice"
Scenario: Student sends, changes and remove their multi choice When I press the back button in the app
And I press "Test single choice name" in the app
Then I should see "Option 1: 0"
And I should see "Option 2: 1"
And I should see "Option 3: 0"
@app @3.8.0
Scenario: Student sends, changes and removes a multi choice answer
Given the following "activities" exist: Given the following "activities" exist:
| activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults | | activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults |
| choice | Test multi choice name | Test multi choice description | C1 | choice2 | Option 1, Option 2, Option 3 | 1 | 1 | 1 | | choice | Test multi choice name | Test multi choice description | C1 | choice2 | Option 1, Option 2, Option 3 | 1 | 1 | 1 |
@ -50,14 +59,144 @@ Feature: Test basic usage in app
And I should see "Option 2: 1" And I should see "Option 2: 1"
And I should see "Option 3: 0" And I should see "Option 3: 0"
And I should see "Remove my choice" And I should see "Remove my choice"
And I press "Option 1" in the app
When I press "Option 1" in the app
And I press "Option 3" in the app And I press "Option 3" in the app
And I press "Save my choice" in the app And I press "Save my choice" in the app
And I should see "Option 1: 0" Then I should see "Option 1: 0"
And I should see "Option 2: 1" And I should see "Option 2: 1"
And I should see "Option 3: 1" And I should see "Option 3: 1"
And I press "Remove my choice" in the app
And I should see "Are you sure" When I press "Remove my choice" in the app
And I press "Delete" in the app Then I should see "Are you sure"
And I should not see "Remove my choice"
And I should see "The results are not currently viewable" When I press "Delete" in the app
Then I should see "The results are not currently viewable"
But I should not see "Remove my choice"
@app @3.8.0
Scenario: Student edits answer offline and synchronises
Given the following "activities" exist:
| activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults |
| choice | Test single choice name | Test single choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 0 | 0 | 1 |
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test single choice name" in the app
And I press "Option 1" in the app
And I switch offline mode to "true"
And I press "Option 2" in the app
And I press "Save my choice" in the app
Then I should see "Are you sure"
When I press "OK" in the app
And I press the back button in the app
And I press "Test single choice name" in the app
Then I should see "This Choice has offline data to be synchronised."
But I should not see "Option 1: 0"
And I should not see "Option 2: 1"
And I should not see "Option 3: 0"
When I switch offline mode to "false"
And I press the back button in the app
And I press "Test single choice name" in the app
And I press "Display options" in the app
And I press "Refresh" in the app
Then I should see "Option 1: 0"
And I should see "Option 2: 1"
And I should see "Option 3: 0"
But I should not see "This Choice has offline data to be synchronised."
@app @3.8.0
Scenario: Student edits answer offline and the app synchronises automatically
Given the following "activities" exist:
| activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults |
| choice | Test single choice name | Test single choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 0 | 0 | 1 |
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test single choice name" in the app
And I press "Option 1" in the app
And I switch offline mode to "true"
And I press "Option 2" in the app
And I press "Save my choice" in the app
Then I should see "Are you sure"
When I press "OK" in the app
And I switch offline mode to "false"
Then I should see "This Choice has offline data to be synchronised."
But I should not see "Option 1: 0"
And I should not see "Option 2: 1"
And I should not see "Option 3: 0"
When I run cron tasks in the app
Then I should see "Option 1: 0"
And I should see "Option 2: 1"
And I should see "Option 3: 0"
But I should not see "This Choice has offline data to be synchronised."
@app @3.8.0
Scenario: Prefetch activity
Given the following "activities" exist:
| activity | name | intro | course | idnumber | option | allowmultiple | allowupdate | showresults |
| choice | Test multi choice name | Test multi choice description | C1 | choice2 | Option 1, Option 2, Option 3 | 1 | 1 | 1 |
| choice | Test single choice name | Test single choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 0 | 0 | 1 |
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Display options" in the app
And I press "Show download options" in the app
And I press "cloud download" near "Test single choice name" in the app
And I switch offline mode to "true"
And I press "Test multi choice 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 press "Test single choice name" in the app
And I press "Option 2" in the app
And I press "Save my choice" in the app
Then I should see "Are you sure"
When I press "OK" in the app
And I press the back button in the app
And I press "Test single choice name" in the app
Then I should see "This Choice has offline data to be synchronised."
But I should not see "Option 1: 0"
And I should not see "Option 2: 1"
And I should not see "Option 3: 0"
When I switch offline mode to "false"
And I press the back button in the app
And I press "Test single choice name" in the app
Then I should see "Option 1: 0"
And I should see "Option 2: 1"
And I should see "Option 3: 0"
But I should not see "This Choice has offline data to be synchronised."
@app @3.8.0
Scenario: Download students choice in text format
# Submit answer as student
Given the following "activities" exist:
| activity | name | intro | course | idnumber | option |
| choice | Choice name | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 |
And I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Choice name" in the app
And I press "Option 2" in the app
And I press "Save my choice" in the app
And I press "OK" in the app
# Download answers as teacher
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Course overview" in the app
And I press "Choice name" in the app
And I press "Display options" in the app
And I press "Open in browser" in the app
And I switch to the browser tab opened by the app
And I log in as "teacher1"
And I press "Actions menu"
And I follow "View 1 responses"
And I press "Download in text format"

View File

@ -0,0 +1,364 @@
@mod @mod_comments @app @javascript
Feature: Test basic usage of comments in app
In order to participate in the comments while using the mobile app
As a student
I need basic comments functionality to work
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | teacher | teacher1@example.com |
| student1 | Student | student | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | mainglossary | allowcomments | assessed | scale |
| glossary | Test glossary | glossary description | C1 | gloss1 | 1 | 1 | 1 | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | comments |
| data | Data | Data info | C1 | data1 | 1 |
@app @3.8.0
Scenario: Create and delete comments (database)
# Create database entry and comment as a teacher
Given I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Data" in the app
And I press "Display options" in the app
And I press "Open in browser" in the app
And I switch to the browser tab opened by the app
And I log in as "teacher1"
And I add a "Text input" field to "Data" database and I fill the form with:
| Field name | Test field name |
| Field description | Test field description |
And I press "Save"
And I close the browser tab opened by the app
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Data" in the app
And I press "add" in the app
And I set the field "Test field name" to "Test" in the app
And I press "Save" in the app
And I press "More" in the app
And I press "Comments (0)" in the app
And I press "close" in the app
And I set the field "Add a comment..." to "comment test teacher" in the app
And I press "Save comment" in the app
Then I should see "Comment created"
And I should see "comment test teacher"
When I press the back button in the app
And I should see "Comments (1)"
# Create and delete comments as a student
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Data" in the app
And I press "More" in the app
And I press "Comments (1)" in the app
And I press "close" in the app
And I set the field "Add a comment..." to "comment test student" in the app
And I press "Save comment" in the app
Then I should see "Comment created"
And I should see "comment test teacher"
And I should see "comment test student"
When I press the back button in the app
And I press "Comments (2)" in the app
And I press "Delete" in the app
And I press "trash" in the app
And I press "Delete" near "Cancel" in the app
Then I should see "Comment deleted"
And I should see "comment test teacher"
But I should not see "comment test student"
When I press the back button in the app
Then I should see "Comments (1)"
@app @3.8.0
Scenario: Create and delete offline comments and synchronise (database)
Given I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Data" in the app
And I press "Display options" in the app
And I press "Open in browser" in the app
And I switch to the browser tab opened by the app
And I log in as "teacher1"
And I add a "Text input" field to "Data" database and I fill the form with:
| Field name | Test field name |
| Field description | Test field description |
And I press "Save"
And I close the browser tab opened by the app
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Data" in the app
And I press "add" in the app
And I set the field "Test field name" to "Test" in the app
And I press "Save" in the app
And I press "More" in the app
And I press "Comments (0)" in the app
And I switch offline mode to "true"
And I press "close" in the app
And I set the field "Add a comment..." to "comment test" in the app
And I press "Save comment" in the app
Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later."
And I should see "There are offline comments to be synchronised."
And I should see "comment test"
When I press the back button in the app
And I press "Comments (0)" in the app
And I switch offline mode to "false"
And I press "Display options" in the app
And I press "Synchronise now" in the app
Then I should see "comment test"
But I should not see "There are offline comments to be synchronised."
When I press the back button in the app
And I press "Comments (1)" in the app
And I switch offline mode to "true"
And I press "Delete" in the app
And I press "trash" in the app
And I press "Delete" near "Cancel" in the app
Then I should see "Comment deleted"
And I should see "There are offline comments to be synchronised."
And I should see "Deleted offline"
And I should see "comment test"
When I press the back button in the app
And I press "Comments (1)" in the app
And I switch offline mode to "false"
And I press "Display options" in the app
And I press "Synchronise now" in the 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
And I should see "Comments (0)"
@app @3.8.0
Scenario: Create and delete comments (glossary)
# Create glossary entry and comment as a teacher
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "close" in the app
And I set the field "Concept" to "potato" in the app
And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app
And I press "Save" in the app
And I press "potato" in the app
And I press "Comments (0)" in the app
And I press "close" in the app
And I set the field "Add a comment..." to "comment test teacher" in the app
And I press "Save comment" in the app
Then I should see "Comment created"
And I should see "comment test teacher"
And I press the back button in the app
And I should see "Comments (1)"
# Create and delete comments as a student
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "potato" in the app
And I press "Comments (1)" in the app
And I press "close" in the app
And I set the field "Add a comment..." to "comment test student" in the app
And I press "Save comment" in the app
Then I should see "Comment created"
And I should see "comment test teacher"
And I should see "comment test student"
When I press the back button in the app
And I press "Comments (2)" in the app
And I press "Delete" in the app
And I press "trash" in the app
And I press "Delete" near "Cancel" in the app
Then I should see "Comment deleted"
And I should see "comment test teacher"
But I should not see "comment test student"
When I press the back button in the app
And I should see "Comments (1)"
@app @3.8.0
Scenario: Create and delete offline comments and synchronise (glossary)
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "close" in the app
And I set the field "Concept" to "potato" in the app
And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app
And I press "Save" in the app
And I press "potato" in the app
And I press "Comments (0)" in the app
And I switch offline mode to "true"
And I press "close" in the app
And I set the field "Add a comment..." to "comment test" in the app
And I press "Save comment" in the app
Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later."
And I should see "There are offline comments to be synchronised."
And I should see "comment test"
When I press the back button in the app
And I press "Comments (0)" in the app
And I switch offline mode to "false"
And I press "Display options" in the app
And I press "Synchronise now" in the app
Then I should see "comment test"
But I should not see "There are offline comments to be synchronised."
When I press the back button in the app
And I press "Comments (1)" in the app
And I switch offline mode to "true"
And I press "Delete" in the app
And I press "trash" in the app
And I press "Delete" near "Cancel" in the app
Then I should see "Comment deleted"
And I should see "There are offline comments to be synchronised."
And I should see "Deleted offline"
And I should see "comment test"
When I press the back button in the app
And I press "Comments (1)" in the app
And I switch offline mode to "false"
And I press "Display options" in the app
And I press "Synchronise now" in the 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
And I should see "Comments (0)"
@app @3.8.0
Scenario: Create and delete comments (blogs)
# Create blog as a teacher
Given I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "menu" in the app
And I press "Website" in the app
And I switch to the browser tab opened by the app
And I follow "Log in"
And I log in as "teacher1"
And I click on "Side panel" "button"
And I follow "C1"
And I press "Turn editing on"
And I click on "Side panel" "button"
And I follow "Add a block"
And I follow "Blog menu"
And I follow "Add an entry about this course"
And I set the field "Entry title" to "Blog test"
And I set the field "Blog entry body" to "Blog body"
And I press "Save changes"
And I close the browser tab opened by the app
# Create and delete comments as a student
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "menu" in the app
And I press "Site blog" in the app
Then I should see "Blog test"
And I should see "Blog body"
When I press "Comments (0)" in the app
And I press "close" in the app
And I set the field "Add a comment..." to "comment test" in the app
And I press "Save comment" in the app
Then I should see "Comment created"
And I should see "comment test"
When I press the back button in the app
And I press "Comments (1)" in the app
And I press "Delete" in the app
And I press "trash" in the app
And I press "Delete" near "Cancel" in the app
Then I should see "Comment deleted"
But I should not see "comment test"
When I press the back button in the app
Then I should see "Comments (0)"
@app @3.8.0
Scenario: Create and delete offline comments and synchronise (blogs)
# Create blog as a teacher
Given I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "menu" in the app
And I press "Website" in the app
And I switch to the browser tab opened by the app
And I follow "Log in"
And I log in as "teacher1"
And I click on "Side panel" "button"
And I follow "C1"
And I press "Turn editing on"
And I click on "Side panel" "button"
And I follow "Add a block"
And I follow "Blog menu"
And I follow "Add an entry about this course"
And I set the field "Entry title" to "Blog test"
And I set the field "Blog entry body" to "Blog body"
And I press "Save changes"
And I close the browser tab opened by the app
# Create and delete comments as a student
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "menu" in the app
And I press "Site blog" in the app
Then I should see "Blog test"
And I should see "Blog body"
When I press "Comments (0)" in the app
And I switch offline mode to "true"
And I press "close" in the app
And I set the field "Add a comment..." to "comment test" in the app
And I press "Save comment" in the app
Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later."
And I should see "There are offline comments to be synchronised."
And I should see "comment test"
When I press the back button in the app
And I press "Comments (0)" in the app
And I switch offline mode to "false"
And I press "Display options" in the app
And I press "Synchronise now" in the app
Then I should see "comment test"
But I should not see "There are offline comments to be synchronised."
When I press the back button in the app
And I press "Comments (1)" in the app
And I switch offline mode to "true"
And I press "Delete" in the app
And I press "trash" in the app
And I press "Delete" near "Cancel" in the app
Then I should see "Comment deleted"
And I should see "There are offline comments to be synchronised."
And I should see "Deleted offline"
And I should see "comment test"
When I press the back button in the app
And I press "Comments (1)" in the app
And I switch offline mode to "false"
And I press "Display options" in the app
And I press "Synchronise now" in the 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
Then I should see "Comments (0)"

View File

@ -0,0 +1,534 @@
@mod @mod_course @app @javascript
Feature: Test basic usage of one course in app
In order to participate in one course while using the mobile app
As a student
I need basic course functionality to work
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | teacher | teacher1@example.com |
| student1 | Student | student | student1@example.com |
| student2 | Student2 | student2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | option | section |
| choice | Choice course 1 | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | 1 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled | section |
| assign | C1 | assign1 | assignment | Test assignment description | 1 | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode | assessed | scale[modgrade_type] |
| forum | Test forum name | Test forum | C1 | forum | 0 | 5 | Point |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode | section |
| chat | Test chat name | Test chat | C1 | chat | 0 | 2 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| data | Web links | Useful links | C1 | data1 | 4 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode | section |
| lti | Test external name | Test external | C1 | external | 0 | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode | section |
| feedback | Test feedback name | Test feedback | C1 | feedback | 0 | 3 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| glossary | Test glossary | glossary description | C1 | gloss1 | 5 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 | 2 |
And the following "question categories" exist:
| contextlevel | reference | name |
| Course | C1 | Test questions |
And the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Test questions | truefalse | TF1 | Text of the first question |
| Test questions | truefalse | TF2 | Text of the second question |
And quiz "Quiz 1" contains the following questions:
| question | page |
| TF1 | 1 |
| TF2 | 2 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode | section |
| survey | Test survey name | Test survey | C1 | survey | 0 | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode |
| wiki | Test wiki name | Test wiki | C1 | wiki | 0 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode | section |
| lesson | Test lesson name | Test lesson | C1 | lesson | 0 | 3 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode | section |
| scorm | Test scorm name | Test scorm | C1 | scorm | 0 | 2 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode | section |
| workshop | Test workshop name | Test workshop | C1 | workshop | 0 | 3 |
@app @3.8.0
Scenario: Student views course contents
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
Then the header should be "Course 1" in the app
And I should see "Choice course 1"
And I should see "assignment"
And I should see "Test forum name"
And I should see "Test chat name"
And I should see "Web links"
And I should see "Test external name"
And I should see "Test feedback name"
And I should see "Test glossary"
And I should see "Quiz 1"
And I should see "Test survey name"
And I should see "Test wiki name"
And I should see "Test lesson name"
And I should see "Test scorm name"
And I should see "Test workshop name"
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
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
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
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
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
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
And I press "Test feedback name" in the 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
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
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
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
And I press "Test wiki name" in the app
And I press "OK" in the app
Then the header should be "Test wiki name" in the app
When I press the back button 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
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
And I press "Test workshop name" in the app
Then the header should be "Test workshop name" in the app
@app @3.8.0
Scenario: Student views section contents
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
Then the header should be "Course 1" in the app
And I should see "Choice course 1"
And I should see "assignment"
And I should see "Test forum name"
And I should see "Test chat name"
And I should see "Web links"
And I should see "Test external name"
And I should see "Test feedback name"
And I should see "Test glossary"
And I should see "Quiz 1"
And I should see "Test survey name"
And I should see "Test wiki name"
And I should see "Test lesson name"
And I should see "Test scorm name"
And I should see "Test workshop name"
When I press "arrow dropdown" in the app
And I press "General" near "Sections" in the app
Then I should see "Test forum name"
And I should see "Test wiki name"
But I should not see "Choice course 1"
And I should not see "assignment"
And I should not see "Test chat name"
And I should not see "Web links"
And I should not see "Test external name"
And I should not see "Test feedback name"
And I should not see "Test glossary"
And I should not see "Quiz 1"
And I should not see "Test survey name"
And I should not see "Test lesson name"
And I should not see "Test scorm name"
And I should not see "Test workshop name"
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
And I press "Test wiki name" in the app
And I press "OK" in the app
Then the header should be "Test wiki name" in the app
When I press the back button in the app
And I press "arrow dropdown" in the app
And I press "Topic 1" near "Sections" in the app
Then I should see "Choice course 1"
And I should see "assignment"
And I should see "Test external name"
And I should see "Test survey name"
But I should not see "Test forum name"
And I should not see "Test chat name"
And I should not see "Web links"
And I should not see "Test feedback name"
And I should not see "Test glossary"
And I should not see "Quiz 1"
And I should not see "Test wiki name"
And I should not see "Test lesson name"
And I should not see "Test scorm name"
And I should not see "Test workshop name"
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
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
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
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
And I press "arrow dropdown" in the app
And I press "Topic 2" near "Sections" in the app
Then I should see "Quiz 1"
And I should see "Test chat name"
And I should see "Test scorm name"
But I should not see "Choice course 1"
And I should not see "assignment"
And I should not see "Test forum name"
And I should not see "Web links"
And I should not see "Test external name"
And I should not see "Test feedback name"
And I should not see "Test glossary"
And I should not see "Test survey name"
And I should not see "Test wiki name"
And I should not see "Test lesson name"
And I should not see "Test workshop name"
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
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
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
And I press "arrow dropdown" in the app
And I press "Topic 3" near "Sections" in the app
Then I should see "Test feedback name"
And I should see "Test lesson name"
And I should see "Test workshop name"
But I should not see "Choice course 1"
And I should not see "assignment"
And I should not see "Test forum name"
And I should not see "Test chat name"
And I should not see "Web links"
And I should not see "Test external name"
And I should not see "Test glossary"
And I should not see "Quiz 1"
And I should not see "Test survey name"
And I should not see "Test wiki name"
And I should not see "Test scorm name"
When I press "Test feedback name" in the 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
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
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
And I press "arrow dropdown" in the app
And I press "Topic 4" near "Sections" in the app
Then I should see "Web links"
But I should not see "Choice course 1"
And I should not see "assignment"
And I should not see "Test forum name"
And I should not see "Test chat name"
And I should not see "Test external name"
And I should not see "Test feedback name"
And I should not see "Test glossary"
And I should not see "Quiz 1"
And I should not see "Test survey name"
And I should not see "Test wiki name"
And I should not see "Test lesson name"
And I should not see "Test scorm name"
And I should not see "Test workshop name"
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
And I press "arrow dropdown" in the app
And I press "Topic 5" near "Sections" in the app
Then I should see "Test glossary"
But I should not see "Choice course 1"
And I should not see "assignment"
And I should not see "Test forum name"
And I should not see "Test chat name"
And I should not see "Web links"
And I should not see "Test external name"
And I should not see "Test feedback name"
And I should not see "Quiz 1"
And I should not see "Test survey name"
And I should not see "Test wiki name"
And I should not see "Test lesson name"
And I should not see "Test scorm name"
And I should not see "Test workshop name"
When I press "Test glossary" in the app
Then the header should be "Test glossary" in the app
@app @3.8.0
Scenario: Navigation between sections using the bottom arrows
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
Then the header should be "Course 1" in the app
And I should see "Choice course 1"
And I should see "assignment"
And I should see "Test forum name"
And I should see "Test chat name"
And I should see "Web links"
And I should see "Test external name"
And I should see "Test feedback name"
And I should see "Test glossary"
And I should see "Quiz 1"
And I should see "Test survey name"
And I should see "Test wiki name"
And I should see "Test lesson name"
And I should see "Test scorm name"
And I should see "Test workshop name"
When I press "arrow dropdown" in the app
And I press "General" near "Sections" in the app
Then I should see "General"
But I should not see "Topic 1"
And I should not see "Topic 2"
And I should not see "Topic 3"
And I should not see "Topic 4"
And I should not see "Topic 5"
When I press "arrow forward" near "Test wiki name" in the app
Then I should see "Topic 1"
But I should not see "General"
And I should not see "Topic 2"
And I should not see "Topic 3"
And I should not see "Topic 4"
And I should not see "Topic 5"
When I press "arrow forward" near "Test survey name" in the app
Then I should see "Topic 2"
But I should not see "General"
And I should not see "Topic 1"
And I should not see "Topic 3"
And I should not see "Topic 4"
And I should not see "Topic 5"
When I press "arrow forward" near "Test scorm name" in the app
Then I should see "Topic 3"
But I should not see "General"
And I should not see "Topic 1"
And I should not see "Topic 2"
And I should not see "Topic 4"
And I should not see "Topic 5"
When I press "arrow forward" near "Test workshop name" in the app
Then I should see "Topic 4"
But I should not see "General"
And I should not see "Topic 1"
And I should not see "Topic 2"
And I should not see "Topic 3"
And I should not see "Topic 5"
When I press "arrow forward" near "Web links" in the app
Then I should see "Topic 5"
But I should not see "General"
And I should not see "Topic 1"
And I should not see "Topic 2"
And I should not see "Topic 3"
And I should not see "Topic 4"
When I press "arrow back" near "Test glossary" in the app
Then I should see "Topic 4"
But I should not see "General"
And I should not see "Topic 1"
And I should not see "Topic 2"
And I should not see "Topic 3"
And I should not see "Topic 5"
@app @3.8.0
Scenario: Self enrol
Given I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Display options" in the app
And I press "Course summary" in the app
And I press "Open in browser" in the app
And I switch to the browser tab opened by the app
And I log in as "teacher1"
And I press "Actions menu"
And I follow "More..."
And I follow "Users"
And I follow "Enrolment methods"
And I click on "Enable" "icon" in the "Self enrolment (Student)" "table_row"
And I close the browser tab opened by the app
When I enter the app
And I log in as "student2"
And I press "Site home" in the app
And I press "Available courses" in the app
And I press "Course 1" in the app
And I press "Enrol me" in the app
And I press "OK" in the app
And I wait loading to finish in the app
And I press "Contents" in the app
Then the header should be "Course 1" in the app
And I should see "Choice course 1"
And I should see "assignment"
And I should see "Test forum name"
And I should see "Test chat name"
And I should see "Web links"
And I should see "Test external name"
And I should see "Test feedback name"
And I should see "Test glossary"
And I should see "Quiz 1"
And I should see "Test survey name"
And I should see "Test wiki name"
And I should see "Test lesson name"
And I should see "Test scorm name"
And I should see "Test workshop name"
@app @3.8.0
Scenario: Guest access
Given I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Display options" in the app
And I press "Course summary" in the app
And I press "Open in browser" in the app
And I switch to the browser tab opened by the app
And I log in as "teacher1"
And I press "Actions menu"
And I follow "More..."
And I follow "Users"
And I follow "Enrolment methods"
And I click on "Enable" "icon" in the "Guest access" "table_row"
And I close the browser tab opened by the app
When I enter the app
And I log in as "student2"
And I press "Site home" in the app
And I press "Available courses" in the app
And I press "Course 1" in the app
Then I should see "Download course"
And I should see "Contents"
When I press "Contents" in the app
Then the header should be "Course 1" in the app
And I should see "Choice course 1"
And I should see "assignment"
And I should see "Test forum name"
And I should see "Test chat name"
And I should see "Web links"
And I should see "Test feedback name"
And I should see "Test glossary"
And I should see "Quiz 1"
And I should see "Test survey name"
And I should see "Test wiki name"
And I should see "Test lesson name"
And I should see "Test scorm name"
And I should see "Test workshop name"
@app @3.8.0
Scenario: View blocks bellow/beside contents also when All sections selected
Given I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Display options" in the app
And I press "Course summary" in the app
And I press "Open in browser" in the app
And I switch to the browser tab opened by the app
And I log in as "teacher1"
And I press "Turn editing on"
And I click on "Side panel" "button"
And I follow "Add a block"
And I follow "HTML"
And I click on "Side panel" "button"
And I follow "Add a block"
And I follow "Activities"
And I click on "Actions menu" "icon" in the "#action-menu-toggle-0" "css_element"
And I follow "Configure (new HTML block) block"
And I set the field "HTML block title" to "HTML title test"
And I set the field "Content" to "body test"
And I press "Save changes"
And I close the browser tab opened by the app
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
Then the header should be "Course 1" in the app
And I should see "Choice course 1"
And I should see "assignment"
And I should see "Test forum name"
And I should see "Test chat name"
And I should see "Web links"
And I should see "Test external name"
And I should see "Test feedback name"
And I should see "Test glossary"
And I should see "Quiz 1"
And I should see "Test survey name"
And I should see "Test wiki name"
And I should see "Test lesson name"
And I should see "Test scorm name"
And I should see "Test workshop name"
And I should see "HTML title test"
And I should see "body test"
And I should see "Activities"

View File

@ -0,0 +1,36 @@
@core @core_course @app @javascript
Feature: Check course completion feature.
In order to track the progress of the course on mobile device
As a student
I need to be able to update the activity completion status.
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category | enablecompletion |
| Course 1 | C1 | 0 | 1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
Scenario: Complete the activity manually by clicking at the completion checkbox.
Given the following "activities" exist:
| activity | name | course | idnumber | completion | completionview |
| forum | First forum | C1 | forum1 | 1 | 0 |
| forum | Second forum | C1 | forum2 | 1 | 0 |
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
# Set activities as completed.
And I should see "0%"
And I press "Not completed: First forum. Select to mark as complete." in the app
And I should see "50%"
And I press "Not completed: Second forum. Select to mark as complete." in the app
And I should see "100%"
# Set activities as not completed.
And I press "Completed: First forum. Select to mark as not complete." in the app
And I should see "50%"
And I press "Completed: Second forum. Select to mark as not complete." in the app
And I should see "0%"

View File

@ -0,0 +1,120 @@
@core @core_course @app @javascript
Feature: Test course list shown on app start tab
In order to select a course
As a student
I need to see the correct list of courses
Background:
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
| Course 2 | C2 |
And the following "users" exist:
| username |
| student1 |
| student2 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
| student2 | C2 | student |
Scenario: Student is registered on one course
When I enter the app
And I log in as "student1"
Then I should see "Course 1"
And I should not see "Course 2"
Scenario: Student is registered on two courses (shortnames not displayed)
When I enter the app
And I log in as "student2"
Then I should see "Course 1"
And I should see "Course 2"
And I should not see "C1"
And I should not see "C2"
Scenario: Student is registered on two courses (shortnames displayed)
Given the following config values are set as admin:
| courselistshortnames | 1 |
When I enter the app
And I log in as "student2"
Then I should see "Course 1"
And I should see "Course 2"
And I should see "C1"
And I should see "C2"
Scenario: Student uses course list to enter course, then leaves it again
When I enter the app
And I log in as "student2"
And I press "Course 2" near "Course overview" in the app
Then the header should be "Course 2" in the app
And I press the back button in the app
Then the header should be "Acceptance test site" in the app
Scenario: Student uses filter feature to reduce course list
Given the following config values are set as admin:
| courselistshortnames | 1 |
And the following "courses" exist:
| fullname | shortname |
| Frog 3 | C3 |
| Frog 4 | C4 |
| Course 5 | C5 |
| Toad 6 | C6 |
And the following "course enrolments" exist:
| user | course | role |
| student2 | C3 | student |
| student2 | C4 | student |
| student2 | C5 | student |
| student2 | C6 | student |
# Create bogus courses so that the main ones aren't shown in the 'recently accessed' part.
# Because these come later in alphabetical order, they may not be displayed in the lower part
# which is OK.
And the following "courses" exist:
| fullname | shortname |
| Zogus 1 | Z1 |
| Zogus 2 | Z2 |
| Zogus 3 | Z3 |
| Zogus 4 | Z4 |
| Zogus 5 | Z5 |
| Zogus 6 | Z6 |
| Zogus 7 | Z7 |
| Zogus 8 | Z8 |
| Zogus 9 | Z9 |
| Zogus 10 | Z10 |
And the following "course enrolments" exist:
| user | course | role |
| student2 | Z1 | student |
| student2 | Z2 | student |
| student2 | Z3 | student |
| student2 | Z4 | student |
| student2 | Z5 | student |
| student2 | Z6 | student |
| student2 | Z7 | student |
| student2 | Z8 | student |
| student2 | Z9 | student |
| student2 | Z10 | student |
When I enter the app
And I log in as "student2"
Then I press "Display options" near "Course overview" in the app
Then I should see "C1"
And I should see "C2"
And I should see "C3"
And I should see "C4"
And I should see "C5"
And I should see "C6"
Then I press "Filter my courses" in the app
And I set the field "Filter my courses" to "fr" in the app
Then I should not see "C1"
And I should not see "C2"
And I should see "C3"
And I should see "C4"
And I should not see "C5"
And I should not see "C6"
And I press "Display options" near "Course overview" in the app
And I press "Filter my courses" in the app
Then I should see "C1"
And I should see "C2"
And I should see "C3"
And I should see "C4"
And I should see "C5"
And I should see "C6"

View File

@ -0,0 +1,156 @@
@mod @mod_courses @app @javascript
Feature: Test basic usage of courses in app
In order to participate in the courses while using the mobile app
As a student
I need basic courses functionality to work
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | teacher | teacher1@example.com |
| student1 | Student | student | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 2 | C2 | 0 |
| Course 3 | C3 | 0 |
| Course 4 | C4 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher1 | C2 | editingteacher |
| teacher1 | C3 | editingteacher |
| teacher1 | C4 | editingteacher |
| student1 | C1 | student |
| student1 | C2 | student |
| student1 | C3 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | option |
| choice | Choice course 1 | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 |
| choice | Choice course 2 | Test choice description | C2 | choice1 | Option 1, Option 2, Option 3 |
| choice | Choice course 3 | Test choice description | C3 | choice1 | Option 1, Option 2, Option 3 |
| choice | Choice course 4 | Test choice description | C4 | choice1 | Option 1, Option 2, Option 3 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled |
| assign | C1 | assign1 | assignment | Test assignment description | 1 |
@app @3.8.0
Scenario: Dashboard tab displayed in >= 3.3 sites
When I enter the app
And I log in as "student1"
Then I should see "Dashboard"
And the header should be "Acceptance test site" in the app
And I should see "Course 1"
And I should see "Course 2"
And I should see "Course 3"
When I press "Site home" in the app
Then I should see "Dashboard"
And the header should be "Acceptance test site" in the app
When I press "Dashboard" in the app
Then I should see "Course 1"
And I should see "Course 2"
And I should see "Course 3"
@app @3.8.0
Scenario: See my courses
When I enter the app
And I log in as "student1"
Then the header should be "Acceptance test site" in the app
And I should see "Course 1"
And I should see "Course 2"
And I should see "Course 3"
When I press "Course 1" near "Recently accessed courses" in the app
Then I should see "Choice course 1"
And the header should be "Course 1" in the app
When I press "Choice course 1" in the app
Then I should see "Test choice description"
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
And I press "Course 2" near "Recently accessed courses" in the app
Then I should see "Choice course 2"
And the header should be "Course 2" in the app
When I press the back button in the app
And I press "Course 3" near "Recently accessed courses" in the app
Then I should see "Choice course 3"
And the header should be "Course 3" in the app
@app @3.8.0
Scenario: Search for a course
When I enter the app
And I log in as "student1"
And I press "Search courses" in the app
And I set the field "Search" to "Course 4" in the app
And I press "Search" in the app
Then I should see "Course 4"
And the header should be "Search courses" in the app
When I press "Course 4" in the app
Then I should see "Course 4"
And the header should be "Course 4" in the app
When I press the back button in the app
And I set the field "Search" to "Course" in the app
And I press "Search" in the app
Then I should see "Course 1"
And I should see "Course 2"
And I should see "Course 3"
And I should see "Course 4"
@app @3.8.0
Scenario: Links to actions in Timeline work for teachers/students
# Configure assignment as teacher
When I enter the app
And I log in as "teacher1"
Then I should see "Timeline"
Given I press "Course 1" near "Recently accessed courses" in the app
And I press "assignment" in the app
And I press "Display options" in the app
And I press "Open in browser" in the app
And I switch to the browser tab opened by the app
And I log in as "teacher1"
And I press "Actions menu"
And I follow "Edit settings"
And I press "Expand all"
And I click on "duedate[enabled]" "checkbox"
And I click on "gradingduedate[enabled]" "checkbox"
And I press "Save and return to course"
And I close the browser tab opened by the app
# Submit assignment as student
When I enter the app
And I log in as "student1"
And I press "Add submission" in the app
Then the header should be "assignment" in the app
And I should see "Test assignment description"
And I should see "No attempt"
And I should see "Due date"
When I press "Add submission" in the app
And I set the field "Online text submissions" to "test" in the app
And I press "Save" in the app
And I press "Submit assignment" in the app
And I press "OK" in the app
Then the header should be "assignment" in the app
And I should see "Test assignment description"
And I should see "Submitted for grading"
And I should see "Due date"
# Grade assignment as teacher
When I enter the app
And I log in as "teacher1"
And I press "Grade" in the app
Then the header should be "assignment" in the app
And I should see "Test assignment description"
And I should see "Time remaining"
When I press "Needs grading" in the app
Then I should see "Student student"
And I should see "Not graded"

View File

@ -1,5 +1,5 @@
@mod @mod_forum @app @javascript @mod @mod_forum @app @javascript
Feature: Test basic usage in app Feature: Test basic usage of forum activity in app
In order to participate in the forum while using the mobile app In order to participate in the forum while using the mobile app
As a student As a student
I need basic forum functionality to work I need basic forum functionality to work
@ -11,13 +11,20 @@ Feature: Test basic usage in app
And the following "users" exist: And the following "users" exist:
| username | | username |
| student1 | | student1 |
| student2 |
| teacher1 |
| teacher2 |
And the following "course enrolments" exist: And the following "course enrolments" exist:
| user | course | role | | user | course | role |
| student1 | C1 | student | | student1 | C1 | student |
| student2 | C1 | student |
| teacher1 | C1 | editingteacher |
| teacher2 | C1 | editingteacher |
And the following "activities" exist: And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode | | activity | name | intro | course | idnumber | groupmode | assessed | scale |
| forum | Test forum name | Test forum | C1 | forum | 0 | | forum | Test forum name | Test forum | C1 | forum | 0 | 1 | 1 |
@app @3.8.0
Scenario: Student starts a discussion Scenario: Student starts a discussion
When I enter the app When I enter the app
And I log in as "student1" And I log in as "student1"
@ -29,22 +36,8 @@ Feature: Test basic usage in app
And I press "Post to forum" in the app And I press "Post to forum" in the app
Then I should see "My happy subject" Then I should see "My happy subject"
@app_upto3.6.1 When I press "My happy subject" in the app
Scenario: Student posts a reply Then I should see "An awesome message"
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I press "Add a new discussion topic" in the app
And I set the field "Subject" to "DiscussionSubject" in the app
And I set the field "Message" to "DiscussionMessage" in the app
And I press "Post to forum" in the app
And I press "DiscussionSubject" in the app
And I press "Reply" in the app
And I set the field "Message" to "ReplyMessage" in the app
And I press "Post to forum" in the app
Then I should see "DiscussionMessage"
And I should see "ReplyMessage"
@app_from3.7 @app_from3.7
Scenario: Student posts a reply Scenario: Student posts a reply
@ -63,17 +56,378 @@ Feature: Test basic usage in app
Then I should see "DiscussionMessage" Then I should see "DiscussionMessage"
And I should see "ReplyMessage" And I should see "ReplyMessage"
Scenario: Test that 'open in browser' works for forum @app @3.8.0
Scenario: Student stars a discussion
When I enter the app When I enter the app
And I change viewport size to "360x640"
And I log in as "student1" And I log in as "student1"
And I press "Course 1" near "Course overview" in the app And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app And I press "Test forum name" in the app
And I press the page menu button in the app And I press "close" in the app
And I press "Open in browser" in the app And I set the field "Subject" to "starred subject" in the app
And I switch to the browser tab opened by the app And I set the field "Message" to "starred message" in the app
And I press "Post to forum" in the app
And I press "close" in the app
And I set the field "Subject" to "normal subject" in the app
And I set the field "Message" to "normal message" in the app
And I press "Post to forum" in the app
And I press "starred subject" in the app
Then I should see "starred message"
When I press the back button in the app
And I press "Display options" near "starred subject" in the app
And I press "Star this discussion" in the app
And I press "starred subject" in the app
Then I should see "starred message"
When I press the back button in the app
And I press "normal subject" in the app
Then I should see "normal message"
When I press the back button in the app
And I press "Display options" near "starred subject" in the app
And I press "Unstar this discussion" in the app
And I press "starred subject" in the app
Then I should see "starred message"
When I press the back button in the app
And I press "normal subject" in the app
Then I should see "normal message"
@app @3.8.0
Scenario: Teacher star and pin a discussion
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I press "close" in the app
And I set the field "Subject" to "Auto-test star" in the app
And I set the field "Message" to "Auto-test star message" in the app
And I press "Post to forum" in the app
And I press "close" in the app
And I set the field "Subject" to "Auto-test pin" in the app
And I set the field "Message" to "Auto-test pin message" in the app
And I press "Post to forum" in the app
And I press "close" in the app
And I set the field "Subject" to "Auto-test" in the app
And I set the field "Message" to "Auto-test message" in the app
And I press "Post to forum" in the app
And I press "Display options" near "Auto-test star" in the app
And I press "Star this discussion" in the app
And I press "Display options" near "Auto-test pin" in the app
And I press "Pin this discussion" in the app
Then I should see "Auto-test pin"
And I should see "Auto-test star"
And I should see "Auto-test"
When I press "Display options" near "Auto-test pin" in the app
And I press "Unpin this discussion" in the app
And I press "Display options" near "Auto-test star" in the app
And I press "Unstar this discussion" in the app
Then I should see "Auto-test star"
And I should see "Auto-test pin"
@app_upto3.6.0
Scenario: Teacher checks pin and star in 3.6
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I press "close" in the app
And I set the field "Subject" to "Auto-test" in the app
And I set the field "Message" to "Auto-test message" in the app
And I press "Post to forum" in the app
And I press "Auto-test" in the app
And I press "Information" in the app
Then I should not see "Star this discussion"
And I should not see "Pin this discussion"
@app @3.8.0
Scenario: Edit a not sent reply offline
When I enter the app
And I log in as "student1" And I log in as "student1"
Then I should see "Test forum name" And I press "Course 1" near "Course overview" in the app
And I should see "Add a new discussion topic" And I press "Test forum name" in the app
And I close the browser tab opened by the app And I press "close" in the app
And I set the field "Subject" to "Auto-test" in the app
And I set the field "Message" to "Auto-test message" in the app
And I press "Post to forum" in the app
And I press "Auto-test" near "Sort by last post creation date in descending order" in the app
And I switch offline mode to "true"
And I press "Reply" in the app
And I set the field "Write your reply..." to "not sent reply" in the app
And I press "Post to forum" in the app
And I press "Display options" near "not sent reply" in the app
Then I should see "Edit"
When I press "Edit" in the app
And I set the field "Write your reply..." to "not sent reply edited" in the app
And I press "Post to forum" in the app
Then I should see "Not sent"
And I should see "This Discussion has offline data to be synchronised"
When I switch offline mode to "false"
And I press the back button in the app And I press the back button in the app
And I press "Auto-test" near "Sort by last post creation date in descending order" in the app
Then I should not see "Not sent"
And I should not see "This Discussion has offline data to be synchronised"
@app @3.8.0
Scenario: Edit a not sent new discussion offline
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I switch offline mode to "true"
And I press "close" in the app
And I set the field "Subject" to "Auto-test" in the app
And I set the field "Message" to "Auto-test message" in the app
And I press "Post to forum" in the app
And I press "Auto-test" in the app
And I set the field "Message" to "Auto-test message edited" in the app
And I press "Post to forum" in the app
Then I should see "This Forum has offline data to be synchronised."
When I switch offline mode to "false"
And I press "Auto-test" in the app
And I press "Post to forum" in the app
Then I should not see "This Forum has offline data to be synchronised."
When I press "Auto-test" near "Sort by last post creation date in descending order" in the app
And I should see "Auto-test message edited"
@app @3.8.0
Scenario: Edit a forum post (only online)
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I press "close" in the app
And I set the field "Subject" to "Auto-test" in the app
And I set the field "Message" to "Auto-test message" in the app
And I press "Post to forum" in the app
Then I should see "Auto-test"
When I press the back button in the app
And I press "Display options" in the app
And I press "Show download options" in the app
And I press "cloud download" near "Test forum name" in the app
And I press "Test forum name" in the app
And I press "Auto-test" near "Sort by last post creation date in descending order" in the app
And I press "Display options" near "Reply" in the app
Then I should see "Edit"
When I press "Edit" in the app
And I set the field "Write your reply..." to "Auto-test message edited" in the app
And I press "Save changes" in the app
And I switch offline mode to "true"
And I press "Display options" near "Reply" 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 should not see "Edit"
@app @3.8.0
Scenario: Delete a forum post (only online)
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I press "close" in the app
And I set the field "Subject" to "Auto-test" in the app
And I set the field "Message" to "Auto-test message" in the app
And I press "Post to forum" in the app
Then I should see "Auto-test"
When I press the back button in the app
And I press "Display options" in the app
And I press "Show download options" in the app
And I press "cloud download" near "Test forum name" in the app
And I press "Test forum name" in the app
And I press "Auto-test" near "Sort by last post creation date in descending order" in the app
And I press "Display options" near "Reply" in the app
Then I should see "Delete"
When I press "Delete" in the app
And I press "Cancel" in the app
And I switch offline mode to "true"
And I press "Display options" near "Reply" 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
Then I should not see "Delete"
When I switch offline mode to "false"
And I press "Display options" near "Reply" in the app
And I press "Delete" in the app
And I press "Delete" in the app
Then I should not see "Auto-test"
@app @3.8.0
Scenario: Add/view ratings
Given I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I press "close" in the app
And I set the field "Subject" to "Auto-test" in the app
And I set the field "Message" to "Auto-test message" in the app
And I press "Post to forum" in the app
And I press "Auto-test" in the app
And I press "Reply" in the app
And I set the field "Write your reply..." to "test2" in the app
And I press "Post to forum" in the app
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I press "Auto-test" in the app
And I press "None" near "Auto-test message" in the app
And I press "1" near "Cancel" in the app
And I switch offline mode to "true"
And I press "None" near "test2" in the app
And I press "0" near "Cancel" in the app
Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later."
And I should see "Average of ratings: -"
And I should see "Average of ratings: 1"
When I switch offline mode to "false"
And I press the back button in the app
Then I should see "This Forum has offline data to be synchronised."
When I press "Display options" near "Test forum name" in the app
And I press "Synchronise now" in the app
Then I should not see "This Forum has offline data to be synchronised."
When I press "Auto-test" in the app
Then I should see "Average of ratings: 1"
And I should see "Average of ratings: 0"
But I should not see "Average of ratings: -"
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I press "Auto-test" in the app
Then I should see "Average of ratings: 1"
And I should see "Average of ratings: 0"
But I should not see "Average of ratings: -"
@app @3.8.0
Scenario: Student replies a post offline
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I press "Add a new discussion topic" in the app
And I set the field "Subject" to "DiscussionSubject" in the app
And I set the field "Message" to "DiscussionMessage" in the app
And I press "Post to forum" in the app
And I press the back button in the app
And I press "Display options" in the app
And I press "Show download options" in the app
And I press "cloud download" near "Test forum name" in the app
And I press "Test forum name" in the app
And I press "DiscussionSubject" in the app
And I switch offline mode to "true"
And I press "Reply" in the app
And I set the field "Write your reply" to "ReplyMessage" in the app
And I press "Post to forum" in the app
Then I should see "DiscussionMessage"
And I should see "ReplyMessage"
And I should see "Not sent"
When I press the back button in the app
And I switch offline mode to "false"
And I press "DiscussionSubject" in the app
Then I should see "DiscussionMessage"
And I should see "ReplyMessage"
But I should not see "Not sent"
@app @3.8.0
Scenario: Student creates a new discussion offline and sync forum
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I switch offline mode to "true"
And I press "Add a new discussion topic" in the app
And I set the field "Subject" to "DiscussionSubject" in the app
And I set the field "Message" to "DiscussionMessage" in the app
And I press "Post to forum" in the app
Then I should see "DiscussionSubject"
And I should see "Not sent"
And I should see "This Forum has offline data to be synchronised."
When I switch offline mode to "false"
And I press the back button in the app
And I press "Test forum name" in the app
And I press "Display options" near "Test forum name" in the app
And I press "Refresh discussions" in the app
And I press "DiscussionSubject" near "Sort by last post creation date in descending order" in the app
Then I should see "DiscussionSubject"
And I should see "DiscussionMessage"
But I should not see "Not sent"
And I should not see "This Forum has offline data to be synchronised."
@app @3.8.0
Scenario: Student creates a new discussion offline and auto-sync forum
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I switch offline mode to "true"
And I press "Add a new discussion topic" in the app
And I set the field "Subject" to "DiscussionSubject" in the app
And I set the field "Message" to "DiscussionMessage" in the app
And I press "Post to forum" in the app
Then I should see "DiscussionSubject"
And I should see "Not sent"
And I should see "This Forum has offline data to be synchronised."
When I switch offline mode to "false"
And I run cron tasks in the app
And I wait loading to finish in the app
Then I should not see "Not sent"
When I press "DiscussionSubject" near "Sort by last post creation date in descending order" in the app
Then I should see "DiscussionSubject"
And I should see "DiscussionMessage"
But I should not see "Not sent"
And I should not see "This Forum has offline data to be synchronised."
@app @3.8.0
Scenario: Prefetch
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test forum name" in the app
And I press "Add a new discussion topic" in the app
And I set the field "Subject" to "DiscussionSubject" in the app
And I set the field "Message" to "DiscussionMessage" in the app
And I press "Post to forum" in the app
Then I should see "DiscussionSubject"
When I press the back button in the app
And I press "Display options" in the app
And I press "Show download options" in the app
And I press "cloud download" near "Test forum name" in the app
And I press "Test forum name" in the app
And I press "Add a new discussion topic" in the app
And I set the field "Subject" to "DiscussionSubject 2" in the app
And I set the field "Message" to "DiscussionMessage 2" in the app
And I press "Post to forum" in the app
Then I should see "DiscussionSubject"
And I should see "DiscussionSubject 2"
When I press the back button in the app
And I switch offline mode to "true"
And I press "Test forum name" in the app
And I press "DiscussionSubject 2" 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 press "DiscussionSubject" in the app
Then I should see "DiscussionSubject"
And I should see "DiscussionMessage"
But I should not see "There was a problem connecting to the site. Please check your connection and try again."

View File

@ -0,0 +1,342 @@
@mod @mod_glossary @app @javascript
Feature: Test basic usage of glossary in app
In order to participate in the glossaries while using the mobile app
As a student
I need basic glossary functionality to work
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | teacher | teacher1@example.com |
| teacher2 | Teacher2 | teacher2 | teacher2@example.com |
| student1 | Student | student | student1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| teacher2 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | idnumber | mainglossary | allowcomments | assessed | scale |
| glossary | Test glossary | glossary description | C1 | gloss1 | 1 | 1 | 1 | 1 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode |
| forum | Test forum name | Test forum | C1 | forum | 0 |
@app @3.8.0
Scenario: View a glossary and its terms
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "close" in the app
And I set the field "Concept" to "potato" in the app
And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "car" in the app
And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "mountain" in the app
And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app
And I press "Save" in the app
Then the header should be "Test glossary" in the app
And I should see "car"
And I should see "mountain"
And I should see "potato"
When I press "car" in the app
Then I should see "car"
And I should see "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods."
@app @3.8.0
Scenario: Change filters (include search)
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "close" in the app
And I set the field "Concept" to "potato" in the app
And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "car" in the app
And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "mountain" in the app
And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app
And I press "Save" in the app
Then the header should be "Test glossary" in the app
And I should see "car"
And I should see "mountain"
And I should see "potato"
When I press "Search" in the app
And I set the field "Search query" to "something" in the app
And I press "search" near "No entries were found." in the app
Then I should see "No entries were found."
When I set the field "Search query" to "potato" in the app
And I press "search" near "No entries were found." in the app
And I set the field "Search query" to " " in the app
And I press "Display options" in the app
And I press "Refresh" in the app
And I press "potato" in the app
Then I should see "potato"
And I should see "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae."
@app @3.8.0
Scenario: Navigate to glossary terms by link (auto-linking)
When the "glossary" filter is "on"
And I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "close" in the app
And I set the field "Concept" to "potato" in the app
And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app
And I press "This entry should be automatically linked" in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "car" in the app
And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app
And I press "This entry should be automatically linked" in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "mountain" in the app
And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app
And I press "This entry should be automatically linked" in the app
And I press "Save" in the app
Then the header should be "Test glossary" in the app
And I should see "car"
And I should see "mountain"
And I should see "potato"
When I press the back button in the app
And I press "Test forum name" in the app
And I press "add" in the app
And I set the field "Subject" to "Testing auto-link glossary"
And I set the field "Message" to "Glossary terms auto-linked: potato car mountain" in the app
And I press "Post to forum" in the app
And I press "Testing auto-link glossary" near "Last post a few seconds ago" in the app
And I press "car" in the app
Then the header should be "car" in the app
And I should see "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods."
When I press the back button in the app
And I press "mountain" in the app
Then the header should be "mountain" in the app
And I should see "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak."
@app @3.8.0
Scenario: See comments
# Create entries as a student
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "close" in the app
And I set the field "Concept" to "potato" in the app
And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "car" in the app
And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "mountain" in the app
And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app
And I press "Save" in the app
Then the header should be "Test glossary" in the app
And I should see "car"
And I should see "mountain"
And I should see "potato"
When I press "mountain" in the app
Then I should see "Comments (0)"
# Write comments as a teacher
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "mountain" in the app
Then I should see "Comments (0)"
When I press "Comments" in the app
And I should see "No comments"
When I press "close" in the app
And I set the field "Add a comment..." to "teacher first comment" in the app
And I press "Save comment" in the app
Then I should see "teacher first comment"
When I press "close" in the app
And I set the field "Add a comment..." to "teacher second comment" in the app
And I press "Save comment" in the app
Then I should see "teacher first comment"
And I should see "teacher second comment"
# View comments as a student
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "mountain" in the app
Then I should see "Comments (2)"
When I press "Comments" in the app
And I should see "teacher first comment"
And I should see "teacher second comment"
@app @3.8.0
Scenario: Prefetch
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "close" in the app
And I set the field "Concept" to "potato" in the app
And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "car" in the app
And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "mountain" in the app
And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app
And I press "Save" in the app
Then the header should be "Test glossary" in the app
And I should see "car"
And I should see "mountain"
And I should see "potato"
When I press "Display options" in the app
And I press "Download" in the app
And I press the back button in the app
And I press the back button in the app
And I press "Course 1" near "Recently accessed courses" in the app
And I switch offline mode to "true"
And I press "Test glossary" in the app
Then the header should be "Test glossary" in the app
And I should see "car"
And I should see "mountain"
And I should see "potato"
When I press "mountain" in the app
Then I should see "mountain"
And I should see "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak."
And I should not see "Comments cannot be retrieved"
And I should see "Comments (0)"
@app @3.8.0
Scenario: Sync
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I switch offline mode to "true"
And I press "close" in the app
And I set the field "Concept" to "potato" in the app
And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "car" in the app
And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "mountain" in the app
And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app
And I press "Save" in the app
Then the header should be "Test glossary" in the app
And I should see "car"
And I should see "mountain"
And I should see "potato"
And I should see "Entries to be synced"
And I should see "This Glossary has offline data to be synchronised."
When I switch offline mode to "false"
And I press "close" in the app
And I set the field "Concept" to "testSync" in the app
And I set the field "Definition" to "testSync" in the app
And I press "Save" in the app
And I press "Display options" in the app
And I press "Synchronise now" in the app
Then the header should be "Test glossary" in the app
And I should see "car"
And I should see "mountain"
And I should see "potato"
And I should see "testSync"
But I should not see "Entries to be synced"
And I should not see "This Glossary has offline data to be synchronised."
@app @3.8.0
Scenario: Add/view ratings
# Create entries as a student
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "close" in the app
And I set the field "Concept" to "potato" in the app
And I set the field "Definition" to "The potato is a root vegetable native to the Americas, a starchy tuber of the plant Solanum tuberosum, and the plant itself, a perennial in the family Solanaceae." in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "car" in the app
And I set the field "Definition" to "A car (or automobile) is a wheeled motor vehicle used for transportation. Most definitions of cars say that they run primarily on roads, seat one to eight people, have four tires, and mainly transport people rather than goods." in the app
And I press "Save" in the app
And I press "close" in the app
And I set the field "Concept" to "mountain" in the app
And I set the field "Definition" to "A mountain is a large landform that rises above the surrounding land in a limited area, usually in the form of a peak." in the app
And I press "Save" in the app
Then the header should be "Test glossary" in the app
And I should see "car"
And I should see "mountain"
And I should see "potato"
# Rate entries as teacher1
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "mountain" in the app
Then I should see "Average of ratings: -"
When I press "None" in the app
And I press "1" in the app
Then I should see "Average of ratings: 1"
# Rate entries as teacher2
When I enter the app
And I log in as "teacher2"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "mountain" in the app
And I switch offline mode to "true"
And I press "None" in the app
And I press "0" in the app
Then I should see "Data stored in the device because it couldn't be sent. It will be sent automatically later."
And I should see "Average of ratings: 1"
When I switch offline mode to "false"
And I press the back button in the app
Then I should see "This Glossary has offline data to be synchronised."
When I press "Display options" in the app
And I press "Synchronise now" in the app
And I press "mountain" in the app
Then I should see "Average of ratings: 0.5"
# View ratings as a student
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Test glossary" in the app
And I press "mountain" in the app
Then the header should be "mountain" in the app
But I should not see "Average of ratings: 0.5"

View File

@ -0,0 +1,74 @@
@mod @mod_login @app @javascript
Feature: Test basic usage of login in app
I need basic login functionality to work
Background:
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "users" exist:
| username | firstname | lastname |
| student1 | david | student |
| student2 | pau | student2 |
| teacher1 | juan | teacher |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| student2 | C1 | student |
| teacher1 | C1 | editingteacher |
@app @3.8.0
Scenario: Add a non existing site
When I enter the app
And I log in as "student1"
And I press "menu" in the app
And I press "Change site" in the app
And I press "add" in the app
And I set the field "https://campus.example.edu" to "Wrong Site Address" in the app
And I press enter in the app
Then I should see "Cannot connect"
And I should see "Please check the address is correct."
@app @3.8.0
Scenario: Delete a site
When I enter the app
And I log in as "student1"
And I press "menu" in the app
And I press "Change site" in the app
Then I should see "Acceptance test site"
And I press "Delete" in the app
And I press "trash" in the app
And I press "Delete" in the app
Then I should see "Connect to Moodle"
But I should not see "Acceptance test site"
@app @3.8.0
Scenario: Require minium version of the app for a site and site name in displayed when adding a new site
When I enter the app
And I log in as "teacher1"
And I press "menu" in the app
And I press "Website" in the app
And I switch to the browser tab opened by the app
And I follow "Log in"
And I log in as "admin"
And I press "Side panel"
And I follow "Site administration"
And I follow "Mobile authentication"
And I set the field "Minimum app version required" to "3.8.1"
And I press "Save changes"
And I close the browser tab opened by the app
And I enter the app
And I log in as "teacher1"
And I press "menu" in the app
And I press "Website" in the app
And I switch to the browser tab opened by the app
And I follow "Log in"
And I log in as "admin"
And I press "Side panel"
And I follow "Site administration"
And I follow "Mobile authentication"
And I set the field "Minimum app version required" to "11.0.0"
And I press "Save changes"
And I close the browser tab opened by the app
And I enter the app
Then I should see "App update required"

View File

@ -0,0 +1,404 @@
@mod @mod_messages @app @javascript
Feature: Test basic usage of messages in app
In order to participate with messages while using the mobile app
As a student
I need basic message functionality to work
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | teacher | teacher1@example.com |
| student1 | Student1 | student1 | student1@example.com |
| student2 | Student2 | student2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
@app @3.8.0
Scenario: View recent conversations and contacts
When I enter the app
And I log in as "teacher1"
And I press "Messages" in the app
And I press "Contacts" in the app
Then I should see "No contacts"
When I press "addon.messages.search" in the app
And I set the field "Search" to "student" in the app
And I press "search" in the app
And I press "Student1 student1" in the app
And I set the field "New message" to "heeey student" in the app
And I press "Send" in the app
And I press "Conversation actions menu" in the app
And I press "Add to contacts" in the app
And I press "Add" in the app
When I enter the app
And I log in as "student1"
And I press "Messages" in the app
And I press "Contacts" in the app
And I press "Requests" in the app
And I press "Teacher teacher" in the app
And I press "Accept and add to contacts" in the app
And I press the back button in the app
And I press "Contacts" near "Requests" in the app
Then the header should be "Contacts" in the app
And I should see "Teacher teacher"
When I press the back button in the app
And I press "Teacher teacher" in the app
Then the header should be "Teacher teacher" in the app
And I should see "heeey student"
@app @3.8.0
Scenario: Search users
When I enter the app
And I log in as "student1"
And I press "Messages" in the app
And I press "addon.messages.search" in the app
And I set the field "Search" to "student2" in the app
And I press "search" in the app
Then I should see "Student2 student2"
When I set the field "Search" to "Teacher" in the app
And I press "search" in the app
Then I should see "Teacher teacher"
@app @3.8.0
Scenario: Send/receive messages in existing conversations
When I enter the app
And I log in as "teacher1"
And I press "Messages" in the app
And I press "Contacts" in the app
And I press "addon.messages.search" in the app
And I set the field "Search" to "student1" in the app
And I press "search" in the app
And I press "Student1 student1" in the app
And I set the field "New message" to "heeey student" in the app
And I press "Send" in the app
And I enter the app
And I log in as "student1"
And I press "Messages" in the app
And I press "Contacts" in the app
And I press "addon.messages.search" in the app
And I set the field "Search" to "teacher" in the app
And I press "search" in the app
And I press "Teacher teacher" in the app
Then I should see "heeey student"
When I set the field "New message" to "hi" in the app
And I press "Send" in the app
And I enter the app
And I log in as "teacher1"
And I press "Messages" in the app
And I press "Contacts" in the app
And I press "addon.messages.search" in the app
And I set the field "Search" to "student1" in the app
And I press "search" in the app
And I press "Student1 student1" in the app
Then I should see "heeey student"
And I should see "hi"
And I set the field "New message" to "byee" in the app
And I press "Send" in the app
Then I should see "heeey student"
And I should see "hi"
And I should see "byee"
@app @3.8.0
Scenario: User profile, send message, add/remove contact
When I enter the app
And I log in as "teacher1"
And I press "Messages" in the app
And I press "Contacts" in the app
And I press "addon.messages.search" in the app
And I set the field "Search" to "student" in the app
And I press "search" in the app
And I press "Student1 student1" in the app
And I set the field "New message" to "heeey student" in the app
And I press "Send" in the app
And I press "Conversation actions menu" in the app
And I press "Add to contacts" in the app
And I press "Add" in the app
Then I should see "Contact request sent"
When I enter the app
And I log in as "student1"
And I press "Messages" in the app
And I press "Contacts" in the app
And I press "Requests" in the app
And I press "Teacher teacher" in the app
Then I should see "Teacher teacher would like to contact you"
When I press "Accept and add to contacts" in the app
Then I should not see "Teacher teacher would like to contact you"
When I press "Teacher teacher" in the app
And I press "Message" in the app
And I set the field "New message" to "hi" in the app
And I press "Send" in the app
Then I should see "heeey student"
And I should see "hi"
When I press the back button in the app
And I press "Remove from contacts" in the app
And I press "Remove" in the app
Then I should see "Add to contacts"
When I press the back button in the app
And I press "Conversation actions menu" in the app
Then I should see "Add to contacts"
When I press "Delete conversation" in the app
And I press "Delete" in the app
And I should not see "heeey student"
And I should not see "hi"
@app @3.8.0
Scenario: Send message offline
When I enter the app
And I log in as "teacher1"
And I press "Messages" in the app
And I press "Contacts" in the app
And I press "addon.messages.search" in the app
And I set the field "Search" to "student1" in the app
And I press "search" in the app
And I press "Student1 student1" in the app
And I switch offline mode to "true"
And I set the field "New message" to "heeey student" in the app
And I press "Send" in the app
And I set the field "New message" to "byee" in the app
And I press "Send" in the app
And I switch offline mode to "false"
And I press the back button in the app
And I press "Student1 student1" in the app
And I enter the app
And I log in as "student1"
And I press "Messages" in the app
And I press "Teacher teacher" in the app
Then I should see "heeey student"
And I should see "byee"
@app @3.8.0
Scenario: Auto-sync messages
When I enter the app
And I log in as "teacher1"
And I press "Messages" in the app
And I press "Contacts" in the app
And I press "addon.messages.search" in the app
And I set the field "Search" to "student1" in the app
And I press "search" in the app
And I press "Student1 student1" in the app
And I switch offline mode to "true"
And I set the field "New message" to "heeey student" in the app
And I press "Send" in the app
And I set the field "New message" to "byee" in the app
And I press "Send" in the app
And I switch offline mode to "false"
And I run cron tasks in the app
And I enter the app
And I log in as "student1"
And I press "Messages" in the app
And I press "Teacher teacher" in the app
Then I should see "heeey student"
And I should see "byee"
@app @3.8.0
Scenario: Search for messages
When I enter the app
And I log in as "teacher1"
And I press "Messages" in the app
And I press "addon.messages.search" in the app
And I set the field "Search" to "student1" in the app
And I press "search" in the app
And I press "Student1 student1" in the app
And I set the field "New message" to "test message" in the app
And I press "Send" in the app
And I set the field "New message" to "search this message" in the app
And I press "Send" in the app
And I enter the app
And I log in as "student1"
And I press "Messages" in the app
And I press "addon.messages.search" in the app
And I set the field "Search" to "search this message" in the app
And I press "search" in the app
Then I should see "Messages"
And I should see "search this message"
When I press "search this message" near "Teacher teacher" in the app
Then I should see "test message"
And I should see "search this message"
@app @3.8.0
Scenario: Star/Unstar
When I enter the app
And I log in as "teacher1"
And I press "Messages" in the app
And I press "addon.messages.search" in the app
And I set the field "Search" to "student1" in the app
And I press "search" in the app
And I press "Student1 student1" in the app
And I set the field "New message" to "star message" in the app
And I press "Send" in the app
And I enter the app
And I log in as "student2"
And I press "Messages" in the app
And I press "addon.messages.search" in the app
And I set the field "Search" to "student1" in the app
And I press "search" in the app
And I press "Student1 student1" in the app
And I set the field "New message" to "test message student2" in the app
And I press "Send" in the app
And I enter the app
And I log in as "student1"
And I press "Messages" in the app
Then I should see "Private (2)"
And I should see "Starred (1)"
When I press "star message" in the app
And I press "Conversation actions menu" in the app
And I press "Star conversation" in the app
And I press the back button in the app
Then I should see "Private (1)"
And I should see "Starred (2)"
When I press "Starred (2)" in the app
Then I should see "Teacher teacher"
And I should see "Student1 student1"
@app @3.8.0
Scenario: User blocking feature
When I enter the app
And I log in as "student2"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Participants" in the app
And I press "Student1 student1" in the app
And I press "Block user" in the app
And I should see "Are you sure you want to block Student1 student1?"
And I press "Cancel" in the app
And I should see "Block user"
And I press "Block user" in the app
And I press "Block user" near "Cancel" in the app
Then I should see "Unblock user"
But I should not see "Block user"
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Participants" in the app
And I press "Student2 student2" in the app
And I press "Message" in the app
Then I should see "You are unable to message this user"
When I enter the app
And I log in as "student2"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Participants" in the app
And I press "Student1 student1" in the app
Then I should see "Unblock user"
But I should not see "Block user"
When I press "Unblock user" in the app
And I press "Cancel" in the app
Then I should see "Unblock user"
But I should not see "Block user"
When I press "Unblock user" in the app
And I press "Unblock user" near "Cancel" in the app
Then I should see "Block user"
But I should not see "Unblock user"
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Participants" in the app
And I press "Student2 student2" in the app
And I press "Message" in the app
And I set the field "New message" to "test message" in the app
And I press "Send" in the app
Then I should see "test message"
But I should not see "You are unable to message this user"
@app @3.8.0
Scenario: Mute Unmute conversations
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Recently accessed courses" in the app
And I press "Participants" in the app
And I press "Student2 student2" in the app
And I press "Message" in the app
And I set the field "New message" to "test message" in the app
And I press "Send" in the app
And I press "Conversation actions menu" in the app
And I press "Mute" in the app
And I press "Muted conversation" in the app
And I press "Conversation actions menu" in the app
Then I should not see "Mute"
When I press "Unmute" in the app
And I press "Conversation actions menu" in the app
Then I should not see "Unmute"
When I press "Mute" 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
And I press "Conversation actions menu" in the app
Then I should see "Unmute"
But I should not see "Mute"
@app @3.8.0
Scenario: Self conversations
When I enter the app
And I log in as "student1"
And I press "Messages" in the app
Then I should see "Starred (1)"
When I press "Student1 student1" in the app
And I set the field "New message" to "self conversation online" in the app
And I press "Send" in the app
And I switch offline mode to "true"
And I set the field "New message" to "self conversation offline" in the app
And I press "Send" in the app
And I switch offline mode to "false"
And I press the back button in the app
And I press "Student1 student1" in the app
And I press "Conversation actions menu" in the app
Then I should see "Show delete messages"
And I should see "Delete conversation"
When I press "Unstar conversation" in the app
And I press "Conversation actions menu" in the app
Then I should see "Star conversation"
And I should see "Delete conversation"
When I press "Show delete messages" in the app
Then I should see "self conversation online"
And I should see "self conversation offline"
When I press "Delete message" near "self conversation offline" in the app
And I press "OK" in the app
Then I should see "self conversation online"
But I should not see "self conversation offline"
When I press "Conversation actions menu" in the app
And I press "Delete conversation" in the app
And I press "Delete" in the app
Then I should not see "self conversation online"
And I should not see "self conversation offline"
When I press the back button in the app
And I press "addon.messages.search" in the app
And I set the field "Search" to "Student1 student1" in the app
And I press "search" in the app
And I press "Student1 student1" in the app
And I set the field "New message" to "auto search test" in the app
And I press "Send" in the app
And I press the back button in the app
And I press the back button in the app
And I press "Private" in the app
And I press "Student1 student1" in the app
Then I should see "auto search test"

View File

@ -0,0 +1,170 @@
@mod @mod_quiz @app @javascript
Feature: Attempt a quiz in app
As a student
In order to demonstrate what I know
I need to be able to attempt quizzes
Background:
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "users" exist:
| username |
| student1 |
| teacher1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| quiz | Quiz 1 | Quiz 1 description | C1 | quiz1 |
And the following "question categories" exist:
| contextlevel | reference | name |
| Course | C1 | Test questions |
And the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Test questions | truefalse | TF1 | Text of the first question |
| Test questions | truefalse | TF2 | Text of the second question |
And quiz "Quiz 1" contains the following questions:
| question | page |
| TF1 | 1 |
| TF2 | 2 |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| quiz | Quiz 2 | Quiz 2 description | C1 | quiz2 |
And the following "question categories" exist:
| contextlevel | reference | name |
| Course | C1 | Test questions 2|
And the following "questions" exist:
| questioncategory | qtype | name | questiontext |
| Test questions | multichoice | TF3 | Text of the first question |
| Test questions | shortanswer | TF4 | Text of the second question |
| Test questions | numerical | TF5 | Text of the third question |
| Test questions | essay | TF6 | Text of the fourth question |
| Test questions | ddwtos | TF7 | Text of the fifth question |
| Test questions | truefalse | TF8 | Text of the sixth question |
| Test questions | match | TF9 | Text of the seventh question |
And quiz "Quiz 2" contains the following questions:
| question | page |
| TF3 | 1 |
| TF4 | 2 |
| TF5 | 3 |
| TF6 | 4 |
| TF7 | 5 |
| TF8 | 6 |
| TF9 | 7 |
@app @3.8.0
Scenario: View a quiz entry page (attempts, status, etc.)
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Quiz 1" in the app
And I press "Attempt quiz now" in the app
Then I should see "Text of the first question"
But I should not see "Text of the second question"
When I press "Next" near "Question 1" in the app
Then I should see "Text of the second question"
But I should not see "Text of the first question"
When I press "Previous" near "Question 2" in the app
Then I should see "Text of the first question"
But I should not see "Text of the second question"
When I press "Next" near "Quiz 1" in the app
Then I should see "Text of the second question"
But I should not see "Text of the first question"
When I press "Previous" near "Quiz 1" in the app
Then I should see "Text of the first question"
But I should not see "Text of the second question"
When I press "Next" near "Question 1" in the app
And I press "Next" near "Quiz 1" in the app
Then I should see "Summary of attempt"
When I press "Return to attempt" in the app
Then I should see "Text of the second question"
But I should not see "Text of the first question"
When I press "Next" in the app
And I press "Submit all and finish" in the app
Then I should see "Once you submit"
When I press "Cancel" near "Once you submit" in the app
Then I should see "Summary of attempt"
When I press "Submit all and finish" in the app
And I press "OK" near "Once you submit" in the app
Then I should see "Review of attempt 1"
And I should see "Started on"
And I should see "State"
And I should see "Completed on"
And I should see "Time taken"
And I should see "Marks"
And I should see "Grade"
And I should see "Question 1"
And I should see "Question 2"
@app @3.8.0
Scenario: Attempt a quiz (all question types)
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Quiz 2" in the app
And I press "Attempt quiz now" in the app
And I press "Four" in the app
And I press "Three" in the app
And I press "Next" near "Question 1" in the app
And I set the field "Answer" to "testing" in the app
And I press "Next" near "Question 2" in the app
And I set the field "Answer" to "5" in the app
And I press "Next" near "Question 3" in the app
And I set the field "Answer" to "Testing an essay" in the app
And I press "Next" near "Question 4" in the app
And I press "lazy" in the app
And I press "Next" near "Question 5" in the app
And I press "True" in the app
And I press "Next" near "Question 6" in the app
And I press "Choose..." near "frog" in the app
And I press "amphibian" in the app
And I press "Choose..." near "newt" in the app
And I press "insect" in the app
And I press "Choose..." near "cat" in the app
And I press "mammal" in the app
And I press "Next" near "Question 7" in the app
And I press "Submit all and finish" in the app
And I press "OK" in the app
Then I should see "Review of attempt 1"
And I should see "Finished"
And I should see "Not yet graded"
@app @3.8.0
Scenario: Submit a quiz and review a quiz attempt
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Quiz 1" in the app
And I press "Attempt quiz now" in the app
And I press "True" in the app
And I press "Next" near "Question 1" in the app
And I press "False" in the app
And I press "Next" near "Question 2" in the app
And I press "Submit all and finish" in the app
And I press "OK" in the app
Then I should see "Review of attempt 1"
When I enter the app
And I log in as "teacher1"
And I press "Course 1" near "Course overview" in the app
And I press "Quiz 1" in the app
And I press "Display options" in the app
And I press "Open in browser" in the app
And I switch to the browser tab opened by the app
And I log in as "teacher1"
And I follow "Attempts: 1"
And I follow "Review attempt"
Then I should see "Finished"
And I should see "1.00/2.00"

View File

@ -0,0 +1,398 @@
@mod @mod_survey @app @javascript
Feature: Test basic usage of survey activity in app
In order to participate in surveys while using the mobile app
As a student
I need basic survey functionality to work
Background:
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "users" exist:
| username |
| student1 |
| teacher1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | name | intro | course | idnumber | groupmode |
| survey | Test survey name | Test survey | C1 | survey | 0 |
@app @3.8.0
Scenario: Student answers a survey ATTLS and see results
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test survey name" in the app
And I press "Choose" near "1. In evaluating what someone says, I focus on the quality of their argument, not on the person who's presenting it." in the app
And I press "Strongly agree" in the app
And I press "Choose" near "2. I like playing devil's advocate - arguing the opposite of what someone is saying." in the app
And I press "Strongly disagree" in the app
And I press "Choose" near "3. I like to understand where other people are 'coming from', what experiences have led them to feel the way they do." in the app
And I press "Somewhat agree" in the app
And I press "Choose" near "4. The most important part of my education has been learning to understand people who are very different to me." in the app
And I press "Somewhat disagree" in the app
And I press "Choose" near "5. I feel that the best way for me to achieve my own identity is to interact with a variety of other people." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "6. I enjoy hearing the opinions of people who come from backgrounds different to mine - it helps me to understand how the same things can be seen in such different ways." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "7. I find that I can strengthen my own position through arguing with someone who disagrees with me." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "8. I am always interested in knowing why people say and believe the things they do." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "9. I often find myself arguing with the authors of books that I read, trying to logically figure out why they're wrong." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "10. It's important for me to remain as objective as possible when I analyze something." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "11. I try to think with people instead of against them." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "12. I have certain criteria I use in evaluating arguments." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "13. I'm more likely to try to understand someone else's opinion than to try to evaluate it." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "14. I try to point out weaknesses in other people's thinking to help them clarify their arguments." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "15. I tend to put myself in other people's shoes when discussing controversial issues, to see why they think the way they do." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "16. One could call my way of analysing things 'putting them on trial' because I am careful to consider all the evidence." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "17. I value the use of logic and reason over the incorporation of my own concerns when solving problems." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "18. I can obtain insight into opinions that differ from mine through empathy." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "19. When I encounter people whose opinions seem alien to me, I make a deliberate effort to 'extend' myself into that person, to try to see how they could have those opinions." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Choose" near "20. I spend time figuring out what's 'wrong' with things. For example, I'll look for something in a literary interpretation that isn't argued well enough." in the app
And I press "Somewhat agree" near "Neither agree nor disagree" in the app
And I press "Submit" in the app
And I press "OK" in the app
And I press "open" in the app
And I switch to the browser tab opened by the app
And I log in as "student1"
Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages."
And I should see "1 people have completed this survey so far"
@app @3.8.0
Scenario: Student answers a survey of critical incidents and see results
Given the following "activities" exist:
| activity | name | intro | template |course | idnumber | groupmode |
| survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 |
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" 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
Then I should see "Results"
When I press "Results" in the app
And I switch to the browser tab opened by the app
And I log in as "student1"
Then I should see "Test survey critical incidents"
@app @3.8.0
Scenario: Student answers a survey of Colles (actual) and see results
Given the following "activities" exist:
| activity | name | intro | template |course | idnumber | groupmode |
| survey | Test survey Colles (actual) | Test survey1 | 1 | C1 | survey1 | 0 |
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test survey Colles (actual)" in the app
And I press "Choose" near "1. my learning focuses on issues that interest me." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "2. what I learn is important for my professional practice." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "3. I learn how to improve my professional practice." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "4. what I learn connects well with my professional practice." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "5. I think critically about how I learn." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "6. I think critically about my own ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "7. I think critically about other students' ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "8. I think critically about ideas in the readings." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "9. I explain my ideas to other students." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "10. I ask other students to explain their ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "11. other students ask me to explain my ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "12. other students respond to my ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "13. the tutor stimulates my thinking." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "14. the tutor encourages me to participate." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "15. the tutor models good discourse." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "16. the tutor models critical self-reflection." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "17. other students encourage my participation." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "18. other students praise my contribution." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "19. other students value my contribution." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "20. other students empathise with my struggle to learn." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "21. I make good sense of other students' messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "22. other students make good sense of my messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "23. I make good sense of the tutor's messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "24. the tutor makes good sense of my messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "25. How long did this survey take you to complete?" in the app
And I press "under 1 min" in the app
And I press "Submit" in the app
And I press "OK" in the app
Then I should see "You have completed this survey"
When I press "Results" in the app
And I switch to the browser tab opened by the app
And I log in as "student1"
Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages."
And I should see "1 people have completed this survey so far"
@app @3.8.0
Scenario: Student answers a survey of Colles (preferred) and see results
Given the following "activities" exist:
| activity | name | intro | template | course | idnumber | groupmode |
| survey | Test survey Colles (preferred) | Test survey1 | 2 | C1 | survey1 | 0 |
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test survey Colles (preferred)" in the app
And I press "Choose" near "1. my learning focuses on issues that interest me." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "2. what I learn is important for my professional practice." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "3. I learn how to improve my professional practice." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "4. what I learn connects well with my professional practice." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "5. I think critically about how I learn." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "6. I think critically about my own ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "7. I think critically about other students' ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "8. I think critically about ideas in the readings." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "9. I explain my ideas to other students." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "10. I ask other students to explain their ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "11. other students ask me to explain my ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "12. other students respond to my ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "13. the tutor stimulates my thinking." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "14. the tutor encourages me to participate." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "15. the tutor models good discourse." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "16. the tutor models critical self-reflection." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "17. other students encourage my participation." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "18. other students praise my contribution." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "19. other students value my contribution." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "20. other students empathise with my struggle to learn." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "21. I make good sense of other students' messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "22. other students make good sense of my messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "23. I make good sense of the tutor's messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "24. the tutor makes good sense of my messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "25. How long did this survey take you to complete?" in the app
And I press "under 1 min" in the app
And I press "Submit" in the app
And I press "OK" in the app
Then I should see "You have completed this survey"
When I press "Results" in the app
And I switch to the browser tab opened by the app
And I log in as "student1"
Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages."
And I should see "1 people have completed this survey so far"
@app @3.8.0
Scenario: Student answers a survey of Colles (preferred and actual) and see results
Given the following "activities" exist:
| activity | name | intro | template | course | idnumber | groupmode |
| survey | Test survey Colles (preferred and actual) | Test survey1 | 3 | C1 | survey1 | 0 |
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test survey Colles (preferred and actual)" in the app
And I press "Choose" near "1. I prefer that my learning focuses on issues that interest me." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "2. I found that my learning focuses on issues that interest me." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "3. I prefer that what I learn is important for my professional practice." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "4. I found that what I learn is important for my professional practice." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "5. I prefer that I learn how to improve my professional practice." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "6. I found that I learn how to improve my professional practice." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "7. I prefer that what I learn connects well with my professional practice." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "8. I found that what I learn connects well with my professional practice." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "9. I prefer that I think critically about how I learn." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "10. I found that I think critically about how I learn." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "11. I prefer that I think critically about my own ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "12. I found that I think critically about my own ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "13. I prefer that I think critically about other students' ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "14. I found that I think critically about other students' ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "15. I prefer that I think critically about ideas in the readings." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "16. I found that I think critically about ideas in the readings." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "17. I prefer that I explain my ideas to other students." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "18. I found that I explain my ideas to other students." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "19. I prefer that I ask other students to explain their ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "20. I found that I ask other students to explain their ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "21. I prefer that other students ask me to explain my ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "22. I found that other students ask me to explain my ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "23. I prefer that other students respond to my ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "24. I found that other students respond to my ideas." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "25. I prefer that the tutor stimulates my thinking." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "26. I found that the tutor stimulates my thinking." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "27. I prefer that the tutor encourages me to participate." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "28. I found that the tutor encourages me to participate." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "29. I prefer that the tutor models good discourse." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "30. I found that the tutor models good discourse." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "31. I prefer that the tutor models critical self-reflection." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "32. I found that the tutor models critical self-reflection." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "33. I prefer that other students encourage my participation." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "34. I found that other students encourage my participation." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "35. I prefer that other students praise my contribution." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "36. I found that other students praise my contribution." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "37. I prefer that other students value my contribution." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "38. I found that other students value my contribution." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "39. I prefer that other students empathise with my struggle to learn." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "40. I found that other students empathise with my struggle to learn." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "41. I prefer that I make good sense of other students' messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "42. I found that I make good sense of other students' messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "43. I prefer that other students make good sense of my messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "44. I found that other students make good sense of my messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "45. I prefer that I make good sense of the tutor's messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "46. I found that I make good sense of the tutor's messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "47. I prefer that the tutor makes good sense of my messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "48. I found that the tutor makes good sense of my messages." in the app
And I press "Sometimes" near "Often" in the app
And I press "Choose" near "49. How long did this survey take you to complete?" in the app
And I press "1-2 min" in the app
And I press "Submit" in the app
And I press "OK" in the app
Then I should see "You have completed this survey"
When I press "Results" in the app
And I switch to the browser tab opened by the app
And I log in as "student1"
Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages."
And I should see "1 people have completed this survey so far"
@app @3.8.0
Scenario: Student answers a survey offline and sync survey
Given the following "activities" exist:
| activity | name | intro | template | course | idnumber | groupmode |
| survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 |
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Test survey critical incidents" in the app
And I switch offline mode to "true"
And I press "Submit" in the app
And I press "OK" in the app
Then I should see "This Survey has offline data to be synchronised."
When I switch offline mode to "false"
And I press the back button in the app
And I press "Test survey critical incidents" in the app
And I press "Display options" in the app
And I press "Refresh" in the app
Then I should see "Results"
And I should see "You have completed this survey."
But I should not see "This Survey has offline data to be synchronised."
@app @3.8.0
Scenario: Prefetch and auto-sync
Given the following "activities" exist:
| activity | name | intro | template | course | idnumber | groupmode |
| survey | Test survey critical incidents | Test survey1 | 5 | C1 | survey1 | 0 |
When I enter the app
And I log in as "student1"
And I press "Course 1" near "Course overview" in the app
And I press "Display options" in the app
And I press "Show download options" in the app
And I press "cloud download" near "Test survey critical incidents" in the app
And I switch offline mode to "true"
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 press "Test survey critical incidents" in the app
And I press "Submit" in the app
And I press "OK" in the app
Then I should see "This Survey has offline data to be synchronised."
When I switch offline mode to "false"
And I run cron tasks in the app
Then I should not see "This Survey has offline data to be synchronised."
And I should see "You have completed this survey."

View File

@ -0,0 +1,100 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Behat step definitions.
*
* @package local_apps
* @copyright 2010 Moodle Pty Ltd (http://moodle.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
use Behat\Mink\Exception\ExpectationException;
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
require_once(__DIR__ . '/../../../../lib/behat/behat_base.php');
/**
* Behat step definitions.
*
* @package local_apps
* @copyright 2010 Moodle Pty Ltd (http://moodle.com)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class behat_local_moodlemobileapp extends behat_base {
/**
* Force cron tasks instead of waiting for the next scheduled execution.
*
* @When /^I run cron tasks in the app$/
*/
public function i_run_cron_tasks_in_the_app() {
$session = $this->getSession();
// Force cron tasks execution and wait until they are completed.
$operationid = random_string();
$session->evaluateScript(
"cronProvider.forceSyncExecution().then(() => { window['behat_{$operationid}_completed'] = true; });"
);
$this->spin(
function() use ($session, $operationid) {
return $session->evaluateScript("window['behat_{$operationid}_completed'] || false");
},
false,
60,
new ExpectationException('Forced cron tasks in the app took too long to complete', $session)
);
// Trigger Angular digest cycle multiple times in case some changes have
// side-effects that result in further pending operations.
for ($ticks = 5; $ticks > 0; $ticks--) {
$session->evaluateScript('appRef.tick();');
}
}
/**
* Wait until loading has finished.
*
* @When /^I wait loading to finish in the app$/
*/
public function i_wait_loading_to_finish_in_the_app() {
$session = $this->getSession();
$this->spin(
function() use ($session) {
$session->evaluateScript('appRef.tick();');
$nodes = $this->find_all('css', 'core-loading ion-spinner');
foreach ($nodes as $node) {
if (!$node->isVisible()) {
continue;
}
return false;
}
return true;
},
false,
60,
new ExpectationException('"Loading took too long to complete', $session)
);
}
}