mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-22 15:14:07 +01:00
another set of fixes for the cucumber scenario's
This commit is contained in:
parent
da2bee2e53
commit
b18b222834
7 changed files with 56 additions and 40 deletions
|
|
@ -188,7 +188,9 @@ end
|
|||
####### submitting using sidebar form #######
|
||||
|
||||
When /^I submit a new action with description "([^"]*)"$/ do |description|
|
||||
fill_in "todo[description]", :with => description
|
||||
within "form#todo-form-new-action" do
|
||||
fill_in "todo[description]", :with => description
|
||||
end
|
||||
submit_next_action_form
|
||||
end
|
||||
|
||||
|
|
@ -196,16 +198,16 @@ When /^I submit a new action with description "([^"]*)" with a dependency on "([
|
|||
predecessor = @current_user.todos.find_by_description(predecessor_description)
|
||||
predecessor.should_not be_nil
|
||||
|
||||
fill_in "todo[description]", :with => todo_description
|
||||
fill_in "predecessor_input", :with => predecessor_description
|
||||
within "form#todo-form-new-action" do
|
||||
fill_in "todo[description]", :with => todo_description
|
||||
fill_in "predecessor_input", :with => predecessor_description
|
||||
end
|
||||
|
||||
# wait for auto complete
|
||||
autocomplete = "//a[@id='ui-active-menuitem']"
|
||||
page.should have_xpath(autocomplete, :visible => true)
|
||||
# wait for auto complete
|
||||
page.should have_css("a.ui-state-focus", :visible => true)
|
||||
|
||||
# click first line
|
||||
first_elem = "//ul/li[1]/a[@id='ui-active-menuitem']"
|
||||
page.find(:xpath, first_elem).click
|
||||
page.find(:css, "ul li a.ui-state-focus").click
|
||||
|
||||
new_dependency_line = "//li[@id='pred_#{predecessor.id}']"
|
||||
page.should have_xpath(new_dependency_line, :visible => true)
|
||||
|
|
@ -214,24 +216,28 @@ When /^I submit a new action with description "([^"]*)" with a dependency on "([
|
|||
end
|
||||
|
||||
When /^I submit a new action with description "([^"]*)" and the tags "([^"]*)" in the context "([^"]*)"$/ do |description, tags, context_name|
|
||||
fill_in "todo[description]", :with => description
|
||||
fill_in "tag_list", :with => tags
|
||||
within "form#todo-form-new-action" do
|
||||
fill_in "todo[description]", :with => description
|
||||
fill_in "tag_list", :with => tags
|
||||
|
||||
# fill_in does not seem to work when the field is prefilled with something. Empty the field first
|
||||
clear_context_name_from_next_action_form
|
||||
fill_in "todo_context_name", :with => context_name
|
||||
# fill_in does not seem to work when the field is prefilled with something. Empty the field first
|
||||
clear_context_name_from_next_action_form
|
||||
fill_in "todo_context_name", :with => context_name
|
||||
end
|
||||
submit_next_action_form
|
||||
end
|
||||
|
||||
When /^I submit a new action with description "([^"]*)" to project "([^"]*)" with tags "([^"]*)" in the context "([^"]*)"$/ do |description, project_name, tags, context_name|
|
||||
fill_in "todo[description]", :with => description
|
||||
within "form#todo-form-new-action" do
|
||||
fill_in "todo[description]", :with => description
|
||||
|
||||
clear_project_name_from_next_action_form
|
||||
clear_context_name_from_next_action_form
|
||||
clear_project_name_from_next_action_form
|
||||
clear_context_name_from_next_action_form
|
||||
|
||||
fill_in "todo_project_name", :with => project_name
|
||||
fill_in "todo_context_name", :with => context_name
|
||||
fill_in "tag_list", :with => tags
|
||||
fill_in "todo_project_name", :with => project_name
|
||||
fill_in "todo_context_name", :with => context_name
|
||||
fill_in "tag_list", :with => tags
|
||||
end
|
||||
|
||||
submit_next_action_form
|
||||
end
|
||||
|
|
@ -241,10 +247,12 @@ When /^I submit a new action with description "([^"]*)" to project "([^"]*)" in
|
|||
end
|
||||
|
||||
When /^I submit a new action with description "([^"]*)" in the context "([^"]*)"$/ do |description, context_name|
|
||||
fill_in "todo[description]", :with => description
|
||||
within "form#todo-form-new-action" do
|
||||
fill_in "todo[description]", :with => description
|
||||
|
||||
clear_context_name_from_next_action_form
|
||||
fill_in "todo_context_name", :with => context_name
|
||||
clear_context_name_from_next_action_form
|
||||
fill_in "todo_context_name", :with => context_name
|
||||
end
|
||||
|
||||
submit_next_action_form
|
||||
end
|
||||
|
|
@ -258,13 +266,15 @@ When /^I submit a new deferred action with description "([^"]*)"$/ do |descripti
|
|||
end
|
||||
|
||||
When /^I submit a new deferred action with description "([^"]*)" and the tags "([^"]*)" in the context "([^"]*)"$/ do |description, tags, context_name|
|
||||
fill_in "todo[description]", :with => description
|
||||
within "form#todo-form-new-action" do
|
||||
fill_in "todo[description]", :with => description
|
||||
|
||||
clear_context_name_from_next_action_form
|
||||
fill_in "todo_context_name", :with => context_name
|
||||
clear_context_name_from_next_action_form
|
||||
fill_in "todo_context_name", :with => context_name
|
||||
|
||||
fill_in "tag_list", :with => tags
|
||||
fill_in "todo[show_from]", :with => format_date(@current_user.time + 1.week)
|
||||
fill_in "tag_list", :with => tags
|
||||
fill_in "todo[show_from]", :with => format_date(@current_user.time + 1.week)
|
||||
end
|
||||
submit_next_action_form
|
||||
end
|
||||
|
||||
|
|
@ -274,10 +284,12 @@ When /^I submit a new deferred action with description "([^"]*)" to project "([^
|
|||
clear_project_name_from_next_action_form
|
||||
clear_context_name_from_next_action_form
|
||||
|
||||
fill_in "todo_project_name", :with => project_name
|
||||
fill_in "todo_context_name", :with => context_name
|
||||
fill_in "tag_list", :with => tags
|
||||
fill_in "todo[show_from]", :with => format_date(@current_user.time + 1.week)
|
||||
within "form#todo-form-new-action" do
|
||||
fill_in "todo_project_name", :with => project_name
|
||||
fill_in "todo_context_name", :with => context_name
|
||||
fill_in "tag_list", :with => tags
|
||||
fill_in "todo[show_from]", :with => format_date(@current_user.time + 1.week)
|
||||
end
|
||||
|
||||
submit_next_action_form
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
When /^I select the second page$/ do
|
||||
step "I follow \"2\" within \"div.paginate_header\""
|
||||
end
|
||||
|
||||
####### DELETE #######
|
||||
|
||||
When /^I delete the action "([^"]*)"$/ do |action_description|
|
||||
|
|
@ -108,7 +112,7 @@ Then /^I should see the page selector$/ do
|
|||
end
|
||||
|
||||
Then /^the page should be "([^"]*)"$/ do |page_number|
|
||||
page.find(:xpath, ".//em[@class='current']").text.should == page_number
|
||||
page.find(:xpath, ".//div[@class='paginate_header']//em[@class='current']").text.should == page_number
|
||||
end
|
||||
|
||||
Then /^the project field of the new todo form should contain "([^"]*)"$/ do |project_name|
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ Feature: Show done
|
|||
Given I have 50 completed todos with a note in project "test project" in context "@pc" with tags "starred"
|
||||
When I go to the <page>
|
||||
Then I should see the page selector
|
||||
When I follow "2"
|
||||
When I select the second page
|
||||
Then I should be on the <page>
|
||||
And the page should be "2"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue