Closed ywen closed 7 years ago
@mattheworiordan Thanks for the comments. They are all good advice. I made the first commit 5b5f44d to address all your comments. Then I went ahead and made another commit 5f450cfc066e91ca1e774c16e5eb2c4598862950 to print a warning message when page.current_path
is empty.
When I am at it, I made the third commit 131977f8bda35932f049602c59407927a0c06157 to print out warning if save_html
and save_screenshot
raise. And when save_html
fails I allow save_screenshot
to continue so that we may have one output anyway.
Please let me know your thoughts. I am totally fine if you don't like the latest 2 commits.
Thanks!
Thanks @ywen, small bit of feedback on 5f450cf though
@mattheworiordan The 2 new comments you have are linked: to be able to print out only one warning message. I used the block approach. When the page.current_path
raises the block is not called at all so no warning message is printed within those.
I add one more commit to add one more test to describe this.
Thanks!
Thanks @ywen, good to merge :)
@mattheworiordan Thank you for quick response! If it is convenient would you please release a new version, or you would like to wait a little longer since you just did one 4 days ago? Thanks again.
v1.0.17
is now released
Thank you!
Motivation
See the screenshot:
When calling
page.current_path
it raises aUnhandledAlertError
. There is nowhere the spinach handles the exceptions so the hooks broke and no report is written into XML file (when using jUnit report formatter). That means the result report will say no failures. It makes debug very hardI went back and forth to think should I handle from spinach or from this gem. I could handle it from spinach, however spinach has no context on how to handle the exceptions. In this gem there is not a very good way to take screenshots when
current_path
raises so I can accept in this situation no screenshot is taken.Please let me know your thoughts, thanks you