Fixed tests for PhantomJS 2.5

This commit is contained in:
Godwin
2017-04-11 21:42:29 -07:00
parent a3137b0d49
commit 5d20630ed6
10 changed files with 1157 additions and 34 deletions
+9 -5
View File
@@ -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
+1 -1
View File
@@ -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