From 38d730ed07b553142879495a7c8c36288dad66e2 Mon Sep 17 00:00:00 2001 From: Nico Schedel Date: Fri, 28 Jun 2019 11:48:33 +0200 Subject: [PATCH] TT#56376 selenium: add error labels to crash detection crash detection will now check for error labels and will print them out if possible Change-Id: Ib583608a2b1f27ea32d079b17676acdfc5940b7c --- t/lib/Selenium/Collection/Common.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/lib/Selenium/Collection/Common.pm b/t/lib/Selenium/Collection/Common.pm index 7785aa714f..2008edf5b3 100644 --- a/t/lib/Selenium/Collection/Common.pm +++ b/t/lib/Selenium/Collection/Common.pm @@ -389,6 +389,16 @@ sub crash_handler { diag("Tab Title: $title"); diag("nginx error: $crashvar"); diag("Perl localtime(): $realtime"); + } elsif(eval{$self->driver->find_element('//*[@id="content"]//div[@class="alert alert-error"]')}) { + my $label = "Label: could not get text"; + eval { + $label = $self->driver->find_element('//*[@id="content"]//div[@class="alert alert-error"]')->get_text(); + }; + diag("Server: $ENV{CATALYST_SERVER}"); + diag("Url: $url"); + diag("Tab Title: $title"); + diag("Error Label: $label"); + diag("Perl localtime(): $realtime"); } else { diag("Could not detect Server issues. Maybe script problems?"); diag("If you still want to check server logs, here's some info");