Skip to content

Commit

Permalink
Issue #444: make stub actually work
Browse files Browse the repository at this point in the history
But there are still TODOs for that test script.
  • Loading branch information
bschmalhofer committed Sep 19, 2020
1 parent 2e6e4d1 commit e3e2a2a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/test/PSGI/DbViewer.t
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,19 @@ use LWP::UserAgent;
use Test2::V0;

# OTOBO modules
use Kernel::System::ObjectManager;

# This test checks whether the /dbviewer route works

# For now test /dbviewer only when running under Docker,
# even though this route could also be available outside Docker.
skip_all 'not running under Docker' unless $ENV{OTOBO_RUNS_UNDER_DOCKER};

$Kernel::OM = Kernel::System::ObjectManager->new(
'Kernel::System::Log' => {
LogPrefix => 'OTOBO-otobo.UnitTest',
},
);

my $ConfigObject = $Kernel::OM->Get('Kernel::Config');

Expand All @@ -54,10 +60,12 @@ my $TestAdminUserLogin = $Helper->TestUserCreate(

ok( $TestAdminUserLogin, 'test user created');

# set up URLS
my $BaseURL = join '',
$ConfigObject->Get('HttpType'),
'://',
$Helper->GetTestHTTPHostname(),
'/',
$ConfigObject->Get('ScriptAlias');

my $AdminLoginURL = $BaseURL . "index.pl?Action=Login;User=$TestAdminUserLogin;Password=$TestAdminUserLogin;";
Expand All @@ -76,7 +84,6 @@ $UserAgent->cookie_jar( {} ); # keep cookies
# Login as admin
{
my $Response = $UserAgent->get( $AdminLoginURL );

ok( $Response->is_success(), "login to agent interface as admin user" );

if ( !$Response->is_success() ) {
Expand All @@ -96,7 +103,8 @@ $UserAgent->cookie_jar( {} ); # keep cookies
}
);

ok( $AdminSessionValid, "login to agent interface as admin user" );
ok( $AdminSessionValid, 'valid session for admin user' );

if ( !$AdminSessionValid ) {
done_testing();

Expand Down

0 comments on commit e3e2a2a

Please sign in to comment.