Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.18 new Gherkin scenarios and corrections #12716

Closed
wants to merge 10 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lesson scenario corrections
pcenov committed Oct 14, 2024
commit 65386bf67cea2078e3786be0e4171bed11a5df64
Original file line number Diff line number Diff line change
@@ -3,45 +3,45 @@ Feature: Coach copies lesson

Background:
Given I am signed in to Kolibri as coach user
And I am on *Coach - '<class>' > Plan > Lessons* page
And I see the <lesson> lesson
And I am at *Coach - '<class>' > Lessons* page
And I have already created some lessons

Scenario: Copy lesson to the same class and assign to the entire class
When I click the <lesson> lesson
Then I see the <lesson> page
When I click *Options* button
And I select *Copy lesson* option
Scenario: Copy lesson to the same class and assign it to the entire class
When I click the title of a lesson
Then I see the lesson summary page
When I click *...* button next to *Manage resources*
And I select the *Copy lesson* option
Then I see the *Copy lesson to* modal
And I see *'<class>' (current class)* is selected
When I click *Continue* button
And I see that *'<class>' (current class)* is selected
When I click the *Continue* button
Then the modal content changes and asks to select recipients
And I see *Entire class* selected
When I click *Copy* button
And I see that *Entire class* is selected by default
When I click the *Copy* button
Then the modal closes
And the snackbar confirmation appears
When I click on *All Lessons*
Then I see the *Copy of '<lesson>'* in the list of lessons
And I see *Entire class* value for it under the *Recipients* heading

Scenario: Copy lesson to a different class and assign it to just one group
Given there is a class <class2> that has a group <group>
When I click the <lesson> lesson
Then I see the <lesson> page
When I click *Options* button
And I select *Copy lesson* option
Given there is a class for which there is a group of learners
When I click the title of a lesson
Then I see the lesson summary page
When I click *...* button next to *Manage resources*
And I select the *Copy lesson* option
Then I see the *Copy lesson to* modal
And I see *'<class>' (current class)* is selected
When I select class <class2>
And I click *Continue* button
And I see that *'<class>' (current class)* is selected
When I select a class
And I click the *Continue* button
Then the modal content changes and asks to select recipients
And I see *Entire class* selected
When I select group <group>
And I click *Copy* button
And I see that *Entire class* is selected by default
When I select a group
And I click the *Copy* button
Then the modal closes
And the snackbar confirmation appears
When I open the sidebar
And I click on *Coach*
And I click class <class2>
And I click on *Plan > Lessons* tab
And I select the other class
And I go to the *Coach > Lessons* page
Then I see the *Copy of '<lesson>'* in the list of lessons
And I see *1 group* value for it under the *Recipients* heading
And I see the specified group under the *Recipients* heading
Original file line number Diff line number Diff line change
@@ -3,70 +3,56 @@ Feature: Coach creates lessons

Background:
Given I am signed in to Kolibri as a coach user
And I am on the *Coach - '<class>' > Plan > Lessons* page
And there is a channel <channel> and topic <topic> on the device
And I am on the *Coach - '<class>' > Lessons* page
And there is at least one imported channel

Scenario: Coach creates a new lesson for entire class
Scenario: Coach creates a new lesson for the entire class
When I click *New lesson* button
Then I see the *Create new lesson* modal
When I fill in the title for the <lesson>
And I fill in the description <description> # optional
And I set *Recipients* to group(s) # optional
And I click *Continue* button
When I fill in the title of the lesson
And I fill in the description # optional
And I set the *Recipients* # optional, skip for this case
And I click the *Save changes* button
Then the modal closes
And I see the <lesson> lesson page

Scenario: Check validation for the title field
When I try to enter a title with more than 50 characters
Then I see that the name is cut at 50
When I input a same lesson title as for an already existing lesson
Then I see the error notification *A lesson with this name already exists*
When I leave the title field empty
And I click *Continue*
Then I see the error notification *This field is required*

Scenario: Assign existing lesson to different recipient groups
# Repeat the scenario from the *Coach - '<class>' > Report > Lessons > '<lesson>'* page
When I change *Recipients* by selecting *Entire class* or one of the groups
And I see the *Lesson created* snackbar message
And I see the lesson details page

Scenario: Assign existing lesson to different recipients
Given I am at the lesson details page
When I click the *...* button
And I select the *Edit details* option
Then I see the *Edit lesson details* modal
When I change the *Recipients* by selecting *Individual learners* or one of the available groups
And I click the *Save changes* button
Then I see the lesson <lesson> page again
And the *Recipients* field reflects the changes I made

Scenario: Assign individual learners
When I change *Recipients* by selecting *Individual learners*
Then I see a table listing all of the learners in the class.
When I change *Recipients* by selecting both *Individual learners* and any other group that has learners
Then I see the learners in the selected group(s) have the checkboxes by their names disabled
When I select learners in the table by clicking the checkboxes next to their names
And I click *Save changes*
Then I can log in as one of the selected individual learners and view the lesson
When I change *Recipients* by selecting *Entire class* then all groups and *Individual learners* become unchecked
And I no longer see the table of learners

Scenario: Manage lesson resources
Given that I have created the lesson with title <lesson>
When I click *Manage resources* button
Then the modal closes
And I see the *Lesson created* snackbar message
And I see the lesson details page
And the *Recipients* field reflects the changes I've made

Scenario: Add lesson resources
Given I am at the lesson details page
When I click the *Manage resources* button
Then I am on the *Manage resources in '<lesson>'* page
And I see the content channel <channel>
When I select channel <channel>
Then I see its topics
When I navigate down to a single topic and click that <topic>
# A topic may have one or more sub-topics in the topic tree.
Then I see the list of resources in that topic
And I see the available channels
When I select a channel
Then I see its folders
When I navigate down to a single folder and click that folder
# A folder may have one or more sub-folders in the folder tree.
Then I see the list of resources in that folder
When I click on a single resource
Then I see the preview page for the selected resource
And I see the *Add* button
When I click *Add* button
When I click the *Add* button
Then I see the snackbar notification
And I see the *Manage resources in '<lesson>'* page again
And I see the *N resources in this lesson* value is increased by 1
When I click the *Close* button at the bottom
Then *Manage resources in '<lesson>'* page closes
And I see the <lesson> lesson page again
And I see the resources I added to the <lesson> lesson
When I click the *Save changes* button at the bottom
Then the *Manage resources in '<lesson>'* page closes
And I see the lesson details page
And I see the resources which I've added to the lesson

Scenario: Search from browse mode (with results)
Given I am browsing the topics
Given I am browsing the folders
When I enter <searchterm> in the *Search* field
And I press the *Submit search* button (magnifying glass)
Then I see the *Results for '<searchterm>'* header
@@ -89,9 +75,9 @@ Feature: Coach creates lessons

Scenario: Exit search with browser history
Given I am on the *Results for '<searchterm>'* page
And I arrived to this page directly from a topic
And I arrived to this page directly from a folder
When I press the *Exit search* button
Then I return to the the content listing of the last topic
Then I return to the the content listing of the last folder

Scenario: Search has no results
Given I am on the *Results for '<searchterm>'* page
@@ -111,7 +97,7 @@ Feature: Coach creates lessons
When I check one resource checkbox
Then I see a snackbar confirmation that *N resources added*

Scenario: Remove a topic or exercise from the search results page
Scenario: Remove a folder or exercise from the search results page
Given I am on the search results page
And there are resources available in the search results
And some of them are selected
@@ -124,10 +110,10 @@ Feature: Coach creates lessons
Then I can see the available formats I can filter by
When I select *Exercises* option
Then I see only exercises among search results
When I select *Topics* option
Then I see only topics among search results
When I select *folders* option
Then I see only folders among search results
When I select the option *All*
Then I see both topics and exercises in search results
Then I see both folders and exercises in search results

Scenario: Use the channel filter
Given I am on the search results page
@@ -154,14 +140,14 @@ Feature: Coach creates lessons
And I see its description
And I see whether it is a coach exercise or not

Scenario: View metadata on topic cards in search results
Scenario: View metadata on folder cards in search results
Given I am on the search results page
And there are topics in the search results
And one of those topics has content for coaches
When I see a topic card
And there are folders in the search results
And one of those folders has content for coaches
When I see a folder card
Then I see its title
And I see its description
And I see how many coach exercises/topics it contains
And I see how many coach exercises/folders it contains

Scenario: Preview a resource from the search results and add/remove it to and from the lesson
Given I am on the search results page
Original file line number Diff line number Diff line change
@@ -2,20 +2,18 @@ Feature: Coach deletes lesson
Coach needs to be able to delete the lesson when necessary

Background:
Given I am signed in to Kolibri as coach user
And I am on *Coach - '<class>' > Plan > Lessons* page
And I see the lesson <lesson>
Given I am signed in to Kolibri as a coach
And I am at *Coach - '<class>' > Lessons* page
And there is at least one created lesson

Scenario: Delete lesson
When I click the lesson <lesson>
Then I see the <lesson> lesson page
When I click *Options* button
Scenario: Delete a lesson
When I click the title of a lesson
Then I am at the lesson's details page
When I click the *...* button
And I select *Delete*
Then I see the *Delete lesson* modal
When I click *Delete* button
When I click the *Delete* button
Then the modal closes
And I am back at *Coach - '<class>' > Lessons* page
And the snackbar notification appears
And I don't see the <lesson> on the list of *Lessons*
But if I click the *Cancel* button
Then the modal closes
And I still see the lesson on the list
And I no longer see the lesson in the *Lessons* table
Original file line number Diff line number Diff line change
@@ -3,37 +3,29 @@ Feature: Coach edits lessons

Background:
Given I am signed in to Kolibri as a coach user
And I am on the *Coach - '<class>' > Plan > Lessons > '<lesson>'* page
And I am on the *Coach - '<class>' > Lessons > '<lesson>'* page
And there are 2 or more learner groups
And there is a lesson <lesson> created previously
And there is a previously created lesson

Scenario: Edit existing lesson title
# Repeat the scenario from the *Coach - '<class>' > Report > Lessons > '<lesson>'* page
When I click the *Options* dropdown menu
Scenario: Edit the title and description of an existing lesson
When I click the *...* button
And I select the *Edit details* option
Then I see the *Edit lesson details* page
When I edit the lesson *Title* and leave the field
When I change the title and description of the lesson
And I click the *Save changes* button
Then I see the lesson <lesson> page again
And I see the title of the lesson is changed
# And I see the snackbar notification “Lesson changes saved” # No snackbar
Then I see the lesson details page again
And I see a *Changes saved* snackbar notification
And I see that the title of the lesson is changed
When I click on the title of the lesson
Then I am the lesson details page
And I can see that the description of the lesson is also changed

Scenario: Cannot change the title of an existing lesson if it is already used
# Repeat the scenario from the *Coach - '<class>' > Report > Lessons > '<lesson>'* page
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 the *A lesson with this name already exists* error notification appears
Given I am at the *Edit lesson details* page
When I try to rename the channel by entering an existing lesson title
Then I see the following validation message: *A lesson with this name already exists*
And I cannot save until I choose another title

Scenario: Edit existing lesson description
# Repeat the scenario from the *Coach - '<class>' > Report > Lessons > '<lesson>'* page
When I edit the lesson <lesson> *Description*
And I click the *Save changes* button
Then I see the lesson <lesson> page again
And I see the description of the lesson is changed
# And I see the snackbar notification “Lesson changes saved” # No snackbar

Scenario: Reassign existing lesson to different recipient groups
# Repeat the scenario from the *Coach - '<class>' > Report > Lessons > '<lesson>'* page
When I change *Recipients* by selecting *Entire class* or one of the groups
Loading