Browse Source

Reverted back to PhatomJs 2.1.1

development
Godwin 7 years ago
parent
commit
74d952393a
  1. 14
      features/contact_us.feature
  2. 1
      features/landing_page.feature
  3. 16
      features/sign_in.feature
  4. 19
      features/step_definitions/interface_steps.rb
  5. 15
      features/step_definitions/navigation.rb
  6. 9
      features/step_definitions/users.rb
  7. 59
      features/workshops.feature

14
features/contact_us.feature

@ -13,11 +13,12 @@ Feature: Contact Us
And select 'Something about the website' And select 'Something about the website'
And enter a subject as 'My Contact Subject' And enter a subject as 'My Contact Subject'
And enter a message as 'My contact message' And enter a message as 'My contact message'
And click the 'Send' button And press 'send'
# Then I should see 'Thank you for contacting us' Then I should be on the contact_sent page
And I should see 'Thank you for contacting us'
And the site administrator should get two 'My Contact Subject' emails And the site administrator should get two 'My contact subject' emails
And the site administrator should get a 'Details for' email And the site administrator should get a 'Details for' email
Scenario: Contact the site administrator from the contact page Scenario: Contact the site administrator from the contact page
@ -30,9 +31,10 @@ Feature: Contact Us
And select 'Something about the website' And select 'Something about the website'
And enter a subject as 'My Contact Subject' And enter a subject as 'My Contact Subject'
And enter a message as 'My contact message' And enter a message as 'My contact message'
And click the 'Send' button And press 'send'
# Then I should see 'Thank you for contacting us' Then I should be on the contact_sent page
And I should see 'Thank you for contacting us'
And the site administrator should get two 'My Contact Subject' emails And the site administrator should get two 'My contact subject' emails
And the site administrator should get a 'Details for' email And the site administrator should get a 'Details for' email

1
features/landing_page.feature

@ -46,4 +46,3 @@ Feature: Landing Page
Then I should see 'Brooklyn' Then I should see 'Brooklyn'
But I should not see 'Portland' But I should not see 'Portland'
And I should not see 'Prince Rupert' And I should not see 'Prince Rupert'

16
features/sign_in.feature

@ -15,7 +15,7 @@ Feature: Sign In
And I should get a 'confirmation' email And I should get a 'confirmation' email
When I click on the 'Confirm' link in the email When I click on the 'Confirm' link in the email
Then I should see 'Your Account' Then I should be on the settings page
Then I should not see a 'My registration' link Then I should not see a 'My registration' link
Scenario: Sign in from the settings page Scenario: Sign in from the settings page
@ -30,7 +30,7 @@ Feature: Sign In
And I should get a 'confirmation' email And I should get a 'confirmation' email
When I click on the 'Confirm' link in the email When I click on the 'Confirm' link in the email
Then I should see 'Your Account' Then I should be on the settings page
Scenario: Users can sign in in different sessions Scenario: Users can sign in in different sessions
Given there is an upcoming conference in 'Brooklyn NY' Given there is an upcoming conference in 'Brooklyn NY'
@ -40,7 +40,8 @@ Feature: Sign In
And I enter my email And I enter my email
And press confirm_email And press confirm_email
Then I should get a 'confirmation' email Then I should be on the do_confirm page
And I should get a 'confirmation' email
Then in a new session Then in a new session
When I click on the 'Confirm' link in the email When I click on the 'Confirm' link in the email
@ -49,7 +50,6 @@ Feature: Sign In
And click the 'Sign In' button And click the 'Sign In' button
Then I should be on the settings page Then I should be on the settings page
And I should see 'Your Account'
Scenario: A registration link should be accessible for registered users Scenario: A registration link should be accessible for registered users
Given there is an upcoming conference in 'Brooklyn NY' Given there is an upcoming conference in 'Brooklyn NY'
@ -75,7 +75,11 @@ Feature: Sign In
But my facebook account has no email address But my facebook account has no email address
When I log in with facebook When I log in with facebook
Then I should see 'Before proceeding, you must provide us an email address' Then I should be on the oauth_update page
And I should see 'Before proceeding, you must provide us an email address'
When I enter my email address When I enter my email address
And click the 'Save' button And press save
Then I should be on the home page
And I should see 'Mark Zuckerberg'
And I should see 'Sign out'

19
features/step_definitions/interface_steps.rb

@ -11,18 +11,14 @@ Then /^(?:I )?(?:should )?(not )?see (?:the |an? )?'(.+)' link$/i do |no, item|
end end
Then /^(?:I )?(?:should )?(?:still )?(not )?see '(.+)'$/i do |negate, item| Then /^(?:I )?(?:should )?(?:still )?(not )?see '(.+)'$/i do |negate, item|
attempt_to true do attempt_to do
attempt_to do expect(page).send(negate ? :not_to : :to, have_text(item))
expect(page).send(negate ? :not_to : :to, have_text(item))
end
end end
end end
Then /^(?:I )?(?:should )?(?:still )?(not )?see (?:my |the )([^']+)$/i do |negate, item| Then /^(?:I )?(?:should )?(?:still )?(not )?see (?:my |the )([^']+)$/i do |negate, item|
attempt_to true do attempt_to do
attempt_to do expect(page).send(negate ? :not_to : :to, have_text(TestState::Values[get_field(item)]))
expect(page).send(negate ? :not_to : :to, have_text(TestState::Values[get_field(item)]))
end
end end
end end
@ -37,10 +33,7 @@ Then /^(?:I )?click (?:on )?(?:the )?(a )?'(.+?)'( button| link)?(?: beside '(.+
else else
element = element_with_text(item, root_item) element = element_with_text(item, root_item)
end end
begin element.click
element.click
rescue Capybara::Poltergeist::TimeoutError
end
rescue Exception => e rescue Exception => e
puts text puts text
raise e raise e
@ -118,7 +111,7 @@ Then /^(?:I )?enter (?:my |an? |some |the )?(.+?)(?: as '(.+)')?$/i do |field, v
end end
end end
TestState::Values[field] = value (TestState::Values[field] = value)
element.set value element.set value

15
features/step_definitions/navigation.rb

@ -20,23 +20,10 @@ Given /^(?:(?:I )?am )?on an? (.+) error page$/i do |page_name|
end end
Then /^(?:I )?should be on (?:the |an? | my)?(.+) page$/i do |page_name| Then /^(?:I )?should be on (?:the |an? | my)?(.+) page$/i do |page_name|
sleep(1)
attempt_to do attempt_to do
path = path_to(page_name) path = path_to(page_name)
TestState.last_page = path
path = /(https?\/\/:[^\/]+)?#{Regexp.escape(path)}\/?(\?|#|$)/ unless path.is_a?(Regexp) path = /(https?\/\/:[^\/]+)?#{Regexp.escape(path)}\/?(\?|#|$)/ unless path.is_a?(Regexp)
begin current_url.should match path
current_url.should match path
rescue Exception => e
# due to a bug in phantomjs 2.5-development, sometimes postbacks don't work properly, this is a workaround
if page.driver.network_traffic.last.url =~ path && page.driver.network_traffic.last.method =~ /^get$/i && page.driver.network_traffic.last.response_parts.present? && page.driver.network_traffic.last.response_parts.first.status == 200
attempt_to do
visit page.driver.network_traffic.last.url
end
else
raise e
end
end
end end
end end

9
features/step_definitions/users.rb

@ -14,13 +14,12 @@ Given /^(?:I )?(?:am logged|log) in(?: as '(.+)')?$/i do |email|
end end
first(selector_for('email')).set(TestState.my_account.email) first(selector_for('email')).set(TestState.my_account.email)
begin first('#token + button[type="submit"]').click
first('.flex-form button').click
rescue Capybara::Poltergeist::TimeoutError
end
attempt_to true do begin
expect(page).to have_link TestState.my_account.name expect(page).to have_link TestState.my_account.name
rescue
fail "Error logging in"
end end
end end
end end

59
features/workshops.feature

@ -56,19 +56,13 @@ Feature: Workshops
Then I should see 'Deleting a workshop cannot be undone' Then I should see 'Deleting a workshop cannot be undone'
When I click on the 'Cancel' button When I click on the 'Cancel' button
Then I should be on my workshop page Then I should see 'Tools'
And I should see 'Tools'
And should see 'Education' And should see 'Education'
When I click the 'Delete Workshop' link When I click the 'Delete Workshop' link
And click the 'Confirm' button And click the 'Confirm' button
Then I should see 'Propose a Workshop'
Then I should be on the delete_workshop page But I should not see any workshops
And I click the 'Confirm' button
# Then I should be on my workshop page
# And I should see 'Propose a Workshop'
# But I should not see any workshops
Scenario: Users can comment on an translate their own workshops Scenario: Users can comment on an translate their own workshops
Given that there is an upcoming conference Given that there is an upcoming conference
@ -85,25 +79,19 @@ Feature: Workshops
When I enter my title as 'Puentes a las bicicletas' When I enter my title as 'Puentes a las bicicletas'
And enter some info And enter some info
And click the 'Save' button And click the 'Save' button
Then I should be on my workshop page Then my workshop title should be 'Bridges to Bicycles'
And my workshop title should be 'Bridges to Bicycles'
And my Spanish workshop title should be 'Puentes a las bicicletas' And my Spanish workshop title should be 'Puentes a las bicicletas'
And I should see 'Bridges to Bicycles' And I should see 'Bridges to Bicycles'
When I enter a comment When I enter a comment
And I click the 'Add Comment' button And I click the 'Add Comment' button
Then I should see 'less than a minute ago'
Then I should be on my workshop page
And I should see 'less than a minute ago'
And I should see my comment And I should see my comment
When I click the 'Reply' button When I click the 'Reply' button
And enter a reply And enter a reply
And click the 'Reply' button And click the 'Reply' button
Then I should see my comment
Then I should be on my workshop page
And I should see 'less than a minute ago'
And I should see my comment
And see my reply And see my reply
Scenario: Users can add facilitators to their workshops Scenario: Users can add facilitators to their workshops
@ -135,10 +123,9 @@ Feature: Workshops
Then I should see 'Please Confirm' Then I should see 'Please Confirm'
And I should see 'Yes' And I should see 'Yes'
And click the 'Yes' button And click the 'Yes' button
Then I should not see 'Please Confirm' Then I should not see 'Please Confirm'
# And I should not see 'new-facilitator@bikebike.org Unregistered' And I should not see 'new-facilitator@bikebike.org Unregistered'
# But I should see 'Applying for 501c3 status' But I should see 'Applying for 501c3 status'
Scenario: Users can approve and deny facilitation requests on their workshops Scenario: Users can approve and deny facilitation requests on their workshops
Given that there is an upcoming conference Given that there is an upcoming conference
@ -163,13 +150,15 @@ Feature: Workshops
And I should see 'Hadrian Requested' And I should see 'Hadrian Requested'
When I click the 'Deny' button beside 'Spartacus' When I click the 'Deny' button beside 'Spartacus'
Then I should see 'Saladin' Then I should be on my workshop page
And I should see 'Saladin'
And I should see 'Hadrian' And I should see 'Hadrian'
But I should not see 'Spartacus' But I should not see 'Spartacus'
And 'Spartacus' should get a 'Your request to facilitate Sturmey Archer Hub Repair has been denied' email And 'Spartacus' should get a 'Your request to facilitate Sturmey Archer Hub Repair has been denied' email
When I click the 'Approve' button beside 'Saladin' When I click the 'Approve' button beside 'Saladin'
Then I should see 'Saladin Collaborator' Then I should be on my workshop page
And I should see 'Saladin Collaborator'
And 'Saladin' should get a 'You have been added as a facilitator of Sturmey Archer Hub Repair' email And 'Saladin' should get a 'You have been added as a facilitator of Sturmey Archer Hub Repair' email
When I click the 'Approve' button beside 'Hadrian' When I click the 'Approve' button beside 'Hadrian'
@ -189,9 +178,7 @@ Feature: Workshops
And see 'Are you sure you would like to remove Hadrian as a facilitator of this workshop?' And see 'Are you sure you would like to remove Hadrian as a facilitator of this workshop?'
When I click on the 'Yes' button When I click on the 'Yes' button
And reload the page Then I should not see 'Hadrian'
Then I should be on my workshop page
And I should not see 'Hadrian'
When I click the 'Transfer Ownership' button beside 'Saladin' When I click the 'Transfer Ownership' button beside 'Saladin'
Then I should see 'Please Confirm' Then I should see 'Please Confirm'
@ -205,8 +192,7 @@ Feature: Workshops
And see 'Are you sure you want to transfer ownership to Saladin?' And see 'Are you sure you want to transfer ownership to Saladin?'
When I click the 'Yes' button When I click the 'Yes' button
Then I should be on my workshop page Then I should not see 'Saladin Collaborator'
And I should not see 'Saladin Collaborator'
But I should see 'Saladin Owner' But I should see 'Saladin Owner'
When I click the 'Leave' button When I click the 'Leave' button
@ -221,8 +207,7 @@ Feature: Workshops
And see 'Are you sure you would like to remove yourself as a facilitator of this workshop?' And see 'Are you sure you would like to remove yourself as a facilitator of this workshop?'
When I click the 'Yes' button When I click the 'Yes' button
Then I should be on my workshop page Then I should not see 'Leave'
And I should not see 'Leave'
But I should see 'Make a facilitation request' But I should see 'Make a facilitation request'
When I click the 'Make a facilitation request' button When I click the 'Make a facilitation request' button
@ -245,8 +230,7 @@ Feature: Workshops
Then I should still see 'Cancel Request' Then I should still see 'Cancel Request'
When I click the 'Cancel Request' button again When I click the 'Cancel Request' button again
And click the 'Yes' button And click the 'Yes' button
Then I should be on my workshop page Then I should not see 'Cancel Request'
And I should not see 'Cancel Request'
But I should see 'Make a facilitation request' But I should see 'Make a facilitation request'
Scenario: Users can add interest to workshops Scenario: Users can add interest to workshops
@ -306,8 +290,7 @@ Feature: Workshops
And enter some info And enter some info
And click the 'Save' button And click the 'Save' button
Then I should be on my workshop page Then the Spanish workshop title should be 'Horas de las mujeres y de los transexuales'
And the Spanish workshop title should be 'Horas de las mujeres y de los transexuales'
And I should see 'Women and Transgender shop hours' And I should see 'Women and Transgender shop hours'
And 'Macbeth' should get a 'The translation for Women and Transgender shop hours has been modified' email And 'Macbeth' should get a 'The translation for Women and Transgender shop hours has been modified' email
@ -326,8 +309,7 @@ Feature: Workshops
And enter a comment as 'Will you be covering Canadian contracts?' And enter a comment as 'Will you be covering Canadian contracts?'
And click the 'Add Comment' button And click the 'Add Comment' button
Then I should be on my workshop page Then I should see 'Will you be covering Canadian contracts?'
And I should see 'Will you be covering Canadian contracts?'
And 'Brunhilda' should get a 'commented' email And 'Brunhilda' should get a 'commented' email
When in a new session When in a new session
@ -337,6 +319,5 @@ Feature: Workshops
And enter a reply as 'If we can find a Canadian facilitator' And enter a reply as 'If we can find a Canadian facilitator'
And click the 'Reply' button And click the 'Reply' button
Then I should be on my workshop page Then I should see 'If we can find a Canadian facilitator'
And I should see 'If we can find a Canadian facilitator' And 'Geronimo' should get a 'replied' email
And 'Geronimo' should get a 'replied' email
Loading…
Cancel
Save