Fixed tests for PhantomJS 2.5
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user