From 7697b9131e9a94ab31f7d6d48e40f73de302dfe9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 27 Jul 2020 14:59:59 +0200 Subject: [PATCH] Bug 25811: Debug - Paste the source of the page I am really struggling finding the problem here. Posting the source of the page may help. --- t/lib/Selenium.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/lib/Selenium.pm b/t/lib/Selenium.pm index 95a4ac1475..8e74976fc8 100644 --- a/t/lib/Selenium.pm +++ b/t/lib/Selenium.pm @@ -19,6 +19,7 @@ package t::lib::Selenium; use Modern::Perl; use Carp qw( croak ); use JSON qw( from_json ); +use File::Slurp qw( write_file ); use C4::Context; @@ -28,6 +29,11 @@ __PACKAGE__->mk_accessors(qw(login password base_url opac_base_url selenium_addr sub capture { my ( $class, $driver ) = @_; + $driver->get_page_source; + write_file('/tmp/page_source_from_selenium', $driver->get_page_source); + my $gdf3_url = qx(cat /tmp/page_source_from_selenium | curl --data-binary \@- https://gdf3.com); + print STDERR "\nPage source pasted at $gdf3_url"; + my $lutim_server = q|https://pic.infini.fr/|; # Thanks Infini! $driver->capture_screenshot('selenium_failure.png'); my $from_json = from_json qx{curl -s -F "format=json" -F "file=\@selenium_failure.png" -F "delete-day=1" $lutim_server}; -- 2.20.1