2010-10-22 20:46:06 +02:00
|
|
|
Feature: Manage the list of contexts
|
|
|
|
|
In order to keep track and manage all of my contexts
|
2010-02-09 10:27:59 +01:00
|
|
|
As a Tracks user
|
2010-10-22 20:46:06 +02:00
|
|
|
I want to manage my list of contexts
|
2010-02-09 10:27:59 +01:00
|
|
|
|
|
|
|
|
Background:
|
|
|
|
|
Given the following user record
|
|
|
|
|
| login | password | is_admin |
|
|
|
|
|
| testuser | secret | false |
|
|
|
|
|
And I have logged in as "testuser" with password "secret"
|
2010-11-10 17:34:28 +01:00
|
|
|
|
2010-10-23 17:52:50 +02:00
|
|
|
@selenium
|
2010-07-30 21:06:12 +02:00
|
|
|
Scenario: Delete context from context page should update badge
|
2010-02-09 23:26:38 +01:00
|
|
|
Given I have a context called "@computer"
|
2010-10-23 17:52:50 +02:00
|
|
|
And I have a context called "@ipad"
|
2010-02-09 23:26:38 +01:00
|
|
|
When I go to the contexts page
|
2010-11-10 17:34:28 +01:00
|
|
|
Then the badge should show 2
|
2010-10-23 17:52:50 +02:00
|
|
|
And the context list badge for active contexts should show 2
|
2010-02-09 23:26:38 +01:00
|
|
|
When I delete the context "@computer"
|
|
|
|
|
Then he should see that a context named "@computer" is not present
|
2010-10-23 17:52:50 +02:00
|
|
|
And the badge should show 1
|
|
|
|
|
And the context list badge for active contexts should show 1
|
|
|
|
|
|
2010-10-24 23:19:11 +02:00
|
|
|
@selenium
|
2010-10-23 17:52:50 +02:00
|
|
|
Scenario: Delete last context from context page should remove the contexts container for hidden or active contexts
|
|
|
|
|
Given I have a context called "@computer"
|
|
|
|
|
And I have a hidden context called "@ipad"
|
|
|
|
|
When I go to the contexts page
|
2010-10-23 18:12:46 +02:00
|
|
|
And I should see that the context container for active contexts is present
|
|
|
|
|
And I should see that the context container for hidden contexts is present
|
2010-10-23 17:52:50 +02:00
|
|
|
When I delete the context "@computer"
|
|
|
|
|
Then I should see that a context named "@computer" is not present
|
|
|
|
|
And I should see that the context container for active contexts is not present
|
|
|
|
|
When I delete the context "@ipad"
|
|
|
|
|
Then I should see that a context named "@ipad" is not present
|
|
|
|
|
And I should see that the context container for hidden contexts is not present
|
2010-02-09 23:26:38 +01:00
|
|
|
|
2010-10-24 23:19:11 +02:00
|
|
|
@selenium
|
2010-02-09 23:26:38 +01:00
|
|
|
Scenario: Delete context from context page right after an edit
|
|
|
|
|
Given I have a context called "@computer"
|
|
|
|
|
When I go to the contexts page
|
|
|
|
|
And I edit the context to rename it to "@laptop"
|
|
|
|
|
When I delete the context "@laptop"
|
|
|
|
|
Then he should see that a context named "@laptop" is not present
|
|
|
|
|
And the badge should show 0
|
|
|
|
|
|
2010-10-24 23:19:11 +02:00
|
|
|
@selenium
|
2010-02-09 23:26:38 +01:00
|
|
|
Scenario: Edit context from context twice
|
|
|
|
|
Given I have a context called "@computer"
|
|
|
|
|
When I go to the contexts page
|
|
|
|
|
And I edit the context to rename it to "@laptop"
|
|
|
|
|
And I edit the context to rename it to "@ipad"
|
|
|
|
|
Then he should see that a context named "@computer" is not present
|
|
|
|
|
And he should see that a context named "@laptop" is not present
|
|
|
|
|
And he should see that a context named "@ipad" is present
|
|
|
|
|
And the badge should show 1
|
2010-07-29 18:06:30 +02:00
|
|
|
|
2010-07-29 18:08:41 +02:00
|
|
|
@selenium
|
2010-10-22 20:46:06 +02:00
|
|
|
Scenario Outline: Add a new context with state
|
2010-07-29 18:06:30 +02:00
|
|
|
Given I have the following contexts
|
2010-11-10 17:34:28 +01:00
|
|
|
| name | hide |
|
|
|
|
|
| @ipad | true |
|
|
|
|
|
| @home | false |
|
2010-07-29 18:06:30 +02:00
|
|
|
When I go to the contexts page
|
2010-10-22 20:46:06 +02:00
|
|
|
And I add a new <state> context "<name>"
|
|
|
|
|
Then I should see the context "<name>" under "<state>"
|
2010-07-29 18:06:30 +02:00
|
|
|
|
2010-10-22 20:46:06 +02:00
|
|
|
Examples:
|
2010-11-10 17:34:28 +01:00
|
|
|
| state | name |
|
|
|
|
|
| active | @phone |
|
|
|
|
|
| hidden | @hidden |
|
2010-11-09 15:13:22 +01:00
|
|
|
|
2010-11-10 16:52:05 +01:00
|
|
|
@selenium
|
2010-11-09 15:13:22 +01:00
|
|
|
Scenario: Cannot add a context with comma in the name
|
|
|
|
|
When I go to the contexts page
|
|
|
|
|
And I add a new active context "foo, bar"
|
2010-11-10 17:34:28 +01:00
|
|
|
Then I should see "Name cannot contain the comma"
|