Skip to content

Create Gherkin tests for Device Swap API#23

Merged
jgarciahospital merged 3 commits intomainfrom
jgarciahospital-patch-4
Oct 18, 2024
Merged

Create Gherkin tests for Device Swap API#23
jgarciahospital merged 3 commits intomainfrom
jgarciahospital-patch-4

Conversation

@jgarciahospital
Copy link
Contributor

What type of PR is this?

  • enhancement/feature
  • tests

What this PR does / why we need it:

Including test proposal for Device Swap 0.1.0

Which issue(s) this PR fixes:

Fixes #20

Copy link
Collaborator

@bigludo7 bigludo7 left a comment

Choose a reason for hiding this comment

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

Thanks
3 comments for your appreciation.

@check_device_swap_6_no_device_swap_no_max_age
Scenario: Check that the response shows that the device has not been swapped - maxAge is not provided in the request parameter
Given a valid phone number identified by the token or provided in the request body
And the device has never been swapped
Copy link
Collaborator

Choose a reason for hiding this comment

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

It works except if we the sim has been installed on the device for less than 240 hours - in this case I expect an answer true
So probably add
and the sim card is associated with this device for more than 240 hours

Copy link
Contributor Author

Choose a reason for hiding this comment

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

included

@check_device_swap_7_no_device_swap_with_max_age
Scenario Outline: Check that the response shows that the device has never been swapped - maxAge is provided in the request
Given a valid phone number identified by the token or provided in the request body
And the device has never been swapped
Copy link
Collaborator

Choose a reason for hiding this comment

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

Idem previous - should we add that the link sim-device is also anterior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

included

Given I want to test "checkDeviceSwap" for a user who has a phone number that has never been activated in the network
And this phone number is provided in the request body
When the request "checkDeviceSwap" is sent
Then the response status code is 200
Copy link
Collaborator

Choose a reason for hiding this comment

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

We're not falling in this case: In case the phone number has never been installed in a device, or no data is available in the operators records (e.g. database error), API will return a 422 error ?

Copy link
Contributor Author

@jgarciahospital jgarciahospital Oct 16, 2024

Choose a reason for hiding this comment

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

That was a duplicated test case, in fact actual testcase is below (check_device_swap_8_NoDeviceSwapPhoneNumberNeverConnected). Wrong one is now deleted

@bigludo7
Copy link
Collaborator

  • file name to follow guidance (comment from @rartych )

@jgarciahospital
Copy link
Contributor Author

@bigludo7 comments solved, and naming changed according to @rartych comments

Copy link
Collaborator

@bigludo7 bigludo7 left a comment

Choose a reason for hiding this comment

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

LGTM
Thanks Jorge

@jgarciahospital jgarciahospital merged commit 27b73be into main Oct 18, 2024
@jgarciahospital jgarciahospital deleted the jgarciahospital-patch-4 branch October 18, 2024 10:20
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.

First release for Device Swap v0.1

2 participants