Bugzilla – Attachment 67200 Details for
Bug 19337
Allow basic_workflow.t be configured by ENV
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19337: Make basic_workflow.t configurable through ENV
Bug-19337-Make-basicworkflowt-configurable-through.patch (text/plain), 3.15 KB, created by
Jonathan Druart
on 2017-09-19 11:54:36 UTC
(
hide
)
Description:
Bug 19337: Make basic_workflow.t configurable through ENV
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-09-19 11:54:36 UTC
Size:
3.15 KB
patch
obsolete
>From 4bd07f3c9a3ff3bad69bf4dae421d00c42f13f78 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 18 Sep 2017 15:58:15 -0300 >Subject: [PATCH] Bug 19337: Make basic_workflow.t configurable through ENV > >This patch makes the basic_workflow.t selenium tests read ENV for the >following vars: > >KOHA_USER >KOHA_PASS >KOHA_INTRANET_URL >SELENIUM_ADDR >SELENIUM_PORT > >to properly configure the running environment. If absent, all variables >fallback to current behaviour: > >KOHA_USER // 'koha' >KOHA_PASS // 'koha' >KOHA_INTRANET_URL (unchanged) >SELENIUM_ADDR // 'localhost' >SELENIUM_PORT // 4444 > >[*] Selenium defaults are documented on the Selenium::Remote::Driver docs. > >Prerequisites: >Make sure you have a working environment for the Selenium tests: >- Run: > $ sudo apt update > $ sudo apt install xvfb firefox-esr > >To test: >- Run: > $ sudo koha-shell kohadev > k$ cd kohaclone > k$ wget https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar \ > -O /tmp/selenium.jar > k$ SELENIUM_PATH=/tmp/selenium.jar > k$ Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null & > k$ DISPLAY=:1 java -jar $SELENIUM_PATH & > k$ prove t/db_dependent/selenium/basic_workflow.t >=> SUCCESS: Tests pass >- Apply this patch >- Run: > k$ prove t/db_dependent/selenium/basic_workflow.t >=> SUCCESS: Tests pass! >- Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/selenium/basic_workflow.t | 21 +++++++++++++++------ > 1 file changed, 15 insertions(+), 6 deletions(-) > >diff --git a/t/db_dependent/selenium/basic_workflow.t b/t/db_dependent/selenium/basic_workflow.t >index f439dace92..235ebf29e1 100644 >--- a/t/db_dependent/selenium/basic_workflow.t >+++ b/t/db_dependent/selenium/basic_workflow.t >@@ -42,10 +42,15 @@ use Test::More tests => 20; > use MARC::Record; > use MARC::Field; > >-my $dbh = C4::Context->dbh; >-my $login = 'koha'; >-my $password = 'koha'; >-my $base_url= ( $ENV{KOHA_INTRANET_URL} || 'http://'.C4::Context->preference("staffClientBaseURL") ) . "/cgi-bin/koha/"; >+my $dbh = C4::Context->dbh; >+my $login = $ENV{KOHA_USER} || 'koha'; >+my $password = $ENV{KOHA_PASS} || 'koha'; >+my $base_url >+ = ( $ENV{KOHA_INTRANET_URL} || 'http://' . C4::Context->preference("staffClientBaseURL") ) >+ . "/cgi-bin/koha/"; >+my $selenium_addr = $ENV{SELENIUM_ADDR} || 'localhost'; >+my $selenium_port = $ENV{SELENIUM_PORT} || 4444; >+ > > > my $number_of_biblios_to_insert = 3; >@@ -89,7 +94,11 @@ SKIP: { > > open my $fh, '>>', '/tmp/output.txt'; > >- my $driver = Selenium::Remote::Driver->new; >+ my $driver = Selenium::Remote::Driver->new( >+ port => $selenium_port, >+ remote_server_addr => $selenium_addr >+ ); >+ > $start = gettimeofday; > $prev_time = $start; > $driver->get($base_url."mainpage.pl"); >@@ -202,7 +211,7 @@ END { > > sub auth { > my ( $driver, $login, $password) = @_; >- fill_form( $driver, { userid => 'koha', password => 'koha' } ); >+ fill_form( $driver, { userid => $login, password => $password } ); > my $login_button = $driver->find_element('//input[@id="submit"]'); > $login_button->submit(); > } >-- >2.11.0
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 19337
:
67194
| 67200