Fix/expand cucumber feature for new user signup.
Replace "wait for aspects page"-type steps with general wait for step.
This commit is contained in:
parent
7bfaf462c8
commit
e7cf5fc841
5 changed files with 45 additions and 37 deletions
|
|
@ -49,7 +49,7 @@
|
||||||
%h4
|
%h4
|
||||||
= t('.aspect_name')
|
= t('.aspect_name')
|
||||||
= form_for Aspect.new do |aspect|
|
= form_for Aspect.new do |aspect|
|
||||||
= aspect.text_field :name, :style => "display:inline;"
|
= aspect.text_field :name, :id => "step-2-aspect-name", :style => "display:inline;"
|
||||||
%p.checkbox_select
|
%p.checkbox_select
|
||||||
= aspect.label :contacts_visible, t('aspects.edit.make_aspect_list_visible')
|
= aspect.label :contacts_visible, t('aspects.edit.make_aspect_list_visible')
|
||||||
= aspect.check_box :contacts_visible, :default => true
|
= aspect.check_box :contacts_visible, :default => true
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ Feature: managing contact requests
|
||||||
When I am on the aspects manage page
|
When I am on the aspects manage page
|
||||||
Then I should see "1" within "#notification_badge"
|
Then I should see "1" within "#notification_badge"
|
||||||
When I click on the contact request
|
When I click on the contact request
|
||||||
And I wait for the requestors profile page to load
|
And I wait for "the requestors profile" to load
|
||||||
Then I should be on the requestors profile
|
Then I should be on the requestors profile
|
||||||
And I should see "wants to share with you"
|
And I should see "wants to share with you"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,21 +16,22 @@ Feature: new user registration
|
||||||
And I fill in "profile_last_name" with "Hai"
|
And I fill in "profile_last_name" with "Hai"
|
||||||
And I fill in "profile_gender" with "guess!"
|
And I fill in "profile_gender" with "guess!"
|
||||||
And I press "Save and continue"
|
And I press "Save and continue"
|
||||||
|
And I wait for "step 2" to load
|
||||||
Then I should see "Profile updated"
|
Then I should see "Profile updated"
|
||||||
And I should see "Your aspects"
|
And I should see "Your aspects"
|
||||||
|
|
||||||
|
When I fill in "step-2-aspect-name" with "cheez friends"
|
||||||
|
And I press "Add"
|
||||||
|
Then I should see "cheez friends"
|
||||||
|
|
||||||
# Not working with selenium - it thinks the aspect name field is hidden
|
|
||||||
# When I fill in "Aspect name" with "cheez friends"
|
|
||||||
# And I press "Add"
|
|
||||||
# And show me the page
|
|
||||||
# Then I should see "cheez friends"
|
|
||||||
When I follow "Save and continue"
|
When I follow "Save and continue"
|
||||||
|
And I wait for "step 3" to load
|
||||||
Then I should see "Your services"
|
Then I should see "Your services"
|
||||||
|
|
||||||
When I follow "Save and continue"
|
When I follow "Save and continue"
|
||||||
|
And I wait for "step 4" to load
|
||||||
Then I should see "You're all set up, O!"
|
Then I should see "You're all set up, O!"
|
||||||
And I should not see "skip getting started"
|
But I should not see "skip getting started"
|
||||||
|
|
||||||
When I follow "Continue on to your Home page, an overview of all of your aspects."
|
When I follow "Continue on to your Home page, an overview of all of your aspects."
|
||||||
Then I should be on the aspects page
|
Then I should be on the aspects page
|
||||||
|
|
@ -43,6 +44,6 @@ Feature: new user registration
|
||||||
|
|
||||||
Scenario: new user skips the setup wizard
|
Scenario: new user skips the setup wizard
|
||||||
When I follow "skip getting started"
|
When I follow "skip getting started"
|
||||||
And I wait for the aspects page to load
|
And I wait for "the aspects page" to load
|
||||||
Then I should be on the aspects page
|
Then I should be on the aspects page
|
||||||
And I should see "Bring the people that matter in your life to Diaspora!"
|
And I should see "Bring the people that matter in your life to Diaspora!"
|
||||||
|
|
|
||||||
|
|
@ -47,14 +47,6 @@ Then /^I should see "([^\"]*)" in the main content area$/ do |stuff|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I wait for the aspects page to load$/ do
|
|
||||||
wait_until { current_path == aspects_path }
|
|
||||||
end
|
|
||||||
|
|
||||||
When /^I wait for the requestors profile page to load$/ do
|
|
||||||
wait_until { current_path == person_path(Request.where(:recipient_id => @me.person.id).first.sender) }
|
|
||||||
end
|
|
||||||
|
|
||||||
When /^I wait for the ajax to finish$/ do
|
When /^I wait for the ajax to finish$/ do
|
||||||
wait_until(10) { evaluate_script("$.active") == 0 }
|
wait_until(10) { evaluate_script("$.active") == 0 }
|
||||||
end
|
end
|
||||||
|
|
@ -68,3 +60,12 @@ When /^I click ok in the confirm dialog to appear next$/ do
|
||||||
window.confirm = function() { return true; };
|
window.confirm = function() { return true; };
|
||||||
JS
|
JS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
When /^I wait for "([^\"]*)" to load$/ do |page_name|
|
||||||
|
wait_until(10) do
|
||||||
|
uri = URI.parse(current_url)
|
||||||
|
current_location = uri.path
|
||||||
|
current_location << "?#{uri.query}" unless uri.query.blank?
|
||||||
|
current_location == path_to(page_name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -1,26 +1,32 @@
|
||||||
module NavigationHelpers
|
module NavigationHelpers
|
||||||
def path_to(page_name)
|
def path_to(page_name)
|
||||||
case page_name
|
case page_name
|
||||||
when /^the home page$/
|
when /^the home page$/
|
||||||
root_path
|
root_path
|
||||||
when /^its ([\w ]+) page$/
|
when /^step (\d)$/
|
||||||
send("#{$1.gsub(/\W+/, '_')}_path", @it)
|
if $1.to_i == 1
|
||||||
when /^the ([\w ]+) page$/
|
getting_started_path
|
||||||
send("#{$1.gsub(/\W+/, '_')}_path")
|
else
|
||||||
when /^my edit profile page$/
|
getting_started_path(:step => $1)
|
||||||
edit_person_path(@me.person)
|
end
|
||||||
when /^my acceptance form page$/
|
when /^its ([\w ]+) page$/
|
||||||
accept_user_invitation_path(:invitation_token => @me.invitation_token)
|
send("#{$1.gsub(/\W+/, '_')}_path", @it)
|
||||||
when /^the requestors profile$/
|
when /^the ([\w ]+) page$/
|
||||||
person_path(Request.where(:recipient_id => @me.person.id).first.sender)
|
send("#{$1.gsub(/\W+/, '_')}_path")
|
||||||
when /^"([^\"]*)"'s page$/
|
when /^my edit profile page$/
|
||||||
person_path(User.find_by_email($1).person)
|
edit_person_path(@me.person)
|
||||||
when /^my account settings page$/
|
when /^my acceptance form page$/
|
||||||
edit_user_path(@me)
|
accept_user_invitation_path(:invitation_token => @me.invitation_token)
|
||||||
when /^"(\/.*)"/
|
when /^the requestors profile$/
|
||||||
$1
|
person_path(Request.where(:recipient_id => @me.person.id).first.sender)
|
||||||
else
|
when /^"([^\"]*)"'s page$/
|
||||||
raise "Can't find mapping from \"#{page_name}\" to a path."
|
person_path(User.find_by_email($1).person)
|
||||||
|
when /^my account settings page$/
|
||||||
|
edit_user_path(@me)
|
||||||
|
when /^"(\/.*)"/
|
||||||
|
$1
|
||||||
|
else
|
||||||
|
raise "Can't find mapping from \"#{page_name}\" to a path."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue