NAME
Kernel::Test::Role::ProvidesTestData::AgentLogin – Role for Tests with valid Agent Login
DESCRIPTION
Kernel::Test::Role::ProvidesTestData::AgentLogin
– creates an Agent User with admin and users groups assigned and exposes it over the AgentLogin
Attribute. It also performs the System Login and reads the AuthToken
from the login response which is stored and exposed as attribute.
To perform the System Login it requires a Test::Mojo
Object as MojoApp
Attribute. So, it always needs to be applied in combination with a Role that provides this Attribute.
When the System Login fails the Test Sequence will be aborted.
ATTRIBUTES
requires 'MojoApp'
Requires an attribute MojoApp
or method which must yield a Test::Mojo object such as the Kernel::Test::Role::IsTestCase::Endpoint
Role.
has 'AgentLogin'
Provides a User object with authenticated session. It also has the groups admin
and users
assigned.
has 'AuthToken'
Provides the Authentication Token issued with the Login.
The Authentication Token can be used as AuthenticationAgent
like:
Cookie: AuthenticationAgent=<I<AuthToken>>
or X-OTRS-API-Authorization
header field like:
X-OTRS-API-Authorization: Bearer <I<AuthToken>>
METHODS
around 'SkipTest'
Perfoms the Login and aborts the Test when the Login has failed