From 2743c6dc133c6ec2a7b8f285c8f7124a9990e894 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Mon, 30 Oct 2017 03:28:20 +0000 Subject: [PATCH] Bug 19181: 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. Signed-off-by: Mark Tompsett Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/selenium/authenticate.t | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/t/db_dependent/selenium/authenticate.t b/t/db_dependent/selenium/authenticate.t index 7b0950f40e..84ee33691a 100644 --- a/t/db_dependent/selenium/authenticate.t +++ b/t/db_dependent/selenium/authenticate.t @@ -32,10 +32,13 @@ 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{}; + our $sample_data = { category => { @@ -48,8 +51,8 @@ our $sample_data = { surname => 'test_patron_surname', cardnumber => '4242424242', userid => 'test_username', - password => 'password', - password2 => 'password' + password => 'Password123', + password2 => 'Password123' }, }; @@ -117,7 +120,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.17.0