Skip to content
47 changes: 47 additions & 0 deletions integration_testing/features/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

# Style guide for Kolibri Studio `.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 Studio.

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.
- Enclose any messages displayed to the user 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)
51 changes: 28 additions & 23 deletions integration_testing/features/add-channel-to-starred.feature
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
Feature: Add channel to *Starred* tab
User needs to be able to mark channels with a star to label them as favorite for easy access
Feature: Add a channel to the *Starred* tab
A user needs to be able to mark channels with a star to label them as favorite for easy access

Background:
Given I am signed in to Studio as a non-admin user
And I am on any of the tabs (*My Channels*, *Starred*, *View only*, or *Content Library*)
And I see a <channel> channel that is not starred (empty star)
Given I am signed in to Studio
And I am on any of the tabs (*My Channels*, *Starred*, *View-only*, or *Content Library*)
And I see a channel that is not starred (white star)

Scenario: Add channel to *Starred* tab
When I click the *Star* button for the desired <channel>
Then I see <channel> channel star is now full
Scenario: Add channel to the *Starred* tab
When I click the *Add to starred channels* button for the desired channel
Then I see that the channel's *Add to starred channels* button is now black
And I see a message that the channel was added to the starred channels
When I click and open the *Starred* tab
Then I see <channel> channel is on the list
Then I see that the channel is displayed among the starred channels

Scenario: Remove channel from *Starred* tab
Scenario: Unstar a channel
Given I am on *My Channels*, *View only*, or *Public* tabs
And I see a <channel> channel that is starred (full star)
When I click the *Star* button for the <channel>
Then I see the star is now empty
And I see a channel that is starred (black star)
When I click the *Remove from starred channels* button for the channel
Then I see that the channel's *Remove from starred channels* button is now white
And I see a message that the channel was removed from the starred channels
When I click and open the *Starred* tab
Then I see the list of channels
But I don't see the <channel> channel on the list
Then I see the list of starred channels
But I don't see the unstarred channel on the list

Scenario: Remove channel directly from *Starred* tab
Given I am on *Starred* tabs
And I see a <channel> channel on the list with a full star
When I click the *Star* button for the <channel>
Then I don't see the <channel> channel any more
Scenario: Remove channel directly from the *Starred* tab
Given I am on the *Starred* tab
And I see a starred channel
When I click the *Remove from starred channels* button for the channel
Then I don't see the unstarred channel any more

Examples:
| channel |
| CK-12 |
Scenario: Remove a starred channel form the *Content Library* tab with *Starred* filter on
Given I am on the *Content Library* tab
And I've selected the *Starred* checkbox
When I click on the star button of a starred channel.
Then I should see a message that the channel was removed from the starred channels
And the channel should no longer be displayed in the list with the filtered channels
2 changes: 1 addition & 1 deletion integration_testing/features/cancel-copy.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Cancel copy

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the channel editor view

Scenario: Cancel copy of single resource
Expand Down
18 changes: 18 additions & 0 deletions integration_testing/features/change-language.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Feature: Change language
A user needs to be able to change the interface language.

Scenario: Change language when you are not signed-in
Given I am not signed-in to Studio
And I am on the Studio home page
When I click on one of the available languages
Then the language interface changes to the selected language
And the selected language is no longer clickable

Scenario: Change language as a signed-in user
Given I am signed-in to Studio
And I click the user profile icon
When I click *Change language*
Then I see a *Change language* modal window displayed with several languages to choose from
When I click on a language which is not currently selected
And I click the *Confirm* button
Then the interface language changes to the selected language
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Copy resource via right click

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the channel editor view

Scenario: Copy resource via right click
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Copy resource via selection bar

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the channel editor view

Scenario: Copy resource via selection bar
Expand Down
2 changes: 1 addition & 1 deletion integration_testing/features/copy-to-clipboard.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Copy to clipboard

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the <channel> editor page
And I have edit permissions for <channel>

Expand Down
2 changes: 1 addition & 1 deletion integration_testing/features/create-a-channel.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Create a channel

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the *My Channels* tab

Scenario: Create a channel
Expand Down
2 changes: 1 addition & 1 deletion integration_testing/features/create-a-topic.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Create a topic

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the directory selection screen
And I find a destination I want to move content into

Expand Down
2 changes: 1 addition & 1 deletion integration_testing/features/create-account.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Create account on Studio

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on Studio home page
And I do not have an account registered with my <email>

Expand Down
28 changes: 28 additions & 0 deletions integration_testing/features/create-exercise.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Feature: Create an exercise

Background:
Given I am signed in to Studio
And I am on the channel editor page

Scenario: Create an exercise
When I click the *Add* button
And I select the *New exercise* option
Then I see the *Details* tab of the *New exercise* modal
And I can set the exercise title, description and tags
And I can select the mastery criteria
And I can choose if the questions are randomized
And I can add/change a thumbnail
And I can select language and visibility
And I can fill in the copyright information
When I click the *Questions* tab
And I click the *New question* button
Then I can add the question text and images in the question editor field
And I can select the response type
And I can provide answers for each question
And I can provide hints for each question
And I can randomize the answer order
When I click the *Related* tab
Then I can click *Add previous step* and or *Add next step*
And I can click the *Add* button to add a step
When I click the *Finish* button
Then I am returned at the main topic tree view
2 changes: 1 addition & 1 deletion integration_testing/features/delete-account.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Delete account

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the *Settings > Account* page

Scenario: Delete account without active channels
Expand Down
33 changes: 33 additions & 0 deletions integration_testing/features/delete-channel.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Feature: Delete channel

Background:
Given I am signed in to Studio
And I have permissions to edit
And I am on *My Channels* tab

Scenario: Delete channel
When I click the *Options* button of a channel #the three dots to the right
Then I see a *Delete channel* option
When I click the *Delete channel* option
And I click the *Delete channel* button
Then I see a message that the channel is deleted
And the deleted channel is no longer displayed on *My Channels* tab

Scenario: Cancel deleting a channel
When I click the *Options* button of a channel #the three dots to the right
Then I see a *Delete channel* option
When I click the *Delete channel* option
And I click the *Cancel* button
Then the *Delete this channel* modal window is closed
And the channel is not deleted

Scenario: Delete a channel while viewing the contents of a channel
When I click on the channel name
Then I see the channel resources page
When I click the *Options* button to the right side of the topbar
Then I see a *Delete channel* option colored in red
When I click the *Delete channel* option
And I click the *Delete channel* button
Then I see a message that the channel is deleted
And I am brought back on *My channels* tab
And the deleted channel is no longer displayed on *My Channels* tab
2 changes: 1 addition & 1 deletion integration_testing/features/delete-resources.feature
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Delete resources permanently

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the channel editor page
And I have one removed resource from my channel editor tree

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Drag-drop resources out of the clipboard

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the channel editor view

Scenario: Drag-drop content nodes out of the clipboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Drag-drop to clipboard

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the channel editor view

Scenario: Drag-drop resources to an open clipboard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Edit account information

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on Studio *Settings > Account* page

Scenario: Changing password
Expand Down
16 changes: 16 additions & 0 deletions integration_testing/features/edit-channel-details.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Feature: Edit channel details

Background:
Given I am signed in to Studio
And I am on *My Channels* tab

Scenario: Edit channel details
When I click the *...* (Options) button for the desired channel
And I click the *Edit channel details* option
Then I see a new page with the channel details
And I see the details for the channel - channel name, language, channel description etc.
When I modify any of the details
And I click the *Save changes* button
Then I see a message: Changes saved
And I can close the page

16 changes: 16 additions & 0 deletions integration_testing/features/edit-resource-details.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Feature: Edit resource details

Background:
Given I am signed in to Studio
And I am on the channel editor page

Scenario: Edit details
When I click the *⋮* (Options) button for a resource
And I click the *Edit details* option
Then I see the *Edit details* window
And I can edit different properties of the resource such as - *Basic information*, *Thumbnail*, *Audience*, *Source* etc.
When I modify any of the details
Then I see a message: *Changes saved*
When I click the *Finish* button
Then I am returned at the main topic tree view

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Expand and collapse topics in the clipboard

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the channel editor view

Scenario: Expand and collapse topics in the clipboard
Expand Down
11 changes: 11 additions & 0 deletions integration_testing/features/explore-without-an-account.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Feature: Explore without an account

Background:
Given I am not signed in to Studio
And I am on Studio sign-in page

Scenario: Explore without an account
When I click the *Explore without an account* link
Then I see the *Content Library* page with available public channels
And I can filter the search results
And I can view or download the channel summary
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Export account information

Background:
Given I have a Studio account
And I am signed in to Studio as a non-admin user
And I am signed in to Studio
And I have interacted with various data and channels
And I am on the *Settings > Account* page

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Get channel token after publishing the channel

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the <channel> editor page
And the <channel> has recently been published

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Go back from Review selections for import to channel list

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on *My Channels > edit* page

Scenario: Go back from Review selections for import to channel list
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Feature: Go to resource original location

Background:
Given I am signed in to Studio as a non-admin user
Given I am signed in to Studio
And I am on the channel editor view

Scenario: Go to resource original location
Expand Down
Loading