Created
September 6, 2016 17:43
-
-
Save sam3k/6f29ea4b885568027fa3e68e5054fa97 to your computer and use it in GitHub Desktop.
undefined method `message' for "TypeError: window.textContent is undefined":String (NoMethodError)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DriverJSError < StandardError; end | |
AfterStep do |scenario, step| | |
errors = page.driver.browser.manage.logs.get(:browser) | |
.select {|e| e.level == "SEVERE" } | |
.map(&:message) | |
.to_a | |
if errors.any? | |
message = errors.map(&:message).join("\n\n") | |
raise DriverJSError, message | |
end | |
end | |
// Sometimes it throws the following error | |
// undefined method `message' for "TypeError: window.textContent is undefined":String (NoMethodError) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works for now: