Bug 25811: Debug - Paste the source of the page
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 27 Jul 2020 12:59:59 +0000 (14:59 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 29 Jul 2020 08:08:43 +0000 (10:08 +0200)
I am really struggling finding the problem here.
Posting the source of the page may help.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

t/lib/Selenium.pm

index 95a4ac1..8e74976 100644 (file)
@@ -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};