Skip to content

Commit

Permalink
feat: update device-reachability-status.feature
Browse files Browse the repository at this point in the history
  • Loading branch information
maxl2287 committed Oct 30, 2024
1 parent 2f1731e commit 4b5f348
Showing 1 changed file with 42 additions and 34 deletions.
76 changes: 42 additions & 34 deletions code/Test_definitions/device-reachability-status.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,57 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi

############# Happy Path Scenarios ##################

@device_reachability_status_01_reachabilityStatusConnectedSms
@device_reachability_status_01_reachableAndConnectedSms
Scenario: Check the reachability status if device is connected with SMS
Given a valid devicestatus request body
Given a valid device reachability status request body
And the request body property "$.device" is set to a valid testing device which is connected with sms and supported by the service
When the request "getReachabilityStatus" is sent
Then the response code is 200
And the response header "Content-Type" is "application/json"
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/ReachabilityStatusResponse"
And the response property "$.status" is 200
And the response property "$.code" is "OK"
And the response property "$.message" contains a user friendly text
And the response property "$.reachabilityStatus" is "CONNECTED_SMS"
And the response property "$.reachable" is true
And the response property "$.connectivity" is ["SMS"]

@device_reachability_status_02_reachabilityStatusConnectedData
@device_reachability_status_02_reachableAndConnectedData
Scenario: Check the reachability status if device is connected with DATA
Given a valid devicestatus request body
Given a valid device reachability status request body
And the request body property "$.device" is set to a valid testing device which is connected with data and supported by the service
When the request "getReachabilityStatus" is sent
Then the response code is 200
And the response header "Content-Type" is "application/json"
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/ReachabilityStatusResponse"
And the response property "$.reachable" is true
And the response property "$.connectivity" is ["DATA"]

@device_reachability_status_03_reachableAndConnectedDataAndSms
Scenario: Check the reachability status if device is connected with DATA
Given a valid device reachability status request body
And the request body property "$.device" is set to a valid testing device which is connected with data and supported by the service
When the request "getReachabilityStatus" is sent
Then the response code is 200
And the response header "Content-Type" is "application/json"
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/ReachabilityStatusResponse"
And the response property "$.status" is 200
And the response property "$.code" is "OK"
And the response property "$.reachabilityStatus" is "CONNECTED_DATA"
And the response property "$.reachable" is true
And the response property "$.connectivity" is ["DATA","SMS"]

@device_reachability_status_03_reachabilityStatusDeviceNotConnected
Scenario: Check the reachability status for DeviceNotConnected
Given a valid devicestatus request body
@device_reachability_status_04_notReachable
Scenario: Check the reachability status for an unreachable device
Given a valid device reachability status request body
And the request body property "$.device" is set to a valid testing device which is not connected and supported by the service
When the request "getReachabilityStatus" is sent
Then the response code is 200
And the response header "Content-Type" is "application/json"
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/ReachabilityStatusResponse"
And the response property "$.status" is 200
And the response property "$.code" is "OK"
And the response property "$.reachabilityStatus" is "NOT_CONNECTED"
And the response property "$.reachable" is false
And the response property "$.connectivity" is not returned

#############Error Response Scenarios##################

@device_reachability_status_04_deviceStatus_with_invalid_parameter
@device_reachability_status_05_deviceStatus_with_invalid_parameter
Scenario: Device reachability status request with invalid parameter
Given the request body is not compliant with the schema "/components/schemas/RequestReachabilityStatus"
When the request "getReachabilityStatus" is sent
Expand All @@ -64,29 +72,29 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text

@device_reachability_status_05_expired_access_token
@device_reachability_status_06_expired_access_token
Scenario: Expired access token
Given a valid devicestatus request body
Given a valid device reachability status request body
And header "Authorization" is set to expired token
When the request "getReachabilityStatus" is sent
Then the response status code is 401
And the response property "$.status" is 401
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text

@device_reachability_status_06_no_authorization_header
@device_reachability_status_07_no_authorization_header
Scenario: No Authorization header
Given a valid devicestatus request body
Given a valid device reachability status request body
And header "Authorization" is not available
When the request "getReachabilityStatus" is sent
Then the response status code is 401
And the response property "$.status" is 401
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text

@device_reachability_status_07_invalid_access_token
@device_reachability_status_08_invalid_access_token
Scenario: Invalid access token
Given a valid devicestatus request body
Given a valid device reachability status request body
And header "Authorization" set to an invalid access token
When the request "getReachabilityStatus" is sent
Then the response status code is 401
Expand All @@ -95,10 +103,10 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text

@device_reachability_status_08_deviceStatus_inconsistent_access_token
@device_reachability_status_09_deviceStatus_inconsistent_access_token
Scenario: Inconsistent access token context for the device
# To test this, a token has to be obtained for a different device
Given a valid devicestatus request body
Given a valid device reachability status request body
And the request body property "$.device" is set to a valid testing device supported by the service
And header "Authorization" set to access token referring different device
When the request "getReachabilityStatus" is sent
Expand All @@ -107,40 +115,40 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi
And the response property "$.code" is "INVALID_TOKEN_CONTEXT"
And the response property "$.message" contains a user friendly text

@device_reachability_status_09_deviceStatusWithIdentifiersMismatch
@device_reachability_status_10_deviceStatusWithIdentifiersMismatch
Scenario: Device reachabilityidentifiers 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 reachability associated to a different phoneNumber
Given a valid devicestatus request body
Given a valid device reachability status request body
And the request body property "$.device" includes several identifiers, each of them identifying a valid but different device
When the request "getReachabilityStatus" 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

@device_reachability_status_10_deviceStatus_NotApplicable
@device_reachability_status_11_deviceStatus_NotApplicable
Scenario: Device reachability not applicable
Given a valid devicestatus request body
Given a valid device reachability status request body
And the request body property "$.device" refers to an unknown device
When the request "getReachabilityStatus" 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

@device_reachability_status_11_unable_to_provide_reachability_status
@device_reachability_status_12_unable_to_provide_reachability_status
Scenario: Unable to provide reachability status for a device
Given a valid devicestatus request body
Given a valid device reachability status request body
And the request body property "$.device" refers to a device having network issue
When the request "getReachabilityStatus" is sent
Then the response status code is 422
And the response property "$.status" is 422
And the response property "$.code" is "UNABLE_TO_PROVIDE_REACHABILITY_STATUS"
And the response property "$.message" contains a user friendly text

@device_reachability_status_12_unsupported_device_identifiers
@device_reachability_status_13_unsupported_device_identifiers
Scenario: Unsupported device identifiers
Given a valid devicestatus request body
Given a valid device reachability status request body
And the request body property "$.device" set to unsupported identifiers value for the service
When the request "getReachabilityStatus" is sent
Then the response status code is 422
Expand Down

0 comments on commit 4b5f348

Please sign in to comment.