mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
Merge pull request #1996 from dnrce/cucumber-failures
Address some Cucumber failures
This commit is contained in:
commit
ef0a2ded5b
5 changed files with 12 additions and 11 deletions
|
|
@ -10,8 +10,8 @@ end
|
|||
When /^I drag "(.*)" to "(.*)"$/ do |dragged, target|
|
||||
drag_id = Todo.where(:description => dragged).first.id
|
||||
drop_id = Todo.where(:description => target).first.id
|
||||
drag_elem = page.find(:xpath, "//div[@id='line_todo_#{drag_id}']//img[@class='grip']")
|
||||
drop_elem = page.find(:xpath, "//div[@id='line_todo_#{drop_id}']")
|
||||
drag_elem = page.find("div#line_todo_#{drag_id} img.grip")
|
||||
drop_elem = page.find("div#line_todo_#{drop_id}")
|
||||
|
||||
drag_elem.drag_to(drop_elem)
|
||||
end
|
||||
|
|
@ -42,11 +42,8 @@ When /^I edit the dependency of "([^"]*)" to add "([^"]*)" as predecessor$/ do |
|
|||
# in webkit, the autocompleter is not fired after fill_in
|
||||
page.execute_script %Q{$("#{form_css}").find('input[id$="predecessor_input"]').autocomplete('search')} if Capybara.javascript_driver == :webkit
|
||||
|
||||
# wait for auto complete
|
||||
expect(page).to have_css("a.ui-state-focus")
|
||||
|
||||
# click first line
|
||||
page.find(:css, "ul li a.ui-state-focus").click
|
||||
page.find('ul.ui-autocomplete li.ui-state-focus').click
|
||||
|
||||
# wait for the new dependency to be added to the list
|
||||
expect(page).to have_css("li#pred_#{predecessor.id}")
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ When /^I edit the due date of "([^"]*)" to "([^"]*)"$/ do |action_description, d
|
|||
|
||||
open_edit_form_for(todo)
|
||||
fill_in "due_todo_#{todo.id}", :with => date
|
||||
close_datepicker
|
||||
submit_edit_todo_form(todo)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -75,9 +75,7 @@ end
|
|||
Then /^I should see an active todo "([^"]*)"$/ do |todo_description|
|
||||
todo = @current_user.todos.where(:description => todo_description).first
|
||||
expect(todo).to_not be_nil
|
||||
|
||||
xpath = "//div[@id='line_todo_#{todo.id}']/img[@class='grip']"
|
||||
expect(page).to have_xpath(xpath, :visible=>true)
|
||||
expect(page).to have_css("div#line_todo_#{todo.id} img.grip", :visible=>true)
|
||||
end
|
||||
|
||||
Then /^the number of actions should be (\d+)$/ do |count|
|
||||
|
|
|
|||
|
|
@ -109,4 +109,9 @@ module TracksFormHelper
|
|||
execute_javascript("$('#todo_project_name').val('');")
|
||||
end
|
||||
|
||||
def close_datepicker
|
||||
within '.ui-datepicker' do
|
||||
click_button 'Done'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ module TracksStepHelper
|
|||
end
|
||||
|
||||
def wait_for_auto_complete
|
||||
expect(page).to have_css("a.ui-state-focus", :visible => true)
|
||||
expect(page).to have_css("ul.ui-autocomplete li.ui-state-focus", :visible => true)
|
||||
end
|
||||
|
||||
def click_first_line_of_auto_complete
|
||||
page.find(:css, "ul li a.ui-state-focus").click
|
||||
page.find(:css, "ul.ui-autocomplete li.ui-state-focus").click
|
||||
end
|
||||
|
||||
def check_xpath_visibility(visible, xpath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue