Cleaned up the use of the 'wait until' steps in the has many examples.
This commit is contained in:
parent
48f869dc27
commit
1d85c0dbf3
@ -30,22 +30,22 @@ Background:
|
|||||||
Scenario: I view a client without any projects
|
Scenario: I view a client without any projects
|
||||||
When I go to the "Clients" model list page
|
When I go to the "Clients" model list page
|
||||||
And I follow "Alpha, Inc"
|
And I follow "Alpha, Inc"
|
||||||
And I wait until ".has-many-selector" is visible
|
And I wait until the has many selector is visible
|
||||||
Then I should see "Empty" within the list of items
|
Then I should see "Empty" within the list of items
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: I add a project to a client
|
Scenario: I add a project to a client
|
||||||
When I go to the "Clients" model list page
|
When I go to the "Clients" model list page
|
||||||
And I follow "Beta, Inc"
|
And I follow "Beta, Inc"
|
||||||
And I wait until ".has-many-selector ul li.template" is visible
|
And I wait until the has many selector is visible
|
||||||
Then "Fun project" should be an option for "label"
|
Then "Fun project" should be an option for "label"
|
||||||
And I press "+ add"
|
And I press "+ add"
|
||||||
When I press "Save"
|
When I press "Save"
|
||||||
And I wait until ".has-many-selector ul li.template" is visible
|
And I wait until the has many selector is visible
|
||||||
Then I should see "Fun project" within the list of added items
|
Then I should see "Fun project" within the list of added items
|
||||||
And I should not see "Empty" within the list of items
|
And I should not see "Empty" within the list of items
|
||||||
When I go to the "Clients" model list page
|
When I go to the "Clients" model list page
|
||||||
And I follow "Beta, Inc"
|
And I follow "Beta, Inc"
|
||||||
And I wait until ".has-many-selector ul li.template" is visible
|
And I wait until the has many selector is visible
|
||||||
Then I should see "Fun project" within the list of added items
|
Then I should see "Fun project" within the list of added items
|
||||||
And I should not see "Empty" within the list of items
|
And I should not see "Empty" within the list of items
|
||||||
|
@ -36,26 +36,26 @@ Scenario: I do not see the "Add Item" button for new parent
|
|||||||
Scenario: I attach already created items for an existing parent and save it
|
Scenario: I attach already created items for an existing parent and save it
|
||||||
When I go to the "Clients" model list page
|
When I go to the "Clients" model list page
|
||||||
And I follow "Apple Inc"
|
And I follow "Apple Inc"
|
||||||
And I wait until ".has-many-selector ul li.template" is visible
|
And I wait until the has many selector is visible
|
||||||
Then "My sexy project" should be an option for "label"
|
Then "My sexy project" should be an option for "label"
|
||||||
When I select "My sexy project" from "label"
|
When I select "My sexy project" from "label"
|
||||||
And I press "+ add"
|
And I press "+ add"
|
||||||
And "My sexy project" should not be an option for "label"
|
And "My sexy project" should not be an option for "label"
|
||||||
When I press "Save"
|
When I press "Save"
|
||||||
And I wait until ".has-many-selector ul li.template" is visible
|
And I wait until the has many selector is visible
|
||||||
Then "My sexy project" should not be an option for "label"
|
Then "My sexy project" should not be an option for "label"
|
||||||
|
|
||||||
@javascript
|
@javascript
|
||||||
Scenario: I create a new item and attach it
|
Scenario: I create a new item and attach it
|
||||||
When I go to the "Clients" model list page
|
When I go to the "Clients" model list page
|
||||||
And I follow "Apple Inc"
|
And I follow "Apple Inc"
|
||||||
And I wait until ".has-many-selector ul li.template" is visible
|
And I wait until the has many selector is visible
|
||||||
And I press "+ add"
|
And I press "+ add"
|
||||||
Then I should see "Apple Inc » Projects — new item"
|
Then I should see "Apple Inc » Projects — new item"
|
||||||
And I should not see "Client" within the main form
|
And I should not see "Client" within the main form
|
||||||
When I fill in "Name" with "iPad"
|
When I fill in "Name" with "iPad"
|
||||||
And I press "Create"
|
And I press "Create"
|
||||||
Then I should see "Content was successfully created."
|
Then I should see "Content was successfully created."
|
||||||
When I wait until ".has-many-selector ul li.template" is visible
|
When I wait until the has many selector is visible
|
||||||
Then I should see "iPad"
|
Then I should see "iPad"
|
||||||
And "iPad" should not be an option for "label"
|
And "iPad" should not be an option for "label"
|
||||||
|
@ -10,6 +10,10 @@ When /^I wait until "([^"]*)" is visible$/ do |selector|
|
|||||||
page.has_css?("#{selector}", :visible => true)
|
page.has_css?("#{selector}", :visible => true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
When /^I wait until ([^"]*) is visible$/ do |locator|
|
||||||
|
page.has_css?(selector_for(locator), :visible => true)
|
||||||
|
end
|
||||||
|
|
||||||
Then /^"([^"]*)" should( not)? be an option for "([^"]*)"(?: within "([^\"]*)")?$/ do |value, negate, field, selector|
|
Then /^"([^"]*)" should( not)? be an option for "([^"]*)"(?: within "([^\"]*)")?$/ do |value, negate, field, selector|
|
||||||
with_scope(selector) do
|
with_scope(selector) do
|
||||||
expectation = negate ? :should_not : :should
|
expectation = negate ? :should_not : :should
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# http://mislav.uniqpath.com/2010/09/cuking-it-right/
|
# http://mislav.uniqpath.com/2010/09/cuking-it-right/
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
# 'as a movie title in the results' => 'ol.movies h1',
|
# 'as a movie title in the results' => 'ol.movies h1',
|
||||||
# 'in a button' => 'button, input[type=submit]',
|
# 'in a button' => 'button, input[type=submit]',
|
||||||
# 'in the navigation' => 'nav'
|
# 'in the navigation' => 'nav'
|
||||||
|
@ -19,6 +19,9 @@ module HtmlSelectorsHelpers
|
|||||||
|
|
||||||
when "the list of items"
|
when "the list of items"
|
||||||
".has-many-selector"
|
".has-many-selector"
|
||||||
|
|
||||||
|
when "the has many selector"
|
||||||
|
".has-many-selector ul li.template"
|
||||||
|
|
||||||
# Add more mappings here.
|
# Add more mappings here.
|
||||||
# Here is an example that pulls values out of the Regexp:
|
# Here is an example that pulls values out of the Regexp:
|
||||||
|
Loading…
Reference in New Issue
Block a user