2021-07-07 19:43:56 +02:00
|
|
|
use Test::More;
|
2022-05-15 23:36:12 +02:00
|
|
|
use IO::String;
|
2021-07-07 19:43:56 +02:00
|
|
|
use strict;
|
|
|
|
|
|
|
|
require 't/test-lib.pm';
|
|
|
|
|
|
|
|
my $res;
|
|
|
|
|
2021-07-08 23:55:03 +02:00
|
|
|
my $client = LLNG::Manager::Test->new( {
|
|
|
|
ini => {
|
2022-05-15 23:36:12 +02:00
|
|
|
logLevel => 'error',
|
|
|
|
portalEnablePasswordDisplay => 1,
|
|
|
|
browsersDontStorePassword => 1
|
2021-07-08 23:55:03 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
2021-07-07 19:43:56 +02:00
|
|
|
|
|
|
|
ok( $res = $client->_get( '/', accept => 'text/html' ), 'Display portal' );
|
2022-05-15 23:36:12 +02:00
|
|
|
ok(
|
|
|
|
$res->[2]->[0] =~
|
2022-05-16 13:38:23 +02:00
|
|
|
m%<i id="toggle_password" class="fa fa-eye-slash toggle-password">%,
|
2022-05-15 23:36:12 +02:00
|
|
|
' toggle password icon found'
|
|
|
|
) or print STDERR Dumper( $res->[2]->[0] );
|
2021-07-07 19:43:56 +02:00
|
|
|
count(2);
|
|
|
|
|
2022-05-15 23:36:12 +02:00
|
|
|
ok(
|
|
|
|
$res = $client->_post(
|
|
|
|
'/',
|
|
|
|
IO::String->new('user=dwho&password=dwho'),
|
|
|
|
length => 23,
|
|
|
|
),
|
|
|
|
'Auth query'
|
|
|
|
);
|
|
|
|
count(1);
|
|
|
|
expectOK($res);
|
|
|
|
my $id = expectCookie($res);
|
|
|
|
|
|
|
|
ok(
|
|
|
|
$res = $client->_get(
|
|
|
|
'/',
|
|
|
|
cookie => "lemonldap=$id",
|
|
|
|
accept => 'text/html'
|
|
|
|
),
|
|
|
|
'Get menu'
|
|
|
|
);
|
|
|
|
ok(
|
|
|
|
$res->[2]->[0] =~
|
2022-05-16 13:38:23 +02:00
|
|
|
m%<i id="toggle_oldpassword" class="fa fa-eye-slash toggle-password">%,
|
2022-05-15 23:36:12 +02:00
|
|
|
' toggle oldpassword icon found'
|
|
|
|
) or print STDERR Dumper( $res->[2]->[0] );
|
|
|
|
ok(
|
|
|
|
$res->[2]->[0] =~
|
2022-05-16 13:38:23 +02:00
|
|
|
m%<i id="toggle_newpassword" class="fa fa-eye-slash toggle-password">%,
|
2022-05-15 23:36:12 +02:00
|
|
|
' toggle newpassword icon found'
|
|
|
|
) or print STDERR Dumper( $res->[2]->[0] );
|
|
|
|
ok(
|
|
|
|
$res->[2]->[0] =~
|
2022-05-16 13:38:23 +02:00
|
|
|
m%<i id="toggle_confirmpassword" class="fa fa-eye-slash toggle-password">%,
|
2022-05-15 23:36:12 +02:00
|
|
|
' toggle confirmpassword icon found'
|
|
|
|
) or print STDERR Dumper( $res->[2]->[0] );
|
|
|
|
ok(
|
|
|
|
$res->[2]->[0] =~
|
|
|
|
m%<input id="newpassword" name="newpassword" type="text" class="form-control"%,
|
|
|
|
' input type text found'
|
|
|
|
) or print STDERR Dumper( $res->[2]->[0] );
|
|
|
|
count(5);
|
|
|
|
|
|
|
|
$client->logout($id);
|
2021-07-07 19:43:56 +02:00
|
|
|
clean_sessions();
|
|
|
|
|
|
|
|
done_testing( count() );
|