Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial test plan #19

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

fernandopradocabrillo
Copy link
Contributor

What type of PR is this?

Add one of the following kinds:

  • enhancement/feature
  • tests

What this PR does / why we need it:

Include initial basic test plan for the API

And the response header "x-correlator" has same value as the request header "x-correlator"
And the response body complies with the OAS schema at "/components/schemas/TenureInfo"
And the response property "$.tenureDateCheck" is true
And if the response contains property "$.contractType" is one of ["PAYG", "PAYM", "Business"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
And if the response contains property "$.contractType" is one of ["PAYG", "PAYM", "Business"]
And if the response contains property "$.contractType", the value is one of ["PAYG", "PAYM", "Business"]

And if the response contains property "$.contractType" is one of ["PAYG", "PAYM", "Business"]

@checkTenure_2_tenure_check_false
Scenario: Validate successful response when tenureDateCheck is true
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Scenario: Validate successful response when tenureDateCheck is true
Scenario: Validate successful response when tenureDateCheck is false

And the response header "x-correlator" has same value as the request header "x-correlator"
And the response body complies with the OAS schema at "/components/schemas/TenureInfo"
And the response property "$.tenureDateCheck" is false
And if the response contains property "$.contractType" is one of ["PAYG", "PAYM", "Business"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
And if the response contains property "$.contractType" is one of ["PAYG", "PAYM", "Business"]
And if the response contains property "$.contractType", the value is one of ["PAYG", "PAYM", "Business"]

Given the header "Authorization" is set to an expired access token
When the HTTP "POST" request is sent
Then the response status code is 401
And the response property "$.code" is "UNAUTHENTICATED" or "AUTHENTICATION_REQUIRED"
Copy link
Contributor

Choose a reason for hiding this comment

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

My understanding is that AUTHENTICATION_REQUIRED is returned when the access token has expired (i.e. was once valid, but is no longer because its lifetime has expired), whereas UNAUTHENTICATED is returned when the access token was either never valid, or has been "cancelled" for some other reason (e.g. token was reported stolen and thus voided).

But I agree that the API design guidelines are not at all clear on this point.

Suggested change
And the response property "$.code" is "UNAUTHENTICATED" or "AUTHENTICATION_REQUIRED"
And the response property "$.code" is "AUTHENTICATION_REQUIRED"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it's not very clear.. I opted for both since there is no consensus and other test plans have used different options. I think this way is a bit more flexible and we can always update it before the meta if there is a more clear path.


@checkTenure_401.2_invalid_access_token
Scenario: Error response for invalid access token
Given the header "Authorization" is set to an invalid access token
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Given the header "Authorization" is set to an invalid access token
Given the header "Authorization" is set to an invalid access token which is invalid for reasons other than lifetime expiry

@checkTenure_404.1_phone_number_not_found
Scenario: Phone number not found
Given the header "Authorization" is set to a valid access token from which the phone number cannot be deducted
And the request body property "$.phoneNumber" is compliant with the schema but does not identify a valid subscription
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
And the request body property "$.phoneNumber" is compliant with the schema but does not identify a valid subscription
And the request body property "$.phoneNumber" is compliant with the schema but does not identify a valid subscription managed by the API provider


@checkTenure_422.1_service_not_applicable
Scenario: Service not applicable for the phone number
Given that service is not supported for all phone numbers commercialized by the operator
Copy link
Contributor

Choose a reason for hiding this comment

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

"network operator" could also be replaced by "API provider"

Suggested change
Given that service is not supported for all phone numbers commercialized by the operator
Given that service is not supported for all phone numbers managed by the network operator

@eric-murray
Copy link
Contributor

See also C02-phoneNumber-errors.feature, which defines an additional test C02.01_phone_number_not_schema_compliant

@fernandopradocabrillo
Copy link
Contributor Author

fernandopradocabrillo commented Jan 8, 2025

Thanks @eric-murray for the review. I've applied most of the suggestions and I have align the errors with the common artifact. I checked with Jose and the idea is that the common can be copy/pasted as it is modifying the minimum.

cc: @GillesInnov35

@fernandopradocabrillo
Copy link
Contributor Author

Hi @GillesInnov35 @eric-murray
We need to have the test plan ready before jan 17 so we can proceed with the release. Please take a look

GillesInnov35
GillesInnov35 previously approved these changes Jan 15, 2025
Copy link

@GillesInnov35 GillesInnov35 left a comment

Choose a reason for hiding this comment

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

Thanks a lot

code/Test_definitions/kyc-tenure.feature Show resolved Hide resolved
Copy link

@tanjadegroot tanjadegroot left a comment

Choose a reason for hiding this comment

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

looks good _ some typos to be fixed

And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text

@check_device_swap_400.3_out_of_range

Choose a reason for hiding this comment

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

Copy error - device swap --> checkTenure


# Only with a 3-legged access token
@checkTenure_C02.03_unnecessary_phone_number
Scenario: Phone number not to included when can be deducted from the access token

Choose a reason for hiding this comment

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

Phone number "not to be included" or should not be included"

@fernandopradocabrillo
Copy link
Contributor Author

Thanks for the review @tanjadegroot

Please @GillesInnov35 can you approve again? it got dismissed..

cc: @eric-murray

@fernandopradocabrillo
Copy link
Contributor Author

hi @eric-murray @grgpapadopoulos according to @tanjadegroot, everything seems fine with the release PR, we just need to merge the test plan to complete the process.
I can see that Gilles approved, please take a look in case we need to update anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants