Bugzilla – Attachment 75054 Details for
Bug 20505
Selenium tests fail if server not running
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20505: Patch selenium tests to skip gracefully
Bug-20505-Patch-selenium-tests-to-skip-gracefully.patch (text/plain), 2.54 KB, created by
Marcel de Rooy
on 2018-05-04 09:27:41 UTC
(
hide
)
Description:
Bug 20505: Patch selenium tests to skip gracefully
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-05-04 09:27:41 UTC
Size:
2.54 KB
patch
obsolete
>From 11ffc07ff8e27ec9050956b9446f91cb197c9447 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Sun, 1 Apr 2018 14:42:16 +0000 >Subject: [PATCH] Bug 20505: Patch selenium tests to skip gracefully >Content-Type: text/plain; charset=utf-8 > >TEST PLAN >--------- >1) In a koha shell on kohadevbox, run > prove -v t/db_dependent/selenium > until it doesn't skip because of missing > dependencies, but rather because of not running > a selenium server. >2) apply this patch and restart_all >3) rerun the tests > -- they will skip gracefully and informatively. >4) run koha qa test tools > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > t/db_dependent/selenium/administration_tasks.t | 9 ++++++++- > t/db_dependent/selenium/basic_workflow.t | 10 ++++++++-- > 2 files changed, 16 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/selenium/administration_tasks.t b/t/db_dependent/selenium/administration_tasks.t >index 4e4f518..5f65b59 100644 >--- a/t/db_dependent/selenium/administration_tasks.t >+++ b/t/db_dependent/selenium/administration_tasks.t >@@ -24,6 +24,7 @@ use Modern::Perl; > use C4::Context; > > use Test::More tests => 1; >+use Try::Tiny; > > use t::lib::Selenium; > >@@ -42,7 +43,13 @@ SKIP: { > > $cleanup_needed = 1; > >- my $s = t::lib::Selenium->new; >+ my $s; >+ try { >+ $s = t::lib::Selenium->new; >+ } catch { >+ skip "Unable to create selenium driver link. Please review https://wiki.koha-community.org/wiki/Using_Selenium_with_Koha", 1; >+ }; >+ > my $driver = $s->driver; > my $mainpage = $s->base_url . q|mainpage.pl|; > $driver->get($mainpage); >diff --git a/t/db_dependent/selenium/basic_workflow.t b/t/db_dependent/selenium/basic_workflow.t >index 420ca3c..325710a 100644 >--- a/t/db_dependent/selenium/basic_workflow.t >+++ b/t/db_dependent/selenium/basic_workflow.t >@@ -41,6 +41,7 @@ use C4::Biblio qw( AddBiblio ); # We shouldn't use it > use Test::More tests => 20; > use MARC::Record; > use MARC::Field; >+use Try::Tiny; > > use t::lib::Selenium; > >@@ -85,9 +86,14 @@ SKIP: { > > $cleanup_needed = 1; > >- open my $fh, '>>', '/tmp/output.txt'; >+ my $s; >+ try { >+ $s = t::lib::Selenium->new; >+ } catch { >+ skip "Unable to create selenium driver link. Please review https://wiki.koha-community.org/wiki/Using_Selenium_with_Koha", 20; >+ }; > >- my $s = t::lib::Selenium->new; >+ open my $fh, '>>', '/tmp/output.txt'; > > my $driver = $s->driver; > my $base_url = $s->base_url; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20505
:
73517
|
74364
| 75054 |
75136