Skip to content

Commit 686d53b

Browse files
committed
fix(e2e): remove extra quotes from substring assertions in rh-identity tests
The behave step 'body of the response contains {substring}' captures the literal text after 'contains', including any quotes. The test assertions were failing because they searched for quoted substrings like '"Invalid base64 encoding"' instead of unquoted text that actually exists in the JSON response body. Fixes 6 failing test scenarios: - Invalid base64 encoding detection - Invalid JSON detection - Unsupported identity type detection - Missing required entitlement detection (3 scenarios) Signed-off-by: Major Hayden <major@redhat.com>
1 parent a2c7264 commit 686d53b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/e2e/features/authorized_rh_identity.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Feature: Authorized endpoint API tests for the rh-identity authentication module
2525
{"placeholder":"abc"}
2626
"""
2727
Then The status code of the response is 400
28-
And The body of the response contains "Invalid base64 encoding"
28+
And The body of the response contains Invalid base64 encoding
2929

3030
Scenario: Request fails when x-rh-identity header has invalid JSON
3131
Given The system is in default state
@@ -35,7 +35,7 @@ Feature: Authorized endpoint API tests for the rh-identity authentication module
3535
{"placeholder":"abc"}
3636
"""
3737
Then The status code of the response is 400
38-
And The body of the response contains "Invalid JSON"
38+
And The body of the response contains Invalid JSON
3939

4040
Scenario: Request fails when identity field is missing
4141
Given The system is in default state
@@ -87,7 +87,7 @@ Feature: Authorized endpoint API tests for the rh-identity authentication module
8787
{"placeholder":"abc"}
8888
"""
8989
Then The status code of the response is 400
90-
And The body of the response contains "Unsupported identity type"
90+
And The body of the response contains Unsupported identity type
9191

9292
Scenario: Request succeeds with valid User identity and required entitlements
9393
Given The system is in default state
@@ -130,7 +130,7 @@ Feature: Authorized endpoint API tests for the rh-identity authentication module
130130
{"placeholder":"abc"}
131131
"""
132132
Then The status code of the response is 403
133-
And The body of the response contains "Missing required entitlement"
133+
And The body of the response contains Missing required entitlement
134134

135135
Scenario: Request fails when user has no entitlements
136136
Given The system is in default state
@@ -150,7 +150,7 @@ Feature: Authorized endpoint API tests for the rh-identity authentication module
150150
{"placeholder":"abc"}
151151
"""
152152
Then The status code of the response is 403
153-
And The body of the response contains "Missing required entitlement"
153+
And The body of the response contains Missing required entitlement
154154

155155
Scenario: Request fails when entitlement exists but is_entitled is false
156156
Given The system is in default state
@@ -170,7 +170,7 @@ Feature: Authorized endpoint API tests for the rh-identity authentication module
170170
{"placeholder":"abc"}
171171
"""
172172
Then The status code of the response is 403
173-
And The body of the response contains "Missing required entitlement"
173+
And The body of the response contains Missing required entitlement
174174

175175
Scenario: Request fails when User identity is missing user field
176176
Given The system is in default state

0 commit comments

Comments
 (0)