mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-34375 Choice: Display choice on 'my home'
- Loading branch information
Showing
3 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
@mod @mod_choice @javascript | ||
Feature: Test the display of the choice module on my home | ||
In order to know my status in a choice activity | ||
As a user | ||
I need to see it in My home. | ||
|
||
Background: | ||
Given the following "users" exist: | ||
| username | firstname | lastname | email | | ||
| teacher1 | Teacher | 1 | teacher1@asd.com | | ||
| student1 | Student | 1 | student1@asd.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 I log in as "teacher1" | ||
And I follow "Course 1" | ||
And I turn editing mode on | ||
And I add a "Choice" to section "1" | ||
And I expand all fieldsets | ||
And I click on "id_timerestrict" "checkbox" | ||
And I set the following fields to these values: | ||
| Choice name | Test choice name | | ||
| Description | Test choice description | | ||
| timeclose[day] | 1 | | ||
| timeclose[month] | January | | ||
| timeclose[year] | 2030 | | ||
| timeclose[hour] | 08 | | ||
| timeclose[minute] | 00 | | ||
| Allow choice to be updated | No | | ||
| option[0] | Option 1 | | ||
| option[1] | Option 2 | | ||
And I press "Save and return to course" | ||
And I log out | ||
|
||
@javascript | ||
Scenario: View my home as a student before answering the choice | ||
Given I log in as "student1" | ||
When I click on "My home" "link" in the "Navigation" "block" | ||
Then I should see "You have Choices that need attention" | ||
And I click on ".collapsibleregioncaption" "css_element" | ||
And I should see "Not answered yet" | ||
And I log out | ||
|
||
Scenario: View my home as a student after answering the choice | ||
Given I log in as "student1" | ||
And I follow "Course 1" | ||
And I choose "Option 1" from "Test choice name" choice activity | ||
And I should see "Your selection: Option 1" | ||
And I should see "Your choice has been saved" | ||
And "Save my choice" "button" should not exist | ||
When I click on "My home" "link" in the "Navigation" "block" | ||
Then I should not see "You have Choices that need attention" | ||
And I log out | ||
|
||
@javascript | ||
Scenario: View my home as a teacher | ||
Given I log in as "student1" | ||
And I follow "Course 1" | ||
And I choose "Option 1" from "Test choice name" choice activity | ||
And I should see "Your selection: Option 1" | ||
And I should see "Your choice has been saved" | ||
And "Save my choice" "button" should not exist | ||
And I log out | ||
When I log in as "teacher1" | ||
And I click on "My home" "link" in the "Navigation" "block" | ||
Then I should see "You have Choices that need attention" | ||
And I click on ".collapsibleregioncaption" "css_element" | ||
And I should see "View 1 responses" | ||
And I log out |