MOBILE-3296 behat: Behat basic test for choice

main
David Castellón 2019-12-13 12:16:40 +01:00
parent ca18c677e2
commit a9da44ebeb
6 changed files with 1 additions and 315 deletions

View File

@ -1,63 +0,0 @@
@mod @mod_choice @app @javascript
Feature: Test basic usage in app
In order to participate in the choice while using the mobile app
As a student
I need basic choice functionality to work
Background:
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "users" exist:
| username |
| teacher1 |
| student1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
Scenario: Student sends their single choice
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 press "Option 2" in the app
And I press "Save my choice" in the app
And I should see "Are you sure"
And I press "OK" in the app
Then I should see "Option 1: 0"
And I should see "Option 2: 1"
And I should see "Option 3: 0"
And I should not see "Remove my choice"
Scenario: Student sends, changes and remove their multi choice
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 |
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 multi choice name" in the app
And I press "Option 1" in the app
And I press "Option 2" in the app
And I press "Save my choice" in the app
Then I should see "Option 1: 1"
And I should see "Option 2: 1"
And I should see "Option 3: 0"
And I should see "Remove my choice"
And I press "Option 1" in the app
And I press "Option 3" in the app
And I press "Save my choice" in the app
And I should see "Option 1: 0"
And I should see "Option 2: 1"
And I should see "Option 3: 1"
And I press "Remove my choice" in the app
And I should see "Are you sure"
And I press "OK" in the app
And I should not see "Remove my choice"
And I should see "The results are not currently viewable"

View File

@ -1,63 +0,0 @@
@mod @mod_choice @app @javascript
Feature: Test basic usage in app
In order to participate in the choice while using the mobile app
As a student
I need basic choice functionality to work
Background:
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "users" exist:
| username |
| teacher1 |
| student1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
Scenario: Student sends their single choice
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 press "Option 2" in the app
And I press "Save my choice" in the app
And I should see "Are you sure"
And I press "OK" in the app
Then I should see "Option 1: 0"
And I should see "Option 2: 1"
And I should see "Option 3: 0"
And I should not see "Remove my choice"
Scenario: Student sends, changes and remove their multi choice
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 |
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 multi choice name" in the app
And I press "Option 1" in the app
And I press "Option 2" in the app
And I press "Save my choice" in the app
Then I should see "Option 1: 1"
And I should see "Option 2: 1"
And I should see "Option 3: 0"
And I should see "Remove my choice"
And I press "Option 1" in the app
And I press "Option 3" in the app
And I press "Save my choice" in the app
And I should see "Option 1: 0"
And I should see "Option 2: 1"
And I should see "Option 3: 1"
And I press "Remove my choice" in the app
And I should see "Are you sure"
And I press "OK" in the app
And I should not see "Remove my choice"
And I should see "The results are not currently viewable"

View File

@ -25,7 +25,7 @@ Feature: Test basic usage in app
| choice | Choice name | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 | | choice | Choice name | Test choice description | C1 | choice1 | Option 1, Option 2, Option 3 |
@3.8.0 @OK @3.8.0 @OK
Scenario: Student sends their single choice, views results and sync. Scenario: Student sends their single choice and views 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 |
@ -42,14 +42,11 @@ 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 not see "Remove my choice" And I should not see "Remove my choice"
And I pause
And I press "arrow back" in the app And I press "arrow back" in the app
And I press "Test single choice name" in the app And I press "Test single choice name" in the app
And I should see "Option 1: 0" And 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
And I pause
@3.8.0 @OK @3.8.0 @OK
Scenario: Student sends, changes and remove their multi choice Scenario: Student sends, changes and remove their multi choice
@ -104,4 +101,3 @@ Feature: Test basic usage in app
And I press "Download in text format" And I press "Download in text format"
And I close the browser tab opened by the app And I close the browser tab opened by the app

View File

@ -1,46 +0,0 @@
@mod @mod_data @app @javascript
Feature: Trying options moodle mobile
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
| teacher1 | Teacher | 1 | teacher1@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 |
And the following "activities" exist:
| activity | name | intro | course | idnumber |
| data | Web links | Useful links | C1 | data1 |
Scenario: Teacher create an event
When I enter the app
And I log in as "teacher1"
And I press "calendar" in the app
And I press "close" in the app
And I set the field "name" to "Holidays!"
And I press "No selection" in the app
And I press "Course 1" in the app
Then I press "Show more..." in the app
And I set the field "location" to "Moodle"
And I press "Save" in the app
Scenario: Student change his moodle language
When I enter the app
And I log in as "student1"
And I press "more" near "Timeline" in the app
And I press "App settings" in the app
And I press "General" in the app
And I press "Language" in the app
And I press "Español" in the app
And I pause
And I press "Text size" in the app
And I pause

View File

@ -1,68 +0,0 @@
@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 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
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 |
@app_upto3.7.0
Scenario: Next and previous navigation in the 3.6 app
Given I enter the app
And I log in as "student1"
When 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"
And I should not see "Text of the second question"
And I press "Next" near "Question 1" in the app
And I should see "Text of the second question"
And I should not see "Text of the first question"
And I press "Previous" near "Question 2" in the app
And I should not see "Text of the second question"
And I should see "Text of the first question"
And I press "Next" near "Quiz 1" in the app
And I should see "Text of the second question"
And I should not see "Text of the first question"
And I press "Previous" near "Quiz 1" in the app
And I should not see "Text of the second question"
And I should see "Text of the first question"
And I press "Next" near "Question 1" in the app
And I press "Next" near "Quiz 1" in the app
And I should see "Summary of attempt"
And I press "Return to attempt" in the app
And I should see "Text of the second question"
And I should not see "Text of the first question"
And I press "Next" in the app
And I press "Submit all and finish" in the app
And I should see "Once you submit"
And I press "Cancel" near "Once you submit" in the app
And I should see "Summary of attempt"
And I press "Submit all and finish" in the app
And I press "OK" near "Once you submit" in the app
And I should see "Review"
And I press "home" in the app
And I should see "Acceptance test site"

View File

@ -1,70 +0,0 @@
@mod @mod_quiz @app @javascript
Feature: Trying quizzes in app
As a student
In order to demonstrate what I know
I need to be able to attempt quizzes
As a teacher
I need to see the results
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 | teacher |
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 |
@app_from3.7.1
Scenario: Student attempt a quiz in app and teacher see the results.
Given I enter the app
And I log in as "student1"
When 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"
And I should not see "Text of the second question"
And I press "True" in the app
And I press "Next" near "Question 1" in the app
And I should see "Text of the second question"
And I should not see "Text of the first question"
And I press "False" in the app
And I press "Clear my choice" in the app
And I press "True" in the app
And I press "Next" in the app
And I press "Submit all and finish" in the app
And I should see "OK"
And I press "OK" in the app
And I should see "Review"
Given I enter the app
And I log in as "teacher1"
When I press "Course 1" near "Course overview" in the app
And I press "Quiz 1" in the app
And I press "Information" 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 "Results"
And I press "Download"
And I pause
And I close the browser tab opened by the app