refactor js and cucumber scenario for integrations page

This commit is contained in:
Reinier Balt 2010-11-10 16:52:05 +01:00
parent d1b35090ab
commit 05b3b7cebc
5 changed files with 37 additions and 52 deletions

View file

@ -71,7 +71,7 @@ Feature: Manage the list of contexts
| active | @phone |
| hidden | @hidden|
@selenium @wip
@selenium
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"

View file

@ -21,7 +21,6 @@ Feature: Existing user logging in
| admin | secret | redirected to the home page | Login successful |
| admin | wrong | on the login page | Login unsuccessful |
@wip
Scenario Outline: Unauthorized users cannot access Tracks and need to log in first
Given there exists a project called "top secret" for user "testuser"
And there exists a context called "@secret location" for user "testuser"

View file

@ -108,7 +108,7 @@ Feature: Manage the list of projects
When I sort the list by number of tasks
Then the project "very busy" should be above the project "test"
@selenium @wip
@selenium
Scenario: Cannot add a project with comma in the name
When I go to the projects page
And I submit a new project with name "foo,bar"

View file

@ -9,6 +9,12 @@ Feature: Integrate Tracks in various ways
| login | password | is_admin |
| testuser | secret | false |
And I have logged in as "testuser" with password "secret"
And I have the following contexts:
| context |
| @pc |
| @home |
| @shops |
| @boss |
Scenario: I cannot see scripts when I do not have a context
Given I have no contexts
@ -21,18 +27,20 @@ Feature: Integrate Tracks in various ways
Then I should see scripts
@selenium
Scenario: When I select a different context the example scripts should change accoordingly
Given I have the following contexts:
| context |
| @pc |
| @home |
| @shops |
| @boss |
Scenario: The scripts on the page should be prefilled with the first context
When I go to the integrations page
Then I should see a script "applescript1" for "@pc"
When I select "@home" from "applescript1-contexts"
Then I should see a script "applescript1" for "@home"
When I select "@shops" from "applescript2-contexts"
Then I should see a script "applescript2" for "@shops"
When I select "@boss" from "quicksilver-contexts"
Then I should see a script "quicksilver" for "@boss"
@selenium
Scenario Outline: When I select a different context the example scripts should change accordingly
When I go to the integrations page
When I select "<context1>" from "<context-list>"
Then I should see a script "<script>" for "<context1>"
When I select "<context2>" from "<context-list>"
Then I should see a script "<script>" for "<context2>"
Examples:
| context1 | context2 | context-list | script |
| @home | @boss | applescript1-contexts | applescript1 |
| @shops | @home | applescript2-contexts | applescript2 |
| @boss | @shops | quicksilver-contexts | quicksilver |