Skip to content

Commit

Permalink
Enable Gherkin Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroDiez committed Nov 12, 2024
1 parent 8b42dbf commit 131b2b4
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 262 deletions.
19 changes: 2 additions & 17 deletions code/Test_definitions/carrier-billing-cancelPayment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
# Happy path scenarios
##############################


@cancel_payment_01_generic_success_scenario
Scenario: Common validations for any success scenario
# Valid default request body compliant with the schema
Expand All @@ -31,27 +30,24 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"


@cancel_payment_02_phoneNumber_three_legged
# Case using a 3-legged Access Token
Scenario: Request cancel payment indicating phoneNumber
Scenario: Request cancel payment indicating phoneNumber in 3-legged access mode
Given the request body property "$.phonenumber" is set to a valid value which is the same as associated to access token
When the HTTP "POST" request is sent
Then the response status code is 202
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"


@cancel_payment_03_phoneNumber_two_legged
# Case using a 2-legged Access Token. Only applicable for Countries and Telco Operators whose regulation allows for it
Scenario: Request cancel payment indicating phoneNumber
Scenario: Request cancel payment indicating phoneNumber in 2-legged access mode
Given the request body property "$.phonenumber" is set to a valid value which is the same as associated to access token
When the HTTP "POST" request is sent
Then the response status code is 202
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"


##############################
# Error scenarios
##############################
Expand All @@ -67,7 +63,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text


@cancel_payment_400.02_empty_request_body
Scenario: Empty object as request body
Given the request body is set to "{}"
Expand All @@ -77,7 +72,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text


# Error 401 scenarios

@cancel_payment_401.01_no_authorization_header
Expand All @@ -90,7 +84,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@cancel_payment_401.02_expired_access_token
Scenario: Expired access token
Given the header "Authorization" is set to an expired access token
Expand All @@ -101,7 +94,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@cancel_payment_401.03_invalid_access_token
Scenario: Invalid access token
Given the header "Authorization" is set to an invalid access token
Expand All @@ -113,7 +105,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


# Error 403 scenarios

@cancel_payment_403.01_invalid_token_permissions
Expand All @@ -127,7 +118,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response property "$.code" is "PERMISSION_DENIED"
And the response property "$.message" contains a user friendly text


@cancel_payment_403.02_phoneNumber_token_mismatch
Scenario: Inconsistent access token context for the phoneNumber
# To test this, a 3-legged access token has to be obtained for a different phoneNumber
Expand All @@ -139,7 +129,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response property "$.code" is "INVALID_TOKEN_CONTEXT"
And the response property "$.message" contains a user friendly text


# Error 409 scenarios

@cancel_payment_409.01_payment_confirmed
Expand All @@ -153,7 +142,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response property "$.code" is "CARRIER_BILLING.PAYMENT_CONFIRMED"
And the response property "$.message" contains a user friendly text


@cancel_payment_409.02_payment_cancelled
Scenario: Payment already cancelled
Given the request body is set to a valid request body
Expand All @@ -165,7 +153,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response property "$.code" is "CARRIER_BILLING.PAYMENT_CANCELLED"
And the response property "$.message" contains a user friendly text


# Error 422 scenarios

@cancel_payment_422.01_phoneNumber_required
Expand All @@ -179,8 +166,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response property "$.code" is "CARRIER_BILLING.PHONE_NUMBER_REQUIRED"
And the response property "$.message" contains a user friendly text


##############################
##END
##############################

20 changes: 2 additions & 18 deletions code/Test_definitions/carrier-billing-confirmPayment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
# Happy path scenarios
##############################


@confirm_payment_01_generic_success_scenario
Scenario: Common validations for any success scenario
# Valid default request body compliant with the schema
Expand All @@ -32,27 +31,24 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"


@confirm_payment_02_phoneNumber_three_legged
# Case using a 3-legged Access Token
Scenario: Request confirm payment indicating phoneNumber
Scenario: Request confirm payment indicating phoneNumber in 3-legged access mode
Given the request body property "$.phonenumber" is set to a valid value which is the same as associated to access token
When the HTTP "POST" request is sent
Then the response status code is 202
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"


@confirm_payment_03_phoneNumber_two_legged
# Case using a 2-legged Access Token. Only applicable for Countries and Telco Operators whose regulation allows for it
Scenario: Request confirm payment indicating phoneNumber
Scenario: Request confirm payment indicating phoneNumber in 2-legged access mode
Given the request body property "$.phonenumber" is set to a valid value which is the same as associated to access token
When the HTTP "POST" request is sent
Then the response status code is 202
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has same value as the request header "x-correlator"


##############################
# Error scenarios
##############################
Expand All @@ -68,7 +64,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text


@confirm_payment_400.02_empty_request_body
Scenario: Empty object as request body
Given the request body is set to "{}"
Expand All @@ -78,7 +73,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text


# Error 401 scenarios

@confirm_payment_401.01_no_authorization_header
Expand All @@ -91,7 +85,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@confirm_payment_401.02_expired_access_token
Scenario: Expired access token
Given the header "Authorization" is set to an expired access token
Expand All @@ -102,7 +95,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@confirm_payment_401.03_invalid_access_token
Scenario: Invalid access token
Given the header "Authorization" is set to an invalid access token
Expand All @@ -114,7 +106,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


# Error 403 scenarios

@confirm_payment_403.01_invalid_token_permissions
Expand All @@ -128,7 +119,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "PERMISSION_DENIED"
And the response property "$.message" contains a user friendly text


@confirm_payment_403.02_phoneNumber_token_mismatch
Scenario: Inconsistent access token context for the phoneNumber
# To test this, a 3-legged access token has to be obtained for a different phoneNumber
Expand All @@ -140,7 +130,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "INVALID_TOKEN_CONTEXT"
And the response property "$.message" contains a user friendly text


@confirm_payment_403.02_payment_denied
Scenario: Payment denied by business
# To test this, a business context exists in the Telco Operator to deny the payment
Expand All @@ -152,7 +141,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "CARRIER_BILLING.PAYMENT_DENIED"
And the response property "$.message" contains a user friendly text


# Error 409 scenarios

@confirm_payment_409.01_payment_confirmed
Expand All @@ -166,7 +154,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "CARRIER_BILLING.PAYMENT_CONFIRMED"
And the response property "$.message" contains a user friendly text


@confirm_payment_409.02_payment_cancelled
Scenario: Payment already cancelled
Given the request body is set to a valid request body
Expand All @@ -178,7 +165,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "CARRIER_BILLING.PAYMENT_CANCELLED"
And the response property "$.message" contains a user friendly text


# Error 422 scenarios

@confirm_payment_422.01_phoneNumber_required
Expand All @@ -192,8 +178,6 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "CARRIER_BILLING.PHONE_NUMBER_REQUIRED"
And the response property "$.message" contains a user friendly text


##############################
##END
##############################

Loading

0 comments on commit 131b2b4

Please sign in to comment.