cuke fix
This commit is contained in:
parent
f506a8778c
commit
18cd151456
1 changed files with 3 additions and 20 deletions
|
|
@ -33,27 +33,10 @@ Then /^the publisher should be expanded$/ do
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I append "([^"]*)" to the publisher$/ do |stuff|
|
When /^I append "([^"]*)" to the publisher$/ do |stuff|
|
||||||
# Wait for the publisher to appear and all the elements to lay out
|
previous_value = page.find("#status_message_fake_text").value
|
||||||
wait_until { evaluate_script("$('#status_message_fake_text').focus().length == 1") }
|
fill_in "status_message_fake_text", :with => previous_value + " " + stuff
|
||||||
|
|
||||||
# Write to the placeholder field and trigger a keyup to start the copy
|
|
||||||
page.execute_script <<-JS
|
|
||||||
$('#status_message_fake_text').val($('#status_message_fake_text').val() + '#{stuff}');
|
|
||||||
$('#status_message_fake_text').keyup();
|
|
||||||
JS
|
|
||||||
|
|
||||||
# Wait until the text appears in the placeholder
|
|
||||||
wait_until do
|
wait_until do
|
||||||
evaluate_script("$('#status_message_fake_text').val().match(/#{stuff}/) != null")
|
page.find("#status_message_text").value.match(/#{stuff}/)
|
||||||
end
|
|
||||||
|
|
||||||
# WAIT FOR IT!...
|
|
||||||
|
|
||||||
# Wait until the text copy is finished
|
|
||||||
wait_until do
|
|
||||||
evaluate_script <<-JS
|
|
||||||
$('#status_message_text').val() && ($('#status_message_text').val().match(/#{stuff}/) != null)
|
|
||||||
JS
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue