Skip to content

Commit

Permalink
Merge pull request #2 from jonboiser/gherkins
Browse files Browse the repository at this point in the history
Update gherkins stories for coach reports
  • Loading branch information
khangmach authored May 9, 2019
2 parents 5eac6d8 + fa0a591 commit c947dea
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,28 @@ Feature: Edit lesson details and manage resources from the lesson *Report* tab
And I have created a <lesson> lesson in a class <class>
And the <lesson> lesson contains one or more resources
And the <lesson> lesson is either inactive, or active and assigned to some learner(s)
And I am on the report page for <lesson>

Scenario: Edit lesson details
When I go to *Coach > '<class>' > Reports > Lessons* tab
And I click to open the <lesson> report
Then I see the *Report* sub-tab with <lesson> resources
And I see the *Learners* sub-tab with a list of the learners who have taken the lesson
When I click the *Options* button
Scenario: Lesson details can be edited from the Lesson report page
When I click the *Options* dropdown menu
And I select the *Edit details* option
Then I see a full-screen modal *Edit details for '<lesson>'*
When I finish editing the details of the lesson
Then I see the *Edit details dialogue for '<lesson>'*
And I see form fields for editing the title, description, status, and recipients (in that order)
And I see a *Resources* section where I can reorder, remove, and preview resources in <lesson>
When I edit one or more details of the lesson
And I click *Save changes* button
Then I see the <lesson> *Report* sub-tab again
Then I am returned to the report page for <lesson>
And the changes I made are reflected in the report

Scenario: Manage lesson resources
When I go to *Coach > '<class>' > Reports > Lessons* tab
And I click to open the <lesson> report
Then I see the *Report* sub-tab with <lesson> resources
And I see the *Learners* sub-tab with a list of the learners who have taken the lesson
When I click the *Options* button
Scenario: Lesson resources can be managed (added or removed) from the Lesson report page
When I click the *Options* dropdown menu
And I select the *Manage resources* option
Then I see a full-screen modal *Manage resources in '<lesson>'*
Then I see the *Manage resources in '<lesson>'* dialogue
When I finish adding to or removing resources from the lesson
And I click the *Finish* button
Then I see the <lesson> *Report* sub-tab again
Then I am returned to the report page for <lesson>
And the changes to the resources I made are reflected in the report

Examples:
| class | lesson |
| Explorers | Count 1 |
| Explorers | Count 1 |
75 changes: 31 additions & 44 deletions integration_testing/features/coach/coach-edit-lesson.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,59 +5,46 @@ Feature: Coach edits lessons
Given I am signed in to Kolibri as a coach user
And I am on the *Coach > Plan > Lessons* page
And there are 2 or more learner groups
And there is a lesson <lesson> created previously
And I am on the *Edit Details* dialogue for <lesson> (arriving there from either reports or plan page)

Scenario: Edit existing lesson title
Given there is a lesson <lesson> created previously
When I click the *Options* button
And I select *Edit details*
Then I see the *Edit lesson details* modal
And the title field should be in-focused by default
When I edit the lesson <lesson> *Title* and leave the field
And I click *Save* button
Then the modal closes
And I see the title change under the *Lesson* tab
And I see the snackbar notification “Lesson changes saved”
When I edit the lesson <lesson> *Title* and leave the field
And I click the *Save Changes* button
Then I am returned to either the report or plan page for <lesson> (depending from where I arrived)
And I see the title change under the *Title* header
And I see the snackbar notification “Lesson changes saved”

Scenario: An existing Lesson cannot have its title changed to a title that is already used in the Class
Given There exists a lesson called "Second Lesson"
When I enter "Second Lesson" in the *Title* field
And I either move to a different field or click *Save Changes*
Then an error appears under the title field saying *A lesson with this name already exists*
And the Lesson is not saved (if I clicked *Save Changes*)

Scenario: Edit existing lesson description
Given there is a lesson <lesson> created previously
When I click the *Options* button
And I select *Edit details*
Then I see the *Edit lesson details* modal
When I edit the lesson <lesson> *Description*
And I click *Save* button
Then the modal closes
And I see the description change under the *Lesson* tab
And I see the snackbar notification “Lesson changes saved”
When I edit the lesson <lesson> *Description*
And I click the *Save Changes* button
Then I am returned to either the report or plan page for <lesson> (depending from where I arrived)
And I see the description change under the *Description* header
And I see the snackbar notification “Lesson changes saved”

Scenario: Edit existing lesson status
Given there is a lesson <lesson> created previously
When I click the *Options* button
And I select *Edit details*
Then I see the *Edit lesson details* page
When I edit the lesson status
And I click *Save changes* button
Then the page closes
And I see the status change in the <lesson> page
And I see the snackbar notification “Lesson changes saved”
When I change the lesson status from *Inactive* to *Active* (or vice-versa)
And I click the *Save changes* button
Then I am returned to either the report or plan page for <lesson> (depending from where I arrived)
And I see the status change next to the *Status* header
And I see the snackbar notification “Lesson changes saved”

Scenario: Reassign lesson
Given there is a lesson <lesson> created previously
When I click the lesson title <lesson>
Then I see the <lesson> page
When I click *Options* button
And I select *Edit details*
Then I see the *Edit details for '<lesson>'* full-page modal
When I change *Recipients* by selecting *Entire class* or one of the groups
And I click *Save changes* button
Then the modal closes
# And the snackbar notification appears: No snackbar anymore?
And I see the change under *Recipients*
Scenario: Existing Lessons can be reassigned to different recipient Learner Groups
When I change *Recipients* by selecting *Entire class* or one of the groups
And I click the *Save changes* button
Then I am returned to either the report or plan page for <lesson> (depending from where I arrived)
And the *Recipients* field reflects the changes I made

Scenario: Preview lesson resource
Given there is a lesson <lesson> created previously
When I click the lesson title
Then I see the <lesson> page
When I click the lesson resource title
Given <lesson> has at least one resource
When I click on the link for lesson resource title
Then I see the resource in a full screen page

Examples:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,27 @@ Feature: Previewing and editing a quiz from the *Report* tab
And I am at *Coach > '<class>' > Reports > Quizzes* tab
And there is a <quiz> quiz in a class <class>
And the <quiz> quiz is either inactive, or active and assigned to some learner(s)
And I am on the report page for <quiz>

Scenario: Preview quiz
When I click to open the <quiz> report
Then I see the *Report* sub-tab with the list of learners
And I see the *Difficult questions* sub-tab
When I click the *Options* button
Scenario: Quizzes can be previewed from the report page
When I click the *Options* dropdown menu
And I select the *Preview* option
Then I see a full-screen modal *Preview of quiz '<quiz>'*
And I see the list of <quiz> quiz questions
When I click the *X* button to close the preview
Then I see the <quiz> *Report* sub-tab again
And I see a preview for the first quiz question
When I click the button for a different quiz question
Then I see a preview for that other quiz question

Scenario: Edit quiz
When I click to open the <quiz> report
Then I see the *Report* sub-tab with the list of learners
And I see the *Difficult questions* sub-tab
When I click the *Options* button
Scenario: Quiz details can be edited from the report page
When I click the *Options* dropdown menu
And I select the *Edit details* option
Then I see a full-screen modal *Edit details for '<quiz>'*
And I see form fields for editing the title, status, and recipients (in that order)
When I finish editing the details of the quiz
And I click *Save changes* button
Then I see the <quiz> *Report* sub-tab again
Then I am returned to the report page for <quiz>
And I see the changes I made reflected in the report header

Examples:
| class | quiz |
| Explorers | Count 1 |
| Explorers | Count 1 |

0 comments on commit c947dea

Please sign in to comment.