Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions REGRESSION/resources/config-ci-regression-mobile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<delayBetweenScenarioRuns seconds="1" enabled="true"/>

<runScenariosByTag enabled="true">
<tag name="httpGeneral" enabled="true"/>
<tag name="httpAuth" enabled="true"/>

<tag name="web" enabled="false"/>
<tag name="mobilebrowser" enabled="false"/>
<tag name="mobilebrowser-healthcheck" enabled="true"/>
Expand Down
3 changes: 3 additions & 0 deletions REGRESSION/resources/config-ci-regression-windows.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<delayBetweenScenarioRuns seconds="1" enabled="true"/>

<runScenariosByTag enabled="true">
<tag name="httpGeneral" enabled="true"/>
<tag name="httpAuth" enabled="true"/>

<tag name="web" enabled="false"/>
<tag name="mobilebrowser" enabled="false"/>
<tag name="mobilebrowser-healthcheck" enabled="false"/>
Expand Down
2 changes: 2 additions & 0 deletions REGRESSION/resources/config-ci-regression.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<delayBetweenScenarioRuns seconds="1" enabled="true"/>

<runScenariosByTag enabled="true">
<tag name="httpGeneral" enabled="true"/>
<tag name="httpAuth" enabled="true"/>
<tag name="web" enabled="true"/>
<tag name="mobilebrowser" enabled="false"/>
<tag name="mobilebrowser-healthcheck" enabled="false"/>
Expand Down
3 changes: 3 additions & 0 deletions REGRESSION/resources/config-local.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<delayBetweenScenarioRuns seconds="1" enabled="false"/>

<runScenariosByTag enabled="true">
<tag name="httpGeneral" enabled="true"/>
<tag name="httpAuth" enabled="true"/>

<tag name="web" enabled="true"/>
<tag name="mobilebrowser" enabled="false"/>
<tag name="mobilebrowser-healthcheck" enabled="false"/>
Expand Down
5 changes: 5 additions & 0 deletions REGRESSION/resources/config/ci-windows/integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
</api>
<api alias="CAT_FACTS" url="https://catfact.ninja/" enabled="false"/>
<api alias="MULTIPART" url="https://postman-echo.com" enabled="false"/>
<api alias="MEGA_APP_CUSTOM" url="http://mega-test-api:8080/api/v1" enabled="true">
<auth authStrategy="custom"
authCustomClassName="com.knubisoft.testlum.testing.framework.auth.CustomAuth"
autoLogout="true"/>
</api>
</apis>

<websockets>
Expand Down
3 changes: 3 additions & 0 deletions REGRESSION/resources/config/ci/integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</api>
<api alias="CAT_FACTS" url="https://catfact.ninja/" enabled="true"/>
<api alias="MULTIPART" url="https://postman-echo.com" enabled="true"/>
<api alias="MEGA_APP_CUSTOM" url="http://mega-test-api:8080/api/v1" enabled="true">
<auth authStrategy="custom" authCustomClassName="com.knubisoft.testlum.testing.framework.auth.CustomAuth" autoLogout="true"/>
</api>
</apis>

<websockets>
Expand Down
3 changes: 3 additions & 0 deletions REGRESSION/resources/config/local/static/integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</api>
<api alias="CAT_FACTS" url="https://catfact.ninja/" enabled="true"/>
<api alias="MULTIPART" url="https://postman-echo.com" enabled="true"/>
<api alias="MEGA_APP_CUSTOM" url="http://localhost:8080/api/v1" enabled="true">
<auth authStrategy="custom" authCustomClassName="com.knubisoft.testlum.testing.framework.auth.CustomAuth" autoLogout="true"/>
</api>
</apis>

<websockets>
Expand Down
3 changes: 3 additions & 0 deletions REGRESSION/resources/config/local/vault/integration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
</api>
<api alias="CAT_FACTS" url="https://catfact.ninja/" enabled="true"/>
<api alias="MULTIPART" url="https://postman-echo.com" enabled="true"/>
<api alias="MEGA_APP_CUSTOM" url="http://localhost:8080/api/v1" enabled="true">
<auth authStrategy="custom" authCustomClassName="com.knubisoft.testlum.testing.framework.auth.CustomAuth" autoLogout="true"/>
</api>
</apis>

<websockets>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"username": "testlum",
"password": "123456"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"clientId": "testlum-client",
"clientSecret": "super-secret"
}
4 changes: 4 additions & 0 deletions REGRESSION/resources/data/credentials/http-auth-user-jwt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"username": "testlum",
"password": "123456"
}
4 changes: 4 additions & 0 deletions REGRESSION/resources/data/variations/httpRepeat.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name,description,status,category,expectedPost,expectedGet
RepeatEntity1,Repeat Description 1,NEW,REPEAT,expected_1_1,expected_3_1
RepeatEntity2,Repeat Description 2,ACTIVE,REPEAT,expected_1_2,expected_3_2
RepeatEntity3,Repeat Description 3,INACTIVE,REPEAT,expected_1_3,expected_3_3
4 changes: 4 additions & 0 deletions REGRESSION/resources/data/variations/httpVariations.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name,description,status,category,expectedPost,expectedGet
VarEntity1,Description 1,NEW,VAR,expected_1_1,expected_3_1
VarEntity2,Description 2,ACTIVE,VAR,expected_1_2,expected_3_2
VarEntity3,Description 3,INACTIVE,VAR,expected_1_3,expected_3_3
4 changes: 4 additions & 0 deletions REGRESSION/resources/data/variations/jwtVariations.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
username,password,expectedLogin,expectedResource
testlum1,123456,expected_1_1,expected_3_1
testlum2,123456,expected_1_2,expected_3_2
testlum3,123456,expected_1_3,expected_3_3
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"username": "testlum",
"role": "ADMIN"
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"username" : "Ronaldo",
"role" : "USER"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[ {
"username" : "testlum",
"role" : "ADMIN"
}, {
"username" : "Ronaldo",
"role" : "USER"
} ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<scenario xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.knubisoft.com/testlum/testing/model/scenario"
xsi:schemaLocation="http://www.knubisoft.com/testlum/testing/model/scenario scenario.xsd">

<overview>
<description>
This scenario verifies Basic Authentication functionality using the auth command.

Test flow includes:
1. Apply Basic Auth header using credentials from file via auth tag.
2. Send GET request to retrieve list of users and verify response status = 200.
3. Validate response headers (X-Auth-Type = BASIC).
4. Send POST request to create a new user using authenticated context.
5. Verify response status = 200 and validate response body.
6. Send GET request again to verify that the new user was successfully added.
7. Validate updated response body and headers.
8. Exit auth block (automatic logout if enabled).
9. Send DELETE request to reset test data and ensure test isolation.

This scenario validates:
- Basic Auth header injection via auth command
- Authorization handling on protected endpoints
- Authenticated access to GET and POST endpoints
- Response header validation
- State mutation (user creation) under authorized context
- Test data cleanup via reset endpoint
</description>
<name>Auth Basic</name>
<developer>Vadym Kostenko</developer>
</overview>

<settings truncateStorages="true">
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need truncateStorages here I guess

<tags>httpAuth</tags>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

httpAuth -> auth

</settings>

<auth comment="Apply Basic Auth header"
apiAlias="MEGA_APP_BASIC"
credentials="http-auth-user-basic.json"
loginEndpoint="/ignore">

<http comment="Check ability to get users inside auth block"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get before auth to make sure that it's private endpoint

alias="MEGA_APP_BASIC">
<get endpoint="/api/test/auth/basic/users">
<response code="200" file="expected_2.json"/>
<header name="X-Auth-Type" data="BASIC"/>
</get>
</http>

<http comment="Check ability to create new user inside auth block"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

alias="MEGA_APP_BASIC">
<post endpoint="/api/test/auth/basic/users">
<response code="200" file="expected_3.json"/>
<header name="Content-Type" data="application/json"/>
<header name="X-Auth-Type" data="BASIC"/>
<body>
<raw>
{
"username": "Ronaldo",
"password": "kris123",
"role": "USER"
}
</raw>
</body>
</post>
</http>

<http comment="Check ability to get users list after creating new user"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

alias="MEGA_APP_BASIC">
<get endpoint="/api/test/auth/basic/users">
<response code="200" file="expected_4.json"/>
<header name="X-Auth-Type" data="BASIC"/>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove header

</get>
</http>

</auth>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add 401 request after auth ending

<http comment="Reset basic auth test data after auth block"
alias="MEGA_APP_BASIC">
<delete endpoint="/api/test/auth/basic/reset">
<response code="200"/>
<header name="X-Auth-Type" data="BASIC"/>
</delete>
</http>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add autologout false check

</scenario>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"token" : "p(any)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"username" : "testlum"
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no single one auth tag in auth scenario

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create true condition
execute success step with this condition
create false condition
execute step with error with this condition

Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<scenario xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.knubisoft.com/testlum/testing/model/scenario"
xsi:schemaLocation="http://www.knubisoft.com/testlum/testing/model/scenario scenario.xsd">

<overview>
<name>Auth JWT Condition</name>
<description>
This scenario verifies interaction between JWT authentication flow and condition command.

Test flow includes:
1. Send POST login request with valid credentials.
2. Verify login response = 200.
3. Extract JWT token from response.
4. Create condition based on extracted token.
5. Send GET request to protected resource only if condition is true.
6. Verify protected response = 200.
7. Create false condition.
8. Send GET request with false condition (should be skipped).
9. Reset JWT auth state after test.

This scenario validates:
- JWT login flow
- Token extraction
- Condition creation based on auth result
- Conditional execution of protected requests
</description>
<developer>Vadym Kostenko</developer>
</overview>

<settings truncateStorages="true">
<tags>httpAuth</tags>
</settings>

<http comment="Step 1-2. Login and get JWT token"
alias="MEGA_APP">
<post endpoint="/api/test/auth/jwt/login">
<response code="200" file="expected_1.json"/>
<header name="Content-Type" data="application/json"/>
<body>
<raw>
{
"username": "testlum",
"password": "123456"
}
</raw>
</body>
</post>
</http>

<var comment="Step 3. Extract JWT token from login response"
name="token">
<path value="$.token"/>
</var>

<condition comment="Step 4. Verify token is not empty"
name="tokenExists"
spel="'{{token}}' != null and '{{token}}' != ''"/>

<http comment="Step 5-6. Access protected resource only if token exists"
alias="MEGA_APP"
condition="tokenExists">
<get endpoint="/api/test/auth/jwt/resource">
<response code="200" file="expected_4.json"/>
<header name="Authorization" data="Bearer {{token}}"/>
<header name="X-Auth-Type" data="JWT"/>
</get>
</http>

<condition comment="Step 7. Create false condition"
name="neverExecute"
spel="'1' == '2'"/>

<http comment="Step 8. This request should not execute because condition is false"
alias="MEGA_APP"
condition="neverExecute">
<get endpoint="/api/test/auth/jwt/resource">
<response code="200" file="expected_6.json"/>
<header name="Authorization" data="Bearer {{token}}"/>
<header name="X-Auth-Type" data="JWT"/>
</get>
</http>

<http comment="Step 9. Reset JWT auth state after test"
alias="MEGA_APP">
<delete endpoint="/api/test/auth/jwt/reset">
<response code="200"/>
<header name="X-Auth-Type" data="JWT"/>
</delete>
</http>

</scenario>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"message" : "Custom auth access granted",
"authType" : "CUSTOM"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"status" : "UNAUTHORIZED",
"message" : "Missing Authorization header",
"timestamp" : "p(any)"
}
Loading