Skip to content

Commit

Permalink
Added improvements to Gherkin scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
radinamatic committed May 8, 2019
1 parent ae96bcd commit 7b709e0
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 94 deletions.
10 changes: 5 additions & 5 deletions integration_testing/features/coach/coach-create-quiz.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Feature: Coach creates quizzes
When I don't input anything into the number field
And I leave the input field or attempt to continue or finish the quiz
Then an input validation error appears
# This is not working right, quiz is saved even if the number of questions is left empty
When I input a valid number
Then I don't see the validation error anymore

Expand Down Expand Up @@ -185,9 +184,10 @@ Feature: Coach creates quizzes
Given I am on *Create new quiz* page
And there are no validation errors
When I click “Continue”
Then I see a *Preview quiz* page with a question list pulled randomly from each exercise
When I click on *Randomize questions* button
Then I see the modal is refreshed with reordered randomized question list
Then I see a *Preview quiz* page
And I see the *Question order* is by default *Randomized*, with a questions displayed as a list pulled randomly from selected exercises
When I select *Fixed* radio button
Then I see the order of questions is refreshed, and questions are displayed as a numbered list.

Scenario: Check validation for the title field
When I try to enter a name with more than 100 characters
Expand All @@ -203,7 +203,7 @@ Feature: Coach creates quizzes
And I see the quiz on the list at *Coach > Plan > Quizzes* tab

Scenario: Save quiz
Given I am on *Create new quiz* page
Given I am on *Preview quiz* page
And there are no validation errors
When I click “Finish”
Then I am redirected to the *Coach > Plan > Quizzes* page
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
# START testing this scenario with a FRESH DB (make a copy of the current if you want to reuse it later), and use the `kolibri manage importusers your-csv-file.csv` command to import a set of users for this case.

Feature: Edit lesson details from its lesson report page
Class coaches and normal coaches are able to preview quizzes they create in the plan tab
Feature: Edit lesson details and manage resources from the lesson *Report* tab
Class and facility coaches need to be able to edit details and manage resources directly from the *Report* tab

Background:
Given I have finished creating a '<lesson>' Lesson A
And I am signed in to Kolibri as a <class coach> or <coach>
And the lesson can be inactive or active and assigned to anyone
Given I am signed in to Kolibri as a class or facility coach
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)

Scenario: Edit lesson details from its report page
When as as a coach I go to Coach and click into the 'Reports' tab
Then I click into Lesson A report
Then I should see a sub-tab with Lesson A's resources
And I should see a sub-tab with a list of the learners who have taken the lesson
When I click the 'options' dropdown button
And I click the 'Edit details' option
Then I should be redirected to a full-screen modal with editable form fields
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
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
And I click *Save changes* button
Then I see the <lesson> *Report* sub-tab again

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
And I select the *Manage resources* option
Then I see a full-screen modal *Manage resources in '<lesson>'*
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

Feature: Manage lesson resources from its lesson report page
Class coaches and normal coaches are able to preview quizzes they create in the plan tab

Background:
Given I have finished creating a '<lesson>' Lesson A
And Lesson A contains one or more resources
And I am signed in to Kolibri as a <class coach> or <coach>
And the lesson can be inactive or active and assigned to anyone

Scenario: Manage lesson resources from its report page
When as as a coach I go to Coach and click into the 'Reports' tab
Then I click into Lesson A report
Then I should see a sub-tab with Lesson A's resources
And I should see a sub-tab with a list of the learners who have taken the lesson
When I click the 'options' dropdown button
And I click the 'Manage resources' option
Then I should be redirected to a full-screen modal with a resource selection tree
Examples:
| class | lesson |
| Explorers | Count 1 |
18 changes: 9 additions & 9 deletions integration_testing/features/coach/coach-edit-lesson.feature
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Feature: Coach edits lessons
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 title and leave the field
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
Expand All @@ -23,7 +23,7 @@ Feature: Coach edits lessons
When I click the *Options* button
And I select *Edit details*
Then I see the *Edit lesson details* modal
When I edit the lesson description
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
Expand All @@ -46,12 +46,12 @@ Feature: Coach edits lessons
Then I see the <lesson> page
When I click *Options* button
And I select *Edit details*
Then I see the *Edit lesson details* modal
When I change *Visible to* by selecting *Entire class* or one of the groups
And I click *Save* button
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
And I see the change under *Visible to*
# And the snackbar notification appears: No snackbar anymore?
And I see the change under *Recipients*

Scenario: Preview lesson resource
Given there is a lesson <lesson> created previously
Expand All @@ -61,5 +61,5 @@ Feature: Coach edits lessons
Then I see the resource in a full screen page

Examples:
| title | description |
| First lesson | Fractions 1 |
| lesson |
| First lesson |
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
# START testing this scenario with a FRESH DB (make a copy of the current if you want to reuse it later), and use the `kolibri manage importusers your-csv-file.csv` command to import a set of users for this case.

Feature: Previewing a quiz from the plan tab
Class coaches and normal coaches are able to preview quizzes they create in the plan tab

Background:
Given I have finished creating a '<quiz>' Quiz A
And I am signed in to Kolibri as a <class coach> or <coach>
And the quiz can be inactive or active and assigned to anyone

Scenario: Preview Quiz A from the plan tab
When as as a coach I go to Coach and click into the 'Plan' tab
Then I click into Quiz A report
Then I should see a a page with the Quiz A's details
And I should see a list of Quiz A's questions and a preview of each question
And I should see a dropdown button with options 'Edit Quiz', 'Copy Quiz', 'Delete'
Feature: Previewing and editing a quiz from the *Report* tab
Class and facility coaches need to be able to preview and edit details for quizzes directly from the *Report* tab

Background:
Given I am signed in to Kolibri as a class or facility coach
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)

Feature: Quick-edit a quiz from a quiz report page
Class coaches and normal coaches are able to preview and edit quizzes via a shortcut in the quiz report. This saves them time navigating back to the Plan tab
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
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

Background:
Given I have a created '<quiz>' Quiz A
And I am signed in to Kolibri as a <class coach> or <coach>
And the quiz can be inactive or active and assigned to anyone
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
And I select the *Edit details* option
Then I see a full-screen modal *Edit details for '<quiz>'*
When I finish editing the details of the quiz
And I click *Save changes* button
Then I see the <quiz> *Report* sub-tab again

Scenario: Shortcut edit Quiz A from its report
When I click into the Reports tab
And I click into the 'Quizzes' sub-tab
Then I click into Quiz A report
And I should see a dropdown button with options 'Preview' and 'Edit details'
When I click 'Preview'
Then I should see a list of Quiz A's questions
When I click "Edit details"
Then I should be redirected to a full-screen modal with editable form fields
Examples:
| class | quiz |
| Explorers | Count 1 |
38 changes: 16 additions & 22 deletions integration_testing/features/coach/coach-edit-quiz.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,40 @@ Feature: Coach edits quizzes

Background:
Given I am signed in to Kolibri as a coach user
And I am on the *Coach > Plan > Quizzes* page
And there is a quiz <quiz> created previously
And I am on the *Coach > Plan > Quizzes > '<quiz>'* page
And I see the quiz preview with the correct answers of the questions

Scenario: Edit existing quiz title
Given there is a quiz <quiz> created previously
When I click the *Options* button
And I select *Edit details*
Then I see the *Edit quiz details* modal
Then I see the full-page *Edit quiz details for '<quiz>'* modal
And the title field should be focused by default
When I edit the quiz title and leave the field
And I click *Save* button
And I click *Save changes* button
Then the modal closes
And I see the title change under the *quiz* tab
And I see the snackbar notification *Changes to quiz saved*
And I see the title change
# And I see the snackbar notification *Changes to quiz saved*: No snackbar anymore?

Scenario: Edit existing quiz status
Given there is a quiz <quiz> created previously
When I click the *Options* button
And I select *Edit details*
Then I see the *Edit quiz details* page
Then I see the full-page *Edit quiz details for '<quiz>'* modal
When I edit the quiz status
And I click *Save changes* button
Then the page closes
Then the modal closes
And I see the status change in the <quiz> page
And I see the snackbar notification “Quiz changes saved”

Scenario: Preview an existing quiz
Given there is a quiz <quiz> created previously
When I click the quiz name
Then I see the quiz preview
And I can see all the correct answers of the questions
# And I see the snackbar notification “Quiz changes saved”: No snackbar anymore?

Scenario: Reassign quiz
When I click *Options* button
When I click the *Options* button
And I select *Edit details*
Then I see the *Edit quiz details* modal
When I change *Visible to* by selecting *Entire class* or one of the groups
And I click *Save* button
Then I see the full-page *Edit quiz details for '<quiz>'* 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 *Changes to quiz saved*
And I see the change under *Visible to*
# And the snackbar notification appears *Changes to quiz saved*: No snackbar anymore?
And I see the change under *Recipients*

Examples:
| title | description |
Expand Down

0 comments on commit 7b709e0

Please sign in to comment.