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

Create Gherkin tests for device-status-reachability and device-status-roaming #186

Merged
merged 19 commits into from
Aug 30, 2024

Conversation

mdomale
Copy link
Contributor

@mdomale mdomale commented Jul 9, 2024

Feature file for device-reachability-status & device-roaming-status

What type of PR is this?

  • tests

What this PR does / why we need it:

Gherkin syntax feature file for syntax

Which issue(s) this PR fixes:

Fixes #

Special notes for reviewers:

Changelog input

 release-note

Additional documentation

This section can be blank.

docs

Feature file for device-reachability-status & device-connectivity-status
@akoshunyadi akoshunyadi changed the title Create device-status.feature Create Gherkin tests for device-status-reachability and device-status-roaming Jul 10, 2024
@bigludo7
Copy link
Collaborator

Hello @mdomale
Thanks for the contribution.
Probably better to split in 2 files to have one file for device-reachability-status and another for device-connectivity-status.

On the file itself we should align with the API-Testing-Guidelines. We should have environment variables, background section, etc... You can probably take a look on this PR that could be used as an illustration of the guidelines.

@mdomale mdomale marked this pull request as ready for review July 23, 2024 08:52
@mdomale
Copy link
Contributor Author

mdomale commented Jul 23, 2024

Updated as per newly agreed camara testing guidelines

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 for the contribution.

Few suggestions for your appreciation. I did the review for code/Test_definitions/device-reachability-status.feature but I guess same applies for the second API.

  • Add Test cases for 403 INVALID_TOKEN_CONTEXT
  Scenario: Inconsistent access token context for the device
    # To test this, a token have to be obtained for a different device
    Given the request body property "$.device" is set to a valid testing device
    And the header "Authorization" is set to a valid access token emitted for a different device
    When the HTTP "POST" request is sent
    Then the response status code is 403
    And the response property "$.status" is 403
    And the response property "$.code" is "INVALID_TOKEN_CONTEXT"
    And the response property "$.message" contains a user friendly text
  • Add Test Case for 422 for DEVICE_IDENTIFIERS_MISMATCH
  Scenario: Device identifiers mismatch
    # To test this, at least 2 types of identifiers have to be provided, e.g. a phoneNumber and the IP address of a device associated to a different phoneNumber
    Given that config_var "identifier_types_unsupported" contains at least 2 items
    And the request body property "$.device" includes several identifiers, each of them identifying a valid but different device
    When the HTTP "POST" request is sent
    Then the response status code is 422
    And the response property "$.status" is 422
    And the response property "$.code" is "DEVICE_IDENTIFIERS_MISMATCH"
    And the response property "$.message" contains a user friendly text
  • Add Test Case for 422 for DEVICE_NOT_APPLICABLE
  Scenario: Service not available for the device
    Given that service is not supported for all devices commercialized by the operator 
    And the request body property "$.device" is set to a valid device for which the service is not applicable
    When the HTTP "POST" request is sent
    Then the response status code is 422
    And the response property "$.status" is 422
    And the response property "$.code" is "DEVICE_NOT_APPLICABLE"
    And the response property "$.message" contains a user friendly text
  • Add Test Case for 422 for UNABLE_TO_PROVIDE_REACHABILITY_STATUS

  • We can add one for 406 but not very valuable - I'm fine if you skip this one.

code/Test_definitions/device-reachability-status.feature Outdated Show resolved Hide resolved
@bigludo7
Copy link
Collaborator

@mdomale @akoshunyadi
It looks very good for me.

For me oly one thing missing: all explicit error are not tested. You have added 422 DEVICE_IDENTIFIERS_MISMATCH. We should also add test cased for 422 DEVICE_NOT_APPLICABLE, 422 UNABLE_TO_PROVIDE_REACHABILITY_STATUS and 422 UNSUPPORTED_DEVICE_IDENTIFIERS

Then for me we will be good !
Thanks

@mdomale mdomale requested a review from bigludo7 August 29, 2024 13:31
@mdomale
Copy link
Contributor Author

mdomale commented Aug 29, 2024

@bigludo7 @sachinvodafone PR amended. Kindly review

bigludo7
bigludo7 previously approved these changes Aug 29, 2024
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 @mdomale
I saw you added the 3 422 so it is good for me !

@mdomale
Copy link
Contributor Author

mdomale commented Aug 30, 2024

@bigludo7 @bigludo7 PR updated .

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

@akoshunyadi akoshunyadi merged commit 7bb1247 into camaraproject:main Aug 30, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants