Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
46 changes: 46 additions & 0 deletions integration_testing/019-features/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

# Style guide for Kolibri `.feature` files

The purpose of this document is to compile and keep the record of our internal conventions used to write and format the `.feature` files for testing Kolibri.

Style guide is a `Work-In-Progress` as we keep adding the testing scenarios and refining our strategies.

## File naming

- Use the `role-name-feature-name.feature` naming strategy.
- Feature name part should be expressed as **action** whenever possible, instead of the *need*. Examples: `move-learners-between-groups`, or `modify-facility-settings`. Do not use verbs as *can* or *should* in filenames.
- Separate all filename parts with dashes `-`, not underscores `_`.

## Feature naming

Feature name and description (the first part of the content inside the `.feature` file), should express the **need**. Try to formulate the name as: "This `role-name` needs to be able to achieve `feature-name`". Add more detailed background explanation if needed. Most feature descriptions can be expressed in one sentence, but other, more complex ones that include various `Background` settings or `Scenarios` might need more than one sentence.

## Other recommendations

- List the `Background` "givens" in order to cover the more general conditions **first** (`there are groups created`, meaning that the groups should be created even before the user arrived to the groups page), and the more specific ones (`I am on *Coach > Groups* page`)
- Keep the *point of view* consistent by writing all the steps as **I**.
- Use present tense and avoid conditionals: *When I scroll... Then I see...* instead of *When I have scrolled... Then I should see...*
- Whenever possible and not too laborious, let's try recording the values in `Examples` table and use the placeholders `<>`in the steps:

```
Examples:
| username | password |
| coach | coach |
```


## UI elements conventions

- Enclose strings of **all** the UI elements (buttons, menu options, headings, modal titles, etc.) inside `**` chars.
- Capitalize just the first letter (even when they appear fully capitalized in the UI, for readability purposes).
- Use the `*Plugin name > Tab name*` convention for indicating the current or position or the desired destination of the user in Kolibri. Examples: `*Coach > Groups*`, `*Learn > Recommended*`, `*Facility > Settings*`, `*Device > Info*`, etc.


## Some useful BDD resources

- [How to describe user stories using Gherkin language](https://medium.com/@SteelKiwiDev/how-to-describe-user-stories-using-gherkin-language-8cffc6b888df)
- [Gherkin Syntax](http://docs.behat.org/en/v2.5/guides/1.gherkin.html#gherkin-syntax)
- [Obey the testing goat BDD](https://www.obeythetestinggoat.com/book/appendix_bdd.html#_writing_an_ft_as_a_feature_using_gherkin_syntax)
- [Gherkin Reference](https://docs.cucumber.io/gherkin/reference/)
- [Gherkin: Feature Testing Language](http://behave.readthedocs.io/en/latest/gherkin.html#features)
- [Syntax formatter for Sublime](https://packagecontrol.io/packages/Gherkin%20(Cucumber)%20Formatter)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Feature: Facility admin device management
Facility admins with device permissions need to see the *Device* dashboard to be able to manage resources

Background:
Given I am signed into Kolibri as a facility admin user with device permissions for content import
And there are imported channels on the device

Scenario: View all the options for managing content
When I go to the *Device > Channels* page
Then I see the *Channels* label
And I see the *Options* drop-down and the *Import* button to the right
And I see the list with already imported channels
And I see the *Manage* button for each channel
When I click the *Manage* button for a channel
Then I see the *Manage <channel>* modal
And I see all the available channel details
And I see all the imported channel resources
And I see an *Import more* button
And I see that the *Delete* and *Export* buttons are disabled

# Continue testing content management by using the scenarios for super admins
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Feature: Admin can rearrange channels
Admins need to be able to customize the order in which the channels are displayed for Learners and Coaches

Background:
Given I am signed in as an Admin or other user with content management permissions
And I am at the *Device > Channels* page

Scenario: User can move a channel
When I click the *Options drop-down*
And I select the *Edit channel order* option
Then I see the *Edit channel order* modal
When I drag a channel using my mouse or keyboard to a new position
Then I see a *Channel order saved* snackbar notification
When I close the modal
Then I am back at the *Device > Channels* page
And I can see that the order of the channels is changes as intended

Scenario: The new channel order is reflected in all parts of the app
Given I've already reordered the channels
When I navigate to any of the following locations: *Device > Channels > Export channels*, *Device > Channels > Delete channels*, *Coach > Create new quiz*, *Coach > Manage lesson resources*, *Learn > Home > Explore channels* and *Learn > Library*
Then I see that the channels are ordered as intended
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Feature: Admin copies a class
Admin users need to be able to copy classes in each facility

Background:
Given I am signed in to Kolibri as a facility admin user
And I am at *Facility > Classes* page
And there is at least one already created class with enrolled learners and assigned coaches

Scenario: Copy a class with learners and coaches
When I click on the *⋮* button for a class
And I click the *Copy class* option
Then I see the *Copy class* modal
And I see a *Class name* field
And I see a *Copy of <class name>* text in the field
And I see a *Copy all learners (N)* checkbox
And I see a *Copy all coaches (N)* checkbox
And both checkboxes are not selected by default
When I enter a new class name in the *Class name* field
And I select both checkboxes
And I click the *Make a copy* button
Then the modal closes
And I see a *Class copied successfully* snackbar message
And I see the copied class in the *Classes* table
And I see the correct number of coped coaches and learners

Scenario: Copy a class without any learners and coaches
Given I am at the *Copy class* modal
When I enter a new class name in the *Class name* field
And I leave both checkboxes unchecked
And I click the *Make a copy* button
Then the modal closes
And I see a *Class copied successfully* snackbar message
And I see that none of the learners and coaches are copied
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Feature: Admin creates classes
Admin needs to be able create classes for each facility

Background:
Given I am signed in to Kolibri as a facility admin user
And I am at *Facility > Classes* page

Scenario: Create a new class
When I click on the *New class* button
Then I see the *Create new class* modal
When I enter a class name
And I click the *Save* button
Then the modal closes
And I see the new class in the *Classes* table
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Feature: Admin can delete classes
Admin users need to be able to delete classes from the facility

Background:
Given I am signed in to Kolibri as a facility admin user
And I am at the *Facility > Classes* page
And there is a class created in the facility

Scenario: Delete class
When I click on the *⋮* button for a class
And I click the *Delete class* option
Then I see the *Delete class* modal
When I click the *Delete* button
Then the modal closes
And I see a *Class deleted* snackbar message
And I see that the deleted class is no longer displayed in the *Classes* table
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Feature: Admin enrolls learners and assign coaches to classes
Admin needs to be able to enroll learners and assign coaches to classes in the facility

Background:
Given I am signed in to Kolibri as a facility admin user
And I am at the *Facility > Classes* page
And there is a class created in the facility
And there are learner and coach users created in the facility

Scenario: Enroll learners to a class
When I click on class
Then I see the class page
When I click the *Enroll learners* button
Then I see the *Enroll learners into '<class>'* page
And I see a list with all the learners who are not enrolled in the class yet
When I select a learner or several learners
Then I see that the *Confirm* button is enabled
When I click the *Confirm* button
Then I am back at the class page
And I see a *Learner(s) enrolled* snackbar message
And I see the selected learners listed under *Learners*

Scenario: Remove a learner from a class
Given a learner is enrolled in the class
And I am at the class page
When I click the *Remove* button to the right of the learner's username
Then I see the *Remove user* modal
When I click the *Remove* button
Then the modal closes
And I see a *Learner removed* snackbar message
And see that the learner is removed from the *Learners* table

Scenario: Assign coaches to a class
Given I am at the class page
When I click the *Assign coaches* button
Then I see the *Assign a coach to '<class>'* page
And I see the list of all coaches who are not assigned to the class yet
When I select a coach or several coaches
Then I see that the *Confirm* button is enabled
When I click the *Confirm* button
Then I am back at the class page
And I see a *Coach(es) assigned* snackbar message
And I see the selected coaches listed under *Coaches*

Scenario: Remove a coach from a class
Given a coach is assigned to the class
And I am at the class page
When I click the *Remove* button to the right of the coach's username
Then I see the *Remove user* modal
When I click the *Remove* button
Then the modal closes
And I see a *Coach removed* snackbar message
And see that the learner is removed from the *Learners* table
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Feature: Admin renames a class
Admin users need to be able to rename classes in each facility

Background:
Given I am signed in to Kolibri as a facility admin user
And I am at the *Facility > Classes* page
And there is at least one already created class

Scenario: Rename a class
When I click on the *⋮* button for a class
And I click the *Rename* option
Then I see the *Rename class* modal
And I see a *Class name* field
And I see a *<class name>* text in the field
When I enter a new class name in the *Class name* field
And I click the *Save* button
Then the modal closes
And I see a *Class renamed* snackbar message
And I see the renamed class in the *Classes* table

Scenario: Rename a class while managing the class coaches and learners
Given I am at the class page
When I click on the *Rename* link to the right of the class name
Then I see the *Rename class* modal
And I see a *Class name* field
And I see a *<class name>* text in the field
When I enter a new class name in the *Class name* field
And I click the *Save* button
Then the modal closes
And I see a *Class renamed* snackbar message
And I see the new class name
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Feature: Admin bulk export of users and classrooms
Admin needs to be able to export users and their classrooms

Background:
Given I am signed in to Kolibri as a facility admin user
And I am on *Facility > Data* page
And there are learners enrolled in classrooms and coaches assigned to them

Scenario: Export a CSV file containing all users in the facility
When I click on *Generate user CSV file* link under the *Import and export users* heading
Then I see the loading indicator
And I see that the *Download CSV* button becomes enabled
When I click on the *Download CSV* button
And I save the file '<facility>_users.csv' on the device
And I open the CSV file
Then I see that it contains only users from my facility, even if there are more facilities in the device
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Feature: Admin bulk export of users and classrooms
Admin needs to be able to import users and their classrooms

Background:
Given I am signed in to Kolibri as a facility admin user
And I am at *Facility > Data* page

Scenario: See the CSV file format requirements
When I click the *Import* button under *Import and export users* heading
Then I see a new window with a text explaining the consequences of importing
When I click on the *View spreadsheet format reference* link
Then I see a new modal window with the CSV file fields formats, requirements and validation rules

Scenario: Bulk import of users from a CSV file
When I click the *Import* button under *Import and export users* heading
Then I see a new window with a text explaining the consequences of importing
And I see the *Cancel* enabled button
And I see the *Continue* disabled button
When I click the *Choose file* button
And select a CSV file with the right format
Then I see the *Continue* button is now enabled
When I click the *Continue* button
Then I see the loading indicator
When the file is processed
Then I see the *Import users* window
And I see a list of the number of users and classes that are going to be updated or created
And I see the list of errors, if any
And I see the *Back* and *Import* buttons
When I click the *Import* button
Then I see the loading indicator
When the file is processed
Then I see the *The import succeeded* message
And I see a report with the changes made in the database
When I click the top left X button to close the modal
And I go to *Facility > Classes*
Then I see that the classes, enrolled learners and assigned coaches now match what was in the CSV
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Feature: Admin exports usage data
Admin needs to be able to export session and summary logs for the facility

Background:
Given I am signed in to Kolibri as a facility admin user
And I am on *Facility > Data* page
And the learners have had interactions with the content on the device

Scenario: Export session logs
When I click on the *Generate log* button under *Session logs* heading
Then I see the *Select a date range* modal
When I select a start and an end date
And I click *Generate*
Then I see a *Download* button displayed to the left of the *Generate log* button
When I click on the *Download* button
Then I see the *Open/Save as* window, or the file *<facility>_content_session_logs_from_<YY-MM-DD>_to_<YY-MM-DD>.csv* is automatically saved on my local drive, depending on the browser defaults

Scenario: Export summary logs
When I click on the *Generate log* button under *Summary logs* heading
Then I see the *Select a date range* modal
When I select a start and an end date
And I click *Generate*
Then I see a *Download* button displayed to the left of the *Generate log* button
When I click on the *Download* button
Then I see the *Open/Save as* window, or the file *<facility>_content_summary_logs_from_<YY-MM-DD>_to_<YY-MM-DD>.csv* is automatically saved on my local drive, depending on the browser defaults
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Feature: Admin registers facility
Admin needs to be able to register their facility to Kolibri Data Portal

Background:
Given I am logged in as a Facility admin
And I have access to a Project token on Kolibri Data Portal
And I am at *Facility > Data*

Scenario: Register to a Kolibri Data Portal project for the first time
Given my facility has never been registered
When I click *Sync*
Then I see the *Select a source* modal
And I see that *Kolibri Data Portal (online)* is the selected option
When I click the *Continue* button
Then I see the *Register facility* modal
When I enter the project token from Kolibri Data Portal
And I click *Continue*
Then I see a confirmation modal with the project name
When I click *Register*
Then the modal closes
And I see the a spinner icon and *Syncing* under the facility name
When the syncing has finished successfully
Then I see a green checkmark icon next to the facility name

Scenario: Register to a second Kolibri Data Portal project
Given my facility has been registered before
And I have access to a different Kolibri Data Portal project token
When I click the *Options* button next to the *Sync* button
And I click the *Register* option
Then I see the *Register facility* modal
When I enter the project token from Kolibri Data Portal
And I click *Continue*
Then I see a confirmation modal with the project name
When I click *Register*
Then the modal closes
And I see a green checkmark icon next to the facility name

Scenario: Registration to a Kolibri Data Portal project failed
Given I have an invalid project token from Kolibri Data Portal
When I click the *Options* button next to the *Sync* button
And I click the *Register* option
Then I see the *Register facility* modal
When I enter the invalid project token from Kolibri Data Portal
And I click *Continue*
Then I see an *Invalid token* error message

Scenario: Register to a Kolibri Data Portal project, but already registered
Given my facility has been registered before
When I click *Register*
Then the register facility modal should appear
When I enter the same project token that was used to successfully register the facility before
And I click *Continue*
Then I see a modal that says I am already registered to the project
Loading
Loading