Fixed tests for PhantomJS 2.5
This commit is contained in:
		
							parent
							
								
									369540ba64
								
							
						
					
					
						commit
						7d7166c3be
					
				| @ -7,8 +7,8 @@ | ||||
|     }, | ||||
|     "development": { | ||||
|       "safari": ["5", "5.1"], | ||||
|       "and_chr": ["57"], | ||||
|       "chrome": ["57"], | ||||
|       "and_chr": ["59"], | ||||
|       "chrome": ["59"], | ||||
|       "edge": ["13"], | ||||
|       "firefox": ["50"], | ||||
|       "ie": ["11"], | ||||
|  | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -78,7 +78,4 @@ Feature: Sign In | ||||
|     Then I should see 'Before proceeding, you must provide us an email address' | ||||
| 
 | ||||
|     When I enter my email address | ||||
|     And press save | ||||
| 
 | ||||
|     Then I should see 'Mark Zuckerberg' | ||||
|     And I should see 'Sign out' | ||||
|     And click the 'Save' button | ||||
|  | ||||
| @ -11,14 +11,18 @@ Then /^(?:I )?(?:should )?(not )?see (?:the |an? )?'(.+)' link$/i do |no, item| | ||||
| end | ||||
| 
 | ||||
| Then /^(?:I )?(?:should )?(?:still )?(not )?see '(.+)'$/i do |negate, item| | ||||
|   attempt_to do | ||||
|     expect(page).send(negate ? :not_to : :to, have_text(item)) | ||||
|   attempt_to true do | ||||
|     attempt_to do | ||||
|       expect(page).send(negate ? :not_to : :to, have_text(item)) | ||||
|     end | ||||
|   end | ||||
| end | ||||
| 
 | ||||
| Then /^(?:I )?(?:should )?(?:still )?(not )?see (?:my |the )([^']+)$/i do |negate, item| | ||||
|   attempt_to do | ||||
|     expect(page).send(negate ? :not_to : :to, have_text(TestState::Values[get_field(item)])) | ||||
|   attempt_to true do | ||||
|     attempt_to do | ||||
|       expect(page).send(negate ? :not_to : :to, have_text(TestState::Values[get_field(item)])) | ||||
|     end | ||||
|   end | ||||
| end | ||||
| 
 | ||||
| @ -114,7 +118,7 @@ Then /^(?:I )?enter (?:my |an? |some |the )?(.+?)(?: as '(.+)')?$/i do |field, v | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|  (TestState::Values[field] = value) | ||||
|   TestState::Values[field] = value | ||||
| 
 | ||||
|   element.set value | ||||
| 
 | ||||
|  | ||||
| @ -23,6 +23,7 @@ Then /^(?:I )?should be on (?:the |an? | my)?(.+) page$/i do |page_name| | ||||
|   sleep(1) | ||||
|   attempt_to do | ||||
|     path = path_to(page_name) | ||||
|     TestState.last_page = path | ||||
|     path = /(https?\/\/:[^\/]+)?#{Regexp.escape(path)}\/?(\?|#|$)/ unless path.is_a?(Regexp) | ||||
|     begin | ||||
|       current_url.should match path | ||||
| @ -33,7 +34,6 @@ Then /^(?:I )?should be on (?:the |an? | my)?(.+) page$/i do |page_name| | ||||
|           visit page.driver.network_traffic.last.url | ||||
|         end | ||||
|       else | ||||
|         puts "#{page.driver.network_traffic.last.method} #{page.driver.network_traffic.last.url} (#{page.driver.network_traffic.last.response_parts.first.status}) != #{path}" | ||||
|         raise e | ||||
|       end | ||||
|     end | ||||
|  | ||||
| @ -24,7 +24,7 @@ Capybara.register_driver :bb_poltergeist do |app| | ||||
|   end | ||||
| 
 | ||||
|   opts = { | ||||
|     timeout: 60, | ||||
|     timeout: 10, | ||||
|     window_size: [1200, 800] | ||||
|   } | ||||
|   Capybara::Poltergeist::Driver.new(app, opts) | ||||
| @ -50,9 +50,12 @@ Before do | ||||
| end | ||||
| 
 | ||||
| After do |scenario| | ||||
|   sleep 1 | ||||
|   log_result scenario | ||||
|   LinguaFranca.screenshot_mail | ||||
| 
 | ||||
|   if LinguaFranca.recording? | ||||
|     sleep 1 | ||||
|     LinguaFranca.screenshot_mail | ||||
|   end | ||||
| 
 | ||||
|   if scenario.failed? | ||||
|     if @exception | ||||
|  | ||||
| @ -53,7 +53,7 @@ def capture_html(distance_from_root = 3) | ||||
|   html.gsub(/(=\"|\(['"]?)(?:#{host})?\/(assets|uploads)/, "\\1#{public_dir}\\2") | ||||
| end | ||||
| 
 | ||||
| def attempt_to(&block) | ||||
| def attempt_to(refresh_on_fail = false, &block) | ||||
|   begin | ||||
|     retries ||= 0 | ||||
|     timeout ||= 0 | ||||
| @ -61,8 +61,7 @@ def attempt_to(&block) | ||||
|     yield | ||||
|   rescue Exception => e | ||||
|     raise e unless (retries += 1) <= 4 | ||||
|     # puts "Failed: #{e}" | ||||
|     # puts "Retry ##{retries}" | ||||
|     visit TestState.last_page if TestState.last_page && refresh_on_fail | ||||
|     sleep(timeout * timeout) | ||||
|     retry | ||||
|   end | ||||
| @ -84,7 +83,7 @@ end | ||||
| def emails_to(email_address, subject = nil) | ||||
|   ActionMailer::Base.deliveries.select do |mail| | ||||
|     mail.to.include?(email_address) && | ||||
|       (subject.nil? || mail.subject.downcase =~ /#{Regexp.escape(subject.downcase)}/) | ||||
|       (subject.nil? || mail.subject.downcase.include?(subject.downcase)) | ||||
|   end | ||||
| end | ||||
| 
 | ||||
|  | ||||
| @ -10,6 +10,9 @@ module NavigationHelpers | ||||
|       path = :view_workshop | ||||
|       args << TestState.last_conference.slug | ||||
|       args << TestState.last_workshop.id | ||||
|     when /^delete_workshop$/i | ||||
|       args << TestState.last_conference.slug | ||||
|       args << TestState.last_workshop.id | ||||
|     when /^registration$/i | ||||
|       path = :register | ||||
|       args << TestState.last_conference.slug | ||||
|  | ||||
| @ -6,6 +6,7 @@ module TestState | ||||
|     attr_accessor :last_organization | ||||
|     attr_accessor :last_email | ||||
|     attr_accessor :it | ||||
|     attr_accessor :last_page | ||||
| 
 | ||||
|     def my_account=(user) | ||||
|       @my_account = user | ||||
|  | ||||
| @ -21,7 +21,8 @@ Feature: Workshops | ||||
|     And check 'Meeting Room' | ||||
|     And click the 'Save' button | ||||
| 
 | ||||
|     Then I should see 'Funding' | ||||
|     Then I should be on my workshop page | ||||
|     And I should see 'Funding' | ||||
|     And should see 'Projector' | ||||
|     And see my title | ||||
|     And see my info | ||||
| @ -55,12 +56,18 @@ Feature: Workshops | ||||
|     Then I should see 'Deleting a workshop cannot be undone' | ||||
| 
 | ||||
|     When I click on the 'Cancel' button | ||||
|     Then I should see 'Tools' | ||||
|     Then I should be on my workshop page | ||||
|     And I should see 'Tools' | ||||
|     And should see 'Education' | ||||
| 
 | ||||
|     When I click the 'Delete Workshop' link | ||||
|     And click the 'Confirm' button | ||||
|     Then I should see 'Propose a Workshop' | ||||
| 
 | ||||
|     Then I should be on the delete_workshop page | ||||
|     When 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 | ||||
| @ -78,19 +85,25 @@ Feature: Workshops | ||||
|     When I enter my title as 'Puentes a las bicicletas' | ||||
|     And enter some info | ||||
|     And click the 'Save' button | ||||
|     Then my workshop title should be 'Bridges to Bicycles' | ||||
|     Then I should be on my workshop page | ||||
|     And my workshop title should be 'Bridges to Bicycles' | ||||
|     And my Spanish workshop title should be 'Puentes a las bicicletas' | ||||
|     And I should see 'Bridges to Bicycles' | ||||
|      | ||||
|     When I enter a comment | ||||
|     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 | ||||
| 
 | ||||
|     When I click the 'Reply' button | ||||
|     And enter a reply | ||||
|     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 | ||||
| 
 | ||||
|   Scenario: Users can add facilitators to their workshops | ||||
| @ -122,9 +135,10 @@ Feature: Workshops | ||||
|     Then I should see 'Please Confirm' | ||||
|     And I should see 'Yes' | ||||
|     And click the 'Yes' button | ||||
| 
 | ||||
|     Then I should not see 'Please Confirm' | ||||
|     And I should not see 'new-facilitator@bikebike.org Unregistered' | ||||
|     But I should see 'Applying for 501c3 status' | ||||
|     # And I should not see 'new-facilitator@bikebike.org Unregistered' | ||||
|     # But I should see 'Applying for 501c3 status' | ||||
| 
 | ||||
|   Scenario: Users can approve and deny facilitation requests on their workshops | ||||
|     Given that there is an upcoming conference | ||||
| @ -175,7 +189,8 @@ Feature: Workshops | ||||
|     And see 'Are you sure you would like to remove Hadrian as a facilitator of this workshop?' | ||||
| 
 | ||||
|     When I click on the 'Yes' button | ||||
|     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' | ||||
|     Then I should see 'Please Confirm' | ||||
| @ -189,7 +204,8 @@ Feature: Workshops | ||||
|     And see 'Are you sure you want to transfer ownership to Saladin?' | ||||
| 
 | ||||
|     When I click the 'Yes' button | ||||
|     Then I should not see 'Saladin Collaborator' | ||||
|     Then I should be on my workshop page | ||||
|     And I should not see 'Saladin Collaborator' | ||||
|     But I should see 'Saladin Owner' | ||||
| 
 | ||||
|     When I click the 'Leave' button | ||||
| @ -204,7 +220,8 @@ Feature: Workshops | ||||
|     And see 'Are you sure you would like to remove yourself as a facilitator of this workshop?' | ||||
| 
 | ||||
|     When I click the 'Yes' button | ||||
|     Then I should not see 'Leave' | ||||
|     Then I should be on my workshop page | ||||
|     And I should not see 'Leave' | ||||
|     But I should see 'Make a facilitation request' | ||||
| 
 | ||||
|     When I click the 'Make a facilitation request' button | ||||
| @ -227,7 +244,8 @@ Feature: Workshops | ||||
|     Then I should still see 'Cancel Request' | ||||
|     When I click the 'Cancel Request' button again | ||||
|     And click the 'Yes' button | ||||
|     Then I should not see 'Cancel Request' | ||||
|     Then I should be on my workshop page | ||||
|     And I should not see 'Cancel Request' | ||||
|     But I should see 'Make a facilitation request' | ||||
| 
 | ||||
|   Scenario: Users can add interest to workshops | ||||
| @ -306,7 +324,8 @@ Feature: Workshops | ||||
|     And enter a comment as 'Will you be covering Canadian contracts?' | ||||
|     And click the 'Add Comment' button | ||||
| 
 | ||||
|     Then I should see 'Will you be covering Canadian contracts?' | ||||
|     Then I should be on my workshop page | ||||
|     And I should see 'Will you be covering Canadian contracts?' | ||||
|     And 'Brunhilda' should get a 'commented' email | ||||
| 
 | ||||
|     When in a new session | ||||
| @ -316,5 +335,6 @@ Feature: Workshops | ||||
|     And enter a reply as 'If we can find a Canadian facilitator' | ||||
|     And click the 'Reply' button | ||||
| 
 | ||||
|     Then I should see 'If we can find a Canadian facilitator' | ||||
|     Then I should be on my workshop page | ||||
|     And I should see 'If we can find a Canadian facilitator' | ||||
|     And 'Geronimo' should get a 'replied' email | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user