From fec6a3c83a53a973db464512523c7f022e9ad976 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 27 Mar 2018 12:03:51 -0300 Subject: [PATCH] Bug 20045: Fix Selenium tests Element id=doc does not longer exist on the admin home page The "main block" need to be localized using the new class 'main container-fluid' We will certainly need to improve this later. Signed-off-by: Jonathan Druart --- t/db_dependent/selenium/administration_tasks.t | 12 ++++++------ t/lib/Selenium.pm | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/t/db_dependent/selenium/administration_tasks.t b/t/db_dependent/selenium/administration_tasks.t index 6cb97dcd12..4e4f518485 100644 --- a/t/db_dependent/selenium/administration_tasks.t +++ b/t/db_dependent/selenium/administration_tasks.t @@ -52,7 +52,7 @@ SKIP: { # Navigate to the Administration area and create an item type $s->click( { href => '/admin/admin-home.pl', main => 'container-main' } ) ; # Koha administration - $s->click( { href => '/admin/itemtypes.pl', main => 'doc' } ); # Item Types + $s->click( { href => '/admin/itemtypes.pl', main_class => 'main container-fluid' } ); # Item Types $s->click( { href => '/admin/itemtypes.pl?op=add_form', main => 'doc3' } ) ; # New item type $s->fill_form( @@ -70,7 +70,7 @@ SKIP: { $driver->get($mainpage); $s->click( { href => '/admin/admin-home.pl', main => 'container-main' } ) ; # Koha administration - $s->click( { href => '/admin/smart-rules.pl', main => 'doc' } ) + $s->click( { href => '/admin/smart-rules.pl', main_class => 'main container-fluid' } ) ; # Circulation and fines rules # TODO Create smart navigation here }; @@ -79,7 +79,7 @@ SKIP: { $driver->get($mainpage); $s->click( { href => '/admin/admin-home.pl', main => 'container-main' } ) ; # Koha administration - $s->click( { href => '/admin/biblio_framework.pl', main => 'doc' } ) + $s->click( { href => '/admin/biblio_framework.pl', main_class => 'main container-fluid' } ) ; # MARC bibliographic framework $s->click( { href => '/admin/biblio_framework.pl?op=add_form', main => 'doc3' } ) @@ -105,7 +105,7 @@ SKIP: { $driver->get($mainpage); $s->click( { href => '/admin/admin-home.pl', main => 'container-main' } ) ; # Koha administration - $s->click( { href => '/admin/branches.pl', main => 'doc' } ) + $s->click( { href => '/admin/branches.pl', main_class => 'main container-fluid' } ) ; # Libraries and groups $s->click( { href => '/admin/branches.pl?op=add_form', main => 'doc3' } ) ; # New library @@ -130,7 +130,7 @@ SKIP: { $driver->get($mainpage); $s->click( { href => '/admin/admin-home.pl', main => 'container-main' } ); #Koha administration - $s->click( { href => '/admin/authorised_values.pl', main => 'doc' } ); #Authorized values + $s->click( { href => '/admin/authorised_values.pl', main_class => 'main container-fluid' } ); #Authorized values $s->click( { href => { 'ends-with' => '/admin/authorised_values.pl?op=add_form' }, main => 'doc3' } ); # New category $s->fill_form( { category => $av_category } ); @@ -166,7 +166,7 @@ SKIP: { { # Patron categories $driver->get($mainpage); $s->click( { href => '/admin/admin-home.pl', main => 'container-main' } ); # Koha administration - $s->click( { href => '/admin/categories.pl', main => 'doc' } ); # Patron categories + $s->click( { href => '/admin/categories.pl', main_class => 'main container-fluid' } ); # Patron categories $s->click( { href => '/admin/categories.pl?op=add_form', main => 'doc3' } ); # New patron category $s->fill_form( { categorycode => $category_code, description => 'Test category', enrolmentperiod => 12, category_type => 'A' } ); diff --git a/t/lib/Selenium.pm b/t/lib/Selenium.pm index 6741f62d32..1ddab54e59 100644 --- a/t/lib/Selenium.pm +++ b/t/lib/Selenium.pm @@ -97,6 +97,8 @@ sub click { my $xpath_selector; if ( exists $params->{main} ) { $xpath_selector = '//div[@id="'.$params->{main}.'"]'; + } elsif ( exists $params->{main_class} ) { + $xpath_selector = '//div[@class="'.$params->{main_class}.'"]'; } if ( exists $params->{href} ) { if ( ref( $params->{href} ) ) { -- 2.39.5