MOBILE-3320 behat: Update courses tests
parent
6a01f84ed5
commit
7180158004
|
@ -1,4 +1,4 @@
|
||||||
@mod @mod_courses @app @app_upto3.9.4 @javascript
|
@mod @mod_courses @app @javascript
|
||||||
Feature: Test basic usage of courses in app
|
Feature: Test basic usage of courses in app
|
||||||
In order to participate in the courses while using the mobile app
|
In order to participate in the courses while using the mobile app
|
||||||
As a student
|
As a student
|
||||||
|
@ -34,81 +34,77 @@ Feature: Test basic usage of courses in app
|
||||||
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled |
|
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled |
|
||||||
| assign | C1 | assign1 | assignment | Test assignment description | 1 |
|
| assign | C1 | assign1 | assignment | Test assignment description | 1 |
|
||||||
|
|
||||||
@app @3.8.0
|
|
||||||
Scenario: "Dashboard" tab displayed in >= 3.3 sites
|
Scenario: "Dashboard" tab displayed in >= 3.3 sites
|
||||||
When I enter the app
|
When I enter the app
|
||||||
And I log in as "student1"
|
And I log in as "student1"
|
||||||
Then I should see "Dashboard"
|
Then I should see "Dashboard"
|
||||||
And the header should be "Acceptance test site" in the app
|
And the header should be "Acceptance test site" in the app
|
||||||
And I should see "Course 1"
|
And I should find "Course 1" in the app
|
||||||
And I should see "Course 2"
|
And I should find "Course 2" in the app
|
||||||
And I should see "Course 3"
|
And I should find "Course 3" in the app
|
||||||
|
|
||||||
When I press "Site home" in the app
|
When I press "Site home" in the app
|
||||||
Then I should see "Dashboard"
|
Then I should find "Dashboard" in the app
|
||||||
And the header should be "Acceptance test site" in the app
|
And the header should be "Acceptance test site" in the app
|
||||||
|
|
||||||
When I press "Dashboard" in the app
|
When I press "Dashboard" in the app
|
||||||
Then I should see "Course 1"
|
Then I should find "Course 1" in the app
|
||||||
And I should see "Course 2"
|
And I should find "Course 2" in the app
|
||||||
And I should see "Course 3"
|
And I should find "Course 3" in the app
|
||||||
|
|
||||||
@app @3.8.0
|
|
||||||
Scenario: See my courses
|
Scenario: See my courses
|
||||||
When I enter the app
|
When I enter the app
|
||||||
And I log in as "student1"
|
And I log in as "student1"
|
||||||
Then the header should be "Acceptance test site" in the app
|
Then the header should be "Acceptance test site" in the app
|
||||||
And I should see "Course 1"
|
And I should find "Course 1" in the app
|
||||||
And I should see "Course 2"
|
And I should find "Course 2" in the app
|
||||||
And I should see "Course 3"
|
And I should find "Course 3" in the app
|
||||||
|
|
||||||
When I press "Course 1" near "Recently accessed courses" in the app
|
When I press "Course 1" near "Recently accessed courses" in the app
|
||||||
Then I should see "Choice course 1"
|
Then I should find "Choice course 1" in the app
|
||||||
And the header should be "Course 1" in the app
|
And the header should be "Course 1" in the app
|
||||||
|
|
||||||
When I press "Choice course 1" in the app
|
When I press "Choice course 1" in the app
|
||||||
Then I should see "Test choice description"
|
Then I should find "Test choice description" in the app
|
||||||
And the header should be "Choice course 1" in the app
|
And the header should be "Choice course 1" in the app
|
||||||
|
|
||||||
When I press the back button in the app
|
When I press the back button in the app
|
||||||
And I press the back button in the app
|
And I press the back button in the app
|
||||||
And I press "Course 2" near "Recently accessed courses" in the app
|
And I press "Course 2" near "Recently accessed courses" in the app
|
||||||
Then I should see "Choice course 2"
|
Then I should find "Choice course 2" in the app
|
||||||
And the header should be "Course 2" in the app
|
And the header should be "Course 2" in the app
|
||||||
|
|
||||||
When I press the back button in the app
|
When I press the back button in the app
|
||||||
And I press "Course 3" near "Recently accessed courses" in the app
|
And I press "Course 3" near "Recently accessed courses" in the app
|
||||||
Then I should see "Choice course 3"
|
Then I should find "Choice course 3" in the app
|
||||||
And the header should be "Course 3" in the app
|
And the header should be "Course 3" in the app
|
||||||
|
|
||||||
@app @3.8.0
|
|
||||||
Scenario: Search for a course
|
Scenario: Search for a course
|
||||||
When I enter the app
|
When I enter the app
|
||||||
And I log in as "student1"
|
And I log in as "student1"
|
||||||
And I press "Search courses" in the app
|
And I press "Search courses" in the app
|
||||||
And I set the field "Search" to "Course 4" in the app
|
And I set the field "Search" to "Course 4" in the app
|
||||||
And I press "Search" in the app
|
And I press "Search" "button" in the app
|
||||||
Then I should see "Course 4"
|
Then I should find "Course 4" in the app
|
||||||
And the header should be "Search courses" in the app
|
And the header should be "Search courses" in the app
|
||||||
|
|
||||||
When I press "Course 4" in the app
|
When I press "Course 4" in the app
|
||||||
Then I should see "Course 4"
|
Then I should find "Course 4" in the app
|
||||||
And the header should be "Course 4" in the app
|
And the header should be "Course 4" in the app
|
||||||
|
|
||||||
When I press the back button 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 set the field "Search" to "Course" in the app
|
||||||
And I press "Search" in the app
|
And I press "Search" "button" in the app
|
||||||
Then I should see "Course 1"
|
Then I should find "Course 1" in the app
|
||||||
And I should see "Course 2"
|
And I should find "Course 2" in the app
|
||||||
And I should see "Course 3"
|
And I should find "Course 3" in the app
|
||||||
And I should see "Course 4"
|
And I should find "Course 4" in the app
|
||||||
|
|
||||||
@app @3.8.0
|
|
||||||
Scenario: Links to actions in Timeline work for teachers/students
|
Scenario: Links to actions in Timeline work for teachers/students
|
||||||
# Configure assignment as teacher
|
# Configure assignment as teacher
|
||||||
When I enter the app
|
When I enter the app
|
||||||
And I log in as "teacher1"
|
And I log in as "teacher1"
|
||||||
Then I should see "Timeline"
|
Then I should find "Timeline" in the app
|
||||||
|
|
||||||
Given I press "Course 1" near "Recently accessed courses" in the app
|
Given I press "Course 1" near "Recently accessed courses" in the app
|
||||||
And I press "assignment" in the app
|
And I press "assignment" in the app
|
||||||
|
@ -129,9 +125,9 @@ Feature: Test basic usage of courses in app
|
||||||
And I log in as "student1"
|
And I log in as "student1"
|
||||||
And I press "Add submission" in the app
|
And I press "Add submission" in the app
|
||||||
Then the header should be "assignment" in the app
|
Then the header should be "assignment" in the app
|
||||||
And I should see "Test assignment description"
|
And I should find "Test assignment description" in the app
|
||||||
And I should see "No attempt"
|
And I should find "No attempt" in the app
|
||||||
And I should see "Due date"
|
And I should find "Due:" in the app
|
||||||
|
|
||||||
When I press "Add submission" in the app
|
When I press "Add submission" in the app
|
||||||
And I set the field "Online text submissions" to "test" in the app
|
And I set the field "Online text submissions" to "test" in the app
|
||||||
|
@ -139,18 +135,18 @@ Feature: Test basic usage of courses in app
|
||||||
And I press "Submit assignment" in the app
|
And I press "Submit assignment" in the app
|
||||||
And I press "OK" in the app
|
And I press "OK" in the app
|
||||||
Then the header should be "assignment" in the app
|
Then the header should be "assignment" in the app
|
||||||
And I should see "Test assignment description"
|
And I should find "Test assignment description" in the app
|
||||||
And I should see "Submitted for grading"
|
And I should find "Submitted for grading" in the app
|
||||||
And I should see "Due date"
|
And I should find "Due:" in the app
|
||||||
|
|
||||||
# Grade assignment as teacher
|
# Grade assignment as teacher
|
||||||
When I enter the app
|
When I enter the app
|
||||||
And I log in as "teacher1"
|
And I log in as "teacher1"
|
||||||
And I press "Grade" in the app
|
And I press "Grade" in the app
|
||||||
Then the header should be "assignment" in the app
|
Then the header should be "assignment" in the app
|
||||||
And I should see "Test assignment description"
|
And I should find "Test assignment description" in the app
|
||||||
And I should see "Time remaining"
|
And I should find "Time remaining" in the app
|
||||||
|
|
||||||
When I press "Needs grading" in the app
|
When I press "Needs grading" in the app
|
||||||
Then I should see "Student student"
|
Then I should find "Student student" in the app
|
||||||
And I should see "Not graded"
|
And I should find "Not graded" in the app
|
||||||
|
|
|
@ -734,7 +734,7 @@
|
||||||
return 'ERROR: No matches for text';
|
return 'ERROR: No matches for text';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
found = findElementsBasedOnText({ text: field, selector: 'input, textarea' })[0];
|
found = findElementsBasedOnText({ text: field, selector: 'input, textarea, [contenteditable="true"]' })[0];
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
return 'ERROR: No matches for text';
|
return 'ERROR: No matches for text';
|
||||||
|
|
Loading…
Reference in New Issue