report at time of failure

12 views
Skip to first unread message

Samuel Rossinovic

unread,
Oct 26, 2017, 2:26:31 AM10/26/17
to Geb User Mailing List
Hi.
Often when a test fails, the generated report ("test foo-failure.html") suggests the it shouldn't have: the missing content which caused the test to fail is actually in the page. Since the content in-question is added dynamically, I wonder: could it be that the failure snapshot is taken not at the point of failure, but slightly afterwards, and thus isn't a true reflection of the state of the DOM at the time of failure?
Sam

Marcin Erdmann

unread,
Oct 26, 2017, 6:22:00 AM10/26/17
to Geb User Mailing List
Sam,

The snapshot is indeed not taken exactly at the point of failure as it's not technically possible. If you think about it, a failure occurs as a result of a WebDriver command (which in fact is a HTTP request between test JVM and a browser process) and a report is taken as a result of another WebDriver command (HTTP request) or many thereof if both screenshot and html reports are generated. Some time will obviously pass between these requests and there is nothing stopping the browser form executing javascript which modifies the page in that time.

The time between a failure and the reports being taken can be even increased if your test performs any cleanup. This is because report taking is implemented in cleanup method of GebReportingSpec which executes after the cleanup method of a spec extending it.

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+unsubscribe@googlegroups.com.
To post to this group, send email to geb-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/2101c3c8-57eb-4f4f-a8b1-cecf05a9e3fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages