mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-15 03:38:08 +01:00
migrate selenium script for integrations page and enhance the story
This commit is contained in:
parent
44c61d942a
commit
d6e20a76c2
6 changed files with 74 additions and 15 deletions
|
|
@ -1,7 +1,18 @@
|
|||
Given /^I have no contexts$/ do
|
||||
# should probably not be needed as you use this given at the start of a scenario
|
||||
Context.delete_all
|
||||
end
|
||||
|
||||
Given /^I have a context called "([^\"]*)"$/ do |context_name|
|
||||
@context = @current_user.contexts.create!(:name => context_name)
|
||||
end
|
||||
|
||||
Given /^I have the following contexts:$/ do |table|
|
||||
table.hashes.each do |context|
|
||||
Given 'I have a context called "'+context[:context]+'"'
|
||||
end
|
||||
end
|
||||
|
||||
Given /^I have a context "([^\"]*)" with (.*) actions$/ do |context_name, number_of_actions|
|
||||
context = @current_user.contexts.create!(:name => context_name)
|
||||
1.upto number_of_actions.to_i do |i|
|
||||
|
|
|
|||
23
features/step_definitions/integration_steps.rb
Normal file
23
features/step_definitions/integration_steps.rb
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
Then /^I should see a message that you need a context to see scripts$/ do
|
||||
Then 'I should see "You do not have any context yet. The script will be available after you add your first context"'
|
||||
end
|
||||
|
||||
Then /^I should see scripts$/ do
|
||||
# check on a small snippet of the first applescript
|
||||
Then 'I should see "set returnValue to call xmlrpc"'
|
||||
end
|
||||
|
||||
Then /^I should see a script "([^\"]*)" for "([^\"]*)"$/ do |script, context_name|
|
||||
selenium.is_visible(script)
|
||||
context = Context.find_by_name(context_name)
|
||||
|
||||
# wait for the script to refresh
|
||||
wait_for :timeout => 15 do
|
||||
selenium.is_text_present("#{context.id} (* #{context_name} *)")
|
||||
end
|
||||
|
||||
# make sure the text is found within the textarea
|
||||
script_source = selenium.get_text("//textarea[@id='#{script}']")
|
||||
script_source.should =~ /#{context.id} \(\* #{context_name} \*\)/
|
||||
end
|
||||
|
||||
|
|
@ -62,7 +62,6 @@ Then /^the first note should disappear$/ do
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
Then /^I should see the note text$/ do
|
||||
Then "I should see \"after 50 characters\""
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue