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

feat: added support in env setup glue for fetching device details dynamically #188

Merged
merged 27 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
91083ee
added support in env setup glue for fetching device details dynamically
anjalimukundan Aug 6, 2024
e4e2ae7
addressed review comments for error handling msg
anjalimukundan Aug 7, 2024
03660a0
added support in fcs to fetch device details dynamically
anjalimukundan Aug 9, 2024
00a8bd7
addressed review comments
anjalimukundan Aug 12, 2024
70ae3a5
updated deviceContentValidation
anjalimukundan Aug 12, 2024
ddb6a7f
added documentation for deviceContentValidation
anjalimukundan Aug 12, 2024
765a8f8
updated constant file
anjalimukundan Aug 13, 2024
034e7d5
updated constants file
anjalimukundan Aug 13, 2024
a574958
updated validations.js
anjalimukundan Aug 13, 2024
25bc6c9
resolved conflicts
anjalimukundan Aug 13, 2024
9aa65a2
removed deviceContentValidation check
anjalimukundan Aug 13, 2024
3dac48b
updated validations.js
anjalimukundan Aug 13, 2024
61fdbc3
removed fetch_device_details env
anjalimukundan Aug 14, 2024
1325275
updated validations.md file with eg:
anjalimukundan Aug 14, 2024
4d17a6d
Merge branch 'dev' into fetch_device_details
anjalimukundan Aug 19, 2024
64c28ea
updated the dynamic device details fetch flow for deviceContentValida…
anjalimukundan Aug 19, 2024
05aac2e
added comments for each if condition in validations.js
anjalimukundan Aug 19, 2024
6ee0c9b
resolved conflicts
anjalimukundan Aug 20, 2024
e8d42e7
addressed review comments for dynamic_details_fetch
anjalimukundan Aug 20, 2024
4db89d6
updated readme.doc
anjalimukundan Aug 21, 2024
cd359a1
Merge branch 'dev' into fetch_device_details
anjalimukundan Aug 21, 2024
4bff988
updated validations.md file with dynamic details fetch doc
anjalimukundan Aug 21, 2024
bf5710f
updated validations.md file
anjalimukundan Aug 21, 2024
c5585fb
updated readme file with fetchDeviceDetails override function
anjalimukundan Aug 21, 2024
6ccbf02
addressed review comments for documentation
anjalimukundan Aug 22, 2024
c9a7083
Merge branch 'dev' into fetch_device_details
anjalimukundan Aug 26, 2024
c0be880
added dynamicContentValidations.md
anjalimukundan Aug 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 183 additions & 0 deletions Docs/Request_Overrides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# Request overrides

## fetchPerformanceThreshold:

- Request:<br>
Makes an HTTP request to graphite with deviceMac, processType with how much percentile, and from what time to fetch the metrics.<br>
Format:
```
{
method: 'performance.fetchPerformanceThreshold',
params: {'type': '<(device|process|all)>', process: '<(memory|load|set size|required)>', percentile: 70, threshold: '<Threshold to use as source of truth>'}
}
```
Examples:
```
{
method: 'performance.fetchPerformanceThreshold',
params: {'type': 'device', process: 'memory', percentile: 70, threshold: '35000000'}
}
{
method: 'performance.fetchPerformanceThreshold',
params: {'type': 'process', process: 'set size', percentile: 70, threshold: '75000000'}
}
{
method: 'performance.fetchPerformanceThreshold',
params: {'type': 'all', process: 'required', percentile: 70, threshold: '75000000'}
}
```
- Response:<br>
Receives an array of objects, which contains success and message properties, success defines the execution is a success or failure and message defines either response or any custom message that descibes the pass/fail.
Example:
```
[
{
"success": true,
"message": "Expected received threshold for set sizeRSS is 37748736 to be less than the expected threshold of 1073741824"
},
{
"success": true,
"message": "Expected received threshold for set sizePSS is 41964544 to be less than the expected threshold of 1073741824"
}
]
```

## createMarker:

- Request:<br>
Making an HTTP call to grafana to create a marker on dashboard with given description.<br>
Format:
```
{
method: 'performance.createMarker',
params: <Scenario name>
}
```
Examples:
```
{
method: 'performance.createMarker',
params: 'Account.id - Positive Scenario: Validate account ID'
}
```
- Response:<br>
Recieves an object with success and message properties.
Example:
```
{
"success": true,
"message": "Marker has been created successfully"
}
{
"success": false,
"message": `Unable to create marker, failed with status code- 200 and error- unable to find the dashboard`
}
```

## setTestProvider:

- Request:<br>
Making a call which sends necessary message to the platform to use a test provider for simulating user inputs.<br>
Format:
```
{
method: 'fcs.setTestProvider',
params: <provider name>
}
```
Examples:
```
{
method: 'fcs.setTestProvider',
params: 'pinChallenge'
}
```
- Response:<br>
Receives an object with intent message.
Example:
```
{
"action": "search",
"context": {
"source": "device"
},
"data": {
"query": "{\"task\":\"registerProviderHandler\",\"params\":{\"provider\":\"pinChallenge\"},\"action\":\"CORE\",\"context\":{\"communicationMode\":\"SDK\"},\"asynchronous\":false}"
}
}
```

## recordLifecycleHistory:

- Request:<br>
Making a call to the platform to start/stop the lifecycle history recording.<br>
Format:
```
{
"method": "fcs.recordLifecycleHistory",
"params": {
"task": "<task name>",
"appId": "<app ID>"
}
}

```
Examples:
```
{
"method": "fcs.recordLifecycleHistory",
"params": {
"task": "start",
"appId": "test"
}
}
```
- Response:<br>
Receives an object with intent message and transport type.
Example:
```
"transport": "<transportMode>",
"payload": {
"action": "search",
"context": {
"source": "device"
},
"data": {
"query": "{\"task\":\"start\",\"params\":{\"provider\":\"pinChallenge\"},\"action\":\"CORE\",\"context\":{\"communicationMode\":\"SDK\"},\"asynchronous\":false}"
}
}
```

## fetchDeviceDetails:

- Request:<br>
Making a call to fetch device details and the token required for dynamically fetching details .<br>

Format:
```
{
"method": "fcs.fetchDeviceDetails",
"params": <deviceId>
}

```
Examples:
```
{

"method": "fcs.fetchDeviceDetails",
"params": "354444327"
}
```
- Response:<br>
Receives the updated environment variable device_data with dynamic device details.
Example:

```
{
"DEVICEID": "354444327",
"DEVICE_TYPE": "ipstb",
"DEVICE_MODEL": "VALUE",
...
}
```
144 changes: 1 addition & 143 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,150 +253,8 @@ HTTP call to the platform:<br/>

## Request overrides

### fetchPerformanceThreshold:
Documentation added in [Request_Overrides.md](/Docs/Request_Overrides.md)

- Request:<br>
Makes an HTTP request to graphite with deviceMac, processType with how much percentile, and from what time to fetch the metrics.<br>
Format:
```
{
method: 'performance.fetchPerformanceThreshold',
params: {'type': '<(device|process|all)>', process: '<(memory|load|set size|required)>', percentile: 70, threshold: '<Threshold to use as source of truth>'}
}
```
Examples:
```
{
method: 'performance.fetchPerformanceThreshold',
params: {'type': 'device', process: 'memory', percentile: 70, threshold: '35000000'}
}
{
method: 'performance.fetchPerformanceThreshold',
params: {'type': 'process', process: 'set size', percentile: 70, threshold: '75000000'}
}
{
method: 'performance.fetchPerformanceThreshold',
params: {'type': 'all', process: 'required', percentile: 70, threshold: '75000000'}
}
```
- Response:<br>
Receives an array of objects, which contains success and message properties, success defines the execution is a success or failure and message defines either response or any custom message that descibes the pass/fail.
Example:
```
[
{
"success": true,
"message": "Expected received threshold for set sizeRSS is 37748736 to be less than the expected threshold of 1073741824"
},
{
"success": true,
"message": "Expected received threshold for set sizePSS is 41964544 to be less than the expected threshold of 1073741824"
}
]
```
### createMarker:

- Request:<br>
Making an HTTP call to grafana to create a marker on dashboard with given description.<br>
Format:
```
{
method: 'performance.createMarker',
params: <Scenario name>
}
```
Examples:
```
{
method: 'performance.createMarker',
params: 'Account.id - Positive Scenario: Validate account ID'
}
```
- Response:<br>
Recieves an object with success and message properties.
Example:
```
{
"success": true,
"message": "Marker has been created successfully"
}
{
"success": false,
"message": `Unable to create marker, failed with status code- 200 and error- unable to find the dashboard`
}
```
### setTestProvider:

- Request:<br>
Making a call which sends necessary message to the platform to use a test provider for simulating user inputs.<br>
Format:
```
{
method: 'fcs.setTestProvider',
params: <provider name>
}
```
Examples:
```
{
method: 'fcs.setTestProvider',
params: 'pinChallenge'
}
```
- Response:<br>
Receives an object with intent message.
Example:
```
{
"action": "search",
"context": {
"source": "device"
},
"data": {
"query": "{\"task\":\"registerProviderHandler\",\"params\":{\"provider\":\"pinChallenge\"},\"action\":\"CORE\",\"context\":{\"communicationMode\":\"SDK\"},\"asynchronous\":false}"
}
}
```
### recordLifecycleHistory:

- Request:<br>
Making a call to the platform to start/stop the lifecycle history recording.<br>
Format:
```
{
"method": "fcs.recordLifecycleHistory",
"params": {
"task": "<task name>",
"appId": "<app ID>"
}
}

```
Examples:
```
{
"method": "fcs.recordLifecycleHistory",
"params": {
"task": "start",
"appId": "test"
}
}
```
- Response:<br>
Receives an object with intent message and transport type.
Example:
```
"transport": "<transportMode>",
"payload": {
"action": "search",
"context": {
"source": "device"
},
"data": {
"query": "{\"task\":\"start\",\"params\":{\"provider\":\"pinChallenge\"},\"action\":\"CORE\",\"context\":{\"communicationMode\":\"SDK\"},\"asynchronous\":false}"
}
}
```

## Interaction Log service

Expand Down
10 changes: 2 additions & 8 deletions cypress/plugins/testDataProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,8 @@ function testDataHandler(requestType, dataIdentifier, fireboltObject) {
if (!deviceMac) {
logger.info('Falling back to default device data path');
}
let deviceData = fetchAndParseDataFromJson(deviceDataPath, data.type);
if (deviceData === CONSTANTS.NO_DATA) {
logger.info(
`Expected deviceData not found for ${data.type}. Returning ${data.type} as is.`
);
deviceData = data.type;
}
data.type = deviceData;
const deviceData = fetchDataFromFile(deviceDataPath);
envVariables[CONSTANTS.DEVICE_DATA] = deviceData;
break;

default:
Expand Down
5 changes: 5 additions & 0 deletions cypress/support/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,12 @@ module.exports = {
DEVICEMODULEFORMAT: 'deviceModelFormat',
DEVICE_AUDIO: 'device.audio',
DEVICE_CONTENT_VALIDATION: 'deviceContentValidation',
DEVICE_DATA: 'deviceData',
DEVICE_ENV: 'Device',
DEVICE_FIRMWARE: 'Device Firmware',
DEVICE_HDCP: 'device.hdcp',
DEVICE_HDR: 'device.hdr',
DEVICE_ID: 'device.id',
DEVICE_IP: 'deviceIp',
DEVICE_MAC: 'deviceMac',
DEVICE_MAC_UNAVAILABLE: 'Device MAC unavailable',
Expand All @@ -99,6 +101,7 @@ module.exports = {
DEVICE_PLATFORM: 'device.platform',
DEVICE_VIDEORESOLUTION: 'device.videoResolution',
DISCOVERY_LAUNCH: 'discovery.launch',
DYNAMIC_DEVICE_DETAILS_MODULES: ['Device'],
EMAIL: 'email',
neeradanelxsi marked this conversation as resolved.
Show resolved Hide resolved
ENV_PLATFORM_SDK_VERSION: 'platformSdkVersion',
ENV_PLATFORM: 'platform',
Expand Down Expand Up @@ -192,6 +195,7 @@ module.exports = {
CUSTOM: 'custom',
VALIDATION_FUNCTION: 'validationFunction',
NOT_SUPPORTED: 'NOT_SUPPORTED',
FETCH_DEVICE_DETAILS_DYNAMICALLY_FLAG: 'fetch_device_details_dynamically',
FIRST_PARTY_APPID: 'firstPartyAppId',
GENERATE_HTML_REPORT: true,
GETEVENTRESPONSE_ERROR_MSG: 'Received error: Requested listener not found',
Expand Down Expand Up @@ -362,6 +366,7 @@ module.exports = {
SETFIREBOLTINTERACTIONSHANDLER: 'fcs.setFireboltInteractionsHandler',
CREATE_MARKER: 'performance.createMarker',
UNLOADAPP: 'fcs.unloadApp',
FETCHDEVICEDETAILS: 'fcs.fetchDeviceDetails',
},
REQUEST_MAP_INTERACTIONS_SERVICE: 'Request map for firebolt interactions service : ',
RESPONSE: 'Response: ',
Expand Down
Loading
Loading