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 Oct 23, 2020
1 parent fec6d65 commit 705ce24
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 705ce24

Please sign in to comment.