From c683fa43dc51c9be0e099f96cce9f1a66fa1f4c4 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Mon, 30 Oct 2017 04:10:31 +0000 Subject: [PATCH] Bug 19184: Change to use ENV, fix login and passwords The kohadevbox has admin/admin set, so for testing when creating the initial superuser, if you wish to minimize effort, use admin/admin. Otherwise, make sure to: export KOHA_USER={whatever your user is} export KOHA_PASS={whatever your password is} before attempting to run the test. Also, this test was failing because of a validation check on the passwords requiring uppercase letters, lowercase letters, and numbers. Changed the sample data passwords to fix. --- t/db_dependent/selenium/purchase_workflow.t | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/t/db_dependent/selenium/purchase_workflow.t b/t/db_dependent/selenium/purchase_workflow.t index 9bdcd7e..5901571 100644 --- a/t/db_dependent/selenium/purchase_workflow.t +++ b/t/db_dependent/selenium/purchase_workflow.t @@ -33,10 +33,12 @@ use MARC::Record; use MARC::Field; my $dbh = C4::Context->dbh; -my $login = 'koha'; -my $password = 'koha'; -my $base_url= 'http://'.C4::Context->preference("staffClientBaseURL")."/cgi-bin/koha/"; -my $opac_url= C4::Context->preference("OPACBaseURL"); +my $login = $ENV{KOHA_USER} || 'koha'; +my $password = $ENV{KOHA_PASS} || 'koha'; +my $staff_client_base_url = + $ENV{KOHA_INTRANET_URL} || C4::Context->preference("staffClientBaseUrl") || q{}; +my $base_url= $staff_client_base_url . "/cgi-bin/koha/"; +my $opac_url = $ENV{KOHA_OPAC_URL} || C4::Context->preference("OPACBaseURL") || q{}; my $number_of_biblios_to_insert = 3; our $sample_data = { @@ -50,8 +52,8 @@ our $sample_data = { surname => 'test_patron_surname', cardnumber => '4242424242', userid => 'test_username', - password => 'password', - password2 => 'password' + password => 'Password123', + password2 => 'Password123' }, }; @@ -156,7 +158,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.1.4