From 5cc5ee8c611d0b0ab2fa6277118e53d26bc42e52 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Thu, 25 Apr 2024 14:47:26 +0530 Subject: [PATCH 001/359] FIRECERT-1789:[FCS] - Use window values for app transitions and language --- cypress.config.js | 1 + .../objects/moduleReqId/moduleReqId.json | 65 +++++++++++++++++++ cypress/support/constants/constants.js | 5 ++ cypress/support/cypress-commands/lifecycle.js | 65 +++++++++++++++++++ 4 files changed, 136 insertions(+) diff --git a/cypress.config.js b/cypress.config.js index a6d31cc4..f9a50699 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -59,6 +59,7 @@ const env = { performanceMetrics: false, generateLocalReport: true, testSuite: '', + visibilityState: { foreground: 'visible', background: 'visible', inactive: 'hidden' }, }; module.exports = { diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index dd4e49d7..ba5d0c80 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -1617,6 +1617,11 @@ "event": { "id": ["1.2.1", "1.2.2"] } + }, + { + "visible_check": { + "id": "1.2.3" + } } ] }, @@ -1636,6 +1641,11 @@ "event": { "id": ["1.2.1", "1.2.2"] } + }, + { + "visible_check": { + "id": "1.2.3" + } } ] }, @@ -1655,6 +1665,11 @@ "event": { "id": ["1.2.1", "1.2.2"] } + }, + { + "visible_check": { + "id": "1.2.3" + } } ] } @@ -1676,6 +1691,11 @@ "event": { "id": ["1.3.6", "1.3.6"] } + }, + { + "visible_check": { + "id": "1.3.2" + } } ] }, @@ -1695,6 +1715,11 @@ "event": { "id": ["1.3.6", "1.3.6"] } + }, + { + "visible_check": { + "id": "1.3.2" + } } ] }, @@ -1714,6 +1739,11 @@ "event": { "id": ["1.4.6", "1.3.6"] } + }, + { + "visible_check": { + "id": "1.3.2" + } } ] } @@ -1735,6 +1765,11 @@ "event": { "id": ["1.4.6", "1.3.6"] } + }, + { + "visible_check": { + "id": "1.4.3" + } } ] }, @@ -1754,6 +1789,11 @@ "event": { "id": ["1.4.6", "1.3.6"] } + }, + { + "visible_check": { + "id": "1.4.3" + } } ] }, @@ -1773,6 +1813,11 @@ "event": { "id": ["1.4.6", "1.3.6"] } + }, + { + "visible_check": { + "id": "1.4.3" + } } ] }, @@ -1792,6 +1837,11 @@ "event": { "id": ["1.4.6", "1.3.6"] } + }, + { + "visible_check": { + "id": "1.4.3" + } } ] }, @@ -1811,6 +1861,11 @@ "event": { "id": ["1.4.6", "1.3.6"] } + }, + { + "visible_check": { + "id": "1.4.3" + } } ] }, @@ -1830,6 +1885,11 @@ "event": { "id": ["1.4.6", "1.3.6"] } + }, + { + "visible_check": { + "id": "1.4.3" + } } ] }, @@ -1849,6 +1909,11 @@ "event": { "id": ["1.4.6", "1.3.6"] } + }, + { + "visible_check": { + "id": "1.4.3" + } } ] } diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 71cf9ef1..d82703d7 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -348,6 +348,7 @@ module.exports = { SETAPIRESPONSE: 'setApiResponse', CLEAREVENTHANDLER: 'clearEventHandler', PERFORMANCETESTHANDLER: 'performanceTestHandler', + VISIBILITYSTATE: 'visibilityState', }, TEST_HANDLER_DATA_UNDEFINED: 'Expected parsed data from fixtures to be defined', TEST_DATA_HANDLER_REQUESTTYPE: ['Params', 'Context', 'Content', 'beforeOperation'], @@ -395,6 +396,10 @@ module.exports = { FCS_DEFAULTTESTDATA_PATH: './cypress/fixtures/defaultTestData.json', ENV_SETUP_STATUS: 'environmentLaunched', APP_LAUNCH_STATUS: 'appLaunched', + VISIBILITYSTATE_VALIDATION_REQ: 'Lifecycle visibility state validation Req # ', + LIFECYCLE_VISIBILITYSTATE_SKIP_MESSAGE: '`App is not reachable to fetch visibility state. Skipping Visibility state validation.`', + VISIBILITYSTATE_FAILURE_FIX_LOG: '`, How to fix: If the visibility state response is correct for the current platform, but the expected value needs to be changed, add the expected value in configModule file ( cypress.config.js) in the format visibilityState: { ${state} : ${result.report}}`', + VISIBILITYSTATE_FAILURE_LOG: '`. If the visibility state response is correct for the current platform, but the expected value needs to be changed, add the expected value in configModule file ( cypress.config.js) in the format visibilityState: { ${state} : ${result.report}}`', }; function getSanityReportPath() { // Check if Cypress is defined, for cypress test context diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 4adf338c..d7f14274 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -106,6 +106,7 @@ Cypress.Commands.add('validateLifecycleState', (state, appId) => { JSON.parse(response).report.result, appObject.getAppObjectState().state ); + validateVisibilityState(state); } catch (error) { cy.log(CONSTANTS.ERROR_LIFECYCLE_STATE_VALIDATION + error).then(() => { assert(false, CONSTANTS.ERROR_LIFECYCLE_STATE_VALIDATION + error); @@ -477,3 +478,67 @@ Cypress.Commands.add('lifecycleSchemaChecks', (response, state) => { }; cy.validationChecksForResponseAndSchemaResult(response, false, apiSchemaResult, false); }); + +/** + * @module commands + * @function validateVisibilityState + * @description To validate app visibility for different lifecycle states + * @param {String} state - To check visibilityState of state + * @example + * validateVisibilityState('foreground'); + */ +function validateVisibilityState(state) { + // Fetching the visibilityState for the states from env. + const visibilityState = Cypress.env('visibilityState'); + if (visibilityState.hasOwnProperty(state)) { + // Get validation requirements for the current scenario from the moduleReqId JSON + const scenarioRequirement = UTILS.getEnvVariable(CONSTANTS.SCENARIO_REQUIREMENTS); + + // Fetching the requirement IDs for the "visiblilityState" from the scenarioRequirement. + const lifecycleStateRequirementId = scenarioRequirement.find((req) => + req.hasOwnProperty('visible_check') + ); + + if (Cypress.env('visibilityState') != undefined || Cypress.env('visibilityState') != null) { + const intentMessage = UTILS.createIntentMessage(CONSTANTS.TASK.VISIBILITYSTATE, { + params: 'visibilityState', + }); + const requestTopic = UTILS.getTopic(null); + const responseTopic = UTILS.getTopic(null, CONSTANTS.SUBSCRIBE); + // Sending message to third party app + cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((result) => { + result = JSON.parse(result); + if (result.report === CONSTANTS.RESPONSE_NOT_FOUND) { + cy.log(CONSTANTS.NO_MATCHED_RESPONSE).then(() => { + assert(false, CONSTANTS.NO_MATCHED_RESPONSE); + }); + } else if (result.error) { + assert(false, result.error.message); + } + const pretext = + CONSTANTS.VISIBILITYSTATE_VALIDATION_REQ + lifecycleStateRequirementId.visible_check.id; + if (visibilityState[state] != result.report) { + const fixLog = eval(CONSTANTS.VISIBILITYSTATE_FAILURE_FIX_LOG); + const assertLog = eval(CONSTANTS.VISIBILITYSTATE_FAILURE_LOG); + cy.log( + pretext + + ': Expected : ' + + visibilityState[state] + + ' , Actual : ' + + result.report + + fixLog + ).then(() => { + assert.equal(visibilityState[state], result.report + assertLog); + }); + } + cy.log( + pretext + ': Expected : ' + visibilityState[state] + ' , Actual : ' + result.report + ).then(() => { + assert.equal(visibilityState[state], result.report, pretext); + }); + }); + } + } else { + cy.log(eval(CONSTANTS.LIFECYCLE_VISIBILITYSTATE_SKIP_MESSAGE)); + } +} From 434887eea2c84c4f3fd83505928f5166727568b2 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Thu, 25 Apr 2024 14:52:50 +0530 Subject: [PATCH 002/359] Linting issue fix --- cypress/support/constants/constants.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index d82703d7..f165849d 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -397,9 +397,12 @@ module.exports = { ENV_SETUP_STATUS: 'environmentLaunched', APP_LAUNCH_STATUS: 'appLaunched', VISIBILITYSTATE_VALIDATION_REQ: 'Lifecycle visibility state validation Req # ', - LIFECYCLE_VISIBILITYSTATE_SKIP_MESSAGE: '`App is not reachable to fetch visibility state. Skipping Visibility state validation.`', - VISIBILITYSTATE_FAILURE_FIX_LOG: '`, How to fix: If the visibility state response is correct for the current platform, but the expected value needs to be changed, add the expected value in configModule file ( cypress.config.js) in the format visibilityState: { ${state} : ${result.report}}`', - VISIBILITYSTATE_FAILURE_LOG: '`. If the visibility state response is correct for the current platform, but the expected value needs to be changed, add the expected value in configModule file ( cypress.config.js) in the format visibilityState: { ${state} : ${result.report}}`', + LIFECYCLE_VISIBILITYSTATE_SKIP_MESSAGE: + '`App is not reachable to fetch visibility state. Skipping Visibility state validation.`', + VISIBILITYSTATE_FAILURE_FIX_LOG: + '`, How to fix: If the visibility state response is correct for the current platform, but the expected value needs to be changed, add the expected value in configModule file ( cypress.config.js) in the format visibilityState: { ${state} : ${result.report}}`', + VISIBILITYSTATE_FAILURE_LOG: + '`. If the visibility state response is correct for the current platform, but the expected value needs to be changed, add the expected value in configModule file ( cypress.config.js) in the format visibilityState: { ${state} : ${result.report}}`', }; function getSanityReportPath() { // Check if Cypress is defined, for cypress test context From c631cf57b272a23eb70fc40c19d9e5a3b522d664 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Thu, 25 Apr 2024 15:00:09 +0530 Subject: [PATCH 003/359] Linting fix --- cypress/support/constants/constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index f165849d..d40a6afa 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -397,7 +397,7 @@ module.exports = { ENV_SETUP_STATUS: 'environmentLaunched', APP_LAUNCH_STATUS: 'appLaunched', VISIBILITYSTATE_VALIDATION_REQ: 'Lifecycle visibility state validation Req # ', - LIFECYCLE_VISIBILITYSTATE_SKIP_MESSAGE: + LIFECYCLE_VISIBILITYSTATE_SKIP_MESSAGE: '`App is not reachable to fetch visibility state. Skipping Visibility state validation.`', VISIBILITYSTATE_FAILURE_FIX_LOG: '`, How to fix: If the visibility state response is correct for the current platform, but the expected value needs to be changed, add the expected value in configModule file ( cypress.config.js) in the format visibilityState: { ${state} : ${result.report}}`', From 6ef4cb9cbe8cbd5653f52ea39d201856097fcc5b Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Thu, 25 Apr 2024 23:51:37 +0530 Subject: [PATCH 004/359] Logs Update --- cypress/support/constants/constants.js | 6 +++--- cypress/support/cypress-commands/lifecycle.js | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index d40a6afa..796889f2 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -398,11 +398,11 @@ module.exports = { APP_LAUNCH_STATUS: 'appLaunched', VISIBILITYSTATE_VALIDATION_REQ: 'Lifecycle visibility state validation Req # ', LIFECYCLE_VISIBILITYSTATE_SKIP_MESSAGE: - '`App is not reachable to fetch visibility state. Skipping Visibility state validation.`', + 'App is not reachable to fetch visibility state. Skipping Visibility state validation.', VISIBILITYSTATE_FAILURE_FIX_LOG: - '`, How to fix: If the visibility state response is correct for the current platform, but the expected value needs to be changed, add the expected value in configModule file ( cypress.config.js) in the format visibilityState: { ${state} : ${result.report}}`', + ', How to fix: If the visibility state response is as per the platform, add the expected value in configModule. More details is present in footer', VISIBILITYSTATE_FAILURE_LOG: - '`. If the visibility state response is correct for the current platform, but the expected value needs to be changed, add the expected value in configModule file ( cypress.config.js) in the format visibilityState: { ${state} : ${result.report}}`', + '. If the visibility state response is as per the platform, add the expected value in configModule. More details is present in footer', }; function getSanityReportPath() { // Check if Cypress is defined, for cypress test context diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index d7f14274..a6df630c 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -518,17 +518,15 @@ function validateVisibilityState(state) { const pretext = CONSTANTS.VISIBILITYSTATE_VALIDATION_REQ + lifecycleStateRequirementId.visible_check.id; if (visibilityState[state] != result.report) { - const fixLog = eval(CONSTANTS.VISIBILITYSTATE_FAILURE_FIX_LOG); - const assertLog = eval(CONSTANTS.VISIBILITYSTATE_FAILURE_LOG); cy.log( pretext + ': Expected : ' + visibilityState[state] + ' , Actual : ' + result.report + - fixLog + CONSTANTS.VISIBILITYSTATE_FAILURE_FIX_LOG ).then(() => { - assert.equal(visibilityState[state], result.report + assertLog); + assert.equal(visibilityState[state], result.report + CONSTANTS.VISIBILITYSTATE_FAILURE_LOG); }); } cy.log( @@ -539,6 +537,6 @@ function validateVisibilityState(state) { }); } } else { - cy.log(eval(CONSTANTS.LIFECYCLE_VISIBILITYSTATE_SKIP_MESSAGE)); + cy.log(CONSTANTS.LIFECYCLE_VISIBILITYSTATE_SKIP_MESSAGE); } } From 2a99b41fd98d0691812ef6c221ef4117c5a0a6ff Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Thu, 25 Apr 2024 23:58:20 +0530 Subject: [PATCH 005/359] linting fix --- cypress/support/cypress-commands/lifecycle.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index a6df630c..903b6fc6 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -526,7 +526,10 @@ function validateVisibilityState(state) { result.report + CONSTANTS.VISIBILITYSTATE_FAILURE_FIX_LOG ).then(() => { - assert.equal(visibilityState[state], result.report + CONSTANTS.VISIBILITYSTATE_FAILURE_LOG); + assert.equal( + visibilityState[state], + result.report + CONSTANTS.VISIBILITYSTATE_FAILURE_LOG + ); }); } cy.log( From 346dd8bb67e3e52274329791289e64b6c2649508 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Mon, 29 Apr 2024 13:40:33 +0530 Subject: [PATCH 006/359] Review comments address --- cypress/support/cypress-commands/lifecycle.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 5069c9cb..5f15d582 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -566,7 +566,7 @@ Cypress.Commands.add('lifecycleSchemaChecks', (response, state) => { */ function validateVisibilityState(state) { // Fetching the visibilityState for the states from env. - const visibilityState = Cypress.env('visibilityState'); + const visibilityState = Cypress.env(CONSTANTS.VISIBILITYSTATE); if (visibilityState.hasOwnProperty(state)) { // Get validation requirements for the current scenario from the moduleReqId JSON const scenarioRequirement = UTILS.getEnvVariable(CONSTANTS.SCENARIO_REQUIREMENTS); @@ -576,9 +576,12 @@ function validateVisibilityState(state) { req.hasOwnProperty('visible_check') ); - if (Cypress.env('visibilityState') != undefined || Cypress.env('visibilityState') != null) { + if ( + Cypress.env(CONSTANTS.VISIBILITYSTATE) != undefined || + Cypress.env(CONSTANTS.VISIBILITYSTATE) != null + ) { const intentMessage = UTILS.createIntentMessage(CONSTANTS.TASK.VISIBILITYSTATE, { - params: 'visibilityState', + params: CONSTANTS.VISIBILITYSTATE, }); const requestTopic = UTILS.getTopic(null); const responseTopic = UTILS.getTopic(null, CONSTANTS.SUBSCRIBE); From f2bd7642e829c6816c0fa1711db7c9c99e208e6d Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Mon, 29 Apr 2024 19:39:50 +0530 Subject: [PATCH 007/359] 2068 - porting HDMIInput --- .../Manage/HdmiInput.feature | 31 +++++++++++++++++++ cypress/fixtures/fireboltCalls/hdmiinput.json | 23 ++++++++++++++ cypress/fixtures/modules/hdmiinput.json | 8 +++++ .../objects/validationObjects/hdmiinput.json | 30 ++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature create mode 100644 cypress/fixtures/fireboltCalls/hdmiinput.json create mode 100644 cypress/fixtures/modules/hdmiinput.json create mode 100644 cypress/fixtures/objects/validationObjects/hdmiinput.json diff --git a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature new file mode 100644 index 00000000..4335c285 --- /dev/null +++ b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature @@ -0,0 +1,31 @@ +Feature: HdmiInput_Manage + + Background: Initialize 'HdmiInput' + Given the environment has been set up for 'Account' tests + And 3rd party 'certification' app is launched + + @HdmiInput @manageSDK @sdk @transport + Scenario: HDMIInput.ports - Positive Scenario: Validate HDMIInput ports + When 1st party app invokes the 'Firebolt' API to 'get hdmi input ports list' + Then 'Firebolt' platform responds to '1st party app' with 'expected hdmi input ports' + + @HdmiInput @manageSDK @sdk @transport + Scenario Outline: HDMIInput.port - Positive Scenario: + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with 'expected hdmi input port' + + Examples: + | Scenario | Key | + | Validate HDMIInput port - Hdmi1 | get hdmiinput port with portId HDMI1 | + | Validate HDMIInput port - Hdmi2 | get hdmiinput port with portId HDMI2 | + + @HdmiInput @manageSDK @sdk @transport + Scenario Outline: HDMIInput.port - Positive Scenario: + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with 'expected hdmi input port' + + Examples: + | Scenario | Key | + | Validate HDMIInput port - Hdmi1 | get hdmiinput port with portId HDMI1 | + | Validate HDMIInput port - Hdmi2 | get hdmiinput port with portId HDMI2 | + diff --git a/cypress/fixtures/fireboltCalls/hdmiinput.json b/cypress/fixtures/fireboltCalls/hdmiinput.json new file mode 100644 index 00000000..00bebcb1 --- /dev/null +++ b/cypress/fixtures/fireboltCalls/hdmiinput.json @@ -0,0 +1,23 @@ +{ + "GET_HDMI_INPUT_PORTS_LIST":{ + "method": "manage_hdmiinput.ports" + }, + "EXPECTED_HDMI_INPUT_PORTS":{ + "method": "hdmiinput.ports", + "validationJsonPath": "result", + "expected": "HDMIINPUT_PORTS" + }, + "GET_HDMI_INPUT_PORT_WITH_PORTID_HDMI1":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_PORT_HDMI1" + }, + "GET_HDMI_INPUT_PORT_WITH_PORTID_HDMI2":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_PORT_HDMI2" + }, + "EXPECTED_HDMI_INPUT_PORT":{ + "method": "hdmiinput.port", + "validationJsonPath": "result", + "expected": "HDMIINPUT_PORT" + } +} \ No newline at end of file diff --git a/cypress/fixtures/modules/hdmiinput.json b/cypress/fixtures/modules/hdmiinput.json new file mode 100644 index 00000000..85a859ce --- /dev/null +++ b/cypress/fixtures/modules/hdmiinput.json @@ -0,0 +1,8 @@ +{ + "PORT_HDMI1": { + "portId": "HDMI1" + }, + "PORT_HDMI2": { + "portId": "HDMI2" + } +} \ No newline at end of file diff --git a/cypress/fixtures/objects/validationObjects/hdmiinput.json b/cypress/fixtures/objects/validationObjects/hdmiinput.json new file mode 100644 index 00000000..62e82c65 --- /dev/null +++ b/cypress/fixtures/objects/validationObjects/hdmiinput.json @@ -0,0 +1,30 @@ +{ + "HDMIINPUT_PORTS": { + "method": "hdmiinput.ports", + "data": [ + { + "type": "regEx", + "validations": [ + { + "type": "object", + "description": "Validation of the HdmiInput ports format" + } + ] + } + ] + }, + "HDMIINPUT_PORT": { + "method": "hdmiinput.port", + "data": [ + { + "type": "regEx", + "validations": [ + { + "type": "object", + "description": "Validation of the HdmiInput port format" + } + ] + } + ] + } +} \ No newline at end of file From 09e3b818ce0bc7e5885ffc1556d47326850cfc66 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Tue, 30 Apr 2024 18:58:13 +0530 Subject: [PATCH 008/359] porting hdmiInput TCs --- .../FireboltCertification/Device.feature | 18 ---- .../Manage/HdmiInput.feature | 97 ++++++++++++++++--- .../SecondScreen.feature | 13 +-- cypress/fixtures/fireboltCalls/hdmiinput.json | 82 ++++++++++++++++ cypress/fixtures/modules/hdmiinput.json | 20 ++++ 5 files changed, 189 insertions(+), 41 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Device.feature b/cypress/TestCases/FireboltCertification/Device.feature index 83b7960a..a41c8e65 100644 --- a/cypress/TestCases/FireboltCertification/Device.feature +++ b/cypress/TestCases/FireboltCertification/Device.feature @@ -50,21 +50,3 @@ Feature: Device And 1st party app invokes the 'Firebolt' API to 'set device name to kitchen' Then 'Firebolt' platform responds to '1st party app' with 'null for device setName' And 'Firebolt' platform does not trigger event for 'onDeviceNameChanged' - - @Device @coreSDK @sdk @transport @notSupported - Scenario Outline: Device.network - Positive Scenario: - When '3rd party app' registers for the 'device onNetworkChanged' event using the 'Firebolt' API - And '3rd party app' invokes the 'Firebolt' API to 'fetch device network' - Then 'Firebolt' platform responds with '' - When User triggers event with value as '' - Then 'Firebolt' platform triggers event '' - - Examples: - | Scenario | Method_Validation_Key | Event_Validation_Key | - | Validate network_wifi_connected | device network as wifi connected | onNetworkChanged with wifi connected | - | Validate network_wifi_disconnected | device network as wifi disconnected | onNetworkChanged with wifi disconnected | - | Validate network_Ethernet_connected | device network as ethernet connected | onNetworkChanged with ethernet connected | - | Validate network_Ethernet_disconnected | device network as ethernet disconnected | onNetworkChanged with ethernet disconnected | - | Validate network_Hybrid_connected | device network as hybrid connected | onNetworkChanged with hybrid connected | - | Validate network_Hybrid_disconnected | device network as hybrid disconnected | onNetworkChanged with hybrid disconnected | - diff --git a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature index 4335c285..42f5119f 100644 --- a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature +++ b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature @@ -1,8 +1,8 @@ Feature: HdmiInput_Manage - Background: Initialize 'HdmiInput' - Given the environment has been set up for 'Account' tests - And 3rd party 'certification' app is launched + Background: Initialize 'HdmiInput' + Given the environment has been set up for 'Account' tests + And 3rd party 'certification' app is launched @HdmiInput @manageSDK @sdk @transport Scenario: HDMIInput.ports - Positive Scenario: Validate HDMIInput ports @@ -15,17 +15,92 @@ Feature: HdmiInput_Manage Then 'Firebolt' platform responds to '1st party app' with 'expected hdmi input port' Examples: - | Scenario | Key | - | Validate HDMIInput port - Hdmi1 | get hdmiinput port with portId HDMI1 | - | Validate HDMIInput port - Hdmi2 | get hdmiinput port with portId HDMI2 | + | Scenario | Key | + | Validate HDMIInput port - Hdmi1 | get hdmiinput port with portId HDMI1 | + | Validate HDMIInput port - Hdmi2 | get hdmiinput port with portId HDMI2 | @HdmiInput @manageSDK @sdk @transport Scenario Outline: HDMIInput.port - Positive Scenario: When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with 'expected hdmi input port' + When 1st party app invokes the 'Firebolt' API to 'get hdmiinput port with portId HDMI1' + Then 'Firebolt' platform responds to '1st party app' with '' + + Examples: + | Scenario | Key | Validation_Key | + | Validate HDMIInput port autoLowLatencyModeCapable true | set autoLowLatencyModeCapable with true | true for autoLowLatencyModeCapable port | + | Validate HDMIInput port autoLowLatencyModeCapable false | set autoLowLatencyModeCapable with false | false for autoLowLatencyModeCapable port | + | Validate HDMIInput port edidVersion 1.4 | set edidVersion to 1.4 | 1.4 for edidVersion port | + | Validate HDMIInput port edidVersion 2.0 | set edidVersion to 2.0 | 2.0 for edidVersion port | + | Validate HDMIInput port edidVersion unknown | set edidVersion to unknown | 2.0 for edidVersion port | + + @HdmiInput @manageSDK @sdk @transport + Scenario Outline: HDMIInput.ports - Positive Scenario: + When 1st party app invokes the 'Firebolt' API to '' + When 1st party app invokes the 'Firebolt' API to 'get hdmi input ports list' + Then 'Firebolt' platform responds to '1st party app' with '' + + Examples: + | Scenario | Key | Validation_Key | + | Validate HDMIInput ports edidVersion 1.4 | set autoLowLatencyModeCapable with true | true for autoLowLatencyModeCapable ports | + | Validate HDMIInput ports edidVersion 2.0 | set autoLowLatencyModeCapable with false | false for autoLowLatencyModeCapable ports | + | Validate HDMIInput ports edidVersion unknown | set edidVersion to 1.4 | 1.4 for edidVersion ports | + | Validate HDMIInput ports autoLowLatencyModeCapable true | set edidVersion to 2.0 | 2.0 for edidVersion ports | + | Validate HDMIInput ports autoLowLatencyModeCapable false | set edidVersion to unknown | 2.0 for edidVersion ports | + + ## If edidVersion is 1.4, then autoLowLatencyModeCapable and autoLowLatencyModeSignalled must be false + @HdmiInput @manageSDK @sdk @transport + Scenario: HDMIInput.ports - Positive Scenario: Validate HDMIInput ports with edidVersion 1.4 + When 1st party app invokes the 'Firebolt' API to 'set edidVersion to 1.4' + When 1st party app invokes the 'Firebolt' API to 'get hdmi input ports list' + Then 'Firebolt' platform responds to '1st party app' with 'false for autoLowLatencyModeCapable ports' + Then 'Firebolt' platform responds to '1st party app' with 'false for autoLowLatencyModeSignalled ports' + + @HdmiInput @manageSDK @sdk @transport + Scenario: HDMIInput.open - Positive Scenario: Validate HDMIInput open + When 1st party app invokes the 'Firebolt' API to 'open HDMI1 port' + Then 'Firebolt' platform responds to '1st party app' with 'null for hdmi input open' + + @HdmiInput @manageSDK @sdk @transport + Scenario: HDMIInput.close - Positive Scenario: Validate HDMIInput close + When 1st party app invokes the 'Firebolt' API to 'close HDMI port' + Then 'Firebolt' platform responds to '1st party app' with 'null for hdmi input close' + + @HdmiInput @manageSDK @sdk @transport + Scenario Outline: HdmiInput. - Positive Scenario: + When 1st party app registers for the '' event using the 'Firebolt' API + When 1st party app invokes the 'Firebolt' API to '' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' + And 'Firebolt' platform triggers to '1st party app' event '' + + Examples: + | Scenario | Key | Validation_Key | Event_Registration_Key | Get_API_Key | Event_Validation_Key | + | set AutoLowLatencyModeCapable-true | set autoLowLatencyModeCapable true with HDMI1 | true for autoLowLatencyModeCapable HDMI1 port | hdmiInput onAutoLowLatencyModeCapableChanged | get autoLowLatencyModeCapable | true for onAutoLowLatencyModeCapableChanged | + | set AutoLowLatencyModeCapable-false | set autoLowLatencyModeCapable false with HDMI1 | false for autoLowLatencyModeCapable HDMI1 port | hdmiInput onAutoLowLatencyModeCapableChanged | get autoLowLatencyModeCapable | false for onAutoLowLatencyModeCapableChanged | + | set EdidVersion-1.4 | set edidVersion to 1.4 | 1.4 for edidVersion HDMI1 port | hdmiInput onEdidVersionChanged | get edidVersion | 1.4 for onEdidVersionChanged | + | set EdidVersion-2.0 | set edidVersion to 2.0 | 2.0 for edidVersion HDMI1 port | hdmiInput onEdidVersionChanged | get edidVersion | 2.0 for onEdidVersionChanged | + | set EdidVersion-unknown | set edidVersion to unknown | 2.0 for edidVersion HDMI1 port | hdmiInput onEdidVersionChanged | get edidVersion | 2.0 for onEdidVersionChanged | + | set LowLatencyMode-true | set lowLatencyMode with true | true for lowLatencyMode | hdmiInput onLowLatencyModeChanged | get lowLatencyMode | true for onLowLatencyModeChanged | + | set LowLatencyMode-false | set lowLatencyMode with false | false for lowLatencyMode | hdmiInput onLowLatencyModeChanged | get lowLatencyMode | false for onLowLatencyModeChanged | + + @HdmiInput @manageSDK @sdk @transport + Scenario Outline: HDMIInput.port - Negative Scenario: + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput port' + + Examples: + | Scenario | Key | + | Validate HDMIInput port - integer | set hdmiInput with integer | + | Validate HDMIInput port - boolean | set hdmiInput with boolean | + | Validate HDMIInput port - invalid string | set hdmiInput with invalid string | + + @HdmiInput @manageSDK @sdk @transport + Scenario Outline: HDMIInput.ports - Negative Scenario: + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput ports' Examples: - | Scenario | Key | - | Validate HDMIInput port - Hdmi1 | get hdmiinput port with portId HDMI1 | - | Validate HDMIInput port - Hdmi2 | get hdmiinput port with portId HDMI2 | - + | Scenario | Key | + | Validate HDMIInput ports with integer edidVersion | set hdmiInput port with integer edidVersion | + | Validate HDMIInput ports with boolean edidVersion | set hdmiInput port with boolean edidVersion | + | Validate HDMIInput ports with invalid string edidVersion | set hdmiInput port with invalid string edidVersion | \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/SecondScreen.feature b/cypress/TestCases/FireboltCertification/SecondScreen.feature index 708251ef..3f5224ba 100644 --- a/cypress/TestCases/FireboltCertification/SecondScreen.feature +++ b/cypress/TestCases/FireboltCertification/SecondScreen.feature @@ -40,15 +40,4 @@ Feature: Secondscreen And I clear 'secondscreen onFriendlyNameChanged event' listeners And 1st party app invokes the 'Firebolt' API to 'set friendlyName to guest room' Then 'Firebolt' platform responds to '1st party app' with 'null for device setName' - And 'Firebolt' platform does not trigger event for 'onFriendlyNameChanged' - - @Secondscreen @coreSDK @regression @sdk @notSupported - Scenario Outline: Secondscreen. - Positive Scenario: Validating event Clearing listeners - When '3rd party app' registers for the '' event using the 'Firebolt' API - And I clear '' listeners - # Then User triggers event with value as '' - Then 'Firebolt' platform does not trigger event for '' - Examples: - | Event_Name | Registered_Event | Clear_Event_Name | Event_Validation_Key | - | onLaunchRequest | secondscreen onLaunchRequest | secondscreen onLaunchRequest event | null for secondscreen onLaunchRequest event | - | onCloseRequest | secondscreen onCloseRequest | secondscreen onCloseRequest event | null for secondscreen onCloseRequest event | \ No newline at end of file + And 'Firebolt' platform does not trigger event for 'onFriendlyNameChanged' \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/hdmiinput.json b/cypress/fixtures/fireboltCalls/hdmiinput.json index 00bebcb1..eaacdd60 100644 --- a/cypress/fixtures/fireboltCalls/hdmiinput.json +++ b/cypress/fixtures/fireboltCalls/hdmiinput.json @@ -19,5 +19,87 @@ "method": "hdmiinput.port", "validationJsonPath": "result", "expected": "HDMIINPUT_PORT" + }, + "SET_AUTOLOWLATENCYMODECAPABLE_WITH_TRUE": { + "method": "manage_hdmiinput.setAutoLowLatencyModeCapable", + "params": "HDMIINPUT_SETAUTOLOWLATENCYMODECAPABLE_TRUE" + }, + "TRUE_FOR_AUTOLOWLATENCYMODECAPABLE_PORT":{ + "method": "hdmiinput.port", + "validationJsonPath": "result.autoLowLatencyModeCapable", + "expected": "TRUE" + }, + "SET_AUTOLOWLATENCYMODECAPABLE_WITH_FALSE": { + "method": "manage_hdmiinput.setAutoLowLatencyModeCapable", + "params": "HDMIINPUT_SETAUTOLOWLATENCYMODECAPABLE_FALSE" + }, + "FALSE_FOR_AUTOLOWLATENCYMODECAPABLE_PORT":{ + "method": "hdmiinput.port", + "validationJsonPath": "result.autoLowLatencyModeCapable", + "expected": "FALSE" + }, + "SET_EDIDVERSION_TO_1.4": { + "method": "manage_hdmiinput.setEdidVersion", + "params": "HDMIINPUT_EDIDVERSION_1_4_HDMI1" + }, + "1.4_FOR_EDIDVERSION_PORT":{ + "method": "hdmiinput.port", + "validationJsonPath": "result.edidVersion", + "expected": "HDMIINPUT_EDIDVERSION_1_4" + }, + "SET_EDIDVERSION_TO_2.0": { + "method": "manage_hdmiinput.setEdidVersion", + "params": "HDMIINPUT_EDIDVERSION_2_0_HDMI1" + }, + "2.0_FOR_EDIDVERSION_PORT":{ + "method": "hdmiinput.port", + "validationJsonPath": "result.edidVersion", + "expected": "HDMIINPUT_EDIDVERSION_2_0" + }, + "SET_EDIDVERSION_TO_UNKNOWN": { + "method": "manage_hdmiinput.setEdidVersion", + "params": "HDMIINPUT_EDIDVERSION_UNKNOWN_HDMI1" + }, + "TRUE_FOR_AUTOLOWLATENCYMODECAPABLE_PORTS":{ + "method": "hdmiinput.ports", + "validationJsonPath": "result[0].autoLowLatencyModeCapable", + "expected": "TRUE" + }, + "FALSE_FOR_AUTOLOWLATENCYMODECAPABLE_PORTS":{ + "method": "hdmiinput.ports", + "validationJsonPath": "result[0].autoLowLatencyModeCapable", + "expected": "FALSE" + }, + "1.4_FOR_EDIDVERSION_PORTS":{ + "method": "hdmiinput.ports", + "validationJsonPath": "result[0].edidVersion", + "expected": "HDMIINPUT_EDIDVERSION_1_4" + }, + "2.0_FOR_EDIDVERSION_PORTS":{ + "method": "hdmiinput.ports", + "validationJsonPath": "result[0].edidVersion", + "expected": "HDMIINPUT_EDIDVERSION_2_0" + }, + "FALSE_FOR_AUTOLOWLATENCYMODESIGNALLED_PORTS":{ + "method": "hdmiinput.ports", + "validationJsonPath": "result[0].autoLowLatencyModeSignalled", + "expected": "FALSE" + }, + "OPEN_HDMI1_PORT":{ + "method": "manage_hdmiinput.open", + "params": "HDMIINPUT_PORT_HDMI1" + }, + "NULL_FOR_HDMI_INPUT_OPEN":{ + "method": "hdmiinput.open", + "validationJsonPath": "result", + "expected": "NULL" + }, + "CLOSE_HDMI_PORT":{ + "method": "manage_hdmiinput.close" + }, + "NULL_FOR_HDMI_INPUT_CLOSE":{ + "method": "hdmiinput.close", + "validationJsonPath": "result", + "expected": "NULL" } } \ No newline at end of file diff --git a/cypress/fixtures/modules/hdmiinput.json b/cypress/fixtures/modules/hdmiinput.json index 85a859ce..d45c1414 100644 --- a/cypress/fixtures/modules/hdmiinput.json +++ b/cypress/fixtures/modules/hdmiinput.json @@ -4,5 +4,25 @@ }, "PORT_HDMI2": { "portId": "HDMI2" + }, + "SETAUTOLOWLATENCYMODECAPABLE_TRUE": { + "port": "HDMI1", + "value": true + }, + "SETAUTOLOWLATENCYMODECAPABLE_FALSE": { + "port": "HDMI1", + "value": false + }, + "EDIDVERSION_1_4_HDMI1": { + "port": "HDMI1", + "value": "1.4" + }, + "EDIDVERSION_2_0_HDMI1": { + "port": "HDMI1", + "value": "2.0" + }, + "EDIDVERSION_UNKNOWN_HDMI1": { + "port": "HDMI1", + "value": "unknown" } } \ No newline at end of file From 39692f1487d819a0d308705079f2f13bbd43c2a6 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Fri, 3 May 2024 14:35:49 +0530 Subject: [PATCH 009/359] Review comment address --- cypress/support/constants/constants.js | 2 +- cypress/support/cypress-commands/lifecycle.js | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 1e65f533..e6340f31 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -353,7 +353,6 @@ module.exports = { SETAPIRESPONSE: 'setApiResponse', CLEAREVENTHANDLER: 'clearEventHandler', PERFORMANCETESTHANDLER: 'performanceTestHandler', - VISIBILITYSTATE: 'visibilityState', }, TEST_HANDLER_DATA_UNDEFINED: 'Expected parsed data from fixtures to be defined', TEST_DATA_HANDLER_REQUESTTYPE: ['Params', 'Context', 'Content', 'beforeOperation'], @@ -410,6 +409,7 @@ module.exports = { '. If the visibility state response is as per the platform, add the expected value in configModule. More details is present in footer', NO_EVENT_TRIGGERED: 'Expecting no event to be triggered from platform', VISIBILITYSTATE: 'visibilityState', + VISIBLE_CHECK: 'visible_check', }; function getSanityReportPath() { // Check if Cypress is defined, for cypress test context diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 5f15d582..2b7fb6c1 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -567,37 +567,49 @@ Cypress.Commands.add('lifecycleSchemaChecks', (response, state) => { function validateVisibilityState(state) { // Fetching the visibilityState for the states from env. const visibilityState = Cypress.env(CONSTANTS.VISIBILITYSTATE); - if (visibilityState.hasOwnProperty(state)) { + + if (visibilityState != null && visibilityState.hasOwnProperty(state)) { // Get validation requirements for the current scenario from the moduleReqId JSON const scenarioRequirement = UTILS.getEnvVariable(CONSTANTS.SCENARIO_REQUIREMENTS); // Fetching the requirement IDs for the "visiblilityState" from the scenarioRequirement. const lifecycleStateRequirementId = scenarioRequirement.find((req) => - req.hasOwnProperty('visible_check') + req.hasOwnProperty(CONSTANTS.VISIBLE_CHECK) ); + // checking for visibilityState value from env not be undefined or null. if ( Cypress.env(CONSTANTS.VISIBILITYSTATE) != undefined || Cypress.env(CONSTANTS.VISIBILITYSTATE) != null ) { + // Creating intent message with visibilityState task to send it to 3rd party app. const intentMessage = UTILS.createIntentMessage(CONSTANTS.TASK.VISIBILITYSTATE, { params: CONSTANTS.VISIBILITYSTATE, }); + // Topic to publish message const requestTopic = UTILS.getTopic(null); + // Topic to subscribe message const responseTopic = UTILS.getTopic(null, CONSTANTS.SUBSCRIBE); // Sending message to third party app cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((result) => { result = JSON.parse(result); + + // checking for response, if no response, fail the test if (result.report === CONSTANTS.RESPONSE_NOT_FOUND) { cy.log(CONSTANTS.NO_MATCHED_RESPONSE).then(() => { assert(false, CONSTANTS.NO_MATCHED_RESPONSE); }); - } else if (result.error) { + } + // checking for response, if error, fail the test with error message + else if (result.error) { assert(false, result.error.message); } + const pretext = CONSTANTS.VISIBILITYSTATE_VALIDATION_REQ + lifecycleStateRequirementId.visible_check.id; + // checking if actual value is different from the default value if (visibilityState[state] != result.report) { + // log to print a reason for failure and how to fix it cy.log( pretext + ': Expected : ' + From a7d6f48c79ab897e5eaaf02488eee3ccd9219faa Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 3 May 2024 15:07:08 +0530 Subject: [PATCH 010/359] FIRECERT-2025-call updateresponse for third party and pass sdkversion via cli --- cypress/support/constants/constants.js | 1 + .../support/step_definitions/fireboltCalls.js | 80 ++++++++++--------- .../support/step_definitions/validations.js | 2 +- .../support/validations/schemaValidation.js | 6 +- 4 files changed, 47 insertions(+), 42 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 13ff5a93..59d286b0 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -320,6 +320,7 @@ module.exports = { SCHEMA_VALIDATION_RESPONSE: 'schemaValidationResponse', SCHEMA_VALIDATION_STATUS: 'schemaValidationStatus', SCHEMA_VALIDATION_STATUS_CODE: ['PASS', 'FAIL', 'SKIPPED', 'PENDING'], + SDK_VERSION: 'sdkVersion', SEARCH: 'search', SET_APP_STATE: 'Application state set to ', SET_LIFECYCLE_STATE_MISSING: diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 12a0a61f..16c18fed 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -66,7 +66,7 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = } } - cy.updateResponseForFCS(method, params, response).then((updatedResponse) => { + cy.updateResponseForFCS(method, params, response, Cypress.env(CONSTANTS.SDK_VERSION)).then((updatedResponse) => { // Create a deep copy to avoid reference mutation const dataToBeCensored = _.cloneDeep(response); @@ -163,30 +163,32 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { assert(false, CONSTANTS.NO_MATCHED_RESPONSE); } result = JSON.parse(result); + cy.updateResponseForFCS(method, params, result, Cypress.env(CONSTANTS.SDK_VERSION)).then((updatedResponse) => { + // Create a deep copy to avoid reference mutation + const dataToBeCensored = _.cloneDeep(result.report.apiResponse); - // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(result.report.apiResponse); - - // Call the 'censorData' command to hide sensitive data - cy.censorData(method, dataToBeCensored).then((maskedResult) => { - cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); - }); + // Call the 'censorData' command to hide sensitive data + cy.censorData(method, dataToBeCensored).then((maskedResult) => { + cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); + }); - // If method and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(method, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } + // If method and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(method, param)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } - // Creating object with method name, params and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - method, - param, - context, - result.report, - expected, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + // Creating object with method name, params and response etc and storing it in a global list for further validation. + const apiAppObject = new apiObject( + method, + param, + context, + //result.report, + updatedResponse, + expected, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + }); }); }); }); @@ -255,22 +257,24 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI } result = JSON.parse(result); cy.log(`Response from ${appId}: ${JSON.stringify(result.report.eventListenerResponse)}`); + cy.updateResponseForFCS(event, params, result, Cypress.env(CONSTANTS.SDK_VERSION)).then((updatedResponse) => { + // If event and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(event, param)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } - // If event and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(event, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } - - // Creating object with event name, params and response etc and storing it in a global list for further validation. - const eventAppObject = new eventObject( - event, - param, - context, - result.report, - appId, - expected - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); + // Creating object with event name, params and response etc and storing it in a global list for further validation. + const eventAppObject = new eventObject( + event, + param, + context, + //result.report, + updatedResponse, + appId, + expected + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); + }); }); }); }); @@ -337,7 +341,7 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn ); } - cy.updateResponseForFCS(event, params, response).then((updatedResponse) => { + cy.updateResponseForFCS(event, params, response, Cypress.env(CONSTANTS.SDK_VERSION)).then((updatedResponse) => { cy.log('Response from Firebolt platform: ' + JSON.stringify(response)); // If event and params are not supported setting isScenarioExempted as true for further validation. if (UTILS.isScenarioExempted(event, params)) { diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 081de441..f3d9bee5 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -109,7 +109,7 @@ Given( }; cy.sendMessagetoPlatforms(requestMap).then((result) => { - cy.updateResponseForFCS(methodOrEvent, null, result).then( + cy.updateResponseForFCS(methodOrEvent, null, result, Cypress.env(CONSTANTS.SDK_VERSION)).then( (updatedResponse) => { cy.saveEventResponse( updatedResponse, diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 173d143f..45120afd 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -66,7 +66,7 @@ async function getAndDeferenceOpenRPC(version) { */ Cypress.Commands.add( 'updateResponseForFCS', - (methodOrEvent, params, response, sdkVersion = null) => { + (methodOrEvent, params, response, sdkVersion) => { if (response.hasOwnProperty(CONSTANTS.RESULT) || response.hasOwnProperty(CONSTANTS.ERROR)) { let formattedResponse = {}; let result; @@ -161,7 +161,7 @@ Cypress.Commands.add( */ Cypress.Commands.add( 'validateSchema', - (response, methodOrEvent, params, sdkVersion = null, schemaType) => { + (response, methodOrEvent, params, sdkVersion, schemaType) => { cy.getSchema(methodOrEvent, params, sdkVersion, schemaType).then((schemaMap) => { if (schemaMap) { return validator.validate(response, schemaMap); @@ -186,7 +186,7 @@ Cypress.Commands.add( * getSchema("accessibility.closedCaptionsSettings", {}, "0.17.0", "result") * getSchema("accessibility.onClosedCaptionsSettingsChanged", {}, null, "result") */ -Cypress.Commands.add('getSchema', (methodOrEvent, params, sdkVersion = null, schemaType) => { +Cypress.Commands.add('getSchema', (methodOrEvent, params, sdkVersion, schemaType) => { cy.wrap().then(async () => { let schemaList; if (UTILS.getEnvVariable(CONSTANTS.DEREFERENCE_OPENRPC, false)) { From 295f309721ae713eba6ee4a01d6d62796ba50269 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 3 May 2024 15:36:34 +0530 Subject: [PATCH 011/359] FIRECERT-2025-lint fix --- .../support/step_definitions/fireboltCalls.js | 127 ++++++++++-------- .../support/step_definitions/validations.js | 25 ++-- .../support/validations/schemaValidation.js | 35 ++--- 3 files changed, 97 insertions(+), 90 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 16c18fed..b1dd7fc7 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -66,7 +66,12 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = } } - cy.updateResponseForFCS(method, params, response, Cypress.env(CONSTANTS.SDK_VERSION)).then((updatedResponse) => { + cy.updateResponseForFCS( + method, + params, + response, + Cypress.env(CONSTANTS.SDK_VERSION) + ).then((updatedResponse) => { // Create a deep copy to avoid reference mutation const dataToBeCensored = _.cloneDeep(response); @@ -163,32 +168,34 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { assert(false, CONSTANTS.NO_MATCHED_RESPONSE); } result = JSON.parse(result); - cy.updateResponseForFCS(method, params, result, Cypress.env(CONSTANTS.SDK_VERSION)).then((updatedResponse) => { - // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(result.report.apiResponse); + cy.updateResponseForFCS(method, params, result, Cypress.env(CONSTANTS.SDK_VERSION)).then( + (updatedResponse) => { + // Create a deep copy to avoid reference mutation + const dataToBeCensored = _.cloneDeep(result.report.apiResponse); - // Call the 'censorData' command to hide sensitive data - cy.censorData(method, dataToBeCensored).then((maskedResult) => { - cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); - }); + // Call the 'censorData' command to hide sensitive data + cy.censorData(method, dataToBeCensored).then((maskedResult) => { + cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); + }); - // If method and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(method, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } + // If method and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(method, param)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } - // Creating object with method name, params and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - method, - param, - context, - //result.report, - updatedResponse, - expected, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); - }); + // Creating object with method name, params and response etc and storing it in a global list for further validation. + const apiAppObject = new apiObject( + method, + param, + context, + //result.report, + updatedResponse, + expected, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + } + ); }); }); }); @@ -257,24 +264,26 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI } result = JSON.parse(result); cy.log(`Response from ${appId}: ${JSON.stringify(result.report.eventListenerResponse)}`); - cy.updateResponseForFCS(event, params, result, Cypress.env(CONSTANTS.SDK_VERSION)).then((updatedResponse) => { - // If event and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(event, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } + cy.updateResponseForFCS(event, params, result, Cypress.env(CONSTANTS.SDK_VERSION)).then( + (updatedResponse) => { + // If event and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(event, param)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } - // Creating object with event name, params and response etc and storing it in a global list for further validation. - const eventAppObject = new eventObject( - event, - param, - context, - //result.report, - updatedResponse, - appId, - expected - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); - }); + // Creating object with event name, params and response etc and storing it in a global list for further validation. + const eventAppObject = new eventObject( + event, + param, + context, + //result.report, + updatedResponse, + appId, + expected + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); + } + ); }); }); }); @@ -341,24 +350,26 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn ); } - cy.updateResponseForFCS(event, params, response, Cypress.env(CONSTANTS.SDK_VERSION)).then((updatedResponse) => { - cy.log('Response from Firebolt platform: ' + JSON.stringify(response)); - // If event and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(event, params)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } + cy.updateResponseForFCS(event, params, response, Cypress.env(CONSTANTS.SDK_VERSION)).then( + (updatedResponse) => { + cy.log('Response from Firebolt platform: ' + JSON.stringify(response)); + // If event and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(event, params)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } - // Creating object with event name, params and response etc and storing it in a global list for further validation. - const eventAppObject = new eventObject( - event, - params, - context, - updatedResponse, - appId, - expected - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); - }); + // Creating object with event name, params and response etc and storing it in a global list for further validation. + const eventAppObject = new eventObject( + event, + params, + context, + updatedResponse, + appId, + expected + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); + } + ); } else { cy.log(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); } diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index f3d9bee5..3a0595e6 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -109,17 +109,20 @@ Given( }; cy.sendMessagetoPlatforms(requestMap).then((result) => { - cy.updateResponseForFCS(methodOrEvent, null, result, Cypress.env(CONSTANTS.SDK_VERSION)).then( - (updatedResponse) => { - cy.saveEventResponse( - updatedResponse, - methodOrEventObject, - eventName, - expected, - eventExpected === 'triggers' ? true : false - ); - } - ); + cy.updateResponseForFCS( + methodOrEvent, + null, + result, + Cypress.env(CONSTANTS.SDK_VERSION) + ).then((updatedResponse) => { + cy.saveEventResponse( + updatedResponse, + methodOrEventObject, + eventName, + expected, + eventExpected === 'triggers' ? true : false + ); + }); }); } else { const params = { event: eventName }; diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 45120afd..2bb0b9e6 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -64,23 +64,16 @@ async function getAndDeferenceOpenRPC(version) { * @example * cy.updateResponseForFCS(method, params, response, sdkVersion = null) */ -Cypress.Commands.add( - 'updateResponseForFCS', - (methodOrEvent, params, response, sdkVersion) => { - if (response.hasOwnProperty(CONSTANTS.RESULT) || response.hasOwnProperty(CONSTANTS.ERROR)) { - let formattedResponse = {}; - let result; - const responseType = response.hasOwnProperty(CONSTANTS.ERROR) - ? CONSTANTS.ERROR - : CONSTANTS.RESULT; +Cypress.Commands.add('updateResponseForFCS', (methodOrEvent, params, response, sdkVersion) => { + if (response.hasOwnProperty(CONSTANTS.RESULT) || response.hasOwnProperty(CONSTANTS.ERROR)) { + let formattedResponse = {}; + let result; + const responseType = response.hasOwnProperty(CONSTANTS.ERROR) + ? CONSTANTS.ERROR + : CONSTANTS.RESULT; - cy.validateSchema( - response[responseType], - methodOrEvent, - params, - sdkVersion, - responseType - ).then((schemaValidation) => { + cy.validateSchema(response[responseType], methodOrEvent, params, sdkVersion, responseType).then( + (schemaValidation) => { if (methodOrEvent.includes('.on')) { let formattedSchemaValidationResult; @@ -139,12 +132,12 @@ Cypress.Commands.add( } return formattedResponse; - }); - } else { - cy.log(`Response does not have a valid result or error field - ${response}`); - } + } + ); + } else { + cy.log(`Response does not have a valid result or error field - ${response}`); } -); +}); /** * @module schemaValidation From 22caa6ac0eb91cf7cb1cc319622abb580a13dbc6 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 3 May 2024 15:37:34 +0530 Subject: [PATCH 012/359] FIRECERT-2025-lint fix --- cypress/support/step_definitions/fireboltCalls.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index b1dd7fc7..b46c7eb4 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -188,7 +188,6 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { method, param, context, - //result.report, updatedResponse, expected, appId @@ -276,7 +275,6 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI event, param, context, - //result.report, updatedResponse, appId, expected From ff596b5f5e1fa3d77d1a41f044fb5ab6f3725873 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Fri, 3 May 2024 17:04:14 +0530 Subject: [PATCH 013/359] Key values for thunderproxy test scenarios --- cypress/fixtures/fireboltCalls/hdmiinput.json | 90 ++++++++++++++++ cypress/fixtures/modules/hdmiinput.json | 101 +++++++++++++++++- 2 files changed, 190 insertions(+), 1 deletion(-) diff --git a/cypress/fixtures/fireboltCalls/hdmiinput.json b/cypress/fixtures/fireboltCalls/hdmiinput.json index eaacdd60..a1b6649c 100644 --- a/cypress/fixtures/fireboltCalls/hdmiinput.json +++ b/cypress/fixtures/fireboltCalls/hdmiinput.json @@ -101,5 +101,95 @@ "method": "hdmiinput.close", "validationJsonPath": "result", "expected": "NULL" + }, + "HDMIINPUT_ONCONNECTIONCHANGED":{ + "method": "manage_hdmiinput.onConnectionChanged" + }, + "HDMIINPUT_ONSIGNALCHANGED":{ + "method": "manage_hdmiinput.onSignalChanged" + }, + "HDMIINPUT_ONAUTOLOWLATENCYMODESIGNALCHANGED":{ + "method": "manage_hdmiinput.onAutoLowLatencyModeSignalChanged" + }, + "TRUE_FOR_HDMIINPUT_PORT_CONNECTED":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_CONNECTED_TRUE" + }, + "FALSE_FOR_HDMIINPUT_PORT_CONNECTED":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_CONNECTED_TRUE" + }, + "UNKNOWN_FOR_HDMIINPUT_PORT_SIGNAL":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_SIGNAL_UNKNOWN" + }, + "NONE_FOR_HDMIINPUT_PORT_SIGNAL":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_SIGNAL_NONE" + }, + "STABLE_FOR_HDMIINPUT_PORT_SIGNAL":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_SIGNAL_STABLE" + }, + "UNSTABLE_FOR_HDMIINPUT_PORT_SIGNAL":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_SIGNAL_UNSTABLE" + }, + "UNSUPPORTED_FOR_HDMIINPUT_PORT_SIGNAL":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_SIGNAL_UNSUPPORTED" + }, + "TRUE_FOR_HDMIINPUT_PORT_AUTOLOWLATENCYMODESIGNALLED":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_AUTOLOWLATENCYMODESIGNALLED_TRUE" + }, + "FALSE_FOR_HDMIINPUT_PORT_AUTOLOWLATENCYMODESIGNALLED":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_AUTOLOWLATENCYMODESIGNALLED_FALSE" + }, + "TRUE_FOR_HDMIINPUT_ONCONNECTIONCHANGED_EVENT":{ + "event": "manage_hdmiinput.onConnectionChanged", + "validationJsonPath": "eventResponse", + "expected": "HDMIINPUT_ONCONNECTIONCHANGED_TRUE" + }, + "FALSE_FOR_HDMIINPUT_ONCONNECTIONCHANGED_EVENT":{ + "event": "manage_hdmiinput.onConnectionChanged", + "validationJsonPath": "eventResponse", + "expected": "HDMIINPUT_ONCONNECTIONCHANGED_FALSE" + }, + "UNKNOWN_FOR_HDMIINPUT_ONSIGNALCHANGED_EVENT":{ + "event": "manage_hdmiinput.onSignalChanged", + "validationJsonPath": "eventResponse", + "expected": "HDMIINPUT_ONSIGNALCHANGED_UNKNOWN" + }, + "NONE_FOR_HDMIINPUT_ONSIGNALCHANGED_EVENT":{ + "event": "manage_hdmiinput.onSignalChanged", + "validationJsonPath": "eventResponse", + "expected": "HDMIINPUT_ONSIGNALCHANGED_NONE" + }, + "STABLE_FOR_HDMIINPUT_ONSIGNALCHANGED_EVENT":{ + "event": "manage_hdmiinput.onSignalChanged", + "validationJsonPath": "eventResponse", + "expected": "HDMIINPUT_ONSIGNALCHANGED_STABLE" + }, + "UNSTABLE_FOR_HDMIINPUT_ONSIGNALCHANGED_EVENT":{ + "event": "manage_hdmiinput.onSignalChanged", + "validationJsonPath": "eventResponse", + "expected": "HDMIINPUT_ONSIGNALCHANGED_UNSTABLE" + }, + "UNSUPPORTED_FOR_HDMIINPUT_ONCONNECTIONCHANGED_EVENT":{ + "event": "manage_hdmiinput.onSignalChanged", + "validationJsonPath": "eventResponse", + "expected": "HDMIINPUT_ONSIGNALCHANGED_UNSUPPORTED" + }, + "TRUE_FOR_HDMIINPUT_ONAUTOLOWLATENCYMODESIGNALCHANGED_EVENT":{ + "event": "manage_hdmiinput.onAutoLowLatencyModeSignalChanged", + "validationJsonPath": "eventResponse", + "expected": "HDMIINPUT_ONAUTOLOWLATENCYMODESIGNALCHANGED_TRUE" + }, + "FALSE_FOR_HDMIINPUT_ONAUTOLOWLATENCYMODESIGNALCHANGED_EVENT":{ + "event": "manage_hdmiinput.onAutoLowLatencyModeSignalChanged", + "validationJsonPath": "eventResponse", + "expected": "HDMIINPUT_ONAUTOLOWLATENCYMODESIGNALCHANGED_FALSE" } } \ No newline at end of file diff --git a/cypress/fixtures/modules/hdmiinput.json b/cypress/fixtures/modules/hdmiinput.json index d45c1414..3faa9ea8 100644 --- a/cypress/fixtures/modules/hdmiinput.json +++ b/cypress/fixtures/modules/hdmiinput.json @@ -24,5 +24,104 @@ "EDIDVERSION_UNKNOWN_HDMI1": { "port": "HDMI1", "value": "unknown" - } + }, + "CONNECTED_TRUE": { + "port": "HDMI1", + "connected": true, + "signal": "stable", + "arcCapable": true, + "arcConnected": true, + "edidVersion": "2.0", + "autoLowLatencyModeCapable": true, + "autoLowLatencyModeSignalled": true + }, + "CONNECTED_FALSE": { + "port": "HDMI1", + "connected": false, + "signal": "stable", + "arcCapable": true, + "arcConnected": true, + "edidVersion": "2.0", + "autoLowLatencyModeCapable": true, + "autoLowLatencyModeSignalled": true + }, + "SIGNAL_UNKNOWN": { + "port": "HDMI1", + "connected": false, + "signal": "unknown", + "arcCapable": true, + "arcConnected": true, + "edidVersion": "2.0", + "autoLowLatencyModeCapable": true, + "autoLowLatencyModeSignalled": true + }, + "SIGNAL_NONE": { + "port": "HDMI1", + "connected": false, + "signal": "none", + "arcCapable": true, + "arcConnected": true, + "edidVersion": "2.0", + "autoLowLatencyModeCapable": true, + "autoLowLatencyModeSignalled": true + }, + "SIGNAL_STABLE": { + "port": "HDMI1", + "connected": false, + "signal": "stable", + "arcCapable": true, + "arcConnected": true, + "edidVersion": "2.0", + "autoLowLatencyModeCapable": true, + "autoLowLatencyModeSignalled": true + }, + "SIGNAL_UNSTABLE": { + "port": "HDMI1", + "connected": false, + "signal": "unstable", + "arcCapable": true, + "arcConnected": true, + "edidVersion": "2.0", + "autoLowLatencyModeCapable": true, + "autoLowLatencyModeSignalled": true + }, + "SIGNAL_UNSUPPORTED": { + "port": "HDMI1", + "connected": false, + "signal": "unsupported", + "arcCapable": true, + "arcConnected": true, + "edidVersion": "2.0", + "autoLowLatencyModeCapable": true, + "autoLowLatencyModeSignalled": true + }, + "AUTOLOWLATENCYMODESIGNALLED_TRUE": { + "port": "HDMI1", + "connected": false, + "signal": "unsupported", + "arcCapable": true, + "arcConnected": true, + "edidVersion": "2.0", + "autoLowLatencyModeCapable": true, + "autoLowLatencyModeSignalled": true + }, + "AUTOLOWLATENCYMODESIGNALLED_FALSE": { + "port": "HDMI1", + "connected": false, + "signal": "unsupported", + "arcCapable": true, + "arcConnected": true, + "edidVersion": "2.0", + "autoLowLatencyModeCapable": true, + "autoLowLatencyModeSignalled": false + }, + "HDMIINPUT_ONCONNECTIONCHANGED_TRUE" : {"port": "HDMI1","connected": true}, + "HDMIINPUT_ONCONNECTIONCHANGED_FALSE" : {"port": "HDMI1","connected": false}, + "HDMIINPUT_ONSIGNALCHANGED_UNKNOWN": {"port": "HDMI1","signal": "unknown"}, + "HDMIINPUT_ONSIGNALCHANGED_NONE" : {"port": "HDMI1","signal": "none"}, + "HDMIINPUT_ONSIGNALCHANGED_STABLE" : {"port": "HDMI1","signal": "stable"}, + "HDMIINPUT_ONSIGNALCHANGED_UNSTABLE": {"port": "HDMI1","signal": "unstable"}, + "HDMIINPUT_ONSIGNALCHANGED_UNSUPPORTED": {"port": "HDMI1","signal": "unsupported"}, + "HDMIINPUT_ONAUTOLOWLATENCYMODESIGNALCHANGED_TRUE" : {"port": "HDMI1","autoLowLatencyModeSignalled": true}, + "HDMIINPUT_ONAUTOLOWLATENCYMODESIGNALCHANGED_FALSE" : {"port": "HDMI1","autoLowLatencyModeSignalled": false} } \ No newline at end of file From 5789237edcad62a5f0b34207047e9a0f319d96c6 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Fri, 3 May 2024 17:21:03 +0530 Subject: [PATCH 014/359] modulereqID for thunderproxy testcases --- .../objects/moduleReqId/moduleReqId.json | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index c0147738..1c4ac9f5 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -2583,6 +2583,98 @@ } ] } + }, + "HdmiInput_Manage":{ + "HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - connected true": { + "req": [ + { + "method": { + "id": "HdmiInput 1.1", + "description": "Should not be null" + } + } + ] + }, + "HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - connected false": { + "req": [ + { + "method": { + "id": "HdmiInput 1.2", + "description": "Should not be null" + } + } + ] + }, + "HdmiInput.onSignalChanged - Positive Scenario: Validate Hdmi1 - signal unknown": { + "req": [ + { + "method": { + "id": "HdmiInput 1.3", + "description": "Should not be null" + } + } + ] + }, + "HdmiInput.onSignalChanged - Positive Scenario: Validate Hdmi1 - signal none": { + "req": [ + { + "method": { + "id": "HdmiInput 1.4", + "description": "Should not be null" + } + } + ] + }, + "HdmiInput.onSignalChanged - Positive Scenario: Validate Hdmi1 - signal stable": { + "req": [ + { + "method": { + "id": "HdmiInput 1.5", + "description": "Should not be null" + } + } + ] + }, + "HdmiInput.onSignalChanged - Positive Scenario: Validate Hdmi1 - signal unstable": { + "req": [ + { + "method": { + "id": "HdmiInput 1.6", + "description": "Should not be null" + } + } + ] + }, + "HdmiInput.onSignalChanged - Positive Scenario: Validate Hdmi1 - signal unsupported": { + "req": [ + { + "method": { + "id": "HdmiInput 1.7", + "description": "Should not be null" + } + } + ] + }, + "HdmiInput.onAutoLowLatencyModeSignalChanged - Positive Scenario: Validate Hdmi1 - autoLowLatencyModeSignalled true": { + "req": [ + { + "method": { + "id": "HdmiInput 1.8", + "description": "Should not be null" + } + } + ] + }, + "HdmiInput.onAutoLowLatencyModeSignalChanged - Positive Scenario: Validate Hdmi1 - autoLowLatencyModeSignalled false": { + "req": [ + { + "method": { + "id": "HdmiInput 1.8", + "description": "Should not be null" + } + } + ] + } } } } \ No newline at end of file From 7336b5459c09a9e3d6725ab4b3bb4107a62224e5 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Fri, 3 May 2024 17:38:52 +0530 Subject: [PATCH 015/359] Linting issue fix --- cypress/support/cypress-commands/lifecycle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 2b7fb6c1..5f488e0e 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -568,7 +568,7 @@ function validateVisibilityState(state) { // Fetching the visibilityState for the states from env. const visibilityState = Cypress.env(CONSTANTS.VISIBILITYSTATE); - if (visibilityState != null && visibilityState.hasOwnProperty(state)) { + if (visibilityState != null && visibilityState.hasOwnProperty(state)) { // Get validation requirements for the current scenario from the moduleReqId JSON const scenarioRequirement = UTILS.getEnvVariable(CONSTANTS.SCENARIO_REQUIREMENTS); From c9279d1e2f59dc6a53b2ac1ff6bf5e88551c8278 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Fri, 3 May 2024 18:15:01 +0530 Subject: [PATCH 016/359] 2068 - pending TCs --- .../Manage/HdmiInput.feature | 92 ++++-- cypress/fixtures/fireboltCalls/hdmiinput.json | 261 +++++++++++++++++- cypress/fixtures/modules/hdmiinput.json | 43 ++- .../objects/validationObjects/hdmiinput.json | 30 ++ 4 files changed, 394 insertions(+), 32 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature index 42f5119f..36a9e6e1 100644 --- a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature +++ b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature @@ -1,18 +1,18 @@ Feature: HdmiInput_Manage Background: Initialize 'HdmiInput' - Given the environment has been set up for 'Account' tests + Given the environment has been set up for 'hdmiInput' tests And 3rd party 'certification' app is launched @HdmiInput @manageSDK @sdk @transport Scenario: HDMIInput.ports - Positive Scenario: Validate HDMIInput ports - When 1st party app invokes the 'Firebolt' API to 'get hdmi input ports list' - Then 'Firebolt' platform responds to '1st party app' with 'expected hdmi input ports' + When 1st party app invokes the 'Firebolt' API to 'get hdmiinput ports list' + Then 'Firebolt' platform responds to '1st party app' with 'expected hdmiinput ports' @HdmiInput @manageSDK @sdk @transport Scenario Outline: HDMIInput.port - Positive Scenario: When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with 'expected hdmi input port' + Then 'Firebolt' platform responds to '1st party app' with 'expected hdmiinput port' Examples: | Scenario | Key | @@ -36,34 +36,34 @@ Feature: HdmiInput_Manage @HdmiInput @manageSDK @sdk @transport Scenario Outline: HDMIInput.ports - Positive Scenario: When 1st party app invokes the 'Firebolt' API to '' - When 1st party app invokes the 'Firebolt' API to 'get hdmi input ports list' + When 1st party app invokes the 'Firebolt' API to 'get hdmiinput ports list' Then 'Firebolt' platform responds to '1st party app' with '' Examples: | Scenario | Key | Validation_Key | - | Validate HDMIInput ports edidVersion 1.4 | set autoLowLatencyModeCapable with true | true for autoLowLatencyModeCapable ports | - | Validate HDMIInput ports edidVersion 2.0 | set autoLowLatencyModeCapable with false | false for autoLowLatencyModeCapable ports | - | Validate HDMIInput ports edidVersion unknown | set edidVersion to 1.4 | 1.4 for edidVersion ports | - | Validate HDMIInput ports autoLowLatencyModeCapable true | set edidVersion to 2.0 | 2.0 for edidVersion ports | - | Validate HDMIInput ports autoLowLatencyModeCapable false | set edidVersion to unknown | 2.0 for edidVersion ports | + | Validate HDMIInput ports autoLowLatencyModeCapable true | set autoLowLatencyModeCapable with true | true for autoLowLatencyModeCapable ports | + | Validate HDMIInput ports autoLowLatencyModeCapable false | set autoLowLatencyModeCapable with false | false for autoLowLatencyModeCapable ports | + | Validate HDMIInput ports edidVersion 1.4 | set edidVersion to 1.4 | 1.4 for edidVersion ports | + | Validate HDMIInput ports edidVersion 2.0 | set edidVersion to 2.0 | 2.0 for edidVersion ports | + | Validate HDMIInput ports edidVersion unknown | set edidVersion to unknown | 2.0 for edidVersion ports | - ## If edidVersion is 1.4, then autoLowLatencyModeCapable and autoLowLatencyModeSignalled must be false + # If edidVersion is 1.4, then autoLowLatencyModeCapable and autoLowLatencyModeSignalled must be false @HdmiInput @manageSDK @sdk @transport Scenario: HDMIInput.ports - Positive Scenario: Validate HDMIInput ports with edidVersion 1.4 When 1st party app invokes the 'Firebolt' API to 'set edidVersion to 1.4' - When 1st party app invokes the 'Firebolt' API to 'get hdmi input ports list' + When 1st party app invokes the 'Firebolt' API to 'get hdmiinput ports list' Then 'Firebolt' platform responds to '1st party app' with 'false for autoLowLatencyModeCapable ports' Then 'Firebolt' platform responds to '1st party app' with 'false for autoLowLatencyModeSignalled ports' @HdmiInput @manageSDK @sdk @transport Scenario: HDMIInput.open - Positive Scenario: Validate HDMIInput open When 1st party app invokes the 'Firebolt' API to 'open HDMI1 port' - Then 'Firebolt' platform responds to '1st party app' with 'null for hdmi input open' + Then 'Firebolt' platform responds to '1st party app' with 'null for hdmiinput open' @HdmiInput @manageSDK @sdk @transport Scenario: HDMIInput.close - Positive Scenario: Validate HDMIInput close When 1st party app invokes the 'Firebolt' API to 'close HDMI port' - Then 'Firebolt' platform responds to '1st party app' with 'null for hdmi input close' + Then 'Firebolt' platform responds to '1st party app' with 'null for hdmiinput close' @HdmiInput @manageSDK @sdk @transport Scenario Outline: HdmiInput. - Positive Scenario: @@ -74,14 +74,14 @@ Feature: HdmiInput_Manage And 'Firebolt' platform triggers to '1st party app' event '' Examples: - | Scenario | Key | Validation_Key | Event_Registration_Key | Get_API_Key | Event_Validation_Key | - | set AutoLowLatencyModeCapable-true | set autoLowLatencyModeCapable true with HDMI1 | true for autoLowLatencyModeCapable HDMI1 port | hdmiInput onAutoLowLatencyModeCapableChanged | get autoLowLatencyModeCapable | true for onAutoLowLatencyModeCapableChanged | - | set AutoLowLatencyModeCapable-false | set autoLowLatencyModeCapable false with HDMI1 | false for autoLowLatencyModeCapable HDMI1 port | hdmiInput onAutoLowLatencyModeCapableChanged | get autoLowLatencyModeCapable | false for onAutoLowLatencyModeCapableChanged | - | set EdidVersion-1.4 | set edidVersion to 1.4 | 1.4 for edidVersion HDMI1 port | hdmiInput onEdidVersionChanged | get edidVersion | 1.4 for onEdidVersionChanged | - | set EdidVersion-2.0 | set edidVersion to 2.0 | 2.0 for edidVersion HDMI1 port | hdmiInput onEdidVersionChanged | get edidVersion | 2.0 for onEdidVersionChanged | - | set EdidVersion-unknown | set edidVersion to unknown | 2.0 for edidVersion HDMI1 port | hdmiInput onEdidVersionChanged | get edidVersion | 2.0 for onEdidVersionChanged | - | set LowLatencyMode-true | set lowLatencyMode with true | true for lowLatencyMode | hdmiInput onLowLatencyModeChanged | get lowLatencyMode | true for onLowLatencyModeChanged | - | set LowLatencyMode-false | set lowLatencyMode with false | false for lowLatencyMode | hdmiInput onLowLatencyModeChanged | get lowLatencyMode | false for onLowLatencyModeChanged | + | Scenario | Key | Validation_Key | Event_Registration_Key | Get_API_Key | Event_Validation_Key | Method | + | set AutoLowLatencyModeCapable-true | set autoLowLatencyModeCapable true with HDMI1 | true for autoLowLatencyModeCapable HDMI1 port | hdmiInput onAutoLowLatencyModeCapableChanged | get autoLowLatencyModeCapable | true for onAutoLowLatencyModeCapableChanged | autoLowLatencyModeCapable | + | set AutoLowLatencyModeCapable-false | set autoLowLatencyModeCapable false with HDMI1 | false for autoLowLatencyModeCapable HDMI1 port | hdmiInput onAutoLowLatencyModeCapableChanged | get autoLowLatencyModeCapable | false for onAutoLowLatencyModeCapableChanged | autoLowLatencyModeCapable | + | set EdidVersion-1.4 | set edidVersion to 1.4 | 1.4 for edidVersion HDMI1 port | hdmiInput onEdidVersionChanged | get edidVersion | 1.4 for onEdidVersionChanged | edidVersion | + | set EdidVersion-2.0 | set edidVersion to 2.0 | 2.0 for edidVersion HDMI1 port | hdmiInput onEdidVersionChanged | get edidVersion | 2.0 for onEdidVersionChanged | edidVersion | + | set EdidVersion-unknown | set edidVersion to unknown | 2.0 for edidVersion HDMI1 port | hdmiInput onEdidVersionChanged | get edidVersion | 2.0 for onEdidVersionChanged | edidVersion | + | set LowLatencyMode-true | set lowLatencyMode with true | true for lowLatencyMode | hdmiInput onLowLatencyModeChanged | get lowLatencyMode | true for onLowLatencyModeChanged | lowLatencyMode | + | set LowLatencyMode-false | set lowLatencyMode with false | false for lowLatencyMode | hdmiInput onLowLatencyModeChanged | get lowLatencyMode | false for onLowLatencyModeChanged | lowLatencyMode | @HdmiInput @manageSDK @sdk @transport Scenario Outline: HDMIInput.port - Negative Scenario: @@ -97,10 +97,54 @@ Feature: HdmiInput_Manage @HdmiInput @manageSDK @sdk @transport Scenario Outline: HDMIInput.ports - Negative Scenario: When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput ports' + Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput edidVersion' Examples: | Scenario | Key | | Validate HDMIInput ports with integer edidVersion | set hdmiInput port with integer edidVersion | | Validate HDMIInput ports with boolean edidVersion | set hdmiInput port with boolean edidVersion | - | Validate HDMIInput ports with invalid string edidVersion | set hdmiInput port with invalid string edidVersion | \ No newline at end of file + | Validate HDMIInput ports with invalid string edidVersion | set hdmiInput port with invalid string edidVersion | + + @HdmiInput @manageSDK @sdk @transport + Scenario Outline: HDMIInput. - Negative Scenario: + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' + + Examples: + | Scenario | Key | Validation_Key | Method | + | set AutoLowLatencyModeCapable-integer | set autoLowLatencyModeCapable with integer | Invalid parameters for autoLowLatencyModeCapable | autoLowLatencyModeCapable | + | set AutoLowLatencyModeCapable-invalid string | set autoLowLatencyModeCapable with invalid string | Invalid parameters for autoLowLatencyModeCapable | autoLowLatencyModeCapable | + | set EdidVersion-integer | set EdidVersion with integer | Invalid parameters for EdidVersion | edidVersion | + | set EdidVersion-boolean | set EdidVersion with boolean | Invalid parameters for EdidVersion | edidVersion | + | set LowLatencyMode-integer | set LowLatencyMode with integer | Invalid parameters for LowLatencyMode | lowLatencyMode | + | set LowLatencyMode-string | set LowLatencyMode with string | Invalid parameters for LowLatencyMode | lowLatencyMode | + | set AutoLowLatencyModeCapable-without port | set autoLowLatencyModeCapable without port | Invalid parameters for autoLowLatencyModeCapable | autoLowLatencyModeCapable | + | set EdidVersion-without port | set EdidVersion without port | Invalid parameters for EdidVersion | edidVersion | + | set AutoLowLatencyModeCapable-empty param | set autoLowLatencyModeCapable with empty param | Invalid parameters for autoLowLatencyModeCapable | autoLowLatencyModeCapable | + | set EdidVersion-empty param | set EdidVersion with empty param | Invalid parameters for EdidVersion | edidVersion | + | set LowLatencyMode-empty param | set LowLatencyMode with empty param | Invalid parameters for LowLatencyMode | lowLatencyMode | + + @HdmiInput @manageSDK @sdk @transport + Scenario Outline: HDMIInput.open - Negative Scenario: + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput open' + + Examples: + | Scenario | Key | + | Validate HDMIInput open - empty param | set hdmiInput open with empty param | + | Validate HDMIInput open - integer port | set hdmiInput open with integer | + | Validate HDMIInput open - boolean port | set hdmiInput open with boolean | + + @HdmiInput @manageSDK @sdk @transport + Scenario: HDMIInput.ports - Negative Scenario: Validate HDMIInput ports with edidVersion 1.4 and autoLowLatencyModeCapable - true + When 1st party app invokes the 'Firebolt' API to 'set edidVersion to 1.4' + When 1st party app invokes the 'Firebolt' API to 'set autoLowLatencyModeCapable with true' + When 1st party app invokes the 'Firebolt' API to 'get hdmiinput ports list with error' + Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput ports' + + @HdmiInput @manageSDK @sdk @transport + Scenario: HDMIInput.port - Negative Scenario: Validate HDMIInput port with edidVersion 1.4 and autoLowLatencyModeCapable - true + When 1st party app invokes the 'Firebolt' API to 'set edidVersion to 1.4' + When 1st party app invokes the 'Firebolt' API to 'set autoLowLatencyModeCapable with true' + When 1st party app invokes the 'Firebolt' API to 'get hdmiinput port with error' + Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput port' \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/hdmiinput.json b/cypress/fixtures/fireboltCalls/hdmiinput.json index eaacdd60..e6dcbee1 100644 --- a/cypress/fixtures/fireboltCalls/hdmiinput.json +++ b/cypress/fixtures/fireboltCalls/hdmiinput.json @@ -1,21 +1,21 @@ { - "GET_HDMI_INPUT_PORTS_LIST":{ + "GET_HDMIINPUT_PORTS_LIST":{ "method": "manage_hdmiinput.ports" }, - "EXPECTED_HDMI_INPUT_PORTS":{ + "EXPECTED_HDMIINPUT_PORTS":{ "method": "hdmiinput.ports", "validationJsonPath": "result", "expected": "HDMIINPUT_PORTS" }, - "GET_HDMI_INPUT_PORT_WITH_PORTID_HDMI1":{ + "GET_HDMIINPUT_PORT_WITH_PORTID_HDMI1":{ "method": "manage_hdmiinput.port", "params": "HDMIINPUT_PORT_HDMI1" }, - "GET_HDMI_INPUT_PORT_WITH_PORTID_HDMI2":{ + "GET_HDMIINPUT_PORT_WITH_PORTID_HDMI2":{ "method": "manage_hdmiinput.port", "params": "HDMIINPUT_PORT_HDMI2" }, - "EXPECTED_HDMI_INPUT_PORT":{ + "EXPECTED_HDMIINPUT_PORT":{ "method": "hdmiinput.port", "validationJsonPath": "result", "expected": "HDMIINPUT_PORT" @@ -89,7 +89,7 @@ "method": "manage_hdmiinput.open", "params": "HDMIINPUT_PORT_HDMI1" }, - "NULL_FOR_HDMI_INPUT_OPEN":{ + "NULL_FOR_HDMIINPUT_OPEN":{ "method": "hdmiinput.open", "validationJsonPath": "result", "expected": "NULL" @@ -97,9 +97,256 @@ "CLOSE_HDMI_PORT":{ "method": "manage_hdmiinput.close" }, - "NULL_FOR_HDMI_INPUT_CLOSE":{ + "NULL_FOR_HDMIINPUT_CLOSE":{ "method": "hdmiinput.close", "validationJsonPath": "result", "expected": "NULL" + }, + "SET_AUTOLOWLATENCYMODECAPABLE_TRUE_WITH_HDMI1": { + "method": "manage_hdmiinput.setAutoLowLatencyModeCapable", + "params": "HDMIINPUT_AUTOLOWLATENCYMODECAPABLE_TRUE_HDMI1" + }, + "SET_AUTOLOWLATENCYMODECAPABLE_FALSE_WITH_HDMI1": { + "method": "manage_hdmiinput.setAutoLowLatencyModeCapable", + "params": "HDMIINPUT_AUTOLOWLATENCYMODECAPABLE_FALSE_HDMI1" + }, + "SET_LOWLATENCYMODE_WITH_TRUE": { + "method": "manage_hdmiinput.setLowLatencyMode", + "params": "HDMIINPUT_SETLOWLATENCYMODE_TRUE" + }, + "SET_LOWLATENCYMODE_WITH_FALSE": { + "method": "manage_hdmiinput.setLowLatencyMode", + "params": "HDMIINPUT_SETLOWLATENCYMODE_FALSE" + }, + "HDMIINPUT_ONAUTOLOWLATENCYMODECAPABLECHANGED": { + "method": "manage_hdmiinput.onAutoLowLatencyModeCapableChanged" + }, + "HDMIINPUT_ONEDIDVERSIONCHANGED": { + "method": "manage_hdmiinput.onEdidVersionChanged" + }, + "HDMIINPUT_ONLOWLATENCYMODECHANGED": { + "method": "manage_hdmiinput.onLowLatencyModeChanged" + }, + "GET_AUTOLOWLATENCYMODECAPABLE": { + "method": "manage_hdmiinput.autoLowLatencyModeCapable", + "params": "HDMIINPUT_PORTVALUE_HDMI1" + }, + "GET_EDIDVERSION": { + "method": "manage_hdmiinput.edidVersion", + "params": "HDMIINPUT_PORTVALUE_HDMI1" + }, + "GET_LOWLATENCYMODE": { + "method": "manage_hdmiinput.lowLatencyMode", + "params": "HDMIINPUT_PORTVALUE_HDMI1" + }, + "TRUE_FOR_AUTOLOWLATENCYMODECAPABLE_HDMI1_PORT":{ + "method": "hdmiinput.autoLowLatencyModeCapable", + "validationJsonPath": "result", + "expected": "TRUE" + }, + "FALSE_FOR_AUTOLOWLATENCYMODECAPABLE_HDMI1_PORT":{ + "method": "hdmiinput.autoLowLatencyModeCapable", + "validationJsonPath": "result", + "expected": "FALSE" + }, + "1.4_FOR_EDIDVERSION_HDMI1_PORT":{ + "method": "hdmiinput.edidVersion", + "validationJsonPath": "result", + "expected": "HDMIINPUT_EDIDVERSION_1_4" + }, + "2.0_FOR_EDIDVERSION_HDMI1_PORT":{ + "method": "hdmiinput.edidVersion", + "validationJsonPath": "result", + "expected": "HDMIINPUT_EDIDVERSION_2_0" + }, + "TRUE_FOR_LOWLATENCYMODE":{ + "method": "hdmiinput.lowLatencyMode", + "validationJsonPath": "result", + "expected": "TRUE" + }, + "FALSE_FOR_LOWLATENCYMODE":{ + "method": "hdmiinput.lowLatencyMode", + "validationJsonPath": "result", + "expected": "FALSE" + }, + "TRUE_FOR_ONAUTOLOWLATENCYMODECAPABLECHANGED":{ + "method": "hdmiinput.autoLowLatencyModeCapable", + "validationJsonPath": "result", + "expected": "TRUE" + }, + "FALSE_FOR_ONAUTOLOWLATENCYMODECAPABLECHANGED":{ + "method": "hdmiinput.autoLowLatencyModeCapable", + "validationJsonPath": "result", + "expected": "FALSE" + }, + "1.4_FOR_ONEDIDVERSIONCHANGED":{ + "method": "hdmiinput.edidVersion", + "validationJsonPath": "result", + "expected": "HDMIINPUT_EDIDVERSION_1_4" + }, + "2.0_FOR_ONEDIDVERSIONCHANGED":{ + "method": "hdmiinput.edidVersion", + "validationJsonPath": "result", + "expected": "HDMIINPUT_EDIDVERSION_2_0" + }, + "TRUE_FOR_ONLOWLATENCYMODECHANGED":{ + "method": "hdmiinput.lowLatencyMode", + "validationJsonPath": "result", + "expected": "TRUE" + }, + "FALSE_FOR_ONLOWLATENCYMODECHANGED":{ + "method": "hdmiinput.lowLatencyMode", + "validationJsonPath": "result", + "expected": "FALSE" + }, + "SET_HDMIINPUT_WITH_INTEGER":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_PORT_INTEGER", + "expected": "error" + }, + "SET_HDMIINPUT_WITH_BOOLEAN":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_PORT_BOOLEAN", + "expected": "error" + }, + "SET_HDMIINPUT_WITH_INVALID_STRING":{ + "method": "manage_hdmiinput.port", + "params": "HDMIINPUT_PORT_INVALID_STRING", + "expected": "error" + }, + "SET_HDMIINPUT_PORT_WITH_INTEGER_EDIDVERSION":{ + "method": "manage_hdmiinput.setEdidVersion", + "params": "HDMIINPUT_EDIDVERSION_INTEGER", + "expected": "error" + }, + "SET_HDMIINPUT_PORT_WITH_BOOLEAN_EDIDVERSION":{ + "method": "manage_hdmiinput.setEdidVersion", + "params": "HDMIINPUT_PORT_BOOLEAN", + "expected": "error" + }, + "SET_HDMIINPUT_PORT_WITH_INVALID_STRING_EDIDVERSION":{ + "method": "manage_hdmiinput.setEdidVersion", + "params": "HDMIINPUT_EDIDVERSION_INVALID_STRING", + "expected": "error" + }, + "INVALID_PARAMETERS_FOR_HDMIINPUT_PORT":{ + "method": "hdmiinput.port", + "validationJsonPath": "result", + "expected": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "INVALID_PARAMETERS_FOR_HDMIINPUT_EDIDVERSION":{ + "method": "hdmiinput.setEdidVersion", + "validationJsonPath": "result", + "expected": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "SET_AUTOLOWLATENCYMODECAPABLE_WITH_INTEGER": { + "method": "manage_hdmiinput.setAutoLowLatencyModeCapable", + "params": "HDMIINPUT_AUTOLOWLATENCYMODECAPABLE_INTEGER_HDMI1", + "expected": "error" + }, + "SET_AUTOLOWLATENCYMODECAPABLE_WITH_INVALID_STRING": { + "method": "manage_hdmiinput.setAutoLowLatencyModeCapable", + "params": "HDMIINPUT_AUTOLOWLATENCYMODECAPABLE_STRING_HDMI1", + "expected": "error" + }, + "SET_EDIDVERSION_WITH_INTEGER": { + "method": "manage_hdmiinput.setEdidVersion", + "params": "HDMIINPUT_EDIDVERSION_INTEGER", + "expected": "error" + }, + "SET_EDIDVERSION_WITH_BOOLEAN": { + "method": "manage_hdmiinput.setEdidVersion", + "params": "HDMIINPUT_EDIDVERSION_BOOLEAN", + "expected": "error" + }, + "SET_LOWLATENCYMODE_WITH_INTEGER": { + "method": "manage_hdmiinput.setLowLatencyMode", + "params": "INTEGER_123", + "expected": "error" + }, + "SET_LOWLATENCYMODE_WITH_STRING": { + "method": "manage_hdmiinput.setLowLatencyMode", + "params": "TEST", + "expected": "error" + }, + "SET_AUTOLOWLATENCYMODECAPABLE_WITHOUT_PORT": { + "method": "manage_hdmiinput.setAutoLowLatencyModeCapable", + "params": "HDMIINPUT_AUTOLOWLATENCYMODECAPABLE_TRUE_WITHOUT_PORT", + "expected": "error" + }, + "SET_EDIDVERSION_WITHOUT_PORT": { + "method": "manage_hdmiinput.setEdidVersion", + "params": "HDMIINPUT_EDIDVERSION_1_4_WITHOUT_PORT", + "expected": "error" + }, + "SET_AUTOLOWLATENCYMODECAPABLE_WITH_EMPTY_PARAM": { + "method": "manage_hdmiinput.setAutoLowLatencyModeCapable", + "params": "EMPTY_PARAM", + "expected": "error" + }, + "SET_EDIDVERSION_WITH_EMPTY_PARAM": { + "method": "manage_hdmiinput.setEdidVersion", + "params": "EMPTY_PARAM", + "expected": "error" + }, + "SET_LOWLATENCYMODE_WITH_EMPTY_PARAM": { + "method": "manage_hdmiinput.setLowLatencyMode", + "params": "EMPTY_PARAM", + "expected": "error" + }, + "INVALID_PARAMETERS_FOR_AUTOLOWLATENCYMODECAPABLE":{ + "method": "hdmiinput.setAutoLowLatencyModeCapable", + "validationJsonPath": "result", + "expected": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "INVALID_PARAMETERS_FOR_EDIDVERSION":{ + "method": "hdmiinput.setEdidVersion", + "validationJsonPath": "result", + "expected": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "INVALID_PARAMETERS_FOR_LOWLATENCYMODE":{ + "method": "hdmiinput.setLowLatencyMode", + "validationJsonPath": "result", + "expected": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "INVALID_PARAMETERS_FOR_HDMIINPUT_OPEN":{ + "method": "hdmiinput.open", + "validationJsonPath": "result", + "expected": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "SET_HDMIINPUT_OPEN_WITH_EMPTY_PARAM": { + "method": "manage_hdmiinput.open", + "params": "EMPTY_PARAM", + "expected": "error" + }, + "SET_HDMIINPUT_OPEN_WITH_INTEGER": { + "method": "manage_hdmiinput.open", + "params": "HDMIINPUT_PORT_INTEGER", + "expected": "error" + }, + "SET_HDMIINPUT_OPEN_WITH_BOOLEAN": { + "method": "manage_hdmiinput.open", + "params": "HDMIINPUT_PORT_BOOLEAN", + "expected": "error" + }, + "GET_HDMIINPUT_PORTS_LIST_WITH_ERROR":{ + "method": "manage_hdmiinput.ports", + "expected": "error" + }, + "INVALID_PARAMETERS_FOR_HDMIINPUT_PORTS":{ + "method": "hdmiinput.ports", + "validationJsonPath": "result", + "expected": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "GET_HDMIINPUT_PORT_WITH_ERROR":{ + "method": "manage_hdmiinput.port", + "expected": "error" } } \ No newline at end of file diff --git a/cypress/fixtures/modules/hdmiinput.json b/cypress/fixtures/modules/hdmiinput.json index d45c1414..b45870b7 100644 --- a/cypress/fixtures/modules/hdmiinput.json +++ b/cypress/fixtures/modules/hdmiinput.json @@ -24,5 +24,46 @@ "EDIDVERSION_UNKNOWN_HDMI1": { "port": "HDMI1", "value": "unknown" - } + }, + "AUTOLOWLATENCYMODECAPABLE_TRUE_HDMI1": { + "port": "HDMI1", + "value": true + }, + "AUTOLOWLATENCYMODECAPABLE_FALSE_HDMI1": { + "port": "HDMI1", + "value": false + }, + "PORTVALUE_HDMI1": { + "port": "HDMI1" + }, + "AUTOLOWLATENCYMODECAPABLE_INTEGER_HDMI1": { + "port": "HDMI1", + "enabled": 123 + }, + "AUTOLOWLATENCYMODECAPABLE_STRING_HDMI1": { + "port": "HDMI1", + "enabled": "test" + }, + "AUTOLOWLATENCYMODECAPABLE_TRUE_WITHOUT_PORT": { + "enabled": "true" + }, + "EDIDVERSION_INTEGER": { + "port": "HDMI1", + "edidVersion": 123 + }, + "EDIDVERSION_BOOLEAN": { + "port": "HDMI1", + "edidVersion": true + }, + "EDIDVERSION_1_4_WITHOUT_PORT": { + "edidVersion": "1.4" + }, + "PORT_INTEGER": { + "portId": 123 + }, + "PORT_BOOLEAN": { + "portId": true + }, + "EDIDVERSION_1_4": "1.4", + "EDIDVERSION_2_0": "2.0" } \ No newline at end of file diff --git a/cypress/fixtures/objects/validationObjects/hdmiinput.json b/cypress/fixtures/objects/validationObjects/hdmiinput.json index 62e82c65..90d769ab 100644 --- a/cypress/fixtures/objects/validationObjects/hdmiinput.json +++ b/cypress/fixtures/objects/validationObjects/hdmiinput.json @@ -26,5 +26,35 @@ ] } ] + }, + "HDMIINPUT_EDIDVERSION_1_4": { + "method": "hdmiinput.port", + "data": [ + { + "type": "fixture", + "validations": [ + { + "type": "HDMIINPUT_EDIDVERSION_1_4", + "mode": "staticContentValidation", + "description": "Validation of the HdmiInput port format" + } + ] + } + ] + }, + "HDMIINPUT_EDIDVERSION_2_0": { + "method": "hdmiinput.port", + "data": [ + { + "type": "fixture", + "validations": [ + { + "type": "HDMIINPUT_EDIDVERSION_2_0", + "mode": "staticContentValidation", + "description": "Validation of the HdmiInput port format" + } + ] + } + ] } } \ No newline at end of file From 6826a5a6d8821b85820976cb4dba78690f6ee673 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Mon, 6 May 2024 16:18:36 +0530 Subject: [PATCH 017/359] FIRECERT-2025-fcs side schema changes --- cypress/support/appObjectConfigs.js | 2 +- .../support/step_definitions/fireboltCalls.js | 12 +++++++-- .../support/step_definitions/validations.js | 26 ++++++++++++++----- .../support/validations/schemaValidation.js | 2 +- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/cypress/support/appObjectConfigs.js b/cypress/support/appObjectConfigs.js index 82b676cf..ae6fd3aa 100644 --- a/cypress/support/appObjectConfigs.js +++ b/cypress/support/appObjectConfigs.js @@ -24,7 +24,7 @@ class apiObject { this.params = params; this.context = context; this.expected = expected; - response.apiResponse ? (this.response = response.apiResponse) : (this.response = response); + this.response = response; this.apiSchemaResult = { validationStatus: response.schemaValidationStatus, validationResponse: response.schemaValidationResponse, diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index b46c7eb4..96cf8cf5 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -171,7 +171,8 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { cy.updateResponseForFCS(method, params, result, Cypress.env(CONSTANTS.SDK_VERSION)).then( (updatedResponse) => { // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(result.report.apiResponse); + let responseType = result.error !== null ? 'error' : 'result'; + const dataToBeCensored = _.cloneDeep(result[responseType]); // Call the 'censorData' command to hide sensitive data cy.censorData(method, dataToBeCensored).then((maskedResult) => { @@ -262,7 +263,14 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI assert(false, CONSTANTS.NO_MATCHED_RESPONSE); } result = JSON.parse(result); - cy.log(`Response from ${appId}: ${JSON.stringify(result.report.eventListenerResponse)}`); + cy.log(`Response from ${appId}: ${JSON.stringify(result.result)}`); + if (result?.result?.hasOwnProperty('listening')) { + let eventResponse = { + eventListenerId: result.result.event + '-' + response.id, + eventListenerResponse: result.result, + }; + result.result = eventResponse; + } cy.updateResponseForFCS(event, params, result, Cypress.env(CONSTANTS.SDK_VERSION)).then( (updatedResponse) => { // If event and params are not supported setting isScenarioExempted as true for further validation. diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 3a0595e6..6c0f2f51 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -109,6 +109,9 @@ Given( }; cy.sendMessagetoPlatforms(requestMap).then((result) => { + if (result?.result?.hasOwnProperty('eventResponse')) { + result.result = result.result.eventResponse; + } cy.updateResponseForFCS( methodOrEvent, null, @@ -136,14 +139,23 @@ Given( cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then( (response) => { response = JSON.parse(response); - response = response.report; - cy.saveEventResponse( + if (response?.result?.hasOwnProperty('eventResponse')) { + response.result = response.result.eventResponse; + } + cy.updateResponseForFCS( + methodOrEvent, + null, response, - methodOrEventObject, - eventName, - expected, - eventExpected === 'triggers' ? true : false - ); + Cypress.env(CONSTANTS.SDK_VERSION) + ).then((updatedResponse) => { + cy.saveEventResponse( + updatedResponse, + methodOrEventObject, + eventName, + expected, + eventExpected === 'triggers' ? true : false + ); + }); } ); } diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 2bb0b9e6..8c73d8e1 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -128,7 +128,7 @@ Cypress.Commands.add('updateResponseForFCS', (methodOrEvent, params, response, s formattedResponse[CONSTANTS.SCHEMA_VALIDATION_RESPONSE] = schemaValidation; } - formattedResponse.apiResponse = result; + formattedResponse.response = result; } return formattedResponse; From 187e028f37f5ba543214d28e1f7e59d8402b4d88 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Mon, 6 May 2024 16:22:53 +0530 Subject: [PATCH 018/359] FIRECERT-2025-lint fix --- cypress/support/step_definitions/fireboltCalls.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 96cf8cf5..02fe440d 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -171,7 +171,7 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { cy.updateResponseForFCS(method, params, result, Cypress.env(CONSTANTS.SDK_VERSION)).then( (updatedResponse) => { // Create a deep copy to avoid reference mutation - let responseType = result.error !== null ? 'error' : 'result'; + const responseType = result.error !== null ? 'error' : 'result'; const dataToBeCensored = _.cloneDeep(result[responseType]); // Call the 'censorData' command to hide sensitive data @@ -265,7 +265,7 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI result = JSON.parse(result); cy.log(`Response from ${appId}: ${JSON.stringify(result.result)}`); if (result?.result?.hasOwnProperty('listening')) { - let eventResponse = { + const eventResponse = { eventListenerId: result.result.event + '-' + response.id, eventListenerResponse: result.result, }; From 435d928b1ea149147f422c117036609657cf5081 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Tue, 7 May 2024 19:40:00 +0530 Subject: [PATCH 019/359] 2068 -add setter validation --- .../Manage/HdmiInput.feature | 5 + cypress/fixtures/fireboltCalls/hdmiinput.json | 24 ++--- cypress/fixtures/modules/hdmiinput.json | 8 +- .../objects/moduleReqId/moduleReqId.json | 92 ------------------- .../support/validations/regExValidation.js | 8 +- 5 files changed, 31 insertions(+), 106 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature index 36a9e6e1..641de33d 100644 --- a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature +++ b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature @@ -22,6 +22,7 @@ Feature: HdmiInput_Manage @HdmiInput @manageSDK @sdk @transport Scenario Outline: HDMIInput.port - Positive Scenario: When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' When 1st party app invokes the 'Firebolt' API to 'get hdmiinput port with portId HDMI1' Then 'Firebolt' platform responds to '1st party app' with '' @@ -36,6 +37,7 @@ Feature: HdmiInput_Manage @HdmiInput @manageSDK @sdk @transport Scenario Outline: HDMIInput.ports - Positive Scenario: When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' When 1st party app invokes the 'Firebolt' API to 'get hdmiinput ports list' Then 'Firebolt' platform responds to '1st party app' with '' @@ -51,6 +53,7 @@ Feature: HdmiInput_Manage @HdmiInput @manageSDK @sdk @transport Scenario: HDMIInput.ports - Positive Scenario: Validate HDMIInput ports with edidVersion 1.4 When 1st party app invokes the 'Firebolt' API to 'set edidVersion to 1.4' + Then 'Firebolt' platform responds to '1st party app' for 'set edidVersion to 1.4' When 1st party app invokes the 'Firebolt' API to 'get hdmiinput ports list' Then 'Firebolt' platform responds to '1st party app' with 'false for autoLowLatencyModeCapable ports' Then 'Firebolt' platform responds to '1st party app' with 'false for autoLowLatencyModeSignalled ports' @@ -138,6 +141,7 @@ Feature: HdmiInput_Manage @HdmiInput @manageSDK @sdk @transport Scenario: HDMIInput.ports - Negative Scenario: Validate HDMIInput ports with edidVersion 1.4 and autoLowLatencyModeCapable - true When 1st party app invokes the 'Firebolt' API to 'set edidVersion to 1.4' + Then 'Firebolt' platform responds to '1st party app' for 'set edidVersion to 1.4' When 1st party app invokes the 'Firebolt' API to 'set autoLowLatencyModeCapable with true' When 1st party app invokes the 'Firebolt' API to 'get hdmiinput ports list with error' Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput ports' @@ -145,6 +149,7 @@ Feature: HdmiInput_Manage @HdmiInput @manageSDK @sdk @transport Scenario: HDMIInput.port - Negative Scenario: Validate HDMIInput port with edidVersion 1.4 and autoLowLatencyModeCapable - true When 1st party app invokes the 'Firebolt' API to 'set edidVersion to 1.4' + Then 'Firebolt' platform responds to '1st party app' for 'set edidVersion to 1.4' When 1st party app invokes the 'Firebolt' API to 'set autoLowLatencyModeCapable with true' When 1st party app invokes the 'Firebolt' API to 'get hdmiinput port with error' Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput port' \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/hdmiinput.json b/cypress/fixtures/fireboltCalls/hdmiinput.json index 2e7baeba..8f47a43e 100644 --- a/cypress/fixtures/fireboltCalls/hdmiinput.json +++ b/cypress/fixtures/fireboltCalls/hdmiinput.json @@ -170,33 +170,33 @@ "expected": "FALSE" }, "TRUE_FOR_ONAUTOLOWLATENCYMODECAPABLECHANGED":{ - "method": "hdmiinput.autoLowLatencyModeCapable", - "validationJsonPath": "result", + "event": "hdmiinput.onAutoLowLatencyModeCapableChanged", + "validationJsonPath": "eventResponse", "expected": "TRUE" }, "FALSE_FOR_ONAUTOLOWLATENCYMODECAPABLECHANGED":{ - "method": "hdmiinput.autoLowLatencyModeCapable", - "validationJsonPath": "result", + "event": "hdmiinput.onAutoLowLatencyModeCapableChanged", + "validationJsonPath": "eventResponse", "expected": "FALSE" }, "1.4_FOR_ONEDIDVERSIONCHANGED":{ - "method": "hdmiinput.edidVersion", - "validationJsonPath": "result", + "event": "hdmiinput.onEdidVersionChanged", + "validationJsonPath": "eventResponse", "expected": "HDMIINPUT_EDIDVERSION_1_4" }, "2.0_FOR_ONEDIDVERSIONCHANGED":{ - "method": "hdmiinput.edidVersion", - "validationJsonPath": "result", + "event": "hdmiinput.onEdidVersionChanged", + "validationJsonPath": "eventResponse", "expected": "HDMIINPUT_EDIDVERSION_2_0" }, "TRUE_FOR_ONLOWLATENCYMODECHANGED":{ - "method": "hdmiinput.lowLatencyMode", - "validationJsonPath": "result", + "event": "hdmiinput.onLowLatencyModeChanged", + "validationJsonPath": "eventResponse", "expected": "TRUE" }, "FALSE_FOR_ONLOWLATENCYMODECHANGED":{ - "method": "hdmiinput.lowLatencyMode", - "validationJsonPath": "result", + "event": "hdmiinput.onLowLatencyModeChanged", + "validationJsonPath": "eventResponse", "expected": "FALSE" }, "SET_HDMIINPUT_WITH_INTEGER":{ diff --git a/cypress/fixtures/modules/hdmiinput.json b/cypress/fixtures/modules/hdmiinput.json index aafd03d5..5c05fc38 100644 --- a/cypress/fixtures/modules/hdmiinput.json +++ b/cypress/fixtures/modules/hdmiinput.json @@ -164,5 +164,11 @@ "HDMIINPUT_ONSIGNALCHANGED_UNSTABLE": {"port": "HDMI1","signal": "unstable"}, "HDMIINPUT_ONSIGNALCHANGED_UNSUPPORTED": {"port": "HDMI1","signal": "unsupported"}, "HDMIINPUT_ONAUTOLOWLATENCYMODESIGNALCHANGED_TRUE" : {"port": "HDMI1","autoLowLatencyModeSignalled": true}, - "HDMIINPUT_ONAUTOLOWLATENCYMODESIGNALCHANGED_FALSE" : {"port": "HDMI1","autoLowLatencyModeSignalled": false} + "HDMIINPUT_ONAUTOLOWLATENCYMODESIGNALCHANGED_FALSE" : {"port": "HDMI1","autoLowLatencyModeSignalled": false}, + "SETLOWLATENCYMODE_TRUE": { + "value": true + }, + "SETLOWLATENCYMODE_FALSE": { + "value": false + } } \ No newline at end of file diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 1c4ac9f5..c0147738 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -2583,98 +2583,6 @@ } ] } - }, - "HdmiInput_Manage":{ - "HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - connected true": { - "req": [ - { - "method": { - "id": "HdmiInput 1.1", - "description": "Should not be null" - } - } - ] - }, - "HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - connected false": { - "req": [ - { - "method": { - "id": "HdmiInput 1.2", - "description": "Should not be null" - } - } - ] - }, - "HdmiInput.onSignalChanged - Positive Scenario: Validate Hdmi1 - signal unknown": { - "req": [ - { - "method": { - "id": "HdmiInput 1.3", - "description": "Should not be null" - } - } - ] - }, - "HdmiInput.onSignalChanged - Positive Scenario: Validate Hdmi1 - signal none": { - "req": [ - { - "method": { - "id": "HdmiInput 1.4", - "description": "Should not be null" - } - } - ] - }, - "HdmiInput.onSignalChanged - Positive Scenario: Validate Hdmi1 - signal stable": { - "req": [ - { - "method": { - "id": "HdmiInput 1.5", - "description": "Should not be null" - } - } - ] - }, - "HdmiInput.onSignalChanged - Positive Scenario: Validate Hdmi1 - signal unstable": { - "req": [ - { - "method": { - "id": "HdmiInput 1.6", - "description": "Should not be null" - } - } - ] - }, - "HdmiInput.onSignalChanged - Positive Scenario: Validate Hdmi1 - signal unsupported": { - "req": [ - { - "method": { - "id": "HdmiInput 1.7", - "description": "Should not be null" - } - } - ] - }, - "HdmiInput.onAutoLowLatencyModeSignalChanged - Positive Scenario: Validate Hdmi1 - autoLowLatencyModeSignalled true": { - "req": [ - { - "method": { - "id": "HdmiInput 1.8", - "description": "Should not be null" - } - } - ] - }, - "HdmiInput.onAutoLowLatencyModeSignalChanged - Positive Scenario: Validate Hdmi1 - autoLowLatencyModeSignalled false": { - "req": [ - { - "method": { - "id": "HdmiInput 1.8", - "description": "Should not be null" - } - } - ] - } } } } \ No newline at end of file diff --git a/cypress/support/validations/regExValidation.js b/cypress/support/validations/regExValidation.js index 759246a7..0e9cd3ea 100644 --- a/cypress/support/validations/regExValidation.js +++ b/cypress/support/validations/regExValidation.js @@ -47,10 +47,16 @@ class regExValidations { const validationResult = extractedResponse ? expression.test(extractedResponse) : expression.test(response); + const stringifiedExtractedResponse = + typeof extractedResponse === 'object' + ? JSON.stringify(extractedResponse) + : extractedResponse; + const stringifiedResponse = + typeof response === 'object' ? JSON.stringify(response) : response; cy.log( `RegEx Validation : Expected ${method} response ${ - extractedResponse ? extractedResponse : response + stringifiedExtractedResponse ? stringifiedExtractedResponse : stringifiedResponse } to be in ${expression} regex format`, 'regexResultValidator' ).then(() => { From fd4bf704ccafe2bc0f44a4eeb20944ab9f42f3c8 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Tue, 7 May 2024 20:04:17 +0530 Subject: [PATCH 020/359] minor changes --- .../FireboltCertification/Manage/HdmiInput.feature | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature index 641de33d..e461e04d 100644 --- a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature +++ b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature @@ -71,8 +71,8 @@ Feature: HdmiInput_Manage @HdmiInput @manageSDK @sdk @transport Scenario Outline: HdmiInput. - Positive Scenario: When 1st party app registers for the '' event using the 'Firebolt' API - When 1st party app invokes the 'Firebolt' API to '' - When 1st party app invokes the 'Firebolt' API to '' + And 1st party app invokes the 'Firebolt' API to '' + And 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' with '' And 'Firebolt' platform triggers to '1st party app' event '' @@ -141,15 +141,13 @@ Feature: HdmiInput_Manage @HdmiInput @manageSDK @sdk @transport Scenario: HDMIInput.ports - Negative Scenario: Validate HDMIInput ports with edidVersion 1.4 and autoLowLatencyModeCapable - true When 1st party app invokes the 'Firebolt' API to 'set edidVersion to 1.4' - Then 'Firebolt' platform responds to '1st party app' for 'set edidVersion to 1.4' - When 1st party app invokes the 'Firebolt' API to 'set autoLowLatencyModeCapable with true' - When 1st party app invokes the 'Firebolt' API to 'get hdmiinput ports list with error' + And 1st party app invokes the 'Firebolt' API to 'set autoLowLatencyModeCapable with true' + And 1st party app invokes the 'Firebolt' API to 'get hdmiinput ports list with error' Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput ports' @HdmiInput @manageSDK @sdk @transport Scenario: HDMIInput.port - Negative Scenario: Validate HDMIInput port with edidVersion 1.4 and autoLowLatencyModeCapable - true When 1st party app invokes the 'Firebolt' API to 'set edidVersion to 1.4' - Then 'Firebolt' platform responds to '1st party app' for 'set edidVersion to 1.4' - When 1st party app invokes the 'Firebolt' API to 'set autoLowLatencyModeCapable with true' - When 1st party app invokes the 'Firebolt' API to 'get hdmiinput port with error' + And 1st party app invokes the 'Firebolt' API to 'set autoLowLatencyModeCapable with true' + And 1st party app invokes the 'Firebolt' API to 'get hdmiinput port with error' Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput port' \ No newline at end of file From 6a18926830a0c72464200dcf2272190ce547da1d Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 8 May 2024 17:42:30 +0530 Subject: [PATCH 021/359] FIRECERT-2025-lifecycle schema migration --- cypress/support/constants/constants.js | 5 ++ cypress/support/cypress-commands/lifecycle.js | 28 ++++++---- .../support/validations/schemaValidation.js | 56 +++++++++++++++++++ 3 files changed, 77 insertions(+), 12 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 59d286b0..fb5b0036 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -199,6 +199,11 @@ module.exports = { LIFECYCLE_HISTORY_RESPONSE: 'Lifecycle history response fetched from application: ', LIFECYCLE_HISTORY_SCHEMA_PATH: 'schemas/lifecycleHistorySchema', LIFECYCLE_INTENT: 'Lifecycle intent sent to application: ', + LIFECYCLE_METHOD_LIST: [ + 'Lifecycle.ready', + 'Lifecycle.state', + 'Lifecycle.close' + ], LIFECYCLE_NOTIFICATION_GENERATED: 'Lifecycle notification generated Req #', LIFECYCLE_NOTIFICATION_NOT_GENERATED: 'Lifecycle notification not generated Req #', LIFECYCLE_STATE: 'Lifecycle.state', diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 308b6313..3a09af44 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -86,7 +86,7 @@ Cypress.Commands.add('validateLifecycleState', (state, appId) => { // Send message to 3rd party app to invoke lifecycle API to get state response cy.invokeLifecycleApi(appId, CONSTANTS.LIFECYCLE_STATE, '{}').then((response) => { try { - const result = JSON.parse(response)?.report?.result ?? null; + const result = JSON.parse(response)?.result ?? null; if (result == null) { cy.log(CONSTANTS.INVALID_LIFECYCLE_STATE_RESPONSE).then(() => { assert(false, CONSTANTS.INVALID_LIFECYCLE_STATE_RESPONSE); @@ -97,13 +97,13 @@ Cypress.Commands.add('validateLifecycleState', (state, appId) => { let pretext = CONSTANTS.STATE_SCHEMA_VALIDATION_REQ + lifecycleStateRequirementId.state.id; UTILS.assertWithRequirementLogs( pretext, - JSON.parse(response).report.schemaResult.status, + JSON.parse(response).schemaResult.status, CONSTANTS.PASS ); pretext = CONSTANTS.STATE_CONTENT_VALIDATION_REQ + lifecycleStateRequirementId.state.id; UTILS.assertWithRequirementLogs( pretext, - JSON.parse(response).report.result, + JSON.parse(response).result, appObject.getAppObjectState().state ); } catch (error) { @@ -166,15 +166,15 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId) => { // Perform a null check on history response and check if response has nested properties result, _history, _value response = JSON.parse(response ?? '{}'); if ( - response.report && - response.report.result && - response.report.result._history && - response.report.result._history._value + response && + response.result && + response.result._history && + response.result._history._value ) { const pretext = CONSTANTS.HISTORY_VALIDATION_REQ + lifecycleHistoryRequirementId.history.id; cy.log(CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + JSON.stringify(response)); // Extract app history value - const appHistory = response.report.result._history._value; + const appHistory = response.result._history._value; // Lifecycle history validation if (appHistory.length > 0) { // Construct an appHistoryList from app history data @@ -299,7 +299,7 @@ Cypress.Commands.add('invokeLifecycleApi', (appId, method, methodParams = null) cy.log(CONSTANTS.LIFECYCLE_INTENT + JSON.stringify(publishMessage)); cy.sendMessagetoApp(requestTopic, responseTopic, publishMessage).then((response) => { try { - errorObject = JSON.parse(response).report.error; + errorObject = JSON.parse(response).error; } catch (error) { cy.log(CONSTANTS.FAILED_TO_PARSE_LIEFECYCLE_ERROR + response).then(() => { assert(false, CONSTANTS.FAILED_TO_PARSE_LIEFECYCLE_ERROR + response); @@ -316,7 +316,11 @@ Cypress.Commands.add('invokeLifecycleApi', (appId, method, methodParams = null) ); return false; } - return response; + if (CONSTANTS.LIFECYCLE_METHOD_LIST.includes(method)) { + cy.updateLifecycleResponse(response, method).then((updatedResponse) => { + return updatedResponse; + }); + } }); }); @@ -479,7 +483,7 @@ Cypress.Commands.add('fetchLifecycleHistory', (appId) => { try { cy.invokeLifecycleApi(appId, CONSTANTS.LIFECYCLE_APIS.HISTORY, '{}').then((response) => { cy.log(CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + response); - const historyValue = _.get(JSON.parse(response), 'report.result._history._value', null); + const historyValue = _.get(JSON.parse(response), 'result._history._value', null); _.isEmpty(historyValue) ? console.log(CONSTANTS.APP_HISTORY_EMPTY) : Cypress.env(CONSTANTS.APP_LIFECYCLE_HISTORY, historyValue); @@ -547,7 +551,7 @@ Cypress.Commands.add('setAppObjectStateFromMethod', (method, appId) => { * cy.lifecycleSchemaChecks({"result":null,"error":null,"schemaResult":{"status":"PASS","schemaValidationResult":{"instance":null,"schema":{"const":null}}, 'foreground'); */ Cypress.Commands.add('lifecycleSchemaChecks', (response, state) => { - result = JSON.parse(response).report.schemaResult; + result = JSON.parse(response).schemaResult; apiSchemaResult = { validationStatus: result.status, validationResponse: result.schemaValidationResult, diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 8c73d8e1..54654fdf 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -241,3 +241,59 @@ function removeSetInMethodName(apiName) { } return apiName.split('.')[0] + '.' + updatedMethod; } + +/** + * @module schemaValidation + * @function validateLifecycleSchema + * @description validate lifecycle response against corresponding schema and return schema validation result + * @param {string} response - lifecycle response + * @param {string} methodSchema - schema against which validation needs to be performed + * @example + * validateLifecycleSchema(response, methodSchema) + */ +Cypress.Commands.add('validateLifecycleSchema', (response, methodSchema) => { + let validationResult; + const schemaMapResult = validator.validate(response, methodSchema); + if (schemaMapResult.errors.length > 0 || response === undefined) { + validationResult = { + status: CONSTANTS.FAIL, + schemaValidationResult: schemaMapResult, + }; + } else { + validationResult = { + status: CONSTANTS.PASS, + schemaValidationResult: schemaMapResult, + }; + } + return validationResult; +}); + +/** + * @module schemaValidation + * @function validateLifecycleSchema + * @description update raw lifecycle response from 3rd party app with schema validation fields + * @param {string} response - lifecycle response + * @param {string} method - method name + * @example + * updateLifecycleResponse(response, method) + */ +Cypress.Commands.add('updateLifecycleResponse', (response, method) => { + let schemaResult, error; + const responseType = response.hasOwnProperty(CONSTANTS.ERROR) + ? CONSTANTS.ERROR + : CONSTANTS.RESULT; + try { + const stateSchema = cy.getSchema( + method, + '', + Cypress.env(CONSTANTS.SDK_VERSION), + responseType + ); + schemaResult = cy.validateLifecycleSchema(response, stateSchema); + response.schemaResult = schemaResult; + } catch (err) { + error = err; + response.error = error; + } + return response; +}); From e76fdc455094ba7e50233dd996aa1b39bd6f006c Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Wed, 8 May 2024 18:25:36 +0530 Subject: [PATCH 022/359] FIRECERT-2075-New Improve lifecycle event validation reliability --- Scripts/lifeCycleAppObject.js | 4 ---- .../LifecycleTestcases/LifecycleForeground.feature | 8 ++++---- .../LifecycleTestcases/LifecycleTerminated.feature | 2 +- cypress/support/constants/constants.js | 2 +- cypress/support/cypress-commands/lifecycle.js | 13 +++++++------ cypress/support/step_definitions/validations.js | 8 ++++---- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Scripts/lifeCycleAppObject.js b/Scripts/lifeCycleAppObject.js index 889708e0..4507090c 100644 --- a/Scripts/lifeCycleAppObject.js +++ b/Scripts/lifeCycleAppObject.js @@ -67,7 +67,6 @@ class appConfig { setAppObjectState(newState) { const currentState = this.state; this.state = new stateConfig(newState); - Cypress.env(CONSTANTS.IS_SAME_APP_TRANSITION, false); // lifecycleAppObjectConfigData contains the look up table describing a list of possible states that the appObject can transition to from the current state cy.fixture(CONSTANTS.STATE_TRANSITION_AND_VALIDATION_CONFIG_LOCATION).then( @@ -98,9 +97,6 @@ class appConfig { this.history.push(this.state); logger.info('New appState pushed to history: ' + newState); } - if (currentState.state == newState) { - Cypress.env(CONSTANTS.IS_SAME_APP_TRANSITION, true); - } if (!stateTransition.includes(newState)) { cy.log('Requested state transition for application is not supported'); this.state = currentState; diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleForeground.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleForeground.feature index be6f4a9f..51a0bc65 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleForeground.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleForeground.feature @@ -7,14 +7,14 @@ Feature: Lifecycle_Foreground Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'initializing' state When '3rd party app' transitions to state 'foreground' - Then '3rd party app' is in 'foreground' state + Then '3rd party app' will be in 'foreground' state @Lifecycle @coreSDK Scenario: Lifecycle 2.2.1 Relaunch foreground app Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'foreground' state And 3rd party 'certification' app is launched - Then '3rd party app' is in 'foreground' state + Then '3rd party app' will stay in 'foreground' state @needsfurtherinformation @Lifecycle @coreSDK @lifecycleManagement @notSupported @@ -24,6 +24,6 @@ Feature: Lifecycle_Foreground When '3rd party app' invokes the 'Firebolt' API to 'get home intent' # And 1st party app invokes the API to 'get lifecycle management state' # Launched app may not establish Linchpin connection. State validation possible through LifecycleManagement APIs. # Then 'Firebolt' platform responds with 'message for lifecycleManagement state' # LifecycleManagement APIs not implemented. Expected response TBD - # Then '3rd party app' is in 'foreground' state #TO BE REPLACED BY ABOVE LINE + # Then '3rd party app' will be in 'foreground' state #TO BE REPLACED BY ABOVE LINE And AppObject state for '3rd party App' is set to 'background' - Then '3rd party app' is in 'background' state \ No newline at end of file + Then '3rd party app' will be in 'background' state \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature index f3b0cd52..19fbf527 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature @@ -5,7 +5,7 @@ Feature: Lifecycle_Terminated Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with '' state Then '3rd party app' invokes the 'Firebolt' API to 'call lifecycle terminate' - Then '3rd party app' is in 'terminated' state + Then '3rd party app' transitions to state 'terminated' Examples: | state | diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index c4153904..ccc3c268 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -40,6 +40,7 @@ module.exports = { ARRAY: 'array', ASYNCHRONOUS: 'asynchronous', BASE64: 'base64', + BE: 'be', BEFORE_OPERATION: 'beforeOperation', BEFORE_OPERATION_TAGS: 'beforeOperationTags', BOOLEAN: 'boolean', @@ -166,7 +167,6 @@ module.exports = { INVALID_RESPONSE: 'Invalid response', INVALID_HISTORY_RESPONSE: 'App history response does not contain expected fields', IS_NOT_SUPPORTED_API: 'isNotSupportedApi', - IS_SAME_APP_TRANSITION: 'isSameAppTransition', IS_SCENARIO_EXEMPTED: 'isScenarioExempted', JOBID: 'jobId', JSON_FILE_EXTENSION: '_CoreSuiteReport.json', diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 041ee377..e7ea14dc 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -153,7 +153,7 @@ Cypress.Commands.add('setLifecycleState', (state, appId) => { * @example * cy.validateLifecycleHistoryAndEvents('foreground', 'foo') */ -Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId) => { +Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, condition) => { // Extract appObject based on appId const appObject = UTILS.getEnvVariable(appId); // Get validation requirements for the current scenario from the moduleReqId JSON @@ -200,15 +200,16 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId) => { ); // Lifecycle event validation - if (lifecycleEventRequirementId && lifecycleEventRequirementId.event) { + if ( + condition == CONSTANTS.BE && + lifecycleEventRequirementId && + lifecycleEventRequirementId.event + ) { const appHistoryPrevious = UTILS.getEnvVariable(CONSTANTS.APP_LIFECYCLE_HISTORY); const appHistoryCount = appHistory.length - appHistoryPrevious.length; let pretext; // If no lifecycle events expected, validate app history value is also empty - if ( - UTILS.getEnvVariable(CONSTANTS.IS_SAME_APP_TRANSITION, false) || - state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING - ) { + if (state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { UTILS.assertWithRequirementLogs( CONSTANTS.LIFECYCLE_NOTIFICATION_GENERATED + lifecycleEventRequirementId?.event?.id[0], appHistoryCount >= 1, diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 081de441..378dbae3 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -315,9 +315,10 @@ Given( * @param {String} app - App type * @param {String} state - Expected state to be used for validation * @example - * Then '3rd party app' is in 'foreground' state + * Then '3rd party app' will stay in 'foreground' state + * Then '3rd party app' will be in 'background' state */ -Then('{string} is in {string} state', (app, state) => { +Then(/'(.+)' will (be|stay) in '(.+)' state/, (app, condition, state) => { const appId = app === CONSTANTS.THIRD_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) @@ -325,9 +326,8 @@ Then('{string} is in {string} state', (app, state) => { ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) : app; const appObject = UTILS.getEnvVariable(appId); - cy.validateLifecycleState(appObject.getAppObjectState().state, appId); - cy.validateLifecycleHistoryAndEvents(appObject.getAppObjectState().state, appId); + cy.validateLifecycleHistoryAndEvents(appObject.getAppObjectState().state, appId, condition); }); /** From c6dc99a3bd8b454ba46b5c94de4422f641037a1b Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 9 May 2024 16:01:27 +0530 Subject: [PATCH 023/359] FIRECERT-2025-coverity fix --- cypress/support/constants/constants.js | 1 + cypress/support/step_definitions/fireboltCalls.js | 4 ++-- cypress/support/step_definitions/validations.js | 12 ++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 1b53cc44..5adb1eef 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -220,6 +220,7 @@ module.exports = { LIFECYCLE_VALIDATION_METHOD: 'Lifecycle.validation', LIMITADTRACKING_OFF: 'limitAdTrackingOFF', LIMITADTRACKING_ON: 'limitAdTrackingON', + LISTENING: 'listening', LONGPOLL_TIMEOUT: 15000, MESSAGE_QUEUE: 'messageQueue', MESSAGE_QUEUE_SIZE: 100, diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 02fe440d..4bf444b8 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -264,7 +264,7 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI } result = JSON.parse(result); cy.log(`Response from ${appId}: ${JSON.stringify(result.result)}`); - if (result?.result?.hasOwnProperty('listening')) { + if (result && result.result && result.result.hasOwnProperty(CONSTANTS.LISTENING)) { const eventResponse = { eventListenerId: result.result.event + '-' + response.id, eventListenerResponse: result.result, @@ -279,7 +279,7 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI } // Creating object with event name, params and response etc and storing it in a global list for further validation. - const eventAppObject = new eventObject( + const eventAppObject = new pprovider( event, param, context, diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 6c0f2f51..56d31daf 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -109,7 +109,11 @@ Given( }; cy.sendMessagetoPlatforms(requestMap).then((result) => { - if (result?.result?.hasOwnProperty('eventResponse')) { + if ( + result && + result.result && + result.result.hasOwnProperty(CONSTANTS.EVENT_RESPONSE) + ) { result.result = result.result.eventResponse; } cy.updateResponseForFCS( @@ -139,7 +143,11 @@ Given( cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then( (response) => { response = JSON.parse(response); - if (response?.result?.hasOwnProperty('eventResponse')) { + if ( + result && + result.result && + result.result.hasOwnProperty(CONSTANTS.EVENT_RESPONSE) + ) { response.result = response.result.eventResponse; } cy.updateResponseForFCS( From d85807c005fc4ee2b1889174339dc4f4307f73f9 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 9 May 2024 16:05:05 +0530 Subject: [PATCH 024/359] FIRECERT-2025-lint fix --- cypress/support/constants/constants.js | 6 +----- .../support/validations/schemaValidation.js | 21 +++++++------------ 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 5adb1eef..df158d05 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -199,11 +199,7 @@ module.exports = { LIFECYCLE_HISTORY_RESPONSE: 'Lifecycle history response fetched from application: ', LIFECYCLE_HISTORY_SCHEMA_PATH: 'schemas/lifecycleHistorySchema', LIFECYCLE_INTENT: 'Lifecycle intent sent to application: ', - LIFECYCLE_METHOD_LIST: [ - 'Lifecycle.ready', - 'Lifecycle.state', - 'Lifecycle.close' - ], + LIFECYCLE_METHOD_LIST: ['Lifecycle.ready', 'Lifecycle.state', 'Lifecycle.close'], LIFECYCLE_NOTIFICATION_GENERATED: 'Lifecycle events generated Req #', LIFECYCLE_STATE: 'Lifecycle.state', LIFECYCLE_STATES: { diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 9258b425..046798dd 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -284,18 +284,13 @@ Cypress.Commands.add('updateLifecycleResponse', (response, method) => { const responseType = response.hasOwnProperty(CONSTANTS.ERROR) ? CONSTANTS.ERROR : CONSTANTS.RESULT; - try { - const stateSchema = cy.getSchema( - method, - '', - Cypress.env(CONSTANTS.SDK_VERSION), - responseType - ); - schemaResult = cy.validateLifecycleSchema(response, stateSchema); - response.schemaResult = schemaResult; - } catch (err) { - error = err; - response.error = error; - } + try { + const stateSchema = cy.getSchema(method, '', Cypress.env(CONSTANTS.SDK_VERSION), responseType); + schemaResult = cy.validateLifecycleSchema(response, stateSchema); + response.schemaResult = schemaResult; + } catch (err) { + error = err; + response.error = error; + } return response; }); From 00473139e2155b3e52ce3bfd8a965322d1a17990 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 9 May 2024 16:06:43 +0530 Subject: [PATCH 025/359] FIRECERT-2025-lint fix --- cypress/support/constants/constants.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index df158d05..a0ebfa6b 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -410,4 +410,4 @@ function getSanityReportPath() { } // If not in Cypress context, for jest unit test context return null; -} \ No newline at end of file +} From 471149570a14e603a60a4e537d4bbce10f545db1 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 9 May 2024 16:31:14 +0530 Subject: [PATCH 026/359] FIRECERT-2025-lint fix --- cypress/support/step_definitions/validations.js | 7 ------- cypress/support/validations/schemaValidation.js | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 56d31daf..6fb8de4c 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -109,13 +109,6 @@ Given( }; cy.sendMessagetoPlatforms(requestMap).then((result) => { - if ( - result && - result.result && - result.result.hasOwnProperty(CONSTANTS.EVENT_RESPONSE) - ) { - result.result = result.result.eventResponse; - } cy.updateResponseForFCS( methodOrEvent, null, diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 046798dd..7f96a01f 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -272,7 +272,7 @@ Cypress.Commands.add('validateLifecycleSchema', (response, methodSchema) => { /** * @module schemaValidation - * @function validateLifecycleSchema + * @function updateLifecycleResponse * @description update raw lifecycle response from 3rd party app with schema validation fields * @param {string} response - lifecycle response * @param {string} method - method name From 76f90024c37e1e795447331211c7a3df50d6fa8d Mon Sep 17 00:00:00 2001 From: Preethi M R <102140979+PreethiMaai@users.noreply.github.com> Date: Fri, 10 May 2024 10:50:13 +0530 Subject: [PATCH 027/359] corrected device validation key --- cypress/fixtures/fireboltCalls/device.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/fixtures/fireboltCalls/device.json b/cypress/fixtures/fireboltCalls/device.json index e9c98605..4c8b271d 100644 --- a/cypress/fixtures/fireboltCalls/device.json +++ b/cypress/fixtures/fireboltCalls/device.json @@ -158,12 +158,12 @@ "BEDROOM_FOR_DEVICE_NAME": { "method": "device.name", "validationJsonPath": "result", - "expected": "DEVICE_BEDROOM_NAME" + "expected": "Bedroom" }, "ONNAMECHANGED_FOR_DEVICE_WITH_BEDROOM": { "event": "device.onNameChanged", "validationJsonPath": "eventResponse", - "expected": "DEVICE_BEDROOM_NAME" + "expected": "Bedroom" }, "PROVISION_DEVICE_WITH_DEFAULT_VALUES":{ "method": "manage_device.provision", @@ -375,4 +375,4 @@ "method": "device.model", "expected": "error" } -} \ No newline at end of file +} From 7d7bd482a73e1568d75fa52f23889a2bc9114c5e Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 10 May 2024 16:06:42 +0530 Subject: [PATCH 028/359] FIRECERT-2025-test fix1 --- cypress/support/step_definitions/fireboltCalls.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 4bf444b8..8a3d1cba 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -266,7 +266,7 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI cy.log(`Response from ${appId}: ${JSON.stringify(result.result)}`); if (result && result.result && result.result.hasOwnProperty(CONSTANTS.LISTENING)) { const eventResponse = { - eventListenerId: result.result.event + '-' + response.id, + eventListenerId: result.result.event + '-' + result.id, eventListenerResponse: result.result, }; result.result = eventResponse; @@ -279,7 +279,7 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI } // Creating object with event name, params and response etc and storing it in a global list for further validation. - const eventAppObject = new pprovider( + const eventAppObject = new eventObject( event, param, context, From dffe91a1abca42d6155e02cffbdd5cadfb2723ca Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 10 May 2024 17:44:10 +0530 Subject: [PATCH 029/359] FIRECERT-2025-test fix 2 --- cypress.config.js | 1 + cypress/plugins/index.js | 5 +- .../support/step_definitions/fireboltCalls.js | 125 ++++++++---------- .../support/step_definitions/validations.js | 50 +++---- .../support/validations/schemaValidation.js | 38 +++--- 5 files changed, 100 insertions(+), 119 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index 90b3cac4..54ee77e8 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -53,6 +53,7 @@ const env = { 'https://rdkcentral.github.io/firebolt/requirements/next/specifications/firebolt-specification.json', firebolt_specification_proposed_url: 'https://rdkcentral.github.io/firebolt/requirements/proposed/specifications/firebolt-specification.json', + sdkVersion: null, externalOpenRpcUrls: [], healthCheckRetries: 8, skipContentValidation: false, diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index 73d50bf9..2efd281e 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -60,7 +60,10 @@ module.exports = async (on, config) => { config.reporterOptions.reportDir = `./reports/${config.env.jobId}`; // Get and dereference OpenRPC - const openRpcs = await getAndDereferenceOpenRpc(config.env.externalOpenRpcUrls); + const openRpcs = await getAndDereferenceOpenRpc( + config.env.externalOpenRpcUrls, + config.env.sdkVersion + ); // Set env equal to strigified openRpcs due to circular references config.env.dereferenceOpenRPC = flatted.stringify(openRpcs); diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 8a3d1cba..730c01c0 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -66,12 +66,7 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = } } - cy.updateResponseForFCS( - method, - params, - response, - Cypress.env(CONSTANTS.SDK_VERSION) - ).then((updatedResponse) => { + cy.updateResponseForFCS(method, params, response).then((updatedResponse) => { // Create a deep copy to avoid reference mutation const dataToBeCensored = _.cloneDeep(response); @@ -168,34 +163,32 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { assert(false, CONSTANTS.NO_MATCHED_RESPONSE); } result = JSON.parse(result); - cy.updateResponseForFCS(method, params, result, Cypress.env(CONSTANTS.SDK_VERSION)).then( - (updatedResponse) => { - // Create a deep copy to avoid reference mutation - const responseType = result.error !== null ? 'error' : 'result'; - const dataToBeCensored = _.cloneDeep(result[responseType]); - - // Call the 'censorData' command to hide sensitive data - cy.censorData(method, dataToBeCensored).then((maskedResult) => { - cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); - }); + cy.updateResponseForFCS(method, params, result).then((updatedResponse) => { + // Create a deep copy to avoid reference mutation + const responseType = result.error !== null ? 'error' : 'result'; + const dataToBeCensored = _.cloneDeep(result[responseType]); - // If method and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(method, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } + // Call the 'censorData' command to hide sensitive data + cy.censorData(method, dataToBeCensored).then((maskedResult) => { + cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); + }); - // Creating object with method name, params and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - method, - param, - context, - updatedResponse, - expected, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + // If method and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(method, param)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); } - ); + + // Creating object with method name, params and response etc and storing it in a global list for further validation. + const apiAppObject = new apiObject( + method, + param, + context, + updatedResponse, + expected, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + }); }); }); }); @@ -271,25 +264,23 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI }; result.result = eventResponse; } - cy.updateResponseForFCS(event, params, result, Cypress.env(CONSTANTS.SDK_VERSION)).then( - (updatedResponse) => { - // If event and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(event, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } - - // Creating object with event name, params and response etc and storing it in a global list for further validation. - const eventAppObject = new eventObject( - event, - param, - context, - updatedResponse, - appId, - expected - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); + cy.updateResponseForFCS(event, params, result).then((updatedResponse) => { + // If event and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(event, param)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); } - ); + + // Creating object with event name, params and response etc and storing it in a global list for further validation. + const eventAppObject = new eventObject( + event, + param, + context, + updatedResponse, + appId, + expected + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); + }); }); }); }); @@ -356,26 +347,24 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn ); } - cy.updateResponseForFCS(event, params, response, Cypress.env(CONSTANTS.SDK_VERSION)).then( - (updatedResponse) => { - cy.log('Response from Firebolt platform: ' + JSON.stringify(response)); - // If event and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(event, params)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } - - // Creating object with event name, params and response etc and storing it in a global list for further validation. - const eventAppObject = new eventObject( - event, - params, - context, - updatedResponse, - appId, - expected - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); + cy.updateResponseForFCS(event, params, response).then((updatedResponse) => { + cy.log('Response from Firebolt platform: ' + JSON.stringify(response)); + // If event and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(event, params)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); } - ); + + // Creating object with event name, params and response etc and storing it in a global list for further validation. + const eventAppObject = new eventObject( + event, + params, + context, + updatedResponse, + appId, + expected + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); + }); } else { cy.log(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); } diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 6fb8de4c..ed7d0130 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -109,20 +109,17 @@ Given( }; cy.sendMessagetoPlatforms(requestMap).then((result) => { - cy.updateResponseForFCS( - methodOrEvent, - null, - result, - Cypress.env(CONSTANTS.SDK_VERSION) - ).then((updatedResponse) => { - cy.saveEventResponse( - updatedResponse, - methodOrEventObject, - eventName, - expected, - eventExpected === 'triggers' ? true : false - ); - }); + cy.updateResponseForFCS(methodOrEvent, null, result).then( + (updatedResponse) => { + cy.saveEventResponse( + updatedResponse, + methodOrEventObject, + eventName, + expected, + eventExpected === 'triggers' ? true : false + ); + } + ); }); } else { const params = { event: eventName }; @@ -143,20 +140,17 @@ Given( ) { response.result = response.result.eventResponse; } - cy.updateResponseForFCS( - methodOrEvent, - null, - response, - Cypress.env(CONSTANTS.SDK_VERSION) - ).then((updatedResponse) => { - cy.saveEventResponse( - updatedResponse, - methodOrEventObject, - eventName, - expected, - eventExpected === 'triggers' ? true : false - ); - }); + cy.updateResponseForFCS(methodOrEvent, null, response).then( + (updatedResponse) => { + cy.saveEventResponse( + updatedResponse, + methodOrEventObject, + eventName, + expected, + eventExpected === 'triggers' ? true : false + ); + } + ); } ); } diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 7f96a01f..dfd41eb4 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -59,11 +59,10 @@ async function getAndDeferenceOpenRPC(version) { * @param {String} method - method name in the format * @param {*} params - API params * @param {Object} response - API response received - * @param {String} sdkVersion - version of SDK * @example - * cy.updateResponseForFCS(method, params, response, sdkVersion = null) + * cy.updateResponseForFCS(method, params, response) */ -Cypress.Commands.add('updateResponseForFCS', (methodOrEvent, params, response, sdkVersion) => { +Cypress.Commands.add('updateResponseForFCS', (methodOrEvent, params, response) => { if (response.hasOwnProperty(CONSTANTS.RESULT) || response.hasOwnProperty(CONSTANTS.ERROR)) { let formattedResponse = {}; let result; @@ -71,7 +70,7 @@ Cypress.Commands.add('updateResponseForFCS', (methodOrEvent, params, response, s ? CONSTANTS.ERROR : CONSTANTS.RESULT; - cy.validateSchema(response[responseType], methodOrEvent, params, sdkVersion, responseType).then( + cy.validateSchema(response[responseType], methodOrEvent, params, responseType).then( (schemaValidation) => { if (methodOrEvent.includes('.on')) { let formattedSchemaValidationResult; @@ -145,26 +144,22 @@ Cypress.Commands.add('updateResponseForFCS', (methodOrEvent, params, response, s * @param {Object} response - JSON response string * @param {string} methodOrEvent - String containing the method/event in the format "" or ""(Ex: accessibility.closedCaptionsSettings, 'accessibility.onClosedCaptionsSettingsChanged') * @param {*} params - API params - * @param {string} sdkVersion - SDK version * @param {string} schemaType - schema type determines which schema should fetch result/error * @example * validateSchema('"accessibility.closedCaptionsSettings",{"enabled":true,"styles":{"fontFamily":"Monospace sans-serif","fontSize":1,"fontColor":"#ffffff","fontEdge":"none","fontEdgeColor":"#7F7F7F","fontOpacity":100,"backgroundColor":"#000000","backgroundOpacity":100,"textAlign":"center","textAlignVertical":"middle"}}' {}, "0.17.0", "result") */ -Cypress.Commands.add( - 'validateSchema', - (response, methodOrEvent, params, sdkVersion, schemaType) => { - cy.getSchema(methodOrEvent, params, sdkVersion, schemaType).then((schemaMap) => { - if (schemaMap) { - return validator.validate(response, schemaMap); - } else { - cy.log(`Failed to fetch schema, validateSchema`).then(() => { - assert(false, 'Failed to fetch schema, validateSchema'); - }); - } - }); - } -); +Cypress.Commands.add('validateSchema', (response, methodOrEvent, params, schemaType) => { + cy.getSchema(methodOrEvent, params, schemaType).then((schemaMap) => { + if (schemaMap) { + return validator.validate(response, schemaMap); + } else { + cy.log(`Failed to fetch schema, validateSchema`).then(() => { + assert(false, 'Failed to fetch schema, validateSchema'); + }); + } + }); +}); /** * @module schemaValidation @@ -172,13 +167,12 @@ Cypress.Commands.add( * @description get schema for a method or event from dereferenced openRPC * @param {string} methodOrEvent - String containing the method/event in the format "" or ""(Ex: accessibility.closedCaptionsSettings, 'accessibility.onClosedCaptionsSettingsChanged') * @param {*} params - API params - * @param {string} sdkVersion - SDK version * @param {string} schemaType - schema type determines which schema should fetch result/error * @example * getSchema("accessibility.closedCaptionsSettings", {}, "0.17.0", "result") * getSchema("accessibility.onClosedCaptionsSettingsChanged", {}, null, "result") */ -Cypress.Commands.add('getSchema', (methodOrEvent, params, sdkVersion, schemaType) => { +Cypress.Commands.add('getSchema', (methodOrEvent, params, schemaType) => { cy.wrap().then(async () => { const schemaList = UTILS.getEnvVariable(CONSTANTS.DEREFERENCE_OPENRPC, true); let schemaMap = null; @@ -285,7 +279,7 @@ Cypress.Commands.add('updateLifecycleResponse', (response, method) => { ? CONSTANTS.ERROR : CONSTANTS.RESULT; try { - const stateSchema = cy.getSchema(method, '', Cypress.env(CONSTANTS.SDK_VERSION), responseType); + const stateSchema = cy.getSchema(method, '', responseType); schemaResult = cy.validateLifecycleSchema(response, stateSchema); response.schemaResult = schemaResult; } catch (err) { From c8d44629c5918704635f8b36c685e9112ee285c8 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 10 May 2024 17:54:13 +0530 Subject: [PATCH 030/359] FIRECERT-2025-test fix 3 --- .../support/validations/schemaValidation.js | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index dfd41eb4..f88f85c8 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -19,38 +19,6 @@ const CONSTANTS = require('../constants/constants'); const Validator = require('jsonschema').Validator; const validator = new Validator(); import UTILS from '../cypress-support/src/utils'; -const logger = require('../Logger')('schemaValidation.js'); - -/** - * @module schemaValidation - * @function getAndDeferenceOpenRPC - * @description To get and dereference the OpenRPC json. If version is provided, get version specific openRPC from URL (https://rdkcentral.github.io/firebolt/requirements/${version}/specifications/firebolt-open-rpc.json) and dereference it. - * Else, get the latest openRPC from URL (https://rdkcentral.github.io/firebolt/requirements/latest/specifications/firebolt-open-rpc.json) by default and dereference it - * Note: Currently, the openRPC supports both core and manage sdk modules - * @param {String} version- version - * @example - * getAndDeferenceOpenRPC('0.17.0') - * getAndDeferenceOpenRPC() - * @return {Object} Dereferenced OpenRPC json - **/ -async function getAndDeferenceOpenRPC(version) { - try { - let url; - if (version) { - url = `https://rdkcentral.github.io/firebolt/requirements/${version}/specifications/firebolt-open-rpc.json`; - } else { - // If no version is provided, get the latest - url = `https://rdkcentral.github.io/firebolt/requirements/latest/specifications/firebolt-open-rpc.json`; - } - const response = await axios.get(url); - const deSchemaList = await $RefParser.dereference(response.data); - Cypress.env(CONSTANTS.DEREFERENCE_OPENRPC, deSchemaList); - return deSchemaList; - } catch (error) { - logger.error('Error fetching data:', error.message, 'getAndDeferenceOpenRPC'); - return null; - } -} /** * @module schemaValidation From 6f70b31d5214aeb71a5a98ba4f2975c13cf80fa7 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 10 May 2024 18:13:22 +0530 Subject: [PATCH 031/359] FIRECERT-2025-test fix4 --- cypress.config.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index 54ee77e8..f50c7fbd 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -33,8 +33,8 @@ const reporterOptions = { const env = { deviceIp: '', - deviceMac: '', - default3rdPartyAppId: '', + deviceMac: 'F0463B1372A4', + default3rdPartyAppId: 'comcast.test.firecert', deviceCommPort: '3474', mock: false, wsUrlPath: '456~A', @@ -53,7 +53,6 @@ const env = { 'https://rdkcentral.github.io/firebolt/requirements/next/specifications/firebolt-specification.json', firebolt_specification_proposed_url: 'https://rdkcentral.github.io/firebolt/requirements/proposed/specifications/firebolt-specification.json', - sdkVersion: null, externalOpenRpcUrls: [], healthCheckRetries: 8, skipContentValidation: false, From 4fc21e8f7ef62ad59b031940f428624454aa3ca8 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 10 May 2024 18:15:24 +0530 Subject: [PATCH 032/359] FIRECERT-2025-test fix5 --- cypress.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index f50c7fbd..90b3cac4 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -33,8 +33,8 @@ const reporterOptions = { const env = { deviceIp: '', - deviceMac: 'F0463B1372A4', - default3rdPartyAppId: 'comcast.test.firecert', + deviceMac: '', + default3rdPartyAppId: '', deviceCommPort: '3474', mock: false, wsUrlPath: '456~A', From 8a071e5d55ae53b03de63047575718e79be3592e Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Mon, 13 May 2024 12:02:56 +0530 Subject: [PATCH 033/359] FIRECERT-2025-addressed comments --- .../support/step_definitions/validations.js | 4 +- .../support/validations/schemaValidation.js | 65 ++++++++++++------- 2 files changed, 42 insertions(+), 27 deletions(-) diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index ed7d0130..1349e3f9 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -109,7 +109,7 @@ Given( }; cy.sendMessagetoPlatforms(requestMap).then((result) => { - cy.updateResponseForFCS(methodOrEvent, null, result).then( + cy.updateResponseForFCS(methodOrEvent, null, result, true).then( (updatedResponse) => { cy.saveEventResponse( updatedResponse, @@ -140,7 +140,7 @@ Given( ) { response.result = response.result.eventResponse; } - cy.updateResponseForFCS(methodOrEvent, null, response).then( + cy.updateResponseForFCS(methodOrEvent, null, response, true).then( (updatedResponse) => { cy.saveEventResponse( updatedResponse, diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index f88f85c8..3d7ceb4d 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -27,19 +27,27 @@ import UTILS from '../cypress-support/src/utils'; * @param {String} method - method name in the format * @param {*} params - API params * @param {Object} response - API response received + * @param {boolean} isValidation - flag to determine if response is updated as part of invocation or validation glue step. For former case, flag is set to false by default, else for latter case flag is set to true * @example * cy.updateResponseForFCS(method, params, response) */ -Cypress.Commands.add('updateResponseForFCS', (methodOrEvent, params, response) => { - if (response.hasOwnProperty(CONSTANTS.RESULT) || response.hasOwnProperty(CONSTANTS.ERROR)) { - let formattedResponse = {}; - let result; - const responseType = response.hasOwnProperty(CONSTANTS.ERROR) - ? CONSTANTS.ERROR - : CONSTANTS.RESULT; +Cypress.Commands.add( + 'updateResponseForFCS', + (methodOrEvent, params, response, isValidation = false) => { + if (response.hasOwnProperty(CONSTANTS.RESULT) || response.hasOwnProperty(CONSTANTS.ERROR)) { + let formattedResponse = {}; + let result; + const responseType = response.hasOwnProperty(CONSTANTS.ERROR) + ? CONSTANTS.ERROR + : CONSTANTS.RESULT; - cy.validateSchema(response[responseType], methodOrEvent, params, responseType).then( - (schemaValidation) => { + cy.validateSchema( + response[responseType], + methodOrEvent, + params, + responseType, + isValidation + ).then((schemaValidation) => { if (methodOrEvent.includes('.on')) { let formattedSchemaValidationResult; @@ -98,12 +106,12 @@ Cypress.Commands.add('updateResponseForFCS', (methodOrEvent, params, response) = } return formattedResponse; - } - ); - } else { - cy.log(`Response does not have a valid result or error field - ${response}`); + }); + } else { + cy.log(`Response does not have a valid result or error field - ${response}`); + } } -}); +); /** * @module schemaValidation @@ -113,21 +121,28 @@ Cypress.Commands.add('updateResponseForFCS', (methodOrEvent, params, response) = * @param {string} methodOrEvent - String containing the method/event in the format "" or ""(Ex: accessibility.closedCaptionsSettings, 'accessibility.onClosedCaptionsSettingsChanged') * @param {*} params - API params * @param {string} schemaType - schema type determines which schema should fetch result/error + * @param {boolean} isValidation - flag to determine if response is updated as part of invocation or validation glue. For former case, flag is set to false by default, else for latter case flag is set to true * @example * validateSchema('"accessibility.closedCaptionsSettings",{"enabled":true,"styles":{"fontFamily":"Monospace sans-serif","fontSize":1,"fontColor":"#ffffff","fontEdge":"none","fontEdgeColor":"#7F7F7F","fontOpacity":100,"backgroundColor":"#000000","backgroundOpacity":100,"textAlign":"center","textAlignVertical":"middle"}}' {}, "0.17.0", "result") */ -Cypress.Commands.add('validateSchema', (response, methodOrEvent, params, schemaType) => { - cy.getSchema(methodOrEvent, params, schemaType).then((schemaMap) => { - if (schemaMap) { - return validator.validate(response, schemaMap); - } else { - cy.log(`Failed to fetch schema, validateSchema`).then(() => { - assert(false, 'Failed to fetch schema, validateSchema'); - }); - } - }); -}); +Cypress.Commands.add( + 'validateSchema', + (response, methodOrEvent, params, schemaType, isValidation) => { + cy.getSchema(methodOrEvent, params, schemaType).then((schemaMap) => { + if (schemaMap) { + return validator.validate(response, schemaMap); + } else { + if (isValidation) { + // Normal calls need to go through and response needs to get stored in global list even if they don't adhere to the schema. Schema failure should only be thrown during validation step + cy.log(`Failed to fetch schema, validateSchema`).then(() => { + assert(false, 'Failed to fetch schema, validateSchema'); + }); + } + } + }); + } +); /** * @module schemaValidation From 696e9e53df7ae4bcfc7b51a4e4ae740cf737b6a7 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 14 May 2024 11:58:17 +0530 Subject: [PATCH 034/359] FIRECERT-2025-addressed comments --- cypress/support/constants/constants.js | 2 +- cypress/support/cypress-commands/lifecycle.js | 2 +- .../support/step_definitions/fireboltCalls.js | 3 +- .../support/step_definitions/validations.js | 6 +- .../support/validations/schemaValidation.js | 216 ++++++++---------- 5 files changed, 106 insertions(+), 123 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index a0ebfa6b..6bdd7c9d 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -126,7 +126,7 @@ module.exports = { EXTERNAL_MODULEREQID_PATH: 'cypress/fixtures/external/moduleReqId/moduleReqId.json', EXTERNAL_PATH: 'cypress/fixtures/external/modules/', EXTERNAL_PREREQUISITE_DATA: './cypress/fixtures/external/PreRequisiteData.json', - EXTRACTEDAPI_PATH: 'extractedApiObject.response.', + EXTRACTEDAPI_PATH: 'extractedApiObject.response.response.', FAIL: 'FAIL', FAILED_TO_PARSE_LIEFECYCLE_ERROR: 'Failed to parse error object from response while setting lifecycle state. Response received : ', diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index f962d23e..ba623007 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -312,7 +312,7 @@ Cypress.Commands.add('invokeLifecycleApi', (appId, method, methodParams = null) return false; } if (CONSTANTS.LIFECYCLE_METHOD_LIST.includes(method)) { - cy.updateLifecycleResponse(response, method).then((updatedResponse) => { + cy.updateResponseForFCS(method, '', response).then((updatedResponse) => { return updatedResponse; }); } diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 730c01c0..540334ee 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -165,8 +165,7 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { result = JSON.parse(result); cy.updateResponseForFCS(method, params, result).then((updatedResponse) => { // Create a deep copy to avoid reference mutation - const responseType = result.error !== null ? 'error' : 'result'; - const dataToBeCensored = _.cloneDeep(result[responseType]); + const dataToBeCensored = _.cloneDeep(result); // Call the 'censorData' command to hide sensitive data cy.censorData(method, dataToBeCensored).then((maskedResult) => { diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 1349e3f9..75e840ec 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -134,9 +134,9 @@ Given( (response) => { response = JSON.parse(response); if ( - result && - result.result && - result.result.hasOwnProperty(CONSTANTS.EVENT_RESPONSE) + response && + response.result && + response.result.hasOwnProperty(CONSTANTS.EVENT_RESPONSE) ) { response.result = response.result.eventResponse; } diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 3d7ceb4d..7ec754e9 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -34,79 +34,94 @@ import UTILS from '../cypress-support/src/utils'; Cypress.Commands.add( 'updateResponseForFCS', (methodOrEvent, params, response, isValidation = false) => { + const responseType = response.hasOwnProperty(CONSTANTS.ERROR) + ? CONSTANTS.ERROR + : CONSTANTS.RESULT; if (response.hasOwnProperty(CONSTANTS.RESULT) || response.hasOwnProperty(CONSTANTS.ERROR)) { - let formattedResponse = {}; - let result; - const responseType = response.hasOwnProperty(CONSTANTS.ERROR) - ? CONSTANTS.ERROR - : CONSTANTS.RESULT; + if ( + Cypress.env(CONSTANTS.TEST_TYPE) && + Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE + ) { + let schemaResult, error; + try { + schemaResult = cy.validateSchema(response, methodOrEvent, '', responseType); + response.schemaResult = schemaResult; + } catch (err) { + error = err; + response.error = error; + } + return response; + } else { + let formattedResponse = {}; + let result; - cy.validateSchema( - response[responseType], - methodOrEvent, - params, - responseType, - isValidation - ).then((schemaValidation) => { - if (methodOrEvent.includes('.on')) { - let formattedSchemaValidationResult; + cy.validateSchema( + response[responseType], + methodOrEvent, + params, + responseType, + isValidation + ).then((schemaValidation) => { + if (methodOrEvent.includes('.on')) { + let formattedSchemaValidationResult; - if ( - schemaValidation.errors && - schemaValidation.errors.length > 0 && - schemaValidation.errors[0].message - ) { - formattedSchemaValidationResult = { - status: CONSTANTS.FAIL, - eventSchemaResult: schemaValidation, - }; + if ( + schemaValidation.errors && + schemaValidation.errors.length > 0 && + schemaValidation.errors[0].message + ) { + formattedSchemaValidationResult = { + status: CONSTANTS.FAIL, + eventSchemaResult: schemaValidation, + }; + } else { + formattedSchemaValidationResult = { + status: CONSTANTS.PASS, + eventSchemaResult: schemaValidation, + }; + } + if (response.hasOwnProperty(CONSTANTS.RESULT)) { + if (response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { + formattedResponse = Object.assign(formattedResponse, response.result); + formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; + } else if (!response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { + formattedResponse.eventResponse = response.result; + formattedResponse.eventSchemaResult = formattedSchemaValidationResult; + formattedResponse.eventTime = null; + } + } else if (response.hasOwnProperty(CONSTANTS.ERROR)) { + if (response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { + formattedResponse = Object.assign(formattedResponse, response.error); + formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; + } else if (!response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { + formattedResponse = response.error; + } + } } else { - formattedSchemaValidationResult = { - status: CONSTANTS.PASS, - eventSchemaResult: schemaValidation, - }; - } - if (response.hasOwnProperty(CONSTANTS.RESULT)) { - if (response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { - formattedResponse = Object.assign(formattedResponse, response.result); - formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; - } else if (!response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { - formattedResponse.eventResponse = response.result; - formattedResponse.eventSchemaResult = formattedSchemaValidationResult; - formattedResponse.eventTime = null; + if (response.hasOwnProperty(CONSTANTS.ERROR)) { + result = { result: null, error: response.error }; + } else if (response.hasOwnProperty(CONSTANTS.RESULT)) { + result = { result: response.result, error: null }; } - } else if (response.hasOwnProperty(CONSTANTS.ERROR)) { - if (response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { - formattedResponse = Object.assign(formattedResponse, response.error); - formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; - } else if (!response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { - formattedResponse = response.error; + + if ( + schemaValidation.errors && + schemaValidation.errors.length > 0 && + schemaValidation.errors[0].message + ) { + formattedResponse[CONSTANTS.SCHEMA_VALIDATION_STATUS] = CONSTANTS.FAIL; + formattedResponse[CONSTANTS.SCHEMA_VALIDATION_RESPONSE] = schemaValidation; + } else { + formattedResponse[CONSTANTS.SCHEMA_VALIDATION_STATUS] = CONSTANTS.PASS; + formattedResponse[CONSTANTS.SCHEMA_VALIDATION_RESPONSE] = schemaValidation; } - } - } else { - if (response.hasOwnProperty(CONSTANTS.ERROR)) { - result = { result: null, error: response.error }; - } else if (response.hasOwnProperty(CONSTANTS.RESULT)) { - result = { result: response.result, error: null }; - } - if ( - schemaValidation.errors && - schemaValidation.errors.length > 0 && - schemaValidation.errors[0].message - ) { - formattedResponse[CONSTANTS.SCHEMA_VALIDATION_STATUS] = CONSTANTS.FAIL; - formattedResponse[CONSTANTS.SCHEMA_VALIDATION_RESPONSE] = schemaValidation; - } else { - formattedResponse[CONSTANTS.SCHEMA_VALIDATION_STATUS] = CONSTANTS.PASS; - formattedResponse[CONSTANTS.SCHEMA_VALIDATION_RESPONSE] = schemaValidation; + formattedResponse.response = result; } - formattedResponse.response = result; - } - - return formattedResponse; - }); + return formattedResponse; + }); + } } else { cy.log(`Response does not have a valid result or error field - ${response}`); } @@ -131,7 +146,27 @@ Cypress.Commands.add( (response, methodOrEvent, params, schemaType, isValidation) => { cy.getSchema(methodOrEvent, params, schemaType).then((schemaMap) => { if (schemaMap) { - return validator.validate(response, schemaMap); + if ( + Cypress.env(CONSTANTS.TEST_TYPE) && + Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE + ) { + let validationResult; + const schemaMapResult = validator.validate(response, methodSchema); + if (schemaMapResult.errors.length > 0 || response === undefined) { + validationResult = { + status: CONSTANTS.FAIL, + schemaValidationResult: schemaMapResult, + }; + } else { + validationResult = { + status: CONSTANTS.PASS, + schemaValidationResult: schemaMapResult, + }; + } + return validationResult; + } else { + return validator.validate(response, schemaMap); + } } else { if (isValidation) { // Normal calls need to go through and response needs to get stored in global list even if they don't adhere to the schema. Schema failure should only be thrown during validation step @@ -220,54 +255,3 @@ function removeSetInMethodName(apiName) { } return apiName.split('.')[0] + '.' + updatedMethod; } - -/** - * @module schemaValidation - * @function validateLifecycleSchema - * @description validate lifecycle response against corresponding schema and return schema validation result - * @param {string} response - lifecycle response - * @param {string} methodSchema - schema against which validation needs to be performed - * @example - * validateLifecycleSchema(response, methodSchema) - */ -Cypress.Commands.add('validateLifecycleSchema', (response, methodSchema) => { - let validationResult; - const schemaMapResult = validator.validate(response, methodSchema); - if (schemaMapResult.errors.length > 0 || response === undefined) { - validationResult = { - status: CONSTANTS.FAIL, - schemaValidationResult: schemaMapResult, - }; - } else { - validationResult = { - status: CONSTANTS.PASS, - schemaValidationResult: schemaMapResult, - }; - } - return validationResult; -}); - -/** - * @module schemaValidation - * @function updateLifecycleResponse - * @description update raw lifecycle response from 3rd party app with schema validation fields - * @param {string} response - lifecycle response - * @param {string} method - method name - * @example - * updateLifecycleResponse(response, method) - */ -Cypress.Commands.add('updateLifecycleResponse', (response, method) => { - let schemaResult, error; - const responseType = response.hasOwnProperty(CONSTANTS.ERROR) - ? CONSTANTS.ERROR - : CONSTANTS.RESULT; - try { - const stateSchema = cy.getSchema(method, '', responseType); - schemaResult = cy.validateLifecycleSchema(response, stateSchema); - response.schemaResult = schemaResult; - } catch (err) { - error = err; - response.error = error; - } - return response; -}); From 6fc4e0c739f5b79ff0683e461c59d478e86a393e Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 14 May 2024 17:16:51 +0530 Subject: [PATCH 035/359] FIRECERT-2025-test fix --- cypress/support/cypress-commands/assertion.js | 5 +++-- cypress/support/step_definitions/validations.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index 20213e2e..09afff57 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -96,7 +96,7 @@ Cypress.Commands.add( const apiErrorResponse = validationType == CONSTANTS.EVENT ? apiOrEventObject.eventListenerResponse.error - : apiOrEventObject.response.error; + : apiOrEventObject.response.response.error; cy.log( `Actual error code ${apiErrorResponse.code} expected to be present in list of expected error codes` @@ -680,7 +680,8 @@ Cypress.Commands.add( return; } if (validationType == CONSTANTS.METHOD) { - const { response, expected, apiSchemaResult } = methodOrEventObject; + const { expected, apiSchemaResult } = methodOrEventObject; + const response = methodOrEventObject.response.response; cy.validationChecksForResponseAndSchemaResult( response, diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 75e840ec..a6cd62f3 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -191,7 +191,7 @@ Given( validationType == CONSTANTS.EVENT ? methodOrEventResponse : validationType == CONSTANTS.METHOD - ? methodOrEventResponse.result + ? methodOrEventResponse.response.result : null; cy.decodeValidation( From 76fe595a02a9fcae2bee17b08a265e411615abd0 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 14 May 2024 17:24:38 +0530 Subject: [PATCH 036/359] FIRECERT-2025-test fix --- .../support/validations/schemaValidation.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 7ec754e9..41a529d2 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -81,16 +81,28 @@ Cypress.Commands.add( }; } if (response.hasOwnProperty(CONSTANTS.RESULT)) { - if (response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { + if ( + response && + response.result && + response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) + ) { formattedResponse = Object.assign(formattedResponse, response.result); formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; - } else if (!response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { + } else if ( + !response && + !response.result && + !response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) + ) { formattedResponse.eventResponse = response.result; formattedResponse.eventSchemaResult = formattedSchemaValidationResult; formattedResponse.eventTime = null; } } else if (response.hasOwnProperty(CONSTANTS.ERROR)) { - if (response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { + if ( + response && + response.result && + response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) + ) { formattedResponse = Object.assign(formattedResponse, response.error); formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; } else if (!response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { From aff96da9856f111ded0abf3b7f0ce7145f1cc2a7 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 14 May 2024 20:05:19 +0530 Subject: [PATCH 037/359] FIRECERT-2025-test fix --- cypress/support/appObjectConfigs.js | 2 +- cypress/support/validations/schemaValidation.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/support/appObjectConfigs.js b/cypress/support/appObjectConfigs.js index cdbc72c7..cc23daed 100644 --- a/cypress/support/appObjectConfigs.js +++ b/cypress/support/appObjectConfigs.js @@ -51,7 +51,7 @@ class eventObject { // Function to update the event response in event object. setEventResponseData(response) { if ( - (response.eventListenerId && response.eventSchemaResult && response.eventResponse != null) || + (response.eventSchemaResult && response.eventResponse != null) || response.hasOwnProperty(CONSTANTS.EVENT_RESPONSE) ) { this.eventResponse = response.eventResponse; diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 41a529d2..fe9fadfa 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -89,8 +89,8 @@ Cypress.Commands.add( formattedResponse = Object.assign(formattedResponse, response.result); formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; } else if ( - !response && - !response.result && + response && + response.result && !response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) ) { formattedResponse.eventResponse = response.result; From c53aa0e13a41f4f1ef8604fe1d5fbb73f845b3d5 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 15 May 2024 14:14:12 +0530 Subject: [PATCH 038/359] FIRECERT-2025-test fix --- .../support/validations/schemaValidation.js | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index fe9fadfa..1b9feec3 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -37,21 +37,23 @@ Cypress.Commands.add( const responseType = response.hasOwnProperty(CONSTANTS.ERROR) ? CONSTANTS.ERROR : CONSTANTS.RESULT; - if (response.hasOwnProperty(CONSTANTS.RESULT) || response.hasOwnProperty(CONSTANTS.ERROR)) { - if ( - Cypress.env(CONSTANTS.TEST_TYPE) && - Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE - ) { - let schemaResult, error; - try { - schemaResult = cy.validateSchema(response, methodOrEvent, '', responseType); - response.schemaResult = schemaResult; - } catch (err) { - error = err; - response.error = error; - } - return response; - } else { + if ( + Cypress.env(CONSTANTS.TEST_TYPE) && + Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE + ) { + try { + cy.validateSchema(response[responseType], methodOrEvent, '', responseType).then( + (schemaValidation) => { + response.schemaResult = schemaValidation; + return response; + } + ); + } catch (err) { + let error = err; + response.error = error; + } + } else { + if (response.hasOwnProperty(CONSTANTS.RESULT) || response.hasOwnProperty(CONSTANTS.ERROR)) { let formattedResponse = {}; let result; @@ -133,9 +135,9 @@ Cypress.Commands.add( return formattedResponse; }); + } else { + cy.log(`Response does not have a valid result or error field - ${response}`); } - } else { - cy.log(`Response does not have a valid result or error field - ${response}`); } } ); @@ -163,7 +165,7 @@ Cypress.Commands.add( Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE ) { let validationResult; - const schemaMapResult = validator.validate(response, methodSchema); + const schemaMapResult = validator.validate(response, schemaMap); if (schemaMapResult.errors.length > 0 || response === undefined) { validationResult = { status: CONSTANTS.FAIL, From 5c93e9886c603491eeb7d73525b4ef2d85e45e6a Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 15 May 2024 14:16:03 +0530 Subject: [PATCH 039/359] FIRECERT-2025-test fix --- cypress/support/validations/schemaValidation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 1b9feec3..43e53d70 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -49,7 +49,7 @@ Cypress.Commands.add( } ); } catch (err) { - let error = err; + const error = err; response.error = error; } } else { From 407b9036289dd031191df5778fe8ed06fae76bce Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Thu, 16 May 2024 11:54:31 +0530 Subject: [PATCH 040/359] FIRECERT-2075-New addressed review comments in lifecycle.js --- .../LifecycleTerminated.feature | 2 +- cypress/support/constants/constants.js | 3 ++- cypress/support/cypress-commands/lifecycle.js | 24 ++++++++++--------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature index 19fbf527..74f1b7c1 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature @@ -4,8 +4,8 @@ Feature: Lifecycle_Terminated Scenario Outline: Lifecycle 2.8 Terminate app in State Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with '' state - Then '3rd party app' invokes the 'Firebolt' API to 'call lifecycle terminate' Then '3rd party app' transitions to state 'terminated' + Then '3rd party app' will stay in 'terminated' state Examples: | state | diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index ccc3c268..69b19932 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -40,7 +40,6 @@ module.exports = { ARRAY: 'array', ASYNCHRONOUS: 'asynchronous', BASE64: 'base64', - BE: 'be', BEFORE_OPERATION: 'beforeOperation', BEFORE_OPERATION_TAGS: 'beforeOperationTags', BOOLEAN: 'boolean', @@ -200,6 +199,7 @@ module.exports = { LIFECYCLE_HISTORY_SCHEMA_PATH: 'schemas/lifecycleHistorySchema', LIFECYCLE_INTENT: 'Lifecycle intent sent to application: ', LIFECYCLE_NOTIFICATION_GENERATED: 'Lifecycle events generated Req #', + LIFECYCLE_NOTIFICATION_NOT_GENERATED: 'Lifecycle events not generated', LIFECYCLE_STATE: 'Lifecycle.state', LIFECYCLE_STATES: { FOREGROUND: 'foreground', @@ -331,6 +331,7 @@ module.exports = { STATE_SCHEMA_VALIDATION_REQ: 'Lifecycle state schema validation Req #', STATIC_CONTENT_VALIDATION: 'staticContentValidation', STATUS_CODE: [0, 1, 2, 3], + STAY: 'stay', STEP_IMPLEMENTATION_MISSING: 'Step implementation missing', STRING: 'string', STRING_LANGUAGE_FORMAT: 'stringLanguageFormat', diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index e7ea14dc..8bd44035 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -198,18 +198,22 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, conditi const lifecycleEventRequirementId = scenarioRequirement.find((req) => req.hasOwnProperty('event') ); + const appHistoryPrevious = UTILS.getEnvVariable(CONSTANTS.APP_LIFECYCLE_HISTORY); + const appHistoryCount = appHistory.length - appHistoryPrevious.length; // Lifecycle event validation - if ( - condition == CONSTANTS.BE && - lifecycleEventRequirementId && - lifecycleEventRequirementId.event - ) { - const appHistoryPrevious = UTILS.getEnvVariable(CONSTANTS.APP_LIFECYCLE_HISTORY); - const appHistoryCount = appHistory.length - appHistoryPrevious.length; + if (condition == CONSTANTS.STAY) { + UTILS.assertWithRequirementLogs( + CONSTANTS.LIFECYCLE_NOTIFICATION_NOT_GENERATED, + appHistoryCount < 1, + true + ); + } else if (lifecycleEventRequirementId && lifecycleEventRequirementId.event) { let pretext; - // If no lifecycle events expected, validate app history value is also empty - if (state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { + if ( + UTILS.getEnvVariable(CONSTANTS.IS_SAME_APP_TRANSITION, false) || + state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING + ) { UTILS.assertWithRequirementLogs( CONSTANTS.LIFECYCLE_NOTIFICATION_GENERATED + lifecycleEventRequirementId?.event?.id[0], appHistoryCount >= 1, @@ -255,8 +259,6 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, conditi ); } } - } else { - cy.log('Skipping lifecycle event validation'); } } else { // Fail test if no valid history response received from 3rd party application From dbaea85b222577f5af789d64073cfe92e5a0dc27 Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Fri, 17 May 2024 13:17:42 +0530 Subject: [PATCH 041/359] FIRECERT-2075-New reverted the existing changes and updated as per review comments --- cypress/support/constants/constants.js | 1 - cypress/support/cypress-commands/lifecycle.js | 147 ++++-------------- .../support/step_definitions/validations.js | 8 +- 3 files changed, 38 insertions(+), 118 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 69b19932..d706f77d 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -199,7 +199,6 @@ module.exports = { LIFECYCLE_HISTORY_SCHEMA_PATH: 'schemas/lifecycleHistorySchema', LIFECYCLE_INTENT: 'Lifecycle intent sent to application: ', LIFECYCLE_NOTIFICATION_GENERATED: 'Lifecycle events generated Req #', - LIFECYCLE_NOTIFICATION_NOT_GENERATED: 'Lifecycle events not generated', LIFECYCLE_STATE: 'Lifecycle.state', LIFECYCLE_STATES: { FOREGROUND: 'foreground', diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 8bd44035..d1de166c 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -19,7 +19,6 @@ const CONSTANTS = require('../constants/constants'); const { _ } = Cypress; import UTILS from '../cypress-support/src/utils'; import lifeCycleAppConfig from '../../../Scripts/lifeCycleAppObject.js'; -const logger = require('../Logger')('lifecycle.js'); /** * @module lifecycle @@ -36,14 +35,12 @@ Cypress.Commands.add('lifecycleSetup', (appCallSign, state) => { if (Cypress.env(CONSTANTS.TEST_TYPE) == CONSTANTS.MODULE_NAMES.LIFECYCLE) { // create lifecycleAppObject to mimic all the state transition for an app and also go through the same state histories - if (!Cypress.env(CONSTANTS.LIFECYCLE_APP_OBJECT_LIST).includes(appId)) { - const lifeCycleAppObject = new lifeCycleAppConfig(appId); - // set the state to initialising - lifeCycleAppObject.setAppObjectState(CONSTANTS.LIFECYCLE_STATES.INITIALIZING); - // store the lifecycleAppObject in global object and push it to a global list - Cypress.env(appId, lifeCycleAppObject); - Cypress.env(CONSTANTS.LIFECYCLE_APP_OBJECT_LIST).push(appId); - } + const lifeCycleAppObject = new lifeCycleAppConfig(appId); + // set the state to initialising + lifeCycleAppObject.setAppObjectState(CONSTANTS.LIFECYCLE_STATES.INITIALIZING); + // store the lifecycleAppObject in global object and push it to a global list + Cypress.env(appId, lifeCycleAppObject); + Cypress.env(CONSTANTS.LIFECYCLE_APP_OBJECT_LIST).push(appId); if (state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { Cypress.env(CONSTANTS.APP_LIFECYCLE_HISTORY, []); @@ -136,8 +133,8 @@ Cypress.Commands.add('setLifecycleState', (state, appId) => { }; cy.log(CONSTANTS.SET_LIFECYCLE_STATE_REQUEST + JSON.stringify(requestMap)).then(() => { cy.sendMessagetoPlatforms(requestMap).then((result) => { - if (result) { - logger.info(CONSTANTS.SET_APP_STATE + state); + if (result !== false) { + console.log(CONSTANTS.SET_APP_STATE + state); } }); }); @@ -150,10 +147,11 @@ Cypress.Commands.add('setLifecycleState', (state, appId) => { * The app history and events obtained by sending message to 3rd party app is validated against corresponding data extracted from the appObject * @param {String} state - State to be used for validation * @param {String} appId - The appId used to launch the app which is identified by the firebolt platform servicing the request + * @param {String} isEventsExpected - * @example - * cy.validateLifecycleHistoryAndEvents('foreground', 'foo') + * cy.validateLifecycleHistoryAndEvents('foreground', 'foo', true) */ -Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, condition) => { +Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEventsExpected) => { // Extract appObject based on appId const appObject = UTILS.getEnvVariable(appId); // Get validation requirements for the current scenario from the moduleReqId JSON @@ -198,34 +196,18 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, conditi const lifecycleEventRequirementId = scenarioRequirement.find((req) => req.hasOwnProperty('event') ); - const appHistoryPrevious = UTILS.getEnvVariable(CONSTANTS.APP_LIFECYCLE_HISTORY); - const appHistoryCount = appHistory.length - appHistoryPrevious.length; // Lifecycle event validation - if (condition == CONSTANTS.STAY) { - UTILS.assertWithRequirementLogs( - CONSTANTS.LIFECYCLE_NOTIFICATION_NOT_GENERATED, - appHistoryCount < 1, - true - ); - } else if (lifecycleEventRequirementId && lifecycleEventRequirementId.event) { - let pretext; - if ( - UTILS.getEnvVariable(CONSTANTS.IS_SAME_APP_TRANSITION, false) || - state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING - ) { - UTILS.assertWithRequirementLogs( - CONSTANTS.LIFECYCLE_NOTIFICATION_GENERATED + lifecycleEventRequirementId?.event?.id[0], - appHistoryCount >= 1, - false - ); + if (lifecycleEventRequirementId && lifecycleEventRequirementId.event) { + const appHistoryPrevious = UTILS.getEnvVariable(CONSTANTS.APP_LIFECYCLE_HISTORY); + const appHistoryCount = appHistory.length - appHistoryPrevious.length; + let pretext = CONSTANTS.NOTIFICATION_EXISTS_REQ + lifecycleEventRequirementId.event.id[0]; + // If no lifecycle events expected, validate app history value is also empty + if (isEventsExpected == false || state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { + UTILS.assertWithRequirementLogs(pretext, appHistoryCount == 0, true); } else { // Else if lifecycle events expected, get app event data and app object event data - UTILS.assertWithRequirementLogs( - CONSTANTS.LIFECYCLE_NOTIFICATION_GENERATED + lifecycleEventRequirementId?.event?.id[0], - appHistoryCount >= 1, - true - ); + UTILS.assertWithRequirementLogs(pretext, appHistoryCount >= 1, true); for (let eventIndex = 1; eventIndex <= appHistoryCount; eventIndex++) { const newAppEvent = appHistory[appHistory.length - eventIndex]; let appObjectEvent; @@ -259,6 +241,8 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, conditi ); } } + } else { + cy.log('Skipping lifecycle event validation'); } } else { // Fail test if no valid history response received from 3rd party application @@ -299,8 +283,8 @@ Cypress.Commands.add('invokeLifecycleApi', (appId, method, methodParams = null) try { errorObject = JSON.parse(response).report.error; } catch (error) { - cy.log(CONSTANTS.FAILED_TO_PARSE_LIEFECYCLE_ERROR + response).then(() => { - assert(false, CONSTANTS.FAILED_TO_PARSE_LIEFECYCLE_ERROR + response); + cy.log(CONSTANTS.FAILED_TO_PARSE_LIEFECYCLE_ERROR).then(() => { + assert(false, CONSTANTS.FAILED_TO_PARSE_LIEFECYCLE_ERROR); }); return false; } @@ -352,7 +336,6 @@ Cypress.Commands.add('setAppState', (state, appId) => { if (response) { cy.log(CONSTANTS.APP_RESPONSE + JSON.stringify(response)); } - appObject.setAppObjectState(state); cy.lifecycleSchemaChecks(response, state); // TODO: Checks for platform support }); @@ -362,9 +345,6 @@ Cypress.Commands.add('setAppState', (state, appId) => { currentAppState.state != CONSTANTS.LIFECYCLE_STATES.FOREGROUND ) { cy.launchApp((appType = CONSTANTS.CERTIFICATION), appId); - appObject.setAppObjectState(state); - } else { - appObject.setAppObjectState(state); } break; @@ -376,9 +356,7 @@ Cypress.Commands.add('setAppState', (state, appId) => { currentAppState.state != CONSTANTS.LIFECYCLE_STATES.INITIALIZING ) { // If current app state is not background, send message to platform to set app state to background - cy.setLifecycleState(state, appId).then(() => { - appObject.setAppObjectState(state); - }); + cy.setLifecycleState(state, appId); } break; @@ -391,7 +369,6 @@ Cypress.Commands.add('setAppState', (state, appId) => { if (response) { cy.log(CONSTANTS.APP_RESPONSE + JSON.stringify(response)); } - appObject.setAppObjectState(state); cy.lifecycleSchemaChecks(response, state); // TODO: Checks for platform support }); @@ -404,73 +381,17 @@ Cypress.Commands.add('setAppState', (state, appId) => { cy.setAppState(CONSTANTS.LIFECYCLE_STATES.FOREGROUND, appId); } // Finally, send message to platform to set app state to inactive - cy.setLifecycleState(state, appId).then(() => { - appObject.setAppObjectState(state); - }); - } - break; - - // Set state to suspended - case CONSTANTS.LIFECYCLE_STATES.SUSPENDED: - // If current app state is not suspended or inactive, set app state to inactive first to comply with allowed transitions - if (currentAppState.state != CONSTANTS.LIFECYCLE_STATES.SUSPENDED) { - if (currentAppState.state != CONSTANTS.LIFECYCLE_STATES.INACTIVE) { - cy.setAppState(CONSTANTS.LIFECYCLE_STATES.INACTIVE, appId); - } - // Send lifecycle.suspend API call to 3rd party app - cy.invokeLifecycleApi(appId, CONSTANTS.LIFECYCLE_APIS.SUSPEND, {}).then((response) => { - if (response) { - cy.log(CONSTANTS.APP_RESPONSE + JSON.stringify(response)); - } - appObject.setAppObjectState(state); - cy.lifecycleSchemaChecks(response, state); - // TODO: Checks for platform support - }); - } - break; - - // Set state to unloading - case CONSTANTS.LIFECYCLE_STATES.UNLOADING: - // If current app state is initializing or null, set app state to inactive first - if (currentAppState.state !== CONSTANTS.LIFECYCLE_STATES.INACTIVE) { - cy.setAppState(CONSTANTS.LIFECYCLE_STATES.INACTIVE, appId); - } - // Send lifecycle.close API call to 3rd party app - cy.invokeLifecycleApi(appId, CONSTANTS.LIFECYCLE_APIS.CLOSE, { - reason: CONSTANTS.ERROR, - }).then((response) => { - if (response) { - cy.log(CONSTANTS.APP_RESPONSE + JSON.stringify(response)); - } - appObject.setAppObjectState(state); - cy.lifecycleSchemaChecks(response, state); - // TODO: Checks for platform support - // cy.fireBoltApi(LifecycleManagement.unload()) - }); - break; - - // Set state to unloaded/terminated - case CONSTANTS.LIFECYCLE_STATES.UNLOADED: - case CONSTANTS.LIFECYCLE_STATES.TERMINATED: - // If current app state is initializing or null, set app state to unloading first - if ( - currentAppState.state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING || - currentAppState.state == CONSTANTS.NULL - ) { - cy.setAppState(CONSTANTS.LIFECYCLE_STATES.UNLOADING, appId); - // Send lifecycle.finished API call to 3rd party app - cy.invokeLifecycleApi(appId, CONSTANTS.LIFECYCLE_APIS.FINISHED, {}).then((response) => { - if (response) { - cy.log(CONSTANTS.APP_RESPONSE + JSON.stringify(response)); - } - appObject.setAppObjectState(state); - }); + cy.setLifecycleState(state, appId); } break; default: break; } + if (state != CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { + // Set app object state to provided state + appObject.setAppObjectState(state); + } }); /** @@ -487,7 +408,7 @@ Cypress.Commands.add('fetchLifecycleHistory', (appId) => { cy.log(CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + response); const historyValue = _.get(JSON.parse(response), 'report.result._history._value', null); _.isEmpty(historyValue) - ? logger.info(CONSTANTS.APP_HISTORY_EMPTY) + ? console.log(CONSTANTS.APP_HISTORY_EMPTY) : Cypress.env(CONSTANTS.APP_LIFECYCLE_HISTORY, historyValue); }); } catch (error) { @@ -529,13 +450,7 @@ Cypress.Commands.add('setAppObjectStateFromMethod', (method, appId) => { switch (method) { case CONSTANTS.LIFECYCLE_APIS.CLOSE.toLowerCase(): const appObject = Cypress.env(appId); - if ( - appObject.getAppObjectState().state !== CONSTANTS.LIFECYCLE_STATES.UNLOADING && - appObject.getAppObjectState().state !== CONSTANTS.LIFECYCLE_STATES.SUSPENDED && - appObject.getAppObjectState().state !== CONSTANTS.LIFECYCLE_STATES.INITIALIZING - ) { - appObject.setAppObjectState(CONSTANTS.LIFECYCLE_STATES.INACTIVE); - } + appObject.setAppObjectState(CONSTANTS.LIFECYCLE_STATES.INACTIVE); break; // Support for other methods can be added in future if needed default: diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 378dbae3..30e44fde 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -325,9 +325,15 @@ Then(/'(.+)' will (be|stay) in '(.+)' state/, (app, condition, state) => { : app === CONSTANTS.FIRST_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) : app; + let isEventsExpected; + condition == CONSTANTS.STAY ? (isEventsExpected = false) : (isEventsExpected = true); const appObject = UTILS.getEnvVariable(appId); cy.validateLifecycleState(appObject.getAppObjectState().state, appId); - cy.validateLifecycleHistoryAndEvents(appObject.getAppObjectState().state, appId, condition); + cy.validateLifecycleHistoryAndEvents( + appObject.getAppObjectState().state, + appId, + isEventsExpected + ); }); /** From e2cb00a2a17c65e92e87a2a70a8efe0b9dbdd445 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Fri, 17 May 2024 14:12:43 +0530 Subject: [PATCH 042/359] FIRECERT-2075-New reverted the existing changes and updated as per review comments --- cypress/support/constants/constants.js | 1 - cypress/support/cypress-commands/lifecycle.js | 25 ++++++++----------- .../support/step_definitions/validations.js | 8 +++++- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 35744e21..ba5d0862 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -203,7 +203,6 @@ module.exports = { LIFECYCLE_HISTORY_SCHEMA_PATH: 'schemas/lifecycleHistorySchema', LIFECYCLE_INTENT: 'Lifecycle intent sent to application: ', LIFECYCLE_NOTIFICATION_GENERATED: 'Lifecycle events generated Req #', - LIFECYCLE_NOTIFICATION_NOT_GENERATED: 'Lifecycle events not generated', LIFECYCLE_STATE: 'Lifecycle.state', LIFECYCLE_STATES: { FOREGROUND: 'foreground', diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 8bd44035..cc5f5fbf 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -150,10 +150,11 @@ Cypress.Commands.add('setLifecycleState', (state, appId) => { * The app history and events obtained by sending message to 3rd party app is validated against corresponding data extracted from the appObject * @param {String} state - State to be used for validation * @param {String} appId - The appId used to launch the app which is identified by the firebolt platform servicing the request + * @param {String} isEventsExpected - The boolean value to check if event is expected or not * @example - * cy.validateLifecycleHistoryAndEvents('foreground', 'foo') + * cy.validateLifecycleHistoryAndEvents('foreground', 'foo', true) */ -Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, condition) => { +Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEventsExpected) => { // Extract appObject based on appId const appObject = UTILS.getEnvVariable(appId); // Get validation requirements for the current scenario from the moduleReqId JSON @@ -198,22 +199,14 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, conditi const lifecycleEventRequirementId = scenarioRequirement.find((req) => req.hasOwnProperty('event') ); - const appHistoryPrevious = UTILS.getEnvVariable(CONSTANTS.APP_LIFECYCLE_HISTORY); - const appHistoryCount = appHistory.length - appHistoryPrevious.length; // Lifecycle event validation - if (condition == CONSTANTS.STAY) { - UTILS.assertWithRequirementLogs( - CONSTANTS.LIFECYCLE_NOTIFICATION_NOT_GENERATED, - appHistoryCount < 1, - true - ); - } else if (lifecycleEventRequirementId && lifecycleEventRequirementId.event) { + if (lifecycleEventRequirementId && lifecycleEventRequirementId.event) { + const appHistoryPrevious = UTILS.getEnvVariable(CONSTANTS.APP_LIFECYCLE_HISTORY); + const appHistoryCount = appHistory.length - appHistoryPrevious.length; let pretext; - if ( - UTILS.getEnvVariable(CONSTANTS.IS_SAME_APP_TRANSITION, false) || - state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING - ) { + // If no lifecycle events expected, validate app history value is also empty + if (isEventsExpected == false || state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { UTILS.assertWithRequirementLogs( CONSTANTS.LIFECYCLE_NOTIFICATION_GENERATED + lifecycleEventRequirementId?.event?.id[0], appHistoryCount >= 1, @@ -259,6 +252,8 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, conditi ); } } + } else { + cy.log('Skipping lifecycle event validation'); } } else { // Fail test if no valid history response received from 3rd party application diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 09a7e146..280d309b 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -329,9 +329,15 @@ Then(/'(.+)' will (be|stay) in '(.+)' state/, (app, condition, state) => { : app === CONSTANTS.FIRST_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) : app; + let isEventsExpected; + condition == CONSTANTS.STAY ? (isEventsExpected = false) : (isEventsExpected = true); const appObject = UTILS.getEnvVariable(appId); cy.validateLifecycleState(appObject.getAppObjectState().state, appId); - cy.validateLifecycleHistoryAndEvents(appObject.getAppObjectState().state, appId, condition); + cy.validateLifecycleHistoryAndEvents( + appObject.getAppObjectState().state, + appId, + isEventsExpected + ); }); /** From 27d430316405c93fc06098e860f82e2f90f163b4 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Fri, 17 May 2024 18:01:37 +0530 Subject: [PATCH 043/359] FIRECERT-1819: Added userinterest feature file and params --- .../UserInterest.feature | 180 +++ .../fixtures/fireboltCalls/userinterest.json | 656 ++++++++ cypress/fixtures/modules/discovery.json | 1343 ++++++++++++++++- 3 files changed, 2177 insertions(+), 2 deletions(-) create mode 100644 cypress/TestCases/FireboltCertification/UserInterest.feature create mode 100644 cypress/fixtures/fireboltCalls/userinterest.json diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature new file mode 100644 index 00000000..7049f1d3 --- /dev/null +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -0,0 +1,180 @@ +Feature: UserInterest + + @initialization + Scenario: Launch FCA for 'Userinterest' + Given the environment has been set up for 'Userinterest' tests + And 3rd party 'certification' app is launched + + @coreSDK @sdk @transport @userinterest + Scenario Outline: Discovery.userInterest - Positive Scenario: with interest type + When 1st party app invokes the 'Firebolt' API to 'discovery onRequestUserInterest' + And '3rd party app' invokes the 'Firebolt' API to 'get userInterest with ' + Then 'Firebolt' platform responds with 'null for discovery userInterest' + And 'Firebolt' platform triggers event '' + + Examples: + | Scenario | GetParam | Event_Content | + | interest reason playlist | type interest reason playlist program entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist | type disinterest reason playlist program entity | onRequestUserInterest with type disinterest reason playlist | + | interest reason playlist & channel streaming entity | type interest reason playlist channel streaming entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & channel streaming entity | type disinterest reason playlist channel streaming entity | onRequestUserInterest with type disinterest reason playlist | + | interest reason playlist & channel overTheAir entity | type interest reason playlist channel overTheAir entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & channel overTheAir entity | type disinterest reason playlist channel overTheAir entity | onRequestUserInterest with type disinterest reason playlist | + | interest reason playlist & program episode entity | type interest reason playlist program episode entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program episode entity | type disinterest reason playlist program episode entity | onRequestUserInterest with type disinterest reason playlist | + | interest reason playlist & program season entity | type interest reason playlist program season entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program season entity | type disinterest reason playlist program season entity | onRequestUserInterest with type disinterest reason playlist | + | interest reason playlist & program series entity | type interest reason playlist program series entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program series entity | type disinterest reason playlist program series entity | onRequestUserInterest with type dinterest reason playlist | + | interest reason playlist & program additional concert entity | type interest reason playlist program additional concert entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program additional concert entity | type disinterest reason playlist program additional concert entity | onRequestUserInterest with type dinterest reason playlist | + | interest reason playlist & program additional sportingEvent entity | type interest reason playlist program additional sportingEvent entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program additional sportingEvent entity | type disinterest reason playlist program additional sportingEvent entity | onRequestUserInterest with type dinterest reason playlist | + | interest reason playlist & program additional preview entity | type interest reason playlist program additional preview entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program additional preview entity | type disinterest reason playlist program additional preview entity | onRequestUserInterest with type dinterest reason playlist | + | interest reason playlist & program additional other entity | type interest reason playlist program additional other entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program additional other entity | type disinterest reason playlist program additional other entity | onRequestUserInterest with type dinterest reason playlist | + | interest reason playlist & program additional advertisement entity | type interest reason playlist program additional advertisement entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program additional advertisement entity | type disinterest reason playlist program additional advertisement entity | onRequestUserInterest with type dinterest reason playlist | + | interest reason playlist & program additional musicVideo entity | type interest reason playlist program additional musicVideo entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program additional musicVideo entity | type disinterest reason playlist program additional musicVideo entity | onRequestUserInterest with type dinterest reason playlist | + | interest reason playlist & program additional minisode entity | type interest reason playlist program additional minisode entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program additional minisode entity | type disinterest reason playlist program additional minisode entity | onRequestUserInterest with type dinterest reason playlist | + | interest reason playlist & program additional extra entity | type interest reason playlist program additional extra entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program additional extra entity | type disinterest reason playlist program additional extra entity | onRequestUserInterest with type dinterest reason playlist | + | interest reason playlist & program additional extra entity | type interest reason playlist program additional extra entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program additional extra entity | type disinterest reason playlist program additional extra entity | onRequestUserInterest with type dinterest reason playlist | + | interest reason playlist & music song entity | type interest reason playlist music song entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & music song entity | type disinterest reason playlist music song entity | onRequestUserInterest with type dinterest reason playlist | + | interest reason playlist & music album entity | type interest reason playlist music album entity | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & music album entity | type disinterest reason playlist music album entity | onRequestUserInterest with type dinterest reason playlist | + | interest reason playlist & program tvepisode entity with seriesId and seasonId | type interest reason playlist program tvepisode entity with seriesId and seasonId | onRequestUserInterest with type interest reason playlist | + | disinterest reason playlist & program tvepisode entity with seriesId and seasonId | type disinterest reason playlist program tvepisode entity with seriesId and seasonId | onRequestUserInterest with type disinterest reason playlist | + | interest reason reaction | type interest reason reaction program entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction | type disinterest reason reaction program entity | onRequestUserInterest with type disinterest reason reaction | + | interest reason reaction & channel streaming entity | type interest reason reaction channel streaming entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & channel streaming entity | type disinterest reason reaction channel streaming entity | onRequestUserInterest with type disinterest reason reaction | + | interest reason reaction & channel overTheAir entity | type interest reason reaction channel overTheAir entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & channel overTheAir entity | type disinterest reason reaction channel overTheAir entity | onRequestUserInterest with type disinterest reason reaction | + | interest reason reaction & program episode entity | type interest reason reaction program episode entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program episode entity | type disinterest reason reaction program episode entity | onRequestUserInterest with type disinterest reason reaction | + | interest reason reaction & program season entity | type interest reason reaction program season entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program season entity | type disinterest reason reaction program season entity | onRequestUserInterest with type disinterest reason reaction | + | interest reason reaction & program series entity | type interest reason reaction program series entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program series entity | type disinterest reason reaction program series entity | onRequestUserInterest with type dinterest reason reaction | + | interest reason reaction & program additional concert entity | type interest reason reaction program additional concert entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program additional concert entity | type disinterest reason reaction program additional concert entity | onRequestUserInterest with type dinterest reason reaction | + | interest reason reaction & program additional sportingEvent entity | type interest reason reaction program additional sportingEvent entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program additional sportingEvent entity | type disinterest reason reaction program additional sportingEvent entity | onRequestUserInterest with type dinterest reason reaction | + | interest reason reaction & program additional preview entity | type interest reason reaction program additional preview entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program additional preview entity | type disinterest reason reaction program additional preview entity | onRequestUserInterest with type dinterest reason reaction | + | interest reason reaction & program additional other entity | type interest reason reaction program additional other entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program additional other entity | type disinterest reason reaction program additional other entity | onRequestUserInterest with type dinterest reason reaction | + | interest reason reaction & program additional advertisement entity | type interest reason reaction program additional advertisement entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program additional advertisement entity | type disinterest reason reaction program additional advertisement entity | onRequestUserInterest with type dinterest reason reaction | + | interest reason reaction & program additional musicVideo entity | type interest reason reaction program additional musicVideo entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program additional musicVideo entity | type disinterest reason reaction program additional musicVideo entity | onRequestUserInterest with type dinterest reason reaction | + | interest reason reaction & program additional minisode entity | type interest reason reaction program additional minisode entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program additional minisode entity | type disinterest reason reaction program additional minisode entity | onRequestUserInterest with type dinterest reason reaction | + | interest reason reaction & program additional extra entity | type interest reason reaction program additional extra entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program additional extra entity | type disinterest reason reaction program additional extra entity | onRequestUserInterest with type dinterest reason reaction | + | interest reason reaction & program additional extra entity | type interest reason reaction program additional extra entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program additional extra entity | type disinterest reason reaction program additional extra entity | onRequestUserInterest with type dinterest reason reaction | + | interest reason reaction & music song entity | type interest reason reaction music song entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & music song entity | type disinterest reason reaction music song entity | onRequestUserInterest with type dinterest reason reaction | + | interest reason reaction & music album entity | type interest reason reaction music album entity | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & music album entity | type disinterest reason reaction music album entity | onRequestUserInterest with type dinterest reason reaction | + | interest reason reaction & program tvepisode entity with seriesId and seasonId | type interest reason reaction program tvepisode entity with seriesId and seasonId | onRequestUserInterest with type interest reason reaction | + | disinterest reason reaction & program tvepisode entity with seriesId and seasonId | type disinterest reason reaction program tvepisode entity with seriesId and seasonId | onRequestUserInterest with type disinterest reason reaction | + | interest reason recording | type interest reason recording program entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording | type disinterest reason recording program entity | onRequestUserInterest with type disinterest reason recording | + | interest reason recording & channel streaming entity | type interest reason recording channel streaming entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & channel streaming entity | type disinterest reason recording channel streaming entity | onRequestUserInterest with type disinterest reason recording | + | interest reason recording & channel overTheAir entity | type interest reason recording channel overTheAir entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & channel overTheAir entity | type disinterest reason recording channel overTheAir entity | onRequestUserInterest with type disinterest reason recording | + | interest reason recording & program episode entity | type interest reason recording program episode entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program episode entity | type disinterest reason recording program episode entity | onRequestUserInterest with type disinterest reason recording | + | interest reason recording & program season entity | type interest reason recording program season entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program season entity | type disinterest reason recording program season entity | onRequestUserInterest with type disinterest reason recording | + | interest reason recording & program series entity | type interest reason recording program series entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program series entity | type disinterest reason recording program series entity | onRequestUserInterest with type dinterest reason recording | + | interest reason recording & program additional concert entity | type interest reason recording program additional concert entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program additional concert entity | type disinterest reason recording program additional concert entity | onRequestUserInterest with type dinterest reason recording | + | interest reason recording & program additional sportingEvent entity | type interest reason recording program additional sportingEvent entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program additional sportingEvent entity | type disinterest reason recording program additional sportingEvent entity | onRequestUserInterest with type dinterest reason recording | + | interest reason recording & program additional preview entity | type interest reason recording program additional preview entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program additional preview entity | type disinterest reason recording program additional preview entity | onRequestUserInterest with type dinterest reason recording | + | interest reason recording & program additional other entity | type interest reason recording program additional other entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program additional other entity | type disinterest reason recording program additional other entity | onRequestUserInterest with type dinterest reason recording | + | interest reason recording & program additional advertisement entity | type interest reason recording program additional advertisement entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program additional advertisement entity | type disinterest reason recording program additional advertisement entity | onRequestUserInterest with type dinterest reason recording | + | interest reason recording & program additional musicVideo entity | type interest reason recording program additional musicVideo entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program additional musicVideo entity | type disinterest reason recording program additional musicVideo entity | onRequestUserInterest with type dinterest reason recording | + | interest reason recording & program additional minisode entity | type interest reason recording program additional minisode entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program additional minisode entity | type disinterest reason recording program additional minisode entity | onRequestUserInterest with type dinterest reason recording | + | interest reason recording & program additional extra entity | type interest reason recording program additional extra entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program additional extra entity | type disinterest reason recording program additional extra entity | onRequestUserInterest with type dinterest reason recording | + | interest reason recording & program additional extra entity | type interest reason recording program additional extra entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program additional extra entity | type disinterest reason recording program additional extra entity | onRequestUserInterest with type dinterest reason recording | + | interest reason recording & music song entity | type interest reason recording music song entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & music song entity | type disinterest reason recording music song entity | onRequestUserInterest with type dinterest reason recording | + | interest reason recording & music album entity | type interest reason recording music album entity | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & music album entity | type disinterest reason recording music album entity | onRequestUserInterest with type dinterest reason recording | + | interest reason recording & program tvepisode entity with seriesId and seasonId | type interest reason recording program tvepisode entity with seriesId and seasonId | onRequestUserInterest with type interest reason recording | + | disinterest reason recording & program tvepisode entity with seriesId and seasonId | type disinterest reason recording program tvepisode entity with seriesId and seasonId | onRequestUserInterest with type disinterest reason recording | + + @coreSDK @sdk @transport @userinterest + Scenario Outline: Discovery.userInterest - Negative Scenario: expecting error + When '3rd party app' invokes the 'Firebolt' API to 'get userInterest ' + Then 'Firebolt' platform responds with 'invalid params for discovery userInterest' + + Examples: + | Scenario | GetParam | + | Empty param | without any params | + | Without Interest type | without interest type | + | Invalid Interest type - integer params | with numeric interestType | + | Invalid Interest type - test params | with string interestType | + | Invalid Interest type - boolean params | with boolean interestType | + | Invalid channelType in channel entity | with invalid channelType in channel entity | + | Boolean channelType in channel entity | with boolean channelType in channel entity | + | Integer channelType in channel entity | with integer channelType in channel entity | + | Invalid programType in program entity | with invalid programType in program entity | + | Boolean programType in program entity | with boolean programType in program entity | + | Integer programType in program entity | with integer programType in program entity | + | Invalid musicType in music entity | with invalid musicType in music entity | + | Boolean musicType in music entity | with boolean musicType in music entity | + | Integer musicType in music entity | with integer musicType in music entity | + | Invalid seriesId in program episode entity | with invalid seriesId in program episode entity | + | Invalid seasonId in program episode entity | with invalid seasonId in program episode entity | + | Invalid seriesId and seasonId in program episode entity | with invalid seriesId and seasonId in program episode entity | + | Invalid seriesId in program season entity | with invalid seriesId in program season entity | + | Invalid programType for program entity with seriesId | with invalid programType for program entity with seriesId | + | Invalid programType for program entity with seasonId | with invalid programType for program entity with seasonId | + + # @coreSDK @sdk @transport @userinterest + Scenario Outline: 'Discovery_content.requestUserInterest - Positive Scenario: with type + When '3rd party app' registers for the 'discovery onRequestUserInterest' event using the 'Firebolt' API + And 1st party app invokes the 'Firebolt' API to 'get requestUserInterest with type ' + Then 'Firebolt' platform responds with '' + # And 'Firebolt' platform triggers event '' + + Examples: + | Scenario | setParam | method_Content | Event_Content | + | interest and reason playlist | interest reason playlist | requestUserInterest with type interest reason playlist | onRequestUserInterest with type interest reason playlist | + | interest and reason reaction | interest reason reaction | requestUserInterest with type interest reason playlist | onRequestUserInterest with type interest reason reaction | + | interest and reason recording | interest reason recording | requestUserInterest with type interest reason playlist | onRequestUserInterest with type interest reason recording | + | disinterest and reason playlist | disinterest reason playlist | requestUserInterest with type interest reason playlist | onRequestUserInterest with type dinterest reason playlist | + | disinterest and reason reaction | disinterest reason reaction | requestUserInterest with type interest reason playlist | onRequestUserInterest with type dinterest reason reaction | + | disinterest and reason recording | disinterest reason recording | requestUserInterest with type interest reason playlist | onRequestUserInterest with type dinterest reason recording | + + @coreSDK @sdk @transport @userinterest + Scenario Outline: Discovery_content.requestUserInterest - Negative Scenario: expecting error + When 1st party app invokes the 'Firebolt' API to 'get requestUserInterest with ' + Then 'Firebolt' platform responds with 'invalid params for content requestUserInterest' + + Examples: + | Scenario | Param | + | Invalid Interest value - test params | invalid interestType | + | Invalid Interest type - boolean params | boolean interestType | + | Invalid reason value - test params | invalid reasonType | + | Invalid Interest type - boolean params | boolean reasonType | \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/userinterest.json b/cypress/fixtures/fireboltCalls/userinterest.json new file mode 100644 index 00000000..e75fe445 --- /dev/null +++ b/cypress/fixtures/fireboltCalls/userinterest.json @@ -0,0 +1,656 @@ +{ + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_CHANNEL_STREAMING_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_STREAMING" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_CHANNEL_STREAMING_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_STREAMING" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_CHANNEL_OVERTHEAIR_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_OVERTHEAIR" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_CHANNEL_OVERTHEAIR_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_OVERTHEAIR" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_EPISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_EPISODE" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_EPISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_EPISODE" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_SEASON_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SEASON" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_SEASON_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SEASON" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_SERIES_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SERIES" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_SERIES_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SERIES" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_CONCERT" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_CONCERT" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_OTHER_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_OTHER" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_OTHER_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_OTHER" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MINISODE" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MINISODE" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_EXTRA" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_EXTRA" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_MUSIC_SONG" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_MUSIC_SONG" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_MUSIC_ALBUM" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_MUSIC_ALBUM" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_CHANNEL_OVERTHEAIR_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_OVERTHEAIR" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_CHANNEL_OVERTHEAIR_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_OVERTHEAIR" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_EPISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_EPISODE" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_EPISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_EPISODE" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_SEASON_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_SEASON" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_SEASON_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_SEASON" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_SERIES_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_SERIES" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_SERIES_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_SERIES" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_CONCERT" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_CONCERT" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_OTHER_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_OTHER" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_OTHER_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_OTHER" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_MUSIC_SONG_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_MUSIC_SONG" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_MUSIC_SONG_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_MUSIC_SONG" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_MUSIC_ALBUM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_MUSIC_ALBUM" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_MUSIC_ALBUM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_MUSIC_ALBUM" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_CHANNEL_STREAMING_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_CHANNEL_STREAMING_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_CHANNEL_OVERTHEAIR_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_OVERTHEAIR" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_CHANNEL_OVERTHEAIR_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_OVERTHEAIR" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_SERIES_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_SERIES" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_SERIES_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_SERIES" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_CONCERT" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_CONCERT" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_OTHER_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_OTHER" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_OTHER_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_OTHER" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MINISODE" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MINISODE" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_EXTRA" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_EXTRA" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_MUSIC_SONG_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_MUSIC_SONG" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_MUSIC_SONG_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_MUSIC_SONG" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_MUSIC_ALBUM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_MUSIC_ALBUM" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_MUSIC_ALBUM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_MUSIC_ALBUM" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" + }, + "ONREQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { + "event": "discovery.onRequestUserInterest", + "validationJsonPath": "eventResponse.request", + "expected": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST" + }, + "ONREQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { + "event": "discovery.onRequestUserInterest", + "validationJsonPath": "eventResponse.request", + "expected": "DISCOVERY_TYPE_INTEREST_REASON_REACTION" + }, + "ONREQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING": { + "event": "discovery.onRequestUserInterest", + "validationJsonPath": "eventResponse.request", + "expected": "DISCOVERY_TYPE_INTEREST_REASON_RECORDING" + }, + "ONREQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { + "event": "discovery.onRequestUserInterest", + "validationJsonPath": "eventResponse.request", + "expected": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST" + }, + "ONREQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION": { + "event": "discovery.onRequestUserInterest", + "validationJsonPath": "eventResponse.request", + "expected": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION" + }, + "ONREQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING": { + "event": "discovery.onRequestUserInterest", + "validationJsonPath": "eventResponse.request", + "expected": "DISCOVERY_TYPE_DISINTEREST_REASON_RECORDING" + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { + "method": "content.requestUserInterest", + "validationJsonPath": "result.entity", + "expected": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_RESPONSE" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_MUSIC_SONG_ENTITY_DATA": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_MUSIC_SONG_ENTITY" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_WITH_MUSIC_SONG_ENTITY_DATA": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_MUSIC_SONG_ENTITY" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_MUSIC_ALBUM_ENTITY_DATA": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_MUSIC_ALBUM_ENTITY" + }, + "GET_USERINTEREST_WITH_TYPE_DISINTEREST_WITH_MUSIC_ALBUM_ENTITY_DATA": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_MUSIC_ALBUM_ENTITY" + }, + "NULL_FOR_DISCOVERY_USERINTEREST": { + "method": "discovery.userInterest", + "context": "noContext", + "validationJsonPath": "result", + "expected": "NULL", + "expectingError": false + }, + "GET_USERINTEREST_WITHOUT_ANY_PARAMS": { + "method": "discovery.userInterest" + }, + "GET_USERINTEREST_WITHOUT_INTEREST_TYPE": { + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITHOUT_INTEREST_TYPE", + "expected": "error" + }, + "GET_USERINTEREST_WITH_NUMERIC_INTERESTTYPE":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_INTERESTTYPE_INTEGER", + "expected": "error" + }, + "GET_USERINTEREST_WITH_STRING_INTERESTTYPE":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_INTERESTTYPE_STRING", + "expected": "error" + }, + "GET_USERINTEREST_WITH_BOOLEAN_INTERESTTYPE":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_INTERESTTYPE_BOOLEAN", + "expected": "error" + }, + "INVALID_PARAMS_FOR_DISCOVERY_USERINTEREST": { + "method": "discovery.userInterest", + "context": "noContext", + "validationJsonPath": "result", + "expected": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "GET_USERINTEREST_WITH_INVALID_CHANNELTYPE_IN_CHANNEL_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_CHANNELTYPE_IN_CHANNEL_ENTITY", + "expected": "error" + }, + "GET_USERINTEREST_WITH_INVALID_PROGRAMTYPE_IN_PROGRAM_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_IN_PROGRAM_ENTITY", + "expected": "error" + }, + "GET_USERINTEREST_WITH_INVALID_MUSICTYPE_IN_MUSIC_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_MUSICTYPE_IN_MUSIC_ENTITY", + "expected": "error" + }, + "GET_USERINTEREST_WITH_BOOLEAN_CHANNELTYPE_IN_CHANNEL_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_BOOLEAN_CHANNELTYPE_IN_CHANNEL_ENTITY", + "expected": "error" + }, + "GET_USERINTEREST_WITH_INTEGER_CHANNELTYPE_IN_CHANNEL_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INTEGER_CHANNELTYPE_IN_CHANNEL_ENTITY", + "expected": "error" + }, + "GET_USERINTEREST_WITH_BOOLEAN_PROGRAMTYPE_IN_PROGRAM_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_BOOLEAN_PROGRAMTYPE_IN_PROGRAM_ENTITY", + "expected": "error" + }, + "GET_USERINTEREST_WITH_INTEGER_PROGRAMTYPE_IN_PROGRAM_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INTEGER_PROGRAMTYPE_IN_PROGRAM_ENTITY", + "expected": "error" + }, + "GET_USERINTEREST_WITH_BOOLEAN_MUSICTYPE_IN_MUSIC_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_BOOLEAN_MUSICTYPE_IN_MUSIC_ENTITY", + "expected": "error" + }, + "GET_USERINTEREST_WITH_INTEGER_MUSICTYPE_IN_MUSIC_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INTEGER_MUSICTYPE_IN_MUSIC_ENTITY", + "expected": "error" + }, + "GET_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST": { + "method": "discovery.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_PROGRAM_EPISODE_ENTITY_AND_SEASONID_DATA": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_PROGRAM_EPISODE_AND_SEASONID_ENTITY" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_PROGRAM_EPISODE_ENTITY_AND_SERIESID_DATA": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_PROGRAM_EPISODE_AND_SERIESID_ENTITY" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_PROGRAM_SEASON_ENTITY_AND_SERIESID_DATA": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_PROGRAM_SEASON_AND_SERIESID_ENTITY" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_PROGRAM_EPISODE_ENTITY_AND_SERIESID_SEASONID_DATA": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_PROGRAM_EPISODE_AND_SERIESID_SEASONID_ENTITY" + }, + "GET_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_EPISODE_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_EPISODE_ENTITY", + "expected": "error" + }, + "GET_USERINTEREST_WITH_INVALID_SEASONID_IN_PROGRAM_EPISODE_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_SEASONID_IN_PROGRAM_EPISODE_ENTITY", + "expected": "error" + }, + "GET_USERINTEREST_WITH_INVALID_SERIESID_AND_SEASONID_IN_PROGRAM_EPISODE_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_SERIESID_AND_SEASONID_IN_PROGRAM_EPISODE_ENTITY", + "expected": "error" + }, + "GET_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_SEASON_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_SEASON_ENTITY", + "expected": "error" + }, + "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_MUSIC_SONG_ENTITY_AND_ALBUMID_DATA": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_MUSIC_SONG_AND_ALBUMID_ENTITY" + }, + "GET_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SERIESID":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SERIESID", + "expected": "error" + }, + "GET_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SEASONID":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SEASONID", + "expected": "error" + }, + "GET_USERINTEREST_WITH_INVALID_MUSICTYPE_FOR_MUSIC_ENTITY_WITH_ALBUMID":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_MUSICTYPE_FOR_MUSIC_ENTITY_WITH_ALBUMID", + "expected": "error" + }, + "GET_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST" + }, + "GET_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION" + }, + "GET_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING" + }, + "GET_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST" + }, + "GET_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION" + }, + "GET_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING" + }, + "GET_REQUESTUSERINTEREST_WITH_INVALID_INTERESTTYPE": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_INVALID_INTERESTTYPE", + "expected": "error" + }, + "GET_REQUESTUSERINTEREST_WITH_BOOLEAN_INTERESTTYPE": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_BOOLEAN_INTERESTTYPE", + "expected": "error" + }, + "GET_REQUESTUSERINTEREST_WITH_INVALID_REASONTYPE": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_INVALID_REASONTYPE", + "expected": "error" + }, + "GET_REQUESTUSERINTEREST_WITH_BOOLEAN_REASONTYPE": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_BOOLEAN_REASONTYPE", + "expected": "error" + }, + "INVALID_PARAMS_FOR_CONTENT_REQUESTUSERINTEREST": { + "method": "discovery_content.requestUserInterest", + "context": "noContext", + "validationJsonPath": "result", + "expected": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "DISCOVERY_ONREQUESTUSERINTEREST":{ + "method": "Discovery.onRequestUserInterest" + } +} \ No newline at end of file diff --git a/cypress/fixtures/modules/discovery.json b/cypress/fixtures/modules/discovery.json index 2929fb80..85d4d9e6 100644 --- a/cypress/fixtures/modules/discovery.json +++ b/cypress/fixtures/modules/discovery.json @@ -432,6 +432,1345 @@ }, "HOME_INTENT": { "appId": "foo", - "intent": { "action": "home", "context": { "source": "voice" } } - } + "intent": { + "action": "home", + "context": { + "source": "voice" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM": { + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_STREAMING": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_STREAMING": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_OVERTHEAIR": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_OVERTHEAIR": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_EPISODE": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_EPISODE": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SEASON": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SEASON": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SERIES": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "series", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SERIES": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "series", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_OTHER": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "other", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_OTHER": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "other", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_MUSIC_SONG": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_MUSIC_SONG": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_MUSIC_ALBUM": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_MUSIC_ALBUM": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + }, + + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM": { + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_OVERTHEAIR": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_OVERTHEAIR": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_EPISODE": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_EPISODE": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_SEASON": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_SEASON": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_SERIES": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "series", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_SERIES": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "series", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_OTHER": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "other", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_OTHER": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "other", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_MUSIC_SONG": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_MUSIC_SONG": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_MUSIC_ALBUM": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_MUSIC_ALBUM": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { + "type": "interest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + }, + + + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM": { + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM": { + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_SERIES": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "series", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_SERIES": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "series", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_OTHER": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "other", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_OTHER": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "other", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_MUSIC_SONG": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_MUSIC_SONG": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_MUSIC_ALBUM": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_MUSIC_ALBUM": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { + "type": "interest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { + "type": "disinterest", + "reason": "recording", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + }, + "USERINTEREST_WITHOUT_INTEREST_TYPE": { + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_INVALID_INTERESTTYPE_INTEGER": { + "type": 123, + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_INVALID_INTERESTTYPE_STRING": { + "type": "test", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_INVALID_INTERESTTYPE_BOOLEAN": { + "type": true, + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + }, + "USERINTEREST_WITH_INVALID_CHANNELTYPE_IN_CHANNEL_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "channel", + "channelType": "test", + "entityId": "broadcast/xyz" + } + }, + "USERINTEREST_WITH_BOOLEAN_CHANNELTYPE_IN_CHANNEL_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "channel", + "channelType": true, + "entityId": "broadcast/xyz" + } + }, + "USERINTEREST_WITH_INTEGER_CHANNELTYPE_IN_CHANNEL_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "channel", + "channelType": 123, + "entityId": "broadcast/xyz" + } + }, + "USERINTEREST_WITH_INVALID_PROGRAMTYPE_IN_PROGRAM_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "test", + "entityId": "entity/abc" + } + }, + "USERINTEREST_WITH_BOOLEAN_PROGRAMTYPE_IN_PROGRAM_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": true, + "entityId": "entity/abc" + } + }, + "USERINTEREST_WITH_INTEGER_PROGRAMTYPE_IN_PROGRAM_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": 123, + "entityId": "entity/abc" + } + }, + "USERINTEREST_WITH_INVALID_MUSICTYPE_IN_MUSIC_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "music", + "musicType": "test", + "entityId": "album/xyz" + } + }, + "USERINTEREST_WITH_BOOLEAN_MUSICTYPE_IN_MUSIC_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "music", + "musicType": true, + "entityId": "album/xyz" + } + }, + "USERINTEREST_WITH_INTEGER_MUSICTYPE_IN_MUSIC_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "music", + "musicType": 123, + "entityId": "album/xyz" + } + }, + "USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_EPISODE_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + }, + "USERINTEREST_WITH_INVALID_SEASONID_IN_PROGRAM_EPISODE_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": 123 + } + }, + "USERINTEREST_WITH_INVALID_SERIESID_AND_SEASONID_IN_PROGRAM_EPISODE_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/def", + "seriesId": 123, + "seasonId": 123 + } + }, + "USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_SEASON_ENTITY": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "season", + "entityId": "entity/klm", + "seriesId": 123, + "seasonId": "breaking-bad-season-1" + } + }, + "USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SERIESID": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "movie", + "entityId": "entity/klm", + "seriesId": "entity/hij" + } + }, + "USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SEASONID": { + "type": "interest", + "reason": "playlist", + "entity": { + "entityType": "program", + "programType": "movie", + "entityId": "entity/def", + "seasonId": "entity/klm" + } + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { + "type": "interest", + "reason": "reaction" + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { + "type": "interest", + "reason": "playlist" + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING": { + "type": "interest", + "reason": "recording" + }, + "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION": { + "type": "disinterest", + "reason": "reaction" + }, + "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { + "type": "disinterest", + "reason": "playlist" + }, + "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING": { + "type": "disinterest", + "reason": "recording" + }, + "REQUESTUSERINTEREST_WITH_INVALID_INTERESTTYPE": { + "type": "test", + "reason": "playlist" + }, + "REQUESTUSERINTEREST_WITH_BOOLEAN_INTERESTTYPE": { + "type": true, + "reason": "playlist" + }, + "REQUESTUSERINTEREST_WITH_INVALID_REASONTYPE": { + "type": "interest", + "reason": "test" + }, + "REQUESTUSERINTEREST_WITH_BOOLEAN_REASONTYPE": { + "type": "interest", + "reason": true + }, + "TYPE_INTEREST_REASON_PLAYLIST": { + "correlationId": "xyz", + "parameters": { + "type": "interest", + "reason": "playlist" + } + }, + "TYPE_INTEREST_REASON_REACTION": { + "correlationId": "xyz", + "parameters": { + "type": "interest", + "reason": "reaction" + } + }, + "TYPE_INTEREST_REASON_RECORDING": { + "correlationId": "xyz", + "parameters": { + "type": "interest", + "reason": "recording" + } + }, + "TYPE_DISINTEREST_REASON_PLAYLIST": { + "correlationId": "xyz", + "parameters": { + "type": "disinterest", + "reason": "playlist" + } + }, + "TYPE_DISINTEREST_REASON_REACTION": { + "correlationId": "xyz", + "parameters": { + "type": "disinterest", + "reason": "reaction" + } + }, + "TYPE_DISINTEREST_REASON_RECORDING": { + "correlationId": "xyz", + "parameters": { + "type": "disinterest", + "reason": "recording" + } + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST": { + "InterestType": "interest" + }, + "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST": { + "InterestType": "disinterest" + }, + "USERINTEREST_WITH_INVALID_MUSICTYPE_FOR_MUSIC_ENTITY_WITH_ALBUMID": { + "InterestType": "interest", + "entity": { + "entityType": "music", + "musicType": "album", + "entityId": "song/xyz", + "albumId": "album/xyz" + } + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_RESPONSE": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } } \ No newline at end of file From 393907547f958b81d614ff08e25fd100e46a628a Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Mon, 20 May 2024 11:19:37 +0530 Subject: [PATCH 044/359] FIRECERT-2075 Addressed review comments --- .../LifecycleBackground.feature | 10 +++++----- .../LifecycleConfigurations.feature | 4 ++-- .../LifecycleInactive.feature | 4 ++-- .../LifecycleInitializing.feature | 2 +- .../LifecycleSuspended.feature | 20 +++++++++---------- .../LifecycleUnloading.feature | 14 ++++++------- .../support/step_definitions/fireboltCalls.js | 1 - 7 files changed, 27 insertions(+), 28 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature index ccb96eaa..143db4c9 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature @@ -7,7 +7,7 @@ Feature: Lifecycle_Background Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with '' state When '3rd party app' transitions to state 'background' - Then '3rd party app' is in 'background' state + Then '3rd party app' will be in 'background' state Examples: | state | @@ -35,7 +35,7 @@ Feature: Lifecycle_Background Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'background' state When '3rd party app' transitions to state 'background' - Then '3rd party app' is in 'background' state + Then '3rd party app' will stay in 'background' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 2.4.3 Cannot Background app in Unloading state @@ -43,18 +43,18 @@ Feature: Lifecycle_Background And 3rd party 'certification' app is launched with 'unloading' state When '3rd party app' transitions to state 'background' And AppObject state for '3rd party App' is set to 'unloading' - Then '3rd party app' is in 'unloading' state + Then '3rd party app' will be in 'unloading' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 2.4.3 Cannot background app from suspended state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When '3rd party app' transitions to state 'background' - Then '3rd party app' is in 'suspended' state + Then '3rd party app' will be in 'suspended' state @Lifecycle @coreSDK Scenario: Lifecycle 2.4.3 Should not Background app in initializing state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'initializing' state When '3rd party app' transitions to state 'background' - Then '3rd party app' is in 'initializing' state \ No newline at end of file + Then '3rd party app' will be in 'initializing' state \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleConfigurations.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleConfigurations.feature index f29a053f..b3c57d15 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleConfigurations.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleConfigurations.feature @@ -7,7 +7,7 @@ Feature: Lifecycle_Configuration # And firebolt config 'Lifecycle.appReadyTimeout' is set to to 5 'seconds' And 3rd party 'certification' app is launched with 'initializing' state # And Test runner waits for 5 'seconds' - Then '3rd party app' is in 'terminated' state + Then '3rd party app' will be in 'terminated' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 6.2 appFinishedTimeout exceeded @@ -15,7 +15,7 @@ Feature: Lifecycle_Configuration # And firebolt config 'Lifecycle.appReadyTimeout' is set to to 5 'seconds' And 3rd party 'certification' app is launched with 'unloading' state # And Test runner waits for 10 'seconds' - Then '3rd party app' is in 'terminated' state + Then '3rd party app' will be in 'terminated' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 6.2 appFinishedTimeout data type diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInactive.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInactive.feature index 86b1454b..17c2df93 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInactive.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInactive.feature @@ -7,7 +7,7 @@ Feature: Lifecycle_Inactive Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with '' state When '3rd party app' transitions to state 'inactive' - Then '3rd party app' is in 'inactive' state + Then '3rd party app' will be in 'inactive' state Examples: | state | | foreground | @@ -20,5 +20,5 @@ Feature: Lifecycle_Inactive # And 1st party app invokes the API to 'get lifecycle management state' When '3rd party app' invokes the 'Firebolt' API to 'close app with remote button' # And 1st party app invokes the API to 'get lifecycle management state' - Then '3rd party app' is in 'inactive' state + Then '3rd party app' will stay in 'inactive' state # Then 'Firebolt' platform responds with 'last two responses for lifecycleManagement state' \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInitializing.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInitializing.feature index b4b00fc6..15ada78b 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInitializing.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInitializing.feature @@ -9,7 +9,7 @@ Feature: Lifecycle_Initializing # And 1st party app invokes the API to 'get lifecycle management state' When '3rd party app' invokes the 'Firebolt' API to 'close app with remote button' Then 'Firebolt' platform responds with 'null for lifecycle close' - And '3rd party app' is in 'initializing' state + And '3rd party app' will stay in 'initializing' state # And 1st party app invokes the API to 'get lifecycle management state' # Then 'Firebolt' platform responds with 'message and code for lifecycle close' # Then 'Firebolt' platform responds with 'last two responses for lifecycleManagement state' \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature index 26ecb1af..16d1f284 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature @@ -11,7 +11,7 @@ Feature: Lifecycle_Suspended Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'inactive' state When '3rd party app' transitions to state 'suspended' - Then '3rd party app' is in 'suspended' state + Then '3rd party app' will be in 'suspended' state @Lifecycle @coreSDK @notSupported @needsFurtherInformation Scenario: Lifecycle 2.2.4 Relaunch a previously Suspended app after Unsuspend @@ -19,35 +19,35 @@ Feature: Lifecycle_Suspended And 3rd party 'certification' app is launched with 'suspended' state When '3rd party app' transitions to state 'inactive' Then '3rd party app' transitions to state 'foreground' - Then '3rd party app' is in 'foreground' state + Then '3rd party app' will be in 'foreground' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 2.5.3 Cannot Suspend a suspended App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When '3rd party app' transitions to state 'suspended' - Then '3rd party app' is in 'suspended' state + Then '3rd party app' will stay in 'suspended' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 2.5.1 Cannot Suspend a unloaded App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'unloaded' state When '3rd party app' transitions to state 'suspended' - Then '3rd party app' is in 'unloaded' state + Then '3rd party app' will stay in 'unloaded' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 2.5.5 Cannot relaunch Suspended App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When 3rd party 'certification' app is launched - Then '3rd party app' is in 'suspended' state + Then '3rd party app' will stay in 'suspended' state @Lifecycle @coreSDK @notSupported Scenario Outline: Lifecycle 2.5.2 Cannot Suspend app Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with '' state When '3rd party app' transitions to state 'suspended' - Then '3rd party app' is in '' state + Then '3rd party app' will be in '' state Examples: | state | @@ -61,7 +61,7 @@ Feature: Lifecycle_Suspended # And 1st party app invokes the API to 'get lifecycle management state' And '3rd party app' invokes the 'Firebolt' API to 'close app with remote button' # And 1st party app invokes the API to 'get lifecycle management state' - Then '3rd party app' is in 'suspended' state + Then '3rd party app' will stay in 'suspended' state # Then 'Firebolt' platform responds with 'last two responses for lifecycleManagement state' Then 'Firebolt' platform responds with 'message and code for lifecycle close' @@ -70,7 +70,7 @@ Feature: Lifecycle_Suspended Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When '3rd party app' transitions to state 'inactive' - Then '3rd party app' is in 'inactive' state + Then '3rd party app' will be in 'inactive' state @Lifecycle @coreSDK @notSupported Scenario Outline: Lifecycle 2.6.1 Cannot Unsuspend in State @@ -79,7 +79,7 @@ Feature: Lifecycle_Suspended # And 1st party app invokes the API to 'get lifecycle management state' And '3rd party app' invokes the 'Firebolt' API to 'unsuspend app' # And 1st party app invokes the API to 'get lifecycle management state' - Then '3rd party app' is in '' state + Then '3rd party app' will stay in '' state # Then 'Firebolt' platform responds with 'message and code for lifecycle unsuspend' Examples: @@ -97,7 +97,7 @@ Feature: Lifecycle_Suspended # And 1st party app invokes the API to 'get lifecycle management state' And '3rd party app' invokes the 'Firebolt' API to 'unsuspend app' # And 1st party app invokes the API to 'get lifecycle management state' - Then '3rd party app' is in 'unloaded' state + Then '3rd party app' will stay in 'unloaded' state # Then 'Firebolt' platform responds with 'message and code for lifecycle unsuspend' # Then 'Firebolt' platform responds with 'last two responses for lifecycleManagement state' diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature index 008417ca..c38a0ae9 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature @@ -8,21 +8,21 @@ Feature: Lifecycle_Unloading When 3rd party 'certification' app is launched with 'unloading' state Then '3rd party app' invokes the 'Firebolt' API to 'call lifecycle finished' And '3rd party app' invokes the 'Firebolt' API to 'call lifecycle finished and expects error' - Then '3rd party app' is in 'unloaded' state + Then '3rd party app' will stay in 'unloaded' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 2.7.1 Unloading from Inactive state Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with 'inactive' state Then '3rd party app' transitions to state 'unloading' - Then '3rd party app' is in 'unloading' state + Then '3rd party app' will be in 'unloading' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 2.3.2 Cannot Close an Unloading App Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with 'unloading' state Then '3rd party app' transitions to state 'inactive' - Then '3rd party app' is in 'unloading' state + Then '3rd party app' will stay in 'unloading' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 3.4.3 finished from unloading state @@ -30,14 +30,14 @@ Feature: Lifecycle_Unloading # And firebolt config 'Lifecycle.appFinishedTimeout' is set to to 60 'seconds' When 3rd party 'certification' app is launched with 'unloading' state Then '3rd party app' transitions to state 'unloaded' - Then '3rd party app' is in 'unloaded' state + Then '3rd party app' will stay in 'unloaded' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 2.7.2 Should not unload from active state (foreground) Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with 'foreground' state # When 1st party app invokes the API to 'call lifecycleManagement unload expecting error' - Then '3rd party app' is in 'foreground' state + Then '3rd party app' will stay in 'foreground' state # Then 'Firebolt' platform responds with 'message and code for lifecycle unload' @Lifecycle @coreSDK @notSupported @@ -47,7 +47,7 @@ Feature: Lifecycle_Unloading # And 1st party app invokes the API to 'get lifecycle management state' Then '3rd party app' invokes the 'Firebolt' API to 'call lifecycle suspend and expects error' # And 1st party app invokes the API to 'get lifecycle management state' - Then '3rd party app' is in 'unloaded' state + Then '3rd party app' will stay in 'unloaded' state # Then 'Firebolt' platform responds with 'message and code for lifecycle suspend' # And 'Firebolt' platform responds with 'last two responses for lifecycleManagement state' @@ -56,7 +56,7 @@ Feature: Lifecycle_Unloading Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with '' state When '3rd party app' invokes the 'Firebolt' API to 'call lifecycle finished and expects error' - Then '3rd party app' is in '' state + Then '3rd party app' will stay in '' state # Then 'Firebolt' platform responds with 'message and code for lifecycle finished' Examples: | state | diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 12a0a61f..7ffa821d 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -133,7 +133,6 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE ) { cy.fetchLifecycleHistory(appId); - cy.setAppObjectStateFromMethod(method, appId); } const communicationMode = UTILS.getCommunicationMode(); const additionalParams = { From 2968fcaa9a399c41ba85699234198f1ba23891ba Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Mon, 20 May 2024 15:04:55 +0530 Subject: [PATCH 045/359] FIRECERT-2068 - retain thunderProxy TCs to FCS --- .../FireboltCertification/Account.feature | 14 +++++- .../FireboltCertification/Device.feature | 16 +++---- .../Manage/HdmiInput.feature | 43 +++++++++++++++++- .../SecondScreen.feature | 23 +++++++--- cypress/fixtures/fireboltCalls/device.json | 24 ++++++++++ .../fixtures/fireboltCalls/secondscreen.json | 8 ++++ cypress/fixtures/modules/device.json | 44 ++++++++++++++++++- cypress/fixtures/modules/secondscreen.json | 15 +++++++ .../objects/validationObjects/device.json | 18 ++++---- .../support/step_definitions/fireboltCalls.js | 12 +++++ 10 files changed, 192 insertions(+), 25 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Account.feature b/cypress/TestCases/FireboltCertification/Account.feature index 8f061e8e..108c3aaf 100644 --- a/cypress/TestCases/FireboltCertification/Account.feature +++ b/cypress/TestCases/FireboltCertification/Account.feature @@ -12,4 +12,16 @@ Feature: Account Examples: | Scenario | API_Key | Validation_key | method | | Validate account ID | fetch account ID | account id | id | - | Validate account UID | fetch account UID | account uid | uid | \ No newline at end of file + | Validate account UID | fetch account UID | account uid | uid | + + @Account @coreSDK @sdk @transport @notSupported + Scenario Outline: Account. - Negative Scenario: + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + + Examples: + | Scenario | API_Key | Validation_key | method | + | Account ID Device not provisioned | fetch account ID when device is not provisioned | invalid parameter error for account id | id | + | Account UID Device not provisioned | fetch account UID when device is not provisioned | invalid parameter error for account uid | uid | + | Account ID Account retrieval attempt | fetch account ID when account is not provisioned | invalid parameter error for account id | id | + | Account UID Account retrieval attempt | fetch account UID when account is not provisioned | invalid parameter error for account uid | uid | \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Device.feature b/cypress/TestCases/FireboltCertification/Device.feature index f0e6651a..cac42fa4 100644 --- a/cypress/TestCases/FireboltCertification/Device.feature +++ b/cypress/TestCases/FireboltCertification/Device.feature @@ -58,12 +58,12 @@ Feature: Device Then 'Firebolt' platform responds with '' When User triggers event with value as '' Then 'Firebolt' platform triggers event '' - + Examples: - | Scenario | Method_Validation_Key | Event_Validation_Key | - | Validate network_wifi_connected | device network as wifi connected | onNetworkChanged with wifi connected | - | Validate network_wifi_disconnected | device network as wifi disconnected | onNetworkChanged with wifi disconnected | - | Validate network_Ethernet_connected | device network as ethernet connected | onNetworkChanged with ethernet connected | - | Validate network_Ethernet_disconnected | device network as ethernet disconnected | onNetworkChanged with ethernet disconnected | - | Validate network_Hybrid_connected | device network as hybrid connected | onNetworkChanged with hybrid connected | - | Validate network_Hybrid_disconnected | device network as hybrid disconnected | onNetworkChanged with hybrid disconnected | + | Scenario | Method_Validation_Key | Event_Validation_Key | Event_Params | + | Validate network_wifi_connected | device network as wifi connected | onNetworkChanged with wifi connected | onNetworkChanged events with wifi connected | + | Validate network_wifi_disconnected | device network as wifi disconnected | onNetworkChanged with wifi disconnected | onNetworkChanged events with wifi disconnected | + | Validate network_Ethernet_connected | device network as ethernet connected | onNetworkChanged with ethernet connected | onNetworkChanged events with ethernet connected | + | Validate network_Ethernet_disconnected | device network as ethernet disconnected | onNetworkChanged with ethernet disconnected | onNetworkChanged events with ethernet disconnected | + | Validate network_Hybrid_connected | device network as hybrid connected | onNetworkChanged with hybrid connected | onNetworkChanged events with hybrid connected | + | Validate network_Hybrid_disconnected | device network as hybrid disconnected | onNetworkChanged with hybrid disconnected | onNetworkChanged events with hybrid disconnected | diff --git a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature index e461e04d..3f99396e 100644 --- a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature +++ b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature @@ -150,4 +150,45 @@ Feature: HdmiInput_Manage When 1st party app invokes the 'Firebolt' API to 'set edidVersion to 1.4' And 1st party app invokes the 'Firebolt' API to 'set autoLowLatencyModeCapable with true' And 1st party app invokes the 'Firebolt' API to 'get hdmiinput port with error' - Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput port' \ No newline at end of file + Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput port' + + ## ThunderProxy scenario. + @HdmiInput @sdk @thunderProxy @notsupported + Scenario Outline: HdmiInput. - Positive Scenario: Validate + When 1st party app registers for the '' event using the 'Firebolt' API + And 1st party app invokes the 'Firebolt' API to 'get hdmiinput port with portId HDMI1' + Then 'Firebolt' platform responds to '1st party app' with '' + When User triggers event with value as '' + Then 'Firebolt' platform triggers event '' + + Examples: + | Scenario | Event | Event_Key | Method_content | Event_Validation_Key | + | Hdmi1 - connected true | onConnectionChanged | hdmiinput onConnectionChanged | true for hdmiinput port connected | true for hdmiinput onConnectionChanged event | + | Hdmi1 - connected false | onConnectionChanged | hdmiinput onConnectionChanged | false for hdmiinput port connected | false for hdmiinput onConnectionChanged event | + | Hdmi1 - signal unknown | onSignalChanged | hdmiinput onSignalChanged | unknown for hdmiinput port signal | unknown for hdmiinput onSignalChanged event | + | Hdmi1 - signal none | onSignalChanged | hdmiinput onSignalChanged | none for hdmiinput port signal | none for hdmiinput onSignalChanged event | + | Hdmi1 - signal stable | onSignalChanged | hdmiinput onSignalChanged | stable for hdmiinput port signal | stable for hdmiinput onSignalChanged event | + | Hdmi1 - signal unstable | onSignalChanged | hdmiinput onSignalChanged | unstable for hdmiinput port signal | unstable for hdmiinput onSignalChanged event | + | Hdmi1 - signal unsupported | onSignalChanged | hdmiinput onSignalChanged | unsupported for hdmiinput port signal | unsupported for hdmiinput onSignalChanged event | + | Hdmi1 - autoLowLatencyModeSignalled true | onAutoLowLatencyModeSignalChanged | hdmiinput onAutoLowLatencyModeSignalChanged | true for hdmiinput port autoLowLatencyModeSignalled | true for hdmiinput onAutoLowLatencyModeSignalChanged event | + | Hdmi1 - autoLowLatencyModeSignalled false | onAutoLowLatencyModeSignalChanged | hdmiinput onAutoLowLatencyModeSignalChanged | false for hdmiinput port autoLowLatencyModeSignalled | false for hdmiinput onAutoLowLatencyModeSignalChanged event | + + ## ThunderProxy scenario. + # Needs to confirm whether the event gets triggered + @HdmiInput @sdk @thunderProxy @notsupported + Scenario Outline: HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - hdmiinput.open + When 1st party app registers for the 'hdmiinput onConnectionChanged' event using the 'Firebolt' API + And 1st party app invokes the 'Firebolt' API to 'open HDMI1 port' + Then 'Firebolt' platform responds to '1st party app' with 'null for hdmi input open' + When User triggers event with value as '' + Then 'Firebolt' platform triggers event 'true for hdmiinput onConnectionChanged event' + + ## ThunderProxy scenario. + # Needs to confirm whether the event gets triggered + @HdmiInput @sdk @thunderProxy @notsupported + Scenario Outline: HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - hdmiinput.close + When 1st party app registers for the 'hdmiinput onConnectionChanged' event using the 'Firebolt' API + And 1st party app invokes the 'Firebolt' API to 'close HDMI port' + Then 'Firebolt' platform responds to '1st party app' with 'null for hdmi input close' + When User triggers event with value as '' + Then 'Firebolt' platform triggers event 'false for hdmiinput onConnectionChanged event' \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/SecondScreen.feature b/cypress/TestCases/FireboltCertification/SecondScreen.feature index 63f65a0a..70e25a07 100644 --- a/cypress/TestCases/FireboltCertification/SecondScreen.feature +++ b/cypress/TestCases/FireboltCertification/SecondScreen.feature @@ -39,16 +39,29 @@ Feature: Secondscreen Given '3rd party app' registers for the 'secondscreen onFriendlyNameChanged' event using the 'Firebolt' API And I clear 'secondscreen onFriendlyNameChanged event' listeners And 1st party app invokes the 'Firebolt' API to 'set friendlyName to guest room' - Then 'Firebolt' platform responds to '1st party app' with 'null for device setName' + Then 'Firebolt' platform responds to '1st party app' for 'set friendlyName to guest room' And 'Firebolt' platform does not trigger event for 'onFriendlyNameChanged' + @Secondscreen @coreSDK @regression @sdk @notSupported + Scenario Outline: Secondscreen. - Positive Scenario: Validating event name in response + When '3rd party app' registers for the '' event using the 'Firebolt' API + And User triggers event with value as '' + Then 'Firebolt' platform responds with '' + + Examples: + | EventName | RegisteredEvent | Event_Validation_Key | EventParams | + | onLaunchRequest | secondscreen onLaunchRequest | expected secondscreen onLaunchRequest event | onLaunchRequest event | + | onLaunchRequest | secondscreen onLaunchRequest | expected secondscreen onLaunchRequest event | onLaunchRequest event | + | onCloseRequest | secondscreen onCloseRequest | expected secondscreen onCloseRequest event | onCloseRequest event | + | onCloseRequest | secondscreen onCloseRequest | expected secondscreen onCloseRequest event | onCloseRequest event | + @Secondscreen @coreSDK @regression @sdk @notSupported Scenario Outline: Secondscreen. - Positive Scenario: Validating event Clearing listeners When '3rd party app' registers for the '' event using the 'Firebolt' API And I clear '' listeners - # Then User triggers event with value as '' + Then User triggers event with value as '' Then 'Firebolt' platform does not trigger event for '' Examples: - | Event_Name | Registered_Event | Clear_Event_Name | Event_Validation_Key | - | onLaunchRequest | secondscreen onLaunchRequest | secondscreen onLaunchRequest event | null for secondscreen onLaunchRequest event | - | onCloseRequest | secondscreen onCloseRequest | secondscreen onCloseRequest event | null for secondscreen onCloseRequest event | + | Event_Name | Registered_Event | Clear_Event_Name | Event_Validation_Key | Event_Params | + | onLaunchRequest | secondscreen onLaunchRequest | secondscreen onLaunchRequest event | null for secondscreen onLaunchRequest event | onLaunchRequest event | + | onCloseRequest | secondscreen onCloseRequest | secondscreen onCloseRequest event | null for secondscreen onCloseRequest event | onCloseRequest event | diff --git a/cypress/fixtures/fireboltCalls/device.json b/cypress/fixtures/fireboltCalls/device.json index 0f17103a..1e50d377 100644 --- a/cypress/fixtures/fireboltCalls/device.json +++ b/cypress/fixtures/fireboltCalls/device.json @@ -369,5 +369,29 @@ "EXPECT_ERROR_FOR_DEVICE_MODEL": { "method": "device.model", "expected": "error" + }, + "ONNETWORKCHANGED_EVENTS_WITH_WIFI_CONNECTED": { + "method": "device.onNetworkChanged", + "params": "DEVICE_ONNETWORKCHANGED_WIFICONNECT_EVENTS" + }, + "ONNETWORKCHANGED_EVENTS_WITH_WIFI_DISCONNECTED": { + "method": "device.onNetworkChanged", + "params": "DEVICE_ONNETWORKCHANGED_WIFIDISCONNECT_EVENTS" + }, + "ONNETWORKCHANGED_EVENTS_WITH_ETHERNET_CONNECTED": { + "method": "device.onNetworkChanged", + "params": "DEVICE_ONNETWORKCHANGED_ETHERNETCONNECT_EVENTS" + }, + "ONNETWORKCHANGED_EVENTS_WITH_ETHERNET_DISCONNECTED": { + "method": "device.onNetworkChanged", + "params": "DEVICE_ONNETWORKCHANGED_ETHERNETDISCONNECT_EVENTS" + }, + "ONNETWORKCHANGED_EVENTS_WITH_HYBRID_CONNECTED": { + "method": "device.onNetworkChanged", + "params": "DEVICE_ONNETWORKCHANGED_HYBRIDCONNECT_EVENTS" + }, + "ONNETWORKCHANGED_EVENTS_WITH_HYBRID_DISCONNECTED": { + "method": "device.onNetworkChanged", + "params": "DEVICE_ONNETWORKCHANGED_HYBRIDDISCONNECT_EVENTS" } } \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/secondscreen.json b/cypress/fixtures/fireboltCalls/secondscreen.json index 377ccac1..6bf61d25 100644 --- a/cypress/fixtures/fireboltCalls/secondscreen.json +++ b/cypress/fixtures/fireboltCalls/secondscreen.json @@ -101,5 +101,13 @@ "event": "secondscreen.onCloseRequest", "validationJsonPath": "eventResponse", "expected": "SECONDSCREEN_ONCLOSEREQUEST" + }, + "ONLAUNCHREQUEST_EVENT": { + "method": "secondscreen.onLaunchRequest", + "params": "SECONDSCREEN_ONLAUNCHREQUEST_EVENT" + }, + "ONCLOSEREQUEST_EVENT": { + "method": "secondscreen.onCloseRequest", + "params": "SECONDSCREEN_ONCLOSEREQUEST_EVENT" } } \ No newline at end of file diff --git a/cypress/fixtures/modules/device.json b/cypress/fixtures/modules/device.json index 715838e0..06585a8b 100644 --- a/cypress/fixtures/modules/device.json +++ b/cypress/fixtures/modules/device.json @@ -55,5 +55,47 @@ "state": "disconnected", "type": "ethernet" }, - "NAME_BEDROOM": "Bedroom" + "NAME_BEDROOM": "Bedroom", + "ONNETWORKCHANGED_WIFICONNECT_EVENTS": { + "method": "device.onNetworkChanged", + "result": { + "state": "connected", + "type": "wifi" + } + }, + "ONNETWORKCHANGED_WIFIDISCONNECT_EVENTS": { + "method": "device.onNetworkChanged", + "result": { + "state": "disconnected", + "type": "wifi" + } + }, + "ONNETWORKCHANGED_ETHERNETCONNECT_EVENTS": { + "method": "device.onNetworkChanged", + "result": { + "state": "connected", + "type": "ethernet" + } + }, + "ONNETWORKCHANGED_ETHERNETDISCONNECT_EVENTS": { + "method": "device.onNetworkChanged", + "result": { + "state": "disconnected", + "type": "ethernet" + } + }, + "ONNETWORKCHANGED_HYBRIDCONNECT_EVENTS": { + "method": "device.onNetworkChanged", + "result": { + "state": "connected", + "type": "ethernet" + } + }, + "ONNETWORKCHANGED_HYBRIDDISCONNECT_EVENTS": { + "method": "device.onNetworkChanged", + "result": { + "state": "disconnected", + "type": "ethernet" + } + } } \ No newline at end of file diff --git a/cypress/fixtures/modules/secondscreen.json b/cypress/fixtures/modules/secondscreen.json index 459ee18d..ee5bd0ce 100644 --- a/cypress/fixtures/modules/secondscreen.json +++ b/cypress/fixtures/modules/secondscreen.json @@ -18,5 +18,20 @@ "ONCLOSEREQUEST_TYPE_DIAL": { "type": "dial", "version": "1.7" + }, + "ONLAUNCHREQUEST_EVENT": { + "method": "secondscreen.onLaunchRequest", + "result":{ + "type": "dial", + "version": "1.7", + "data": "{\"code\":\"AQDPQZiQcb3KQ7gY7yy5tHTMbbkGHR9Zjp-KL53H3eKBZIeAt7O9UKYPu6B21l2UZVmIqkFXDXBmXvK4g2e3EgZtjMNmKPsTltgnRl95DImtOXjSpWtTjSaOkW4w1kZKUTwLKdwVWTzBVH8ERHorvLU6vCGOVHxXt65LNwdl5HKRweShVC1V9QsyvRnQS61ov0UclmrH_xZML2Bt-Q-rZFjey5MjwupIb4x4f53XUJMhjHpDHoIUKrjpdPDQvK2a\",\"friendlyName\":\"Operator_TX061AEI\",\"UDN\":\"608fef11-2800-482a-962b-23a6690c93c1\"}" + } + }, + "ONCLOSEREQUEST_EVENT": { + "method": "secondscreen.onCloseRequest", + "result":{ + "type": "dial", + "version": "1.7" + } } } \ No newline at end of file diff --git a/cypress/fixtures/objects/validationObjects/device.json b/cypress/fixtures/objects/validationObjects/device.json index ff763c4b..58529898 100644 --- a/cypress/fixtures/objects/validationObjects/device.json +++ b/cypress/fixtures/objects/validationObjects/device.json @@ -318,7 +318,7 @@ } ] }, - "NETWORK_WIFICONNECTED": { + "DEVICE_NETWORK_WIFICONNECTED": { "method": "device.network", "data": [ { @@ -333,7 +333,7 @@ } ] }, - "NETWORK_WIFIDISCONNECTED": { + "DEVICE_NETWORK_WIFIDISCONNECTED": { "method": "device.network", "data": [ { @@ -348,7 +348,7 @@ } ] }, - "NETWORK_ETHERNETCONNECTED": { + "DEVICE_NETWORK_ETHERNETCONNECTED": { "method": "device.network", "data": [ { @@ -363,7 +363,7 @@ } ] }, - "NETWORK_ETHERNETDISCONNECTED": { + "DEVICE_NETWORK_ETHERNETDISCONNECTED": { "method": "device.network", "data": [ { @@ -378,7 +378,7 @@ } ] }, - "NETWORK_HYBRIDCONNECTED": { + "DEVICE_NETWORK_HYBRIDCONNECTED": { "method": "device.network", "data": [ { @@ -393,7 +393,7 @@ } ] }, - "NETWORK_HYBRIDDISCONNECTED": { + "DEVICE_NETWORK_HYBRIDDISCONNECTED": { "method": "device.network", "data": [ { @@ -408,7 +408,7 @@ } ] }, - "NETWORK_WIFIDISCONNECTED_EVENT": { + "DEVICE_NETWORK_WIFIDISCONNECTED_EVENT": { "method": "device.network", "data": [ { @@ -423,7 +423,7 @@ } ] }, - "NETWORK_ETHERNETDISCONNECTED_EVENT": { + "DEVICE_NETWORK_ETHERNETDISCONNECTED_EVENT": { "method": "device.network", "data": [ { @@ -438,7 +438,7 @@ } ] }, - "NETWORKHYBRIDDISCONNECTED_EVENT": { + "DEVICE_NETWORKHYBRIDDISCONNECTED_EVENT": { "method": "device.network", "data": [ { diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 12a0a61f..1aa8cf9a 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -409,3 +409,15 @@ Given(/I clear '(.+)' listeners$/, async (key) => { }); }); }); + +/** + * @module fireboltCalls + * @function User triggers event with value '{}}' + * @description sending message to platform to make post call to set values. + * @param {String} key - Name of event to be called. + * @example + * And User triggers event with value as ' DEVICE_ONHDCPCHANGED_EVENTS' + */ +Given(/User triggers event with value as '(.+)'/, (key) => { + throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING) +}); From 5680a205aaa8d3adab5ffcddc0ca4557451c886b Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Mon, 20 May 2024 15:19:59 +0530 Subject: [PATCH 046/359] lint error --- cypress/support/step_definitions/fireboltCalls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 1aa8cf9a..c2b295f8 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -419,5 +419,5 @@ Given(/I clear '(.+)' listeners$/, async (key) => { * And User triggers event with value as ' DEVICE_ONHDCPCHANGED_EVENTS' */ Given(/User triggers event with value as '(.+)'/, (key) => { - throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING) + throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); }); From 491c68c27c6c312bc81fba4cd9be035ff0cbe9c7 Mon Sep 17 00:00:00 2001 From: Preethi M R <102140979+PreethiMaai@users.noreply.github.com> Date: Mon, 20 May 2024 17:44:26 +0530 Subject: [PATCH 047/359] Added comment for thunderproxy scenarios --- .../FireboltCertification/Manage/HdmiInput.feature | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature index 3f99396e..3e87db7c 100644 --- a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature +++ b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature @@ -153,6 +153,7 @@ Feature: HdmiInput_Manage Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput port' ## ThunderProxy scenario. + # Event parameters are not added yet as they are not known. @HdmiInput @sdk @thunderProxy @notsupported Scenario Outline: HdmiInput. - Positive Scenario: Validate When 1st party app registers for the '' event using the 'Firebolt' API @@ -174,7 +175,7 @@ Feature: HdmiInput_Manage | Hdmi1 - autoLowLatencyModeSignalled false | onAutoLowLatencyModeSignalChanged | hdmiinput onAutoLowLatencyModeSignalChanged | false for hdmiinput port autoLowLatencyModeSignalled | false for hdmiinput onAutoLowLatencyModeSignalChanged event | ## ThunderProxy scenario. - # Needs to confirm whether the event gets triggered + # Needs to confirm whether the event gets triggered. Event parameters are not added yet as they are not known. @HdmiInput @sdk @thunderProxy @notsupported Scenario Outline: HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - hdmiinput.open When 1st party app registers for the 'hdmiinput onConnectionChanged' event using the 'Firebolt' API @@ -184,11 +185,11 @@ Feature: HdmiInput_Manage Then 'Firebolt' platform triggers event 'true for hdmiinput onConnectionChanged event' ## ThunderProxy scenario. - # Needs to confirm whether the event gets triggered + # Needs to confirm whether the event gets triggered. Event parameters are not added yet as they are not known. @HdmiInput @sdk @thunderProxy @notsupported Scenario Outline: HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - hdmiinput.close When 1st party app registers for the 'hdmiinput onConnectionChanged' event using the 'Firebolt' API And 1st party app invokes the 'Firebolt' API to 'close HDMI port' Then 'Firebolt' platform responds to '1st party app' with 'null for hdmi input close' When User triggers event with value as '' - Then 'Firebolt' platform triggers event 'false for hdmiinput onConnectionChanged event' \ No newline at end of file + Then 'Firebolt' platform triggers event 'false for hdmiinput onConnectionChanged event' From 43d887b2014eb33a1fa477df1225c772fd9e59b7 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Tue, 21 May 2024 09:42:58 +0530 Subject: [PATCH 048/359] FIRECERT-2068 addressed review comments --- .../FireboltCertification/Manage/HdmiInput.feature | 9 +++------ cypress/support/constants/constants.js | 1 + cypress/support/step_definitions/fireboltCalls.js | 4 +++- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature index 3e87db7c..cdf0ca07 100644 --- a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature +++ b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature @@ -152,9 +152,8 @@ Feature: HdmiInput_Manage And 1st party app invokes the 'Firebolt' API to 'get hdmiinput port with error' Then 'Firebolt' platform responds to '1st party app' with 'Invalid parameters for hdmiInput port' - ## ThunderProxy scenario. # Event parameters are not added yet as they are not known. - @HdmiInput @sdk @thunderProxy @notsupported + @HdmiInput @manageSDK @sdk @notsupported Scenario Outline: HdmiInput. - Positive Scenario: Validate When 1st party app registers for the '' event using the 'Firebolt' API And 1st party app invokes the 'Firebolt' API to 'get hdmiinput port with portId HDMI1' @@ -174,9 +173,8 @@ Feature: HdmiInput_Manage | Hdmi1 - autoLowLatencyModeSignalled true | onAutoLowLatencyModeSignalChanged | hdmiinput onAutoLowLatencyModeSignalChanged | true for hdmiinput port autoLowLatencyModeSignalled | true for hdmiinput onAutoLowLatencyModeSignalChanged event | | Hdmi1 - autoLowLatencyModeSignalled false | onAutoLowLatencyModeSignalChanged | hdmiinput onAutoLowLatencyModeSignalChanged | false for hdmiinput port autoLowLatencyModeSignalled | false for hdmiinput onAutoLowLatencyModeSignalChanged event | - ## ThunderProxy scenario. # Needs to confirm whether the event gets triggered. Event parameters are not added yet as they are not known. - @HdmiInput @sdk @thunderProxy @notsupported + @HdmiInput @manageSDK @sdk @notsupported Scenario Outline: HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - hdmiinput.open When 1st party app registers for the 'hdmiinput onConnectionChanged' event using the 'Firebolt' API And 1st party app invokes the 'Firebolt' API to 'open HDMI1 port' @@ -184,9 +182,8 @@ Feature: HdmiInput_Manage When User triggers event with value as '' Then 'Firebolt' platform triggers event 'true for hdmiinput onConnectionChanged event' - ## ThunderProxy scenario. # Needs to confirm whether the event gets triggered. Event parameters are not added yet as they are not known. - @HdmiInput @sdk @thunderProxy @notsupported + @HdmiInput @manageSDK @sdk @notsupported Scenario Outline: HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - hdmiinput.close When 1st party app registers for the 'hdmiinput onConnectionChanged' event using the 'Firebolt' API And 1st party app invokes the 'Firebolt' API to 'close HDMI port' diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 5ad43997..9bb37766 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -404,6 +404,7 @@ module.exports = { ENV_SETUP_STATUS: 'environmentLaunched', APP_LAUNCH_STATUS: 'appLaunched', NO_EVENT_TRIGGERED: 'Expecting no event to be triggered from platform', + STEP_DEFINITION_NEEDS_TO_IMPLEMENT: 'Step definition needs to be implemented', }; function getSanityReportPath() { // Check if Cypress is defined, for cypress test context diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index c2b295f8..23a4404a 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -419,5 +419,7 @@ Given(/I clear '(.+)' listeners$/, async (key) => { * And User triggers event with value as ' DEVICE_ONHDCPCHANGED_EVENTS' */ Given(/User triggers event with value as '(.+)'/, (key) => { - throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); + cy.log(CONSTANTS.STEP_DEFINITION_NEEDS_TO_IMPLEMENT).then(() => { + throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); + }); }); From 09ac7f6f377144b6e4e8c503b0f6dfe97728f677 Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Tue, 21 May 2024 16:54:55 +0530 Subject: [PATCH 049/359] FIRECERT-2075-New updated with dev and addressed review comments --- .../LifecycleBackground.feature | 2 +- cypress/support/cypress-commands/lifecycle.js | 20 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature index 143db4c9..9b2ca6db 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature @@ -57,4 +57,4 @@ Feature: Lifecycle_Background Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'initializing' state When '3rd party app' transitions to state 'background' - Then '3rd party app' will be in 'initializing' state \ No newline at end of file + Then '3rd party app' will stay in 'initializing' state \ No newline at end of file diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 455a2957..d366f5a1 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -35,12 +35,14 @@ Cypress.Commands.add('lifecycleSetup', (appCallSign, state) => { if (Cypress.env(CONSTANTS.TEST_TYPE) == CONSTANTS.MODULE_NAMES.LIFECYCLE) { // create lifecycleAppObject to mimic all the state transition for an app and also go through the same state histories - const lifeCycleAppObject = new lifeCycleAppConfig(appId); - // set the state to initialising - lifeCycleAppObject.setAppObjectState(CONSTANTS.LIFECYCLE_STATES.INITIALIZING); - // store the lifecycleAppObject in global object and push it to a global list - Cypress.env(appId, lifeCycleAppObject); - Cypress.env(CONSTANTS.LIFECYCLE_APP_OBJECT_LIST).push(appId); + if (!Cypress.env(CONSTANTS.LIFECYCLE_APP_OBJECT_LIST).includes(appId)) { + const lifeCycleAppObject = new lifeCycleAppConfig(appId); + // set the state to initialising + lifeCycleAppObject.setAppObjectState(CONSTANTS.LIFECYCLE_STATES.INITIALIZING); + // store the lifecycleAppObject in global object and push it to a global list + Cypress.env(appId, lifeCycleAppObject); + Cypress.env(CONSTANTS.LIFECYCLE_APP_OBJECT_LIST).push(appId); + } if (state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { Cypress.env(CONSTANTS.APP_LIFECYCLE_HISTORY, []); @@ -211,7 +213,11 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent ); } else { // Else if lifecycle events expected, get app event data and app object event data - UTILS.assertWithRequirementLogs(pretext, appHistoryCount >= 1, true); + UTILS.assertWithRequirementLogs( + CONSTANTS.LIFECYCLE_NOTIFICATION_GENERATED, + appHistoryCount >= 1, + true + ); for (let eventIndex = 1; eventIndex <= appHistoryCount; eventIndex++) { const newAppEvent = appHistory[appHistory.length - eventIndex]; let appObjectEvent; From b8e1fe4cddd6604372bf98961af0ee10c5e46830 Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Tue, 21 May 2024 17:28:27 +0530 Subject: [PATCH 050/359] FIRECERT-2075-New updated with dev --- cypress/support/cypress-commands/lifecycle.js | 101 +++++++++++++++--- 1 file changed, 85 insertions(+), 16 deletions(-) diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index d366f5a1..d03fdabb 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -19,6 +19,7 @@ const CONSTANTS = require('../constants/constants'); const { _ } = Cypress; import UTILS from '../cypress-support/src/utils'; import lifeCycleAppConfig from '../../../Scripts/lifeCycleAppObject.js'; +const logger = require('../Logger')('lifecycle.js'); /** * @module lifecycle @@ -135,8 +136,8 @@ Cypress.Commands.add('setLifecycleState', (state, appId) => { }; cy.log(CONSTANTS.SET_LIFECYCLE_STATE_REQUEST + JSON.stringify(requestMap)).then(() => { cy.sendMessagetoPlatforms(requestMap).then((result) => { - if (result !== false) { - console.log(CONSTANTS.SET_APP_STATE + state); + if (result) { + logger.info(CONSTANTS.SET_APP_STATE + state); } }); }); @@ -205,8 +206,7 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent const appHistoryCount = appHistory.length - appHistoryPrevious.length; let pretext; // If no lifecycle events expected, validate app history value is also empty - if (isEventsExpected == false || state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { - UTILS.assertWithRequirementLogs( + if (isEventsExpected == false || state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { UTILS.assertWithRequirementLogs( CONSTANTS.LIFECYCLE_NOTIFICATION_GENERATED + lifecycleEventRequirementId?.event?.id[0], appHistoryCount >= 1, false @@ -214,7 +214,7 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent } else { // Else if lifecycle events expected, get app event data and app object event data UTILS.assertWithRequirementLogs( - CONSTANTS.LIFECYCLE_NOTIFICATION_GENERATED, + CONSTANTS.LIFECYCLE_NOTIFICATION_GENERATED + lifecycleEventRequirementId?.event?.id[0], appHistoryCount >= 1, true ); @@ -293,8 +293,8 @@ Cypress.Commands.add('invokeLifecycleApi', (appId, method, methodParams = null) try { errorObject = JSON.parse(response).report.error; } catch (error) { - cy.log(CONSTANTS.FAILED_TO_PARSE_LIEFECYCLE_ERROR).then(() => { - assert(false, CONSTANTS.FAILED_TO_PARSE_LIEFECYCLE_ERROR); + cy.log(CONSTANTS.FAILED_TO_PARSE_LIEFECYCLE_ERROR + response).then(() => { + assert(false, CONSTANTS.FAILED_TO_PARSE_LIEFECYCLE_ERROR + response); }); return false; } @@ -346,6 +346,7 @@ Cypress.Commands.add('setAppState', (state, appId) => { if (response) { cy.log(CONSTANTS.APP_RESPONSE + JSON.stringify(response)); } + appObject.setAppObjectState(state); cy.lifecycleSchemaChecks(response, state); // TODO: Checks for platform support }); @@ -355,6 +356,9 @@ Cypress.Commands.add('setAppState', (state, appId) => { currentAppState.state != CONSTANTS.LIFECYCLE_STATES.FOREGROUND ) { cy.launchApp((appType = CONSTANTS.CERTIFICATION), appId); + appObject.setAppObjectState(state); + } else { + appObject.setAppObjectState(state); } break; @@ -366,7 +370,9 @@ Cypress.Commands.add('setAppState', (state, appId) => { currentAppState.state != CONSTANTS.LIFECYCLE_STATES.INITIALIZING ) { // If current app state is not background, send message to platform to set app state to background - cy.setLifecycleState(state, appId); + cy.setLifecycleState(state, appId).then(() => { + appObject.setAppObjectState(state); + }); } break; @@ -379,6 +385,7 @@ Cypress.Commands.add('setAppState', (state, appId) => { if (response) { cy.log(CONSTANTS.APP_RESPONSE + JSON.stringify(response)); } + appObject.setAppObjectState(state); cy.lifecycleSchemaChecks(response, state); // TODO: Checks for platform support }); @@ -391,17 +398,73 @@ Cypress.Commands.add('setAppState', (state, appId) => { cy.setAppState(CONSTANTS.LIFECYCLE_STATES.FOREGROUND, appId); } // Finally, send message to platform to set app state to inactive - cy.setLifecycleState(state, appId); + cy.setLifecycleState(state, appId).then(() => { + appObject.setAppObjectState(state); + }); + } + break; + + // Set state to suspended + case CONSTANTS.LIFECYCLE_STATES.SUSPENDED: + // If current app state is not suspended or inactive, set app state to inactive first to comply with allowed transitions + if (currentAppState.state != CONSTANTS.LIFECYCLE_STATES.SUSPENDED) { + if (currentAppState.state != CONSTANTS.LIFECYCLE_STATES.INACTIVE) { + cy.setAppState(CONSTANTS.LIFECYCLE_STATES.INACTIVE, appId); + } + // Send lifecycle.suspend API call to 3rd party app + cy.invokeLifecycleApi(appId, CONSTANTS.LIFECYCLE_APIS.SUSPEND, {}).then((response) => { + if (response) { + cy.log(CONSTANTS.APP_RESPONSE + JSON.stringify(response)); + } + appObject.setAppObjectState(state); + cy.lifecycleSchemaChecks(response, state); + // TODO: Checks for platform support + }); + } + break; + + // Set state to unloading + case CONSTANTS.LIFECYCLE_STATES.UNLOADING: + // If current app state is initializing or null, set app state to inactive first + if (currentAppState.state !== CONSTANTS.LIFECYCLE_STATES.INACTIVE) { + cy.setAppState(CONSTANTS.LIFECYCLE_STATES.INACTIVE, appId); + } + // Send lifecycle.close API call to 3rd party app + cy.invokeLifecycleApi(appId, CONSTANTS.LIFECYCLE_APIS.CLOSE, { + reason: CONSTANTS.ERROR, + }).then((response) => { + if (response) { + cy.log(CONSTANTS.APP_RESPONSE + JSON.stringify(response)); + } + appObject.setAppObjectState(state); + cy.lifecycleSchemaChecks(response, state); + // TODO: Checks for platform support + // cy.fireBoltApi(LifecycleManagement.unload()) + }); + break; + + // Set state to unloaded/terminated + case CONSTANTS.LIFECYCLE_STATES.UNLOADED: + case CONSTANTS.LIFECYCLE_STATES.TERMINATED: + // If current app state is initializing or null, set app state to unloading first + if ( + currentAppState.state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING || + currentAppState.state == CONSTANTS.NULL + ) { + cy.setAppState(CONSTANTS.LIFECYCLE_STATES.UNLOADING, appId); + // Send lifecycle.finished API call to 3rd party app + cy.invokeLifecycleApi(appId, CONSTANTS.LIFECYCLE_APIS.FINISHED, {}).then((response) => { + if (response) { + cy.log(CONSTANTS.APP_RESPONSE + JSON.stringify(response)); + } + appObject.setAppObjectState(state); + }); } break; default: break; } - if (state != CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { - // Set app object state to provided state - appObject.setAppObjectState(state); - } }); /** @@ -418,7 +481,7 @@ Cypress.Commands.add('fetchLifecycleHistory', (appId) => { cy.log(CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + response); const historyValue = _.get(JSON.parse(response), 'report.result._history._value', null); _.isEmpty(historyValue) - ? console.log(CONSTANTS.APP_HISTORY_EMPTY) + ? logger.info(CONSTANTS.APP_HISTORY_EMPTY) : Cypress.env(CONSTANTS.APP_LIFECYCLE_HISTORY, historyValue); }); } catch (error) { @@ -460,7 +523,13 @@ Cypress.Commands.add('setAppObjectStateFromMethod', (method, appId) => { switch (method) { case CONSTANTS.LIFECYCLE_APIS.CLOSE.toLowerCase(): const appObject = Cypress.env(appId); - appObject.setAppObjectState(CONSTANTS.LIFECYCLE_STATES.INACTIVE); + if ( + appObject.getAppObjectState().state !== CONSTANTS.LIFECYCLE_STATES.UNLOADING && + appObject.getAppObjectState().state !== CONSTANTS.LIFECYCLE_STATES.SUSPENDED && + appObject.getAppObjectState().state !== CONSTANTS.LIFECYCLE_STATES.INITIALIZING + ) { + appObject.setAppObjectState(CONSTANTS.LIFECYCLE_STATES.INACTIVE); + } break; // Support for other methods can be added in future if needed default: @@ -484,4 +553,4 @@ Cypress.Commands.add('lifecycleSchemaChecks', (response, state) => { validationResponse: result.schemaValidationResult, }; cy.validationChecksForResponseAndSchemaResult(response, false, apiSchemaResult, false); -}); +}); \ No newline at end of file From 69edf7931181062baac9034e6c881c40316d2e29 Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Tue, 21 May 2024 17:33:52 +0530 Subject: [PATCH 051/359] FIRECERT-2075-New fixed lint issues --- cypress/support/cypress-commands/lifecycle.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index d03fdabb..cc5f5fbf 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -206,7 +206,8 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent const appHistoryCount = appHistory.length - appHistoryPrevious.length; let pretext; // If no lifecycle events expected, validate app history value is also empty - if (isEventsExpected == false || state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { UTILS.assertWithRequirementLogs( + if (isEventsExpected == false || state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { + UTILS.assertWithRequirementLogs( CONSTANTS.LIFECYCLE_NOTIFICATION_GENERATED + lifecycleEventRequirementId?.event?.id[0], appHistoryCount >= 1, false @@ -553,4 +554,4 @@ Cypress.Commands.add('lifecycleSchemaChecks', (response, state) => { validationResponse: result.schemaValidationResult, }; cy.validationChecksForResponseAndSchemaResult(response, false, apiSchemaResult, false); -}); \ No newline at end of file +}); From a40e920e22f18e64b118f69fc836936c4b3c4fd9 Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Tue, 21 May 2024 17:38:44 +0530 Subject: [PATCH 052/359] FIRECERT-2075-New addressed review comments --- .../LifecycleTestcases/LifecycleTerminated.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature index 74f1b7c1..70b1b0fd 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature @@ -5,7 +5,7 @@ Feature: Lifecycle_Terminated Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with '' state Then '3rd party app' transitions to state 'terminated' - Then '3rd party app' will stay in 'terminated' state + Then '3rd party app' will be in 'terminated' state Examples: | state | From dc58cd87a0a5e387c9aa4794cd0780c1c55f70d1 Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Tue, 21 May 2024 20:51:44 +0530 Subject: [PATCH 053/359] FIRECERT-2075-New updated history validation log in utils.js --- cypress/support/cypress-support/src/utils.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index cecd8fea..ebe4d8c7 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -443,8 +443,17 @@ function assertWithRequirementLogs(pretext, actual, expected, equateDeep = false assert(false, pretext + ': ' + JSON.stringify(errorObject)); }); } else { + let expectedLog = expected; + let actualLog = actual; + if (Array.isArray(actual) && actual.length < 1) { + actualLog = JSON.stringify(actual); + } + if (Array.isArray(expected) && expected.length < 1) { + expectedLog = JSON.stringify(expected); + } + cy.log( - pretext + ': Expected : ' + expected + ' , Actual : ' + actual, + pretext + ': Expected : ' + expectedLog + ' , Actual : ' + actualLog, 'assertWithRequirementLogs' ).then(() => { if (equateDeep) { From 07a043e9488321cead4458a0beeea40f5004db5e Mon Sep 17 00:00:00 2001 From: Preethi M R <102140979+PreethiMaai@users.noreply.github.com> Date: Wed, 22 May 2024 10:32:28 +0530 Subject: [PATCH 054/359] update to dummy value --- cypress/fixtures/modules/secondscreen.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/fixtures/modules/secondscreen.json b/cypress/fixtures/modules/secondscreen.json index ee5bd0ce..3f9359e4 100644 --- a/cypress/fixtures/modules/secondscreen.json +++ b/cypress/fixtures/modules/secondscreen.json @@ -24,7 +24,7 @@ "result":{ "type": "dial", "version": "1.7", - "data": "{\"code\":\"AQDPQZiQcb3KQ7gY7yy5tHTMbbkGHR9Zjp-KL53H3eKBZIeAt7O9UKYPu6B21l2UZVmIqkFXDXBmXvK4g2e3EgZtjMNmKPsTltgnRl95DImtOXjSpWtTjSaOkW4w1kZKUTwLKdwVWTzBVH8ERHorvLU6vCGOVHxXt65LNwdl5HKRweShVC1V9QsyvRnQS61ov0UclmrH_xZML2Bt-Q-rZFjey5MjwupIb4x4f53XUJMhjHpDHoIUKrjpdPDQvK2a\",\"friendlyName\":\"Operator_TX061AEI\",\"UDN\":\"608fef11-2800-482a-962b-23a6690c93c1\"}" + "data": "test" } }, "ONCLOSEREQUEST_EVENT": { @@ -34,4 +34,4 @@ "version": "1.7" } } -} \ No newline at end of file +} From ccd358153899900b781daa69ff0e721d3a435518 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Wed, 22 May 2024 11:15:43 +0530 Subject: [PATCH 055/359] Testcase corrections --- .../UserInterest.feature | 20 +++++++++---------- cypress/fixtures/fireboltCalls/content.json | 5 +++++ 2 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 cypress/fixtures/fireboltCalls/content.json diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index 7049f1d3..d349e655 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -7,7 +7,7 @@ Feature: UserInterest @coreSDK @sdk @transport @userinterest Scenario Outline: Discovery.userInterest - Positive Scenario: with interest type - When 1st party app invokes the 'Firebolt' API to 'discovery onRequestUserInterest' + When 1st party app invokes the 'Firebolt' API to 'Content onUserInterest' And '3rd party app' invokes the 'Firebolt' API to 'get userInterest with ' Then 'Firebolt' platform responds with 'null for discovery userInterest' And 'Firebolt' platform triggers event '' @@ -151,21 +151,21 @@ Feature: UserInterest | Invalid programType for program entity with seriesId | with invalid programType for program entity with seriesId | | Invalid programType for program entity with seasonId | with invalid programType for program entity with seasonId | - # @coreSDK @sdk @transport @userinterest + @coreSDK @sdk @userinterest Scenario Outline: 'Discovery_content.requestUserInterest - Positive Scenario: with type When '3rd party app' registers for the 'discovery onRequestUserInterest' event using the 'Firebolt' API And 1st party app invokes the 'Firebolt' API to 'get requestUserInterest with type ' - Then 'Firebolt' platform responds with '' + Then 'Firebolt' platform responds to '1st party app' with '' # And 'Firebolt' platform triggers event '' Examples: - | Scenario | setParam | method_Content | Event_Content | - | interest and reason playlist | interest reason playlist | requestUserInterest with type interest reason playlist | onRequestUserInterest with type interest reason playlist | - | interest and reason reaction | interest reason reaction | requestUserInterest with type interest reason playlist | onRequestUserInterest with type interest reason reaction | - | interest and reason recording | interest reason recording | requestUserInterest with type interest reason playlist | onRequestUserInterest with type interest reason recording | - | disinterest and reason playlist | disinterest reason playlist | requestUserInterest with type interest reason playlist | onRequestUserInterest with type dinterest reason playlist | - | disinterest and reason reaction | disinterest reason reaction | requestUserInterest with type interest reason playlist | onRequestUserInterest with type dinterest reason reaction | - | disinterest and reason recording | disinterest reason recording | requestUserInterest with type interest reason playlist | onRequestUserInterest with type dinterest reason recording | + | Scenario | setParam | method_Content | Event_Content | + | interest and reason playlist | interest reason playlist | requestUserInterest with type interest reason playlist response | onRequestUserInterest with type interest reason playlist | + | interest and reason reaction | interest reason reaction | requestUserInterest with type interest reason playlist | onRequestUserInterest with type interest reason reaction | + | interest and reason recording | interest reason recording | requestUserInterest with type interest reason playlist | onRequestUserInterest with type interest reason recording | + | disinterest and reason playlist | disinterest reason playlist | requestUserInterest with type interest reason playlist | onRequestUserInterest with type dinterest reason playlist | + | disinterest and reason reaction | disinterest reason reaction | requestUserInterest with type interest reason playlist | onRequestUserInterest with type dinterest reason reaction | + | disinterest and reason recording | disinterest reason recording | requestUserInterest with type interest reason playlist | onRequestUserInterest with type dinterest reason recording | @coreSDK @sdk @transport @userinterest Scenario Outline: Discovery_content.requestUserInterest - Negative Scenario: expecting error diff --git a/cypress/fixtures/fireboltCalls/content.json b/cypress/fixtures/fireboltCalls/content.json new file mode 100644 index 00000000..bd431ef4 --- /dev/null +++ b/cypress/fixtures/fireboltCalls/content.json @@ -0,0 +1,5 @@ +{ + "CONTENT_ONUSERINTEREST":{ + "method": "discovery_content.onUserInterest" + } +} \ No newline at end of file From 5972f51b63db5ac0b23d61f935e0ea7e594977c0 Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Wed, 22 May 2024 12:51:02 +0530 Subject: [PATCH 056/359] FIRECERT-2075-New addressed review comments --- .../LifecycleTestcases/LifecycleBackground.feature | 4 ++-- .../LifecycleTestcases/LifecycleSuspended.feature | 2 +- cypress/support/cypress-support/src/utils.js | 4 ++-- cypress/support/step_definitions/validations.js | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature index 9b2ca6db..2653ecc7 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature @@ -43,14 +43,14 @@ Feature: Lifecycle_Background And 3rd party 'certification' app is launched with 'unloading' state When '3rd party app' transitions to state 'background' And AppObject state for '3rd party App' is set to 'unloading' - Then '3rd party app' will be in 'unloading' state + Then '3rd party app' will stay in 'unloading' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 2.4.3 Cannot background app from suspended state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When '3rd party app' transitions to state 'background' - Then '3rd party app' will be in 'suspended' state + Then '3rd party app' will stay in 'suspended' state @Lifecycle @coreSDK Scenario: Lifecycle 2.4.3 Should not Background app in initializing state diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature index 16d1f284..92ebb1f5 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature @@ -47,7 +47,7 @@ Feature: Lifecycle_Suspended Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with '' state When '3rd party app' transitions to state 'suspended' - Then '3rd party app' will be in '' state + Then '3rd party app' will stay in '' state Examples: | state | diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index ebe4d8c7..6f9ab1ae 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -457,9 +457,9 @@ function assertWithRequirementLogs(pretext, actual, expected, equateDeep = false 'assertWithRequirementLogs' ).then(() => { if (equateDeep) { - assert.deepEqual(actual, expected, pretext); + fireLog.deepEqual(actual, expected, pretext); } else { - assert.equal(actual, expected, pretext); + fireLog.equal(actual, expected, pretext); } }); } diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 280d309b..bc26a4c0 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -329,8 +329,7 @@ Then(/'(.+)' will (be|stay) in '(.+)' state/, (app, condition, state) => { : app === CONSTANTS.FIRST_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) : app; - let isEventsExpected; - condition == CONSTANTS.STAY ? (isEventsExpected = false) : (isEventsExpected = true); + const isEventsExpected = condition == CONSTANTS.STAY ? false : true; const appObject = UTILS.getEnvVariable(appId); cy.validateLifecycleState(appObject.getAppObjectState().state, appId); cy.validateLifecycleHistoryAndEvents( From 5f313b3c5fdb8e025ac0d7bb3857630b02ea0362 Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Wed, 22 May 2024 15:48:30 +0530 Subject: [PATCH 057/359] FIRECERT-1819 fixed param n TC issues --- cypress/TestCases/FireboltCertification/UserInterest.feature | 4 ++-- cypress/fixtures/fireboltCalls/userinterest.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index d349e655..d80a2d83 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -170,10 +170,10 @@ Feature: UserInterest @coreSDK @sdk @transport @userinterest Scenario Outline: Discovery_content.requestUserInterest - Negative Scenario: expecting error When 1st party app invokes the 'Firebolt' API to 'get requestUserInterest with ' - Then 'Firebolt' platform responds with 'invalid params for content requestUserInterest' + Then 'Firebolt' platform responds to '1st party app' with 'invalid params for content requestUserInterest' Examples: - | Scenario | Param | + | Scenario | param | | Invalid Interest value - test params | invalid interestType | | Invalid Interest type - boolean params | boolean interestType | | Invalid reason value - test params | invalid reasonType | diff --git a/cypress/fixtures/fireboltCalls/userinterest.json b/cypress/fixtures/fireboltCalls/userinterest.json index e75fe445..7df6a626 100644 --- a/cypress/fixtures/fireboltCalls/userinterest.json +++ b/cypress/fixtures/fireboltCalls/userinterest.json @@ -466,7 +466,8 @@ "expectingError": false }, "GET_USERINTEREST_WITHOUT_ANY_PARAMS": { - "method": "discovery.userInterest" + "method": "discovery.userInterest", + "expected": "error" }, "GET_USERINTEREST_WITHOUT_INTEREST_TYPE": { "method": "discovery.userInterest", From 02190d0693d25fa9ccc6728c032fb4b54b0b5e63 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Wed, 22 May 2024 17:25:17 +0530 Subject: [PATCH 058/359] Added params and correction of testcases --- .../UserInterest.feature | 20 ++++++------- .../fixtures/fireboltCalls/userinterest.json | 7 ++++- cypress/fixtures/modules/discovery.json | 29 ++++++++++++++++--- .../objects/moduleReqId/moduleReqId.json | 22 ++++++++++++++ 4 files changed, 62 insertions(+), 16 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index d80a2d83..d664051c 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -152,23 +152,21 @@ Feature: UserInterest | Invalid programType for program entity with seasonId | with invalid programType for program entity with seasonId | @coreSDK @sdk @userinterest - Scenario Outline: 'Discovery_content.requestUserInterest - Positive Scenario: with type - When '3rd party app' registers for the 'discovery onRequestUserInterest' event using the 'Firebolt' API + Scenario Outline: Content.requestUserInterest - Positive Scenario: with type And 1st party app invokes the 'Firebolt' API to 'get requestUserInterest with type ' Then 'Firebolt' platform responds to '1st party app' with '' - # And 'Firebolt' platform triggers event '' Examples: - | Scenario | setParam | method_Content | Event_Content | - | interest and reason playlist | interest reason playlist | requestUserInterest with type interest reason playlist response | onRequestUserInterest with type interest reason playlist | - | interest and reason reaction | interest reason reaction | requestUserInterest with type interest reason playlist | onRequestUserInterest with type interest reason reaction | - | interest and reason recording | interest reason recording | requestUserInterest with type interest reason playlist | onRequestUserInterest with type interest reason recording | - | disinterest and reason playlist | disinterest reason playlist | requestUserInterest with type interest reason playlist | onRequestUserInterest with type dinterest reason playlist | - | disinterest and reason reaction | disinterest reason reaction | requestUserInterest with type interest reason playlist | onRequestUserInterest with type dinterest reason reaction | - | disinterest and reason recording | disinterest reason recording | requestUserInterest with type interest reason playlist | onRequestUserInterest with type dinterest reason recording | + | Scenario | setParam | method_Content | + | interest and reason playlist | interest reason playlist | requestUserInterest with type interest reason playlist | + | interest and reason reaction | interest reason reaction | requestUserInterest with type interest reason reaction | + | interest and reason recording | interest reason recording | requestUserInterest with type interest reason playlist | + | disinterest and reason playlist | disinterest reason playlist | requestUserInterest with type interest reason playlist | + | disinterest and reason reaction | disinterest reason reaction | requestUserInterest with type interest reason playlist | + | disinterest and reason recording | disinterest reason recording | requestUserInterest with type interest reason playlist | @coreSDK @sdk @transport @userinterest - Scenario Outline: Discovery_content.requestUserInterest - Negative Scenario: expecting error + Scenario Outline: Content.requestUserInterest - Negative Scenario: expecting error When 1st party app invokes the 'Firebolt' API to 'get requestUserInterest with ' Then 'Firebolt' platform responds to '1st party app' with 'invalid params for content requestUserInterest' diff --git a/cypress/fixtures/fireboltCalls/userinterest.json b/cypress/fixtures/fireboltCalls/userinterest.json index 7df6a626..244cefc0 100644 --- a/cypress/fixtures/fireboltCalls/userinterest.json +++ b/cypress/fixtures/fireboltCalls/userinterest.json @@ -439,9 +439,14 @@ }, "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { "method": "content.requestUserInterest", - "validationJsonPath": "result.entity", + "validationJsonPath": "result", "expected": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_RESPONSE" }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { + "method": "content.requestUserInterest", + "validationJsonPath": "result", + "expected": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_RESPONSE" + }, "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_MUSIC_SONG_ENTITY_DATA": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_MUSIC_SONG_ENTITY" diff --git a/cypress/fixtures/modules/discovery.json b/cypress/fixtures/modules/discovery.json index 85d4d9e6..d2b12c72 100644 --- a/cypress/fixtures/modules/discovery.json +++ b/cypress/fixtures/modules/discovery.json @@ -1754,12 +1754,33 @@ "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_RESPONSE": { "identifiers": { "entityId": "345", - "entityType": "program", - "programType": "movie" + "entityType": "playlist" + }, + "info": { + "title": "User Interest", + "synopsis": "User Interest request provider", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_RESPONSE": { + "identifiers": { + "entityId": "123", + "entityType": "channel", + "channelType": "streaming" }, "info": { - "title": "Cool Runnings", - "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "title": "User Interest", + "synopsis": "User Interest request provider", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ { diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 1c8b3d2b..07cad106 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -2676,6 +2676,28 @@ } ] } + }, + "UserInterest": { + "Content.requestUserInterest - Positive Scenario: with type interest and reason playlist": { + "req": [ + { + "method": { + "id": "UserInterest 1.0", + "description": "Positive Scenario: with type interest and reason playlist" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: with type interest and reason reaction": { + "req": [ + { + "method": { + "id": "UserInterest 1.1", + "description": "Positive Scenario: with type interest and reason playlist" + } + } + ] + } } } } \ No newline at end of file From 791cd5ea1709c2695778ff7f3ae36934d2f4e78a Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Wed, 22 May 2024 21:21:34 +0530 Subject: [PATCH 059/359] FIRECERT-1819: Userinterest params correction --- .../UserInterest.feature | 14 +++---- .../fixtures/fireboltCalls/userinterest.json | 13 ++++-- cypress/fixtures/modules/discovery.json | 22 +++++++++- .../objects/moduleReqId/moduleReqId.json | 42 ++++++++++++++++++- 4 files changed, 77 insertions(+), 14 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index d664051c..bcfab597 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -157,13 +157,13 @@ Feature: UserInterest Then 'Firebolt' platform responds to '1st party app' with '' Examples: - | Scenario | setParam | method_Content | - | interest and reason playlist | interest reason playlist | requestUserInterest with type interest reason playlist | - | interest and reason reaction | interest reason reaction | requestUserInterest with type interest reason reaction | - | interest and reason recording | interest reason recording | requestUserInterest with type interest reason playlist | - | disinterest and reason playlist | disinterest reason playlist | requestUserInterest with type interest reason playlist | - | disinterest and reason reaction | disinterest reason reaction | requestUserInterest with type interest reason playlist | - | disinterest and reason recording | disinterest reason recording | requestUserInterest with type interest reason playlist | + | Scenario | setParam | method_Content | + | interest and reason playlist | interest reason playlist | requestUserInterest with reason playlist | + | interest and reason reaction | interest reason reaction | requestUserInterest with reason reaction | + | interest and reason recording | interest reason recording | requestUserInterest with reason recording | + | disinterest and reason playlist | disinterest reason playlist | requestUserInterest with reason playlist | + | disinterest and reason reaction | disinterest reason reaction | requestUserInterest with reason reaction | + | disinterest and reason recording | disinterest reason recording | requestUserInterest with reason recording | @coreSDK @sdk @transport @userinterest Scenario Outline: Content.requestUserInterest - Negative Scenario: expecting error diff --git a/cypress/fixtures/fireboltCalls/userinterest.json b/cypress/fixtures/fireboltCalls/userinterest.json index 244cefc0..89f7f6ff 100644 --- a/cypress/fixtures/fireboltCalls/userinterest.json +++ b/cypress/fixtures/fireboltCalls/userinterest.json @@ -437,15 +437,20 @@ "validationJsonPath": "eventResponse.request", "expected": "DISCOVERY_TYPE_DISINTEREST_REASON_RECORDING" }, - "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { + "REQUESTUSERINTEREST_WITH_REASON_PLAYLIST": { "method": "content.requestUserInterest", "validationJsonPath": "result", - "expected": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_RESPONSE" + "expected": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_PLAYLIST_RESPONSE" }, - "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { + "REQUESTUSERINTEREST_WITH_REASON_REACTION": { "method": "content.requestUserInterest", "validationJsonPath": "result", - "expected": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_RESPONSE" + "expected": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_REACTION_RESPONSE" + }, + "REQUESTUSERINTEREST_WITH_REASON_RECORDING": { + "method": "content.requestUserInterest", + "validationJsonPath": "result", + "expected": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_RECORDING_RESPONSE" }, "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_MUSIC_SONG_ENTITY_DATA": { "method": "discovery.userInterest", diff --git a/cypress/fixtures/modules/discovery.json b/cypress/fixtures/modules/discovery.json index d2b12c72..a74ae329 100644 --- a/cypress/fixtures/modules/discovery.json +++ b/cypress/fixtures/modules/discovery.json @@ -1751,7 +1751,7 @@ "albumId": "album/xyz" } }, - "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_RESPONSE": { + "REQUESTUSERINTEREST_WITH_REASON_PLAYLIST_RESPONSE": { "identifiers": { "entityId": "345", "entityType": "playlist" @@ -1772,7 +1772,7 @@ ] } }, - "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_RESPONSE": { + "REQUESTUSERINTEREST_WITH_REASON_REACTION_RESPONSE": { "identifiers": { "entityId": "123", "entityType": "channel", @@ -1793,5 +1793,23 @@ } ] } + }, + "REQUESTUSERINTEREST_WITH_REASON_RECORDING_RESPONSE": { + "identifiers": { + "entityId": "981", + "entityType": "music", + "musicType": "song" + }, + "info": { + "title": "User Interest", + "synopsis": "User Interest request provider", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-TV", + "rating": "PG" + } + ] + } } } \ No newline at end of file diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 07cad106..8461af5c 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -2693,7 +2693,47 @@ { "method": { "id": "UserInterest 1.1", - "description": "Positive Scenario: with type interest and reason playlist" + "description": "Positive Scenario: with type interest and reason reaction" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: with type interest and reason recording": { + "req": [ + { + "method": { + "id": "UserInterest 1.2", + "description": "Positive Scenario: with type interest and reason recording" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: with type disinterest and reason playlist": { + "req": [ + { + "method": { + "id": "UserInterest 1.3", + "description": "Positive Scenario: with type disinterest and reason playlist" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: with type disinterest and reason reaction": { + "req": [ + { + "method": { + "id": "UserInterest 1.4", + "description": "Positive Scenario: with type disinterest and reason reaction" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: with type disinterest and reason recording": { + "req": [ + { + "method": { + "id": "UserInterest 1.5", + "description": "Positive Scenario: with type disinterest and reason recording" } } ] From 8c6db29f5e035a8ed51b75eade76f1bdaf3a2761 Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Thu, 23 May 2024 10:28:27 +0530 Subject: [PATCH 060/359] FIRECERT-2075-New updated fireLogs in utils.js --- cypress/support/cypress-support/src/utils.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 6f9ab1ae..924191b6 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -452,16 +452,12 @@ function assertWithRequirementLogs(pretext, actual, expected, equateDeep = false expectedLog = JSON.stringify(expected); } - cy.log( - pretext + ': Expected : ' + expectedLog + ' , Actual : ' + actualLog, - 'assertWithRequirementLogs' - ).then(() => { - if (equateDeep) { - fireLog.deepEqual(actual, expected, pretext); - } else { - fireLog.equal(actual, expected, pretext); - } - }); + const logMessage = pretext + ': Expected : ' + expectedLog + ' , Actual : ' + actualLog; + if (equateDeep) { + fireLog.deepEqual(actual, expected, logMessage); + } else { + fireLog.equal(actual, expected, logMessage); + } } } From fa028f0159731b5733abbc10b1e33567b35be185 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 23 May 2024 13:48:09 +0530 Subject: [PATCH 061/359] FIRECERT-2055-moving current changes to new PR --- .../Accessibility.feature | 256 +++++++++--------- .../Manage/ClosedCaptionsManage.feature | 26 +- cypress/fixtures/README.md | 2 +- .../fixtures/fireboltCalls/accessibility.json | 48 ++-- .../fireboltCalls/closedcaptions.json | 48 ++-- .../validationObjects/accessibility.json | 168 ++++++++++++ cypress/support/constants/constants.js | 1 + cypress/support/cypress-support/src/utils.js | 4 + .../support/step_definitions/validations.js | 8 + .../support/step_definitions/validations.md | 48 +++- cypress/support/validations/index.js | 1 + .../validations/undefinedValidation.js | 92 +++++++ 12 files changed, 511 insertions(+), 191 deletions(-) create mode 100644 cypress/support/validations/undefinedValidation.js diff --git a/cypress/TestCases/FireboltCertification/Accessibility.feature b/cypress/TestCases/FireboltCertification/Accessibility.feature index 035a1d78..8d7d5187 100644 --- a/cypress/TestCases/FireboltCertification/Accessibility.feature +++ b/cypress/TestCases/FireboltCertification/Accessibility.feature @@ -4,50 +4,50 @@ Feature: Accessibility Given the environment has been set up for 'Accessibility' tests And 3rd party 'certification' app is launched - @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: - When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API - And '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' - Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' + # @Accessibility @coreSDK @sdk @transport + # Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: + # When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API + # And '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' + # And 1st party app invokes the 'Firebolt' API to '' + # Then 'Firebolt' platform responds to '1st party app' for '' + # When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' + # Then 'Firebolt' platform responds with '' + # And 'Firebolt' platform triggers event '' - Examples: - | Scenario | Key | Method_Content | Event_Content | - | Disable closedcaptions | disable closedCaptions | disabled for closedCaptions settings | onclosedCaptionsSettingsChanged with disabled | - | Enable closedcaptions | enable closedCaptions | enabled for closedCaptions settings | onclosedCaptionsSettingsChanged with enabled | - | Set fontFamily-monospaced_sanserif | set fontFamily to monospaced_sanserif | monospace sanserif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with monospace sanserif for fontfamily | - | Set fontFamily-cursive | set fontFamily to cursive | cursive for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with cursive for fontfamily | - | Set fontFamily-proportional_serif | set fontFamily to proportional_serif | proportional serif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with proportional serif for fontfamily | - | Set fontFamily-monospaced_serif | set fontFamily to monospaced_serif | monospaced serif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with monospaced serif for fontfamily | - | Set fontFamily-proportional_sanserif | set fontFamily to proportional_sanserif | proportional sanserif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with proportional sanserif for fontfamily | - | Set fontFamily-smallcaps | set fontFamily to smallcaps | smallcaps for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with smallcaps for fontfamily | - | Set fontFamily-casual | set fontFamily to casual | casual for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with casual for fontfamily | - | Set fontSize-1 | set fontSize to 1 | 1 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 1 for fontSize | - | Set fontSize-0.5 | set fontSize to 0.5 | 0.5 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 0.5 for fontSize | - | Set fontSize-1.5 | set fontSize to 1.5 | 1.5 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 1.5 for fontSize | - | Set fontColor-#ff00ff | set fontColor to #ff00ff | #ff00ff for fontColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #ff00ff for fontColor | - | Set fontEdge-raised | set fontEdge to raised | raised for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with raised for fontEdge | - | Set fontEdge-none | set fontEdge to none | none for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with none for fontEdge | - | Set fontEdge-depressed | set fontEdge to depressed | depressed for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with depressed for fontEdge | - | Set fontEdge-uniform | set fontEdge to uniform | uniform for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with uniform for fontEdge | - | Set fontEdge-dropShadow-left | set fontEdge to dropShadow_left | dropShadowLeft for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with dropShadowLeft for fontEdge | - | Set fontEdge-dropShadow-right | set fontEdge to dropShadow_right | dropShadowRight for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with dropShadowRight for fontEdge | - | Set fontEdgeColor-#FFFFFF | set fontEdgeColor to #FFFFFF | #ffffff for fontEdgeColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #ffffff for fontEdgeColor | - | Set backgroundColor-#7f7f7f | set backgroundColor to #7f7f7f | #7f7f7f for backgroundColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #7f7f7f for backgroundColor | - | Set fontOpacity-75 | set fontOpacity to 75 | 75 for fontOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 75 for fontOpacity | - | Set backgroundOpacity-75 | set backgroundOpacity to 75 | 75 for backgroundOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 75 for backgroundOpacity | - | Set textAlign-left | set textAlign to left | left for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with left for textAlign | - | Set textAlign-center | set textAlign to center | center for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with center for textAlign | - | Set textAlign-right | set textAlign to right | right for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with right for textAlign | - | Set textAlignVertical-top | set textAlignVertical to top | top for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with top for textAlignVertical | - | Set textAlignVertical-middle | set textAlignVertical to middle | middle for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with middle for textAlignVertical | - | Set textAlignVertical-bottom | set textAlignVertical to bottom | bottom for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with bottom for textAlignVertical | - | Set windowColor-white | set windowColor to white | white for windowColor in closedcaptions settings | onclosedCaptionsSettingsChanged with white for windowColor | - | Set windowOpacity-50 | set windowOpacity to 50 | 50 for windowOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 50 for windowOpacity | - | Set preferredLanguages | set preferredLanguages to spanish english | spanish for preferredLanguages in closedcaptions settings | onclosedCaptionsSettingsChanged with spanish for preferredLanguages | + # Examples: + # | Scenario | Key | Method_Content | Event_Content | + # | Disable closedcaptions | disable closedCaptions | disabled for closedCaptions settings | onclosedCaptionsSettingsChanged with disabled | + # | Enable closedcaptions | enable closedCaptions | enabled for closedCaptions settings | onclosedCaptionsSettingsChanged with enabled | + # | Set fontFamily-monospaced_sanserif | set fontFamily to monospaced_sanserif | monospace sanserif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with monospace sanserif for fontfamily | + # | Set fontFamily-cursive | set fontFamily to cursive | cursive for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with cursive for fontfamily | + # | Set fontFamily-proportional_serif | set fontFamily to proportional_serif | proportional serif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with proportional serif for fontfamily | + # | Set fontFamily-monospaced_serif | set fontFamily to monospaced_serif | monospaced serif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with monospaced serif for fontfamily | + # | Set fontFamily-proportional_sanserif | set fontFamily to proportional_sanserif | proportional sanserif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with proportional sanserif for fontfamily | + # | Set fontFamily-smallcaps | set fontFamily to smallcaps | smallcaps for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with smallcaps for fontfamily | + # | Set fontFamily-casual | set fontFamily to casual | casual for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with casual for fontfamily | + # | Set fontSize-1 | set fontSize to 1 | 1 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 1 for fontSize | + # | Set fontSize-0.5 | set fontSize to 0.5 | 0.5 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 0.5 for fontSize | + # | Set fontSize-1.5 | set fontSize to 1.5 | 1.5 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 1.5 for fontSize | + # | Set fontColor-#ff00ff | set fontColor to #ff00ff | #ff00ff for fontColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #ff00ff for fontColor | + # | Set fontEdge-raised | set fontEdge to raised | raised for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with raised for fontEdge | + # | Set fontEdge-none | set fontEdge to none | none for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with none for fontEdge | + # | Set fontEdge-depressed | set fontEdge to depressed | depressed for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with depressed for fontEdge | + # | Set fontEdge-uniform | set fontEdge to uniform | uniform for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with uniform for fontEdge | + # | Set fontEdge-dropShadow-left | set fontEdge to dropShadow_left | dropShadowLeft for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with dropShadowLeft for fontEdge | + # | Set fontEdge-dropShadow-right | set fontEdge to dropShadow_right | dropShadowRight for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with dropShadowRight for fontEdge | + # | Set fontEdgeColor-#FFFFFF | set fontEdgeColor to #FFFFFF | #ffffff for fontEdgeColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #ffffff for fontEdgeColor | + # | Set backgroundColor-#7f7f7f | set backgroundColor to #7f7f7f | #7f7f7f for backgroundColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #7f7f7f for backgroundColor | + # | Set fontOpacity-75 | set fontOpacity to 75 | 75 for fontOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 75 for fontOpacity | + # | Set backgroundOpacity-75 | set backgroundOpacity to 75 | 75 for backgroundOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 75 for backgroundOpacity | + # | Set textAlign-left | set textAlign to left | left for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with left for textAlign | + # | Set textAlign-center | set textAlign to center | center for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with center for textAlign | + # | Set textAlign-right | set textAlign to right | right for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with right for textAlign | + # | Set textAlignVertical-top | set textAlignVertical to top | top for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with top for textAlignVertical | + # | Set textAlignVertical-middle | set textAlignVertical to middle | middle for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with middle for textAlignVertical | + # | Set textAlignVertical-bottom | set textAlignVertical to bottom | bottom for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with bottom for textAlignVertical | + # | Set windowColor-white | set windowColor to white | white for windowColor in closedcaptions settings | onclosedCaptionsSettingsChanged with white for windowColor | + # | Set windowOpacity-50 | set windowOpacity to 50 | 50 for windowOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 50 for windowOpacity | + # | Set preferredLanguages | set preferredLanguages to spanish english | spanish for preferredLanguages in closedcaptions settings | onclosedCaptionsSettingsChanged with spanish for preferredLanguages | @Accessibility @coreSDK @sdk @transport Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: with 'null' params @@ -60,98 +60,98 @@ Feature: Accessibility And 'Firebolt' platform triggers event '' Examples: - | Scenario | Key | Method_Content | Event_Content | - | fontFamily | set fontFamily as null | monospaced serif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with monospaced serif for fontfamily | - | fontSize | set fontSize as null | 1 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 1 for fontSize | - | fontColor | set fontColor as null | #ffffff for fontColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #ff00ff for fontColor | - | fontEdge | set fontEdge as null | none for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with none for fontEdge | - | fontEdgeColor | set fontEdgeColor as null | #7f7f7f for fontEdgeColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #ffffff for fontEdgeColor | - | fontOpacity | set fontOpacity as null | 100 for fontOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 75 for fontOpacity | - | backgroundColor | set backgroundColor as null | #000000 for backgroundColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #000000 for backgroundColor | - | backgroundOpacity | set backgroundOpacity as null | 12 for backgroundOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 12 for backgroundOpacity | - | textAlign | set textAlign as null | center for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with center for textAlign | - | textAlignVertical | set textAlignVertical as null | middle for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with middle for textAlignVertical | - | windowColor | set windowColor as null | #000000 for windowColor in closedcaptions settings | onclosedCaptionsSettingsChanged with white for windowColor | - | windowOpacity | set windowOpacity as null | 0 for windowOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 0 for windowOpacity | + | Scenario | Key | Method_Content | Event_Content | + | fontFamily | set fontFamily as null | default value for fontFamily | onclosedCaptionsSettingsChanged with monospaced serif for fontfamily | + | fontSize | set fontSize as null | default value for fontSize | onclosedCaptionsSettingsChanged with 1 for fontSize | + | fontColor | set fontColor as null | default value for fontColor | onclosedCaptionsSettingsChanged with #ff00ff for fontColor | + | fontEdge | set fontEdge as null | default value for fontEdge | onclosedCaptionsSettingsChanged with none for fontEdge | + | fontEdgeColor | set fontEdgeColor as null | default value for fontEdgeColor | onclosedCaptionsSettingsChanged with #ffffff for fontEdgeColor | + | fontOpacity | set fontOpacity as null | default value for fontOpacity | onclosedCaptionsSettingsChanged with 75 for fontOpacity | + | backgroundColor | set backgroundColor as null | default value for backgroundColor | onclosedCaptionsSettingsChanged with #000000 for backgroundColor | + | backgroundOpacity | set backgroundOpacity as null | default value for backgroundOpacity | onclosedCaptionsSettingsChanged with 12 for backgroundOpacity | + | textAlign | set textAlign as null | default value for textAlign | onclosedCaptionsSettingsChanged with center for textAlign | + | textAlignVertical | set textAlignVertical as null | default value for textAlignVertical | onclosedCaptionsSettingsChanged with middle for textAlignVertical | + | windowColor | set windowColor as null | default value for windowColor | onclosedCaptionsSettingsChanged with white for windowColor | + | windowOpacity | set windowOpacity as null | default value for windowOpacity | onclosedCaptionsSettingsChanged with 0 for windowOpacity | - @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.voiceGuidanceSettings - Positive Scenario: - When '3rd party app' registers for the 'accessibility onVoiceGuidanceSettingsChanged' event using the 'Firebolt' API - And '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance settings' - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance settings' - Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' + # @Accessibility @coreSDK @sdk @transport + # Scenario Outline: Accessibility.voiceGuidanceSettings - Positive Scenario: + # When '3rd party app' registers for the 'accessibility onVoiceGuidanceSettingsChanged' event using the 'Firebolt' API + # And '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance settings' + # And 1st party app invokes the 'Firebolt' API to '' + # Then 'Firebolt' platform responds to '1st party app' for '' + # When '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance settings' + # Then 'Firebolt' platform responds with '' + # And 'Firebolt' platform triggers event '' - Examples: - | Scenario | Key | Method_Content | Event_Content | - | Disable voiceguidance | disable voiceGuidance | disabled voiceGuidance settings | onvoiceGuidanceSettings with disabled | - | Enable voiceguidance | enable voiceGuidance | enabled voiceGuidance settings | onvoiceGuidanceSettings with enabled | - | Set speed-1 | set speed as 1 | 1 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 1 for speed | - | Set speed-0.5 | set speed as 0.5 | 0.5 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 0.5 for speed | - | Set speed-2 | set speed as 2 | 2 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 2 for speed | + # Examples: + # | Scenario | Key | Method_Content | Event_Content | + # | Disable voiceguidance | disable voiceGuidance | disabled voiceGuidance settings | onvoiceGuidanceSettings with disabled | + # | Enable voiceguidance | enable voiceGuidance | enabled voiceGuidance settings | onvoiceGuidanceSettings with enabled | + # | Set speed-1 | set speed as 1 | 1 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 1 for speed | + # | Set speed-0.5 | set speed as 0.5 | 0.5 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 0.5 for speed | + # | Set speed-2 | set speed as 2 | 2 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 2 for speed | - @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.audioDescriptionSettings - Positive Scenario: - When '3rd party app' registers for the 'accessibility onAudioDescriptionSettingsChanged' event using the 'Firebolt' API - And '3rd party app' invokes the 'Firebolt' API to 'get audioDescriptionSettings settings' - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When '3rd party app' invokes the 'Firebolt' API to 'get audioDescriptionSettings settings' - Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' + # @Accessibility @coreSDK @sdk @transport + # Scenario Outline: Accessibility.audioDescriptionSettings - Positive Scenario: + # When '3rd party app' registers for the 'accessibility onAudioDescriptionSettingsChanged' event using the 'Firebolt' API + # And '3rd party app' invokes the 'Firebolt' API to 'get audioDescriptionSettings settings' + # And 1st party app invokes the 'Firebolt' API to '' + # Then 'Firebolt' platform responds to '1st party app' for '' + # When '3rd party app' invokes the 'Firebolt' API to 'get audioDescriptionSettings settings' + # Then 'Firebolt' platform responds with '' + # And 'Firebolt' platform triggers event '' - Examples: - | Scenario | Key | Method_Content | Event_Content | - | Disable audioDescriptionSettings | disable audioDescription | disabled audioDescription settings | onaudioDescriptionSettings with disabled | - | Enable audioDescriptionSettings | enable audioDescription | enabled audioDescription settings | onaudioDescriptionSettings with enabled | + # Examples: + # | Scenario | Key | Method_Content | Event_Content | + # | Disable audioDescriptionSettings | disable audioDescription | disabled audioDescription settings | onaudioDescriptionSettings with disabled | + # | Enable audioDescriptionSettings | enable audioDescription | enabled audioDescription settings | onaudioDescriptionSettings with enabled | - @Accessibility @coreSDK @sdk @transport - Scenario: Accessibility.onClosedCaptionsSettingsChanged event - Positive Scenario: Clear listeners - When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API - And I clear 'accessibility onClosedCaptionsSettingsChanged event' listeners - And 1st party app invokes the 'Firebolt' API to 'disable closedCaptions' - Then 'Firebolt' platform responds to '1st party app' for 'disable closedCaptions' - And 'Firebolt' platform does not trigger event for 'onclosedCaptionsSettingsChanged' + # @Accessibility @coreSDK @sdk @transport + # Scenario: Accessibility.onClosedCaptionsSettingsChanged event - Positive Scenario: Clear listeners + # When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API + # And I clear 'accessibility onClosedCaptionsSettingsChanged event' listeners + # And 1st party app invokes the 'Firebolt' API to 'disable closedCaptions' + # Then 'Firebolt' platform responds to '1st party app' for 'disable closedCaptions' + # And 'Firebolt' platform does not trigger event for 'onclosedCaptionsSettingsChanged' - @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.closedCaptions - Positive Scenario: - When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions' - Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' + # @Accessibility @coreSDK @sdk @transport + # Scenario Outline: Accessibility.closedCaptions - Positive Scenario: + # When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API + # And 1st party app invokes the 'Firebolt' API to '' + # Then 'Firebolt' platform responds to '1st party app' for '' + # When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions' + # Then 'Firebolt' platform responds with '' + # And 'Firebolt' platform triggers event '' - Examples: - | Scenario | Set_Method_Key | Method_Content | Event_Content | - | Enable closedcaptions | enable closedCaptions | enabled for accessibility closedCaptions | onclosedCaptionsSettingsChanged with enabled | - | Set fontFamily-monospaced_sanserif | set fontFamily to monospaced_sanserif | monospace sanserif for fontfamily in accessibility closedcaptions | onclosedCaptionsSettingsChanged with monospace sanserif for fontfamily | - | Set fontSize-1 | set fontSize to 1 | 1 for fontSize in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 1 for fontSize | - | Set fontColor-#ffffff | set fontColor to #ffffff | #ffffff for fontColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #ffffff for fontColor | - | Set fontEdge-raised | set fontEdge to raised | raised for fontEdge in accessibility closedcaptions | onclosedCaptionsSettingsChanged with raised for fontEdge | - | Set fontEdgeColor-#7f7f7f | set fontEdgeColor to #7f7f7f | #7f7f7f for fontEdgeColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #7f7f7f for fontEdgeColor | - | Set backgroundColor-#000000 | set backgroundColor to #000000 | #000000 for backgroundColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #000000 for backgroundColor | - | Set fontOpacity-100 | set fontOpacity to 100 | 100 for fontOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 100 for fontOpacity | - | Set backgroundOpacity-100 | set backgroundOpacity to 100 | 100 for backgroundOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 100 for backgroundOpacity | - | Set textAlign-left | set textAlign to left | left for textAlign in accessibility closedcaptions | onclosedCaptionsSettingsChanged with left for textAlign | - | Set textAlignVertical-top | set textAlignVertical to top | top for textAlignVertical in accessibility closedcaptions | onclosedCaptionsSettingsChanged with top for textAlignVertical | - | Set windowColor-#7f7f7f | set windowColor to #7f7f7f | #7f7f7f for windowColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #7f7f7f for windowColor | - | Set windowOpacity-40 | set windowOpacity to 40 | 40 for windowOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 40 for windowOpacity | + # Examples: + # | Scenario | Set_Method_Key | Method_Content | Event_Content | + # | Enable closedcaptions | enable closedCaptions | enabled for accessibility closedCaptions | onclosedCaptionsSettingsChanged with enabled | + # | Set fontFamily-monospaced_sanserif | set fontFamily to monospaced_sanserif | monospace sanserif for fontfamily in accessibility closedcaptions | onclosedCaptionsSettingsChanged with monospace sanserif for fontfamily | + # | Set fontSize-1 | set fontSize to 1 | 1 for fontSize in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 1 for fontSize | + # | Set fontColor-#ffffff | set fontColor to #ffffff | #ffffff for fontColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #ffffff for fontColor | + # | Set fontEdge-raised | set fontEdge to raised | raised for fontEdge in accessibility closedcaptions | onclosedCaptionsSettingsChanged with raised for fontEdge | + # | Set fontEdgeColor-#7f7f7f | set fontEdgeColor to #7f7f7f | #7f7f7f for fontEdgeColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #7f7f7f for fontEdgeColor | + # | Set backgroundColor-#000000 | set backgroundColor to #000000 | #000000 for backgroundColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #000000 for backgroundColor | + # | Set fontOpacity-100 | set fontOpacity to 100 | 100 for fontOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 100 for fontOpacity | + # | Set backgroundOpacity-100 | set backgroundOpacity to 100 | 100 for backgroundOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 100 for backgroundOpacity | + # | Set textAlign-left | set textAlign to left | left for textAlign in accessibility closedcaptions | onclosedCaptionsSettingsChanged with left for textAlign | + # | Set textAlignVertical-top | set textAlignVertical to top | top for textAlignVertical in accessibility closedcaptions | onclosedCaptionsSettingsChanged with top for textAlignVertical | + # | Set windowColor-#7f7f7f | set windowColor to #7f7f7f | #7f7f7f for windowColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #7f7f7f for windowColor | + # | Set windowOpacity-40 | set windowOpacity to 40 | 40 for windowOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 40 for windowOpacity | - @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.voiceGuidance - Positive Scenario: - When '3rd party app' registers for the 'accessibility onVoiceGuidanceSettingsChanged' event using the 'Firebolt' API - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance' - Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' + # @Accessibility @coreSDK @sdk @transport + # Scenario Outline: Accessibility.voiceGuidance - Positive Scenario: + # When '3rd party app' registers for the 'accessibility onVoiceGuidanceSettingsChanged' event using the 'Firebolt' API + # And 1st party app invokes the 'Firebolt' API to '' + # Then 'Firebolt' platform responds to '1st party app' for '' + # When '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance' + # Then 'Firebolt' platform responds with '' + # And 'Firebolt' platform triggers event '' - Examples: - | Scenario | Set_Method_Key | Method_Content | Event_Content | - | Disable voiceguidance | disable voiceGuidance | disabled voiceGuidance | onvoiceGuidanceSettings with disabled | - | Enable voiceguidance | enable voiceGuidance | enabled voiceGuidance | onvoiceGuidanceSettings with enabled | - | Set speed-1 | set speed as 1 | 1 for speed in voiceGuidance | onvoiceGuidanceSettings with 1 for speed | \ No newline at end of file + # Examples: + # | Scenario | Set_Method_Key | Method_Content | Event_Content | + # | Disable voiceguidance | disable voiceGuidance | disabled voiceGuidance | onvoiceGuidanceSettings with disabled | + # | Enable voiceguidance | enable voiceGuidance | enabled voiceGuidance | onvoiceGuidanceSettings with enabled | + # | Set speed-1 | set speed as 1 | 1 for speed in voiceGuidance | onvoiceGuidanceSettings with 1 for speed | \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature index b2bb586a..c044dfda 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature @@ -58,19 +58,19 @@ Feature: ClosedCaptions_Manage And 'Firebolt' platform triggers to '1st party app' with '' Examples: - | Scenario | Method | Set_API_Key | API_Key | Method_Validation_Key | Event_Validation_Key | Event | - | fontFamily | fontFamily | set fontFamily as null | get fontFamily | monospaced serif for fontfamily in closedCaptions | onFontFamilyChanged for closedcaptions with monospaced serif | closedcaptions onFontFamilyChanged | - | fontSize | fontSize | set fontSize as null | get fontSize | 1 for fontSize in closedcaptions | onFontSizeChanged for closedcaptions with 1 | closedcaptions onFontSizeChanged | - | fontColor | fontColor | set fontColor as null | get fontColor | #ffffff for fontColor in closedCaptions | onFontColorChanged for closedcaptions with #ffffff | closedcaptions onFontColorChanged | - | fontEdge | fontEdge | set fontEdge as null | get fontEdge | none for fontEdge in closedCaptions | onFontEdgeChanged for closedcaptions with none | closedcaptions onFontEdgeChanged | - | fontEdgeColor | fontEdgeColor | set fontEdgeColor as null | get fontEdgeColor | #7F7F7F for fontEdgeColor in closedCaptions | onFontEdgeColorChanged for closedcaptions with #7F7F7F | closedcaptions onFontEdgeColorChanged | - | fontOpacity | fontOpacity | set fontOpacity as null | get fontOpacity | 100 for fontOpacity in closedCaptions | onFontOpacityChanged for closedcaptions with 100 | closedcaptions onFontOpacityChanged | - | backgroundColor | backgroundColor | set backgroundColor as null | get backgroundColor | #000000 for backgroundColor in closedCaptions | onBackgroundColorChanged for closedcaptions with #000000 | closedcaptions onBackgroundColorChanged | - | backgroundOpacity | backgroundOpacity | set backgroundOpacity as null | get backgroundOpacity | 12 for backgroundOpacity in closedCaptions | onBackgroundOpacityChanged for closedcaptions with 12 | closedcaptions onBackgroundOpacityChanged | - | textAlign | textAlign | set textAlign as null | get textAlign | center for textAlign in closedCaptions | onTextAlignChanged for closedcaptions with center | closedcaptions onTextAlignChanged | - | textAlignVertical | textAlignVertical | set textAlignVertical as null | get textAlignVertical | middle for textAlignVertical in closedCaptions | onTextAlignVerticalChanged for closedcaptions with middle | closedcaptions onTextAlignVerticalChanged | - | windowColor | windowColor | set windowColor as null | get windowColor | #000000 for windowColor in closedCaptions | onWindowColorChanged for closedcaptions with #000000 | closedcaptions onWindowColorChanged | - | windowOpacity | windowOpacity | set windowOpacity as null | get windowOpacity | 0 for windowOpacity in closedCaptions | onWindowOpacityChanged for closedcaptions with 0 | closedcaptions onWindowOpacityChanged | + | Scenario | Method | Set_API_Key | API_Key | Method_Validation_Key | Event_Validation_Key | Event | + | fontFamily | fontFamily | set fontFamily as null | get fontFamily | default value for fontFamily in closedcaptions | onFontFamilyChanged for closedcaptions with monospaced serif | closedcaptions onFontFamilyChanged | + | fontSize | fontSize | set fontSize as null | get fontSize | default value for fontSize in closedcaptions | onFontSizeChanged for closedcaptions with 1 | closedcaptions onFontSizeChanged | + | fontColor | fontColor | set fontColor as null | get fontColor | default value for fontColor in closedcaptions | onFontColorChanged for closedcaptions with #ffffff | closedcaptions onFontColorChanged | + | fontEdge | fontEdge | set fontEdge as null | get fontEdge | default value for fontEdge in closedcaptions | onFontEdgeChanged for closedcaptions with none | closedcaptions onFontEdgeChanged | + | fontEdgeColor | fontEdgeColor | set fontEdgeColor as null | get fontEdgeColor | default value for fontEdgeColor in closedcaptions | onFontEdgeColorChanged for closedcaptions with #7F7F7F | closedcaptions onFontEdgeColorChanged | + | fontOpacity | fontOpacity | set fontOpacity as null | get fontOpacity | default value for fontOpacity in closedcaptions | onFontOpacityChanged for closedcaptions with 100 | closedcaptions onFontOpacityChanged | + | backgroundColor | backgroundColor | set backgroundColor as null | get backgroundColor | default value for backgroundColor in closedcaptions | onBackgroundColorChanged for closedcaptions with #000000 | closedcaptions onBackgroundColorChanged | + | backgroundOpacity | backgroundOpacity | set backgroundOpacity as null | get backgroundOpacity | default value for backgroundOpacity in closedcaptions | onBackgroundOpacityChanged for closedcaptions with 12 | closedcaptions onBackgroundOpacityChanged | + | textAlign | textAlign | set textAlign as null | get textAlign | default value for textAlign in closedcaptions | onTextAlignChanged for closedcaptions with center | closedcaptions onTextAlignChanged | + | textAlignVertical | textAlignVertical | set textAlignVertical as null | get textAlignVertical | default value for textAlignVertical in closedcaptions | onTextAlignVerticalChanged for closedcaptions with middle | closedcaptions onTextAlignVerticalChanged | + | windowColor | windowColor | set windowColor as null | get windowColor | default value for windowColor in closedcaptions | onWindowColorChanged for closedcaptions with #000000 | closedcaptions onWindowColorChanged | + | windowOpacity | windowOpacity | set windowOpacity as null | get windowOpacity | default value for windowOpacity in closedcaptions | onWindowOpacityChanged for closedcaptions with 0 | closedcaptions onWindowOpacityChanged | @ClosedCaptions @manageSDK Scenario Outline: ClosedCaptions. - Negative Scenario: expecting error diff --git a/cypress/fixtures/README.md b/cypress/fixtures/README.md index 7d998ec3..d339e8f5 100644 --- a/cypress/fixtures/README.md +++ b/cypress/fixtures/README.md @@ -51,7 +51,7 @@ fireboltCalls object has two types as shown below. - method or event - Name of the API or Event, which is used to extract the response object from global list for content validation. - validationJsonPath - Represent the JSON path used to obtain a specific value. - context - Represent the data that needs to be stored in api/event object that helps to search specific object in a global list. - - expected - Represent the expected value used for validating against a firebolt api response. + - content - Represent the expected value used for validating against a firebolt api response. - expectingError - Determines whether we are performing result or error content validation. Ex: ``` diff --git a/cypress/fixtures/fireboltCalls/accessibility.json b/cypress/fixtures/fireboltCalls/accessibility.json index ac6c12c6..cf670ace 100644 --- a/cypress/fixtures/fireboltCalls/accessibility.json +++ b/cypress/fixtures/fireboltCalls/accessibility.json @@ -501,10 +501,10 @@ "validationJsonPath": "eventResponse.styles.fontFamily", "content": "ACCESSIBILITY_FONTFAMILY_PROPORTIONAL_SERIF" }, - "MONOSPACED_SERIF_FOR_FONTFAMILY_IN_CLOSEDCAPTIONS_SETTINGS": { + "DEFAULT_VALUE_FOR_FONTFAMILY": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.fontFamily", - "content": "ACCESSIBILITY_FONTFAMILY_MONOSPACED_SERIF" + "content": "ACCESSIBILITY_FONTFAMILY_VALUE_FOR_NULL_PARAMS" }, "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_MONOSPACED_SERIF_FOR_FONTFAMILY": { "event": "accessibility.onClosedCaptionsSettingsChanged", @@ -541,10 +541,10 @@ "validationJsonPath": "eventResponse.styles.fontFamily", "content": "ACCESSIBILITY_FONTFAMILY_CASUAL" }, - "1_FOR_FONTSIZE_IN_CLOSEDCAPTIONS_SETTINGS": { + "DEFAULT_VALUE_FOR_FONTSIZE": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.fontSize", - "content": "INTEGER1" + "content": "ACCESSIBILITY_FONTSIZE_VALUE_FOR_NULL_PARAMS" }, "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_1_FOR_FONTSIZE": { "event": "accessibility.onClosedCaptionsSettingsChanged", @@ -576,10 +576,10 @@ "validationJsonPath": "eventResponse.styles.fontEdge", "content": "ACCESSIBILITY_FONTEDGE_RAISED" }, - "NONE_FOR_FONTEDGE_IN_CLOSEDCAPTIONS_SETTINGS": { + "DEFAULT_VALUE_FOR_FONTEDGE": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.fontEdge", - "content": "ACCESSIBILITY_FONTEDGE_NONE" + "content": "ACCESSIBILITY_FONTEDGE_VALUE_FOR_NULL_PARAMS" }, "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_NONE_FOR_FONTEDGE": { "event": "accessibility.onClosedCaptionsSettingsChanged", @@ -696,10 +696,10 @@ "validationJsonPath": "eventResponse.styles.textAlign", "content": "LEFT" }, - "CENTER_FOR_TEXTALIGN_IN_CLOSEDCAPTIONS_SETTINGS": { + "DEFAULT_VALUE_FOR_TEXTALIGN": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.textAlign", - "content": "CENTER" + "content": "ACCESSIBILITY_TEXTALIGN_VALUE_FOR_NULL_PARAMS" }, "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_CENTER_FOR_TEXTALIGN": { "event": "accessibility.onClosedCaptionsSettingsChanged", @@ -726,10 +726,10 @@ "validationJsonPath": "eventResponse.styles.textAlignVertical", "content": "TOP" }, - "MIDDLE_FOR_TEXTALIGNVERTICAL_IN_CLOSEDCAPTIONS_SETTINGS": { + "DEFAULT_VALUE_FOR_TEXTALIGNVERTICAL": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.textAlignVertical", - "content": "MIDDLE" + "content": "ACCESSIBILITY_TEXTALIGNVERTICAL_VALUE_FOR_NULL_PARAMS" }, "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_MIDDLE_FOR_TEXTALIGNVERTICAL": { "event": "accessibility.onClosedCaptionsSettingsChanged", @@ -886,45 +886,45 @@ "validationJsonPath": "eventResponse.enabled", "content": "TRUE" }, - "#FFFFFF_FOR_FONTCOLOR_IN_CLOSEDCAPTIONS_SETTINGS": { + "DEFAULT_VALUE_FOR_FONTCOLOR": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.fontColor", - "content": "ACCESSIBILITY_FONTCOLOR_FFFFFF" + "content": "ACCESSIBILITY_FONTCOLOR_VALUE_FOR_NULL_PARAMS" }, "#FFFFFF_FOR_FONTCOLOR_IN_CLOSEDCAPTIONS_SETTINGS_EVENT": { "event": "accessibility.onClosedCaptionsSettingsChanged", "validationJsonPath": "eventResponse.styles.fontColor", "content": "ACCESSIBILITY_FONTCOLOR_FFFFFF" }, - "#7F7F7F_FOR_FONTEDGECOLOR_IN_CLOSEDCAPTIONS_SETTINGS": { + "DEFAULT_VALUE_FOR_FONTEDGECOLOR": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.fontEdgeColor", - "content": "ACCESSIBILITY_FONTEDGECOLOR_7F7F7F" + "content": "ACCESSIBILITY_FONTEDGECOLOR_VALUE_FOR_NULL_PARAMS" }, "#7F7F7F_FOR_FONTEDGECOLOR_IN_CLOSEDCAPTIONS_SETTINGS_EVENT": { "event": "accessibility.onClosedCaptionsSettingsChanged", "validationJsonPath": "eventResponse.styles.fontEdgeColor", "content": "ACCESSIBILITY_FONTEDGECOLOR_7F7F7F" }, - "100_FOR_FONTOPACITY_IN_CLOSEDCAPTIONS_SETTINGS": { + "DEFAULT_VALUE_FOR_FONTOPACITY": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.fontOpacity", - "content": "INTEGER100" + "content": "ACCESSIBILITY_FONTOPACITY_VALUE_FOR_NULL_PARAMS" }, - "12_FOR_BACKGROUNDOPACITY_IN_CLOSEDCAPTIONS_SETTINGS": { + "DEFAULT_VALUE_FOR_BACKGROUNDOPACITY": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.backgroundOpacity", - "content": "INTEGER12" + "content": "ACCESSIBILITY_BACKGROUNDOPACITY_VALUE_FOR_NULL_PARAMS" }, - "#000000_FOR_BACKGROUNDCOLOR_IN_CLOSEDCAPTIONS_SETTINGS": { + "DEFAULT_VALUE_FOR_BACKGROUNDCOLOR": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.backgroundColor", - "content": "ACCESSIBILITY_BACKGROUNDCOLOR_000000" + "content": "ACCESSIBILITY_BACKGROUNDCOLOR_VALUE_FOR_NULL_PARAMS" }, - "#000000_FOR_WINDOWCOLOR_IN_CLOSEDCAPTIONS_SETTINGS": { + "DEFAULT_VALUE_FOR_WINDOWCOLOR": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.windowColor", - "content": "ACCESSIBILITY_WINDOWCOLOR_000000" + "content": "ACCESSIBILITY_WINDOWCOLOR_VALUE_FOR_NULL_PARAMS" }, "#000000_FOR_WINDOWCOLOR_IN_CLOSEDCAPTIONS_SETTINGS_EVENT": { "event": "accessibility.onClosedCaptionsSettingsChanged", @@ -936,10 +936,10 @@ "validationJsonPath": "eventResponse.styles.backgroundColor", "content": "ACCESSIBILITY_BACKGROUNDCOLOR_000000" }, - "0_FOR_WINDOWOPACITY_IN_CLOSEDCAPTIONS_SETTINGS": { + "DEFAULT_VALUE_FOR_WINDOWOPACITY": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.windowOpacity", - "content": "INTEGER0" + "content": "ACCESSIBILITY_WINDOWOPACITY_VALUE_FOR_NULL_PARAMS" }, "ONCLOSEDCAPTIONSSETTINGSCHANGED": { "event": "accessibility.onClosedCaptionsSettingsChanged", diff --git a/cypress/fixtures/fireboltCalls/closedcaptions.json b/cypress/fixtures/fireboltCalls/closedcaptions.json index a2e74e53..d36b408b 100644 --- a/cypress/fixtures/fireboltCalls/closedcaptions.json +++ b/cypress/fixtures/fireboltCalls/closedcaptions.json @@ -400,10 +400,10 @@ "validationJsonPath": "result", "content": "CLOSEDCAPTIONS_BACKGROUNDCOLOR" }, - "#000000_FOR_BACKGROUNDCOLOR_IN_CLOSEDCAPTIONS": { + "DEFAULT_VALUE_FOR_BACKGROUNDCOLOR_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.backgroundColor", "validationJsonPath": "result", - "content": "CLOSEDCAPTIONS_BACKGROUNDCOLOR_#000000" + "content": "NULL" }, "ONBACKGROUNDCOLORCHANGED_FOR_CLOSEDCAPTIONS_WITH_#FF00FF": { "event": "closedcaptions.onBackgroundColorChanged", @@ -420,10 +420,10 @@ "validationJsonPath": "result", "content": "CLOSEDCAPTIONS_BACKGROUNDOPACITY" }, - "12_FOR_BACKGROUNDOPACITY_IN_CLOSEDCAPTIONS": { + "DEFAULT_VALUE_FOR_BACKGROUNDOPACITY_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.backgroundOpacity", "validationJsonPath": "result", - "content": "CLOSEDCAPTIONS_BACKGROUNDOPACITY_12" + "content": "NULL" }, "ONBACKGROUNDOPACITYCHANGED_FOR_CLOSEDCAPTIONS_WITH_75": { "event": "closedcaptions.onBackgroundOpacityChanged", @@ -460,10 +460,10 @@ "validationJsonPath": "result", "content": "CLOSEDCAPTIONS_FONTCOLOR" }, - "#FFFFFF_FOR_FONTCOLOR_IN_CLOSEDCAPTIONS": { + "DEFAULT_VALUE_FOR_FONTCOLOR_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontColor", "validationJsonPath": "result", - "content": "CLOSEDCAPTIONS_FONTCOLOR_FFFFFF" + "content": "NULL" }, "ONFONTCOLORCHANGED_FOR_CLOSEDCAPTIONS_WITH_#FF00FF": { "event": "closedcaptions.onFontColorChanged", @@ -485,10 +485,10 @@ "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_FONTEDGE_RAISED" }, - "NONE_FOR_FONTEDGE_IN_CLOSEDCAPTIONS": { + "DEFAULT_VALUE_FOR_FONTEDGE_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontEdge", "validationJsonPath": "result", - "content": "CLOSEDCAPTIONS_FONTEDGE_NONE" + "content": "NULL" }, "ONFONTEDGECHANGED_FOR_CLOSEDCAPTIONS_WITH_NONE": { "event": "closedcaptions.onFontEdgeChanged", @@ -540,10 +540,10 @@ "validationJsonPath": "result", "content": "CLOSEDCAPTIONS_COLOR_#FFFFFF" }, - "#7F7F7F_FOR_FONTEDGECOLOR_IN_CLOSEDCAPTIONS": { + "DEFAULT_VALUE_FOR_FONTEDGECOLOR_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontEdgeColor", "validationJsonPath": "result", - "content": "ACCESSIBILITY_FONTEDGECOLOR_7F7F7F" + "content": "NULL" }, "ONFONTEDGECOLORCHANGED_FOR_CLOSEDCAPTIONS_WITH_#FFFFFF": { "event": "closedcaptions.onFontEdgeColorChanged", @@ -570,10 +570,10 @@ "validationJsonPath": "result", "content": "CLOSEDCAPTIONS_FONTOPACITY" }, - "100_FOR_FONTOPACITY_IN_CLOSEDCAPTIONS": { + "DEFAULT_VALUE_FOR_FONTOPACITY_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontOpacity", "validationJsonPath": "result", - "content": "CLOSEDCAPTIONS_FONTOPACITY_100" + "content": "NULL" }, "ONFONTOPACITYCHANGED_FOR_CLOSEDCAPTIONS_WITH_75": { "event": "closedcaptions.onFontOpacityChanged", @@ -585,10 +585,10 @@ "validationJsonPath": "eventResponse", "content": "INTEGER100" }, - "1_FOR_FONTSIZE_IN_CLOSEDCAPTIONS": { + "DEFAULT_VALUE_FOR_FONTSIZE_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontSize", "validationJsonPath": "result", - "content": "CLOSEDCAPTIONS_FONTSIZE" + "content": "NULL" }, "ONFONTSIZECHANGED_FOR_CLOSEDCAPTIONS_WITH_1": { "event": "closedcaptions.onFontSizeChanged", @@ -615,10 +615,10 @@ "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_TEXTALIGN_RIGHT" }, - "CENTER_FOR_TEXTALIGN_IN_CLOSEDCAPTIONS": { + "DEFAULT_VALUE_FOR_TEXTALIGN_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.textAlign", "validationJsonPath": "result", - "content": "CLOSEDCAPTIONS_TEXTALIGN_CENTER" + "content": "NULL" }, "ONTEXTALIGNCHANGED_FOR_CLOSEDCAPTIONS_WITH_CENTER": { "event": "closedcaptions.onTextAlignChanged", @@ -635,10 +635,10 @@ "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_TEXTALIGNVERTICAL_TOP" }, - "MIDDLE_FOR_TEXTALIGNVERTICAL_IN_CLOSEDCAPTIONS": { + "DEFAULT_VALUE_FOR_TEXTALIGNVERTICAL_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.textAlignVertical", "validationJsonPath": "result", - "content": "CLOSEDCAPTIONS_TEXTALIGNVERTICAL_MIDDLE" + "content": "NULL" }, "ONTEXTALIGNVERTICALCHANGED_FOR_CLOSEDCAPTIONS_WITH_MIDDLE": { "event": "closedcaptions.onTextAlignVerticalChanged", @@ -695,10 +695,10 @@ "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_FONTFAMILY_PROPORTIONAL_SERIF" }, - "MONOSPACED_SERIF_FOR_FONTFAMILY_IN_CLOSEDCAPTIONS": { + "DEFAULT_VALUE_FOR_FONTFAMILY_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontFamily", "validationJsonPath": "result", - "content": "CLOSEDCAPTIONS_FONTFAMILY_MONOSPACED_SERIF" + "content": "NULL" }, "ONFONTFAMILYCHANGED_FOR_CLOSEDCAPTIONS_WITH_MONOSPACED_SERIF": { "event": "closedcaptions.onFontFamilyChanged", @@ -755,10 +755,10 @@ "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_PREFERREDLANGUAGES_ARRAY" }, - "#000000_FOR_WINDOWCOLOR_IN_CLOSEDCAPTIONS": { + "DEFAULT_VALUE_FOR_WINDOWCOLOR_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.windowColor", "validationJsonPath": "result", - "content": "CLOSEDCAPTIONS_WINDOWCOLOR_#000000" + "content": "NULL" }, "WHITE_FOR_WINDOWCOLOR_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.windowColor", @@ -780,10 +780,10 @@ "validationJsonPath": "result", "content": "CLOSEDCAPTIONS_WINDOWOPACITY_50" }, - "0_FOR_WINDOWOPACITY_IN_CLOSEDCAPTIONS": { + "DEFAULT_VALUE_FOR_WINDOWOPACITY_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.windowOpacity", "validationJsonPath": "result", - "content": "CLOSEDCAPTIONS_WINDOWOPACITY_0", + "content": "NULL", "expectingError": false }, "ONWINDOWOPACITYCHANGED_FOR_CLOSEDCAPTIONS_WITH_50": { diff --git a/cypress/fixtures/objects/validationObjects/accessibility.json b/cypress/fixtures/objects/validationObjects/accessibility.json index b15aa0aa..06ae093b 100644 --- a/cypress/fixtures/objects/validationObjects/accessibility.json +++ b/cypress/fixtures/objects/validationObjects/accessibility.json @@ -44,6 +44,20 @@ } ] }, + "ACCESSIBILITY_FONTFAMILY_VALUE_FOR_NULL_PARAMS": { + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.fontFamily", + "description": "Validation of the accessibility fontfamily undefined" + } + ] + } + ] + }, "ACCESSIBILITY_FONTFAMILY_MONOSPACED_SERIF": { "method": "accessibility.closedCaptionsSettings", "data": [ @@ -74,6 +88,20 @@ } ] }, + "ACCESSIBILITY_FONTSIZE_VALUE_FOR_NULL_PARAMS": { + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.fontSize", + "description": "Validation of the accessibility fontSize undefined" + } + ] + } + ] + }, "ACCESSIBILITY_FONTFAMILY_SMALLCAPS": { "method": "accessibility.closedCaptionsSettings", "data": [ @@ -149,6 +177,20 @@ } ] }, + "ACCESSIBILITY_FONTEDGE_VALUE_FOR_NULL_PARAMS": { + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.fontEdge", + "description": "Validation of the accessibility fontEdge undefined" + } + ] + } + ] + }, "ACCESSIBILITY_FONTEDGE_NONE": { "method": "accessibility.closedCaptionsSettings", "data": [ @@ -269,6 +311,90 @@ } ] }, + "ACCESSIBILITY_FONTCOLOR_VALUE_FOR_NULL_PARAMS": { + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.fontColor", + "description": "Validation of the accessibility fontColor undefined" + } + ] + } + ] + }, + "ACCESSIBILITY_FONTEDGECOLOR_VALUE_FOR_NULL_PARAMS": { + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.fontEdgeColor", + "description": "Validation of the accessibility fontEdgeColor undefined" + } + ] + } + ] + }, + "ACCESSIBILITY_FONTOPACITY_VALUE_FOR_NULL_PARAMS": { + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.fontOpacity", + "description": "Validation of the accessibility fontEdgeOpacity undefined" + } + ] + } + ] + }, + "ACCESSIBILITY_BACKGROUNDCOLOR_VALUE_FOR_NULL_PARAMS": { + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.backgroundColor", + "description": "Validation of the accessibility backgroundColor undefined" + } + ] + } + ] + }, + "ACCESSIBILITY_BACKGROUNDOPACITY_VALUE_FOR_NULL_PARAMS": { + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.backgroundOpacity", + "description": "Validation of the accessibility backgroundOpacity undefined" + } + ] + } + ] + }, + "ACCESSIBILITY_TEXTALIGN_VALUE_FOR_NULL_PARAMS": { + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.textAlign", + "description": "Validation of the accessibility textAlign undefined" + } + ] + } + ] + }, "ACCESSIBILITY_FONTCOLOR_FFFFFF": { "method": "accessibility.closedCaptionsSettings", "data": [ @@ -284,6 +410,20 @@ } ] }, + "ACCESSIBILITY_TEXTALIGNVERTICAL_VALUE_FOR_NULL_PARAMS": { + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.textAlignVertical", + "description": "Validation of the accessibility textAlignVertical undefined" + } + ] + } + ] + }, "ACCESSIBILITY_FONTEDGECOLOR_7F7F7F": { "method": "accessibility.closedCaptionsSettings", "data": [ @@ -299,6 +439,20 @@ } ] }, + "ACCESSIBILITY_WINDOWCOLOR_VALUE_FOR_NULL_PARAMS": { + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.windowColor", + "description": "Validation of the accessibility windowcolor undefined" + } + ] + } + ] + }, "ACCESSIBILITY_BACKGROUNDCOLOR_000000": { "method": "accessibility.closedCaptionsSettings", "data": [ @@ -328,5 +482,19 @@ ] } ] + }, + "ACCESSIBILITY_WINDOWOPACITY_VALUE_FOR_NULL_PARAMS": { + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.windowOpacity", + "description": "Validation of the accessibility windowopacity undefined" + } + ] + } + ] } } \ No newline at end of file diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 5be43d33..e1300529 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -380,6 +380,7 @@ module.exports = { TRANSPORT: 'transport', TYPE_OBJECT: 'object', TYPE_STRING: 'string', + UNDEFINED: 'undefined', UNIQUEID: 'uniqueid', UNLOADING_APP_TEST_TYPES: [ 'lifecycle', diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index cecd8fea..aa6a5daa 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -666,6 +666,10 @@ class FireLog { assert.isNotNull(value, message); } + isUndefined(value, message) { + assert.isUndefined(value, message); + } + isTrue(value, message) { assert.isTrue(value, message); } diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index a33db307..95975db8 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -145,6 +145,7 @@ Given( } try { + console.log("2055 1", contentObject) if (contentObject && contentObject.data) { contentObject.data.forEach((object) => { if (object.validations) { @@ -201,6 +202,13 @@ Given( case CONSTANTS.CUSTOM: cy.customValidation(object, methodOrEventObject); break; + case CONSTANTS.UNDEFINED: + cy.undefinedValidation( + object, + methodOrEventObject, + validationType + ); + break; default: assert(false, 'Unsupported validation type'); break; diff --git a/cypress/support/step_definitions/validations.md b/cypress/support/step_definitions/validations.md index 90a5b71d..ad5c3aa8 100644 --- a/cypress/support/step_definitions/validations.md +++ b/cypress/support/step_definitions/validations.md @@ -62,6 +62,8 @@ | decode | Used when the incoming response has to be decoded and validated. It can be base64 or JWT. | | fixture | Used when the response value is to be validated against an expected value already provided. | | custom | Used when the incoming response has to be validated using a customized function provided in the configModule. | +| undefined | Used when the incoming response has to be validated against undefined value. | + ## regEx ### format: @@ -239,6 +241,7 @@ } ] } + ## custom ### format: { @@ -285,6 +288,49 @@ ] } + +## undefined +### format: +{ + "method": "", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "", + "description": "" + } + ] + } + ] +} + +### Params: +| Param | type | Description | +| ------------ | ------ | --------------------------------------------------------------------------------------------------------- | +| method | string | The name of the method whose response is to be validated. | +| data | array | An array that holds the entire set of validation objects. | +| type | string | The value which indicates the type of validation. | +| validations | array | The array that holds all the data for validation, like value, format, etc. | +| field | string | The field to be validated ( depends on the validation function ). | +| description | string | The description of the validation executed with this type. | + +### Example: + "method": "accessibility.closedCaptionsSettings", + "data": [ + { + "type": "undefined", + "validations": [ + { + "field": "result.styles.windowColor", + "description": "Validation of the accessibility windowcolor undefined" + } + ] + } + ] + + # Validation Override ## Format @@ -363,4 +409,4 @@ Here, the value of the key "assertionDef" will be the customMethod we use for va ] } ] -} +} \ No newline at end of file diff --git a/cypress/support/validations/index.js b/cypress/support/validations/index.js index b601b024..c60597d8 100644 --- a/cypress/support/validations/index.js +++ b/cypress/support/validations/index.js @@ -19,3 +19,4 @@ import './miscellaneousValidation'; import './decodeValidation'; import './regExValidation'; import './schemaValidation'; +import './undefinedValidation'; diff --git a/cypress/support/validations/undefinedValidation.js b/cypress/support/validations/undefinedValidation.js new file mode 100644 index 00000000..a0ce0eb9 --- /dev/null +++ b/cypress/support/validations/undefinedValidation.js @@ -0,0 +1,92 @@ +/** + * @module undefinedValidation + * @function undefinedValidation + * @description To validate the content of the response if undefined + * @param {Object} validationTypeObject - The object consists of required fields for validation. + * @param {Object} apiOrEventObject - Extracted API or Event object from global list. + * @param {String} validationType - To check whether to validate event or method + * @example + * cy.undefinedValidation(validationTypeObject, apiOrEventObject) + */ + +const CONSTANTS = require('../constants/constants'); +const { fireLog } = require('../cypress-support/src/utils'); + +Cypress.Commands.add( + 'undefinedValidation', + (validationTypeObject, apiOrEventObject, validationType) => { + console.log("2055 2", validationTypeObject) + + if (validationTypeObject != null && apiOrEventObject != null) { + try { + const methodOrEventResponse = + validationType == CONSTANTS.EVENT + ? apiOrEventObject.eventResponse + : validationType == CONSTANTS.METHOD + ? apiOrEventObject.response + : null; + const methodOrEventName = + validationType == CONSTANTS.EVENT + ? apiOrEventObject.eventName + : validationType == CONSTANTS.METHOD + ? apiOrEventObject.apiName + : null; + // Loop through each item of validations array of validation object + validationTypeObject.validations.forEach((validation) => { + // If the field to be validated is result, directly assert if result stored in response is undefined + if (validation.field === CONSTANTS.RESULT) { + fireLog.isUndefined( + methodOrEventResponse.result, + `Undefined Validation : Expected ${methodOrEventName} response to have the field ${validation.field} as undefined` + ); + } else { + // Else recursilvely access the nested field properties and verify the corresponding value in response is undefined + const fieldParts = validation.field.split('.'); + let currentObject = methodOrEventResponse; + // Throw error if any properties other than the provided field is undefined + for (let i = 0; i < fieldParts.length - 1; i++) { + const part = fieldParts[i]; + if (!currentObject || typeof currentObject[part] === CONSTANTS.UNDEFINED) { + cy.log( + `Undefined Validation : Expected ${methodOrEventName} response to have property ${part} in the field ${validation.field}` + ).then(() => { + assert( + false, + `Expected ${methodOrEventName} response to have property ${part} in the field ${validation.field}` + ); + }); + } + currentObject = currentObject[part]; + } + // Else assert if provided field is undefined + const finalPart = fieldParts[fieldParts.length - 1]; + fireLog.isUndefined( + currentObject[finalPart], + `Undefined Validation : Expected ${methodOrEventName} response to have the field ${validation.field} as undefined` + ); + } + }); + } catch (error) { + cy.log( + `Undefined Validation : Received following error while performing validation of type undefined on response', + ${JSON.stringify(error)}` + ).then(() => { + assert( + false, + `Undefined Validation : Received following error while performing validation of type undefined on response', + ${JSON.stringify(error)}` + ); + }); + } + } else { + cy.log( + `Undefined Validation : Expected validation object or api/event object stored in global list to not be undefined` + ).then(() => { + assert( + false, + 'Undefined Validation : Expected validation object or api/event object stored in global list to not be undefined' + ); + }); + } + } +); From dcf293e3bed174e625bfa10b1f32c6bfe4c72eeb Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 23 May 2024 14:00:27 +0530 Subject: [PATCH 062/359] FIRECERT-2055-moving current changes to new PR --- .../Accessibility.feature | 230 +++++++++--------- .../support/step_definitions/validations.js | 7 +- .../validations/undefinedValidation.js | 2 - 3 files changed, 116 insertions(+), 123 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Accessibility.feature b/cypress/TestCases/FireboltCertification/Accessibility.feature index 8d7d5187..5c8fe05d 100644 --- a/cypress/TestCases/FireboltCertification/Accessibility.feature +++ b/cypress/TestCases/FireboltCertification/Accessibility.feature @@ -4,50 +4,50 @@ Feature: Accessibility Given the environment has been set up for 'Accessibility' tests And 3rd party 'certification' app is launched - # @Accessibility @coreSDK @sdk @transport - # Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: - # When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API - # And '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' - # And 1st party app invokes the 'Firebolt' API to '' - # Then 'Firebolt' platform responds to '1st party app' for '' - # When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' - # Then 'Firebolt' platform responds with '' - # And 'Firebolt' platform triggers event '' + @Accessibility @coreSDK @sdk @transport + Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: + When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API + And '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' + And 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' + Then 'Firebolt' platform responds with '' + And 'Firebolt' platform triggers event '' - # Examples: - # | Scenario | Key | Method_Content | Event_Content | - # | Disable closedcaptions | disable closedCaptions | disabled for closedCaptions settings | onclosedCaptionsSettingsChanged with disabled | - # | Enable closedcaptions | enable closedCaptions | enabled for closedCaptions settings | onclosedCaptionsSettingsChanged with enabled | - # | Set fontFamily-monospaced_sanserif | set fontFamily to monospaced_sanserif | monospace sanserif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with monospace sanserif for fontfamily | - # | Set fontFamily-cursive | set fontFamily to cursive | cursive for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with cursive for fontfamily | - # | Set fontFamily-proportional_serif | set fontFamily to proportional_serif | proportional serif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with proportional serif for fontfamily | - # | Set fontFamily-monospaced_serif | set fontFamily to monospaced_serif | monospaced serif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with monospaced serif for fontfamily | - # | Set fontFamily-proportional_sanserif | set fontFamily to proportional_sanserif | proportional sanserif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with proportional sanserif for fontfamily | - # | Set fontFamily-smallcaps | set fontFamily to smallcaps | smallcaps for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with smallcaps for fontfamily | - # | Set fontFamily-casual | set fontFamily to casual | casual for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with casual for fontfamily | - # | Set fontSize-1 | set fontSize to 1 | 1 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 1 for fontSize | - # | Set fontSize-0.5 | set fontSize to 0.5 | 0.5 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 0.5 for fontSize | - # | Set fontSize-1.5 | set fontSize to 1.5 | 1.5 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 1.5 for fontSize | - # | Set fontColor-#ff00ff | set fontColor to #ff00ff | #ff00ff for fontColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #ff00ff for fontColor | - # | Set fontEdge-raised | set fontEdge to raised | raised for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with raised for fontEdge | - # | Set fontEdge-none | set fontEdge to none | none for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with none for fontEdge | - # | Set fontEdge-depressed | set fontEdge to depressed | depressed for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with depressed for fontEdge | - # | Set fontEdge-uniform | set fontEdge to uniform | uniform for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with uniform for fontEdge | - # | Set fontEdge-dropShadow-left | set fontEdge to dropShadow_left | dropShadowLeft for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with dropShadowLeft for fontEdge | - # | Set fontEdge-dropShadow-right | set fontEdge to dropShadow_right | dropShadowRight for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with dropShadowRight for fontEdge | - # | Set fontEdgeColor-#FFFFFF | set fontEdgeColor to #FFFFFF | #ffffff for fontEdgeColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #ffffff for fontEdgeColor | - # | Set backgroundColor-#7f7f7f | set backgroundColor to #7f7f7f | #7f7f7f for backgroundColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #7f7f7f for backgroundColor | - # | Set fontOpacity-75 | set fontOpacity to 75 | 75 for fontOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 75 for fontOpacity | - # | Set backgroundOpacity-75 | set backgroundOpacity to 75 | 75 for backgroundOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 75 for backgroundOpacity | - # | Set textAlign-left | set textAlign to left | left for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with left for textAlign | - # | Set textAlign-center | set textAlign to center | center for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with center for textAlign | - # | Set textAlign-right | set textAlign to right | right for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with right for textAlign | - # | Set textAlignVertical-top | set textAlignVertical to top | top for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with top for textAlignVertical | - # | Set textAlignVertical-middle | set textAlignVertical to middle | middle for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with middle for textAlignVertical | - # | Set textAlignVertical-bottom | set textAlignVertical to bottom | bottom for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with bottom for textAlignVertical | - # | Set windowColor-white | set windowColor to white | white for windowColor in closedcaptions settings | onclosedCaptionsSettingsChanged with white for windowColor | - # | Set windowOpacity-50 | set windowOpacity to 50 | 50 for windowOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 50 for windowOpacity | - # | Set preferredLanguages | set preferredLanguages to spanish english | spanish for preferredLanguages in closedcaptions settings | onclosedCaptionsSettingsChanged with spanish for preferredLanguages | + Examples: + | Scenario | Key | Method_Content | Event_Content | + | Disable closedcaptions | disable closedCaptions | disabled for closedCaptions settings | onclosedCaptionsSettingsChanged with disabled | + | Enable closedcaptions | enable closedCaptions | enabled for closedCaptions settings | onclosedCaptionsSettingsChanged with enabled | + | Set fontFamily-monospaced_sanserif | set fontFamily to monospaced_sanserif | monospace sanserif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with monospace sanserif for fontfamily | + | Set fontFamily-cursive | set fontFamily to cursive | cursive for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with cursive for fontfamily | + | Set fontFamily-proportional_serif | set fontFamily to proportional_serif | proportional serif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with proportional serif for fontfamily | + | Set fontFamily-monospaced_serif | set fontFamily to monospaced_serif | monospaced serif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with monospaced serif for fontfamily | + | Set fontFamily-proportional_sanserif | set fontFamily to proportional_sanserif | proportional sanserif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with proportional sanserif for fontfamily | + | Set fontFamily-smallcaps | set fontFamily to smallcaps | smallcaps for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with smallcaps for fontfamily | + | Set fontFamily-casual | set fontFamily to casual | casual for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with casual for fontfamily | + | Set fontSize-1 | set fontSize to 1 | 1 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 1 for fontSize | + | Set fontSize-0.5 | set fontSize to 0.5 | 0.5 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 0.5 for fontSize | + | Set fontSize-1.5 | set fontSize to 1.5 | 1.5 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 1.5 for fontSize | + | Set fontColor-#ff00ff | set fontColor to #ff00ff | #ff00ff for fontColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #ff00ff for fontColor | + | Set fontEdge-raised | set fontEdge to raised | raised for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with raised for fontEdge | + | Set fontEdge-none | set fontEdge to none | none for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with none for fontEdge | + | Set fontEdge-depressed | set fontEdge to depressed | depressed for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with depressed for fontEdge | + | Set fontEdge-uniform | set fontEdge to uniform | uniform for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with uniform for fontEdge | + | Set fontEdge-dropShadow-left | set fontEdge to dropShadow_left | dropShadowLeft for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with dropShadowLeft for fontEdge | + | Set fontEdge-dropShadow-right | set fontEdge to dropShadow_right | dropShadowRight for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with dropShadowRight for fontEdge | + | Set fontEdgeColor-#FFFFFF | set fontEdgeColor to #FFFFFF | #ffffff for fontEdgeColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #ffffff for fontEdgeColor | + | Set backgroundColor-#7f7f7f | set backgroundColor to #7f7f7f | #7f7f7f for backgroundColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #7f7f7f for backgroundColor | + | Set fontOpacity-75 | set fontOpacity to 75 | 75 for fontOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 75 for fontOpacity | + | Set backgroundOpacity-75 | set backgroundOpacity to 75 | 75 for backgroundOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 75 for backgroundOpacity | + | Set textAlign-left | set textAlign to left | left for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with left for textAlign | + | Set textAlign-center | set textAlign to center | center for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with center for textAlign | + | Set textAlign-right | set textAlign to right | right for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with right for textAlign | + | Set textAlignVertical-top | set textAlignVertical to top | top for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with top for textAlignVertical | + | Set textAlignVertical-middle | set textAlignVertical to middle | middle for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with middle for textAlignVertical | + | Set textAlignVertical-bottom | set textAlignVertical to bottom | bottom for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with bottom for textAlignVertical | + | Set windowColor-white | set windowColor to white | white for windowColor in closedcaptions settings | onclosedCaptionsSettingsChanged with white for windowColor | + | Set windowOpacity-50 | set windowOpacity to 50 | 50 for windowOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 50 for windowOpacity | + | Set preferredLanguages | set preferredLanguages to spanish english | spanish for preferredLanguages in closedcaptions settings | onclosedCaptionsSettingsChanged with spanish for preferredLanguages | @Accessibility @coreSDK @sdk @transport Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: with 'null' params @@ -74,84 +74,84 @@ Feature: Accessibility | windowColor | set windowColor as null | default value for windowColor | onclosedCaptionsSettingsChanged with white for windowColor | | windowOpacity | set windowOpacity as null | default value for windowOpacity | onclosedCaptionsSettingsChanged with 0 for windowOpacity | - # @Accessibility @coreSDK @sdk @transport - # Scenario Outline: Accessibility.voiceGuidanceSettings - Positive Scenario: - # When '3rd party app' registers for the 'accessibility onVoiceGuidanceSettingsChanged' event using the 'Firebolt' API - # And '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance settings' - # And 1st party app invokes the 'Firebolt' API to '' - # Then 'Firebolt' platform responds to '1st party app' for '' - # When '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance settings' - # Then 'Firebolt' platform responds with '' - # And 'Firebolt' platform triggers event '' + @Accessibility @coreSDK @sdk @transport + Scenario Outline: Accessibility.voiceGuidanceSettings - Positive Scenario: + When '3rd party app' registers for the 'accessibility onVoiceGuidanceSettingsChanged' event using the 'Firebolt' API + And '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance settings' + And 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance settings' + Then 'Firebolt' platform responds with '' + And 'Firebolt' platform triggers event '' - # Examples: - # | Scenario | Key | Method_Content | Event_Content | - # | Disable voiceguidance | disable voiceGuidance | disabled voiceGuidance settings | onvoiceGuidanceSettings with disabled | - # | Enable voiceguidance | enable voiceGuidance | enabled voiceGuidance settings | onvoiceGuidanceSettings with enabled | - # | Set speed-1 | set speed as 1 | 1 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 1 for speed | - # | Set speed-0.5 | set speed as 0.5 | 0.5 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 0.5 for speed | - # | Set speed-2 | set speed as 2 | 2 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 2 for speed | + Examples: + | Scenario | Key | Method_Content | Event_Content | + | Disable voiceguidance | disable voiceGuidance | disabled voiceGuidance settings | onvoiceGuidanceSettings with disabled | + | Enable voiceguidance | enable voiceGuidance | enabled voiceGuidance settings | onvoiceGuidanceSettings with enabled | + | Set speed-1 | set speed as 1 | 1 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 1 for speed | + | Set speed-0.5 | set speed as 0.5 | 0.5 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 0.5 for speed | + | Set speed-2 | set speed as 2 | 2 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 2 for speed | - # @Accessibility @coreSDK @sdk @transport - # Scenario Outline: Accessibility.audioDescriptionSettings - Positive Scenario: - # When '3rd party app' registers for the 'accessibility onAudioDescriptionSettingsChanged' event using the 'Firebolt' API - # And '3rd party app' invokes the 'Firebolt' API to 'get audioDescriptionSettings settings' - # And 1st party app invokes the 'Firebolt' API to '' - # Then 'Firebolt' platform responds to '1st party app' for '' - # When '3rd party app' invokes the 'Firebolt' API to 'get audioDescriptionSettings settings' - # Then 'Firebolt' platform responds with '' - # And 'Firebolt' platform triggers event '' + @Accessibility @coreSDK @sdk @transport + Scenario Outline: Accessibility.audioDescriptionSettings - Positive Scenario: + When '3rd party app' registers for the 'accessibility onAudioDescriptionSettingsChanged' event using the 'Firebolt' API + And '3rd party app' invokes the 'Firebolt' API to 'get audioDescriptionSettings settings' + And 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to 'get audioDescriptionSettings settings' + Then 'Firebolt' platform responds with '' + And 'Firebolt' platform triggers event '' - # Examples: - # | Scenario | Key | Method_Content | Event_Content | - # | Disable audioDescriptionSettings | disable audioDescription | disabled audioDescription settings | onaudioDescriptionSettings with disabled | - # | Enable audioDescriptionSettings | enable audioDescription | enabled audioDescription settings | onaudioDescriptionSettings with enabled | + Examples: + | Scenario | Key | Method_Content | Event_Content | + | Disable audioDescriptionSettings | disable audioDescription | disabled audioDescription settings | onaudioDescriptionSettings with disabled | + | Enable audioDescriptionSettings | enable audioDescription | enabled audioDescription settings | onaudioDescriptionSettings with enabled | - # @Accessibility @coreSDK @sdk @transport - # Scenario: Accessibility.onClosedCaptionsSettingsChanged event - Positive Scenario: Clear listeners - # When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API - # And I clear 'accessibility onClosedCaptionsSettingsChanged event' listeners - # And 1st party app invokes the 'Firebolt' API to 'disable closedCaptions' - # Then 'Firebolt' platform responds to '1st party app' for 'disable closedCaptions' - # And 'Firebolt' platform does not trigger event for 'onclosedCaptionsSettingsChanged' + @Accessibility @coreSDK @sdk @transport + Scenario: Accessibility.onClosedCaptionsSettingsChanged event - Positive Scenario: Clear listeners + When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API + And I clear 'accessibility onClosedCaptionsSettingsChanged event' listeners + And 1st party app invokes the 'Firebolt' API to 'disable closedCaptions' + Then 'Firebolt' platform responds to '1st party app' for 'disable closedCaptions' + And 'Firebolt' platform does not trigger event for 'onclosedCaptionsSettingsChanged' - # @Accessibility @coreSDK @sdk @transport - # Scenario Outline: Accessibility.closedCaptions - Positive Scenario: - # When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API - # And 1st party app invokes the 'Firebolt' API to '' - # Then 'Firebolt' platform responds to '1st party app' for '' - # When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions' - # Then 'Firebolt' platform responds with '' - # And 'Firebolt' platform triggers event '' + @Accessibility @coreSDK @sdk @transport + Scenario Outline: Accessibility.closedCaptions - Positive Scenario: + When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API + And 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions' + Then 'Firebolt' platform responds with '' + And 'Firebolt' platform triggers event '' - # Examples: - # | Scenario | Set_Method_Key | Method_Content | Event_Content | - # | Enable closedcaptions | enable closedCaptions | enabled for accessibility closedCaptions | onclosedCaptionsSettingsChanged with enabled | - # | Set fontFamily-monospaced_sanserif | set fontFamily to monospaced_sanserif | monospace sanserif for fontfamily in accessibility closedcaptions | onclosedCaptionsSettingsChanged with monospace sanserif for fontfamily | - # | Set fontSize-1 | set fontSize to 1 | 1 for fontSize in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 1 for fontSize | - # | Set fontColor-#ffffff | set fontColor to #ffffff | #ffffff for fontColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #ffffff for fontColor | - # | Set fontEdge-raised | set fontEdge to raised | raised for fontEdge in accessibility closedcaptions | onclosedCaptionsSettingsChanged with raised for fontEdge | - # | Set fontEdgeColor-#7f7f7f | set fontEdgeColor to #7f7f7f | #7f7f7f for fontEdgeColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #7f7f7f for fontEdgeColor | - # | Set backgroundColor-#000000 | set backgroundColor to #000000 | #000000 for backgroundColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #000000 for backgroundColor | - # | Set fontOpacity-100 | set fontOpacity to 100 | 100 for fontOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 100 for fontOpacity | - # | Set backgroundOpacity-100 | set backgroundOpacity to 100 | 100 for backgroundOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 100 for backgroundOpacity | - # | Set textAlign-left | set textAlign to left | left for textAlign in accessibility closedcaptions | onclosedCaptionsSettingsChanged with left for textAlign | - # | Set textAlignVertical-top | set textAlignVertical to top | top for textAlignVertical in accessibility closedcaptions | onclosedCaptionsSettingsChanged with top for textAlignVertical | - # | Set windowColor-#7f7f7f | set windowColor to #7f7f7f | #7f7f7f for windowColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #7f7f7f for windowColor | - # | Set windowOpacity-40 | set windowOpacity to 40 | 40 for windowOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 40 for windowOpacity | + Examples: + | Scenario | Set_Method_Key | Method_Content | Event_Content | + | Enable closedcaptions | enable closedCaptions | enabled for accessibility closedCaptions | onclosedCaptionsSettingsChanged with enabled | + | Set fontFamily-monospaced_sanserif | set fontFamily to monospaced_sanserif | monospace sanserif for fontfamily in accessibility closedcaptions | onclosedCaptionsSettingsChanged with monospace sanserif for fontfamily | + | Set fontSize-1 | set fontSize to 1 | 1 for fontSize in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 1 for fontSize | + | Set fontColor-#ffffff | set fontColor to #ffffff | #ffffff for fontColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #ffffff for fontColor | + | Set fontEdge-raised | set fontEdge to raised | raised for fontEdge in accessibility closedcaptions | onclosedCaptionsSettingsChanged with raised for fontEdge | + | Set fontEdgeColor-#7f7f7f | set fontEdgeColor to #7f7f7f | #7f7f7f for fontEdgeColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #7f7f7f for fontEdgeColor | + | Set backgroundColor-#000000 | set backgroundColor to #000000 | #000000 for backgroundColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #000000 for backgroundColor | + | Set fontOpacity-100 | set fontOpacity to 100 | 100 for fontOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 100 for fontOpacity | + | Set backgroundOpacity-100 | set backgroundOpacity to 100 | 100 for backgroundOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 100 for backgroundOpacity | + | Set textAlign-left | set textAlign to left | left for textAlign in accessibility closedcaptions | onclosedCaptionsSettingsChanged with left for textAlign | + | Set textAlignVertical-top | set textAlignVertical to top | top for textAlignVertical in accessibility closedcaptions | onclosedCaptionsSettingsChanged with top for textAlignVertical | + | Set windowColor-#7f7f7f | set windowColor to #7f7f7f | #7f7f7f for windowColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #7f7f7f for windowColor | + | Set windowOpacity-40 | set windowOpacity to 40 | 40 for windowOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 40 for windowOpacity | - # @Accessibility @coreSDK @sdk @transport - # Scenario Outline: Accessibility.voiceGuidance - Positive Scenario: - # When '3rd party app' registers for the 'accessibility onVoiceGuidanceSettingsChanged' event using the 'Firebolt' API - # And 1st party app invokes the 'Firebolt' API to '' - # Then 'Firebolt' platform responds to '1st party app' for '' - # When '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance' - # Then 'Firebolt' platform responds with '' - # And 'Firebolt' platform triggers event '' + @Accessibility @coreSDK @sdk @transport + Scenario Outline: Accessibility.voiceGuidance - Positive Scenario: + When '3rd party app' registers for the 'accessibility onVoiceGuidanceSettingsChanged' event using the 'Firebolt' API + And 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance' + Then 'Firebolt' platform responds with '' + And 'Firebolt' platform triggers event '' - # Examples: - # | Scenario | Set_Method_Key | Method_Content | Event_Content | - # | Disable voiceguidance | disable voiceGuidance | disabled voiceGuidance | onvoiceGuidanceSettings with disabled | - # | Enable voiceguidance | enable voiceGuidance | enabled voiceGuidance | onvoiceGuidanceSettings with enabled | - # | Set speed-1 | set speed as 1 | 1 for speed in voiceGuidance | onvoiceGuidanceSettings with 1 for speed | \ No newline at end of file + Examples: + | Scenario | Set_Method_Key | Method_Content | Event_Content | + | Disable voiceguidance | disable voiceGuidance | disabled voiceGuidance | onvoiceGuidanceSettings with disabled | + | Enable voiceguidance | enable voiceGuidance | enabled voiceGuidance | onvoiceGuidanceSettings with enabled | + | Set speed-1 | set speed as 1 | 1 for speed in voiceGuidance | onvoiceGuidanceSettings with 1 for speed | \ No newline at end of file diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 95975db8..248d5d36 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -145,7 +145,6 @@ Given( } try { - console.log("2055 1", contentObject) if (contentObject && contentObject.data) { contentObject.data.forEach((object) => { if (object.validations) { @@ -203,11 +202,7 @@ Given( cy.customValidation(object, methodOrEventObject); break; case CONSTANTS.UNDEFINED: - cy.undefinedValidation( - object, - methodOrEventObject, - validationType - ); + cy.undefinedValidation(object, methodOrEventObject, validationType); break; default: assert(false, 'Unsupported validation type'); diff --git a/cypress/support/validations/undefinedValidation.js b/cypress/support/validations/undefinedValidation.js index a0ce0eb9..4b744235 100644 --- a/cypress/support/validations/undefinedValidation.js +++ b/cypress/support/validations/undefinedValidation.js @@ -15,8 +15,6 @@ const { fireLog } = require('../cypress-support/src/utils'); Cypress.Commands.add( 'undefinedValidation', (validationTypeObject, apiOrEventObject, validationType) => { - console.log("2055 2", validationTypeObject) - if (validationTypeObject != null && apiOrEventObject != null) { try { const methodOrEventResponse = From a1798d53e954cff2b7b2bebf75369b9f92f180b1 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 23 May 2024 15:56:31 +0530 Subject: [PATCH 063/359] FIRECERT-2055-moving current changes to new PR --- cypress/support/validations/undefinedValidation.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/support/validations/undefinedValidation.js b/cypress/support/validations/undefinedValidation.js index 4b744235..066c0c6b 100644 --- a/cypress/support/validations/undefinedValidation.js +++ b/cypress/support/validations/undefinedValidation.js @@ -48,7 +48,7 @@ Cypress.Commands.add( cy.log( `Undefined Validation : Expected ${methodOrEventName} response to have property ${part} in the field ${validation.field}` ).then(() => { - assert( + fireLog.assert( false, `Expected ${methodOrEventName} response to have property ${part} in the field ${validation.field}` ); @@ -69,7 +69,7 @@ Cypress.Commands.add( `Undefined Validation : Received following error while performing validation of type undefined on response', ${JSON.stringify(error)}` ).then(() => { - assert( + fireLog.assert( false, `Undefined Validation : Received following error while performing validation of type undefined on response', ${JSON.stringify(error)}` @@ -80,7 +80,7 @@ Cypress.Commands.add( cy.log( `Undefined Validation : Expected validation object or api/event object stored in global list to not be undefined` ).then(() => { - assert( + fireLog.assert( false, 'Undefined Validation : Expected validation object or api/event object stored in global list to not be undefined' ); From a3e3a6b5b3d9ae31ebd089f76f965dc858131671 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 23 May 2024 18:19:13 +0530 Subject: [PATCH 064/359] FIRECERT-2055-latest changes --- .../fixtures/fireboltCalls/accessibility.json | 25 +++++++++++++++++++ .../fireboltCalls/closedcaptions.json | 25 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/cypress/fixtures/fireboltCalls/accessibility.json b/cypress/fixtures/fireboltCalls/accessibility.json index cf670ace..248c5a48 100644 --- a/cypress/fixtures/fireboltCalls/accessibility.json +++ b/cypress/fixtures/fireboltCalls/accessibility.json @@ -941,6 +941,31 @@ "validationJsonPath": "result.styles.windowOpacity", "content": "ACCESSIBILITY_WINDOWOPACITY_VALUE_FOR_NULL_PARAMS" }, + "MONOSPACED_SERIF_FOR_FONTFAMILY_IN_CLOSEDCAPTIONS_SETTINGS": { + "method": "accessibility.closedCaptionsSettings", + "validationJsonPath": "result.styles.fontFamily", + "content": "ACCESSIBILITY_FONTFAMILY_MONOSPACED_SERIF" + }, + "1_FOR_FONTSIZE_IN_CLOSEDCAPTIONS_SETTINGS": { + "method": "accessibility.closedCaptionsSettings", + "validationJsonPath": "result.styles.fontSize", + "content": "INTEGER1" + }, + "CENTER_FOR_TEXTALIGN_IN_CLOSEDCAPTIONS_SETTINGS": { + "method": "accessibility.closedCaptionsSettings", + "validationJsonPath": "result.styles.textAlign", + "content": "CENTER" + }, + "MIDDLE_FOR_TEXTALIGNVERTICAL_IN_CLOSEDCAPTIONS_SETTINGS": { + "method": "accessibility.closedCaptionsSettings", + "validationJsonPath": "result.styles.textAlignVertical", + "content": "MIDDLE" + }, + "NONE_FOR_FONTEDGE_IN_CLOSEDCAPTIONS_SETTINGS": { + "method": "accessibility.closedCaptionsSettings", + "validationJsonPath": "result.styles.fontEdge", + "content": "ACCESSIBILITY_FONTEDGE_NONE" + }, "ONCLOSEDCAPTIONSSETTINGSCHANGED": { "event": "accessibility.onClosedCaptionsSettingsChanged", "validationJsonPath": "eventResponse", diff --git a/cypress/fixtures/fireboltCalls/closedcaptions.json b/cypress/fixtures/fireboltCalls/closedcaptions.json index d36b408b..9a20a9b5 100644 --- a/cypress/fixtures/fireboltCalls/closedcaptions.json +++ b/cypress/fixtures/fireboltCalls/closedcaptions.json @@ -535,11 +535,36 @@ "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_FONTEDGE_DROPSHADOW_RIGHT" }, + "MIDDLE_FOR_TEXTALIGNVERTICAL_IN_CLOSEDCAPTIONS": { + "method": "closedcaptions.textAlignVertical", + "validationJsonPath": "result", + "content": "CLOSEDCAPTIONS_TEXTALIGNVERTICAL_MIDDLE" + }, "#FFFFFF_FOR_FONTEDGECOLOR_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontEdgeColor", "validationJsonPath": "result", "content": "CLOSEDCAPTIONS_COLOR_#FFFFFF" }, + "CENTER_FOR_TEXTALIGN_IN_CLOSEDCAPTIONS": { + "method": "closedcaptions.textAlign", + "validationJsonPath": "result", + "content": "CLOSEDCAPTIONS_TEXTALIGN_CENTER" + }, + "1_FOR_FONTSIZE_IN_CLOSEDCAPTIONS": { + "method": "closedcaptions.fontSize", + "validationJsonPath": "result", + "content": "CLOSEDCAPTIONS_FONTSIZE" + }, + "MONOSPACED_SERIF_FOR_FONTFAMILY_IN_CLOSEDCAPTIONS": { + "method": "closedcaptions.fontFamily", + "validationJsonPath": "result", + "content": "CLOSEDCAPTIONS_FONTFAMILY_MONOSPACED_SERIF" + }, + "NONE_FOR_FONTEDGE_IN_CLOSEDCAPTIONS": { + "method": "closedcaptions.fontEdge", + "validationJsonPath": "result", + "content": "CLOSEDCAPTIONS_FONTEDGE_NONE" + }, "DEFAULT_VALUE_FOR_FONTEDGECOLOR_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontEdgeColor", "validationJsonPath": "result", From e1dc35ee33d1f38bebadabcc7d2e2920b5a6619c Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Thu, 23 May 2024 21:59:52 +0530 Subject: [PATCH 065/359] FIRECERT-1819: UserInterest params corrections --- .../UserInterest.feature | 4 +- .../fixtures/fireboltCalls/userinterest.json | 24 ++-- cypress/fixtures/modules/discovery.json | 113 ++++++++++-------- 3 files changed, 75 insertions(+), 66 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index bcfab597..e8637302 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -7,10 +7,10 @@ Feature: UserInterest @coreSDK @sdk @transport @userinterest Scenario Outline: Discovery.userInterest - Positive Scenario: with interest type - When 1st party app invokes the 'Firebolt' API to 'Content onUserInterest' + When 1st party app registers for the 'Content onUserInterest' event using the 'Firebolt' API And '3rd party app' invokes the 'Firebolt' API to 'get userInterest with ' Then 'Firebolt' platform responds with 'null for discovery userInterest' - And 'Firebolt' platform triggers event '' + And 'Firebolt' platform triggers to '1st party app' event '' Examples: | Scenario | GetParam | Event_Content | diff --git a/cypress/fixtures/fireboltCalls/userinterest.json b/cypress/fixtures/fireboltCalls/userinterest.json index 89f7f6ff..df0c0ee2 100644 --- a/cypress/fixtures/fireboltCalls/userinterest.json +++ b/cypress/fixtures/fireboltCalls/userinterest.json @@ -410,47 +410,47 @@ "ONREQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { "event": "discovery.onRequestUserInterest", "validationJsonPath": "eventResponse.request", - "expected": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST" + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST" }, "ONREQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { "event": "discovery.onRequestUserInterest", "validationJsonPath": "eventResponse.request", - "expected": "DISCOVERY_TYPE_INTEREST_REASON_REACTION" + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION" }, "ONREQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING": { "event": "discovery.onRequestUserInterest", "validationJsonPath": "eventResponse.request", - "expected": "DISCOVERY_TYPE_INTEREST_REASON_RECORDING" + "content": "DISCOVERY_TYPE_INTEREST_REASON_RECORDING" }, "ONREQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { "event": "discovery.onRequestUserInterest", "validationJsonPath": "eventResponse.request", - "expected": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST" + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST" }, "ONREQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION": { "event": "discovery.onRequestUserInterest", "validationJsonPath": "eventResponse.request", - "expected": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION" + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION" }, "ONREQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING": { "event": "discovery.onRequestUserInterest", "validationJsonPath": "eventResponse.request", - "expected": "DISCOVERY_TYPE_DISINTEREST_REASON_RECORDING" + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_RECORDING" }, "REQUESTUSERINTEREST_WITH_REASON_PLAYLIST": { "method": "content.requestUserInterest", "validationJsonPath": "result", - "expected": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_PLAYLIST_RESPONSE" + "content": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_PLAYLIST_RESPONSE" }, "REQUESTUSERINTEREST_WITH_REASON_REACTION": { "method": "content.requestUserInterest", "validationJsonPath": "result", - "expected": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_REACTION_RESPONSE" + "content": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_REACTION_RESPONSE" }, "REQUESTUSERINTEREST_WITH_REASON_RECORDING": { "method": "content.requestUserInterest", "validationJsonPath": "result", - "expected": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_RECORDING_RESPONSE" + "content": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_RECORDING_RESPONSE" }, "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_MUSIC_SONG_ENTITY_DATA": { "method": "discovery.userInterest", @@ -472,7 +472,7 @@ "method": "discovery.userInterest", "context": "noContext", "validationJsonPath": "result", - "expected": "NULL", + "content": "NULL", "expectingError": false }, "GET_USERINTEREST_WITHOUT_ANY_PARAMS": { @@ -503,7 +503,7 @@ "method": "discovery.userInterest", "context": "noContext", "validationJsonPath": "result", - "expected": "INVALID_TYPE_PARAMS", + "content": "INVALID_TYPE_PARAMS", "expectingError": true }, "GET_USERINTEREST_WITH_INVALID_CHANNELTYPE_IN_CHANNEL_ENTITY":{ @@ -658,7 +658,7 @@ "method": "discovery_content.requestUserInterest", "context": "noContext", "validationJsonPath": "result", - "expected": "INVALID_TYPE_PARAMS", + "content": "INVALID_TYPE_PARAMS", "expectingError": true }, "DISCOVERY_ONREQUESTUSERINTEREST":{ diff --git a/cypress/fixtures/modules/discovery.json b/cypress/fixtures/modules/discovery.json index a74ae329..af4643b6 100644 --- a/cypress/fixtures/modules/discovery.json +++ b/cypress/fixtures/modules/discovery.json @@ -1752,64 +1752,73 @@ } }, "REQUESTUSERINTEREST_WITH_REASON_PLAYLIST_RESPONSE": { - "identifiers": { - "entityId": "345", - "entityType": "playlist" - }, - "info": { - "title": "User Interest", - "synopsis": "User Interest request provider", - "releaseDate": "1993-01-01T00:00:00.000Z", - "contentRatings": [ - { - "scheme": "US-Movie", - "rating": "PG" - }, - { - "scheme": "CA-Movie", - "rating": "G" - } - ] + "appId": "foo-app", + "entity":{ + "identifiers": { + "entityId": "345", + "entityType": "playlist" + }, + "info": { + "title": "User Interest", + "synopsis": "User Interest request provider", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } } }, "REQUESTUSERINTEREST_WITH_REASON_REACTION_RESPONSE": { - "identifiers": { - "entityId": "123", - "entityType": "channel", - "channelType": "streaming" - }, - "info": { - "title": "User Interest", - "synopsis": "User Interest request provider", - "releaseDate": "1993-01-01T00:00:00.000Z", - "contentRatings": [ - { - "scheme": "US-Movie", - "rating": "PG" - }, - { - "scheme": "CA-Movie", - "rating": "G" - } - ] + "appId": "foo-app", + "entity":{ + "identifiers": { + "entityId": "123", + "entityType": "channel", + "channelType": "streaming" + }, + "info": { + "title": "User Interest", + "synopsis": "User Interest request provider", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } } }, "REQUESTUSERINTEREST_WITH_REASON_RECORDING_RESPONSE": { - "identifiers": { - "entityId": "981", - "entityType": "music", - "musicType": "song" - }, - "info": { - "title": "User Interest", - "synopsis": "User Interest request provider", - "releaseDate": "1993-01-01T00:00:00.000Z", - "contentRatings": [ - { - "scheme": "US-TV", - "rating": "PG" - } - ] + "appId": "foo-app", + "entity":{ + "identifiers": { + "entityId": "981", + "entityType": "music", + "musicType": "song" + }, + "info": { + "title": "User Interest", + "synopsis": "User Interest request provider", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-TV", + "rating": "PG" + } + ] + } } } } \ No newline at end of file From fbac02385d2e11889886c036ed26d3e3ae42d1c8 Mon Sep 17 00:00:00 2001 From: Keaton Sentak <54916859+ksentak@users.noreply.github.com> Date: Thu, 23 May 2024 14:55:01 -0400 Subject: [PATCH 066/359] vs json firebolt call changes (#76) --- .gitignore | 3 ++ cypress/plugins/common.js | 5 ++ cypress/plugins/pluginUtils.js | 56 +++++++++++++++++++- cypress/support/cypress-commands/commands.js | 27 +++++++++- cypress/support/cypress-support/src/main.js | 11 ++++ 5 files changed, 99 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index cc59eb46..f57ee5d5 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ cypress/TestCases/Distributor # External Testdata cypress/fixtures/external +# Firebolt Calls Test Data +cypress/fixtures/fireboltCalls/index.js + # Lock Files yarn.lock diff --git a/cypress/plugins/common.js b/cypress/plugins/common.js index 06db25bb..0feb5c09 100644 --- a/cypress/plugins/common.js +++ b/cypress/plugins/common.js @@ -18,6 +18,8 @@ const fs = require('fs'); const testDataProcessor = require('./testDataProcessor'); const logger = require('../support/Logger')('common.js'); +const { generateFirboltCallsIndexFile } = require('./pluginUtils'); +const CONSTANTS = require('../support/constants/constants'); // If "genericSupport" is set to a falsy value (false, null, etc), take no further action. Simply "return" function genericSupport(config) { @@ -33,6 +35,9 @@ function genericSupport(config) { return acc; }, {}); + generateFirboltCallsIndexFile(CONSTANTS.FIREBOLTCALLS_FROM_FCS); + generateFirboltCallsIndexFile(CONSTANTS.FIREBOLTCALLS_FROM_CONFIGMODULE); + // The sequence of override - the default config in the config.js file, overriden by supportConfig.json and then by the command line arguments. config.env = { ...config.env, diff --git a/cypress/plugins/pluginUtils.js b/cypress/plugins/pluginUtils.js index 8f92e5df..acfaf46b 100644 --- a/cypress/plugins/pluginUtils.js +++ b/cypress/plugins/pluginUtils.js @@ -2,6 +2,7 @@ const axios = require('axios'); const fs = require('fs'); const path = require('path'); const $RefParser = require('@apidevtools/json-schema-ref-parser'); +const logger = require('../support/Logger')('pluginUtils.js'); /** * Fetches and dereferences OpenRPC documents from various sources including a Firebolt URL, local files, and external URLs. @@ -58,8 +59,59 @@ async function getAndDereferenceOpenRpc(externalUrls, version = null) { } return openRpcDocs; } catch (err) { - console.log(err); + logger.error(err, 'getAndDereferenceOpenRpc'); } } -module.exports = { getAndDereferenceOpenRpc }; +/** + * Generates an index.js file that requires all JavaScript files in a specified directory. + * @param {string} path - The path to the directory containing the FireboltCalls V2 data. + * @throws {Error} If an error occurs while reading the directory or writing the file. + */ +function generateFirboltCallsIndexFile(path) { + // Define variables + const v2TestFiles = []; + // let indexFileContent = ''; + let indexFileContent = 'let fireboltCalls = {};\n'; + + try { + // First check if the provided path exists + if (fs.existsSync(path)) { + // Read files in the directory + const files = fs.readdirSync(path); + + // Filter out non-JavaScript files and the index file itself, + // then slice off the .js extension and push the file names to the v2TestFiles array + files.forEach((file) => { + if (file && file.endsWith('.js') && !file.includes('index')) { + v2TestFiles.push(file.slice(0, -3)); + } + }); + + // Loop through the test files and require them in the index file + v2TestFiles.forEach((moduleName) => { + indexFileContent += `const ${moduleName} = require('./${moduleName}');\n`; + indexFileContent += `Object.assign(fireboltCalls, ${moduleName});\n`; + }); + } + + // Add exports at the bottom of the file + indexFileContent += 'module.exports = fireboltCalls;'; + + // Delete the index.js file if it already exists + if (fs.existsSync(`${path}/index.js`)) { + fs.unlinkSync(`${path}/index.js`); + } + + // Write to the new index.js file + fs.writeFileSync(`${path}/index.js`, indexFileContent); + } catch (error) { + logger.error( + `An error occurred while generating the FireboltCalls index file: ${error}`, + 'generateFirboltCallsIndexFile' + ); + throw error; + } +} + +module.exports = { getAndDereferenceOpenRpc, generateFirboltCallsIndexFile }; diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index c7718a7f..bf61b8c4 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -40,7 +40,7 @@ Cypress.Commands.add( } else if (callType == CONSTANTS.SUPPORTED_CALLTYPES.SET_RESPONSE_JSON) { fireboltData = UTILS.getEnvVariable('setResponseJson')[key]; } else { - fireboltData = UTILS.getEnvVariable('fireboltCallsJson')[key]; + fireboltData = UTILS.getEnvVariable(CONSTANTS.COMBINEDFIREBOLTCALLS)[key]; } if (!fireboltData) { fireLog.assert(false, CONSTANTS.NO_DATA_FOR_THE_KEY + key); @@ -738,6 +738,31 @@ Cypress.Commands.add('convertJsonToHTML', (defaultDirectory, fileName) => { } }); +/** + * @module commands + * @function mergeFireboltCallJsons + * @description Merges properties of two JSON objects into one, prioritizing the values from the second JSON object. + * @param {*} v1DataJson - JSON object + * @param {*} v2DataJson - The JSON object to merge with the first JSON object and that takes precedence. + * @returns {Object} The merged JSON object. + * @example + * mergeFireboltCallJsons(v1JSON, v2DataJSON); + */ + +Cypress.Commands.add('mergeFireboltCallJsons', (v1DataJson, v2DataJson) => { + const combinedJsonData = { ...v1DataJson }; + for (const [key, value] of Object.entries(v2DataJson)) { + // If the key exists in combinedJsonData, merge the objects + if (combinedJsonData.hasOwnProperty(key)) { + combinedJsonData[key] = { ...combinedJsonData[key], ...value }; + } else { + // Otherwise, simply assign the value + combinedJsonData[key] = value; + } + } + return combinedJsonData; +}); + /** * @module commands * @function clearCache diff --git a/cypress/support/cypress-support/src/main.js b/cypress/support/cypress-support/src/main.js index 449b4c68..f08f9569 100644 --- a/cypress/support/cypress-support/src/main.js +++ b/cypress/support/cypress-support/src/main.js @@ -29,6 +29,8 @@ const logger = require('../../Logger')('main.js'); const setimmediate = require('setimmediate'); let appTransport; const flatted = require('flatted'); +const internalV2FireboltCallsData = require('../../../fixtures/fireboltCalls/index'); +const externalV2FireboltCallsData = require('../../../fixtures/external/fireboltCalls/index'); export default function (module) { const config = new Config(module); @@ -70,6 +72,15 @@ export default function (module) { ); } + const v1FireboltCallsData = UTILS.getEnvVariable('fireboltCallsJson'); + const v2FireboltCallsData = { ...internalV2FireboltCallsData, ...externalV2FireboltCallsData }; + + cy.mergeFireboltCallJsons(v1FireboltCallsData, v2FireboltCallsData).then( + (mergedFireboltCalls) => { + Cypress.env(CONSTANTS.COMBINEDFIREBOLTCALLS, mergedFireboltCalls); + } + ); + // Unflatten the openRPC data const flattedOpenRpc = UTILS.getEnvVariable(CONSTANTS.DEREFERENCE_OPENRPC); const unflattedOpenRpc = flatted.parse(flattedOpenRpc); From 8854ad89cd381fd67f9904be4cc6f9f6895e66b5 Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Fri, 24 May 2024 12:06:54 +0530 Subject: [PATCH 067/359] FIRECERT-2075-New updated LifecycleUnloading feature file --- .../LifecycleTestcases/LifecycleUnloading.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature index c38a0ae9..ed6e76bb 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature @@ -30,7 +30,7 @@ Feature: Lifecycle_Unloading # And firebolt config 'Lifecycle.appFinishedTimeout' is set to to 60 'seconds' When 3rd party 'certification' app is launched with 'unloading' state Then '3rd party app' transitions to state 'unloaded' - Then '3rd party app' will stay in 'unloaded' state + Then '3rd party app' will be in 'unloaded' state @Lifecycle @coreSDK @notSupported Scenario: Lifecycle 2.7.2 Should not unload from active state (foreground) From c2ec550060d09f60085e4d7d902dccd6adb1d7e5 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 24 May 2024 13:49:25 +0530 Subject: [PATCH 068/359] FIRECERT-2055-addressed comments --- .../Accessibility.feature | 26 +++--- .../Manage/ClosedCaptionsManage.feature | 24 +++--- .../fixtures/fireboltCalls/accessibility.json | 60 ++++++++++++++ .../fireboltCalls/closedcaptions.json | 82 +++++++++++++------ .../validations/undefinedValidation.js | 43 ++++------ 5 files changed, 159 insertions(+), 76 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Accessibility.feature b/cypress/TestCases/FireboltCertification/Accessibility.feature index 5c8fe05d..f2a3f14e 100644 --- a/cypress/TestCases/FireboltCertification/Accessibility.feature +++ b/cypress/TestCases/FireboltCertification/Accessibility.feature @@ -60,19 +60,19 @@ Feature: Accessibility And 'Firebolt' platform triggers event '' Examples: - | Scenario | Key | Method_Content | Event_Content | - | fontFamily | set fontFamily as null | default value for fontFamily | onclosedCaptionsSettingsChanged with monospaced serif for fontfamily | - | fontSize | set fontSize as null | default value for fontSize | onclosedCaptionsSettingsChanged with 1 for fontSize | - | fontColor | set fontColor as null | default value for fontColor | onclosedCaptionsSettingsChanged with #ff00ff for fontColor | - | fontEdge | set fontEdge as null | default value for fontEdge | onclosedCaptionsSettingsChanged with none for fontEdge | - | fontEdgeColor | set fontEdgeColor as null | default value for fontEdgeColor | onclosedCaptionsSettingsChanged with #ffffff for fontEdgeColor | - | fontOpacity | set fontOpacity as null | default value for fontOpacity | onclosedCaptionsSettingsChanged with 75 for fontOpacity | - | backgroundColor | set backgroundColor as null | default value for backgroundColor | onclosedCaptionsSettingsChanged with #000000 for backgroundColor | - | backgroundOpacity | set backgroundOpacity as null | default value for backgroundOpacity | onclosedCaptionsSettingsChanged with 12 for backgroundOpacity | - | textAlign | set textAlign as null | default value for textAlign | onclosedCaptionsSettingsChanged with center for textAlign | - | textAlignVertical | set textAlignVertical as null | default value for textAlignVertical | onclosedCaptionsSettingsChanged with middle for textAlignVertical | - | windowColor | set windowColor as null | default value for windowColor | onclosedCaptionsSettingsChanged with white for windowColor | - | windowOpacity | set windowOpacity as null | default value for windowOpacity | onclosedCaptionsSettingsChanged with 0 for windowOpacity | + | Scenario | Key | Method_Content | Event_Content | + | fontFamily | set fontFamily as null | default value for fontFamily | onclosedCaptionsSettingsChanged with default value for fontfamily | + | fontSize | set fontSize as null | default value for fontSize | onclosedCaptionsSettingsChanged with default value for fontSize | + | fontColor | set fontColor as null | default value for fontColor | onclosedCaptionsSettingsChanged with default value for fontColor | + | fontEdge | set fontEdge as null | default value for fontEdge | onclosedCaptionsSettingsChanged with default value for fontEdge | + | fontEdgeColor | set fontEdgeColor as null | default value for fontEdgeColor | onclosedCaptionsSettingsChanged with default value for fontEdgeColor | + | fontOpacity | set fontOpacity as null | default value for fontOpacity | onclosedCaptionsSettingsChanged with default value for fontOpacity | + | backgroundColor | set backgroundColor as null | default value for backgroundColor | onclosedCaptionsSettingsChanged with default value for backgroundColor | + | backgroundOpacity | set backgroundOpacity as null | default value for backgroundOpacity | onclosedCaptionsSettingsChanged with default value for backgroundOpacity | + | textAlign | set textAlign as null | default value for textAlign | onclosedCaptionsSettingsChanged with default value for textAlign | + | textAlignVertical | set textAlignVertical as null | default value for textAlignVertical | onclosedCaptionsSettingsChanged with default value for textAlignVertical | + | windowColor | set windowColor as null | default value for windowColor | onclosedCaptionsSettingsChanged with default value for windowColor | + | windowOpacity | set windowOpacity as null | default value for windowOpacity | onclosedCaptionsSettingsChanged with default value for windowOpacity | @Accessibility @coreSDK @sdk @transport Scenario Outline: Accessibility.voiceGuidanceSettings - Positive Scenario: diff --git a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature index c044dfda..9a38d422 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature @@ -1,4 +1,4 @@ -Feature: ClosedCaptions_Manage +ndefinedFeature: ClosedCaptions_Manage Background: Launch FCA for 'ClosedCaptions' Given the environment has been set up for 'ClosedCaptions' tests @@ -59,17 +59,17 @@ Feature: ClosedCaptions_Manage Examples: | Scenario | Method | Set_API_Key | API_Key | Method_Validation_Key | Event_Validation_Key | Event | - | fontFamily | fontFamily | set fontFamily as null | get fontFamily | default value for fontFamily in closedcaptions | onFontFamilyChanged for closedcaptions with monospaced serif | closedcaptions onFontFamilyChanged | - | fontSize | fontSize | set fontSize as null | get fontSize | default value for fontSize in closedcaptions | onFontSizeChanged for closedcaptions with 1 | closedcaptions onFontSizeChanged | - | fontColor | fontColor | set fontColor as null | get fontColor | default value for fontColor in closedcaptions | onFontColorChanged for closedcaptions with #ffffff | closedcaptions onFontColorChanged | - | fontEdge | fontEdge | set fontEdge as null | get fontEdge | default value for fontEdge in closedcaptions | onFontEdgeChanged for closedcaptions with none | closedcaptions onFontEdgeChanged | - | fontEdgeColor | fontEdgeColor | set fontEdgeColor as null | get fontEdgeColor | default value for fontEdgeColor in closedcaptions | onFontEdgeColorChanged for closedcaptions with #7F7F7F | closedcaptions onFontEdgeColorChanged | - | fontOpacity | fontOpacity | set fontOpacity as null | get fontOpacity | default value for fontOpacity in closedcaptions | onFontOpacityChanged for closedcaptions with 100 | closedcaptions onFontOpacityChanged | - | backgroundColor | backgroundColor | set backgroundColor as null | get backgroundColor | default value for backgroundColor in closedcaptions | onBackgroundColorChanged for closedcaptions with #000000 | closedcaptions onBackgroundColorChanged | - | backgroundOpacity | backgroundOpacity | set backgroundOpacity as null | get backgroundOpacity | default value for backgroundOpacity in closedcaptions | onBackgroundOpacityChanged for closedcaptions with 12 | closedcaptions onBackgroundOpacityChanged | - | textAlign | textAlign | set textAlign as null | get textAlign | default value for textAlign in closedcaptions | onTextAlignChanged for closedcaptions with center | closedcaptions onTextAlignChanged | - | textAlignVertical | textAlignVertical | set textAlignVertical as null | get textAlignVertical | default value for textAlignVertical in closedcaptions | onTextAlignVerticalChanged for closedcaptions with middle | closedcaptions onTextAlignVerticalChanged | - | windowColor | windowColor | set windowColor as null | get windowColor | default value for windowColor in closedcaptions | onWindowColorChanged for closedcaptions with #000000 | closedcaptions onWindowColorChanged | + | fontFamily | fontFamily | set fontFamily as null | get fontFamily | default value for fontFamily in closedcaptions | onFontFamilyChanged for closedcaptions with default value | closedcaptions onFontFamilyChanged | + | fontSize | fontSize | set fontSize as null | get fontSize | default value for fontSize in closedcaptions | onFontSizeChanged for closedcaptions with default value | closedcaptions onFontSizeChanged | + | fontColor | fontColor | set fontColor as null | get fontColor | default value for fontColor in closedcaptions | onFontColorChanged for closedcaptions with default value | closedcaptions onFontColorChanged | + | fontEdge | fontEdge | set fontEdge as null | get fontEdge | default value for fontEdge in closedcaptions | onFontEdgeChanged for closedcaptions with default value | closedcaptions onFontEdgeChanged | + | fontEdgeColor | fontEdgeColor | set fontEdgeColor as null | get fontEdgeColor | default value for fontEdgeColor in closedcaptions | onFontEdgeColorChanged for closedcaptions with default value | closedcaptions onFontEdgeColorChanged | + | fontOpacity | fontOpacity | set fontOpacity as null | get fontOpacity | default value for fontOpacity in closedcaptions | onFontOpacityChanged for closedcaptions with default value | closedcaptions onFontOpacityChanged | + | backgroundColor | backgroundColor | set backgroundColor as null | get backgroundColor | default value for backgroundColor in closedcaptions | onBackgroundColorChanged for closedcaptions with default value | closedcaptions onBackgroundColorChanged | + | backgroundOpacity | backgroundOpacity | set backgroundOpacity as null | get backgroundOpacity | default value for backgroundOpacity in closedcaptions | onBackgroundOpacityChanged for closedcaptions with default value | closedcaptions onBackgroundOpacityChanged | + | textAlign | textAlign | set textAlign as null | get textAlign | default value for textAlign in closedcaptions | onTextAlignChanged for closedcaptions with default value | closedcaptions onTextAlignChanged | + | textAlignVertical | textAlignVertical | set textAlignVertical as null | get textAlignVertical | default value for textAlignVertical in closedcaptions | onTextAlignVerticalChanged for closedcaptions with default value | closedcaptions onTextAlignVerticalChanged | + | windowColor | windowColor | set windowColor as null | get windowColor | default value for windowColor in closedcaptions | onWindowColorChanged for closedcaptions with default value | closedcaptions onWindowColorChanged | | windowOpacity | windowOpacity | set windowOpacity as null | get windowOpacity | default value for windowOpacity in closedcaptions | onWindowOpacityChanged for closedcaptions with 0 | closedcaptions onWindowOpacityChanged | @ClosedCaptions @manageSDK diff --git a/cypress/fixtures/fireboltCalls/accessibility.json b/cypress/fixtures/fireboltCalls/accessibility.json index 248c5a48..2b644757 100644 --- a/cypress/fixtures/fireboltCalls/accessibility.json +++ b/cypress/fixtures/fireboltCalls/accessibility.json @@ -481,6 +481,11 @@ "validationJsonPath": "eventResponse.styles.fontFamily", "content": "ACCESSIBILITY_FONTFAMILY_MONOSPACE" }, + "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_DEFAULT_VALUE_FOR_FONTFAMILY": { + "event": "accessibility.onClosedCaptionsSettingsChanged", + "validationJsonPath": "eventResponse.styles.fontFamily", + "content": "ACCESSIBILITY_FONTFAMILY_VALUE_FOR_NULL_PARAMS" + }, "CURSIVE_FOR_FONTFAMILY_IN_CLOSEDCAPTIONS_SETTINGS": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.fontFamily", @@ -551,6 +556,11 @@ "validationJsonPath": "eventResponse.styles.fontSize", "content": "INTEGER1" }, + "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_DEFAULT_VALUE_FOR_FONTSIZE": { + "event": "accessibility.onClosedCaptionsSettingsChanged", + "validationJsonPath": "eventResponse.styles.fontSize", + "content": "ACCESSIBILITY_FONTSIZE_VALUE_FOR_NULL_PARAMS" + }, "#FF00FF_FOR_FONTCOLOR_IN_CLOSEDCAPTIONS_SETTINGS": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.fontColor", @@ -561,11 +571,21 @@ "validationJsonPath": "eventResponse.styles.fontColor", "content": "ACCESSIBILITY_FONTCOLOR" }, + "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_DEFAULT_VALUE_FOR_FONTEDGECOLOR": { + "event": "accessibility.onClosedCaptionsSettingsChanged", + "validationJsonPath": "eventResponse.styles.fontEdgeColor", + "content": "ACCESSIBILITY_FONTEDGECOLOR_VALUE_FOR_NULL_PARAMS" + }, "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_#FFFFFF_FOR_FONTCOLOR": { "event": "accessibility.onClosedCaptionsSettingsChanged", "validationJsonPath": "eventResponse.styles.fontColor", "content": "ACCESSIBILITY_FONTCOLOR_FFFFFF" }, + "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_DEFAULT_VALUE_FOR_FONTCOLOR": { + "event": "accessibility.onClosedCaptionsSettingsChanged", + "validationJsonPath": "eventResponse.styles.fontColor", + "content": "ACCESSIBILITY_FONTCOLOR_VALUE_FOR_NULL_PARAMS" + }, "RAISED_FOR_FONTEDGE_IN_CLOSEDCAPTIONS_SETTINGS": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.fontEdge", @@ -586,6 +606,11 @@ "validationJsonPath": "eventResponse.styles.fontEdge", "content": "ACCESSIBILITY_FONTEDGE_NONE" }, + "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_DEFAULT_VALUE_FOR_FONTEDGE": { + "event": "accessibility.onClosedCaptionsSettingsChanged", + "validationJsonPath": "eventResponse.styles.fontEdge", + "content": "ACCESSIBILITY_FONTEDGE_VALUE_FOR_NULL_PARAMS" + }, "DEPRESSED_FOR_FONTEDGE_IN_CLOSEDCAPTIONS_SETTINGS": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.fontEdge", @@ -656,6 +681,11 @@ "validationJsonPath": "eventResponse.styles.backgroundColor", "content": "ACCESSIBILITY_BACKGROUNDCOLOR_000000" }, + "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_DEFAULT_VALUE_FOR_BACKGROUNDCOLOR": { + "event": "accessibility.onClosedCaptionsSettingsChanged", + "validationJsonPath": "eventResponse.styles.backgroundColor", + "content": "ACCESSIBILITY_BACKGROUNDCOLOR_VALUE_FOR_NULL_PARAMS" + }, "75_FOR_FONTOPACITY_IN_CLOSEDCAPTIONS_SETTINGS": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.fontOpacity", @@ -666,6 +696,11 @@ "validationJsonPath": "eventResponse.styles.fontOpacity", "content": "INTEGER75" }, + "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_DEFAULT_VALUE_FOR_FONTOPACITY": { + "event": "accessibility.onClosedCaptionsSettingsChanged", + "validationJsonPath": "eventResponse.styles.fontOpacity", + "content": "ACCESSIBILITY_FONTOPACITY_VALUE_FOR_NULL_PARAMS" + }, "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_100_FOR_FONTOPACITY": { "event": "accessibility.onClosedCaptionsSettingsChanged", "validationJsonPath": "eventResponse.styles.fontOpacity", @@ -686,6 +721,11 @@ "validationJsonPath": "eventResponse.styles.backgroundOpacity", "content": "INTEGER12" }, + "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_DEFAULT_VALUE_FOR_BACKGROUNDOPACITY": { + "event": "accessibility.onClosedCaptionsSettingsChanged", + "validationJsonPath": "eventResponse.styles.backgroundOpacity", + "content": "ACCESSIBILITY_BACKGROUNDOPACITY_VALUE_FOR_NULL_PARAMS" + }, "LEFT_FOR_TEXTALIGN_IN_CLOSEDCAPTIONS_SETTINGS": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.textAlign", @@ -706,6 +746,11 @@ "validationJsonPath": "eventResponse.styles.textAlign", "content": "CENTER" }, + "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_DEFAULT_VALUE_FOR_TEXTALIGN": { + "event": "accessibility.onClosedCaptionsSettingsChanged", + "validationJsonPath": "eventResponse.styles.textAlign", + "content": "ACCESSIBILITY_TEXTALIGN_VALUE_FOR_NULL_PARAMS" + }, "RIGHT_FOR_TEXTALIGN_IN_CLOSEDCAPTIONS_SETTINGS": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.textAlign", @@ -736,6 +781,11 @@ "validationJsonPath": "eventResponse.styles.textAlignVertical", "content": "MIDDLE" }, + "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_DEFAULT_VALUE_FOR_TEXTALIGNVERTICAL": { + "event": "accessibility.onClosedCaptionsSettingsChanged", + "validationJsonPath": "eventResponse.styles.textAlignVertical", + "content": "ACCESSIBILITY_TEXTALIGNVERTICAL_VALUE_FOR_NULL_PARAMS" + }, "BOTTOM_FOR_TEXTALIGNVERTICAL_IN_CLOSEDCAPTIONS_SETTINGS": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.textAlignVertical", @@ -756,6 +806,11 @@ "validationJsonPath": "eventResponse.styles.windowColor", "content": "WHITE" }, + "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_DEFAULT_VALUE_FOR_WINDOWCOLOR": { + "event": "accessibility.onClosedCaptionsSettingsChanged", + "validationJsonPath": "eventResponse.styles.windowColor", + "content": "ACCESSIBILITY_WINDOWCOLOR_VALUE_FOR_NULL_PARAMS" + }, "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_#000000_FOR_WINDOWCOLOR": { "event": "accessibility.onClosedCaptionsSettingsChanged", "validationJsonPath": "eventResponse.styles.windowColor", @@ -776,6 +831,11 @@ "validationJsonPath": "eventResponse.styles.windowOpacity", "content": "INTEGER0" }, + "ONCLOSEDCAPTIONSSETTINGSCHANGED_WITH_DEFAULT_VALUE_FOR_WINDOWOPACITY": { + "event": "accessibility.onClosedCaptionsSettingsChanged", + "validationJsonPath": "eventResponse.styles.windowOpacity", + "content": "ACCESSIBILITY_WINDOWOPACITY_VALUE_FOR_NULL_PARAMS" + }, "0.5_FOR_FONTSIZE_IN_CLOSEDCAPTIONS_SETTINGS": { "method": "accessibility.closedCaptionsSettings", "validationJsonPath": "result.styles.fontSize", diff --git a/cypress/fixtures/fireboltCalls/closedcaptions.json b/cypress/fixtures/fireboltCalls/closedcaptions.json index 9a20a9b5..e165eed4 100644 --- a/cypress/fixtures/fireboltCalls/closedcaptions.json +++ b/cypress/fixtures/fireboltCalls/closedcaptions.json @@ -402,8 +402,7 @@ }, "DEFAULT_VALUE_FOR_BACKGROUNDCOLOR_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.backgroundColor", - "validationJsonPath": "result", - "content": "NULL" + "validationJsonPath": "result" }, "ONBACKGROUNDCOLORCHANGED_FOR_CLOSEDCAPTIONS_WITH_#FF00FF": { "event": "closedcaptions.onBackgroundColorChanged", @@ -415,6 +414,10 @@ "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_BACKGROUNDCOLOR_#000000" }, + "ONBACKGROUNDCOLORCHANGED_FOR_CLOSEDCAPTIONS_WITH_DEFAULT_VALUE": { + "event": "closedcaptions.onBackgroundColorChanged", + "validationJsonPath": "eventResponse" + }, "75_FOR_BACKGROUNDOPACITY_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.backgroundOpacity", "validationJsonPath": "result", @@ -422,8 +425,7 @@ }, "DEFAULT_VALUE_FOR_BACKGROUNDOPACITY_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.backgroundOpacity", - "validationJsonPath": "result", - "content": "NULL" + "validationJsonPath": "result" }, "ONBACKGROUNDOPACITYCHANGED_FOR_CLOSEDCAPTIONS_WITH_75": { "event": "closedcaptions.onBackgroundOpacityChanged", @@ -435,6 +437,10 @@ "validationJsonPath": "eventResponse", "content": "INTEGER12" }, + "ONBACKGROUNDOPACITYCHANGED_FOR_CLOSEDCAPTIONS_WITH_DEFAULT_VALUE": { + "event": "closedcaptions.onBackgroundOpacityChanged", + "validationJsonPath": "eventResponse" + }, "DISABLED_FOR_CLOSEDCAPTIONS":{ "method": "closedcaptions.enabled", "validationJsonPath": "result", @@ -462,8 +468,7 @@ }, "DEFAULT_VALUE_FOR_FONTCOLOR_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontColor", - "validationJsonPath": "result", - "content": "NULL" + "validationJsonPath": "result" }, "ONFONTCOLORCHANGED_FOR_CLOSEDCAPTIONS_WITH_#FF00FF": { "event": "closedcaptions.onFontColorChanged", @@ -475,6 +480,10 @@ "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_COLOR_#FFFFFF" }, + "ONFONTCOLORCHANGED_FOR_CLOSEDCAPTIONS_WITH_DEFAULT_VALUE": { + "event": "closedcaptions.onFontColorChanged", + "validationJsonPath": "eventResponse" + }, "RAISED_FOR_FONTEDGE_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontEdge", "validationJsonPath": "result", @@ -487,14 +496,17 @@ }, "DEFAULT_VALUE_FOR_FONTEDGE_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontEdge", - "validationJsonPath": "result", - "content": "NULL" + "validationJsonPath": "result" }, "ONFONTEDGECHANGED_FOR_CLOSEDCAPTIONS_WITH_NONE": { "event": "closedcaptions.onFontEdgeChanged", "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_FONTEDGE_NONE" }, + "ONFONTEDGECHANGED_FOR_CLOSEDCAPTIONS_WITH_DEFAULT_VALUE": { + "event": "closedcaptions.onFontEdgeChanged", + "validationJsonPath": "eventResponse" + }, "DEPRESSED_FOR_FONTEDGE_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontEdge", "validationJsonPath": "result", @@ -567,8 +579,7 @@ }, "DEFAULT_VALUE_FOR_FONTEDGECOLOR_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontEdgeColor", - "validationJsonPath": "result", - "content": "NULL" + "validationJsonPath": "result" }, "ONFONTEDGECOLORCHANGED_FOR_CLOSEDCAPTIONS_WITH_#FFFFFF": { "event": "closedcaptions.onFontEdgeColorChanged", @@ -580,6 +591,10 @@ "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_FONTEDGECOLOR_#7F7F7F" }, + "ONFONTEDGECOLORCHANGED_FOR_CLOSEDCAPTIONS_WITH_DEFAULT_VALUE": { + "event": "closedcaptions.onFontEdgeColorChanged", + "validationJsonPath": "eventResponse" + }, "CURSIVE_FOR_FONTFAMILY_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontFamily", "validationJsonPath": "result", @@ -597,8 +612,7 @@ }, "DEFAULT_VALUE_FOR_FONTOPACITY_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontOpacity", - "validationJsonPath": "result", - "content": "NULL" + "validationJsonPath": "result" }, "ONFONTOPACITYCHANGED_FOR_CLOSEDCAPTIONS_WITH_75": { "event": "closedcaptions.onFontOpacityChanged", @@ -610,16 +624,23 @@ "validationJsonPath": "eventResponse", "content": "INTEGER100" }, + "ONFONTOPACITYCHANGED_FOR_CLOSEDCAPTIONS_WITH_DEFAULT_VALUE": { + "event": "closedcaptions.onFontOpacityChanged", + "validationJsonPath": "eventResponse" + }, "DEFAULT_VALUE_FOR_FONTSIZE_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontSize", - "validationJsonPath": "result", - "content": "NULL" + "validationJsonPath": "result" }, "ONFONTSIZECHANGED_FOR_CLOSEDCAPTIONS_WITH_1": { "event": "closedcaptions.onFontSizeChanged", "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_FONTSIZE" }, + "ONFONTSIZECHANGED_FOR_CLOSEDCAPTIONS_WITH_DEFAULT_VALUE": { + "event": "closedcaptions.onFontSizeChanged", + "validationJsonPath": "eventResponse" + }, "LEFT_FOR_TEXTALIGN_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.textAlign", "validationJsonPath": "result", @@ -642,14 +663,17 @@ }, "DEFAULT_VALUE_FOR_TEXTALIGN_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.textAlign", - "validationJsonPath": "result", - "content": "NULL" + "validationJsonPath": "result" }, "ONTEXTALIGNCHANGED_FOR_CLOSEDCAPTIONS_WITH_CENTER": { "event": "closedcaptions.onTextAlignChanged", "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_TEXTALIGN_CENTER" }, + "ONTEXTALIGNCHANGED_FOR_CLOSEDCAPTIONS_WITH_DEFAULT_VALUE": { + "event": "closedcaptions.onTextAlignChanged", + "validationJsonPath": "eventResponse" + }, "TOP_FOR_TEXTALIGNVERTICAL_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.textAlignVertical", "validationJsonPath": "result", @@ -662,14 +686,17 @@ }, "DEFAULT_VALUE_FOR_TEXTALIGNVERTICAL_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.textAlignVertical", - "validationJsonPath": "result", - "content": "NULL" + "validationJsonPath": "result" }, "ONTEXTALIGNVERTICALCHANGED_FOR_CLOSEDCAPTIONS_WITH_MIDDLE": { "event": "closedcaptions.onTextAlignVerticalChanged", "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_TEXTALIGNVERTICAL_MIDDLE" }, + "ONTEXTALIGNVERTICALCHANGED_FOR_CLOSEDCAPTIONS_WITH_DEFAULT_VALUE": { + "event": "closedcaptions.onTextAlignVerticalChanged", + "validationJsonPath": "eventResponse" + }, "BOTTOM_FOR_TEXTALIGNVERTICAL_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.textAlignVertical", "validationJsonPath": "result", @@ -710,6 +737,10 @@ "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_FONTFAMILY_MONOSPACED_SANSERIF" }, + "ONFONTFAMILYCHANGED_FOR_CLOSEDCAPTIONS_WITH_DEFAULT_VALUE": { + "event": "closedcaptions.onFontFamilyChanged", + "validationJsonPath": "eventResponse" + }, "PROPORTIONAL_SERIF_FOR_FONTFAMILY_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontFamily", "validationJsonPath": "result", @@ -722,8 +753,7 @@ }, "DEFAULT_VALUE_FOR_FONTFAMILY_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.fontFamily", - "validationJsonPath": "result", - "content": "NULL" + "validationJsonPath": "result" }, "ONFONTFAMILYCHANGED_FOR_CLOSEDCAPTIONS_WITH_MONOSPACED_SERIF": { "event": "closedcaptions.onFontFamilyChanged", @@ -782,8 +812,7 @@ }, "DEFAULT_VALUE_FOR_WINDOWCOLOR_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.windowColor", - "validationJsonPath": "result", - "content": "NULL" + "validationJsonPath": "result" }, "WHITE_FOR_WINDOWCOLOR_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.windowColor", @@ -795,6 +824,10 @@ "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_WINDOWCOLOR_WHITE" }, + "ONWINDOWCOLORCHANGED_FOR_CLOSEDCAPTIONS_WITH_DEFAULT_VALUE": { + "event": "closedcaptions.onWindowColorChanged", + "validationJsonPath": "eventResponse" + }, "WHITE_FOR_WINDOWCOLOR_IN_CLOSEDCAPTIONS_EVENT": { "event": "closedcaptions.onWindowColorChanged", "validationJsonPath": "eventResponse", @@ -808,7 +841,6 @@ "DEFAULT_VALUE_FOR_WINDOWOPACITY_IN_CLOSEDCAPTIONS": { "method": "closedcaptions.windowOpacity", "validationJsonPath": "result", - "content": "NULL", "expectingError": false }, "ONWINDOWOPACITYCHANGED_FOR_CLOSEDCAPTIONS_WITH_50": { @@ -821,6 +853,10 @@ "validationJsonPath": "eventResponse", "content": "INTEGER0" }, + "ONWINDOWOPACITYCHANGED_FOR_CLOSEDCAPTIONS_WITH_DEFAULT_VALUE": { + "event": "closedcaptions.onWindowOpacityChanged", + "validationJsonPath": "eventResponse" + }, "ENABLE_CLOSEDCAPTIONS_WITH_NO_PARAMETERS":{ "method": "manage_closedcaptions.setEnabled" }, diff --git a/cypress/support/validations/undefinedValidation.js b/cypress/support/validations/undefinedValidation.js index 066c0c6b..de1a70bf 100644 --- a/cypress/support/validations/undefinedValidation.js +++ b/cypress/support/validations/undefinedValidation.js @@ -21,7 +21,7 @@ Cypress.Commands.add( validationType == CONSTANTS.EVENT ? apiOrEventObject.eventResponse : validationType == CONSTANTS.METHOD - ? apiOrEventObject.response + ? apiOrEventObject.response.result : null; const methodOrEventName = validationType == CONSTANTS.EVENT @@ -32,27 +32,23 @@ Cypress.Commands.add( // Loop through each item of validations array of validation object validationTypeObject.validations.forEach((validation) => { // If the field to be validated is result, directly assert if result stored in response is undefined - if (validation.field === CONSTANTS.RESULT) { + if (validation.field === CONSTANTS.RESULT || validation.field === EVENT_RESPONSE) { fireLog.isUndefined( - methodOrEventResponse.result, + methodOrEventResponse, `Undefined Validation : Expected ${methodOrEventName} response to have the field ${validation.field} as undefined` ); } else { - // Else recursilvely access the nested field properties and verify the corresponding value in response is undefined - const fieldParts = validation.field.split('.'); + // Else recursively access the nested field properties and verify the corresponding value in response is undefined + const fieldParts = validation.field.split('.').shift(); let currentObject = methodOrEventResponse; // Throw error if any properties other than the provided field is undefined for (let i = 0; i < fieldParts.length - 1; i++) { const part = fieldParts[i]; if (!currentObject || typeof currentObject[part] === CONSTANTS.UNDEFINED) { - cy.log( + fireLog.assert( + false, `Undefined Validation : Expected ${methodOrEventName} response to have property ${part} in the field ${validation.field}` - ).then(() => { - fireLog.assert( - false, - `Expected ${methodOrEventName} response to have property ${part} in the field ${validation.field}` - ); - }); + ); } currentObject = currentObject[part]; } @@ -65,26 +61,17 @@ Cypress.Commands.add( } }); } catch (error) { - cy.log( + fireLog.assert( + false, `Undefined Validation : Received following error while performing validation of type undefined on response', - ${JSON.stringify(error)}` - ).then(() => { - fireLog.assert( - false, - `Undefined Validation : Received following error while performing validation of type undefined on response', ${JSON.stringify(error)}` - ); - }); + ); } } else { - cy.log( - `Undefined Validation : Expected validation object or api/event object stored in global list to not be undefined` - ).then(() => { - fireLog.assert( - false, - 'Undefined Validation : Expected validation object or api/event object stored in global list to not be undefined' - ); - }); + fireLog.assert( + false, + 'Undefined Validation : Expected validation object or api/event object stored in global list to not be undefined' + ); } } ); From c11172ca3a324f07e622cbc65d3fbc1e109022bd Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 24 May 2024 14:34:41 +0530 Subject: [PATCH 069/359] FIRECERT-2055-addressed comments --- cypress/support/validations/undefinedValidation.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cypress/support/validations/undefinedValidation.js b/cypress/support/validations/undefinedValidation.js index de1a70bf..0e7a3fcf 100644 --- a/cypress/support/validations/undefinedValidation.js +++ b/cypress/support/validations/undefinedValidation.js @@ -32,14 +32,18 @@ Cypress.Commands.add( // Loop through each item of validations array of validation object validationTypeObject.validations.forEach((validation) => { // If the field to be validated is result, directly assert if result stored in response is undefined - if (validation.field === CONSTANTS.RESULT || validation.field === EVENT_RESPONSE) { + if ( + validation.field === CONSTANTS.RESULT || + validation.field === CONSTANTS.EVENT_RESPONSE + ) { fireLog.isUndefined( methodOrEventResponse, `Undefined Validation : Expected ${methodOrEventName} response to have the field ${validation.field} as undefined` ); } else { // Else recursively access the nested field properties and verify the corresponding value in response is undefined - const fieldParts = validation.field.split('.').shift(); + const fieldParts = validation.field.split('.'); + fieldParts.shift(); let currentObject = methodOrEventResponse; // Throw error if any properties other than the provided field is undefined for (let i = 0; i < fieldParts.length - 1; i++) { From d6fb977568b183ad2fb8d10e0f93ed7295d125fb Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Fri, 24 May 2024 16:44:24 +0530 Subject: [PATCH 070/359] 2086 - fixing failures --- .../FireboltCertification/Manage/ClosedCaptionsManage.feature | 2 +- cypress/fixtures/fireboltCalls/closedcaptions.json | 2 +- cypress/fixtures/fireboltCalls/privacy.json | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature index b2bb586a..fab4b949 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature @@ -15,7 +15,7 @@ Feature: ClosedCaptions_Manage Examples: | Scenario | Method | Event | Set_API_Key | API_Key | Method_Validation_Key | Event_Validation_Key | - | Set backgroundColor-#7f7f7f | backgroundColor | closedcaptions onBackgroundColorChanged | set backgroundColor to #7f7f7f | get backgroundColor | #ff00ff for backgroundColor in closedCaptions | onBackgroundColorChanged for closedcaptions with #ff00ff | + | Set backgroundColor-#7f7f7f | backgroundColor | closedcaptions onBackgroundColorChanged | set backgroundColor to #7f7f7f | get backgroundColor | #7f7f7f for backgroundColor in closedCaptions | onBackgroundColorChanged for closedcaptions with #7f7f7f | | Set backgroundOpacity-75 | backgroundOpacity | closedcaptions onBackgroundOpacityChanged | set backgroundOpacity to 75 | get backgroundOpacity | 75 for backgroundOpacity in closedCaptions | onBackgroundOpacityChanged for closedcaptions with 75 | | Set closedcaptions-false | enabled | closedcaptions onEnabledChanged | disable closedCaptions | get enabled | disabled for closedCaptions | onEnabledChanged for closedcaptions with disable | | Set closedcaptions-true | enabled | closedcaptions onEnabledChanged | enable closedCaptions | get enabled | enabled for closedCaptions | onEnabledChanged for closedcaptions with enable | diff --git a/cypress/fixtures/fireboltCalls/closedcaptions.json b/cypress/fixtures/fireboltCalls/closedcaptions.json index a2e74e53..25d500b1 100644 --- a/cypress/fixtures/fireboltCalls/closedcaptions.json +++ b/cypress/fixtures/fireboltCalls/closedcaptions.json @@ -405,7 +405,7 @@ "validationJsonPath": "result", "content": "CLOSEDCAPTIONS_BACKGROUNDCOLOR_#000000" }, - "ONBACKGROUNDCOLORCHANGED_FOR_CLOSEDCAPTIONS_WITH_#FF00FF": { + "ONBACKGROUNDCOLORCHANGED_FOR_CLOSEDCAPTIONS_WITH_#7F7F7F": { "event": "closedcaptions.onBackgroundColorChanged", "validationJsonPath": "eventResponse", "content": "CLOSEDCAPTIONS_BACKGROUNDCOLOR" diff --git a/cypress/fixtures/fireboltCalls/privacy.json b/cypress/fixtures/fireboltCalls/privacy.json index 92093fa5..6b664876 100644 --- a/cypress/fixtures/fireboltCalls/privacy.json +++ b/cypress/fixtures/fireboltCalls/privacy.json @@ -780,7 +780,8 @@ }, "INVALID_TEST_PARAMS_FOR_PRIVACY_ALLOWPRIMARYCONTENTADTARGETING": { "method": "privacy.setAllowPrimaryContentAdTargeting", - "expected": "INVALID_TYPE_PARAMS", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true }, "INVALID_PARAMS_INTEGER_FOR_PRIVACY_ALLOWPRIMARYBROWSEADTARGETING": { From 9e2be5f9050c673f5aa6fd906147a7f633c5c3e1 Mon Sep 17 00:00:00 2001 From: Preethi M R <102140979+PreethiMaai@users.noreply.github.com> Date: Fri, 24 May 2024 16:47:41 +0530 Subject: [PATCH 071/359] revert content changes --- cypress/fixtures/fireboltCalls/device.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/fixtures/fireboltCalls/device.json b/cypress/fixtures/fireboltCalls/device.json index 8a85be61..6b403ea7 100644 --- a/cypress/fixtures/fireboltCalls/device.json +++ b/cypress/fixtures/fireboltCalls/device.json @@ -153,12 +153,12 @@ "BEDROOM_FOR_DEVICE_NAME": { "method": "device.name", "validationJsonPath": "result", - "content": "Bedroom" + "content": "DEVICE_BEDROOM_NAME" }, "ONNAMECHANGED_FOR_DEVICE_WITH_BEDROOM": { "event": "device.onNameChanged", "validationJsonPath": "eventResponse", - "content": "Bedroom" + "content": "DEVICE_BEDROOM_NAME" }, "PROVISION_DEVICE_WITH_DEFAULT_VALUES":{ "method": "manage_device.provision", From db16d265e7012fd0a3a886d958df3d3c3e28b014 Mon Sep 17 00:00:00 2001 From: Preethi M R <102140979+PreethiMaai@users.noreply.github.com> Date: Fri, 24 May 2024 16:48:18 +0530 Subject: [PATCH 072/359] minor modification From 3a19b6a6b9b47fcce5b28e830d8bcb3243a713e0 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Fri, 24 May 2024 16:52:20 +0530 Subject: [PATCH 073/359] minor change --- cypress/fixtures/fireboltCalls/device.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/fixtures/fireboltCalls/device.json b/cypress/fixtures/fireboltCalls/device.json index 6b403ea7..ed9a73a0 100644 --- a/cypress/fixtures/fireboltCalls/device.json +++ b/cypress/fixtures/fireboltCalls/device.json @@ -370,4 +370,4 @@ "method": "device.model", "expected": "error" } -} +} \ No newline at end of file From 19b809c485e2b684d97bf5212186305629019128 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 24 May 2024 17:37:50 +0530 Subject: [PATCH 074/359] FIRECERT-2055-addressed comments --- .../Manage/ClosedCaptionsManage.feature | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature index 9a38d422..04d3558e 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature @@ -1,4 +1,4 @@ -ndefinedFeature: ClosedCaptions_Manage +Feature: ClosedCaptions_Manage Background: Launch FCA for 'ClosedCaptions' Given the environment has been set up for 'ClosedCaptions' tests @@ -58,19 +58,19 @@ ndefinedFeature: ClosedCaptions_Manage And 'Firebolt' platform triggers to '1st party app' with '' Examples: - | Scenario | Method | Set_API_Key | API_Key | Method_Validation_Key | Event_Validation_Key | Event | - | fontFamily | fontFamily | set fontFamily as null | get fontFamily | default value for fontFamily in closedcaptions | onFontFamilyChanged for closedcaptions with default value | closedcaptions onFontFamilyChanged | - | fontSize | fontSize | set fontSize as null | get fontSize | default value for fontSize in closedcaptions | onFontSizeChanged for closedcaptions with default value | closedcaptions onFontSizeChanged | - | fontColor | fontColor | set fontColor as null | get fontColor | default value for fontColor in closedcaptions | onFontColorChanged for closedcaptions with default value | closedcaptions onFontColorChanged | - | fontEdge | fontEdge | set fontEdge as null | get fontEdge | default value for fontEdge in closedcaptions | onFontEdgeChanged for closedcaptions with default value | closedcaptions onFontEdgeChanged | - | fontEdgeColor | fontEdgeColor | set fontEdgeColor as null | get fontEdgeColor | default value for fontEdgeColor in closedcaptions | onFontEdgeColorChanged for closedcaptions with default value | closedcaptions onFontEdgeColorChanged | - | fontOpacity | fontOpacity | set fontOpacity as null | get fontOpacity | default value for fontOpacity in closedcaptions | onFontOpacityChanged for closedcaptions with default value | closedcaptions onFontOpacityChanged | - | backgroundColor | backgroundColor | set backgroundColor as null | get backgroundColor | default value for backgroundColor in closedcaptions | onBackgroundColorChanged for closedcaptions with default value | closedcaptions onBackgroundColorChanged | - | backgroundOpacity | backgroundOpacity | set backgroundOpacity as null | get backgroundOpacity | default value for backgroundOpacity in closedcaptions | onBackgroundOpacityChanged for closedcaptions with default value | closedcaptions onBackgroundOpacityChanged | - | textAlign | textAlign | set textAlign as null | get textAlign | default value for textAlign in closedcaptions | onTextAlignChanged for closedcaptions with default value | closedcaptions onTextAlignChanged | - | textAlignVertical | textAlignVertical | set textAlignVertical as null | get textAlignVertical | default value for textAlignVertical in closedcaptions | onTextAlignVerticalChanged for closedcaptions with default value | closedcaptions onTextAlignVerticalChanged | - | windowColor | windowColor | set windowColor as null | get windowColor | default value for windowColor in closedcaptions | onWindowColorChanged for closedcaptions with default value | closedcaptions onWindowColorChanged | - | windowOpacity | windowOpacity | set windowOpacity as null | get windowOpacity | default value for windowOpacity in closedcaptions | onWindowOpacityChanged for closedcaptions with 0 | closedcaptions onWindowOpacityChanged | + | Scenario | Method | Set_API_Key | API_Key | Method_Validation_Key | Event_Validation_Key | Event | + | fontFamily | fontFamily | set fontFamily as null | get fontFamily | default value for fontFamily in closedcaptions | onFontFamilyChanged for closedcaptions with default value | closedcaptions onFontFamilyChanged | + | fontSize | fontSize | set fontSize as null | get fontSize | default value for fontSize in closedcaptions | onFontSizeChanged for closedcaptions with default value | closedcaptions onFontSizeChanged | + | fontColor | fontColor | set fontColor as null | get fontColor | default value for fontColor in closedcaptions | onFontColorChanged for closedcaptions with default value | closedcaptions onFontColorChanged | + | fontEdge | fontEdge | set fontEdge as null | get fontEdge | default value for fontEdge in closedcaptions | onFontEdgeChanged for closedcaptions with default value | closedcaptions onFontEdgeChanged | + | fontEdgeColor | fontEdgeColor | set fontEdgeColor as null | get fontEdgeColor | default value for fontEdgeColor in closedcaptions | onFontEdgeColorChanged for closedcaptions with default value | closedcaptions onFontEdgeColorChanged | + | fontOpacity | fontOpacity | set fontOpacity as null | get fontOpacity | default value for fontOpacity in closedcaptions | onFontOpacityChanged for closedcaptions with default value | closedcaptions onFontOpacityChanged | + | backgroundColor | backgroundColor | set backgroundColor as null | get backgroundColor | default value for backgroundColor in closedcaptions | onBackgroundColorChanged for closedcaptions with default value | closedcaptions onBackgroundColorChanged | + | backgroundOpacity | backgroundOpacity | set backgroundOpacity as null | get backgroundOpacity | default value for backgroundOpacity in closedcaptions | onBackgroundOpacityChanged for closedcaptions with default value | closedcaptions onBackgroundOpacityChanged | + | textAlign | textAlign | set textAlign as null | get textAlign | default value for textAlign in closedcaptions | onTextAlignChanged for closedcaptions with default value | closedcaptions onTextAlignChanged | + | textAlignVertical | textAlignVertical | set textAlignVertical as null | get textAlignVertical | default value for textAlignVertical in closedcaptions | onTextAlignVerticalChanged for closedcaptions with default value | closedcaptions onTextAlignVerticalChanged | + | windowColor | windowColor | set windowColor as null | get windowColor | default value for windowColor in closedcaptions | onWindowColorChanged for closedcaptions with default value | closedcaptions onWindowColorChanged | + | windowOpacity | windowOpacity | set windowOpacity as null | get windowOpacity | default value for windowOpacity in closedcaptions | onWindowOpacityChanged for closedcaptions with default value | closedcaptions onWindowOpacityChanged | @ClosedCaptions @manageSDK Scenario Outline: ClosedCaptions. - Negative Scenario: expecting error From 6a911f99162381ea9cde2881d90a763c70c8951c Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Mon, 27 May 2024 11:37:37 +0530 Subject: [PATCH 075/359] FIRECERT-2025-addressed comments --- cypress/support/cypress-commands/lifecycle.js | 6 +- .../support/validations/schemaValidation.js | 192 +++++++----------- 2 files changed, 80 insertions(+), 118 deletions(-) diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index ba623007..b768d0e7 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -554,10 +554,10 @@ Cypress.Commands.add('setAppObjectStateFromMethod', (method, appId) => { * cy.lifecycleSchemaChecks({"result":null,"error":null,"schemaResult":{"status":"PASS","schemaValidationResult":{"instance":null,"schema":{"const":null}}, 'foreground'); */ Cypress.Commands.add('lifecycleSchemaChecks', (response, state) => { - result = JSON.parse(response).schemaResult; + result = JSON.parse(response); apiSchemaResult = { - validationStatus: result.status, - validationResponse: result.schemaValidationResult, + validationStatus: result[CONSTANTS.SCHEMA_VALIDATION_STATUS], + validationResponse: result[CONSTANTS.SCHEMA_VALIDATION_RESPONSE], }; cy.validationChecksForResponseAndSchemaResult(response, false, apiSchemaResult, false); }); diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 43e53d70..c2302f41 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -18,7 +18,7 @@ const CONSTANTS = require('../constants/constants'); const Validator = require('jsonschema').Validator; const validator = new Validator(); -import UTILS from '../cypress-support/src/utils'; +import UTILS, { fireLog } from '../cypress-support/src/utils'; /** * @module schemaValidation @@ -37,107 +37,91 @@ Cypress.Commands.add( const responseType = response.hasOwnProperty(CONSTANTS.ERROR) ? CONSTANTS.ERROR : CONSTANTS.RESULT; - if ( - Cypress.env(CONSTANTS.TEST_TYPE) && - Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE - ) { - try { - cy.validateSchema(response[responseType], methodOrEvent, '', responseType).then( - (schemaValidation) => { - response.schemaResult = schemaValidation; - return response; - } - ); - } catch (err) { - const error = err; - response.error = error; - } - } else { - if (response.hasOwnProperty(CONSTANTS.RESULT) || response.hasOwnProperty(CONSTANTS.ERROR)) { - let formattedResponse = {}; - let result; - cy.validateSchema( - response[responseType], - methodOrEvent, - params, - responseType, - isValidation - ).then((schemaValidation) => { - if (methodOrEvent.includes('.on')) { - let formattedSchemaValidationResult; + if (response.hasOwnProperty(CONSTANTS.RESULT) || response.hasOwnProperty(CONSTANTS.ERROR)) { + let formattedResponse = {}; + let result; + cy.validateSchema( + response[responseType], + methodOrEvent, + params, + responseType, + isValidation + ).then((schemaValidation) => { + if (methodOrEvent.includes('.on')) { + let formattedSchemaValidationResult; + + if ( + schemaValidation.errors && + schemaValidation.errors.length > 0 && + schemaValidation.errors[0].message + ) { + formattedSchemaValidationResult = { + status: CONSTANTS.FAIL, + eventSchemaResult: schemaValidation, + }; + } else { + formattedSchemaValidationResult = { + status: CONSTANTS.PASS, + eventSchemaResult: schemaValidation, + }; + } + if (response.hasOwnProperty(CONSTANTS.RESULT)) { if ( - schemaValidation.errors && - schemaValidation.errors.length > 0 && - schemaValidation.errors[0].message + response && + response.result && + response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) ) { - formattedSchemaValidationResult = { - status: CONSTANTS.FAIL, - eventSchemaResult: schemaValidation, - }; - } else { - formattedSchemaValidationResult = { - status: CONSTANTS.PASS, - eventSchemaResult: schemaValidation, - }; - } - if (response.hasOwnProperty(CONSTANTS.RESULT)) { - if ( - response && - response.result && - response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) - ) { - formattedResponse = Object.assign(formattedResponse, response.result); - formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; - } else if ( - response && - response.result && - !response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) - ) { - formattedResponse.eventResponse = response.result; - formattedResponse.eventSchemaResult = formattedSchemaValidationResult; - formattedResponse.eventTime = null; - } - } else if (response.hasOwnProperty(CONSTANTS.ERROR)) { - if ( - response && - response.result && - response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) - ) { - formattedResponse = Object.assign(formattedResponse, response.error); - formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; - } else if (!response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { - formattedResponse = response.error; - } - } - } else { - if (response.hasOwnProperty(CONSTANTS.ERROR)) { - result = { result: null, error: response.error }; - } else if (response.hasOwnProperty(CONSTANTS.RESULT)) { - result = { result: response.result, error: null }; + formattedResponse = Object.assign(formattedResponse, response.result); + formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; + } else if ( + response && + response.result && + !response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) + ) { + formattedResponse.eventResponse = response.result; + formattedResponse.eventSchemaResult = formattedSchemaValidationResult; + formattedResponse.eventTime = null; } - + } else if (response.hasOwnProperty(CONSTANTS.ERROR)) { if ( - schemaValidation.errors && - schemaValidation.errors.length > 0 && - schemaValidation.errors[0].message + response && + response.result && + response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) ) { - formattedResponse[CONSTANTS.SCHEMA_VALIDATION_STATUS] = CONSTANTS.FAIL; - formattedResponse[CONSTANTS.SCHEMA_VALIDATION_RESPONSE] = schemaValidation; - } else { - formattedResponse[CONSTANTS.SCHEMA_VALIDATION_STATUS] = CONSTANTS.PASS; - formattedResponse[CONSTANTS.SCHEMA_VALIDATION_RESPONSE] = schemaValidation; + formattedResponse = Object.assign(formattedResponse, response.error); + formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; + } else if (!response?.result?.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE)) { + formattedResponse = response.error; } + } + } else { + if (response.hasOwnProperty(CONSTANTS.ERROR)) { + result = { result: null, error: response.error }; + } else if (response.hasOwnProperty(CONSTANTS.RESULT)) { + result = { result: response.result, error: null }; + } - formattedResponse.response = result; + if ( + schemaValidation.errors && + schemaValidation.errors.length > 0 && + schemaValidation.errors[0].message + ) { + formattedResponse[CONSTANTS.SCHEMA_VALIDATION_STATUS] = CONSTANTS.FAIL; + formattedResponse[CONSTANTS.SCHEMA_VALIDATION_RESPONSE] = schemaValidation; + } else { + formattedResponse[CONSTANTS.SCHEMA_VALIDATION_STATUS] = CONSTANTS.PASS; + formattedResponse[CONSTANTS.SCHEMA_VALIDATION_RESPONSE] = schemaValidation; } - return formattedResponse; - }); - } else { - cy.log(`Response does not have a valid result or error field - ${response}`); - } + formattedResponse.response = result; + } + + return formattedResponse; + }); + } else { + cy.log(`Response does not have a valid result or error field - ${response}`); } } ); @@ -160,33 +144,11 @@ Cypress.Commands.add( (response, methodOrEvent, params, schemaType, isValidation) => { cy.getSchema(methodOrEvent, params, schemaType).then((schemaMap) => { if (schemaMap) { - if ( - Cypress.env(CONSTANTS.TEST_TYPE) && - Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE - ) { - let validationResult; - const schemaMapResult = validator.validate(response, schemaMap); - if (schemaMapResult.errors.length > 0 || response === undefined) { - validationResult = { - status: CONSTANTS.FAIL, - schemaValidationResult: schemaMapResult, - }; - } else { - validationResult = { - status: CONSTANTS.PASS, - schemaValidationResult: schemaMapResult, - }; - } - return validationResult; - } else { - return validator.validate(response, schemaMap); - } + return validator.validate(response, schemaMap); } else { if (isValidation) { // Normal calls need to go through and response needs to get stored in global list even if they don't adhere to the schema. Schema failure should only be thrown during validation step - cy.log(`Failed to fetch schema, validateSchema`).then(() => { - assert(false, 'Failed to fetch schema, validateSchema'); - }); + fireLog.assert(false, 'Failed to fetch schema, validateSchema'); } } }); From 73458dbfa9e586c31dc621f62dff1487cbad37d2 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 28 May 2024 12:19:50 +0530 Subject: [PATCH 076/359] FIRECERT-2055-minor edit --- cypress/support/validations/undefinedValidation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/validations/undefinedValidation.js b/cypress/support/validations/undefinedValidation.js index 0e7a3fcf..0838b161 100644 --- a/cypress/support/validations/undefinedValidation.js +++ b/cypress/support/validations/undefinedValidation.js @@ -6,7 +6,7 @@ * @param {Object} apiOrEventObject - Extracted API or Event object from global list. * @param {String} validationType - To check whether to validate event or method * @example - * cy.undefinedValidation(validationTypeObject, apiOrEventObject) + * cy.undefinedValidation(validationTypeObject, apiOrEventObject, validationType) */ const CONSTANTS = require('../constants/constants'); From 21a654a07a0f6b19261ec37a432b2d2118de92fe Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 28 May 2024 17:36:02 +0530 Subject: [PATCH 077/359] FIRECERT-2025-latest change --- cypress/support/cypress-commands/assertion.js | 4 ++-- cypress/support/validations/regExValidation.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index 91c5ace7..38d85e04 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -128,7 +128,7 @@ Cypress.Commands.add( const apiErrorResponse = validationType == CONSTANTS.EVENT ? apiOrEventObject.eventListenerResponse.error - : apiOrEventObject.response.error; + : apiOrEventObject.response.response.error; fireLog.include( errorContentObject.errorCode, @@ -669,7 +669,7 @@ Cypress.Commands.add( if (eventExpected) { methodOrEventObject.setEventResponseData(response); } else { - fireLog.isNull(response[eventName], CONSTANTS.NO_EVENT_TRIGGERED); + fireLog.isNull(response.eventResponse[eventName], CONSTANTS.NO_EVENT_TRIGGERED); } } ); diff --git a/cypress/support/validations/regExValidation.js b/cypress/support/validations/regExValidation.js index 34ead4cb..3fd9858f 100644 --- a/cypress/support/validations/regExValidation.js +++ b/cypress/support/validations/regExValidation.js @@ -41,7 +41,7 @@ class regExValidations { regexResultValidator(method, expression, validationPath, response) { if (response) { // Get the response from the provided path - const extractedResponse = validationPath ? eval('response.' + validationPath) : null; + const extractedResponse = validationPath ? eval('response.response.' + validationPath) : null; // Validate the response with the mentioned expression const validationResult = extractedResponse @@ -50,7 +50,7 @@ class regExValidations { cy.log( `RegEx Validation : Expected ${method} response ${ - extractedResponse ? extractedResponse : response + extractedResponse ? JSON.stringify(extractedResponse) : JSON.stringify(response) } to be in ${expression} regex format`, 'regexResultValidator' ).then(() => { From 8f5eb6893042d7795b0b5c8568b12427c9762cb7 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Tue, 28 May 2024 21:36:04 +0530 Subject: [PATCH 078/359] Corrected In-app UX scenarios --- .../UserInterest.feature | 155 +- .../fixtures/fireboltCalls/userinterest.json | 258 ++- cypress/fixtures/modules/discovery.json | 1657 ++++++++--------- 3 files changed, 1064 insertions(+), 1006 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index e8637302..237a4c49 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -10,118 +10,53 @@ Feature: UserInterest When 1st party app registers for the 'Content onUserInterest' event using the 'Firebolt' API And '3rd party app' invokes the 'Firebolt' API to 'get userInterest with ' Then 'Firebolt' platform responds with 'null for discovery userInterest' - And 'Firebolt' platform triggers to '1st party app' event '' + And 'Firebolt' platform triggers to '1st party app' event 'onUserInterest with ' Examples: - | Scenario | GetParam | Event_Content | - | interest reason playlist | type interest reason playlist program entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist | type disinterest reason playlist program entity | onRequestUserInterest with type disinterest reason playlist | - | interest reason playlist & channel streaming entity | type interest reason playlist channel streaming entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & channel streaming entity | type disinterest reason playlist channel streaming entity | onRequestUserInterest with type disinterest reason playlist | - | interest reason playlist & channel overTheAir entity | type interest reason playlist channel overTheAir entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & channel overTheAir entity | type disinterest reason playlist channel overTheAir entity | onRequestUserInterest with type disinterest reason playlist | - | interest reason playlist & program episode entity | type interest reason playlist program episode entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program episode entity | type disinterest reason playlist program episode entity | onRequestUserInterest with type disinterest reason playlist | - | interest reason playlist & program season entity | type interest reason playlist program season entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program season entity | type disinterest reason playlist program season entity | onRequestUserInterest with type disinterest reason playlist | - | interest reason playlist & program series entity | type interest reason playlist program series entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program series entity | type disinterest reason playlist program series entity | onRequestUserInterest with type dinterest reason playlist | - | interest reason playlist & program additional concert entity | type interest reason playlist program additional concert entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program additional concert entity | type disinterest reason playlist program additional concert entity | onRequestUserInterest with type dinterest reason playlist | - | interest reason playlist & program additional sportingEvent entity | type interest reason playlist program additional sportingEvent entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program additional sportingEvent entity | type disinterest reason playlist program additional sportingEvent entity | onRequestUserInterest with type dinterest reason playlist | - | interest reason playlist & program additional preview entity | type interest reason playlist program additional preview entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program additional preview entity | type disinterest reason playlist program additional preview entity | onRequestUserInterest with type dinterest reason playlist | - | interest reason playlist & program additional other entity | type interest reason playlist program additional other entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program additional other entity | type disinterest reason playlist program additional other entity | onRequestUserInterest with type dinterest reason playlist | - | interest reason playlist & program additional advertisement entity | type interest reason playlist program additional advertisement entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program additional advertisement entity | type disinterest reason playlist program additional advertisement entity | onRequestUserInterest with type dinterest reason playlist | - | interest reason playlist & program additional musicVideo entity | type interest reason playlist program additional musicVideo entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program additional musicVideo entity | type disinterest reason playlist program additional musicVideo entity | onRequestUserInterest with type dinterest reason playlist | - | interest reason playlist & program additional minisode entity | type interest reason playlist program additional minisode entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program additional minisode entity | type disinterest reason playlist program additional minisode entity | onRequestUserInterest with type dinterest reason playlist | - | interest reason playlist & program additional extra entity | type interest reason playlist program additional extra entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program additional extra entity | type disinterest reason playlist program additional extra entity | onRequestUserInterest with type dinterest reason playlist | - | interest reason playlist & program additional extra entity | type interest reason playlist program additional extra entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program additional extra entity | type disinterest reason playlist program additional extra entity | onRequestUserInterest with type dinterest reason playlist | - | interest reason playlist & music song entity | type interest reason playlist music song entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & music song entity | type disinterest reason playlist music song entity | onRequestUserInterest with type dinterest reason playlist | - | interest reason playlist & music album entity | type interest reason playlist music album entity | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & music album entity | type disinterest reason playlist music album entity | onRequestUserInterest with type dinterest reason playlist | - | interest reason playlist & program tvepisode entity with seriesId and seasonId | type interest reason playlist program tvepisode entity with seriesId and seasonId | onRequestUserInterest with type interest reason playlist | - | disinterest reason playlist & program tvepisode entity with seriesId and seasonId | type disinterest reason playlist program tvepisode entity with seriesId and seasonId | onRequestUserInterest with type disinterest reason playlist | - | interest reason reaction | type interest reason reaction program entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction | type disinterest reason reaction program entity | onRequestUserInterest with type disinterest reason reaction | - | interest reason reaction & channel streaming entity | type interest reason reaction channel streaming entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & channel streaming entity | type disinterest reason reaction channel streaming entity | onRequestUserInterest with type disinterest reason reaction | - | interest reason reaction & channel overTheAir entity | type interest reason reaction channel overTheAir entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & channel overTheAir entity | type disinterest reason reaction channel overTheAir entity | onRequestUserInterest with type disinterest reason reaction | - | interest reason reaction & program episode entity | type interest reason reaction program episode entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program episode entity | type disinterest reason reaction program episode entity | onRequestUserInterest with type disinterest reason reaction | - | interest reason reaction & program season entity | type interest reason reaction program season entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program season entity | type disinterest reason reaction program season entity | onRequestUserInterest with type disinterest reason reaction | - | interest reason reaction & program series entity | type interest reason reaction program series entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program series entity | type disinterest reason reaction program series entity | onRequestUserInterest with type dinterest reason reaction | - | interest reason reaction & program additional concert entity | type interest reason reaction program additional concert entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program additional concert entity | type disinterest reason reaction program additional concert entity | onRequestUserInterest with type dinterest reason reaction | - | interest reason reaction & program additional sportingEvent entity | type interest reason reaction program additional sportingEvent entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program additional sportingEvent entity | type disinterest reason reaction program additional sportingEvent entity | onRequestUserInterest with type dinterest reason reaction | - | interest reason reaction & program additional preview entity | type interest reason reaction program additional preview entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program additional preview entity | type disinterest reason reaction program additional preview entity | onRequestUserInterest with type dinterest reason reaction | - | interest reason reaction & program additional other entity | type interest reason reaction program additional other entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program additional other entity | type disinterest reason reaction program additional other entity | onRequestUserInterest with type dinterest reason reaction | - | interest reason reaction & program additional advertisement entity | type interest reason reaction program additional advertisement entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program additional advertisement entity | type disinterest reason reaction program additional advertisement entity | onRequestUserInterest with type dinterest reason reaction | - | interest reason reaction & program additional musicVideo entity | type interest reason reaction program additional musicVideo entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program additional musicVideo entity | type disinterest reason reaction program additional musicVideo entity | onRequestUserInterest with type dinterest reason reaction | - | interest reason reaction & program additional minisode entity | type interest reason reaction program additional minisode entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program additional minisode entity | type disinterest reason reaction program additional minisode entity | onRequestUserInterest with type dinterest reason reaction | - | interest reason reaction & program additional extra entity | type interest reason reaction program additional extra entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program additional extra entity | type disinterest reason reaction program additional extra entity | onRequestUserInterest with type dinterest reason reaction | - | interest reason reaction & program additional extra entity | type interest reason reaction program additional extra entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program additional extra entity | type disinterest reason reaction program additional extra entity | onRequestUserInterest with type dinterest reason reaction | - | interest reason reaction & music song entity | type interest reason reaction music song entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & music song entity | type disinterest reason reaction music song entity | onRequestUserInterest with type dinterest reason reaction | - | interest reason reaction & music album entity | type interest reason reaction music album entity | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & music album entity | type disinterest reason reaction music album entity | onRequestUserInterest with type dinterest reason reaction | - | interest reason reaction & program tvepisode entity with seriesId and seasonId | type interest reason reaction program tvepisode entity with seriesId and seasonId | onRequestUserInterest with type interest reason reaction | - | disinterest reason reaction & program tvepisode entity with seriesId and seasonId | type disinterest reason reaction program tvepisode entity with seriesId and seasonId | onRequestUserInterest with type disinterest reason reaction | - | interest reason recording | type interest reason recording program entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording | type disinterest reason recording program entity | onRequestUserInterest with type disinterest reason recording | - | interest reason recording & channel streaming entity | type interest reason recording channel streaming entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & channel streaming entity | type disinterest reason recording channel streaming entity | onRequestUserInterest with type disinterest reason recording | - | interest reason recording & channel overTheAir entity | type interest reason recording channel overTheAir entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & channel overTheAir entity | type disinterest reason recording channel overTheAir entity | onRequestUserInterest with type disinterest reason recording | - | interest reason recording & program episode entity | type interest reason recording program episode entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program episode entity | type disinterest reason recording program episode entity | onRequestUserInterest with type disinterest reason recording | - | interest reason recording & program season entity | type interest reason recording program season entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program season entity | type disinterest reason recording program season entity | onRequestUserInterest with type disinterest reason recording | - | interest reason recording & program series entity | type interest reason recording program series entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program series entity | type disinterest reason recording program series entity | onRequestUserInterest with type dinterest reason recording | - | interest reason recording & program additional concert entity | type interest reason recording program additional concert entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program additional concert entity | type disinterest reason recording program additional concert entity | onRequestUserInterest with type dinterest reason recording | - | interest reason recording & program additional sportingEvent entity | type interest reason recording program additional sportingEvent entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program additional sportingEvent entity | type disinterest reason recording program additional sportingEvent entity | onRequestUserInterest with type dinterest reason recording | - | interest reason recording & program additional preview entity | type interest reason recording program additional preview entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program additional preview entity | type disinterest reason recording program additional preview entity | onRequestUserInterest with type dinterest reason recording | - | interest reason recording & program additional other entity | type interest reason recording program additional other entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program additional other entity | type disinterest reason recording program additional other entity | onRequestUserInterest with type dinterest reason recording | - | interest reason recording & program additional advertisement entity | type interest reason recording program additional advertisement entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program additional advertisement entity | type disinterest reason recording program additional advertisement entity | onRequestUserInterest with type dinterest reason recording | - | interest reason recording & program additional musicVideo entity | type interest reason recording program additional musicVideo entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program additional musicVideo entity | type disinterest reason recording program additional musicVideo entity | onRequestUserInterest with type dinterest reason recording | - | interest reason recording & program additional minisode entity | type interest reason recording program additional minisode entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program additional minisode entity | type disinterest reason recording program additional minisode entity | onRequestUserInterest with type dinterest reason recording | - | interest reason recording & program additional extra entity | type interest reason recording program additional extra entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program additional extra entity | type disinterest reason recording program additional extra entity | onRequestUserInterest with type dinterest reason recording | - | interest reason recording & program additional extra entity | type interest reason recording program additional extra entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program additional extra entity | type disinterest reason recording program additional extra entity | onRequestUserInterest with type dinterest reason recording | - | interest reason recording & music song entity | type interest reason recording music song entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & music song entity | type disinterest reason recording music song entity | onRequestUserInterest with type dinterest reason recording | - | interest reason recording & music album entity | type interest reason recording music album entity | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & music album entity | type disinterest reason recording music album entity | onRequestUserInterest with type dinterest reason recording | - | interest reason recording & program tvepisode entity with seriesId and seasonId | type interest reason recording program tvepisode entity with seriesId and seasonId | onRequestUserInterest with type interest reason recording | - | disinterest reason recording & program tvepisode entity with seriesId and seasonId | type disinterest reason recording program tvepisode entity with seriesId and seasonId | onRequestUserInterest with type disinterest reason recording | + | Scenario | GetParam | Event_Content | + | interest reason playlist | type interest reason playlist program entity | type interest reason playlist | + | disinterest reason playlist | type disinterest reason playlist program entity | type disinterest reason playlist | + | interest reason playlist & channel streaming entity | type interest reason playlist channel streaming entity | type interest reason playlist channel | + | disinterest reason playlist & channel streaming entity | type disinterest reason playlist channel streaming entity | type disinterest reason playlist channel | + | interest reason playlist & channel overTheAir entity | type interest reason playlist channel overTheAir entity | type interest reason playlist overTheAir | + | disinterest reason playlist & channel overTheAir entity | type disinterest reason playlist channel overTheAir entity | type disinterest reason playlist overTheAir | + | interest reason playlist & program episode entity | type interest reason playlist program episode entity | type interest reason playlist program episode | + | disinterest reason playlist & program episode entity | type disinterest reason playlist program episode entity | type disinterest reason playlist program episode | + | interest reason playlist & program additional concert entity | type interest reason playlist program additional concert entity | type interest reason playlist additional concert entity | + | disinterest reason playlist & program additional concert entity | type disinterest reason playlist program additional concert entity | type disinterest reason playlist additional concert entity | + | interest reason playlist & program additional sportingEvent entity | type interest reason playlist program additional sportingEvent entity | type interest reason playlist additional sportingEvent entity | + | disinterest reason playlist & program additional sportingEvent entity | type disinterest reason playlist program additional sportingEvent entity | type disinterest reason playlist additional sportingEvent entity | + | interest reason playlist & music song entity | type interest reason playlist music song entity | type interest reason playlist music song entity | + | disinterest reason playlist & music song entity | type disinterest reason playlist music song entity | type disinterest reason playlist music song entity | + | interest reason playlist & music album entity | type interest reason playlist music album entity | type interest reason playlist music album entity | + | disinterest reason playlist & music album entity | type disinterest reason playlist music album entity | type disinterest reason playlist music album entity | + | interest reason reaction | type interest reason reaction program entity | type interest reason reaction program entity | + | disinterest reason reaction | type disinterest reason reaction program entity | type disinterest reason reaction program entity | + | interest reason reaction & channel streaming entity | type interest reason reaction channel streaming entity | type interest reason reaction channel streaming entity | + | disinterest reason reaction & channel streaming entity | type disinterest reason reaction channel streaming entity | type disinterest reason reaction channel streaming entity | + | interest reason reaction & program additional preview entity | type interest reason reaction program additional preview entity | type interest reason reaction program additional preview entity | + | disinterest reason reaction & program additional preview entity | type disinterest reason reaction program additional preview entity | type disinterest reason reaction program additional preview entity | + | interest reason reaction & program additional advertisement entity | type interest reason reaction program additional advertisement entity | type interest reason reaction program additional advertisement entity | + | disinterest reason reaction & program additional advertisement entity | type disinterest reason reaction program additional advertisement entity | type disinterest reason reaction program additional advertisement entity | + | interest reason reaction & program additional musicVideo entity | type interest reason reaction program additional musicVideo entity | type interest reason reaction program additional musicVideo entity | + | disinterest reason reaction & program additional musicVideo entity | type disinterest reason reaction program additional musicVideo entity | type disinterest reason reaction program additional musicVideo entity | + | interest reason reaction & program additional minisode entity | type interest reason reaction program additional minisode entity | type interest reason reaction program additional minisode entity | + | disinterest reason reaction & program additional minisode entity | type disinterest reason reaction program additional minisode entity | type disinterest reason reaction program additional minisode entity | + | interest reason reaction & program additional extra entity | type interest reason reaction program additional extra entity | type interest reason reaction program additional extra entity | + | disinterest reason reaction & program additional extra entity | type disinterest reason reaction program additional extra entity | type disinterest reason reaction program additional extra entity | + | interest reason reaction & program tvepisode entity with seriesId and seasonId | type interest reason reaction program tvepisode entity with seriesId and seasonId | type interest reason reaction program tvepisode entity with seriesId and seasonId | + | disinterest reason reaction & program tvepisode entity with seriesId and seasonId | type disinterest reason reaction program tvepisode entity with seriesId and seasonId | type disinterest reason reaction program tvepisode entity with seriesId and seasonId | + | interest reason recording | type interest reason recording program entity | type interest reason recording program entity | + | disinterest reason recording | type disinterest reason recording program entity | type disinterest reason recording program entity | + | interest reason recording & channel streaming entity | type interest reason recording channel streaming entity | type interest reason recording channel streaming entity | + | disinterest reason recording & channel streaming entity | type disinterest reason recording channel streaming entity | type disinterest reason recording channel streaming entity | + | interest reason recording & channel overTheAir entity | type interest reason recording channel overTheAir entity | type interest reason recording channel overTheAir entity | + | disinterest reason recording & channel overTheAir entity | type disinterest reason recording channel overTheAir entity | type disinterest reason recording channel overTheAir entity | + | interest reason recording & program episode entity | type interest reason recording program episode entity | type interest reason recording program episode entity | + | disinterest reason recording & program episode entity | type disinterest reason recording program episode entity | type disinterest reason recording program episode entity | + | interest reason recording & program season entity | type interest reason recording program season entity | type interest reason recording program season entity | + | disinterest reason recording & program season entity | type disinterest reason recording program season entity | type disinterest reason recording program season entity | + @coreSDK @sdk @transport @userinterest Scenario Outline: Discovery.userInterest - Negative Scenario: expecting error diff --git a/cypress/fixtures/fireboltCalls/userinterest.json b/cypress/fixtures/fireboltCalls/userinterest.json index df0c0ee2..dbb14133 100644 --- a/cypress/fixtures/fireboltCalls/userinterest.json +++ b/cypress/fixtures/fireboltCalls/userinterest.json @@ -207,14 +207,6 @@ "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_OTHER_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_OTHER" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_OTHER_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_OTHER" - }, "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" @@ -273,27 +265,27 @@ }, "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ENTITY": { "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM" + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM" }, "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ENTITY": { "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM" + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM" }, "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_CHANNEL_STREAMING_ENTITY": { "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING" + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING" }, "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_CHANNEL_STREAMING_ENTITY": { "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING" + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING" }, "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_CHANNEL_OVERTHEAIR_ENTITY": { "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_OVERTHEAIR" + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR" }, "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_CHANNEL_OVERTHEAIR_ENTITY": { "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_OVERTHEAIR" + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR" }, "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY": { "method": "discovery.userInterest", @@ -407,35 +399,215 @@ "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" }, - "ONREQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { - "event": "discovery.onRequestUserInterest", - "validationJsonPath": "eventResponse.request", - "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST" - }, - "ONREQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { - "event": "discovery.onRequestUserInterest", - "validationJsonPath": "eventResponse.request", - "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION" - }, - "ONREQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING": { - "event": "discovery.onRequestUserInterest", - "validationJsonPath": "eventResponse.request", - "content": "DISCOVERY_TYPE_INTEREST_REASON_RECORDING" - }, - "ONREQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { - "event": "discovery.onRequestUserInterest", - "validationJsonPath": "eventResponse.request", - "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST" - }, - "ONREQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION": { - "event": "discovery.onRequestUserInterest", - "validationJsonPath": "eventResponse.request", - "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION" - }, - "ONREQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING": { - "event": "discovery.onRequestUserInterest", - "validationJsonPath": "eventResponse.request", - "content": "DISCOVERY_TYPE_DISINTEREST_REASON_RECORDING" + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_CHANNEL": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_CHANNEL_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_CHANNEL": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_CHANNEL_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_OVERTHEAIR": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_OVERTHEAIR_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_OVERTHEAIR": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_OVERTHEAIR_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_EPISODE": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_EPISODE_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_EPISODE": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_EPISODE_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ADDITIONAL_CONCERT_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_ADDITIONAL_CONCERT_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ADDITIONAL_CONCERT_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_ADDITIONAL_CONCERT_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_SPORTINGEVENT_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_SPORTINGEVENT_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_CHANNEL_STREAMING_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_CHANNEL_STREAMING_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_CHANNEL_STREAMING_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_CHANNEL_STREAMING_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_CHANNEL_OVERTHEAIR_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_CHANNEL_OVERTHEAIR_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_CHANNEL_OVERTHEAIR_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_CHANNEL_OVERTHEAIR_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY_RESPONSE" }, "REQUESTUSERINTEREST_WITH_REASON_PLAYLIST": { "method": "content.requestUserInterest", diff --git a/cypress/fixtures/modules/discovery.json b/cypress/fixtures/modules/discovery.json index af4643b6..10871733 100644 --- a/cypress/fixtures/modules/discovery.json +++ b/cypress/fixtures/modules/discovery.json @@ -495,295 +495,156 @@ "type": "interest", "reason": "playlist", "entity": { - "entityType": "channel", - "channelType": "streaming", - "entityId": "streaming/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } } }, "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_STREAMING": { "type": "disinterest", "reason": "playlist", "entity": { - "entityType": "channel", - "channelType": "streaming", - "entityId": "streaming/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } } }, "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_OVERTHEAIR": { "type": "interest", "reason": "playlist", "entity": { - "entityType": "channel", - "channelType": "overTheAir", - "entityId": "streaming/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } } }, "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_OVERTHEAIR": { "type": "disinterest", "reason": "playlist", "entity": { - "entityType": "channel", - "channelType": "overTheAir", - "entityId": "streaming/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } } }, "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_EPISODE": { "type": "interest", "reason": "playlist", "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "movie", + "entityId": "entity/xyz" + } } }, "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_EPISODE": { "type": "disinterest", "reason": "playlist", "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SEASON": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "season", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SEASON": { - "type": "disinterest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "season", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SERIES": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "series", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SERIES": { - "type": "disinterest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "series", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "movie", + "entityId": "entity/xyz" + } } }, "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { "type": "interest", "reason": "playlist", "entity": { - "entityType": "program", - "programType": "concert", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } } }, "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { "type": "disinterest", "reason": "playlist", "entity": { - "entityType": "program", - "programType": "concert", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } } }, "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { "type": "interest", "reason": "playlist", "entity": { - "entityType": "program", - "programType": "sportingEvent", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } } }, "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { "type": "disinterest", "reason": "playlist", "entity": { - "entityType": "program", - "programType": "sportingEvent", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "preview", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { - "type": "disinterest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "preview", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_OTHER": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "other", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_OTHER": { - "type": "disinterest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "other", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "advertisement", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { - "type": "disinterest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "advertisement", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "musicVideo", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { - "type": "disinterest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "musicVideo", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "minisode", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { - "type": "disinterest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "minisode", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "extra", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { - "type": "disinterest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "extra", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } } }, "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_MUSIC_SONG": { "type": "interest", "reason": "playlist", "entity": { - "entityType": "music", - "musicType": "song", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } } }, "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_MUSIC_SONG": { "type": "disinterest", "reason": "playlist", "entity": { - "entityType": "music", - "musicType": "song", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } } }, "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_MUSIC_ALBUM": { "type": "interest", "reason": "playlist", "entity": { - "entityType": "music", - "musicType": "album", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } } }, "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_MUSIC_ALBUM": { "type": "disinterest", "reason": "playlist", "entity": { - "entityType": "music", - "musicType": "album", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "breaking-bad-pilot", - "seriesId": "breaking-bad", - "seasonId": "breaking-bad-season-1" - } - }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { - "type": "disinterest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "breaking-bad-pilot", - "seriesId": "breaking-bad", - "seasonId": "breaking-bad-season-1" + "identifiers": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM": { "type": "interest", "reason": "reaction", @@ -840,299 +701,477 @@ "type": "interest", "reason": "reaction", "entity": { - "entityType": "channel", - "channelType": "streaming", - "entityId": "streaming/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } } }, "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING": { "type": "disinterest", "reason": "reaction", "entity": { - "entityType": "channel", - "channelType": "streaming", - "entityId": "streaming/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_OVERTHEAIR": { + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { "type": "interest", "reason": "reaction", "entity": { - "entityType": "channel", - "channelType": "overTheAir", - "entityId": "streaming/xyz" + "identifiers": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_OVERTHEAIR": { + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { "type": "disinterest", "reason": "reaction", "entity": { - "entityType": "channel", - "channelType": "overTheAir", - "entityId": "streaming/xyz" + "identifiers": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_EPISODE": { + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { "type": "interest", "reason": "reaction", "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_EPISODE": { + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { "type": "disinterest", "reason": "reaction", "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_SEASON": { + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { "type": "interest", "reason": "reaction", "entity": { - "entityType": "program", - "programType": "season", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_SEASON": { + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { "type": "disinterest", "reason": "reaction", "entity": { - "entityType": "program", - "programType": "season", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_SERIES": { + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { "type": "interest", "reason": "reaction", "entity": { - "entityType": "program", - "programType": "series", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_SERIES": { + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { "type": "disinterest", "reason": "reaction", "entity": { - "entityType": "program", - "programType": "series", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { "type": "interest", "reason": "reaction", "entity": { - "entityType": "program", - "programType": "concert", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { "type": "disinterest", "reason": "reaction", "entity": { - "entityType": "program", - "programType": "concert", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { "type": "interest", "reason": "reaction", "entity": { - "entityType": "program", - "programType": "sportingEvent", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { "type": "disinterest", "reason": "reaction", "entity": { - "entityType": "program", - "programType": "sportingEvent", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM": { "type": "interest", - "reason": "reaction", + "reason": "recording", "entity": { - "entityType": "program", - "programType": "preview", - "entityId": "entity/xyz" + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM": { "type": "disinterest", - "reason": "reaction", + "reason": "recording", "entity": { - "entityType": "program", - "programType": "preview", - "entityId": "entity/xyz" + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_OTHER": { + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING": { "type": "interest", - "reason": "reaction", + "reason": "recording", "entity": { - "entityType": "program", - "programType": "other", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_OTHER": { + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING": { "type": "disinterest", - "reason": "reaction", + "reason": "recording", "entity": { - "entityType": "program", - "programType": "other", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR": { "type": "interest", - "reason": "reaction", + "reason": "recording", "entity": { - "entityType": "program", - "programType": "advertisement", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR": { "type": "disinterest", - "reason": "reaction", + "reason": "recording", "entity": { - "entityType": "program", - "programType": "advertisement", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE": { "type": "interest", - "reason": "reaction", + "reason": "recording", "entity": { - "entityType": "program", - "programType": "musicVideo", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE": { "type": "disinterest", - "reason": "reaction", + "reason": "recording", "entity": { - "entityType": "program", - "programType": "musicVideo", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON": { "type": "interest", - "reason": "reaction", + "reason": "recording", "entity": { - "entityType": "program", - "programType": "minisode", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz", + "seriesId": "breaking-bad" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON": { "type": "disinterest", - "reason": "reaction", + "reason": "recording", "entity": { - "entityType": "program", - "programType": "minisode", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz", + "seriesId": "breaking-bad" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { "type": "interest", - "reason": "reaction", - "entity": { - "entityType": "program", - "programType": "extra", - "entityId": "entity/xyz" - } + "reason": "reaction" }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { + "type": "interest", + "reason": "playlist" + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING": { + "type": "interest", + "reason": "recording" + }, + "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION": { "type": "disinterest", - "reason": "reaction", - "entity": { - "entityType": "program", - "programType": "extra", - "entityId": "entity/xyz" - } + "reason": "reaction" + }, + "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { + "type": "disinterest", + "reason": "playlist" + }, + "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING": { + "type": "disinterest", + "reason": "recording" + }, + "REQUESTUSERINTEREST_WITH_INVALID_INTERESTTYPE": { + "type": "test", + "reason": "playlist" + }, + "REQUESTUSERINTEREST_WITH_BOOLEAN_INTERESTTYPE": { + "type": true, + "reason": "playlist" }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_MUSIC_SONG": { + "REQUESTUSERINTEREST_WITH_INVALID_REASONTYPE": { "type": "interest", - "reason": "reaction", - "entity": { - "entityType": "music", - "musicType": "song", - "entityId": "entity/xyz" + "reason": "test" + }, + "REQUESTUSERINTEREST_WITH_BOOLEAN_REASONTYPE": { + "type": "interest", + "reason": true + }, + "TYPE_INTEREST_REASON_PLAYLIST": { + "correlationId": "xyz", + "parameters": { + "type": "interest", + "reason": "playlist" } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_MUSIC_SONG": { - "type": "disinterest", - "reason": "reaction", - "entity": { - "entityType": "music", - "musicType": "song", - "entityId": "entity/xyz" + "TYPE_INTEREST_REASON_REACTION": { + "correlationId": "xyz", + "parameters": { + "type": "interest", + "reason": "reaction" } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_MUSIC_ALBUM": { - "type": "interest", - "reason": "reaction", - "entity": { - "entityType": "music", - "musicType": "album", - "entityId": "entity/xyz" + "TYPE_INTEREST_REASON_RECORDING": { + "correlationId": "xyz", + "parameters": { + "type": "interest", + "reason": "recording" } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_MUSIC_ALBUM": { - "type": "disinterest", - "reason": "reaction", + "TYPE_DISINTEREST_REASON_PLAYLIST": { + "correlationId": "xyz", + "parameters": { + "type": "disinterest", + "reason": "playlist" + } + }, + "TYPE_DISINTEREST_REASON_REACTION": { + "correlationId": "xyz", + "parameters": { + "type": "disinterest", + "reason": "reaction" + } + }, + "TYPE_DISINTEREST_REASON_RECORDING": { + "correlationId": "xyz", + "parameters": { + "type": "disinterest", + "reason": "recording" + } + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST": { + "InterestType": "interest" + }, + "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST": { + "InterestType": "disinterest" + }, + "USERINTEREST_WITH_INVALID_MUSICTYPE_FOR_MUSIC_ENTITY_WITH_ALBUMID": { + "InterestType": "interest", "entity": { "entityType": "music", "musicType": "album", - "entityId": "entity/xyz" + "entityId": "song/xyz", + "albumId": "album/xyz" } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { - "type": "interest", - "reason": "reaction", - "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "breaking-bad-pilot", - "seriesId": "breaking-bad", - "seasonId": "breaking-bad-season-1" + "REQUESTUSERINTEREST_WITH_REASON_PLAYLIST_RESPONSE": { + "appId": "foo-app", + "entity":{ + "identifiers": { + "entityId": "345", + "entityType": "playlist" + }, + "info": { + "title": "User Interest", + "synopsis": "User Interest request provider", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { - "type": "disinterest", - "reason": "reaction", - "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "breaking-bad-pilot", - "seriesId": "breaking-bad", - "seasonId": "breaking-bad-season-1" + "REQUESTUSERINTEREST_WITH_REASON_REACTION_RESPONSE": { + "appId": "foo-app", + "entity":{ + "identifiers": { + "entityId": "123", + "entityType": "channel", + "channelType": "streaming" + }, + "info": { + "title": "User Interest", + "synopsis": "User Interest request provider", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } } }, - - - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM": { + "REQUESTUSERINTEREST_WITH_REASON_RECORDING_RESPONSE": { + "appId": "foo-app", + "entity":{ + "identifiers": { + "entityId": "981", + "entityType": "music", + "musicType": "song" + }, + "info": { + "title": "User Interest", + "synopsis": "User Interest request provider", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-TV", + "rating": "PG" + } + ] + } + } + }, + "TYPE_INTEREST_REASON_PLAYLIST_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "playlist", "entity": { "identifiers": { "entityId": "345", @@ -1156,9 +1195,10 @@ } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM": { + "TYPE_DISINTEREST_REASON_PLAYLIST_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "playlist", "entity": { "identifiers": { "entityId": "345", @@ -1182,585 +1222,413 @@ } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING": { + "TYPE_INTEREST_REASON_PLAYLIST_CHANNEL_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "channel", - "channelType": "streaming", - "entityId": "streaming/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING": { + "TYPE_DISINTEREST_REASON_PLAYLIST_CHANNEL_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "channel", - "channelType": "streaming", - "entityId": "streaming/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR": { + "TYPE_INTEREST_REASON_PLAYLIST_OVERTHEAIR_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "channel", - "channelType": "overTheAir", - "entityId": "streaming/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR": { + "TYPE_DISINTEREST_REASON_PLAYLIST_OVERTHEAIR_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "channel", - "channelType": "overTheAir", - "entityId": "streaming/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE": { + "TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_EPISODE_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "movie", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE": { + "TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_EPISODE_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON": { - "type": "interest", - "reason": "recording", - "entity": { - "entityType": "program", - "programType": "season", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON": { - "type": "disinterest", - "reason": "recording", - "entity": { - "entityType": "program", - "programType": "season", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "movie", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_SERIES": { + "TYPE_INTEREST_REASON_PLAYLIST_ADDITIONAL_CONCERT_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "program", - "programType": "series", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_SERIES": { + "TYPE_DISINTEREST_REASON_PLAYLIST_ADDITIONAL_CONCERT_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "program", - "programType": "series", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { + "TYPE_INTEREST_REASON_PLAYLIST_SPORTINGEVENT_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "program", - "programType": "concert", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { + "TYPE_DISINTEREST_REASON_PLAYLIST_SPORTINGEVENT_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "program", - "programType": "concert", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { + "TYPE_INTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "program", - "programType": "sportingEvent", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { + "TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "program", - "programType": "sportingEvent", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { + "TYPE_INTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "program", - "programType": "preview", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { + "TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "playlist", "entity": { - "entityType": "program", - "programType": "preview", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_OTHER": { + "TYPE_INTEREST_REASON_REACTION_PROGRAM_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "program", - "programType": "other", - "entityId": "entity/xyz" + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_OTHER": { + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "program", - "programType": "other", - "entityId": "entity/xyz" + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { + "TYPE_INTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "program", - "programType": "advertisement", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { + "TYPE_DISINTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "program", - "programType": "advertisement", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { + "TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "program", - "programType": "musicVideo", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "program", - "programType": "musicVideo", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { + "TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "program", - "programType": "minisode", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "program", - "programType": "minisode", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { + "TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "program", - "programType": "extra", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "program", - "programType": "extra", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_MUSIC_SONG": { + "TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "music", - "musicType": "song", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_MUSIC_SONG": { + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "music", - "musicType": "song", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_MUSIC_ALBUM": { + "TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "music", - "musicType": "album", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_MUSIC_ALBUM": { + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_RESPONSE": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "music", - "musicType": "album", - "entityId": "entity/xyz" + "identifiers": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } } }, - "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { + "TYPE_INTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "appId":"foo-app", "type": "interest", - "reason": "recording", + "reason": "reaction", "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "breaking-bad-pilot", - "seriesId": "breaking-bad", - "seasonId": "breaking-bad-season-1" + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } } }, - "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "appId":"foo-app", "type": "disinterest", - "reason": "recording", - "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "breaking-bad-pilot", - "seriesId": "breaking-bad", - "seasonId": "breaking-bad-season-1" - } - }, - "USERINTEREST_WITHOUT_INTEREST_TYPE": { - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "extra", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_INVALID_INTERESTTYPE_INTEGER": { - "type": 123, - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "extra", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_INVALID_INTERESTTYPE_STRING": { - "type": "test", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "extra", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_INVALID_INTERESTTYPE_BOOLEAN": { - "type": true, - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "extra", - "entityId": "entity/xyz" - } - }, - "USERINTEREST_WITH_INVALID_CHANNELTYPE_IN_CHANNEL_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "channel", - "channelType": "test", - "entityId": "broadcast/xyz" - } - }, - "USERINTEREST_WITH_BOOLEAN_CHANNELTYPE_IN_CHANNEL_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "channel", - "channelType": true, - "entityId": "broadcast/xyz" - } - }, - "USERINTEREST_WITH_INTEGER_CHANNELTYPE_IN_CHANNEL_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "channel", - "channelType": 123, - "entityId": "broadcast/xyz" - } - }, - "USERINTEREST_WITH_INVALID_PROGRAMTYPE_IN_PROGRAM_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "test", - "entityId": "entity/abc" - } - }, - "USERINTEREST_WITH_BOOLEAN_PROGRAMTYPE_IN_PROGRAM_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": true, - "entityId": "entity/abc" - } - }, - "USERINTEREST_WITH_INTEGER_PROGRAMTYPE_IN_PROGRAM_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": 123, - "entityId": "entity/abc" - } - }, - "USERINTEREST_WITH_INVALID_MUSICTYPE_IN_MUSIC_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "music", - "musicType": "test", - "entityId": "album/xyz" - } - }, - "USERINTEREST_WITH_BOOLEAN_MUSICTYPE_IN_MUSIC_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "music", - "musicType": true, - "entityId": "album/xyz" - } - }, - "USERINTEREST_WITH_INTEGER_MUSICTYPE_IN_MUSIC_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "music", - "musicType": 123, - "entityId": "album/xyz" - } - }, - "USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_EPISODE_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "breaking-bad-pilot", - "seriesId": "breaking-bad", - "seasonId": "breaking-bad-season-1" - } - }, - "USERINTEREST_WITH_INVALID_SEASONID_IN_PROGRAM_EPISODE_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "breaking-bad-pilot", - "seriesId": "breaking-bad", - "seasonId": 123 - } - }, - "USERINTEREST_WITH_INVALID_SERIESID_AND_SEASONID_IN_PROGRAM_EPISODE_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "episode", - "entityId": "entity/def", - "seriesId": 123, - "seasonId": 123 - } - }, - "USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_SEASON_ENTITY": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "season", - "entityId": "entity/klm", - "seriesId": 123, - "seasonId": "breaking-bad-season-1" - } - }, - "USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SERIESID": { - "type": "interest", - "reason": "playlist", - "entity": { - "entityType": "program", - "programType": "movie", - "entityId": "entity/klm", - "seriesId": "entity/hij" - } - }, - "USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SEASONID": { - "type": "interest", - "reason": "playlist", + "reason": "reaction", "entity": { - "entityType": "program", - "programType": "movie", - "entityId": "entity/def", - "seasonId": "entity/klm" + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } } }, - "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { + "TYPE_INTEREST_REASON_RECORDING_PROGRAM_ENTITY_RESPONSE": { + "appId":"foo-app", "type": "interest", - "reason": "reaction" - }, - "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { - "type": "interest", - "reason": "playlist" - }, - "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING": { - "type": "interest", - "reason": "recording" - }, - "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION": { - "type": "disinterest", - "reason": "reaction" - }, - "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { - "type": "disinterest", - "reason": "playlist" - }, - "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING": { - "type": "disinterest", - "reason": "recording" - }, - "REQUESTUSERINTEREST_WITH_INVALID_INTERESTTYPE": { - "type": "test", - "reason": "playlist" - }, - "REQUESTUSERINTEREST_WITH_BOOLEAN_INTERESTTYPE": { - "type": true, - "reason": "playlist" - }, - "REQUESTUSERINTEREST_WITH_INVALID_REASONTYPE": { - "type": "interest", - "reason": "test" - }, - "REQUESTUSERINTEREST_WITH_BOOLEAN_REASONTYPE": { - "type": "interest", - "reason": true - }, - "TYPE_INTEREST_REASON_PLAYLIST": { - "correlationId": "xyz", - "parameters": { - "type": "interest", - "reason": "playlist" - } - }, - "TYPE_INTEREST_REASON_REACTION": { - "correlationId": "xyz", - "parameters": { - "type": "interest", - "reason": "reaction" - } - }, - "TYPE_INTEREST_REASON_RECORDING": { - "correlationId": "xyz", - "parameters": { - "type": "interest", - "reason": "recording" - } - }, - "TYPE_DISINTEREST_REASON_PLAYLIST": { - "correlationId": "xyz", - "parameters": { - "type": "disinterest", - "reason": "playlist" - } - }, - "TYPE_DISINTEREST_REASON_REACTION": { - "correlationId": "xyz", - "parameters": { - "type": "disinterest", - "reason": "reaction" - } - }, - "TYPE_DISINTEREST_REASON_RECORDING": { - "correlationId": "xyz", - "parameters": { - "type": "disinterest", - "reason": "recording" - } - }, - "REQUESTUSERINTEREST_WITH_TYPE_INTEREST": { - "InterestType": "interest" - }, - "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST": { - "InterestType": "disinterest" - }, - "USERINTEREST_WITH_INVALID_MUSICTYPE_FOR_MUSIC_ENTITY_WITH_ALBUMID": { - "InterestType": "interest", + "reason": "recording", "entity": { - "entityType": "music", - "musicType": "album", - "entityId": "song/xyz", - "albumId": "album/xyz" - } - }, - "REQUESTUSERINTEREST_WITH_REASON_PLAYLIST_RESPONSE": { - "appId": "foo-app", - "entity":{ "identifiers": { "entityId": "345", - "entityType": "playlist" + "entityType": "program", + "programType": "movie" }, "info": { - "title": "User Interest", - "synopsis": "User Interest request provider", + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ { @@ -1775,17 +1643,19 @@ } } }, - "REQUESTUSERINTEREST_WITH_REASON_REACTION_RESPONSE": { - "appId": "foo-app", - "entity":{ + "TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "recording", + "entity": { "identifiers": { - "entityId": "123", - "entityType": "channel", - "channelType": "streaming" + "entityId": "345", + "entityType": "program", + "programType": "movie" }, "info": { - "title": "User Interest", - "synopsis": "User Interest request provider", + "title": "Cool Runnings", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ { @@ -1800,24 +1670,105 @@ } } }, - "REQUESTUSERINTEREST_WITH_REASON_RECORDING_RESPONSE": { - "appId": "foo-app", - "entity":{ + "TYPE_INTEREST_REASON_CHANNEL_STREAMING_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "recording", + "entity": { "identifiers": { - "entityId": "981", - "entityType": "music", - "musicType": "song" - }, - "info": { - "title": "User Interest", - "synopsis": "User Interest request provider", - "releaseDate": "1993-01-01T00:00:00.000Z", - "contentRatings": [ - { - "scheme": "US-TV", - "rating": "PG" - } - ] + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_CHANNEL_STREAMING_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_INTEREST_REASON_CHANNEL_OVERTHEAIR_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_CHANNEL_OVERTHEAIR_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_INTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + } + }, + "TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + } + }, + "TYPE_INTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz", + "seriesId": "breaking-bad" + } + } + }, + "TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz", + "seriesId": "breaking-bad" } } } From 657d79a9d133eb98b6dc6c7d5aafb5e443a1b775 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 29 May 2024 12:06:49 +0530 Subject: [PATCH 079/359] FIRECERT-2055-addressed comment --- cypress/support/validations/undefinedValidation.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/support/validations/undefinedValidation.js b/cypress/support/validations/undefinedValidation.js index 0838b161..f574f43d 100644 --- a/cypress/support/validations/undefinedValidation.js +++ b/cypress/support/validations/undefinedValidation.js @@ -41,22 +41,22 @@ Cypress.Commands.add( `Undefined Validation : Expected ${methodOrEventName} response to have the field ${validation.field} as undefined` ); } else { - // Else recursively access the nested field properties and verify the corresponding value in response is undefined + // Else recursively access the nested field properties const fieldParts = validation.field.split('.'); fieldParts.shift(); let currentObject = methodOrEventResponse; - // Throw error if any properties other than the provided field is undefined + // Throw error if any properties other than the last field is undefined for (let i = 0; i < fieldParts.length - 1; i++) { const part = fieldParts[i]; if (!currentObject || typeof currentObject[part] === CONSTANTS.UNDEFINED) { fireLog.assert( false, - `Undefined Validation : Expected ${methodOrEventName} response to have property ${part} in the field ${validation.field}` + `Undefined Validation : Expected ${methodOrEventName} response to have property ${part}` ); } currentObject = currentObject[part]; } - // Else assert if provided field is undefined + // Else assert that the last field is undefined const finalPart = fieldParts[fieldParts.length - 1]; fireLog.isUndefined( currentObject[finalPart], @@ -67,14 +67,14 @@ Cypress.Commands.add( } catch (error) { fireLog.assert( false, - `Undefined Validation : Received following error while performing validation of type undefined on response', + `Undefined Validation : Received following error while performing validation', ${JSON.stringify(error)}` ); } } else { fireLog.assert( false, - 'Undefined Validation : Expected validation object or api/event object stored in global list to not be undefined' + `Undefined Validation : Unable to find ${methodOrEventName} object stored in global list` ); } } From 7bf88105f21a6375b82628357104d4e446caa549 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Wed, 29 May 2024 14:01:10 +0530 Subject: [PATCH 080/359] FIRECERT-1819: Testcase scenario names and params correction --- .../UserInterest.feature | 94 ++--- .../fixtures/fireboltCalls/userinterest.json | 328 +++--------------- 2 files changed, 95 insertions(+), 327 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index 237a4c49..6fec7253 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -6,56 +6,56 @@ Feature: UserInterest And 3rd party 'certification' app is launched @coreSDK @sdk @transport @userinterest - Scenario Outline: Discovery.userInterest - Positive Scenario: with interest type + Scenario Outline: Discovery.userInterest - Positive Scenario: In-app UX Notify userInterest with type When 1st party app registers for the 'Content onUserInterest' event using the 'Firebolt' API - And '3rd party app' invokes the 'Firebolt' API to 'get userInterest with ' + And '3rd party app' invokes the 'Firebolt' API to 'notify userInterest with ' Then 'Firebolt' platform responds with 'null for discovery userInterest' And 'Firebolt' platform triggers to '1st party app' event 'onUserInterest with ' Examples: - | Scenario | GetParam | Event_Content | - | interest reason playlist | type interest reason playlist program entity | type interest reason playlist | - | disinterest reason playlist | type disinterest reason playlist program entity | type disinterest reason playlist | - | interest reason playlist & channel streaming entity | type interest reason playlist channel streaming entity | type interest reason playlist channel | - | disinterest reason playlist & channel streaming entity | type disinterest reason playlist channel streaming entity | type disinterest reason playlist channel | - | interest reason playlist & channel overTheAir entity | type interest reason playlist channel overTheAir entity | type interest reason playlist overTheAir | - | disinterest reason playlist & channel overTheAir entity | type disinterest reason playlist channel overTheAir entity | type disinterest reason playlist overTheAir | - | interest reason playlist & program episode entity | type interest reason playlist program episode entity | type interest reason playlist program episode | - | disinterest reason playlist & program episode entity | type disinterest reason playlist program episode entity | type disinterest reason playlist program episode | - | interest reason playlist & program additional concert entity | type interest reason playlist program additional concert entity | type interest reason playlist additional concert entity | - | disinterest reason playlist & program additional concert entity | type disinterest reason playlist program additional concert entity | type disinterest reason playlist additional concert entity | - | interest reason playlist & program additional sportingEvent entity | type interest reason playlist program additional sportingEvent entity | type interest reason playlist additional sportingEvent entity | - | disinterest reason playlist & program additional sportingEvent entity | type disinterest reason playlist program additional sportingEvent entity | type disinterest reason playlist additional sportingEvent entity | - | interest reason playlist & music song entity | type interest reason playlist music song entity | type interest reason playlist music song entity | - | disinterest reason playlist & music song entity | type disinterest reason playlist music song entity | type disinterest reason playlist music song entity | - | interest reason playlist & music album entity | type interest reason playlist music album entity | type interest reason playlist music album entity | - | disinterest reason playlist & music album entity | type disinterest reason playlist music album entity | type disinterest reason playlist music album entity | - | interest reason reaction | type interest reason reaction program entity | type interest reason reaction program entity | - | disinterest reason reaction | type disinterest reason reaction program entity | type disinterest reason reaction program entity | - | interest reason reaction & channel streaming entity | type interest reason reaction channel streaming entity | type interest reason reaction channel streaming entity | - | disinterest reason reaction & channel streaming entity | type disinterest reason reaction channel streaming entity | type disinterest reason reaction channel streaming entity | - | interest reason reaction & program additional preview entity | type interest reason reaction program additional preview entity | type interest reason reaction program additional preview entity | - | disinterest reason reaction & program additional preview entity | type disinterest reason reaction program additional preview entity | type disinterest reason reaction program additional preview entity | - | interest reason reaction & program additional advertisement entity | type interest reason reaction program additional advertisement entity | type interest reason reaction program additional advertisement entity | - | disinterest reason reaction & program additional advertisement entity | type disinterest reason reaction program additional advertisement entity | type disinterest reason reaction program additional advertisement entity | - | interest reason reaction & program additional musicVideo entity | type interest reason reaction program additional musicVideo entity | type interest reason reaction program additional musicVideo entity | - | disinterest reason reaction & program additional musicVideo entity | type disinterest reason reaction program additional musicVideo entity | type disinterest reason reaction program additional musicVideo entity | - | interest reason reaction & program additional minisode entity | type interest reason reaction program additional minisode entity | type interest reason reaction program additional minisode entity | - | disinterest reason reaction & program additional minisode entity | type disinterest reason reaction program additional minisode entity | type disinterest reason reaction program additional minisode entity | - | interest reason reaction & program additional extra entity | type interest reason reaction program additional extra entity | type interest reason reaction program additional extra entity | - | disinterest reason reaction & program additional extra entity | type disinterest reason reaction program additional extra entity | type disinterest reason reaction program additional extra entity | - | interest reason reaction & program tvepisode entity with seriesId and seasonId | type interest reason reaction program tvepisode entity with seriesId and seasonId | type interest reason reaction program tvepisode entity with seriesId and seasonId | - | disinterest reason reaction & program tvepisode entity with seriesId and seasonId | type disinterest reason reaction program tvepisode entity with seriesId and seasonId | type disinterest reason reaction program tvepisode entity with seriesId and seasonId | - | interest reason recording | type interest reason recording program entity | type interest reason recording program entity | - | disinterest reason recording | type disinterest reason recording program entity | type disinterest reason recording program entity | - | interest reason recording & channel streaming entity | type interest reason recording channel streaming entity | type interest reason recording channel streaming entity | - | disinterest reason recording & channel streaming entity | type disinterest reason recording channel streaming entity | type disinterest reason recording channel streaming entity | - | interest reason recording & channel overTheAir entity | type interest reason recording channel overTheAir entity | type interest reason recording channel overTheAir entity | - | disinterest reason recording & channel overTheAir entity | type disinterest reason recording channel overTheAir entity | type disinterest reason recording channel overTheAir entity | - | interest reason recording & program episode entity | type interest reason recording program episode entity | type interest reason recording program episode entity | - | disinterest reason recording & program episode entity | type disinterest reason recording program episode entity | type disinterest reason recording program episode entity | - | interest reason recording & program season entity | type interest reason recording program season entity | type interest reason recording program season entity | - | disinterest reason recording & program season entity | type disinterest reason recording program season entity | type disinterest reason recording program season entity | + | Scenario | GetParam | Event_Content | + | interest & reason playlist with program entity | type interest and reason playlist with program entity | type interest reason playlist | + | disinterest & reason playlist with program entity | type disinterest and reason playlist with program entity | type disinterest reason playlist | + | interest & reason playlist with channel streaming entity | type interest and reason playlist with channel streaming entity | type interest reason playlist channel | + | disinterest & reason playlist with channel streaming entity | type disinterest and reason playlist with channel streaming entity | type disinterest reason playlist channel | + | interest & reason playlist with channel overTheAir entity | type interest and reason playlist with channel overTheAir entity | type interest reason playlist overTheAir | + | disinterest & reason playlist with channel overTheAir entity | type disinterest and reason playlist with channel overTheAir entity | type disinterest reason playlist overTheAir | + | interest & reason playlist with program episode entity | type interest and reason playlist with program episode entity | type interest reason playlist program episode | + | disinterest & reason playlist with program episode entity | type disinterest and reason playlist with program episode entity | type disinterest reason playlist program episode | + | interest & reason playlist with program additional concert entity | type interest and reason playlist with program additional concert entity | type interest reason playlist additional concert entity | + | disinterest & reason playlist with program additional concert entity | type disinterest and reason playlist with program additional concert entity | type disinterest reason playlist additional concert entity | + | interest & reason playlist with program additional sportingEvent entity | type interest and reason playlist with program additional sportingEvent entity | type interest reason playlist additional sportingEvent entity | + | disinterest & reason playlist with program additional sportingEvent entity | type disinterest and reason playlist with program additional sportingEvent entity | type disinterest reason playlist additional sportingEvent entity | + | interest & reason playlist with music song entity | type interest and reason playlist with music song entity | type interest reason playlist music song entity | + | disinterest & reason playlist with music song entity | type disinterest and reason playlist with music song entity | type disinterest reason playlist music song entity | + | interest & reason playlist with music album entity | type interest and reason playlist with music album entity | type interest reason playlist music album entity | + | disinterest & reason playlist with music album entity | type disinterest and reason playlist with music album entity | type disinterest reason playlist music album entity | + | interest & reason reaction with program entity | type interest and reason reaction with program entity | type interest reason reaction program entity | + | disinterest & reason reaction with program entity | type disinterest and reason reaction with program entity | type disinterest reason reaction program entity | + | interest & reason reaction with channel streaming entity | type interest and reason reaction with channel streaming entity | type interest reason reaction channel streaming entity | + | disinterest & reason reaction with channel streaming entity | type disinterest and reason reaction with channel streaming entity | type disinterest reason reaction channel streaming entity | + | interest & reason reaction with program additional preview entity | type interest and reason reaction with program additional preview entity | type interest reason reaction program additional preview entity | + | disinterest & reason reaction with program additional preview entity | type disinterest and reason reaction with program additional preview entity | type disinterest reason reaction program additional preview entity | + | interest & reason reaction with program additional advertisement entity | type interest and reason reaction with program additional advertisement entity | type interest reason reaction program additional advertisement entity | + | disinterest & reason reaction with program additional advertisement entity | type disinterest and reason reaction with program additional advertisement entity | type disinterest reason reaction program additional advertisement entity | + | interest & reason reaction with program additional musicVideo entity | type interest and reason reaction with program additional musicVideo entity | type interest reason reaction program additional musicVideo entity | + | disinterest & reason reaction with program additional musicVideo entity | type disinterest and reason reaction with program additional musicVideo entity | type disinterest reason reaction program additional musicVideo entity | + | interest & reason reaction with program additional minisode entity | type interest and reason reaction with program additional minisode entity | type interest reason reaction program additional minisode entity | + | disinterest & reason reaction with program additional minisode entity | type disinterest and reason reaction with program additional minisode entity | type disinterest reason reaction program additional minisode entity | + | interest & reason reaction with program additional extra entity | type interest and reason reaction with program additional extra entity | type interest reason reaction program additional extra entity | + | disinterest & reason reaction with program additional extra entity | type disinterest and reason reaction with program additional extra entity | type disinterest reason reaction program additional extra entity | + | interest & reason reaction with program tvepisode entity with seriesId and seasonId | type interest and reason reaction with program tvepisode entity with seriesId and seasonId | type interest reason reaction program tvepisode entity with seriesId and seasonId | + | disinterest & reason reaction with program tvepisode entity with seriesId and seasonId | type disinterest and reason reaction with program tvepisode entity with seriesId and seasonId | type disinterest reason reaction program tvepisode entity with seriesId and seasonId | + | interest & reason recording with program entity | type interest and reason recording with program entity | type interest reason recording program entity | + | disinterest & reason recording with program entity | type disinterest and reason recording with program entity | type disinterest reason recording program entity | + | interest & reason recording with channel streaming entity | type interest and reason recording with channel streaming entity | type interest reason recording channel streaming entity | + | disinterest & reason recording with channel streaming entity | type disinterest and reason recording with channel streaming entity | type disinterest reason recording channel streaming entity | + | interest & reason recording with channel overTheAir entity | type interest and reason recording with channel overTheAir entity | type interest reason recording channel overTheAir entity | + | disinterest & reason recording with channel overTheAir entity | type disinterest and reason recording with channel overTheAir entity | type disinterest reason recording channel overTheAir entity | + | interest & reason recording with program episode entity | type interest and reason recording with program episode entity | type interest reason recording program episode entity | + | disinterest & reason recording with program episode entity | type disinterest and reason recording with program episode entity | type disinterest reason recording program episode entity | + | interest & reason recording with program season entity | type interest and reason recording with program season entity | type interest reason recording program season entity | + | disinterest & reason recording with program season entity | type disinterest and reason recording with program season entity | type disinterest reason recording program season entity | @coreSDK @sdk @transport @userinterest @@ -87,8 +87,8 @@ Feature: UserInterest | Invalid programType for program entity with seasonId | with invalid programType for program entity with seasonId | @coreSDK @sdk @userinterest - Scenario Outline: Content.requestUserInterest - Positive Scenario: with type - And 1st party app invokes the 'Firebolt' API to 'get requestUserInterest with type ' + Scenario Outline: Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type + And 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type ' Then 'Firebolt' platform responds to '1st party app' with '' Examples: diff --git a/cypress/fixtures/fireboltCalls/userinterest.json b/cypress/fixtures/fireboltCalls/userinterest.json index dbb14133..8397012d 100644 --- a/cypress/fixtures/fireboltCalls/userinterest.json +++ b/cypress/fixtures/fireboltCalls/userinterest.json @@ -1,404 +1,172 @@ { - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_CHANNEL_STREAMING_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_CHANNEL_STREAMING_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_STREAMING" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_CHANNEL_STREAMING_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_CHANNEL_STREAMING_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_STREAMING" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_CHANNEL_OVERTHEAIR_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_CHANNEL_OVERTHEAIR_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_OVERTHEAIR" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_CHANNEL_OVERTHEAIR_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_CHANNEL_OVERTHEAIR_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_OVERTHEAIR" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_EPISODE_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_EPISODE_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_EPISODE" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_EPISODE_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_EPISODE_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_EPISODE" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_SEASON_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SEASON" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_SEASON_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SEASON" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_SERIES_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SERIES" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_SERIES_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_SERIES" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_CONCERT" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_CONCERT" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_OTHER_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_OTHER" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_OTHER_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_OTHER" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MINISODE" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_MINISODE" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_EXTRA" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_EXTRA" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_MUSIC_SONG_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_MUSIC_SONG" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_MUSIC_SONG_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_MUSIC_SONG" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_MUSIC_ALBUM_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_MUSIC_ALBUM" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_MUSIC_ALBUM_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_MUSIC_ALBUM" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_CHANNEL_STREAMING_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_CHANNEL_STREAMING_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_CHANNEL_OVERTHEAIR_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_OVERTHEAIR" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_CHANNEL_OVERTHEAIR_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_OVERTHEAIR" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_EPISODE_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_EPISODE" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_EPISODE_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_EPISODE" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_SEASON_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_SEASON" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_SEASON_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_SEASON" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_SERIES_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_SERIES" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_SERIES_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_SERIES" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_CONCERT" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_CONCERT" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_MUSIC_SONG_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_MUSIC_SONG" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_MUSIC_SONG_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_MUSIC_SONG" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_MUSIC_ALBUM_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_MUSIC_ALBUM" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_MUSIC_ALBUM_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_MUSIC_ALBUM" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_RECORDING_WITH_PROGRAM_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_RECORDING_WITH_PROGRAM_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_CHANNEL_STREAMING_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_RECORDING_WITH_CHANNEL_STREAMING_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_CHANNEL_STREAMING_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_RECORDING_WITH_CHANNEL_STREAMING_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_CHANNEL_OVERTHEAIR_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_RECORDING_WITH_CHANNEL_OVERTHEAIR_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_CHANNEL_OVERTHEAIR_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_RECORDING_WITH_CHANNEL_OVERTHEAIR_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_RECORDING_WITH_PROGRAM_EPISODE_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_RECORDING_WITH_PROGRAM_EPISODE_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_RECORDING_WITH_PROGRAM_SEASON_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON" }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY": { + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_RECORDING_WITH_PROGRAM_SEASON_ENTITY": { "method": "discovery.userInterest", "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_SERIES_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_SERIES" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_SERIES_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_SERIES" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_CONCERT" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_CONCERT" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_OTHER_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_OTHER" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_OTHER_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_OTHER" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MINISODE" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_MINISODE" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_EXTRA" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_ADDITIONAL_EXTRA" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_MUSIC_SONG_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_MUSIC_SONG" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_MUSIC_SONG_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_MUSIC_SONG" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_MUSIC_ALBUM_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_MUSIC_ALBUM" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_MUSIC_ALBUM_ENTITY": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_MUSIC_ALBUM" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" - }, "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { "event": "content.onUserInterest", "validationJsonPath": "eventResponse", @@ -782,27 +550,27 @@ "param": "DISCOVERY_USERINTEREST_WITH_INVALID_MUSICTYPE_FOR_MUSIC_ENTITY_WITH_ALBUMID", "expected": "error" }, - "GET_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { "method": "discovery_content.requestUserInterest", "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST" }, - "GET_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { "method": "discovery_content.requestUserInterest", "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION" }, - "GET_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING": { + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING": { "method": "discovery_content.requestUserInterest", "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING" }, - "GET_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { "method": "discovery_content.requestUserInterest", "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST" }, - "GET_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION": { + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION": { "method": "discovery_content.requestUserInterest", "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION" }, - "GET_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING": { + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING": { "method": "discovery_content.requestUserInterest", "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING" }, From 419e5b866d89ed5e599298c006d04ebefd327d1b Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Wed, 29 May 2024 14:53:23 +0530 Subject: [PATCH 081/359] Updated module requirement id json file --- .../fixtures/objects/moduleReqId/moduleReqId.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 8461af5c..5b076996 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -2678,7 +2678,7 @@ } }, "UserInterest": { - "Content.requestUserInterest - Positive Scenario: with type interest and reason playlist": { + "Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type interest and reason playlist": { "req": [ { "method": { @@ -2688,7 +2688,7 @@ } ] }, - "Content.requestUserInterest - Positive Scenario: with type interest and reason reaction": { + "Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type interest and reason reaction": { "req": [ { "method": { @@ -2698,7 +2698,7 @@ } ] }, - "Content.requestUserInterest - Positive Scenario: with type interest and reason recording": { + "Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type interest and reason recording": { "req": [ { "method": { @@ -2708,7 +2708,7 @@ } ] }, - "Content.requestUserInterest - Positive Scenario: with type disinterest and reason playlist": { + "Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type disinterest and reason playlist": { "req": [ { "method": { @@ -2718,7 +2718,7 @@ } ] }, - "Content.requestUserInterest - Positive Scenario: with type disinterest and reason reaction": { + "Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type disinterest and reason reaction": { "req": [ { "method": { @@ -2728,7 +2728,7 @@ } ] }, - "Content.requestUserInterest - Positive Scenario: with type disinterest and reason recording": { + "Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type disinterest and reason recording": { "req": [ { "method": { From dc57c7fc684778e49b9f0993a3e1a5012390b954 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Thu, 30 May 2024 13:15:28 +0530 Subject: [PATCH 082/359] FIRECERT-1819: Added behavioural scenarios for userInterest --- .../UserInterest.feature | 19 ++++++++++++- .../fixtures/fireboltCalls/userinterest.json | 27 +++++++++++++++++++ .../objects/moduleReqId/moduleReqId.json | 10 +++++++ cypress/support/constants/constants.js | 2 +- cypress/support/cypress-commands/commands.js | 1 + defaultModule/requestModules/fcs.js | 11 +++++--- 6 files changed, 64 insertions(+), 6 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index 6fec7253..f4c050e5 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -110,4 +110,21 @@ Feature: UserInterest | Invalid Interest value - test params | invalid interestType | | Invalid Interest type - boolean params | boolean interestType | | Invalid reason value - test params | invalid reasonType | - | Invalid Interest type - boolean params | boolean reasonType | \ No newline at end of file + | Invalid Interest type - boolean params | boolean reasonType | + + @coreSDK @sdk @userinterest @notSupported + Scenario: Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest but platform timeout without sending response + When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type interest timeout' + Then 'Firebolt' platform responds to '1st party app' with 'not available for requestUserInterest' + + @coreSDK @sdk @userinterest @notSupported + Scenario: Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest but 3rd party app return error + When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type interest returns error' + Then 'Firebolt' platform responds to '1st party app' with 'invalid parameters for requestUserInterest' + + @coreSDK @sdk @userinterest + Scenario: Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest without registering for providers + Given the environment has been set up for 'Userinterest' tests + And 3rd party 'certification' app is launched + When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type interest without provider' + Then 'Firebolt' platform responds to '1st party app' with 'not available for requestUserInterest' diff --git a/cypress/fixtures/fireboltCalls/userinterest.json b/cypress/fixtures/fireboltCalls/userinterest.json index 8397012d..022862a2 100644 --- a/cypress/fixtures/fireboltCalls/userinterest.json +++ b/cypress/fixtures/fireboltCalls/userinterest.json @@ -603,5 +603,32 @@ }, "DISCOVERY_ONREQUESTUSERINTEREST":{ "method": "Discovery.onRequestUserInterest" + }, + "NOT_AVAILABLE_FOR_REQUESTUSERINTEREST": { + "method": "content.requestUserInterest", + "validationJsonPath": "result", + "content": "NOT_AVAILABLE", + "expectingError": true + }, + "INVALID_PARAMETERS_FOR_REQUESTUSERINTEREST": { + "method": "content.requestUserInterest", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_WITHOUT_PROVIDER": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST", + "expected": "error" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_TIMEOUT": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST", + "expected": "error" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_RETURNS_ERROR": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST", + "expected": "error" } } \ No newline at end of file diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 5b076996..e9b38a5b 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -2737,6 +2737,16 @@ } } ] + }, + "Content.requestUserInterest - Negative Scenario: Platform-UX Notify requestUserInterest without registering for providers": { + "req": [ + { + "method": { + "id": "UserInterest 1.6", + "description": "Negative Scenario: Notify requestUserInterest without registering for providers" + } + } + ] } } } diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 5be43d33..1049a00e 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -398,7 +398,7 @@ module.exports = { STOPPED: 'stopped', START: 'start', STOP: 'stop', - FIRST_PARTY_MOCK_USER: 'firstPartyUserId', + FIRST_PARTY_MOCK_USER: 'firstPartyMockUser', THIRD_PARTY_MOCK_USER: 'thirdPartyMockUser', HTTP: 'HTTP', STATE_METHOD: 'state/method/', diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index c7718a7f..b1096418 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -475,6 +475,7 @@ Cypress.Commands.add('setResponse', (beforeOperation, scenarioName) => { CONSTANTS.SUPPORTED_CALLTYPES.FIREBOLTMOCKS ).then((parsedData) => { if (firstParty) { + parsedData.firstParty = firstParty; const method = CONSTANTS.REQUEST_OVERRIDE_CALLS.SETRESPONSE; const requestMap = { method: method, diff --git a/defaultModule/requestModules/fcs.js b/defaultModule/requestModules/fcs.js index af136246..0f9263f8 100644 --- a/defaultModule/requestModules/fcs.js +++ b/defaultModule/requestModules/fcs.js @@ -32,7 +32,7 @@ const UTILS = require('../../../cypress/support/cypress-support/src/utils'); function setResponse(parsedParam) { try { parsedParam = parsedParam.params; - const { method } = parsedParam; + const { method, firstParty } = parsedParam; let requestJson, URLParam; let publishMessage = {}; if (parsedParam.response) { @@ -42,7 +42,7 @@ function setResponse(parsedParam) { requestJson = { error: parsedParam.error }; URLParam = `${CONSTANTS.STATE_METHOD}${method}/error`; } - publishMessage = { requestJson, URLParam }; + publishMessage = { requestJson, URLParam, firstParty }; return createPublishMessage(publishMessage); } catch (error) { assert(false, `${error.message} in setResponse`); @@ -58,7 +58,7 @@ function setResponse(parsedParam) { * createPublishMessage({"URLParam":"search","requestJson":{"result":"jeo@deo.com"},"userId":"456~A"}) **/ function createPublishMessage(publishMessage) { - const { URLParam, requestJson } = publishMessage; + const { URLParam, requestJson, firstParty } = publishMessage; return { transport: CONSTANTS.HTTP, options: { @@ -66,7 +66,10 @@ function createPublishMessage(publishMessage) { method: 'POST', headers: { 'Content-Type': 'application/json', - 'x-mockfirebolt-userid': UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_MOCK_USER), + 'x-mockfirebolt-userid': + firstParty == true + ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_MOCK_USER) + : UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_MOCK_USER), }, payload: requestJson, }, From aa7759df15194cf861b33a49dddc26db775d43fb Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Thu, 30 May 2024 14:39:29 +0530 Subject: [PATCH 083/359] FIRECERT-1819: Corrected scenario names --- .../FireboltCertification/UserInterest.feature | 4 ++-- .../fixtures/objects/moduleReqId/moduleReqId.json | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index f4c050e5..100d7244 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -6,7 +6,7 @@ Feature: UserInterest And 3rd party 'certification' app is launched @coreSDK @sdk @transport @userinterest - Scenario Outline: Discovery.userInterest - Positive Scenario: In-app UX Notify userInterest with type + Scenario Outline: Discovery.userInterest - Positive Scenario: In-app UX - Notify userInterest with type When 1st party app registers for the 'Content onUserInterest' event using the 'Firebolt' API And '3rd party app' invokes the 'Firebolt' API to 'notify userInterest with ' Then 'Firebolt' platform responds with 'null for discovery userInterest' @@ -87,7 +87,7 @@ Feature: UserInterest | Invalid programType for program entity with seasonId | with invalid programType for program entity with seasonId | @coreSDK @sdk @userinterest - Scenario Outline: Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type + Scenario Outline: Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type And 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type ' Then 'Firebolt' platform responds to '1st party app' with '' diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index e9b38a5b..c7461199 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -2678,7 +2678,7 @@ } }, "UserInterest": { - "Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type interest and reason playlist": { + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type interest and reason playlist": { "req": [ { "method": { @@ -2688,7 +2688,7 @@ } ] }, - "Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type interest and reason reaction": { + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type interest and reason reaction": { "req": [ { "method": { @@ -2698,7 +2698,7 @@ } ] }, - "Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type interest and reason recording": { + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type interest and reason recording": { "req": [ { "method": { @@ -2708,7 +2708,7 @@ } ] }, - "Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type disinterest and reason playlist": { + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type disinterest and reason playlist": { "req": [ { "method": { @@ -2718,7 +2718,7 @@ } ] }, - "Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type disinterest and reason reaction": { + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type disinterest and reason reaction": { "req": [ { "method": { @@ -2728,7 +2728,7 @@ } ] }, - "Content.requestUserInterest - Positive Scenario: Platform-UX Notify requestUserInterest with type disinterest and reason recording": { + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type disinterest and reason recording": { "req": [ { "method": { @@ -2738,7 +2738,7 @@ } ] }, - "Content.requestUserInterest - Negative Scenario: Platform-UX Notify requestUserInterest without registering for providers": { + "Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest without registering for providers": { "req": [ { "method": { From 0a2428d9468e2db42c29f7860663a89379699b6b Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Thu, 30 May 2024 14:43:07 +0530 Subject: [PATCH 084/359] Corrected requirement id's --- .../fixtures/objects/moduleReqId/moduleReqId.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index c7461199..789a74af 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -2682,7 +2682,7 @@ "req": [ { "method": { - "id": "UserInterest 1.0", + "id": "UserInterest 4.1", "description": "Positive Scenario: with type interest and reason playlist" } } @@ -2692,7 +2692,7 @@ "req": [ { "method": { - "id": "UserInterest 1.1", + "id": "UserInterest 4.2", "description": "Positive Scenario: with type interest and reason reaction" } } @@ -2702,7 +2702,7 @@ "req": [ { "method": { - "id": "UserInterest 1.2", + "id": "UserInterest 4.3", "description": "Positive Scenario: with type interest and reason recording" } } @@ -2712,7 +2712,7 @@ "req": [ { "method": { - "id": "UserInterest 1.3", + "id": "UserInterest 4.4", "description": "Positive Scenario: with type disinterest and reason playlist" } } @@ -2722,7 +2722,7 @@ "req": [ { "method": { - "id": "UserInterest 1.4", + "id": "UserInterest 4.5", "description": "Positive Scenario: with type disinterest and reason reaction" } } @@ -2732,7 +2732,7 @@ "req": [ { "method": { - "id": "UserInterest 1.5", + "id": "UserInterest 4.6", "description": "Positive Scenario: with type disinterest and reason recording" } } @@ -2742,7 +2742,7 @@ "req": [ { "method": { - "id": "UserInterest 1.6", + "id": "UserInterest 4.7", "description": "Negative Scenario: Notify requestUserInterest without registering for providers" } } From 42812326b54f7487a7c814c9d9ad322426e91877 Mon Sep 17 00:00:00 2001 From: "Padinjarevelikkakath Mukundan, Anjali" Date: Thu, 30 May 2024 17:58:18 +0530 Subject: [PATCH 085/359] FIRECERT-2108 Core module report analysis and fixing --- cypress/fixtures/defaultTestData.json | 3 ++- cypress/fixtures/fireboltCalls/localization.json | 2 +- cypress/fixtures/modules/localization.json | 1 + .../objects/validationObjects/localization.json | 15 +++++++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/cypress/fixtures/defaultTestData.json b/cypress/fixtures/defaultTestData.json index db406502..069859eb 100644 --- a/cypress/fixtures/defaultTestData.json +++ b/cypress/fixtures/defaultTestData.json @@ -39,5 +39,6 @@ "APIVERSION": "1.0.0", "DEVICERESOLUTION" : [[1280,720],[1920,1080],[3840,2160]], "STRING123456": "123456", - "FOREGROUND": "foreground" + "FOREGROUND": "foreground", + "SCREENRESOLUTION" : [[1280,720],[1920,1080],[3840,2160]] } diff --git a/cypress/fixtures/fireboltCalls/localization.json b/cypress/fixtures/fireboltCalls/localization.json index 5c1cd105..ac792851 100644 --- a/cypress/fixtures/fireboltCalls/localization.json +++ b/cypress/fixtures/fireboltCalls/localization.json @@ -41,7 +41,7 @@ "EMPTY_RESPONSE_FOR_LOCALIZATION_ADDITIONALINFO": { "method": "localization.additionalInfo", "validationJsonPath": "result", - "content": "EMPTYPARAM" + "content": "LOCALIZATION_REMOVE_ADDITIONALINFO_EMPTY_RESPONSE" }, "SET_LOCALIZATION_ADDADDITIONALINFO_WITH_KEY_AS_STRING_VALUE_AS_NULL": { "method": "manage_localization.addAdditionalInfo", diff --git a/cypress/fixtures/modules/localization.json b/cypress/fixtures/modules/localization.json index b8b834bc..ddbdd62f 100644 --- a/cypress/fixtures/modules/localization.json +++ b/cypress/fixtures/modules/localization.json @@ -4,6 +4,7 @@ "ADD_ADDITIONALINFO_KEY_AS_STRING": {"key":"defaultKey"}, "ADD_ADDITIONALINFO_KEY_AS_EMPTY_STRING": {"key":""}, "REMOVE_ADDITIONALINFO_RESPONSE_AS_EMPTY_STRING": {"":""}, + "REMOVE_ADDITIONALINFO_EMPTY_RESPONSE": {}, "ADD_ADDITIONALINFO_VALUE_AS_NULL": {"key": "info","value": null}, "ADD_ADDITIONALINFO_KEY_AS_NULL": {"key": null ,"value": "value1"}, "ADD_ADDITIONALINFO_AS_NULL": {"key": null ,"value": null}, diff --git a/cypress/fixtures/objects/validationObjects/localization.json b/cypress/fixtures/objects/validationObjects/localization.json index 69b6077a..333f1334 100644 --- a/cypress/fixtures/objects/validationObjects/localization.json +++ b/cypress/fixtures/objects/validationObjects/localization.json @@ -128,6 +128,21 @@ } ] }, + "LOCALIZATION_REMOVE_ADDITIONALINFO_EMPTY_RESPONSE": { + "method": "localization.additionalInfo", + "data": [ + { + "type": "fixture", + "validations": [ + { + "mode": "staticContentValidation", + "type": "LOCALIZATION_REMOVE_ADDITIONALINFO_EMPTY_RESPONSE", + "description": "Validation of the Localization additionalInfo key as empty string Format" + } + ] + } + ] + }, "LOCALIZATION_TIMEZONE": { "data": [ { From 15a4c523daec47b52a06a396e5cfcb46c9b1b269 Mon Sep 17 00:00:00 2001 From: Keaton Sentak <54916859+ksentak@users.noreply.github.com> Date: Thu, 30 May 2024 09:47:05 -0400 Subject: [PATCH 086/359] v2 fireboltMock functionality (#82) * v2 fireboltMocks * make generateFireboltCallsIndexFile more generic --- .gitignore | 3 +++ cypress/plugins/common.js | 10 +++++++--- cypress/plugins/pluginUtils.js | 21 ++++++++++---------- cypress/support/cypress-commands/commands.js | 2 +- cypress/support/cypress-support/src/main.js | 13 ++++++++++++ 5 files changed, 35 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index f57ee5d5..6af0c72d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ cypress/fixtures/external # Firebolt Calls Test Data cypress/fixtures/fireboltCalls/index.js +# Firebolt Mock Test Data +cypress/fixtures/fireboltMocks/index.js + # Lock Files yarn.lock diff --git a/cypress/plugins/common.js b/cypress/plugins/common.js index 0feb5c09..a677ef74 100644 --- a/cypress/plugins/common.js +++ b/cypress/plugins/common.js @@ -18,7 +18,7 @@ const fs = require('fs'); const testDataProcessor = require('./testDataProcessor'); const logger = require('../support/Logger')('common.js'); -const { generateFirboltCallsIndexFile } = require('./pluginUtils'); +const { generateIndexFile } = require('./pluginUtils'); const CONSTANTS = require('../support/constants/constants'); // If "genericSupport" is set to a falsy value (false, null, etc), take no further action. Simply "return" @@ -35,8 +35,12 @@ function genericSupport(config) { return acc; }, {}); - generateFirboltCallsIndexFile(CONSTANTS.FIREBOLTCALLS_FROM_FCS); - generateFirboltCallsIndexFile(CONSTANTS.FIREBOLTCALLS_FROM_CONFIGMODULE); + // fireboltCalls JSON + generateIndexFile(CONSTANTS.FIREBOLTCALLS_FROM_FCS, 'fireboltCalls'); + generateIndexFile(CONSTANTS.FIREBOLTCALLS_FROM_CONFIGMODULE, 'fireboltCalls'); + // fireboltMocks JSON + generateIndexFile(CONSTANTS.FIREBOLTMOCK_FROM_FCS, 'fireboltMocks'); + generateIndexFile(CONSTANTS.FIREBOLTMOCK_FROM_CONFIGMODULE, 'fireboltMocks'); // The sequence of override - the default config in the config.js file, overriden by supportConfig.json and then by the command line arguments. config.env = { diff --git a/cypress/plugins/pluginUtils.js b/cypress/plugins/pluginUtils.js index acfaf46b..0e4d017c 100644 --- a/cypress/plugins/pluginUtils.js +++ b/cypress/plugins/pluginUtils.js @@ -66,13 +66,14 @@ async function getAndDereferenceOpenRpc(externalUrls, version = null) { /** * Generates an index.js file that requires all JavaScript files in a specified directory. * @param {string} path - The path to the directory containing the FireboltCalls V2 data. + * @param {string} outputObj - The name of the output object. * @throws {Error} If an error occurs while reading the directory or writing the file. */ -function generateFirboltCallsIndexFile(path) { +function generateIndexFile(path, outputObj) { // Define variables - const v2TestFiles = []; + const moduleFiles = []; // let indexFileContent = ''; - let indexFileContent = 'let fireboltCalls = {};\n'; + let indexFileContent = `let ${outputObj} = {};\n`; try { // First check if the provided path exists @@ -84,19 +85,19 @@ function generateFirboltCallsIndexFile(path) { // then slice off the .js extension and push the file names to the v2TestFiles array files.forEach((file) => { if (file && file.endsWith('.js') && !file.includes('index')) { - v2TestFiles.push(file.slice(0, -3)); + moduleFiles.push(file.slice(0, -3)); } }); // Loop through the test files and require them in the index file - v2TestFiles.forEach((moduleName) => { + moduleFiles.forEach((moduleName) => { indexFileContent += `const ${moduleName} = require('./${moduleName}');\n`; - indexFileContent += `Object.assign(fireboltCalls, ${moduleName});\n`; + indexFileContent += `Object.assign(${outputObj}, ${moduleName});\n`; }); } // Add exports at the bottom of the file - indexFileContent += 'module.exports = fireboltCalls;'; + indexFileContent += `module.exports = ${outputObj};`; // Delete the index.js file if it already exists if (fs.existsSync(`${path}/index.js`)) { @@ -107,11 +108,11 @@ function generateFirboltCallsIndexFile(path) { fs.writeFileSync(`${path}/index.js`, indexFileContent); } catch (error) { logger.error( - `An error occurred while generating the FireboltCalls index file: ${error}`, - 'generateFirboltCallsIndexFile' + `An error occurred while generating the index file: ${error}`, + 'generateIndexFile' ); throw error; } } -module.exports = { getAndDereferenceOpenRpc, generateFirboltCallsIndexFile }; +module.exports = { getAndDereferenceOpenRpc, generateIndexFile }; diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index bf61b8c4..028a969e 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -36,7 +36,7 @@ Cypress.Commands.add( // Reading the data from combinedJson based on key. let fireboltData; if (callType == CONSTANTS.SUPPORTED_CALLTYPES.FIREBOLTMOCKS) { - fireboltData = UTILS.getEnvVariable('fireboltMocksJson')[key]; + fireboltData = UTILS.getEnvVariable(CONSTANTS.COMBINEDFIREBOLTMOCKS)[key]; } else if (callType == CONSTANTS.SUPPORTED_CALLTYPES.SET_RESPONSE_JSON) { fireboltData = UTILS.getEnvVariable('setResponseJson')[key]; } else { diff --git a/cypress/support/cypress-support/src/main.js b/cypress/support/cypress-support/src/main.js index f08f9569..413f62bd 100644 --- a/cypress/support/cypress-support/src/main.js +++ b/cypress/support/cypress-support/src/main.js @@ -31,6 +31,8 @@ let appTransport; const flatted = require('flatted'); const internalV2FireboltCallsData = require('../../../fixtures/fireboltCalls/index'); const externalV2FireboltCallsData = require('../../../fixtures/external/fireboltCalls/index'); +const internalV2FireboltMockData = require('../../../fixtures/fireboltCalls/index'); +const externalV2FireboltMockData = require('../../../fixtures/external/fireboltCalls/index'); export default function (module) { const config = new Config(module); @@ -72,6 +74,7 @@ export default function (module) { ); } + // Merge fireboltCalls const v1FireboltCallsData = UTILS.getEnvVariable('fireboltCallsJson'); const v2FireboltCallsData = { ...internalV2FireboltCallsData, ...externalV2FireboltCallsData }; @@ -81,6 +84,16 @@ export default function (module) { } ); + // Merge fireboltMocks + const v1FireboltMockData = UTILS.getEnvVariable('fireboltMocksJson'); + const combinedFireboltMockData = { + ...v1FireboltMockData, + ...internalV2FireboltMockData, + ...externalV2FireboltMockData, + }; + + Cypress.env(CONSTANTS.COMBINEDFIREBOLTMOCKS, combinedFireboltMockData); + // Unflatten the openRPC data const flattedOpenRpc = UTILS.getEnvVariable(CONSTANTS.DEREFERENCE_OPENRPC); const unflattedOpenRpc = flatted.parse(flattedOpenRpc); From 395eb3019d315126a8bc8988e24873990199a108 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Thu, 30 May 2024 20:09:55 +0530 Subject: [PATCH 087/359] Moved Negative scenario closedcaptions testcases to new folder --- .../ClosedCaptionsManage.feature | 25 +++++++++++++++++++ .../Manage/ClosedCaptionsManage.feature | 8 +----- 2 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 cypress/TestCases/FireboltCertification/AdditionalTestcases/ClosedCaptionsManage.feature diff --git a/cypress/TestCases/FireboltCertification/AdditionalTestcases/ClosedCaptionsManage.feature b/cypress/TestCases/FireboltCertification/AdditionalTestcases/ClosedCaptionsManage.feature new file mode 100644 index 00000000..c1716bc8 --- /dev/null +++ b/cypress/TestCases/FireboltCertification/AdditionalTestcases/ClosedCaptionsManage.feature @@ -0,0 +1,25 @@ +Feature: ClosedCaptions_Manage + + Background: Launch FCA for 'ClosedCaptions' + Given the environment has been set up for 'ClosedCaptions' tests + And 3rd party 'certification' app is launched + + # Below scenario can be implemented by respective config module to return error or default value + # For all the below testcases we are passing invalid string in params but there is no enum value specified so the platform can decide to either return error or default value + @ClosedCaptions @manageSDK + Scenario Outline: ClosedCaptions. - Setting random string values: + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' + + Examples: + | Scenario | Method | API_Key | Method_Validation_key | + | Set fontFamily-test | setFontFamily | set fontFamily to test | custom error for closedCaptions setFontFamily | + | Set fontEdgeColor-test | setFontEdgeColor | set fontEdgeColor to test | invalid params for closedcaptions setFontEdgeColor | + | Set backgroundColor-test | setBackgroundColor | set backgroundColor to test | invalid params for closedcaptions setBackgroundColor | + | Set textAlign-top | setTextAlign | set textAlign to top | invalid params for closedcaptions setTextAlign | + | Set textAlignVertical-right | setTextAlignVertical | set textAlignVertical to right | invalid params for closedcaptions setTextAlignVertical | + | Set fontColor-test | setFontColor | set fontColor to test | invalid params for closedcaptions setFontColor | + + + + diff --git a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature index fab4b949..6126191f 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature @@ -81,7 +81,6 @@ Feature: ClosedCaptions_Manage | Scenario | Method | API_Key | Method_Validation_key | | Set enabled-test | setEnabled | enable closedCaptions with test parameter | invalid params for closedcaptions setEnabled | | Set enabled-123 | setEnabled | enable closedCaptions with integer parameter | invalid params for closedcaptions setEnabled | - | Set fontFamily-test | setFontFamily | set fontFamily to test | custom error for closedCaptions setFontFamily | | Set fontFamily-123 | setFontFamily | set fontFamily to 123 | invalid params for closedcaptions setFontFamily | | Set fontFamily-true | setFontFamily | set fontFamily to true | invalid params for closedcaptions setFontFamily | | Set fontSize-true | setFontSize | set fontSize to true | invalid params for closedcaptions setFontSize | @@ -94,22 +93,17 @@ Feature: ClosedCaptions_Manage | Set fontEdge-solid | setFontEdge | set fontEdge to solid | custom error for closedcaptions setFontEdge | | Set preferredLanguages-true | setPreferredLanguages | set preferredLanguages to true | invalid params for closedcaptions setPreferredLanguages | | Set preferredLanguages-123 | setPreferredLanguages | set preferredLanguages to 123 | invalid params for closedcaptions setPreferredLanguages | - | Set preferredLanguages | setPreferredLanguages | set preferredLanguages to test | invalid params for closedcaptions setPreferredLanguages | + | Set preferredLanguage-test | setPreferredLanguages | set preferredLanguages to test | invalid params for closedcaptions setPreferredLanguages | | Set windowColor-123 | setWindowColor | set windowColor to 123 | invalid params for closedcaptions setWindowColor | | Set windowOpacity-true | setWindowOpacity | set windowOpacity to true | invalid params for closedcaptions setWindowOpacity | - | Set fontEdgeColor-test | setFontEdgeColor | set fontEdgeColor to test | invalid params for closedcaptions setFontEdgeColor | | Set fontEdgeColor-123 | setFontEdgeColor | set fontEdgeColor to 123 | invalid params for closedcaptions setFontEdgeColor | | Set fontEdgeColor-true | setFontEdgeColor | set fontEdgeColor to true | invalid params for closedcaptions setFontEdgeColor | - | Set backgroundColor-test | setBackgroundColor | set backgroundColor to test | invalid params for closedcaptions setBackgroundColor | | Set backgroundColor-123 | setBackgroundColor | set backgroundColor to 123 | invalid params for closedcaptions setBackgroundColor | | Set backgroundColor-true | setBackgroundColor | set backgroundColor to true | invalid params for closedcaptions setBackgroundColor | - | Set textAlign-top | setTextAlign | set textAlign to top | invalid params for closedcaptions setTextAlign | | Set textAlign-123 | setTextAlign | set textAlign to 123 | invalid params for closedcaptions setTextAlign | | Set textAlign-true | setTextAlign | set textAlign to true | invalid params for closedcaptions setTextAlign | - | Set textAlignVertical-right | setTextAlignVertical | set textAlignVertical to right | invalid params for closedcaptions setTextAlignVertical | | Set textAlignVertical-123 | setTextAlignVertical | set textAlignVertical to 123 | invalid params for closedcaptions setTextAlignVertical | | Set textAlignVertical-true | setTextAlignVertical | set textAlignVertical to true | invalid params for closedcaptions setTextAlignVertical | - | Set fontColor-test | setFontColor | set fontColor to test | invalid params for closedcaptions setFontColor | | Set fontColor-123 | setFontColor | set fontColor to 123 | invalid params for closedcaptions setFontColor | | Set fontColor-true | setFontColor | set fontColor to true | invalid params for closedcaptions setFontColor | | Set fontOpacity-120 | setFontOpacity | set fontOpacity to 120 | custom error for closedcaptions setFontOpacity | From 8af23d7de88c5ddef3724a8bab61b86f67b5a990 Mon Sep 17 00:00:00 2001 From: Keaton Sentak <54916859+ksentak@users.noreply.github.com> Date: Thu, 30 May 2024 16:57:22 -0400 Subject: [PATCH 088/359] fix bug when mock or calls directory does not exist and needs to be created (#86) --- cypress/plugins/pluginUtils.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cypress/plugins/pluginUtils.js b/cypress/plugins/pluginUtils.js index 0e4d017c..93b5ffc8 100644 --- a/cypress/plugins/pluginUtils.js +++ b/cypress/plugins/pluginUtils.js @@ -72,7 +72,6 @@ async function getAndDereferenceOpenRpc(externalUrls, version = null) { function generateIndexFile(path, outputObj) { // Define variables const moduleFiles = []; - // let indexFileContent = ''; let indexFileContent = `let ${outputObj} = {};\n`; try { @@ -99,13 +98,21 @@ function generateIndexFile(path, outputObj) { // Add exports at the bottom of the file indexFileContent += `module.exports = ${outputObj};`; - // Delete the index.js file if it already exists - if (fs.existsSync(`${path}/index.js`)) { - fs.unlinkSync(`${path}/index.js`); + // Define the path of the file to be created + const indexFilePath = `${path}index.js`; + + // Check if the file exists and delete if it does + if (fs.existsSync(indexFilePath)) { + fs.unlinkSync(indexFilePath); + } + + // Check if the directory exists, if not create it + if (!fs.existsSync(path)) { + fs.mkdirSync(path, { recursive: true }); } // Write to the new index.js file - fs.writeFileSync(`${path}/index.js`, indexFileContent); + fs.writeFileSync(indexFilePath, indexFileContent); } catch (error) { logger.error( `An error occurred while generating the index file: ${error}`, From b146d066480bdb722b8bedacedd8c2447e8630a5 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Fri, 31 May 2024 10:51:40 +0530 Subject: [PATCH 089/359] FIRECERT-1819: Corrected params --- .../UserInterest.feature | 6 +- .../fixtures/fireboltCalls/userinterest.json | 86 ++++++------------- 2 files changed, 28 insertions(+), 64 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index 100d7244..21b263a2 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -60,7 +60,7 @@ Feature: UserInterest @coreSDK @sdk @transport @userinterest Scenario Outline: Discovery.userInterest - Negative Scenario: expecting error - When '3rd party app' invokes the 'Firebolt' API to 'get userInterest ' + When '3rd party app' invokes the 'Firebolt' API to 'notify userInterest ' Then 'Firebolt' platform responds with 'invalid params for discovery userInterest' Examples: @@ -102,7 +102,7 @@ Feature: UserInterest @coreSDK @sdk @transport @userinterest Scenario Outline: Content.requestUserInterest - Negative Scenario: expecting error - When 1st party app invokes the 'Firebolt' API to 'get requestUserInterest with ' + When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with ' Then 'Firebolt' platform responds to '1st party app' with 'invalid params for content requestUserInterest' Examples: @@ -122,7 +122,7 @@ Feature: UserInterest When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type interest returns error' Then 'Firebolt' platform responds to '1st party app' with 'invalid parameters for requestUserInterest' - @coreSDK @sdk @userinterest + @coreSDK @sdk @userinterest @notSupported Scenario: Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest without registering for providers Given the environment has been set up for 'Userinterest' tests And 3rd party 'certification' app is launched diff --git a/cypress/fixtures/fireboltCalls/userinterest.json b/cypress/fixtures/fireboltCalls/userinterest.json index 022862a2..f4346444 100644 --- a/cypress/fixtures/fireboltCalls/userinterest.json +++ b/cypress/fixtures/fireboltCalls/userinterest.json @@ -392,22 +392,6 @@ "validationJsonPath": "result", "content": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_RECORDING_RESPONSE" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_MUSIC_SONG_ENTITY_DATA": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_MUSIC_SONG_ENTITY" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_WITH_MUSIC_SONG_ENTITY_DATA": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_MUSIC_SONG_ENTITY" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_MUSIC_ALBUM_ENTITY_DATA": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_MUSIC_ALBUM_ENTITY" - }, - "GET_USERINTEREST_WITH_TYPE_DISINTEREST_WITH_MUSIC_ALBUM_ENTITY_DATA": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_MUSIC_ALBUM_ENTITY" - }, "NULL_FOR_DISCOVERY_USERINTEREST": { "method": "discovery.userInterest", "context": "noContext", @@ -415,26 +399,26 @@ "content": "NULL", "expectingError": false }, - "GET_USERINTEREST_WITHOUT_ANY_PARAMS": { + "NOTIFY_USERINTEREST_WITHOUT_ANY_PARAMS": { "method": "discovery.userInterest", "expected": "error" }, - "GET_USERINTEREST_WITHOUT_INTEREST_TYPE": { + "NOTIFY_USERINTEREST_WITHOUT_INTEREST_TYPE": { "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITHOUT_INTEREST_TYPE", "expected": "error" }, - "GET_USERINTEREST_WITH_NUMERIC_INTERESTTYPE":{ + "NOTIFY_USERINTEREST_WITH_NUMERIC_INTERESTTYPE":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_INTERESTTYPE_INTEGER", "expected": "error" }, - "GET_USERINTEREST_WITH_STRING_INTERESTTYPE":{ + "NOTIFY_USERINTEREST_WITH_STRING_INTERESTTYPE":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_INTERESTTYPE_STRING", "expected": "error" }, - "GET_USERINTEREST_WITH_BOOLEAN_INTERESTTYPE":{ + "NOTIFY_USERINTEREST_WITH_BOOLEAN_INTERESTTYPE":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_INTERESTTYPE_BOOLEAN", "expected": "error" @@ -446,47 +430,47 @@ "content": "INVALID_TYPE_PARAMS", "expectingError": true }, - "GET_USERINTEREST_WITH_INVALID_CHANNELTYPE_IN_CHANNEL_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_INVALID_CHANNELTYPE_IN_CHANNEL_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_CHANNELTYPE_IN_CHANNEL_ENTITY", "expected": "error" }, - "GET_USERINTEREST_WITH_INVALID_PROGRAMTYPE_IN_PROGRAM_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_IN_PROGRAM_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_IN_PROGRAM_ENTITY", "expected": "error" }, - "GET_USERINTEREST_WITH_INVALID_MUSICTYPE_IN_MUSIC_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_INVALID_MUSICTYPE_IN_MUSIC_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_MUSICTYPE_IN_MUSIC_ENTITY", "expected": "error" }, - "GET_USERINTEREST_WITH_BOOLEAN_CHANNELTYPE_IN_CHANNEL_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_BOOLEAN_CHANNELTYPE_IN_CHANNEL_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_BOOLEAN_CHANNELTYPE_IN_CHANNEL_ENTITY", "expected": "error" }, - "GET_USERINTEREST_WITH_INTEGER_CHANNELTYPE_IN_CHANNEL_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_INTEGER_CHANNELTYPE_IN_CHANNEL_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INTEGER_CHANNELTYPE_IN_CHANNEL_ENTITY", "expected": "error" }, - "GET_USERINTEREST_WITH_BOOLEAN_PROGRAMTYPE_IN_PROGRAM_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_BOOLEAN_PROGRAMTYPE_IN_PROGRAM_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_BOOLEAN_PROGRAMTYPE_IN_PROGRAM_ENTITY", "expected": "error" }, - "GET_USERINTEREST_WITH_INTEGER_PROGRAMTYPE_IN_PROGRAM_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_INTEGER_PROGRAMTYPE_IN_PROGRAM_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INTEGER_PROGRAMTYPE_IN_PROGRAM_ENTITY", "expected": "error" }, - "GET_USERINTEREST_WITH_BOOLEAN_MUSICTYPE_IN_MUSIC_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_BOOLEAN_MUSICTYPE_IN_MUSIC_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_BOOLEAN_MUSICTYPE_IN_MUSIC_ENTITY", "expected": "error" }, - "GET_USERINTEREST_WITH_INTEGER_MUSICTYPE_IN_MUSIC_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_INTEGER_MUSICTYPE_IN_MUSIC_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INTEGER_MUSICTYPE_IN_MUSIC_ENTITY", "expected": "error" @@ -495,57 +479,37 @@ "method": "discovery.requestUserInterest", "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_PROGRAM_EPISODE_ENTITY_AND_SEASONID_DATA": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_PROGRAM_EPISODE_AND_SEASONID_ENTITY" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_PROGRAM_EPISODE_ENTITY_AND_SERIESID_DATA": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_PROGRAM_EPISODE_AND_SERIESID_ENTITY" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_PROGRAM_SEASON_ENTITY_AND_SERIESID_DATA": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_PROGRAM_SEASON_AND_SERIESID_ENTITY" - }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_PROGRAM_EPISODE_ENTITY_AND_SERIESID_SEASONID_DATA": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_PROGRAM_EPISODE_AND_SERIESID_SEASONID_ENTITY" - }, - "GET_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_EPISODE_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_EPISODE_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_EPISODE_ENTITY", "expected": "error" }, - "GET_USERINTEREST_WITH_INVALID_SEASONID_IN_PROGRAM_EPISODE_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_INVALID_SEASONID_IN_PROGRAM_EPISODE_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_SEASONID_IN_PROGRAM_EPISODE_ENTITY", "expected": "error" }, - "GET_USERINTEREST_WITH_INVALID_SERIESID_AND_SEASONID_IN_PROGRAM_EPISODE_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_INVALID_SERIESID_AND_SEASONID_IN_PROGRAM_EPISODE_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_SERIESID_AND_SEASONID_IN_PROGRAM_EPISODE_ENTITY", "expected": "error" }, - "GET_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_SEASON_ENTITY":{ + "NOTIFY_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_SEASON_ENTITY":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_SEASON_ENTITY", "expected": "error" }, - "GET_USERINTEREST_WITH_TYPE_INTEREST_WITH_MUSIC_SONG_ENTITY_AND_ALBUMID_DATA": { - "method": "discovery.userInterest", - "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_MUSIC_SONG_AND_ALBUMID_ENTITY" - }, - "GET_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SERIESID":{ + "NOTIFY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SERIESID":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SERIESID", "expected": "error" }, - "GET_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SEASONID":{ + "NOTIFY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SEASONID":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SEASONID", "expected": "error" }, - "GET_USERINTEREST_WITH_INVALID_MUSICTYPE_FOR_MUSIC_ENTITY_WITH_ALBUMID":{ + "NOTIFY_USERINTEREST_WITH_INVALID_MUSICTYPE_FOR_MUSIC_ENTITY_WITH_ALBUMID":{ "method": "discovery.userInterest", "param": "DISCOVERY_USERINTEREST_WITH_INVALID_MUSICTYPE_FOR_MUSIC_ENTITY_WITH_ALBUMID", "expected": "error" @@ -574,22 +538,22 @@ "method": "discovery_content.requestUserInterest", "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING" }, - "GET_REQUESTUSERINTEREST_WITH_INVALID_INTERESTTYPE": { + "NOTIFY_REQUESTUSERINTEREST_WITH_INVALID_INTERESTTYPE": { "method": "discovery_content.requestUserInterest", "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_INVALID_INTERESTTYPE", "expected": "error" }, - "GET_REQUESTUSERINTEREST_WITH_BOOLEAN_INTERESTTYPE": { + "NOTIFY_REQUESTUSERINTEREST_WITH_BOOLEAN_INTERESTTYPE": { "method": "discovery_content.requestUserInterest", "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_BOOLEAN_INTERESTTYPE", "expected": "error" }, - "GET_REQUESTUSERINTEREST_WITH_INVALID_REASONTYPE": { + "NOTIFY_REQUESTUSERINTEREST_WITH_INVALID_REASONTYPE": { "method": "discovery_content.requestUserInterest", "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_INVALID_REASONTYPE", "expected": "error" }, - "GET_REQUESTUSERINTEREST_WITH_BOOLEAN_REASONTYPE": { + "NOTIFY_REQUESTUSERINTEREST_WITH_BOOLEAN_REASONTYPE": { "method": "discovery_content.requestUserInterest", "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_BOOLEAN_REASONTYPE", "expected": "error" From cbbeb8568b1a45076bcd2e84df4acc2eff111707 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Fri, 31 May 2024 11:17:06 +0530 Subject: [PATCH 090/359] FIRECERT-1819: Corrected title in params --- cypress/fixtures/modules/discovery.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cypress/fixtures/modules/discovery.json b/cypress/fixtures/modules/discovery.json index 10871733..132aeba8 100644 --- a/cypress/fixtures/modules/discovery.json +++ b/cypress/fixtures/modules/discovery.json @@ -449,7 +449,7 @@ "programType": "movie" }, "info": { - "title": "Cool Runnings", + "title": "User Interest", "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ @@ -475,7 +475,7 @@ "programType": "movie" }, "info": { - "title": "Cool Runnings", + "title": "User Interest", "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ @@ -655,7 +655,7 @@ "programType": "movie" }, "info": { - "title": "Cool Runnings", + "title": "User Interest", "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ @@ -681,7 +681,7 @@ "programType": "movie" }, "info": { - "title": "Cool Runnings", + "title": "User Interest", "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ @@ -865,7 +865,7 @@ "programType": "movie" }, "info": { - "title": "Cool Runnings", + "title": "User Interest", "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ @@ -891,7 +891,7 @@ "programType": "movie" }, "info": { - "title": "Cool Runnings", + "title": "User Interest", "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ @@ -1179,7 +1179,7 @@ "programType": "movie" }, "info": { - "title": "Cool Runnings", + "title": "User Interest", "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ @@ -1206,7 +1206,7 @@ "programType": "movie" }, "info": { - "title": "Cool Runnings", + "title": "User Interest", "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ @@ -1401,7 +1401,7 @@ "programType": "movie" }, "info": { - "title": "Cool Runnings", + "title": "User Interest", "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ @@ -1428,7 +1428,7 @@ "programType": "movie" }, "info": { - "title": "Cool Runnings", + "title": "User Interest", "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ @@ -1627,7 +1627,7 @@ "programType": "movie" }, "info": { - "title": "Cool Runnings", + "title": "User Interest", "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ @@ -1654,7 +1654,7 @@ "programType": "movie" }, "info": { - "title": "Cool Runnings", + "title": "User Interest", "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", "releaseDate": "1993-01-01T00:00:00.000Z", "contentRatings": [ From 80bd7870179cabbd329dcc35662697d205f438e8 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 31 May 2024 13:14:54 +0530 Subject: [PATCH 091/359] FIRECERT-2025-lifecycle changes --- cypress/support/cypress-commands/lifecycle.js | 16 ++++++++-------- cypress/support/validations/schemaValidation.js | 4 +--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index b768d0e7..a00a18f3 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -89,24 +89,24 @@ Cypress.Commands.add('validateLifecycleState', (state, appId) => { // Send message to 3rd party app to invoke lifecycle API to get state response cy.invokeLifecycleApi(appId, CONSTANTS.LIFECYCLE_STATE, '{}').then((response) => { try { - const result = JSON.parse(response)?.result ?? null; + const result = response[CONSTANTS.SCHEMA_VALIDATION_RESPONSE].instance ?? null; if (result == null) { cy.log(CONSTANTS.INVALID_LIFECYCLE_STATE_RESPONSE).then(() => { assert(false, CONSTANTS.INVALID_LIFECYCLE_STATE_RESPONSE); }); } - cy.log(CONSTANTS.APP_RESPONSE + response); + cy.log(CONSTANTS.APP_RESPONSE + JSON.stringify(response)); // Perform schema and content validation of state response against appObject state let pretext = CONSTANTS.STATE_SCHEMA_VALIDATION_REQ + lifecycleStateRequirementId.state.id; UTILS.assertWithRequirementLogs( pretext, - JSON.parse(response).schemaResult.status, + response[CONSTANTS.SCHEMA_VALIDATION_STATUS], CONSTANTS.PASS ); pretext = CONSTANTS.STATE_CONTENT_VALIDATION_REQ + lifecycleStateRequirementId.state.id; UTILS.assertWithRequirementLogs( pretext, - JSON.parse(response).result, + response[CONSTANTS.SCHEMA_VALIDATION_RESPONSE].instance, appObject.getAppObjectState().state ); } catch (error) { @@ -312,7 +312,7 @@ Cypress.Commands.add('invokeLifecycleApi', (appId, method, methodParams = null) return false; } if (CONSTANTS.LIFECYCLE_METHOD_LIST.includes(method)) { - cy.updateResponseForFCS(method, '', response).then((updatedResponse) => { + cy.updateResponseForFCS(method, '', JSON.parse(response)).then((updatedResponse) => { return updatedResponse; }); } @@ -554,10 +554,10 @@ Cypress.Commands.add('setAppObjectStateFromMethod', (method, appId) => { * cy.lifecycleSchemaChecks({"result":null,"error":null,"schemaResult":{"status":"PASS","schemaValidationResult":{"instance":null,"schema":{"const":null}}, 'foreground'); */ Cypress.Commands.add('lifecycleSchemaChecks', (response, state) => { - result = JSON.parse(response); + typeof response == 'object' ? response : (response = JSON.parse(response)); apiSchemaResult = { - validationStatus: result[CONSTANTS.SCHEMA_VALIDATION_STATUS], - validationResponse: result[CONSTANTS.SCHEMA_VALIDATION_RESPONSE], + validationStatus: response[CONSTANTS.SCHEMA_VALIDATION_STATUS], + validationResponse: response[CONSTANTS.SCHEMA_VALIDATION_RESPONSE], }; cy.validationChecksForResponseAndSchemaResult(response, false, apiSchemaResult, false); }); diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index c2302f41..f312a3c4 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -34,9 +34,7 @@ import UTILS, { fireLog } from '../cypress-support/src/utils'; Cypress.Commands.add( 'updateResponseForFCS', (methodOrEvent, params, response, isValidation = false) => { - const responseType = response.hasOwnProperty(CONSTANTS.ERROR) - ? CONSTANTS.ERROR - : CONSTANTS.RESULT; + const responseType = response.error ? CONSTANTS.ERROR : CONSTANTS.RESULT; if (response.hasOwnProperty(CONSTANTS.RESULT) || response.hasOwnProperty(CONSTANTS.ERROR)) { let formattedResponse = {}; From a55f055de4bcaa96c909fb1019da415776573b09 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 31 May 2024 15:29:33 +0530 Subject: [PATCH 092/359] Added a changes for listening for event response --- cypress/support/constants/constants.js | 1 + .../cypress-support/src/FireboltInvoker.js | 15 +++++++++++++ .../transportLayers/websocket.js | 16 +++++++++++++- .../support/step_definitions/validations.js | 4 ++-- defaultModule/requestModules/fcs.js | 22 ++++++++++++++++++- 5 files changed, 54 insertions(+), 4 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index d4fcd0dc..aaeb20fa 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -110,6 +110,7 @@ module.exports = { EVENT_NAME: 'eventName', EVENT_PARAM: 'event_param', EVENT_RESPONSE: 'eventResponse', + EVENT_RESPONSE_MAP: 'eventResponseMap', EVENT_SCHEMA_MSG: 'Event listener schema validation', EVENT_SCHEMA_RESULT: 'eventSchemaResult', EXCEPTION_ERROR_OBJECT: 'exceptionErrorObject', diff --git a/cypress/support/cypress-support/src/FireboltInvoker.js b/cypress/support/cypress-support/src/FireboltInvoker.js index a5c24207..9847dfa1 100644 --- a/cypress/support/cypress-support/src/FireboltInvoker.js +++ b/cypress/support/cypress-support/src/FireboltInvoker.js @@ -19,6 +19,9 @@ import modularTransportClient from '../../modularTransportClient'; import { getEnvVariable } from './utils'; const logger = require('../../Logger')('FireboltInvoker.js'); +const CONSTANTS = require('../../constants/constants'); +const responseMap = new Map(); +Cypress.env(CONSTANTS.EVENT_RESPONSE_MAP, responseMap); const WEBSOCKET = 'WebSocket'; const DEFAULT_WS_URL_PROTOCOL = 'ws://'; @@ -91,6 +94,18 @@ export default class FireboltInvoker { logger.info('Firebolt Message in the invoke:' + JSON.stringify(fireboltMessage), 'invoke'); try { + // Adding method name and listenerResponse to MAP for event registration request message. + if ( + fireboltMessage && + fireboltMessage.params && + fireboltMessage.params.hasOwnProperty('listen') && + fireboltMessage.params.listen == true + ) { + Cypress.env(CONSTANTS.EVENT_RESPONSE_MAP).set(fireboltMessage.id, { + method: fireboltMessage.method, + listenerResponse: {}, + }); + } const currentInstance = await this.get(); const response = await currentInstance.send(JSON.stringify(fireboltMessage)); diff --git a/cypress/support/modularTransportClient/transportLayers/websocket.js b/cypress/support/modularTransportClient/transportLayers/websocket.js index a8d76d46..4346a126 100644 --- a/cypress/support/modularTransportClient/transportLayers/websocket.js +++ b/cypress/support/modularTransportClient/transportLayers/websocket.js @@ -81,7 +81,21 @@ export default class Websocket extends AsyncTransportClient { res(event.data); }; - this.ws.addEventListener('message', sendCallback); + this.ws.onmessage = (msg) => { + const message = JSON.parse(msg.data); + const requestMessage = JSON.parse(payload); + // Updating the listenerResponse in the MAP when event response received. + if(message?.id && Cypress.env('eventResponseMap').has(message.id) && !message.result.hasOwnProperty('listening')){ + const obj = Cypress.env('eventResponseMap').get(message.id); + obj.listenerResponse = message; + Cypress.env('eventResponseMap').set(message.id, obj) + } + + // Returning the message when response and request id matches. + if (message.id == requestMessage.id) { + sendCallback(msg); + } + }; this.ws.send(payload); }); diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index d3431f83..2c4adebc 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -115,7 +115,7 @@ Given( cy.saveEventResponse( updatedResponse, methodOrEventObject, - eventName, + methodOrEvent, eventExpected === 'triggers' ? true : false ); }); @@ -136,7 +136,7 @@ Given( cy.saveEventResponse( response, methodOrEventObject, - eventName, + methodOrEvent, eventExpected === 'triggers' ? true : false ); } diff --git a/defaultModule/requestModules/fcs.js b/defaultModule/requestModules/fcs.js index af136246..fc1336e8 100644 --- a/defaultModule/requestModules/fcs.js +++ b/defaultModule/requestModules/fcs.js @@ -89,4 +89,24 @@ function setLifecycleState(parsedData) { throw new Error(CONSTANTS.SET_LIFECYCLE_STATE_MISSING); }); } -module.exports = { setResponse, setTestProvider, setLifecycleState }; + +/** + * @module fcs + * @function fetchEventResponse + * @description Extracting a triggered event response from MAP, otherwise returning the parameter as-is. + * @param {Object} parsedParam - request message having event id to fetch the response. + * @example + * fetchEventResponse({method: 'fcs.fetchEventResponse', params: '2'}) + **/ +function fetchEventResponse(parsedParam) { + let result; + const responseMap = Cypress.env(CONSTANTS.EVENT_RESPONSE_MAP); + if (responseMap && responseMap.has(parsedParam.params)) { + result = responseMap.get(parsedParam.params); + return result.listenerResponse; + } else { + return parsedParam; + } +} + +module.exports = { setResponse, setTestProvider, setLifecycleState, fetchEventResponse }; From e305631bede92c744d060712c69c2f8a2b7361ce Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 31 May 2024 15:41:22 +0530 Subject: [PATCH 093/359] fixed lint issues --- .../modularTransportClient/transportLayers/websocket.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cypress/support/modularTransportClient/transportLayers/websocket.js b/cypress/support/modularTransportClient/transportLayers/websocket.js index 4346a126..be275dc9 100644 --- a/cypress/support/modularTransportClient/transportLayers/websocket.js +++ b/cypress/support/modularTransportClient/transportLayers/websocket.js @@ -85,10 +85,14 @@ export default class Websocket extends AsyncTransportClient { const message = JSON.parse(msg.data); const requestMessage = JSON.parse(payload); // Updating the listenerResponse in the MAP when event response received. - if(message?.id && Cypress.env('eventResponseMap').has(message.id) && !message.result.hasOwnProperty('listening')){ + if ( + message?.id && + Cypress.env('eventResponseMap').has(message.id) && + !message.result.hasOwnProperty('listening') + ) { const obj = Cypress.env('eventResponseMap').get(message.id); obj.listenerResponse = message; - Cypress.env('eventResponseMap').set(message.id, obj) + Cypress.env('eventResponseMap').set(message.id, obj); } // Returning the message when response and request id matches. From 7cb2ee0fe22d6b334ace7f4ce5c205d55d2fcb4f Mon Sep 17 00:00:00 2001 From: Keaton Sentak <54916859+ksentak@users.noreply.github.com> Date: Fri, 31 May 2024 12:35:57 -0400 Subject: [PATCH 094/359] Move defaultTestData v2 variables to cypress env (#89) * defaultdata config with objects * process cypress env variables in validation objects --- cypress.config.js | 8 +++++ cypress/fixtures/defaultTestData.json | 2 -- .../objects/validationObjects/device.json | 4 +-- cypress/plugins/testDataProcessor.js | 31 +++++++++++++++++++ 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index 7d4e5d47..63cc7f5c 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -62,6 +62,14 @@ const env = { loggerLevel: 'debug', testSuite: '', visibilityState: { foreground: 'visible', background: 'visible', inactive: 'hidden' }, + defaultTestData: { + apiVersion: '1.0.0', + deviceResolution: [ + [1280, 720], + [1920, 1080], + [3840, 2160], + ], + }, }; module.exports = { diff --git a/cypress/fixtures/defaultTestData.json b/cypress/fixtures/defaultTestData.json index db406502..ed852780 100644 --- a/cypress/fixtures/defaultTestData.json +++ b/cypress/fixtures/defaultTestData.json @@ -36,8 +36,6 @@ "stringZero": "0", "stringOne": "1", "EMPTYARRAY": [], - "APIVERSION": "1.0.0", - "DEVICERESOLUTION" : [[1280,720],[1920,1080],[3840,2160]], "STRING123456": "123456", "FOREGROUND": "foreground" } diff --git a/cypress/fixtures/objects/validationObjects/device.json b/cypress/fixtures/objects/validationObjects/device.json index 8a5e2f18..5aa6d89d 100644 --- a/cypress/fixtures/objects/validationObjects/device.json +++ b/cypress/fixtures/objects/validationObjects/device.json @@ -21,7 +21,7 @@ "validations": [ { "mode": "fixture", - "type": "APIVERSION", + "type": "CYPRESSENV-defaultTestData-apiVersion", "description": "Validation of the Device version API Format" } ] @@ -81,7 +81,7 @@ "validations": [ { "mode": "fixture", - "type": "DEVICERESOLUTION", + "type": "CYPRESSENV-defaultTestData-deviceResolution", "description": "Validation of the Device videoResolution" } ] diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index 1f5f352c..bc179a4d 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -193,6 +193,37 @@ function testDataHandler(requestType, dataIdentifier, fireboltObject) { if (typeof data.type !== CONSTANTS.STRING) { return data.type; } + + // Resolve any cypress env variables + if (typeof data.type === 'string' && data.type.includes('CYPRESSENV')) { + // Split into an array and remove CYPRESSENV + const envSegments = data.type.split('-').slice(1); + // Handle the case where the env variable is an object + if (envSegments.length > 1) { + const objectName = envSegments[0]; + const propertyName = envSegments[1]; + + // Get object from envVariables + const envValue = _.get(envVariables, [objectName, propertyName]); + + // Check if object exists and contains the specified property + if (envValue !== undefined) { + return (data.type = envValue); + } else { + logger.info(`Cypress env variable '${envKey}' does not exist`); + return data.type; + } + } else { + const envKey = envSegments[0]; + const envValue = _.get(envVariables, envKey); + if (envValue !== undefined) { + return (data.type = envValue); + } else { + logger.info(`Cypress env variable '${envKey}' does not exist`); + return data.type; + } + } + } switch (data.mode) { case CONSTANTS.REGEX.toLowerCase(): const regexType = data.type.includes('_REGEXP') From 9ac733aa38b47237f6cc67de096337e810811350 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 3 Jun 2024 12:09:11 +0530 Subject: [PATCH 095/359] Addressed the comment --- .../transportLayers/websocket.js | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/cypress/support/modularTransportClient/transportLayers/websocket.js b/cypress/support/modularTransportClient/transportLayers/websocket.js index be275dc9..b31b0b7f 100644 --- a/cypress/support/modularTransportClient/transportLayers/websocket.js +++ b/cypress/support/modularTransportClient/transportLayers/websocket.js @@ -82,21 +82,26 @@ export default class Websocket extends AsyncTransportClient { }; this.ws.onmessage = (msg) => { - const message = JSON.parse(msg.data); - const requestMessage = JSON.parse(payload); - // Updating the listenerResponse in the MAP when event response received. - if ( - message?.id && - Cypress.env('eventResponseMap').has(message.id) && - !message.result.hasOwnProperty('listening') - ) { - const obj = Cypress.env('eventResponseMap').get(message.id); - obj.listenerResponse = message; - Cypress.env('eventResponseMap').set(message.id, obj); - } - - // Returning the message when response and request id matches. - if (message.id == requestMessage.id) { + if (msg && msg.data) { + const message = JSON.parse(msg.data); + const requestMessage = JSON.parse(payload); + + // Updating event response in the map when event is triggered by the platform + if ( + message?.id && + Cypress.env('eventResponseMap').has(message.id) && + !message.result.hasOwnProperty('listening') + ) { + const obj = Cypress.env('eventResponseMap').get(message.id); + obj.listenerResponse = message; + Cypress.env('eventResponseMap').set(message.id, obj); + } + + // Returning the message when response and request id matches. + if (message.id == requestMessage.id) { + sendCallback(msg); + } + } else { sendCallback(msg); } }; From dea7b279e5d7e6df9a959f7c6dd5e5343f814fd4 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Mon, 3 Jun 2024 15:11:22 +0530 Subject: [PATCH 096/359] FIRECERT-2025-addressed comment --- cypress/support/appObjectConfigs.js | 8 ++++---- cypress/support/constants/constants.js | 2 +- cypress/support/cypress-commands/assertion.js | 4 ++-- cypress/support/step_definitions/validations.js | 4 ++-- .../moduleValidations/advertisingMiscValidation.js | 2 +- .../moduleValidations/capabilitiesMiscValidation.js | 6 +++--- .../validations/moduleValidations/deviceMiscValidation.js | 4 ++-- .../moduleValidations/lifecycleMiscValidation.js | 2 +- .../moduleValidations/parametersMiscValidation.js | 2 +- .../moduleValidations/usergrantsMiscValidation.js | 2 +- cypress/support/validations/regExValidation.js | 2 +- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cypress/support/appObjectConfigs.js b/cypress/support/appObjectConfigs.js index d00920a0..84735d88 100644 --- a/cypress/support/appObjectConfigs.js +++ b/cypress/support/appObjectConfigs.js @@ -19,15 +19,15 @@ const CONSTANTS = require('./constants/constants'); class apiObject { - constructor(apiName, params, context, response, expected, appId) { + constructor(apiName, params, context, apiResponse, expected, appId) { this.apiName = apiName; this.params = params; this.context = context; this.expected = expected; - this.response = response; + this.apiResponse = apiResponse.response; this.apiSchemaResult = { - validationStatus: response.schemaValidationStatus, - validationResponse: response.schemaValidationResponse, + validationStatus: apiResponse.schemaValidationStatus, + validationResponse: apiResponse.schemaValidationResponse, }; this.app = appId; } diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index a4436b14..3b033a52 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -131,7 +131,7 @@ module.exports = { EXTERNAL_MODULEREQID_PATH: 'cypress/fixtures/external/objects/moduleReqId/moduleReqId.json', EXTERNAL_PATH: 'cypress/fixtures/external/modules/', EXTERNAL_PREREQUISITE_DATA: './cypress/fixtures/external/PreRequisiteData.json', - EXTRACTEDAPI_PATH: 'extractedApiObject.response.response.', + EXTRACTEDAPI_PATH: 'extractedApiObject.apiResponse.', FAIL: 'FAIL', FAILED_TO_PARSE_LIEFECYCLE_ERROR: 'Failed to parse error object from response while setting lifecycle state. Response received : ', diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index 38d85e04..309e8328 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -128,7 +128,7 @@ Cypress.Commands.add( const apiErrorResponse = validationType == CONSTANTS.EVENT ? apiOrEventObject.eventListenerResponse.error - : apiOrEventObject.response.response.error; + : apiOrEventObject.apiResponse.error; fireLog.include( errorContentObject.errorCode, @@ -691,7 +691,7 @@ Cypress.Commands.add( } if (validationType == CONSTANTS.METHOD) { const { expected, apiSchemaResult } = methodOrEventObject; - const response = methodOrEventObject.response.response; + const response = methodOrEventObject.apiResponse; cy.validationChecksForResponseAndSchemaResult( response, diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 5e6978ce..a0d05d96 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -165,7 +165,7 @@ Given( validationType == CONSTANTS.EVENT ? methodOrEventObject.eventResponse : validationType == CONSTANTS.METHOD - ? methodOrEventObject.response + ? methodOrEventObject.apiResponse : null; switch (scenario) { case CONSTANTS.REGEX: @@ -189,7 +189,7 @@ Given( validationType == CONSTANTS.EVENT ? methodOrEventResponse : validationType == CONSTANTS.METHOD - ? methodOrEventResponse.response.result + ? methodOrEventResponse.result : null; cy.decodeValidation( diff --git a/cypress/support/validations/moduleValidations/advertisingMiscValidation.js b/cypress/support/validations/moduleValidations/advertisingMiscValidation.js index 08748420..9558fd32 100644 --- a/cypress/support/validations/moduleValidations/advertisingMiscValidation.js +++ b/cypress/support/validations/moduleValidations/advertisingMiscValidation.js @@ -46,7 +46,7 @@ export function advertisingMiscValidation(method, validationTypeObject, apiOrEve * validateAdvertisingAdvertisingId('advertising.advertisingId', {"type": "limitAdTrackingON"},{response:{result: '', error: null, ...}}); */ function validateAdvertisingAdvertisingId(method, validationTypeObject, apiOrEventObject) { - const response = apiOrEventObject.response.result; + const response = apiOrEventObject.apiResponse.result; const ScenarioType = validationTypeObject.type; const pretext = `${CONSTANTS.METHOD_CONTENT} for ${method} method : `; diff --git a/cypress/support/validations/moduleValidations/capabilitiesMiscValidation.js b/cypress/support/validations/moduleValidations/capabilitiesMiscValidation.js index 05e8aff2..34a844a9 100644 --- a/cypress/support/validations/moduleValidations/capabilitiesMiscValidation.js +++ b/cypress/support/validations/moduleValidations/capabilitiesMiscValidation.js @@ -54,7 +54,7 @@ export function capabilitiesMiscValidation(method, validationTypeObject, apiOrEv */ // TODO: Planning to move it out of FCS and keep it in configModule function validateCapabilitiesInfo(method, validationTypeObject, apiOrEventObject) { - const capabilityInfoResponse = apiOrEventObject.response.result; + const capabilityInfoResponse = apiOrEventObject.apiResponse.result; const fireboltConfig = UTILS.getEnvVariable(CONSTANTS.FIREBOLTCONFIG); const notSupportedCapabilitiesList = UTILS.getEnvVariable( CONSTANTS.NOT_SUPPORTED_CAPABILITIES_LIST @@ -113,7 +113,7 @@ function validateCapabilitiesInfo(method, validationTypeObject, apiOrEventObject */ // TODO: Planning to move it out of FCS and keep it in configModule function validateCapabilitiesSupported(method, validationTypeObject, apiOrEventObject) { - const capabilityResponse = apiOrEventObject.response.result; + const capabilityResponse = apiOrEventObject.apiResponse.result; const capabilityParam = apiOrEventObject.params.value; const notSupportedCapabilitiesList = UTILS.getEnvVariable( CONSTANTS.NOT_SUPPORTED_CAPABILITIES_LIST @@ -224,7 +224,7 @@ Cypress.Commands.add('specialValidation', (validationObject) => { const methodOrEventObject = UTILS.getApiOrEventObjectFromGlobalList(method, context, appId); cy.validateResponseErrorAndSchemaResult(methodOrEventObject, CONSTANTS.METHOD, skipCheck).then( () => { - const apiResponseContent = eval('methodOrEventObject.response.' + validationPath); + const apiResponseContent = eval('methodOrEventObject.apiResponse.' + validationPath); const message = Object.keys(context).length ? context : { role: validationPath.split('.')[1] }; diff --git a/cypress/support/validations/moduleValidations/deviceMiscValidation.js b/cypress/support/validations/moduleValidations/deviceMiscValidation.js index 7e0f53f2..cfee7a18 100644 --- a/cypress/support/validations/moduleValidations/deviceMiscValidation.js +++ b/cypress/support/validations/moduleValidations/deviceMiscValidation.js @@ -29,7 +29,7 @@ const UTILS = require('../../cypress-support/src/utils'); * deviceMiscValidation('device.verion', {"mode": "fixture", "type": "APIVERSION", "description": "Validation of the Device version API Format"},{response:{result: '', error: null, ...}}); */ export function deviceMiscValidation(method, validationTypeObject, apiOrEventObject) { - const response = apiOrEventObject.response.result; + const response = apiOrEventObject.apiResponse.result; switch (method) { case CONSTANTS.DEVICE_VERSION: @@ -71,7 +71,7 @@ export function deviceMiscValidation(method, validationTypeObject, apiOrEventObj */ function validateDeviceVersion(method, validationTypeObject, apiOrEventObject) { const expected = validationTypeObject.type; - const response = apiOrEventObject.response.result; + const response = apiOrEventObject.apiResponse.result; const apiVersionvalue = UTILS.getEnvVariable(CONSTANTS.API_VERSION, false); // The APIVersionValue contains any value, directly validating with the obtained response. diff --git a/cypress/support/validations/moduleValidations/lifecycleMiscValidation.js b/cypress/support/validations/moduleValidations/lifecycleMiscValidation.js index db766f03..34205b9b 100644 --- a/cypress/support/validations/moduleValidations/lifecycleMiscValidation.js +++ b/cypress/support/validations/moduleValidations/lifecycleMiscValidation.js @@ -48,7 +48,7 @@ export function lifecycleMiscValidation(method, validationTypeObject, apiOrEvent */ function validateLifecycleFinished(method, validationTypeObject, apiOrEventObject) { const communicationMode = UTILS.getEnvVariable(CONSTANTS.COMMUNICATION_MODE); - const apiErrorResponse = apiOrEventObject.response.error; + const apiErrorResponse = apiOrEventObject.apiResponse.error; const errorContentObject = validationTypeObject.type; switch (validationTypeObject.mode) { diff --git a/cypress/support/validations/moduleValidations/parametersMiscValidation.js b/cypress/support/validations/moduleValidations/parametersMiscValidation.js index 3b6a5559..6c53e0ba 100644 --- a/cypress/support/validations/moduleValidations/parametersMiscValidation.js +++ b/cypress/support/validations/moduleValidations/parametersMiscValidation.js @@ -46,7 +46,7 @@ export function parametersMiscValidation(method, validationTypeObject, apiOrEven * validateParametersInitialization('parameters.initialization', {"type": "limitAdTrackingON"},{response:{result: '', error: null, ...}}); */ function validateParametersInitialization(method, validationTypeObject, apiOrEventObject) { - const response = apiOrEventObject.response.result; + const response = apiOrEventObject.apiResponse.result; const ScenarioType = validationTypeObject.type; const pretext = `${CONSTANTS.METHOD_CONTENT} for ${method} :`; switch (ScenarioType) { diff --git a/cypress/support/validations/moduleValidations/usergrantsMiscValidation.js b/cypress/support/validations/moduleValidations/usergrantsMiscValidation.js index 901e366f..155dfd34 100644 --- a/cypress/support/validations/moduleValidations/usergrantsMiscValidation.js +++ b/cypress/support/validations/moduleValidations/usergrantsMiscValidation.js @@ -36,7 +36,7 @@ export function usergrantsMiscValidation(method, validationTypeObject, apiOrEven const appId = apiOrEventObject.app; const context = apiOrEventObject.context; const methodOrEventObject = UTILS.getApiOrEventObjectFromGlobalList(method, context, appId); - const userGrantsList = methodOrEventObject.response.result; + const userGrantsList = methodOrEventObject.apiResponse.result; const pretext = CONSTANTS.METHOD_CONTENT; if (validationTypeObject.content) { cy.log( diff --git a/cypress/support/validations/regExValidation.js b/cypress/support/validations/regExValidation.js index 56c84cc4..983ec26c 100644 --- a/cypress/support/validations/regExValidation.js +++ b/cypress/support/validations/regExValidation.js @@ -41,7 +41,7 @@ class regExValidations { regexResultValidator(method, expression, validationPath, response) { if (response) { // Get the response from the provided path - const extractedResponse = validationPath ? eval('response.response.' + validationPath) : null; + const extractedResponse = validationPath ? eval('response.' + validationPath) : null; // Validate the response with the mentioned expression const validationResult = extractedResponse From 0685b2a7bb43b1ab5c00307a6c6b19910576543a Mon Sep 17 00:00:00 2001 From: kdivya153 <121901963+kdivya153@users.noreply.github.com> Date: Mon, 3 Jun 2024 09:32:55 -0400 Subject: [PATCH 097/359] Systest jira 9767 (#85) * Added global function to resolve device variable * Added jsdocs * Addressed review comments * fix lint errors --- cypress/plugins/common.js | 5 +-- cypress/plugins/pluginUtils.js | 35 +++++++++++++++++++- cypress/support/cypress-support/src/utils.js | 18 ++++++++++ cypress/support/cypress-support/src/utils.md | 7 ++++ 4 files changed, 62 insertions(+), 3 deletions(-) diff --git a/cypress/plugins/common.js b/cypress/plugins/common.js index a677ef74..640696ec 100644 --- a/cypress/plugins/common.js +++ b/cypress/plugins/common.js @@ -18,7 +18,7 @@ const fs = require('fs'); const testDataProcessor = require('./testDataProcessor'); const logger = require('../support/Logger')('common.js'); -const { generateIndexFile } = require('./pluginUtils'); +const { generateIndexFile, preprocessDeviceData } = require('./pluginUtils'); const CONSTANTS = require('../support/constants/constants'); // If "genericSupport" is set to a falsy value (false, null, etc), take no further action. Simply "return" @@ -48,7 +48,8 @@ function genericSupport(config) { ...data, ...commandLineArgs, }; - + // To read device data JSON + preprocessDeviceData(config); const testDataEnv = testDataProcessor.testDataProcessor(config.env); Object.assign(config.env, testDataEnv); diff --git a/cypress/plugins/pluginUtils.js b/cypress/plugins/pluginUtils.js index 93b5ffc8..bf4502fd 100644 --- a/cypress/plugins/pluginUtils.js +++ b/cypress/plugins/pluginUtils.js @@ -122,4 +122,37 @@ function generateIndexFile(path, outputObj) { } } -module.exports = { getAndDereferenceOpenRpc, generateIndexFile }; +/** + * @function preprocessDeviceData + * @description Reads the device data JSON file and adds it to the config object. + * @param {string} config - The config object. + * @example + * preprocessDeviceData(config); + */ + +function preprocessDeviceData(config) { + const deviceMac = config.env.deviceMac; + try { + if (!deviceMac) { + logger.error('Device MAC address is required.'); + } + const formattedDeviceMac = deviceMac.replace(/:/g, '').toUpperCase(); + const jsonFilePath = `cypress/fixtures/external/devices/${formattedDeviceMac}.json`; + let deviceData; + + try { + deviceData = JSON.parse(fs.readFileSync(jsonFilePath, 'utf-8')); + } catch (readError) { + logger.error( + `Error reading or parsing the JSON file at ${jsonFilePath}: ${readError.message}` + ); + } + + const resolvedDeviceData = { ...deviceData }; + config.env = Object.assign({}, config.env, { resolvedDeviceData }); + } catch (error) { + logger.error(`Error in preprocessDeviceData: ${error.message}`); + } +} + +module.exports = { getAndDereferenceOpenRpc, generateIndexFile, preprocessDeviceData }; diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 924191b6..ad6a5fe5 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -627,6 +627,24 @@ function checkForTags(tags) { } } +/** + * @module utils + * @globalfunction resolveDeviceVariable + * @description Resolve the device variable from the preprocessed data for the given key + * @example + * resolveDeviceVariable("deviceId") + */ + +global.resolveDeviceVariable = function (key) { + const resolvedDeviceData = Cypress.env('resolvedDeviceData'); + if (!(key in resolvedDeviceData)) { + logger.error(`Key ${key} not found in preprocessed data.`); + return null; + } + logger.debug(`Resolved value for key ${key} is ${resolvedDeviceData[key]}`); + return resolvedDeviceData[key]; +}; + /** * FireLog class provides assertion methods with logging using Cypress's cy.log(). * It wraps Cypress's assertion methods, allowing logging of messages for each assertion. diff --git a/cypress/support/cypress-support/src/utils.md b/cypress/support/cypress-support/src/utils.md index 4d8c0266..e2bba8c0 100644 --- a/cypress/support/cypress-support/src/utils.md +++ b/cypress/support/cypress-support/src/utils.md @@ -277,6 +277,13 @@ request - `cy.destroyGlobalObjects(['lifecycleAppObjectList']); ### Examples: request - `cy.checkForTags(["TAG1","TAG2"]); +## resolveDeviceVariable + +### Purpose: The global resolveDeviceVariable function retrieves a value from the preprocessed device data stored in Cypress environment variables called resolvedDeviceData based on a specified key and returns the value of the key. The preprocessDeviceData function reads and processes device-specific data from a fixture JSON file based on a given deviceMac address. + +### Examples: +resolveDeviceVariable("deviceId") + ## FireLog ### Purpose: Provides assertion methods with logging using Cypress's cy.log(). It wraps Cypress's assertion methods, allowing logging of messages for each assertion. From 7880a6a34f6439e672f43ae7f341da6324f9dda5 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Mon, 3 Jun 2024 22:47:08 +0530 Subject: [PATCH 098/359] FIRECERT-2113: [FCS] Process setResponseData in plugins --- cypress/plugins/testDataProcessor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index bc179a4d..61093bdb 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -7,6 +7,9 @@ const path = require('path'); const _ = require('lodash'); const logger = require('../support/Logger')('testDataProcessor.js'); +// Combining validation objects from FCS and config module into single JSON +const validationObjects = combineValidationObjectsJson(); + /** * @function testDataProcessor * The Test Data Processor performs the following operations: @@ -180,8 +183,6 @@ function testDataHandler(requestType, dataIdentifier, fireboltObject) { return dataIdentifier; } } else { - // Combining validation objects from FCS and config module into single JSON - const validationObjects = combineValidationObjectsJson(); const validationObject = validationObjects[dataIdentifier]; if (validationObject && validationObject.data) { From 9ce1fd09b9b3257c248637a3fd6d63483333f587 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Tue, 4 Jun 2024 10:28:53 +0530 Subject: [PATCH 099/359] FIRECERT-1819: Change of keynames --- .../FireboltCertification/UserInterest.feature | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index 21b263a2..d727f681 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -8,12 +8,12 @@ Feature: UserInterest @coreSDK @sdk @transport @userinterest Scenario Outline: Discovery.userInterest - Positive Scenario: In-app UX - Notify userInterest with type When 1st party app registers for the 'Content onUserInterest' event using the 'Firebolt' API - And '3rd party app' invokes the 'Firebolt' API to 'notify userInterest with ' + And '3rd party app' invokes the 'Firebolt' API to 'notify userInterest with ' Then 'Firebolt' platform responds with 'null for discovery userInterest' And 'Firebolt' platform triggers to '1st party app' event 'onUserInterest with ' Examples: - | Scenario | GetParam | Event_Content | + | Scenario | NotifyParam | Event_Content | | interest & reason playlist with program entity | type interest and reason playlist with program entity | type interest reason playlist | | disinterest & reason playlist with program entity | type disinterest and reason playlist with program entity | type disinterest reason playlist | | interest & reason playlist with channel streaming entity | type interest and reason playlist with channel streaming entity | type interest reason playlist channel | @@ -60,11 +60,11 @@ Feature: UserInterest @coreSDK @sdk @transport @userinterest Scenario Outline: Discovery.userInterest - Negative Scenario: expecting error - When '3rd party app' invokes the 'Firebolt' API to 'notify userInterest ' + When '3rd party app' invokes the 'Firebolt' API to 'notify userInterest ' Then 'Firebolt' platform responds with 'invalid params for discovery userInterest' Examples: - | Scenario | GetParam | + | Scenario | Param | | Empty param | without any params | | Without Interest type | without interest type | | Invalid Interest type - integer params | with numeric interestType | @@ -88,11 +88,11 @@ Feature: UserInterest @coreSDK @sdk @userinterest Scenario Outline: Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type - And 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type ' + And 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type ' Then 'Firebolt' platform responds to '1st party app' with '' Examples: - | Scenario | setParam | method_Content | + | Scenario | NotifyParam | method_Content | | interest and reason playlist | interest reason playlist | requestUserInterest with reason playlist | | interest and reason reaction | interest reason reaction | requestUserInterest with reason reaction | | interest and reason recording | interest reason recording | requestUserInterest with reason recording | @@ -102,16 +102,16 @@ Feature: UserInterest @coreSDK @sdk @transport @userinterest Scenario Outline: Content.requestUserInterest - Negative Scenario: expecting error - When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with ' + When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with ' Then 'Firebolt' platform responds to '1st party app' with 'invalid params for content requestUserInterest' Examples: - | Scenario | param | + | Scenario | Param | | Invalid Interest value - test params | invalid interestType | | Invalid Interest type - boolean params | boolean interestType | | Invalid reason value - test params | invalid reasonType | | Invalid Interest type - boolean params | boolean reasonType | - + @coreSDK @sdk @userinterest @notSupported Scenario: Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest but platform timeout without sending response When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type interest timeout' From c2960730f112e38ae1f7da136ff618445c28b1c3 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Tue, 4 Jun 2024 11:08:30 +0530 Subject: [PATCH 100/359] Addressed the comment --- .../support/cypress-support/src/FireboltInvoker.js | 11 +++++++---- .../transportLayers/websocket.js | 11 +++++++---- cypress/support/step_definitions/validations.js | 4 ++-- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/cypress/support/cypress-support/src/FireboltInvoker.js b/cypress/support/cypress-support/src/FireboltInvoker.js index 9847dfa1..a9fb8e6b 100644 --- a/cypress/support/cypress-support/src/FireboltInvoker.js +++ b/cypress/support/cypress-support/src/FireboltInvoker.js @@ -101,10 +101,13 @@ export default class FireboltInvoker { fireboltMessage.params.hasOwnProperty('listen') && fireboltMessage.params.listen == true ) { - Cypress.env(CONSTANTS.EVENT_RESPONSE_MAP).set(fireboltMessage.id, { - method: fireboltMessage.method, - listenerResponse: {}, - }); + Cypress.env(CONSTANTS.EVENT_RESPONSE_MAP).set( + fireboltMessage.method + '-' + fireboltMessage.id, + { + method: fireboltMessage.method, + listenerResponse: {}, + } + ); } const currentInstance = await this.get(); const response = await currentInstance.send(JSON.stringify(fireboltMessage)); diff --git a/cypress/support/modularTransportClient/transportLayers/websocket.js b/cypress/support/modularTransportClient/transportLayers/websocket.js index b31b0b7f..e1342f10 100644 --- a/cypress/support/modularTransportClient/transportLayers/websocket.js +++ b/cypress/support/modularTransportClient/transportLayers/websocket.js @@ -85,16 +85,19 @@ export default class Websocket extends AsyncTransportClient { if (msg && msg.data) { const message = JSON.parse(msg.data); const requestMessage = JSON.parse(payload); + const mapKey = Array.from(Cypress.env('eventResponseMap').keys()).find((key) => + key.includes(message.id) + ); // Updating event response in the map when event is triggered by the platform if ( - message?.id && - Cypress.env('eventResponseMap').has(message.id) && + mapKey && + Cypress.env('eventResponseMap').has(mapKey) && !message.result.hasOwnProperty('listening') ) { - const obj = Cypress.env('eventResponseMap').get(message.id); + const obj = Cypress.env('eventResponseMap').get(mapKey); obj.listenerResponse = message; - Cypress.env('eventResponseMap').set(message.id, obj); + Cypress.env('eventResponseMap').set(mapKey, obj); } // Returning the message when response and request id matches. diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 2c4adebc..d3431f83 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -115,7 +115,7 @@ Given( cy.saveEventResponse( updatedResponse, methodOrEventObject, - methodOrEvent, + eventName, eventExpected === 'triggers' ? true : false ); }); @@ -136,7 +136,7 @@ Given( cy.saveEventResponse( response, methodOrEventObject, - methodOrEvent, + eventName, eventExpected === 'triggers' ? true : false ); } From dfb9a6adfe6843c572a39d8512e48d8e620e9beb Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Tue, 4 Jun 2024 12:57:46 +0530 Subject: [PATCH 101/359] Added minor change --- .../support/modularTransportClient/transportLayers/websocket.js | 2 +- cypress/support/validations/schemaValidation.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/modularTransportClient/transportLayers/websocket.js b/cypress/support/modularTransportClient/transportLayers/websocket.js index e1342f10..efeb4aa7 100644 --- a/cypress/support/modularTransportClient/transportLayers/websocket.js +++ b/cypress/support/modularTransportClient/transportLayers/websocket.js @@ -93,7 +93,7 @@ export default class Websocket extends AsyncTransportClient { if ( mapKey && Cypress.env('eventResponseMap').has(mapKey) && - !message.result.hasOwnProperty('listening') + !message?.result?.hasOwnProperty('listening') ) { const obj = Cypress.env('eventResponseMap').get(mapKey); obj.listenerResponse = message; diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 1371bbd7..672a0d99 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -140,7 +140,7 @@ Cypress.Commands.add( return formattedResponse; }); } else { - cy.log(`Response does not have a valid result or error field - ${response}`); + cy.log(`Response does not have a valid result or error field - ${JSON.stringify(response)}`); } } ); From 71b4b94d19254ad50532f2249eaede7360a934a1 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Tue, 4 Jun 2024 19:33:36 +0530 Subject: [PATCH 102/359] Keynames change --- .../TestCases/FireboltCertification/UserInterest.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index d727f681..3a909fce 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -8,12 +8,12 @@ Feature: UserInterest @coreSDK @sdk @transport @userinterest Scenario Outline: Discovery.userInterest - Positive Scenario: In-app UX - Notify userInterest with type When 1st party app registers for the 'Content onUserInterest' event using the 'Firebolt' API - And '3rd party app' invokes the 'Firebolt' API to 'notify userInterest with ' + And '3rd party app' invokes the 'Firebolt' API to 'notify userInterest with ' Then 'Firebolt' platform responds with 'null for discovery userInterest' And 'Firebolt' platform triggers to '1st party app' event 'onUserInterest with ' Examples: - | Scenario | NotifyParam | Event_Content | + | Scenario | userInterestData | Event_Content | | interest & reason playlist with program entity | type interest and reason playlist with program entity | type interest reason playlist | | disinterest & reason playlist with program entity | type disinterest and reason playlist with program entity | type disinterest reason playlist | | interest & reason playlist with channel streaming entity | type interest and reason playlist with channel streaming entity | type interest reason playlist channel | @@ -88,11 +88,11 @@ Feature: UserInterest @coreSDK @sdk @userinterest Scenario Outline: Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type - And 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type ' + And 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type ' Then 'Firebolt' platform responds to '1st party app' with '' Examples: - | Scenario | NotifyParam | method_Content | + | Scenario | userInterestData | method_Content | | interest and reason playlist | interest reason playlist | requestUserInterest with reason playlist | | interest and reason reaction | interest reason reaction | requestUserInterest with reason reaction | | interest and reason recording | interest reason recording | requestUserInterest with reason recording | From 61a6b48fd5638e71589b795ff5dcc6105c150220 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Wed, 5 Jun 2024 10:43:31 +0530 Subject: [PATCH 103/359] addressed the comment --- cypress/support/cypress-support/src/FireboltInvoker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/cypress-support/src/FireboltInvoker.js b/cypress/support/cypress-support/src/FireboltInvoker.js index a9fb8e6b..2ab91616 100644 --- a/cypress/support/cypress-support/src/FireboltInvoker.js +++ b/cypress/support/cypress-support/src/FireboltInvoker.js @@ -94,7 +94,7 @@ export default class FireboltInvoker { logger.info('Firebolt Message in the invoke:' + JSON.stringify(fireboltMessage), 'invoke'); try { - // Adding method name and listenerResponse to MAP for event registration request message. + // Saving firebolt event to an env map with the event name and listener id if ( fireboltMessage && fireboltMessage.params && From cef10bb93c23f5ae9c90744d315a0ed69c6e54df Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Wed, 5 Jun 2024 11:03:53 +0530 Subject: [PATCH 104/359] 2086 - Rearrange advertising TCs --- cypress/TestCases/FireboltCertification/Advertising.feature | 2 +- .../FireboltCertification/Manage/AdvertisingManage.feature | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Advertising.feature b/cypress/TestCases/FireboltCertification/Advertising.feature index 3c7a803d..65d2639b 100644 --- a/cypress/TestCases/FireboltCertification/Advertising.feature +++ b/cypress/TestCases/FireboltCertification/Advertising.feature @@ -31,9 +31,9 @@ Feature: Advertising Examples: | Scenario | API_Key | Method_Validation_key | Event_Validation_key | + | SkipRestriction adsAll | set skipRestriction as adsAll | Advertising policy skipRestriction as adsAll | onPolicyChanged for advertising skipRestriction with adsAll | | SkipRestriction none | set skipRestriction as none | Advertising policy skipRestriction as none | onPolicyChanged for advertising skipRestriction with none | | SkipRestriction adsUnwatched | set skipRestriction as adsUnwatched | Advertising policy skipRestriction as adsUnwatched | onPolicyChanged for advertising skipRestriction with adsUnwatched | - | SkipRestriction adsAll | set skipRestriction as adsAll | Advertising policy skipRestriction as adsAll | onPolicyChanged for advertising skipRestriction with adsAll | | SkipRestriction all | set skipRestriction as all | Advertising policy skipRestriction as all | onPolicyChanged for advertising skipRestriction with all | @Advertising @coreSDK @sdk @transport diff --git a/cypress/TestCases/FireboltCertification/Manage/AdvertisingManage.feature b/cypress/TestCases/FireboltCertification/Manage/AdvertisingManage.feature index 4f663eba..f8be43d9 100644 --- a/cypress/TestCases/FireboltCertification/Manage/AdvertisingManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/AdvertisingManage.feature @@ -21,9 +21,9 @@ Feature: Advertising_Manage Examples: | Scenario | API_Key | Method_Validation_Key | Event_Validation_Key | + | SkipRestriction adsAll | set skipRestriction as adsAll | adsAll for skipRestriction | onSkipRestrictionChanged with adsAll | | SkipRestriction none | set skipRestriction as none | none for skipRestriction | onSkipRestrictionChanged with none | | SkipRestriction adsUnwatched | set skipRestriction as adsUnwatched | adsUnwatched for skipRestriction | onSkipRestrictionChanged with adsUnwatched | - | SkipRestriction adsAll | set skipRestriction as adsAll | adsAll for skipRestriction | onSkipRestrictionChanged with adsAll | | SkipRestriction all | set skipRestriction as all | all for skipRestriction | onSkipRestrictionChanged with all | From 6a1027a71f6717e1e6645c9a0189f61af7433b02 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Wed, 5 Jun 2024 21:28:35 +0530 Subject: [PATCH 105/359] changes to process data for setResponseJson --- cypress/plugins/testDataProcessor.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index 61093bdb..ad9ea67c 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -55,14 +55,34 @@ function testDataProcessor(configEnv) { // Resolving the variables in the JSON const resolvedFireboltCallsJson = processFireboltJson(combinedFireboltCallsJson); + // Resolving the variables in the SetResponse JSON + const resolvedSetResponseJson = processSetResponseJson(mergedSetResponseJson); + // Below key names are converted into environment variables. return { fireboltCallsJson: resolvedFireboltCallsJson, fireboltMocksJson: combinedFireboltMocksJson, - setResponseJson: mergedSetResponseJson, + setResponseJson: resolvedSetResponseJson, }; } +function processSetResponseJson(jsonData) { + // Looping through json data + for (const key in jsonData) { + const object = jsonData[key]; + if (object.hasOwnProperty('fireboltMock') && combinedFireboltMocksJson[object.fireboltMock]) { + object.fireboltMock = combinedFireboltMocksJson[object.fireboltMock]; + } else if ( + object.hasOwnProperty('fireboltCall') && + resolvedFireboltCallsJson[object.fireboltCall] + ) { + object.fireboltCall = resolvedFireboltCallsJson[object.fireboltCall]; + } + } + return jsonData +} + + /** * @function processFireboltJson * processFireboltJson function will perform following operations From f2f641c62496fea8e0486093f5e33ca860fa4ab9 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Wed, 5 Jun 2024 23:55:28 +0530 Subject: [PATCH 106/359] declaring the variable globally --- cypress/plugins/testDataProcessor.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index ad9ea67c..0b9eae20 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -9,6 +9,8 @@ const logger = require('../support/Logger')('testDataProcessor.js'); // Combining validation objects from FCS and config module into single JSON const validationObjects = combineValidationObjectsJson(); +let resolvedFireboltCallsJson; +let combinedFireboltMocksJson /** * @function testDataProcessor @@ -42,7 +44,7 @@ function testDataProcessor(configEnv) { fcsFireboltCallsMergedJson, configFireboltCallsModuleMergedJson ); - const combinedFireboltMocksJson = Object.assign( + combinedFireboltMocksJson = Object.assign( fcsFireboltMocksMergedJson, configModuleFireboltMocksMergedJson ); @@ -53,7 +55,7 @@ function testDataProcessor(configEnv) { ]); // Resolving the variables in the JSON - const resolvedFireboltCallsJson = processFireboltJson(combinedFireboltCallsJson); + resolvedFireboltCallsJson = processFireboltJson(combinedFireboltCallsJson); // Resolving the variables in the SetResponse JSON const resolvedSetResponseJson = processSetResponseJson(mergedSetResponseJson); @@ -79,10 +81,9 @@ function processSetResponseJson(jsonData) { object.fireboltCall = resolvedFireboltCallsJson[object.fireboltCall]; } } - return jsonData + return jsonData; } - /** * @function processFireboltJson * processFireboltJson function will perform following operations From c60df42c9e815ff34d0363f5ac9cba1da0fadd39 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Wed, 5 Jun 2024 23:58:42 +0530 Subject: [PATCH 107/359] lint fix --- cypress/plugins/testDataProcessor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index 0b9eae20..9c4e5185 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -10,7 +10,7 @@ const logger = require('../support/Logger')('testDataProcessor.js'); // Combining validation objects from FCS and config module into single JSON const validationObjects = combineValidationObjectsJson(); let resolvedFireboltCallsJson; -let combinedFireboltMocksJson +let combinedFireboltMocksJson; /** * @function testDataProcessor From 6bc29b73cd73b92c918365f51a4e589cbe711697 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Thu, 6 Jun 2024 10:26:44 +0530 Subject: [PATCH 108/359] description --- cypress/plugins/testDataProcessor.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index 9c4e5185..dcb71cda 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -68,6 +68,18 @@ function testDataProcessor(configEnv) { }; } +/** + * @function processSetResponseJson + * processSetResponseJson function will perform following operations + * - Iterate over each key in the provided JSON + * - Resolve the values of setResponse params + * - Return the JSON with the updated value. + * + * @example + * processSetResponseJson({'abc': {'fireboltMock': 'ACKNOWLEDGE_CHALLENGE_GRANTED', 'firstParty': 'true'}}) + * @returns + * {'abc': {fireboltMock: {'method': 'method_name', 'response': [{"isCancelled": false, "withUi": true, "result":{}}]}}, 'firstParty': 'true'} + */ function processSetResponseJson(jsonData) { // Looping through json data for (const key in jsonData) { From b8d7efd751716d9780fc149afc8d628134467a76 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 7 Jun 2024 13:06:50 +0530 Subject: [PATCH 109/359] Added resolveAtRuntime global function --- cypress/support/cypress-support/src/utils.js | 66 ++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 52990489..f57c4f96 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -741,6 +741,72 @@ class FireLog { const fireLog = new FireLog(); global.fireLog = fireLog; +/** + * @module utils + * @globalfunction resolveAtRuntime + * @description Resolve the device variable from the preprocessed data for the given key + * @example + * resolveAtRuntime(["result.{{attribute}}", "result.styles.{{attribute}}"]) + * resolveAtRuntime("manage_closedcaptions.set{{attribute.uppercaseFirstChar}}") + * resolveAtRuntime("value") + * + * @returns + * ['result.fontSize', 'result.styles.fontSize'] + * "manage_closedcaptions.setFontSize" + * "1.5" + */ +const resolveAtRuntime = (input) => { + const functions = { + uppercaseFirstChar: function (str) { + return str.charAt(0).toUpperCase() + str.slice(1); + }, + lowercaseFirstChar: function (str) { + return str.charAt(0).toLowerCase() + str.slice(1); + }, + }; + + // Function to check the occurence of the pattern and updating the actual value + function replacingPatternOccurenceWithValue(text) { + return text.replace(/{{(.*?)}}/g, (match, pattern) => { + let functionName; + + // Separating the function name from the pattern, if it exists,. + if (pattern.includes('.')) { + functionName = pattern.split('.')[1]; + pattern = pattern.split('.')[0]; + } + + // If a function name is present in the pattern, call the function with pattern content as input. + // Reading the pattern content from the runtime environment variable + if (functionName && functions.hasOwnProperty(functionName)) { + return functions[functionName](getEnvVariable(runtime)[pattern] || match); + } else { + return getEnvVariable(runtime)[pattern] || match; + } + }); + } + + if (typeof input === CONSTANTS.TYPE_STRING) { + // Returning the actual pattern content for each occurrence of "{{" + if (input.includes('{{')) { + return replacingPatternOccurenceWithValue(input); + } + // If input not having "{{", returning content from runtime environment variable. + else if (!input.includes('{{')) { + return getEnvVariable(runtime).input || input; + } + } else if (Array.isArray(input) && input.length > 0) { + // input is an array; iterating through each element, it updates the actual value for that pattern if there is an occurrence of "{{". + return input.map((element) => { + if (element.includes('{{')) { + return replacingPatternOccurenceWithValue(element); + } + }); + } +}; + +global.resolveAtRuntime = resolveAtRuntime; + module.exports = { replaceJsonStringWithEnvVar, createIntentMessage, From b58ed5bf1f49313db9729c1580118cf1e3558caf Mon Sep 17 00:00:00 2001 From: Abhishek urs C J <43801187+Abhishk123@users.noreply.github.com> Date: Fri, 7 Jun 2024 13:19:54 +0530 Subject: [PATCH 110/359] Update utils.js --- cypress/support/cypress-support/src/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index f57c4f96..3317c3ea 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -749,8 +749,8 @@ global.fireLog = fireLog; * resolveAtRuntime(["result.{{attribute}}", "result.styles.{{attribute}}"]) * resolveAtRuntime("manage_closedcaptions.set{{attribute.uppercaseFirstChar}}") * resolveAtRuntime("value") - * - * @returns + * + * @returns * ['result.fontSize', 'result.styles.fontSize'] * "manage_closedcaptions.setFontSize" * "1.5" From 089f48fc5d7a3a2f32ea8792ebd81e92199bf957 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 7 Jun 2024 15:44:38 +0530 Subject: [PATCH 111/359] FIRECERT-2025-updated log for calls --- cypress/support/step_definitions/fireboltCalls.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index ce6487d9..46339ed4 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -69,10 +69,12 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = cy.updateResponseForFCS(method, params, response).then((updatedResponse) => { // Create a deep copy to avoid reference mutation const dataToBeCensored = _.cloneDeep(response); - // Call the 'censorData' command to hide sensitive data cy.censorData(method, dataToBeCensored).then((maskedResult) => { - cy.log(`Response from Firebolt platform: ${JSON.stringify(maskedResult)}`); + const responseType = response.error ? CONSTANTS.ERROR : CONSTANTS.RESULT; + cy.log( + `Response from Firebolt platform: ${JSON.stringify(maskedResult[responseType])}` + ); }); // If event and params are not supported setting isScenarioExempted as true for further validation. if (UTILS.isScenarioExempted(method, params)) { @@ -168,7 +170,8 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { // Call the 'censorData' command to hide sensitive data cy.censorData(method, dataToBeCensored).then((maskedResult) => { - cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); + const responseType = result.error ? CONSTANTS.ERROR : CONSTANTS.RESULT; + cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult[responseType])}`); }); // If method and params are not supported setting isScenarioExempted as true for further validation. From 3ffac80683a46b1e4553d7a190dd1af848d101b3 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Fri, 7 Jun 2024 16:03:48 +0530 Subject: [PATCH 112/359] update lifecycle TCs name in modReqId --- .../objects/moduleReqId/moduleReqId.json | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 8a902fb3..11f154ed 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -1601,7 +1601,7 @@ } }, "Lifecycle_Inactive": { - "Close an app from foreground": { + "Lifecycle 2.3.1 Close an app from foreground": { "req": [ { "state": { @@ -1625,7 +1625,7 @@ } ] }, - "Close an app from background": { + "Lifecycle 2.3.1 Close an app from background": { "req": [ { "state": { @@ -1649,7 +1649,7 @@ } ] }, - "No impact on closing app from inactive state": { + "Lifecycle 2.3.3 No impact on closing app from inactive state": { "req": [ { "state": { @@ -1675,7 +1675,7 @@ } }, "Lifecycle_Foreground": { - "Loading & Launching an App (initializing -> foreground)": { + "Lifecycle 2.2 Loading & Launching an App (initializing -> foreground)": { "req": [ { "state": { @@ -1699,7 +1699,7 @@ } ] }, - "Relaunch foreground app": { + "Lifecycle 2.2.1 Relaunch foreground app": { "req": [ { "state": { @@ -1723,7 +1723,7 @@ } ] }, - "App Launching another app": { + "Lifecycle 2.2.5 App Launching another app": { "req": [ { "state": { @@ -2155,7 +2155,7 @@ } }, "Lifecycle_Background": { - "Background an app from foreground": { + "Lifecycle 2.4.2 Background an app from foreground": { "req": [ { "state": { @@ -2179,7 +2179,7 @@ } ] }, - "Background an app from inactive": { + "Lifecycle 2.4.2 Background an app from inactive": { "req": [ { "state": { @@ -2203,7 +2203,7 @@ } ] }, - "Cannot Background app that is not loaded": { + "Lifecycle 2.4.3 Cannot Background app that is not loaded": { "req": [ { "state": { @@ -2227,7 +2227,7 @@ } ] }, - "Cannot Background a Backgrounded App": { + "Lifecycle 2.4.1 Cannot Background a Backgrounded App": { "req": [ { "state": { @@ -2251,7 +2251,7 @@ } ] }, - "Cannot Background app in Unloading state": { + "Lifecycle 2.4.3 Cannot Background app in Unloading state": { "req": [ { "state": { @@ -2275,7 +2275,7 @@ } ] }, - "Cannot background app from suspended state": { + "Lifecycle 2.4.3 Cannot background app from suspended state": { "req": [ { "state": { @@ -2299,7 +2299,7 @@ } ] }, - "Should not Background app in initializing state": { + "Lifecycle 2.4.3 Should not Background app in initializing state": { "req": [ { "state": { From 6eb70b9abcafa65c01a41a479a2db66830c9689b Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Fri, 7 Jun 2024 16:53:09 +0530 Subject: [PATCH 113/359] Add missing constant --- cypress/support/constants/constants.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 55e9f06d..4d3bbc4e 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -370,6 +370,7 @@ module.exports = { SETAPIRESPONSE: 'setApiResponse', CLEAREVENTHANDLER: 'clearEventHandler', PERFORMANCETESTHANDLER: 'performanceTestHandler', + VISIBILITYSTATE: 'visibilityState', }, TEST_TYPE: 'testType', THIRD_PARTY_APP: '3rd party app', From 63afebc74349d84fd09026c8f71fc4832548e045 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Fri, 7 Jun 2024 17:21:09 +0530 Subject: [PATCH 114/359] review comment address --- cypress/plugins/testDataProcessor.js | 8 ++++---- cypress/support/cypress-commands/commands.js | 20 ++++++++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index dcb71cda..5f7c04d8 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -80,10 +80,10 @@ function testDataProcessor(configEnv) { * @returns * {'abc': {fireboltMock: {'method': 'method_name', 'response': [{"isCancelled": false, "withUi": true, "result":{}}]}}, 'firstParty': 'true'} */ -function processSetResponseJson(jsonData) { +function processSetResponseJson(setResponseJsonData) { // Looping through json data - for (const key in jsonData) { - const object = jsonData[key]; + for (const key in setResponseJsonData) { + const object = setResponseJsonData[key]; if (object.hasOwnProperty('fireboltMock') && combinedFireboltMocksJson[object.fireboltMock]) { object.fireboltMock = combinedFireboltMocksJson[object.fireboltMock]; } else if ( @@ -93,7 +93,7 @@ function processSetResponseJson(jsonData) { object.fireboltCall = resolvedFireboltCallsJson[object.fireboltCall]; } } - return jsonData; + return setResponseJsonData; } /** diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 028a969e..9b5068bb 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -470,10 +470,7 @@ Cypress.Commands.add('setResponse', (beforeOperation, scenarioName) => { }); }); } else if (beforeOperation.hasOwnProperty(CONSTANTS.FIREBOLTMOCK)) { - cy.getFireboltData( - beforeOperation[CONSTANTS.FIREBOLTMOCK], - CONSTANTS.SUPPORTED_CALLTYPES.FIREBOLTMOCKS - ).then((parsedData) => { + cy.parsedMockData(beforeOperation).then((parsedData) => { if (firstParty) { const method = CONSTANTS.REQUEST_OVERRIDE_CALLS.SETRESPONSE; const requestMap = { @@ -533,6 +530,21 @@ Cypress.Commands.add('setResponse', (beforeOperation, scenarioName) => { } }); +Cypress.Commands.add('parsedMockData', (beforeOperation) => { + if (beforeOperation.hasOwnProperty('fireboltMock')) { + if (typeof beforeOperation.fireboltMock === 'string') { + cy.getFireboltData( + beforeOperation[CONSTANTS.FIREBOLTMOCK], + CONSTANTS.SUPPORTED_CALLTYPES.FIREBOLTMOCKS + ).then((response) => { + return response; + }); + } else { + return beforeOperation.fireboltMock; + } + } +}); + /** * @module commands * @function startOrStopPerformanceService From 7cd592179b88ba4a02d69e5cc93c340637487432 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 10 Jun 2024 10:32:51 +0530 Subject: [PATCH 115/359] addressed the comments --- cypress/support/cypress-support/src/utils.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index f57c4f96..725dc102 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -744,7 +744,7 @@ global.fireLog = fireLog; /** * @module utils * @globalfunction resolveAtRuntime - * @description Resolve the device variable from the preprocessed data for the given key + * @description Resolve the value for the passed input at runtime. * @example * resolveAtRuntime(["result.{{attribute}}", "result.styles.{{attribute}}"]) * resolveAtRuntime("manage_closedcaptions.set{{attribute.uppercaseFirstChar}}") @@ -753,7 +753,7 @@ global.fireLog = fireLog; * @returns * ['result.fontSize', 'result.styles.fontSize'] * "manage_closedcaptions.setFontSize" - * "1.5" + * 1.5 */ const resolveAtRuntime = (input) => { const functions = { @@ -802,6 +802,8 @@ const resolveAtRuntime = (input) => { return replacingPatternOccurenceWithValue(element); } }); + } else { + logger.info(`Passed input ${input} must be an array or a string.`) } }; From eb6703ca97d8fd5907364bcf71d8f42cd0801a43 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Mon, 10 Jun 2024 14:36:33 +0530 Subject: [PATCH 116/359] FIRECERT-2025-log update --- cypress/support/step_definitions/fireboltCalls.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 46339ed4..1dbe1523 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -71,10 +71,7 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = const dataToBeCensored = _.cloneDeep(response); // Call the 'censorData' command to hide sensitive data cy.censorData(method, dataToBeCensored).then((maskedResult) => { - const responseType = response.error ? CONSTANTS.ERROR : CONSTANTS.RESULT; - cy.log( - `Response from Firebolt platform: ${JSON.stringify(maskedResult[responseType])}` - ); + cy.log(`Response from Firebolt platform: ${JSON.stringify(maskedResult)}`); }); // If event and params are not supported setting isScenarioExempted as true for further validation. if (UTILS.isScenarioExempted(method, params)) { From 5df56912398d3e1b765218f0d4ac891af3b2c43a Mon Sep 17 00:00:00 2001 From: Abhishek urs C J <43801187+Abhishk123@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:16:13 +0530 Subject: [PATCH 117/359] Update utils.js --- cypress/support/cypress-support/src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index ac850fa4..63ffd471 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -803,7 +803,7 @@ const resolveAtRuntime = (input) => { } }); } else { - logger.info(`Passed input ${input} must be an array or a string.`) + logger.info(`Passed input ${input} must be an array or a string.`); } }; From 9b72027bd994106d78cb01585d0113bbdd969ba0 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 11 Jun 2024 13:35:13 +0530 Subject: [PATCH 118/359] FIRECERT-2144-reporting changes --- Scripts/lifeCycleAppObject.js | 2 +- .../LifecycleTestcases/Lifecycle.feature | 12 +- .../LifecycleBackground.feature | 12 +- .../LifecycleConfigurations.feature | 8 +- .../LifecycleForeground.feature | 6 +- .../LifecycleInactive.feature | 4 +- .../LifecycleInitializing.feature | 2 +- .../LifecycleSuspended.feature | 24 +- .../LifecycleTerminated.feature | 2 +- .../LifecycleUnloading.feature | 16 +- .../fixtures/objects/lifecycleAppObject.json | 26 +- .../objects/moduleReqId/moduleReqId.json | 732 +++++++++--------- cypress/support/constants/constants.js | 18 +- cypress/support/cypress-commands/commands.js | 5 +- cypress/support/cypress-commands/lifecycle.js | 65 +- cypress/support/step_definitions/testSetup.js | 5 +- 16 files changed, 457 insertions(+), 482 deletions(-) diff --git a/Scripts/lifeCycleAppObject.js b/Scripts/lifeCycleAppObject.js index 4507090c..f63005a8 100644 --- a/Scripts/lifeCycleAppObject.js +++ b/Scripts/lifeCycleAppObject.js @@ -41,7 +41,7 @@ class stateConfig { // If currentState and previousState are not equal and allowed state transition supports currentState, generate an event and push to notification list if (stateTransition.includes(currentState) && currentState != previousState) { - const message = { state: currentState, previous: previousState }; + const message = { previous: previousState, state: currentState, }; logger.info('Lifecycle appObject transition: ' + JSON.stringify(message)); const tempNotification = new notificationConfig(message); this.notification.push(tempNotification); diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/Lifecycle.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/Lifecycle.feature index 5c5081ec..084cc972 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/Lifecycle.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/Lifecycle.feature @@ -1,14 +1,14 @@ Feature: Lifecycle @Lifecycle @sdk @transport @coreSDK @regression - Scenario: Validate lifecycle.ready - Notify the platform that the app is ready + Scenario: Lifecycle R*4.1 Validate lifecycle.ready - Notify the platform that the app is ready Given the environment has been set up for 'lifeCycleApi' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to 'notify that the app is ready' Then 'Firebolt' platform responds with 'null for lifecycle ready' @Lifecycle @sdk @transport @coreSDK @regression - Scenario: Validate 'lifecycle.ready' - expecting error + Scenario: Lifecycle R*4.1 Validate 'lifecycle.ready' - expecting error Given the environment has been set up for 'lifeCycleApi' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to 'notify that the app is ready' @@ -19,14 +19,14 @@ Feature: Lifecycle Then 'Firebolt' platform responds with 'foreground for lifecycle state' @Lifecycle @sdk @transport @coreSDK @regression - Scenario: Validate lifecycle.state - Get the current state + Scenario: Lifecycle R*4.6 Validate lifecycle.state - Get the current state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to 'fetch lifecycle state' Then 'Firebolt' platform responds with 'foreground for lifecycle state' @Lifecycle @coreSDK @regression @sdk @transport - Scenario Outline: Validate lifecycle.close - '' expecting error + Scenario Outline: Lifecycle R*4.3 Validate lifecycle.close - '' expecting error Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to '' @@ -46,7 +46,7 @@ Feature: Lifecycle | Invalid params | close app with invalid parameter | invalid parameter error for lifecycle close | @Lifecycle @coreSDK @regression @sdk @transport - Scenario Outline: Validate lifecycle.close - Positive Scenario - '' + Scenario Outline: Lifecycle R*4.3 Validate lifecycle.close - Positive Scenario - '' Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to '' @@ -60,7 +60,7 @@ Feature: Lifecycle | with done | close app with done | @Lifecycle @sdk @transport @coreSDK @regression - Scenario: Validate 'lifecycle.finished' - expecting error + Scenario: Lifecycle R*4.5 Validate 'lifecycle.finished' - expecting error Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to 'notify that the app is done unloading' diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature index 2653ecc7..3c1ca75b 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature @@ -3,7 +3,7 @@ Feature: Lifecycle_Background @Lifecycle @coreSDK - Scenario Outline: Lifecycle 2.4.2 Background an app from + Scenario Outline: Lifecycle R*3.4 Background an app from Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with '' state When '3rd party app' transitions to state 'background' @@ -20,7 +20,7 @@ Feature: Lifecycle_Background @needsFurtherInformation @notSupported @Lifecycle @coreSDK @lifecycleManagement - Scenario: Lifecycle 2.4.3 Cannot Background app that is not loaded + Scenario: Lifecycle R.3.4.4 Cannot Background app that is not loaded Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'unloaded' state # And 1st party app invokes the API to 'get lifecycle management state' @@ -31,14 +31,14 @@ Feature: Lifecycle_Background # Keeping this as notSupported because there is no support to background an already backgrounded app using lifecycle.background method @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.4.1 Cannot Background a Backgrounded App + Scenario: Lifecycle R*3.4.3 Cannot Background a Backgrounded App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'background' state When '3rd party app' transitions to state 'background' Then '3rd party app' will stay in 'background' state @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.4.3 Cannot Background app in Unloading state + Scenario: Lifecycle R.3.4.4 Cannot Background app in Unloading state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'unloading' state When '3rd party app' transitions to state 'background' @@ -46,14 +46,14 @@ Feature: Lifecycle_Background Then '3rd party app' will stay in 'unloading' state @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.4.3 Cannot background app from suspended state + Scenario: Lifecycle R.3.4.4 Cannot background app from suspended state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When '3rd party app' transitions to state 'background' Then '3rd party app' will stay in 'suspended' state @Lifecycle @coreSDK - Scenario: Lifecycle 2.4.3 Should not Background app in initializing state + Scenario: Lifecycle R.3.4.4 Should not Background app in initializing state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'initializing' state When '3rd party app' transitions to state 'background' diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleConfigurations.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleConfigurations.feature index b3c57d15..7fc6e5eb 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleConfigurations.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleConfigurations.feature @@ -2,7 +2,7 @@ # Validation objects are not added for not supported methods Feature: Lifecycle_Configuration @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 6.1 App launch time out + Scenario: Lifecycle R*6.1 App launch time out Given the environment has been set up for 'lifecycle' tests # And firebolt config 'Lifecycle.appReadyTimeout' is set to to 5 'seconds' And 3rd party 'certification' app is launched with 'initializing' state @@ -10,7 +10,7 @@ Feature: Lifecycle_Configuration Then '3rd party app' will be in 'terminated' state @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 6.2 appFinishedTimeout exceeded + Scenario: Lifecycle R*6.1 appFinishedTimeout exceeded Given the environment has been set up for 'lifecycle' tests # And firebolt config 'Lifecycle.appReadyTimeout' is set to to 5 'seconds' And 3rd party 'certification' app is launched with 'unloading' state @@ -18,7 +18,7 @@ Feature: Lifecycle_Configuration Then '3rd party app' will be in 'terminated' state @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 6.2 appFinishedTimeout data type + Scenario: Lifecycle R*6.2 appFinishedTimeout data type Given the environment has been set up for 'lifecycle' tests # And 1st party app invokes API methods using below datatable # Then 'Firebolt' platform responds with 'message and code for lifecycle appFinishedTimeout' @@ -29,7 +29,7 @@ Feature: Lifecycle_Configuration # | Lifecycle.appFinishedTimeout | | @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 6.1 appReadyTimeout data type + Scenario: Lifecycle R*6.1 appReadyTimeout data type Given the environment has been set up for 'lifecycle' tests # And 1st party app invokes API methods using below datatable # Then 'Firebolt' platform responds with 'message and code for lifecycle appReadyTimeout' diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleForeground.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleForeground.feature index 51a0bc65..43760987 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleForeground.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleForeground.feature @@ -3,14 +3,14 @@ Feature: Lifecycle_Foreground @Lifecycle @coreSDK - Scenario: Lifecycle 2.2 Loading & Launching an App (initializing -> foreground) + Scenario: Lifecycle R*3.2 Loading & Launching an App (initializing -> foreground) Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'initializing' state When '3rd party app' transitions to state 'foreground' Then '3rd party app' will be in 'foreground' state @Lifecycle @coreSDK - Scenario: Lifecycle 2.2.1 Relaunch foreground app + Scenario: Lifecycle R*3.2.3 Relaunch foreground app Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'foreground' state And 3rd party 'certification' app is launched @@ -18,7 +18,7 @@ Feature: Lifecycle_Foreground @needsfurtherinformation @Lifecycle @coreSDK @lifecycleManagement @notSupported - Scenario: Lifecycle 2.2.5 App Launching another app + Scenario: Lifecycle R.3.2.1 App Launching another app Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'foreground' state When '3rd party app' invokes the 'Firebolt' API to 'get home intent' diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInactive.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInactive.feature index 17c2df93..649e5c2a 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInactive.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInactive.feature @@ -3,7 +3,7 @@ Feature: Lifecycle_Inactive @Lifecycle @coreSDK - Scenario Outline: Lifecycle 2.3.1 Close an app from + Scenario Outline: Lifecycle R*3.3 Close an app from Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with '' state When '3rd party app' transitions to state 'inactive' @@ -14,7 +14,7 @@ Feature: Lifecycle_Inactive | background | @Lifecycle @coreSDK @lifecycleManagement - Scenario: Lifecycle 2.3.3 No impact on closing app from inactive state + Scenario: Lifecycle R*3.3.3 No impact on closing app from inactive state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'inactive' state # And 1st party app invokes the API to 'get lifecycle management state' diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInitializing.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInitializing.feature index 15ada78b..9c5b2086 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInitializing.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInitializing.feature @@ -3,7 +3,7 @@ Feature: Lifecycle_Initializing @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.3.2 Cannot Close an app from initializing + Scenario: Lifecycle R.3.3.4 Cannot Close an app from initializing Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'initializing' state # And 1st party app invokes the API to 'get lifecycle management state' diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature index 92ebb1f5..183f7f47 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature @@ -1,20 +1,20 @@ Feature: Lifecycle_Suspended @Lifecycle @coreSDK - Scenario: Lifecycle 1.6.1 App should subscribe to onSuspended listener regardless of capability + Scenario: Lifecycle R*2.6.1 App should subscribe to onSuspended listener regardless of capability Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'foreground' state When '3rd party app' registers for the 'lifecycle onSuspended' event using the 'Firebolt' API @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.5.4 Suspend App from Inactive state + Scenario: Lifecycle R*2.6.5, R*3.5.3 Suspend App from Inactive state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'inactive' state When '3rd party app' transitions to state 'suspended' Then '3rd party app' will be in 'suspended' state @Lifecycle @coreSDK @notSupported @needsFurtherInformation - Scenario: Lifecycle 2.2.4 Relaunch a previously Suspended app after Unsuspend + Scenario: Lifecycle R*2.2.8, R*3.2.3 Relaunch a previously Suspended app after Unsuspend Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When '3rd party app' transitions to state 'inactive' @@ -22,28 +22,28 @@ Feature: Lifecycle_Suspended Then '3rd party app' will be in 'foreground' state @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.5.3 Cannot Suspend a suspended App + Scenario: Lifecycle R*3.5.2 Cannot Suspend a suspended App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When '3rd party app' transitions to state 'suspended' Then '3rd party app' will stay in 'suspended' state @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.5.1 Cannot Suspend a unloaded App + Scenario: Lifecycle R*2.5.3 Cannot Suspend a unloaded App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'unloaded' state When '3rd party app' transitions to state 'suspended' Then '3rd party app' will stay in 'unloaded' state @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.5.5 Cannot relaunch Suspended App + Scenario: Lifecycle R*3.2.5 Cannot relaunch Suspended App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When 3rd party 'certification' app is launched Then '3rd party app' will stay in 'suspended' state @Lifecycle @coreSDK @notSupported - Scenario Outline: Lifecycle 2.5.2 Cannot Suspend app + Scenario Outline: Lifecycle R*2.6.5 Cannot Suspend app Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with '' state When '3rd party app' transitions to state 'suspended' @@ -55,7 +55,7 @@ Feature: Lifecycle_Suspended | background | @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.3.2 Cannot Close Suspended App + Scenario: Lifecycle R.3.3.4 Cannot Close Suspended App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state # And 1st party app invokes the API to 'get lifecycle management state' @@ -66,14 +66,14 @@ Feature: Lifecycle_Suspended Then 'Firebolt' platform responds with 'message and code for lifecycle close' @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.6, 2.6.2 Unsuspending App + Scenario: Lifecycle R*3.6 Unsuspending App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When '3rd party app' transitions to state 'inactive' Then '3rd party app' will be in 'inactive' state @Lifecycle @coreSDK @notSupported - Scenario Outline: Lifecycle 2.6.1 Cannot Unsuspend in State + Scenario Outline: Lifecycle R*3.6.3 Cannot Unsuspend in State Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with '' state # And 1st party app invokes the API to 'get lifecycle management state' @@ -91,7 +91,7 @@ Feature: Lifecycle_Suspended | unloading | @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.6.3 Unsuspend unloaded app + Scenario: Lifecycle R*3.6.2 Unsuspend unloaded app Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'unloaded' state # And 1st party app invokes the API to 'get lifecycle management state' @@ -102,7 +102,7 @@ Feature: Lifecycle_Suspended # Then 'Firebolt' platform responds with 'last two responses for lifecycleManagement state' @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.5.6 Try to suspend an app that doesn't exist + Scenario: Lifecycle R.3.5.3 Try to suspend an app that doesn't exist Given the environment has been set up for 'lifecycle' tests # And 1st party app invokes the API to 'get lifecycle management state' And '3rd party app' invokes the 'Firebolt' API to 'suspend an app that does not exist' diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature index 70b1b0fd..ff0a1428 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature @@ -1,7 +1,7 @@ Feature: Lifecycle_Terminated @Lifecycle @coreSDK @notSupported - Scenario Outline: Lifecycle 2.8 Terminate app in State + Scenario Outline: Lifecycle R*3.8 Terminate app in State Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with '' state Then '3rd party app' transitions to state 'terminated' diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature index ed6e76bb..f9c2d725 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature @@ -3,7 +3,7 @@ Feature: Lifecycle_Unloading @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 3.4.4 No impact of multiple Finished events while unloading + Scenario: Lifecycle R.4.5.4 No impact of multiple Finished events while unloading Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with 'unloading' state Then '3rd party app' invokes the 'Firebolt' API to 'call lifecycle finished' @@ -11,21 +11,21 @@ Feature: Lifecycle_Unloading Then '3rd party app' will stay in 'unloaded' state @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.7.1 Unloading from Inactive state + Scenario: Lifecycle R*3.7.3 Unloading from Inactive state Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with 'inactive' state Then '3rd party app' transitions to state 'unloading' Then '3rd party app' will be in 'unloading' state @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.3.2 Cannot Close an Unloading App + Scenario: Lifecycle R.3.3.4 Cannot Close an Unloading App Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with 'unloading' state Then '3rd party app' transitions to state 'inactive' Then '3rd party app' will stay in 'unloading' state @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 3.4.3 finished from unloading state + Scenario: Lifecycle R*4.5.3 finished from unloading state Given the environment has been set up for 'lifecycle' tests # And firebolt config 'Lifecycle.appFinishedTimeout' is set to to 60 'seconds' When 3rd party 'certification' app is launched with 'unloading' state @@ -33,7 +33,7 @@ Feature: Lifecycle_Unloading Then '3rd party app' will be in 'unloaded' state @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.7.2 Should not unload from active state (foreground) + Scenario: Lifecycle R*3.7.2 Should not unload from active state (foreground) Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with 'foreground' state # When 1st party app invokes the API to 'call lifecycleManagement unload expecting error' @@ -41,7 +41,7 @@ Feature: Lifecycle_Unloading # Then 'Firebolt' platform responds with 'message and code for lifecycle unload' @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.5.1 Cannot Suspend Unloaded app + Scenario: Lifecycle R.3.5.3 Cannot Suspend Unloaded app Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with 'unloaded' state # And 1st party app invokes the API to 'get lifecycle management state' @@ -52,7 +52,7 @@ Feature: Lifecycle_Unloading # And 'Firebolt' platform responds with 'last two responses for lifecycleManagement state' @Lifecycle @coreSDK @notSupported - Scenario Outline: Lifecycle 3.4.1 Should not finish from state other than unloading () + Scenario Outline: Lifecycle R.4.5.4 Should not finish from state other than unloading () Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with '' state When '3rd party app' invokes the 'Firebolt' API to 'call lifecycle finished and expects error' @@ -67,7 +67,7 @@ Feature: Lifecycle_Unloading | suspended | @Lifecycle @coreSDK @notSupported - Scenario: Lifecycle 2.3.2 Cannot Close an app that is not loaded + Scenario: Lifecycle R.3.3.4 Cannot Close an app that is not loaded Given the environment has been set up for 'lifecycle' tests # When 1st party app invokes the API to 'call lifecycleManagement close expecting error' # Then 'Firebolt' platform responds with 'message and code for lifecycleManagement close' \ No newline at end of file diff --git a/cypress/fixtures/objects/lifecycleAppObject.json b/cypress/fixtures/objects/lifecycleAppObject.json index 2237760c..34121080 100644 --- a/cypress/fixtures/objects/lifecycleAppObject.json +++ b/cypress/fixtures/objects/lifecycleAppObject.json @@ -1,34 +1,34 @@ { "validationConfig": { "initializing": { - "stateValidation": { "req": "1.1.1 & 3.5" }, - "historyValidation": { "req": "1.1.2" }, + "stateValidation": { "req": "R*2.1.1 & R*2.1.2 & R*4.6" }, + "historyValidation": { "req": "R*2.1.3" }, "notificationValidation": { "req": "" } }, "inactive": { - "stateValidation": { "req": "1.2.2 & 3.5" }, - "historyValidation": { "req": "1.1.2" }, - "notificationValidation": { "req": ["1.2.1", "1.2.2"] } + "stateValidation": { "req": "R*4.6" }, + "historyValidation": { "req": "" }, + "notificationValidation": { "req": "R*2.2.2 [onInactive event triggered]" } }, "foreground": { - "stateValidation": { "req": "3.5" }, + "stateValidation": { "req": "R*4.6" }, "historyValidation": { "req": "" }, - "notificationValidation": { "req": ["1.3.6", "1.3.6"] } + "notificationValidation": { "req": "R*2.3.6 [onForeground event triggered]" } }, "background": { - "stateValidation": { "req": "3.5" }, + "stateValidation": { "req": "R*4.6" }, "historyValidation": { "req": "" }, - "notificationValidation": { "req": ["1.4.6", "1.3.6"] } + "notificationValidation": { "req": "R*2.4.6 [onBackground event triggered]" } }, "unloading": { - "stateValidation": { "req": "1.5.1 & 3.5" }, - "historyValidation": { "req": "1.5.2" }, + "stateValidation": { "req": "R*2.5.1 & R*2.5.2 & R*4.6" }, + "historyValidation": { "req": "R*2.5.3" }, "notificationValidation": { "req": "" } }, "suspended": { - "stateValidation": { "req": "3.5" }, + "stateValidation": { "req": "R*4.6" }, "historyValidation": { "req": "" }, - "notificationValidation": { "req": ["1.6.4", "1.6.3"] } + "notificationValidation": { "req": "R*2.6.6 [onSuspended event triggered]" } }, "unloaded": { "stateValidation": { "req": "" }, diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 8a902fb3..9c73919f 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -1601,85 +1601,86 @@ } }, "Lifecycle_Inactive": { - "Close an app from foreground": { + + "Lifecycle R*3.3 Close an app from foreground": { "req": [ { "state": { - "id": "1.2.2 & 3.5" + "id": "R*4.6" } }, { "history": { - "id": "1.1.2" + "id": "" } }, { "event": { - "id": ["1.2.1", "1.2.2"] + "id": "R*2.2.2 [onInactive event triggered]" } }, { "visible_check": { - "id": "1.2.3" + "id": "R.2.2.1" } } ] }, - "Close an app from background": { + "Lifecycle R*3.3 Close an app from background": { "req": [ - { - "state": { - "id": "1.2.2 & 3.5" - } - }, - { - "history": { - "id": "1.1.2" - } - }, - { - "event": { - "id": ["1.2.1", "1.2.2"] - } - }, - { - "visible_check": { - "id": "1.2.3" + { + "state": { + "id": "R*4.6" + } + }, + { + "history": { + "id": "" + } + }, + { + "event": { + "id": "R*2.2.2 [onInactive event triggered]" + } + }, + { + "visible_check": { + "id": "R.2.2.1" + } } - } - ] + ] }, - "No impact on closing app from inactive state": { + "Lifecycle R*3.3 No impact on closing app from inactive state": { "req": [ - { - "state": { - "id": "1.2.2 & 3.5" - } - }, - { - "history": { - "id": "1.1.2" - } - }, - { - "event": { - "id": ["1.2.1", "1.2.2"] + { + "state": { + "id": "R*4.6" + } + }, + { + "history": { + "id": "" + } + }, + { + "event": { + "id": "R*2.2.2 [onInactive event triggered]" + } + }, + { + "visible_check": { + "id": "R.2.2.1" + } } - }, - { - "visible_check": { - "id": "1.2.3" - } - } - ] + ] } }, "Lifecycle_Foreground": { - "Loading & Launching an App (initializing -> foreground)": { + "Lifecycle R*3.2 Loading & Launching an App (initializing -> foreground)": { "req": [ { "state": { - "id": "3.5" + "id": "R*4.6" } }, { @@ -1689,79 +1690,80 @@ }, { "event": { - "id": ["1.3.6", "1.3.6"] + "id": "R*2.3.6 [onForeground event triggered]" } }, { "visible_check": { - "id": "1.3.2" + "id": "R*2.3.2" } } ] }, - "Relaunch foreground app": { + "Lifecycle R*3.2.3 Relaunch foreground app": { "req": [ - { - "state": { - "id": "3.5" - } - }, - { - "history": { - "id": "" + { + "state": { + "id": "R*4.6" + } + }, + { + "history": { + "id": "" + } + }, + { + "event": { + "id": "R*2.3.6 [onForeground event triggered]" + } + }, + { + "visible_check": { + "id": "R*2.3.2" + } } - }, - { - "event": { - "id": ["1.3.6", "1.3.6"] - } - }, - { - "visible_check": { - "id": "1.3.2" - } - } - ] + ] }, - "App Launching another app": { + "Lifecycle R.3.2.1 App Launching another app": { "req": [ - { - "state": { - "id": "3.5" + { + "state": { + "id": "R*4.6" + } + }, + { + "history": { + "id": "" + } + }, + { + "event": { + "id": "R*2.3.6 [onForeground event triggered]" + } + }, + { + "visible_check": { + "id": "R*2.3.2" + } } - }, - { - "history": { - "id": "" - } - }, - { - "event": { - "id": ["1.3.6", "1.3.6"] - } - }, - { - "visible_check": { - "id": "1.3.2" - } - } - ] + ] } }, "Lifecycle_Initializing": { - "Lifecycle 2.3.2 Cannot Close an app from initializing": { + "Lifecycle R.3.3.4 Cannot Close an app from initializing": { "req": [ { "state": { "id": [ - "1.1.1", - "3.5" + "R*2.1.1", + "R*2.1.2", + "R*4.6" ] } }, { "history": { - "id": "1.1.2" + "id": "R*2.1.3" } }, { @@ -1773,7 +1775,7 @@ } }, "Lifecycle_Terminated": { - "Lifecycle 2.8 Terminate app in foreground State": { + "Lifecycle R*3.8 Terminate app in foreground State": { "req": [ { "state": { @@ -1792,7 +1794,7 @@ } ] }, - "Lifecycle 2.8 Terminate app in background State": { + "Lifecycle R*3.8 Terminate app in background State": { "req": [ { "state": { @@ -1811,7 +1813,7 @@ } ] }, - "Lifecycle 2.8 Terminate app in initializing State": { + "Lifecycle R*3.8 Terminate app in initializing State": { "req": [ { "state": { @@ -1830,7 +1832,7 @@ } ] }, - "Lifecycle 2.8 Terminate app in inactive State": { + "Lifecycle R*3.8 Terminate app in inactive State": { "req": [ { "state": { @@ -1849,7 +1851,7 @@ } ] }, - "Lifecycle 2.8 Terminate app in suspended State": { + "Lifecycle R*3.8 Terminate app in suspended State": { "req": [ { "state": { @@ -1868,7 +1870,7 @@ } ] }, - "Lifecycle 2.8 Terminate app in unloading State": { + "Lifecycle R*3.8 Terminate app in unloading State": { "req": [ { "state": { @@ -1889,19 +1891,20 @@ } }, "Lifecycle_Unloading": { - "Lifecycle 3.4.4 No impact of multiple Finished events while unloading": { + "Lifecycle R.4.5.4 No impact of multiple Finished events while unloading": { "req": [ { "state": { "id": [ - "1.5.1", - "3.5" + "R*2.5.1", + "R*2.5.2", + "R*4.6" ] } }, { "history": { - "id": "1.5.2" + "id": "R*2.5.3" } }, { @@ -1911,19 +1914,20 @@ } ] }, - "Lifecycle 2.7.1 Unloading from Inactive state": { + "Lifecycle R*3.7.3 Unloading from Inactive state": { "req": [ { "state": { "id": [ - "1.5.1", - "3.5" + "R*2.5.1", + "R*2.5.2", + "R*4.6" ] } }, { "history": { - "id": "1.5.2" + "id": "R*2.5.3" } }, { @@ -1933,19 +1937,20 @@ } ] }, - "Lifecycle 2.3.2 Cannot Close an Unloading App": { + "Lifecycle R.3.3.4 Cannot Close an Unloading App": { "req": [ { "state": { "id": [ - "1.5.1", - "3.5" + "R*2.5.1", + "R*2.5.2", + "R*4.6" ] } }, { "history": { - "id": "1.5.2" + "id": "R*2.5.3" } }, { @@ -1955,19 +1960,20 @@ } ] }, - "Lifecycle 3.4.3 finished from unloading state": { + "Lifecycle R*4.5.3 finished from unloading state": { "req": [ { "state": { "id": [ - "1.5.1", - "3.5" + "R*2.5.1", + "R*2.5.2", + "R*4.6" ] } }, { "history": { - "id": "1.5.2" + "id": "R*2.5.3" } }, { @@ -1977,19 +1983,20 @@ } ] }, - "Lifecycle 2.7.2 Should not unload from active state (foreground)": { + "Lifecycle R*3.7.2 Should not unload from active state (foreground)": { "req": [ { "state": { "id": [ - "1.5.1", - "3.5" + "R*2.5.1", + "R*2.5.2", + "R*4.6" ] } }, { "history": { - "id": "1.5.2" + "id": "R*2.5.3" } }, { @@ -1999,19 +2006,20 @@ } ] }, - "Lifecycle 2.5.1 Cannot Suspend Unloaded app": { + "Lifecycle R.3.5.3 Cannot Suspend Unloaded app": { "req": [ { "state": { "id": [ - "1.5.1", - "3.5" + "R*2.5.1", + "R*2.5.2", + "R*4.6" ] } }, { "history": { - "id": "1.5.2" + "id": "R*2.5.3" } }, { @@ -2021,19 +2029,20 @@ } ] }, - "Lifecycle 3.4.1 Should not finish from state other than unloading (initializing)": { + "Lifecycle R.4.5.4 Should not finish from state other than unloading (initializing)": { "req": [ { "state": { "id": [ - "1.5.1", - "3.5" + "R*2.5.1", + "R*2.5.2", + "R*4.6" ] } }, { "history": { - "id": "1.5.2" + "id": "R*2.5.3" } }, { @@ -2043,19 +2052,20 @@ } ] }, - "Lifecycle 3.4.1 Should not finish from state other than unloading (foreground)": { + "Lifecycle R.4.5.4 Should not finish from state other than unloading (foreground)": { "req": [ { "state": { "id": [ - "1.5.1", - "3.5" + "R*2.5.1", + "R*2.5.2", + "R*4.6" ] } }, { "history": { - "id": "1.5.2" + "id": "R*2.5.3" } }, { @@ -2065,19 +2075,20 @@ } ] }, - "Lifecycle 3.4.1 Should not finish from state other than unloading (background)": { + "Lifecycle R.4.5.4 Should not finish from state other than unloading (background)": { "req": [ { "state": { "id": [ - "1.5.1", - "3.5" + "R*2.5.1", + "R*2.5.2", + "R*4.6" ] } }, { "history": { - "id": "1.5.2" + "id": "R*2.5.3" } }, { @@ -2087,19 +2098,20 @@ } ] }, - "Lifecycle 3.4.1 Should not finish from state other than unloading (inactive)": { + "Lifecycle R.4.5.4 Should not finish from state other than unloading (inactive)": { "req": [ { "state": { "id": [ - "1.5.1", - "3.5" + "R*2.5.1", + "R*2.5.2", + "R*4.6" ] } }, { "history": { - "id": "1.5.2" + "id": "R*2.5.3" } }, { @@ -2109,19 +2121,20 @@ } ] }, - "Lifecycle 3.4.1 Should not finish from state other than unloading (suspended)": { + "Lifecycle R.4.5.4 Should not finish from state other than unloading (suspended)": { "req": [ { "state": { "id": [ - "1.5.1", - "3.5" + "R*2.5.1", + "R*2.5.2", + "R*4.6" ] } }, { "history": { - "id": "1.5.2" + "id": "R*2.5.3" } }, { @@ -2131,19 +2144,20 @@ } ] }, - "Lifecycle 2.3.2 Cannot Close an app that is not loaded": { + "Lifecycle R.3.3.4 Cannot Close an app that is not loaded": { "req": [ { "state": { "id": [ - "1.5.1", - "3.5" + "R*2.5.1", + "R*2.5.2", + "R*4.6" ] } }, { "history": { - "id": "1.5.2" + "id": "R*2.5.3" } }, { @@ -2155,11 +2169,11 @@ } }, "Lifecycle_Background": { - "Background an app from foreground": { + "Lifecycle R*3.4 Background an app from foreground": { "req": [ { "state": { - "id": "3.5" + "id": "R*4.6" } }, { @@ -2169,167 +2183,167 @@ }, { "event": { - "id": ["1.4.6", "1.3.6"] + "id": "R*2.4.6 [onBackground event triggered]" } }, { "visible_check": { - "id": "1.4.3" + "id": "R*2.4.2" } } ] }, - "Background an app from inactive": { + "Lifecycle R*3.4 Background an app from inactive": { "req": [ - { - "state": { - "id": "3.5" - } - }, - { - "history": { - "id": "" - } - }, - { - "event": { - "id": ["1.4.6", "1.3.6"] + { + "state": { + "id": "R*4.6" + } + }, + { + "history": { + "id": "" + } + }, + { + "event": { + "id": "R*2.4.6 [onBackground event triggered]" + } + }, + { + "visible_check": { + "id": "R*2.4.2" + } } - }, - { - "visible_check": { - "id": "1.4.3" - } - } - ] + ] }, - "Cannot Background app that is not loaded": { + "Lifecycle R.3.4.4 Cannot Background app that is not loaded": { "req": [ - { - "state": { - "id": "3.5" - } - }, - { - "history": { - "id": "" + { + "state": { + "id": "R*4.6" + } + }, + { + "history": { + "id": "" + } + }, + { + "event": { + "id": "R*2.4.6 [onBackground event triggered]" + } + }, + { + "visible_check": { + "id": "R*2.4.2" + } } - }, - { - "event": { - "id": ["1.4.6", "1.3.6"] - } - }, - { - "visible_check": { - "id": "1.4.3" - } - } - ] + ] }, - "Cannot Background a Backgrounded App": { + "Lifecycle R*3.4.3 Cannot Background a Backgrounded App": { "req": [ - { - "state": { - "id": "3.5" + { + "state": { + "id": "R*4.6" + } + }, + { + "history": { + "id": "" + } + }, + { + "event": { + "id": "R*2.4.6 [onBackground event triggered]" + } + }, + { + "visible_check": { + "id": "R*2.4.2" + } } - }, - { - "history": { - "id": "" - } - }, - { - "event": { - "id": ["1.4.6", "1.3.6"] - } - }, - { - "visible_check": { - "id": "1.4.3" - } - } - ] + ] }, - "Cannot Background app in Unloading state": { + "Lifecycle R.3.4.4 Cannot Background app in Unloading state": { "req": [ - { - "state": { - "id": "3.5" - } - }, - { - "history": { - "id": "" - } - }, - { - "event": { - "id": ["1.4.6", "1.3.6"] + { + "state": { + "id": "R*4.6" + } + }, + { + "history": { + "id": "" + } + }, + { + "event": { + "id": "R*2.4.6 [onBackground event triggered]" + } + }, + { + "visible_check": { + "id": "R*2.4.2" + } } - }, - { - "visible_check": { - "id": "1.4.3" - } - } - ] + ] }, - "Cannot background app from suspended state": { + "Lifecycle R.3.4.4 Cannot background app from suspended state": { "req": [ - { - "state": { - "id": "3.5" - } - }, - { - "history": { - "id": "" + { + "state": { + "id": "R*4.6" + } + }, + { + "history": { + "id": "" + } + }, + { + "event": { + "id": "R*2.4.6 [onBackground event triggered]" + } + }, + { + "visible_check": { + "id": "R*2.4.2" + } } - }, - { - "event": { - "id": ["1.4.6", "1.3.6"] - } - }, - { - "visible_check": { - "id": "1.4.3" - } - } - ] + ] }, - "Should not Background app in initializing state": { + "Lifecycle R.3.4.4 Should not Background app in initializing state": { "req": [ - { - "state": { - "id": "3.5" + { + "state": { + "id": "R*4.6" + } + }, + { + "history": { + "id": "" + } + }, + { + "event": { + "id": "R*2.4.6 [onBackground event triggered]" + } + }, + { + "visible_check": { + "id": "R*2.4.2" + } } - }, - { - "history": { - "id": "" - } - }, - { - "event": { - "id": ["1.4.6", "1.3.6"] - } - }, - { - "visible_check": { - "id": "1.4.3" - } - } - ] + ] } }, "Lifecycle_Suspended": { - "Lifecycle 1.6.1 App should subscribe to onSuspended listener regardless of capability": { + "Lifecycle R*1.6.1 App should subscribe to onSuspended listener regardless of capability": { "req": [ { "state": { - "id": "1.6.1" + "id": "R*4.6" } }, { @@ -2339,19 +2353,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.5.4 Suspend App from Inactive state": { + "Lifecycle R*2.6.5, R*3.5.3 Suspend App from Inactive state": { "req": [ { "state": { - "id": "2.5.4" + "id": "R*4.6" } }, { @@ -2361,19 +2372,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.2.4 Relaunch a previously Suspended app after Unsuspend": { + "Lifecycle R*2.2.8, R*3.2.3 Relaunch a previously Suspended app after Unsuspend": { "req": [ { "state": { - "id": "2.2.4" + "id": "R*4.6" } }, { @@ -2383,19 +2391,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.5.3 Cannot Suspend a suspended App": { + "Lifecycle R*3.5.2 Cannot Suspend a suspended App": { "req": [ { "state": { - "id": "2.5.3" + "id": "R*4.6" } }, { @@ -2405,19 +2410,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.5.1 Cannot Suspend a unloaded App": { + "Lifecycle R*2.5.3 Cannot Suspend a unloaded App": { "req": [ { "state": { - "id": "2.5.1" + "id": "R*4.6" } }, { @@ -2427,19 +2429,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.5.5 Cannot relaunch Suspended App": { + "Lifecycle R*3.2.5 Cannot relaunch Suspended App": { "req": [ { "state": { - "id": "2.5.5" + "id": "R*4.6" } }, { @@ -2449,19 +2448,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.5.2 Cannot Suspend foreground app": { + "Lifecycle R*2.6.5 Cannot Suspend foreground app": { "req": [ { "state": { - "id": "2.5.2" + "id": "R*4.6" } }, { @@ -2471,19 +2467,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.5.2 Cannot Suspend background app": { + "Lifecycle R*2.6.5 Cannot Suspend background app": { "req": [ { "state": { - "id": "2.5.2" + "id": "R*4.6" } }, { @@ -2493,19 +2486,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.3.2 Cannot Close Suspended App": { + "Lifecycle R.3.3.4 Cannot Close Suspended App": { "req": [ { "state": { - "id": "2.3.2" + "id": "R*4.6" } }, { @@ -2515,22 +2505,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.6, 2.6.2 Unsuspending App": { + "Lifecycle R*3.6 Unsuspending App": { "req": [ { "state": { - "id": [ - "2.6", - "2.6.2" - ] + "id": "R*4.6" } }, { @@ -2540,19 +2524,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.6.1 Cannot Unsuspend in initializing State": { + "Lifecycle R*3.6.3 Cannot Unsuspend in initializing State": { "req": [ { "state": { - "id": "2.6.1" + "id": "R*4.6" } }, { @@ -2562,19 +2543,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.6.1 Cannot Unsuspend in foreground State": { + "Lifecycle R*3.6.3 Cannot Unsuspend in foreground State": { "req": [ { "state": { - "id": "2.6.1" + "id": "R*4.6" } }, { @@ -2584,19 +2562,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.6.1 Cannot Unsuspend in background State": { + "Lifecycle R*3.6.3 Cannot Unsuspend in background State": { "req": [ { "state": { - "id": "2.6.1" + "id": "R*4.6" } }, { @@ -2606,19 +2581,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.6.1 Cannot Unsuspend in inactive State": { + "Lifecycle R*3.6.3 Cannot Unsuspend in inactive State": { "req": [ { "state": { - "id": "2.6.1" + "id": "R*4.6" } }, { @@ -2628,19 +2600,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.6.1 Cannot Unsuspend in unloading State": { + "Lifecycle R*3.6.3 Cannot Unsuspend in unloading State": { "req": [ { "state": { - "id": "2.6.1" + "id": "R*4.6" } }, { @@ -2650,19 +2619,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 4.3 Unsuspend unloaded app": { + "Lifecycle R*3.6.2 Unsuspend unloaded app": { "req": [ { "state": { - "id": "4.3" + "id": "R*4.6" } }, { @@ -2672,19 +2638,16 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] }, - "Lifecycle 2.5.6 Try to suspend an app that doesn't exist": { + "Lifecycle R.3.5.3 Try to suspend an app that doesn't exist": { "req": [ { "state": { - "id": "2.5.6" + "id": "R*4.6" } }, { @@ -2694,10 +2657,7 @@ }, { "event": { - "id": [ - "1.6.4", - "1.6.3" - ] + "id": "R*2.6.6 [onSuspended event triggered]" } } ] diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 55e9f06d..d811fe22 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -168,7 +168,7 @@ module.exports = { GLOBAL_EVENT_OBJECT_LIST: 'eventObjectList', HEALTH_CHECK_RETRIES: 'healthCheckRetries', HEXADECIMAL: 'hexaDecimal', - HISTORY_VALIDATION_REQ: 'Lifecycle history validation Req # ', + HISTORY_VALIDATION_REQ: 'Lifecycle history validation ', ID: 'id', INPUT: 'INPUT', INTENT: 'intent', @@ -208,7 +208,7 @@ module.exports = { LIFECYCLE_HISTORY_RESPONSE: 'Lifecycle history response fetched from application: ', LIFECYCLE_HISTORY_SCHEMA_PATH: 'schemas/lifecycleHistorySchema', LIFECYCLE_INTENT: 'Lifecycle intent sent to application: ', - LIFECYCLE_NOTIFICATION_GENERATED: 'Lifecycle events generated Req #', + LIFECYCLE_NOTIFICATION_GENERATED: 'Lifecycle events generated ', LIFECYCLE_STATE: 'Lifecycle.state', LIFECYCLE_STATES: { FOREGROUND: 'foreground', @@ -268,9 +268,9 @@ module.exports = { NO_MATCHED_RESPONSE: 'Unable to find the response for the current request', NO_PARAMS: 'noParam', NO_RESPONSE: 'No_Response', - NOTIFICATION_CONTENT_VALIDATION_REQ: 'Lifecycle notification content validation Req # ', - NOTIFICATION_EXISTS_REQ: 'Lifecycle notification exists Req # ', - NOTIFICATION_SCHEMA_VALIDATION_REQ: 'Lifecycle notification schema validation Req # ', + NOTIFICATION_CONTENT_VALIDATION_REQ: 'Lifecycle notification content validation ', + NOTIFICATION_EXISTS_REQ: 'Lifecycle notification exists ', + NOTIFICATION_SCHEMA_VALIDATION_REQ: 'Lifecycle notification schema validation ', NULL: 'null', NULL_RESPONSE: null, NULL_CHECK: 'Null Check requirement SKIPPED as schema validation is PASSED. ', @@ -287,6 +287,8 @@ module.exports = { PLATFORM_INVALID_RESPONSE_LOG: 'Platform returned response in invalid format, which could lead to failures in validations. Response must be an object', PLATFORM_NOT_SUPPORT_LOG: 'Platform does not support method', + PLATFORM_NOT_TRIGGER_EVENT: 'Platform MUST not trigger event ', + PLATFORM_TRIGGER_EVENT: 'Platform MUST trigger event ', PREREQUISITE_DATA: 'PreRequisiteData.json', SETUPCHECK: 'Setup Check', SETUPVALUES: 'external/setupValues.json', @@ -341,8 +343,8 @@ module.exports = { SKIPCONTENTVALIDATION: 'skipContentValidation', SKIPPED: 'SKIPPED', SOURCE: 'source', - STATE_CONTENT_VALIDATION_REQ: 'Lifecycle state content validation Req # ', - STATE_SCHEMA_VALIDATION_REQ: 'Lifecycle state schema validation Req #', + STATE_CONTENT_VALIDATION_REQ: 'Lifecycle state content validation ', + STATE_SCHEMA_VALIDATION_REQ: 'Lifecycle state schema validation ', STATIC_CONTENT_VALIDATION: 'staticContentValidation', STATUS_CODE: [0, 1, 2, 3], STAY: 'stay', @@ -416,7 +418,7 @@ module.exports = { FCS_DEFAULTTESTDATA_PATH: 'cypress/fixtures/defaultTestData.json', ENV_SETUP_STATUS: 'environmentLaunched', APP_LAUNCH_STATUS: 'appLaunched', - VISIBILITYSTATE_VALIDATION_REQ: 'Lifecycle visibility state validation Req # ', + VISIBILITYSTATE_VALIDATION_REQ: 'Lifecycle visibility state validation ', LIFECYCLE_VISIBILITYSTATE_SKIP_MESSAGE: 'App is not reachable to fetch visibility state. Skipping Visibility state validation.', VISIBILITYSTATE_FAILURE_FIX_LOG: diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 028a969e..59099a5a 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -186,7 +186,7 @@ Cypress.Commands.add('getDeviceVersion', () => { param: {}, action: CONSTANTS.ACTION_CORE.toLowerCase(), }; - + cy.log('Device version intent: ' + JSON.stringify(requestMap)); cy.sendMessagetoPlatforms(requestMap).then((response) => { try { if (response && response.result) { @@ -248,18 +248,15 @@ Cypress.Commands.add('getFireboltJsonData', () => { // Reading the path of the firebolt.json file from the environment variable based on the SDK version. if (envPlatformSdkVersion.includes(CONSTANTS.NEXT)) { FIREBOLT_SPECIFICATION_URL = UTILS.getEnvVariable(CONSTANTS.FIREBOLT_SPECIFICATION_NEXT_URL); - cy.log(`Using the next version of firebolt.json`); } else if (envPlatformSdkVersion.includes(CONSTANTS.PROPOSED)) { FIREBOLT_SPECIFICATION_URL = UTILS.getEnvVariable( CONSTANTS.FIREBOLT_SPECIFICATION_PROPOSED_URL ); - cy.log(`Using the proposed version of firebolt.json`); } else { FIREBOLT_SPECIFICATION_URL = UTILS.getEnvVariable(CONSTANTS.FIREBOLT_SPECIFICATION_URL).replace( CONSTANTS.LATEST, envPlatformSdkVersion ); - cy.log(`Using the ${envPlatformSdkVersion} version of firebolt.json`); } cy.request({ url: FIREBOLT_SPECIFICATION_URL, failOnStatusCode: false }).then((data) => { diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 960d58c3..36ac38e2 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -177,7 +177,10 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent response.report.result._history._value ) { const pretext = CONSTANTS.HISTORY_VALIDATION_REQ + lifecycleHistoryRequirementId.history.id; - cy.log(CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + JSON.stringify(response)); + cy.log( + CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + + JSON.stringify(response.report.result._history._value) + ); // Extract app history value const appHistory = response.report.result._history._value; // Lifecycle history validation @@ -206,20 +209,39 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent const appHistoryPrevious = UTILS.getEnvVariable(CONSTANTS.APP_LIFECYCLE_HISTORY); const appHistoryCount = appHistory.length - appHistoryPrevious.length; let pretext; - // If no lifecycle events expected, validate app history value is also empty - if (isEventsExpected == false || state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING) { + // If events are not expected and not received + if ( + (isEventsExpected == false && appHistoryCount == 0) || + state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING + ) { UTILS.assertWithRequirementLogs( - CONSTANTS.LIFECYCLE_NOTIFICATION_GENERATED + lifecycleEventRequirementId?.event?.id[0], - appHistoryCount >= 1, - false + CONSTANTS.PLATFORM_NOT_TRIGGER_EVENT + lifecycleEventRequirementId?.event?.id[0], + CONSTANTS.PASS, + CONSTANTS.PASS ); - } else { - // Else if lifecycle events expected, get app event data and app object event data + // If events are not expected but received + } else if (isEventsExpected == false && appHistoryCount > 0) { UTILS.assertWithRequirementLogs( - CONSTANTS.LIFECYCLE_NOTIFICATION_GENERATED + lifecycleEventRequirementId?.event?.id[0], - appHistoryCount >= 1, - true + CONSTANTS.PLATFORM_NOT_TRIGGER_EVENT + lifecycleEventRequirementId?.event?.id[0], + CONSTANTS.FAIL, + CONSTANTS.FAIL ); + } else { + // If events are expected and received + if (isEventsExpected == true && appHistoryCount > 0) { + UTILS.assertWithRequirementLogs( + CONSTANTS.PLATFORM_TRIGGER_EVENT + lifecycleEventRequirementId?.event?.id[0], + CONSTANTS.PASS, + CONSTANTS.PASS + ); + // If events are expected and not received + } else if (isEventsExpected == true && appHistoryCount == 0) { + UTILS.assertWithRequirementLogs( + CONSTANTS.PLATFORM_TRIGGER_EVENT + lifecycleEventRequirementId?.event?.id[0], + CONSTANTS.FAIL, + CONSTANTS.FAIL + ); + } for (let eventIndex = 1; eventIndex <= appHistoryCount; eventIndex++) { const newAppEvent = appHistory[appHistory.length - eventIndex]; let appObjectEvent; @@ -230,26 +252,19 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent appObjectEvent = appObjectStateItem.notification[0]; } // Perform schema and content validation of app event data against app object event data - pretext = - CONSTANTS.NOTIFICATION_SCHEMA_VALIDATION_REQ + - lifecycleEventRequirementId.event.id[1]; + let id = lifecycleEventRequirementId.event.id[1]; + let pretext = id === undefined ? ' : Schema ' : id + ' : Schema '; + UTILS.assertWithRequirementLogs( pretext, newAppEvent.schemaValidationStatus, CONSTANTS.PASS ); - pretext = - CONSTANTS.NOTIFICATION_CONTENT_VALIDATION_REQ + - lifecycleEventRequirementId.event.id[1]; - UTILS.assertWithRequirementLogs( - pretext, - newAppEvent.event.state, - appObjectEvent.message.state - ); + pretext = id === undefined ? ' : Content ' : id + ' : Content '; UTILS.assertWithRequirementLogs( pretext, - newAppEvent.event.previous, - appObjectEvent.message.previous + JSON.stringify(newAppEvent.event), + JSON.stringify(appObjectEvent.message) ); } } @@ -480,11 +495,11 @@ Cypress.Commands.add('setAppState', (state, appId) => { Cypress.Commands.add('fetchLifecycleHistory', (appId) => { try { cy.invokeLifecycleApi(appId, CONSTANTS.LIFECYCLE_APIS.HISTORY, '{}').then((response) => { - cy.log(CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + response); const historyValue = _.get(JSON.parse(response), 'report.result._history._value', null); _.isEmpty(historyValue) ? logger.info(CONSTANTS.APP_HISTORY_EMPTY) : Cypress.env(CONSTANTS.APP_LIFECYCLE_HISTORY, historyValue); + cy.log(CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + JSON.stringify(historyValue)); }); } catch (error) { assert(false, CONSTANTS.LIFECYCLE_HISTORY_FAILED + error); diff --git a/cypress/support/step_definitions/testSetup.js b/cypress/support/step_definitions/testSetup.js index 7cdc845f..fbb1de88 100644 --- a/cypress/support/step_definitions/testSetup.js +++ b/cypress/support/step_definitions/testSetup.js @@ -93,13 +93,14 @@ function destroyAppInstance(testType) { params, additionalParams ); + cy.log('Lifecycle close intent: ' + JSON.stringify(intentMessage)); try { cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((response) => { if (response != CONSTANTS.NO_RESPONSE) { - cy.log('App closed with reason: ' + closeReason, 'destroyAppInstance'); + fireLog.assert(false, 'App failed to unload, Reason: ' + closeReason); } else { - cy.log('Failed to close the 3rd party app: Response Not Recieved'); + cy.log('App unloaded', 'destroyAppInstance'); } cy.wait(5000); }); From 41a03ffdf5b6b0f4d8dbf4cd9312150a680536d2 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 11 Jun 2024 13:39:22 +0530 Subject: [PATCH 119/359] FIRECERT-2144-reporting changes --- Scripts/lifeCycleAppObject.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/lifeCycleAppObject.js b/Scripts/lifeCycleAppObject.js index f63005a8..f793f96d 100644 --- a/Scripts/lifeCycleAppObject.js +++ b/Scripts/lifeCycleAppObject.js @@ -41,7 +41,7 @@ class stateConfig { // If currentState and previousState are not equal and allowed state transition supports currentState, generate an event and push to notification list if (stateTransition.includes(currentState) && currentState != previousState) { - const message = { previous: previousState, state: currentState, }; + const message = { previous: previousState, state: currentState }; logger.info('Lifecycle appObject transition: ' + JSON.stringify(message)); const tempNotification = new notificationConfig(message); this.notification.push(tempNotification); From 2164f78a03bb2089c36e73d19c8c6553712ed1b2 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 11 Jun 2024 13:44:40 +0530 Subject: [PATCH 120/359] FIRECERT-2144-reporting changes --- cypress/support/cypress-commands/lifecycle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 36ac38e2..094f1a35 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -252,7 +252,7 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent appObjectEvent = appObjectStateItem.notification[0]; } // Perform schema and content validation of app event data against app object event data - let id = lifecycleEventRequirementId.event.id[1]; + const id = lifecycleEventRequirementId.event.id[1]; let pretext = id === undefined ? ' : Schema ' : id + ' : Schema '; UTILS.assertWithRequirementLogs( From 1456bd0d0b02c5118adb9d338f313457378d483d Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Tue, 11 Jun 2024 19:25:20 +0530 Subject: [PATCH 121/359] modified the resolveAtRuntime to return parsing logic as function --- cypress/support/cypress-support/src/utils.js | 94 ++++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 63ffd471..46fdf4d2 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -755,60 +755,60 @@ global.fireLog = fireLog; * "manage_closedcaptions.setFontSize" * 1.5 */ -const resolveAtRuntime = (input) => { - const functions = { - uppercaseFirstChar: function (str) { - return str.charAt(0).toUpperCase() + str.slice(1); - }, - lowercaseFirstChar: function (str) { - return str.charAt(0).toLowerCase() + str.slice(1); - }, - }; +global.resolveAtRuntime = function (input) { + return function () { + const functions = { + uppercaseFirstChar: function (str) { + return str.charAt(0).toUpperCase() + str.slice(1); + }, + lowercaseFirstChar: function (str) { + return str.charAt(0).toLowerCase() + str.slice(1); + }, + }; + + // Function to check the occurence of the pattern and updating the actual value + function replacingPatternOccurenceWithValue(text) { + return text.replace(/{{(.*?)}}/g, (match, pattern) => { + let functionName; + + // Separating the function name from the pattern, if it exists,. + if (pattern.includes('.')) { + functionName = pattern.split('.')[1]; + pattern = pattern.split('.')[0]; + } - // Function to check the occurence of the pattern and updating the actual value - function replacingPatternOccurenceWithValue(text) { - return text.replace(/{{(.*?)}}/g, (match, pattern) => { - let functionName; + // If a function name is present in the pattern, call the function with pattern content as input. + // Reading the pattern content from the runtime environment variable + if (functionName && functions.hasOwnProperty(functionName)) { + return functions[functionName](getEnvVariable('runtime')[pattern] || match); + } else { + return getEnvVariable('runtime')[pattern] || match; + } + }); + } - // Separating the function name from the pattern, if it exists,. - if (pattern.includes('.')) { - functionName = pattern.split('.')[1]; - pattern = pattern.split('.')[0]; + if (typeof input === CONSTANTS.TYPE_STRING) { + // Returning the actual pattern content for each occurrence of "{{" + if (input.includes('{{')) { + return replacingPatternOccurenceWithValue(input); } - - // If a function name is present in the pattern, call the function with pattern content as input. - // Reading the pattern content from the runtime environment variable - if (functionName && functions.hasOwnProperty(functionName)) { - return functions[functionName](getEnvVariable(runtime)[pattern] || match); - } else { - return getEnvVariable(runtime)[pattern] || match; + // If input not having "{{", returning content from runtime environment variable. + else if (!input.includes('{{')) { + return getEnvVariable('runtime')[input] || input; } - }); - } - - if (typeof input === CONSTANTS.TYPE_STRING) { - // Returning the actual pattern content for each occurrence of "{{" - if (input.includes('{{')) { - return replacingPatternOccurenceWithValue(input); - } - // If input not having "{{", returning content from runtime environment variable. - else if (!input.includes('{{')) { - return getEnvVariable(runtime).input || input; + } else if (Array.isArray(input) && input.length > 0) { + // input is an array; iterating through each element, it updates the actual value for that pattern if there is an occurrence of "{{". + return input.map((element) => { + if (element.includes('{{')) { + return replacingPatternOccurenceWithValue(element); + } + }); + } else { + logger.info(`Passed input - ${input} must be an array or a string.`); } - } else if (Array.isArray(input) && input.length > 0) { - // input is an array; iterating through each element, it updates the actual value for that pattern if there is an occurrence of "{{". - return input.map((element) => { - if (element.includes('{{')) { - return replacingPatternOccurenceWithValue(element); - } - }); - } else { - logger.info(`Passed input ${input} must be an array or a string.`); - } + }; }; -global.resolveAtRuntime = resolveAtRuntime; - module.exports = { replaceJsonStringWithEnvVar, createIntentMessage, From 242d40b51c87c0c04f3114dffedf12425ede7768 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Wed, 12 Jun 2024 10:50:47 +0530 Subject: [PATCH 122/359] 2108 - re-arrange TC --- cypress/TestCases/FireboltCertification/Advertising.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/TestCases/FireboltCertification/Advertising.feature b/cypress/TestCases/FireboltCertification/Advertising.feature index 65d2639b..91868282 100644 --- a/cypress/TestCases/FireboltCertification/Advertising.feature +++ b/cypress/TestCases/FireboltCertification/Advertising.feature @@ -16,8 +16,8 @@ Feature: Advertising Examples: | Scenario | API_Key | Method_Validation_key | Event_Validation_key | - | Disable limitAdTracking | disable limitAdTracking | Advertising policy limitAdTracking as true | onPolicyChanged for advertising limitAdTracking with true | | Enable limitAdTracking | enable limitAdTracking | Advertising policy limitAdTracking as false | onPolicyChanged for advertising limitAdTracking with false | + | Disable limitAdTracking | disable limitAdTracking | Advertising policy limitAdTracking as true | onPolicyChanged for advertising limitAdTracking with true | @Advertising @coreSDK @sdk @transport Scenario Outline: Advertising.policy - Positive Scenario: From 4097bc289df71019f2a4f006ee71724fa119591b Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Wed, 12 Jun 2024 11:05:26 +0530 Subject: [PATCH 123/359] FIRECERT-1760-RpcOnly Added rpc-Only TCs --- ...AcknowledgeChallengeManage_RpcOnly.feature | 30 ++++++++ .../Manage/KeyboardManage_RpcOnly.feature | 37 ++++++++++ .../Manage/ProfileManage_RpcOnly.feature | 27 ++++++++ cypress/fixtures/fireboltCalls/keyboard.json | 69 +++++++++++++++++++ cypress/fixtures/fireboltCalls/profile.json | 21 ++++++ .../fixtures/fireboltCalls/usergrants.json | 22 ++++++ cypress/fixtures/modules/keyboard.json | 63 +++++++++++++++++ cypress/fixtures/modules/profile.json | 19 +++++ cypress/fixtures/modules/usergrants.json | 19 +++++ 9 files changed, 307 insertions(+) create mode 100644 cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature create mode 100644 cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature create mode 100644 cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature diff --git a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature new file mode 100644 index 00000000..3f71b98b --- /dev/null +++ b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature @@ -0,0 +1,30 @@ + Feature: AcknowledgeChallenge_Manage_RpcOnly + + # Note: Reboot required after running this feature file + + @transport @ripple + Scenario: AcknowledgeChallenge.onRequestChallenge - Positive Scenario: Validating rpc method + Given the environment has been set up for 'AcknowledgeChallenge-rpc-Only' tests + And 3rd party 'certification' app is launched + And Framework registers 'ackchallenge' test provider + And User set response for 'set acknowledge granted' + When 1st party app registers for the 'acknowledgeChallenge onRequestChallenge manage' event using the 'Firebolt' API + When '3rd party app' invokes the 'Firebolt' API to 'get localization countryCode' + And Fetch response for 'acknowledgeChallenge onRequestChallenge' event + And 1st party app invokes the 'Firebolt' API to 'get acknowledgeChallenge challengeFocus' + And 1st party app invokes the 'Firebolt' API to 'get acknowledgeChallenge challengeResponse' + And Fetch response for 'get localization countryCode' method + Then 'Firebolt' platform responds with 'expected localization countryCode' + + @transport @ripple + Scenario: AcknowledgeChallenge.challengeError - Negative Scenario: Validating rpc method + Given the environment has been set up for 'AcknowledgeChallenge-rpc-Only' tests + And 3rd party 'certification' app is launched + And Framework registers 'ackchallenge' test provider + And User set response for 'set acknowledge granted' + When 1st party app registers for the 'acknowledgeChallenge onRequestChallenge manage' event using the 'Firebolt' API + When '3rd party app' invokes the 'Firebolt' API to 'get localization countryCode' + And Fetch response for 'acknowledgeChallenge onRequestChallenge' event + And 1st party app invokes the 'Firebolt' API to 'get acknowledgeChallenge challengeError' + And Fetch response for 'get localization countryCode' method + Then 'Firebolt' platform responds with 'expected localization countryCode' \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature new file mode 100644 index 00000000..1ca11615 --- /dev/null +++ b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature @@ -0,0 +1,37 @@ +Feature: Keyboard_Manage_RpcOnly + + # Note: Reboot required after running this feature file + + @transport @ripple + Scenario Outline: Keyboard. - Positive Scenario: Validating rpc method + Given the environment has been set up for 'Keyboard-rpc-Only' tests + And 3rd party 'certification' app is launched + When 1st party app registers for the '' event using the 'Firebolt' API + When '3rd party app' invokes the 'Firebolt' API to '' + And Fetch response for '' event + And 1st party app invokes the 'Firebolt' API to '' + And 1st party app invokes the 'Firebolt' API to '' + And Fetch response for '' method + Then 'Firebolt' platform responds with '' + Examples: + | Scenario | ManageEventName | EventName | MethodName | MethodParam | FocusMethod | ResponseMethod | MethodResponse | + | onRequestEmail | keyboard onRequestEmail manage | keyboard onRequestEmail | keyboard email | prompt the user for their email address with signin type | get keyboard emailFocus | get keyboard emailResponse | entered email address | + | onRequestStandard | keyboard onRequestStandard manage | keyboard onRequestStandard | keyboard standard | prompt the user for their standard platform | get keyboard standardFocus | get keyboard standardResponse | entered username | + | onRequestPassword | keyboard onRequestPassword manage | keyboard onRequestPassword | keyboard password | prompt the user for their password | get keyboard passwordFocus | get keyboard passwordResponse | entered password | + + @transport @ripple + Scenario Outline: Keyboard. - Negative Scenario: Validating rpc method + Given the environment has been set up for 'Keyboard-rpc-Only' tests + And 3rd party 'certification' app is launched + When 1st party app registers for the '' event using the 'Firebolt' API + When '3rd party app' invokes the 'Firebolt' API to '' + And Fetch response for '' event + And 1st party app invokes the 'Firebolt' API to '' + And Fetch response for '' method + Then 'Firebolt' platform responds with '' + + Examples: + | Scenario | ManageEventName | EventName | MethodName | MethodParam | FocusMethod | MethodResponse | + | Validating rpc method | keyboard onRequestEmail manage | keyboard onRequestEmail | keyboard email | prompt the user for their email address with signin type | get keyboard emailError | entered email address | + | Validating rpc method | keyboard onRequestStandard manage | keyboard onRequestStandard | keyboard standard | prompt the user for their username | get keyboard passwordError | entered username | + | Validating rpc method | keyboard onRequestPassword manage | keyboard onRequestPassword | keyboard password | prompt the user for their password | get keyboard standardError | entered password | \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature new file mode 100644 index 00000000..c8beef43 --- /dev/null +++ b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature @@ -0,0 +1,27 @@ +Feature: Profile_Manage_RpcOnly + + # Note: Reboot required after running this feature file + + @transport @ripple + Scenario: PinChallenge.onRequestChallenge - Positive Scenario: Validating rpc method + Given the environment has been set up for 'PinChallenge-rpc-Only' tests + And 3rd party 'certification' app is launched + When 1st party app registers for the 'pinChallenge onRequestChallenge manage' event using the 'Firebolt' API + When '3rd party app' invokes the 'Firebolt' API to 'profile approvePurchase' + And Fetch response for 'pinChallenge onRequestChallenge' event + And 1st party app invokes the 'Firebolt' API to 'get pinChallenge challengeFocus' + And 1st party app invokes the 'Firebolt' API to 'get pinChallenge challengeResponse' + And Fetch response for 'profile approvePurchase' method + Then 'Firebolt' platform responds with 'true for profile approvepurchase' + + + @transport @ripple + Scenario: PinChallenge.challengeError - Negative Scenario: Validating rpc method + Given the environment has been set up for 'PinChallenge-rpc-Only' tests + And 3rd party 'certification' app is launched + When 1st party app registers for the 'pinChallenge onRequestChallenge manage' event using the 'Firebolt' API + When '3rd party app' invokes the 'Firebolt' API to 'profile approvePurchase' + And Fetch response for 'pinChallenge onRequestChallenge' event + And 1st party app invokes the 'Firebolt' API to 'get pinChallenge challengeError' + And Fetch response for 'profile approvePurchase' method + Then 'Firebolt' platform responds with 'true for profile approvepurchase' \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/keyboard.json b/cypress/fixtures/fireboltCalls/keyboard.json index 5cec34df..5b9c0bcc 100644 --- a/cypress/fixtures/fireboltCalls/keyboard.json +++ b/cypress/fixtures/fireboltCalls/keyboard.json @@ -98,5 +98,74 @@ "KEYBOARD_EMAIL": { "method": "keyboard.email", "params": "KEYBOARD_EMAIL" + }, + "KEYBOARD_ONREQUESTEMAIL_MANAGE":{ + "method": "manage_keyboard.onRequestEmail" + }, + "KEYBOARD_ONREQUESTSTANDARD_MANAGE":{ + "method": "manage_keyboard.onRequestStandard" + }, + "KEYBOARD_ONREQUESTPASSWORD_MANAGE":{ + "method": "manage_keyboard.onRequestPassword" + }, + "KEYBOARD_ONREQUESTEMAIL":{ + "method": "keyboard.onRequestEmail" + }, + "KEYBOARD_ONREQUESTSTANDARD":{ + "method": "keyboard.onRequestStandard" + }, + "KEYBOARD_ONREQUESTPASSWORD":{ + "method": "keyboard.onRequestPassword" + }, + "GET_KEYBOARD_EMAILFOCUS":{ + "method": "keyboard.emailFocus", + "params": "KEYBOARD_EMAILFOCUS" + }, + "GET_KEYBOARD_STANDARDFOCUS":{ + "method": "keyboard.standardFocus", + "params": "KEYBOARD_STANDARDFOCUS" + }, + "GET_KEYBOARD_PASSWORDFOCUS":{ + "method": "keyboard.passwordFocus", + "params": "KEYBOARD_PASSWORDFOCUS" + }, + "GET_KEYBOARD_EMAILRESPONSE":{ + "method": "keyboard.emailResponse", + "params": "KEYBOARD_EMAILRESPONSE" + }, + "GET_KEYBOARD_STANDARDRESPONSE":{ + "method": "keyboard.standardResponse", + "params": "KEYBOARD_STANDARDRESPONSE" + }, + "GET_KEYBOARD_PASSWORDRESPONSE":{ + "method": "keyboard.passwordResponse", + "params": "KEYBOARD_PASSWORDRESPONSE" + }, + "ENTERED_EMAIL_ADDRESS": { + "method": "keyboard.email", + "validationJsonPath": "result", + "content": "KEYBOARD_EMAIL" + }, + "ENTERED_USERNAME": { + "method": "keyboard.standard", + "validationJsonPath": "result", + "content": "KEYBOARD_STANDARD" + }, + "ENTERED_PASSWORD": { + "method": "keyboard.password", + "validationJsonPath": "result", + "content": "KEYBOARD_PASSWORD" + }, + "GET_KEYBOARD_EMAILERROR":{ + "method": "keyboard.emailError", + "params": "KEYBOARD_EMAILERROR" + }, + "GET_KEYBOARD_STANDARDERROR":{ + "method": "keyboard.standardError", + "params": "KEYBOARD_STANDARDERROR" + }, + "GET_KEYBOARD_PASSWORDERROR":{ + "method": "keyboard.passwordError", + "params": "KEYBOARD_PASSWORDERROR" } } \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/profile.json b/cypress/fixtures/fireboltCalls/profile.json index b1497711..a5dce0f8 100644 --- a/cypress/fixtures/fireboltCalls/profile.json +++ b/cypress/fixtures/fireboltCalls/profile.json @@ -42,5 +42,26 @@ "validationJsonPath": "result", "content": "INVALID_REQUEST", "expectingError": true + }, + "PINCHALLENGE_ONREQUESTCHALLENGE_MANAGE":{ + "method": "manage_pinChallenge.onRequestChallenge" + }, + "PROFILE_APPROVEPURCHASE":{ + "method": "profile.approvePurchase" + }, + "PINCHALLENGE_ONREQUESTCHALLENGE":{ + "method": "pinChallenge.onRequestChallenge" + }, + "GET_PINCHALLENGE_CHALLENGEFOCUS":{ + "method": "pinChallenge.challengeFocus", + "params": "PINCHALLENGE_CHALLENGEFOCUS_PARAMS" + }, + "GET_PINCHALLENGE_CHALLENGERESPONSE":{ + "method": "pinChallenge.challengeResponse", + "params": "PINCHALLENGE_CHALLENGERESPONSE_PARAMS" + }, + "GET_PINCHALLENGE_CHALLENGEERROR":{ + "method": "pinChallenge.challengeError", + "params": "PINCHALLENGE_CHALLENGE_ERROR_PARAMS" } } \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/usergrants.json b/cypress/fixtures/fireboltCalls/usergrants.json index 33fb0fc9..2713953f 100644 --- a/cypress/fixtures/fireboltCalls/usergrants.json +++ b/cypress/fixtures/fireboltCalls/usergrants.json @@ -78,5 +78,27 @@ "CLEAR_APP_LEVEL_DATA_APP_USAGE_CAPABILITY_WITH_ROLE_USE":{ "method": "manage_usergrants.clear", "params": "USERGRANTS_CLEAR_APP_LEVEL_DATA_APP_USAGE_ROLE_USE" + }, + "SET_USERGRANTS_ACKNOWLEDGECHALLENGE_GRANTED_RESPONSE":{ + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_APP_LEVEL_DATA_APP_USAGE_ROLE_USE" + }, + "ACKNOWLEDGECHALLENGE_ONREQUESTCHALLENGE_MANAGE":{ + "method": "manage_acknowledgeChallenge.onRequestChallenge" + }, + "ACKNOWLEDGECHALLENGE_ONREQUESTCHALLENGE":{ + "method": "acknowledgeChallenge.onRequestChallenge" + }, + "GET_ACKNOWLEDGECHALLENGE_CHALLENGEFOCUS":{ + "method": "acknowledgeChallenge.challengeFocus", + "params": "ACKNOWLEDGECHALLENGE_CHALLENGEFOCUS_PARAMS" + }, + "GET_ACKNOWLEDGECHALLENGE_CHALLENGERESPONSE":{ + "method": "acknowledgeChallenge.challengeResponse", + "params": "ACKNOWLEDGECHALLENGE_CHALLENGERESPONSE_PARAMS" + }, + "GET_ACKNOWLEDGECHALLENGE_CHALLENGEERROR":{ + "method": "acknowledgeChallenge.challengeError", + "params": "ACKNOWLEDGECHALLENGE_CHALLENGEERROR_PARAMS" } } \ No newline at end of file diff --git a/cypress/fixtures/modules/keyboard.json b/cypress/fixtures/modules/keyboard.json index 61f93032..38f80b86 100644 --- a/cypress/fixtures/modules/keyboard.json +++ b/cypress/fixtures/modules/keyboard.json @@ -35,5 +35,68 @@ }, "PASSWORD": { "result": "Abc##123" + }, + "EMAILFOCUS": { + "CYPRESSENV-correlationId": "123" + }, + "STANDARDFOCUS": { + "CYPRESSENV-correlationId": "123" + }, + "PASSWORDFOCUS": { + "CYPRESSENV-correlationId": "123" + }, + "EMAILRESPONSE": { + "CYPRESSENV-correlationId": "123", + "result": { + "text": "email@address.com", + "canceled": false + } + }, + "STANDARDRESPONSE": { + "CYPRESSENV-correlationId": "123", + "result": { + "text": "email@address.com", + "canceled": false + } + }, + "PASSWORDRESPONSE": { + "CYPRESSENV-correlationId": "123", + "result": { + "text": "Abc##123", + "canceled": false + } + }, + "KEYBOARD_EMAILERROR": { + "error": { + "CYPRESSENV-correlationId": "123", + "result": { + "code": 1, + "message": "Error" + } + } + }, + "KEYBOARD_STANDARDERROR": { + "error": { + "CYPRESSENV-correlationId": "123", + "result": { + "name": "error", + "value": { + "CYPRESSENV-correlationId": "123", + "result": { + "code": 1, + "message": "Error" + } + } + } + } + }, + "KEYBOARD_PASSWORDERROR": { + "error": { + "CYPRESSENV-correlationId": "123", + "result": { + "code": 1, + "message": "Error" + } + } } } \ No newline at end of file diff --git a/cypress/fixtures/modules/profile.json b/cypress/fixtures/modules/profile.json index 4ab00859..e363e1b8 100644 --- a/cypress/fixtures/modules/profile.json +++ b/cypress/fixtures/modules/profile.json @@ -1,5 +1,24 @@ { "FLAGS": { "userExperience": "1001" + }, + "PINCHALLENGE_CHALLENGEFOCUS_PARAMS": { + "CYPRESSENV-correlationId": "123" + }, + "PINCHALLENGE_CHALLENGERESPONSE_PARAMS": { + "CYPRESSENV-correlationId": "123", + "result": { + "granted": true, + "reason": "correctPin" + } + }, + "PINCHALLENGE_CHALLENGE_ERROR_PARAMS": { + "error": { + "CYPRESSENV-correlationId": "123", + "result": { + "code": 1, + "message": "Error" + } + } } } \ No newline at end of file diff --git a/cypress/fixtures/modules/usergrants.json b/cypress/fixtures/modules/usergrants.json index 9bcc79da..e12b3008 100644 --- a/cypress/fixtures/modules/usergrants.json +++ b/cypress/fixtures/modules/usergrants.json @@ -67,5 +67,24 @@ }, "DEVICE_ID": { "capability": "xrn:firebolt:capability:device:id" + }, + "ACKNOWLEDGECHALLENGE_CHALLENGEFOCUS_PARAMS": { + "CYPRESSENV-correlationId": "123" + }, + "ACKNOWLEDGECHALLENGE_CHALLENGERESPONSE_PARAMS": { + "CYPRESSENV-correlationId": "123", + "result": { + "granted": true, + "reason": "correctPin" + } + }, + "ACKNOWLEDGECHALLENGE_CHALLENGE_ERROR_PARAMS": { + "error": { + "CYPRESSENV-correlationId": "123", + "result": { + "code": 1, + "message": "Error" + } + } } } \ No newline at end of file From 95fcdb536e5864efb8cf86da1287e9e127bbfb5f Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Wed, 12 Jun 2024 12:12:17 +0530 Subject: [PATCH 124/359] FIRECERT-1819 UserInterest and keyboard changes --- .../FireboltCertification/Keyboard.feature | 2 +- .../UserInterest.feature | 130 ++ .../Sanity/DiscoverySDKSuite.feature | 9 + cypress/fixtures/fireboltCalls/content.json | 5 + .../fixtures/fireboltCalls/userinterest.json | 598 ++++++++ cypress/fixtures/modules/discovery.json | 1342 ++++++++++++++++- .../objects/moduleReqId/moduleReqId.json | 72 + cypress/support/constants/constants.js | 3 +- 8 files changed, 2157 insertions(+), 4 deletions(-) create mode 100644 cypress/TestCases/FireboltCertification/UserInterest.feature create mode 100644 cypress/TestCases/Sanity/DiscoverySDKSuite.feature create mode 100644 cypress/fixtures/fireboltCalls/content.json create mode 100644 cypress/fixtures/fireboltCalls/userinterest.json diff --git a/cypress/TestCases/FireboltCertification/Keyboard.feature b/cypress/TestCases/FireboltCertification/Keyboard.feature index 1d599afd..2d42e67b 100644 --- a/cypress/TestCases/FireboltCertification/Keyboard.feature +++ b/cypress/TestCases/FireboltCertification/Keyboard.feature @@ -48,7 +48,7 @@ Feature: Keyboard Then 'Firebolt' platform responds with '' Examples: - | Mehtod | Scenario | API_Key | Validation_key | + | Method | Scenario | API_Key | Validation_key | | email | passing email type as invalid string | prompt the user for their email with invalid type as string | invalid parameter for email | | email | passing email type as integer | prompt the user for their email with invalid type as integer | invalid parameter for email | | email | passing email type as empty | prompt the user for their email with type as empty | invalid parameter for email | diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature new file mode 100644 index 00000000..3a909fce --- /dev/null +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -0,0 +1,130 @@ +Feature: UserInterest + + @initialization + Scenario: Launch FCA for 'Userinterest' + Given the environment has been set up for 'Userinterest' tests + And 3rd party 'certification' app is launched + + @coreSDK @sdk @transport @userinterest + Scenario Outline: Discovery.userInterest - Positive Scenario: In-app UX - Notify userInterest with type + When 1st party app registers for the 'Content onUserInterest' event using the 'Firebolt' API + And '3rd party app' invokes the 'Firebolt' API to 'notify userInterest with ' + Then 'Firebolt' platform responds with 'null for discovery userInterest' + And 'Firebolt' platform triggers to '1st party app' event 'onUserInterest with ' + + Examples: + | Scenario | userInterestData | Event_Content | + | interest & reason playlist with program entity | type interest and reason playlist with program entity | type interest reason playlist | + | disinterest & reason playlist with program entity | type disinterest and reason playlist with program entity | type disinterest reason playlist | + | interest & reason playlist with channel streaming entity | type interest and reason playlist with channel streaming entity | type interest reason playlist channel | + | disinterest & reason playlist with channel streaming entity | type disinterest and reason playlist with channel streaming entity | type disinterest reason playlist channel | + | interest & reason playlist with channel overTheAir entity | type interest and reason playlist with channel overTheAir entity | type interest reason playlist overTheAir | + | disinterest & reason playlist with channel overTheAir entity | type disinterest and reason playlist with channel overTheAir entity | type disinterest reason playlist overTheAir | + | interest & reason playlist with program episode entity | type interest and reason playlist with program episode entity | type interest reason playlist program episode | + | disinterest & reason playlist with program episode entity | type disinterest and reason playlist with program episode entity | type disinterest reason playlist program episode | + | interest & reason playlist with program additional concert entity | type interest and reason playlist with program additional concert entity | type interest reason playlist additional concert entity | + | disinterest & reason playlist with program additional concert entity | type disinterest and reason playlist with program additional concert entity | type disinterest reason playlist additional concert entity | + | interest & reason playlist with program additional sportingEvent entity | type interest and reason playlist with program additional sportingEvent entity | type interest reason playlist additional sportingEvent entity | + | disinterest & reason playlist with program additional sportingEvent entity | type disinterest and reason playlist with program additional sportingEvent entity | type disinterest reason playlist additional sportingEvent entity | + | interest & reason playlist with music song entity | type interest and reason playlist with music song entity | type interest reason playlist music song entity | + | disinterest & reason playlist with music song entity | type disinterest and reason playlist with music song entity | type disinterest reason playlist music song entity | + | interest & reason playlist with music album entity | type interest and reason playlist with music album entity | type interest reason playlist music album entity | + | disinterest & reason playlist with music album entity | type disinterest and reason playlist with music album entity | type disinterest reason playlist music album entity | + | interest & reason reaction with program entity | type interest and reason reaction with program entity | type interest reason reaction program entity | + | disinterest & reason reaction with program entity | type disinterest and reason reaction with program entity | type disinterest reason reaction program entity | + | interest & reason reaction with channel streaming entity | type interest and reason reaction with channel streaming entity | type interest reason reaction channel streaming entity | + | disinterest & reason reaction with channel streaming entity | type disinterest and reason reaction with channel streaming entity | type disinterest reason reaction channel streaming entity | + | interest & reason reaction with program additional preview entity | type interest and reason reaction with program additional preview entity | type interest reason reaction program additional preview entity | + | disinterest & reason reaction with program additional preview entity | type disinterest and reason reaction with program additional preview entity | type disinterest reason reaction program additional preview entity | + | interest & reason reaction with program additional advertisement entity | type interest and reason reaction with program additional advertisement entity | type interest reason reaction program additional advertisement entity | + | disinterest & reason reaction with program additional advertisement entity | type disinterest and reason reaction with program additional advertisement entity | type disinterest reason reaction program additional advertisement entity | + | interest & reason reaction with program additional musicVideo entity | type interest and reason reaction with program additional musicVideo entity | type interest reason reaction program additional musicVideo entity | + | disinterest & reason reaction with program additional musicVideo entity | type disinterest and reason reaction with program additional musicVideo entity | type disinterest reason reaction program additional musicVideo entity | + | interest & reason reaction with program additional minisode entity | type interest and reason reaction with program additional minisode entity | type interest reason reaction program additional minisode entity | + | disinterest & reason reaction with program additional minisode entity | type disinterest and reason reaction with program additional minisode entity | type disinterest reason reaction program additional minisode entity | + | interest & reason reaction with program additional extra entity | type interest and reason reaction with program additional extra entity | type interest reason reaction program additional extra entity | + | disinterest & reason reaction with program additional extra entity | type disinterest and reason reaction with program additional extra entity | type disinterest reason reaction program additional extra entity | + | interest & reason reaction with program tvepisode entity with seriesId and seasonId | type interest and reason reaction with program tvepisode entity with seriesId and seasonId | type interest reason reaction program tvepisode entity with seriesId and seasonId | + | disinterest & reason reaction with program tvepisode entity with seriesId and seasonId | type disinterest and reason reaction with program tvepisode entity with seriesId and seasonId | type disinterest reason reaction program tvepisode entity with seriesId and seasonId | + | interest & reason recording with program entity | type interest and reason recording with program entity | type interest reason recording program entity | + | disinterest & reason recording with program entity | type disinterest and reason recording with program entity | type disinterest reason recording program entity | + | interest & reason recording with channel streaming entity | type interest and reason recording with channel streaming entity | type interest reason recording channel streaming entity | + | disinterest & reason recording with channel streaming entity | type disinterest and reason recording with channel streaming entity | type disinterest reason recording channel streaming entity | + | interest & reason recording with channel overTheAir entity | type interest and reason recording with channel overTheAir entity | type interest reason recording channel overTheAir entity | + | disinterest & reason recording with channel overTheAir entity | type disinterest and reason recording with channel overTheAir entity | type disinterest reason recording channel overTheAir entity | + | interest & reason recording with program episode entity | type interest and reason recording with program episode entity | type interest reason recording program episode entity | + | disinterest & reason recording with program episode entity | type disinterest and reason recording with program episode entity | type disinterest reason recording program episode entity | + | interest & reason recording with program season entity | type interest and reason recording with program season entity | type interest reason recording program season entity | + | disinterest & reason recording with program season entity | type disinterest and reason recording with program season entity | type disinterest reason recording program season entity | + + + @coreSDK @sdk @transport @userinterest + Scenario Outline: Discovery.userInterest - Negative Scenario: expecting error + When '3rd party app' invokes the 'Firebolt' API to 'notify userInterest ' + Then 'Firebolt' platform responds with 'invalid params for discovery userInterest' + + Examples: + | Scenario | Param | + | Empty param | without any params | + | Without Interest type | without interest type | + | Invalid Interest type - integer params | with numeric interestType | + | Invalid Interest type - test params | with string interestType | + | Invalid Interest type - boolean params | with boolean interestType | + | Invalid channelType in channel entity | with invalid channelType in channel entity | + | Boolean channelType in channel entity | with boolean channelType in channel entity | + | Integer channelType in channel entity | with integer channelType in channel entity | + | Invalid programType in program entity | with invalid programType in program entity | + | Boolean programType in program entity | with boolean programType in program entity | + | Integer programType in program entity | with integer programType in program entity | + | Invalid musicType in music entity | with invalid musicType in music entity | + | Boolean musicType in music entity | with boolean musicType in music entity | + | Integer musicType in music entity | with integer musicType in music entity | + | Invalid seriesId in program episode entity | with invalid seriesId in program episode entity | + | Invalid seasonId in program episode entity | with invalid seasonId in program episode entity | + | Invalid seriesId and seasonId in program episode entity | with invalid seriesId and seasonId in program episode entity | + | Invalid seriesId in program season entity | with invalid seriesId in program season entity | + | Invalid programType for program entity with seriesId | with invalid programType for program entity with seriesId | + | Invalid programType for program entity with seasonId | with invalid programType for program entity with seasonId | + + @coreSDK @sdk @userinterest + Scenario Outline: Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type + And 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type ' + Then 'Firebolt' platform responds to '1st party app' with '' + + Examples: + | Scenario | userInterestData | method_Content | + | interest and reason playlist | interest reason playlist | requestUserInterest with reason playlist | + | interest and reason reaction | interest reason reaction | requestUserInterest with reason reaction | + | interest and reason recording | interest reason recording | requestUserInterest with reason recording | + | disinterest and reason playlist | disinterest reason playlist | requestUserInterest with reason playlist | + | disinterest and reason reaction | disinterest reason reaction | requestUserInterest with reason reaction | + | disinterest and reason recording | disinterest reason recording | requestUserInterest with reason recording | + + @coreSDK @sdk @transport @userinterest + Scenario Outline: Content.requestUserInterest - Negative Scenario: expecting error + When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with ' + Then 'Firebolt' platform responds to '1st party app' with 'invalid params for content requestUserInterest' + + Examples: + | Scenario | Param | + | Invalid Interest value - test params | invalid interestType | + | Invalid Interest type - boolean params | boolean interestType | + | Invalid reason value - test params | invalid reasonType | + | Invalid Interest type - boolean params | boolean reasonType | + + @coreSDK @sdk @userinterest @notSupported + Scenario: Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest but platform timeout without sending response + When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type interest timeout' + Then 'Firebolt' platform responds to '1st party app' with 'not available for requestUserInterest' + + @coreSDK @sdk @userinterest @notSupported + Scenario: Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest but 3rd party app return error + When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type interest returns error' + Then 'Firebolt' platform responds to '1st party app' with 'invalid parameters for requestUserInterest' + + @coreSDK @sdk @userinterest @notSupported + Scenario: Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest without registering for providers + Given the environment has been set up for 'Userinterest' tests + And 3rd party 'certification' app is launched + When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type interest without provider' + Then 'Firebolt' platform responds to '1st party app' with 'not available for requestUserInterest' diff --git a/cypress/TestCases/Sanity/DiscoverySDKSuite.feature b/cypress/TestCases/Sanity/DiscoverySDKSuite.feature new file mode 100644 index 00000000..8fec321f --- /dev/null +++ b/cypress/TestCases/Sanity/DiscoverySDKSuite.feature @@ -0,0 +1,9 @@ +Feature: Firebolt Certification Discovery-SDK validation + + @sanity @DiscoverySDK @Suite @sdk @transport + Scenario: Firebolt Certification Discovery-SDK validation + Given the environment has been set up for 'Firebolt Sanity' tests + And 3rd party 'certification' app is launched + When User starts 'firebolt certification' test using below datatable + | paramType | variableName | value | + | INPUT | action | DISCOVERY | diff --git a/cypress/fixtures/fireboltCalls/content.json b/cypress/fixtures/fireboltCalls/content.json new file mode 100644 index 00000000..bd431ef4 --- /dev/null +++ b/cypress/fixtures/fireboltCalls/content.json @@ -0,0 +1,5 @@ +{ + "CONTENT_ONUSERINTEREST":{ + "method": "discovery_content.onUserInterest" + } +} \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/userinterest.json b/cypress/fixtures/fireboltCalls/userinterest.json new file mode 100644 index 00000000..f4346444 --- /dev/null +++ b/cypress/fixtures/fireboltCalls/userinterest.json @@ -0,0 +1,598 @@ +{ + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_CHANNEL_STREAMING_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_STREAMING" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_CHANNEL_STREAMING_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_STREAMING" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_CHANNEL_OVERTHEAIR_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_OVERTHEAIR" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_CHANNEL_OVERTHEAIR_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_OVERTHEAIR" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_EPISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_EPISODE" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_EPISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_EPISODE" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_CONCERT" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_ADDITIONAL_CONCERT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_CONCERT" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_PROGRAM_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_MUSIC_SONG_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_MUSIC_SONG" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_MUSIC_SONG_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_MUSIC_SONG" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_PLAYLIST_WITH_MUSIC_ALBUM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_MUSIC_ALBUM" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_PLAYLIST_WITH_MUSIC_ALBUM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_MUSIC_ALBUM" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_CHANNEL_STREAMING_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_CHANNEL_STREAMING_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_REACTION_WITH_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_REACTION_WITH_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_RECORDING_WITH_PROGRAM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_RECORDING_WITH_PROGRAM_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_RECORDING_WITH_CHANNEL_STREAMING_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_RECORDING_WITH_CHANNEL_STREAMING_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_RECORDING_WITH_CHANNEL_OVERTHEAIR_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_RECORDING_WITH_CHANNEL_OVERTHEAIR_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_RECORDING_WITH_PROGRAM_EPISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_RECORDING_WITH_PROGRAM_EPISODE_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_INTEREST_AND_REASON_RECORDING_WITH_PROGRAM_SEASON_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON" + }, + "NOTIFY_USERINTEREST_WITH_TYPE_DISINTEREST_AND_REASON_RECORDING_WITH_PROGRAM_SEASON_ENTITY": { + "method": "discovery.userInterest", + "params": "DISCOVERY_USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_CHANNEL": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_CHANNEL_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_CHANNEL": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_CHANNEL_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_OVERTHEAIR": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_OVERTHEAIR_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_OVERTHEAIR": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_OVERTHEAIR_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_EPISODE": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_EPISODE_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_EPISODE": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_EPISODE_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ADDITIONAL_CONCERT_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_ADDITIONAL_CONCERT_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ADDITIONAL_CONCERT_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_ADDITIONAL_CONCERT_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_SPORTINGEVENT_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ADDITIONAL_SPORTINGEVENT_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_SPORTINGEVENT_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_RECORDING_PROGRAM_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_CHANNEL_STREAMING_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_CHANNEL_STREAMING_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_CHANNEL_STREAMING_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_CHANNEL_STREAMING_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_CHANNEL_OVERTHEAIR_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_CHANNEL_OVERTHEAIR_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_CHANNEL_OVERTHEAIR_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_CHANNEL_OVERTHEAIR_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_INTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY_RESPONSE" + }, + "ONUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY": { + "event": "content.onUserInterest", + "validationJsonPath": "eventResponse", + "content": "DISCOVERY_TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY_RESPONSE" + }, + "REQUESTUSERINTEREST_WITH_REASON_PLAYLIST": { + "method": "content.requestUserInterest", + "validationJsonPath": "result", + "content": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_PLAYLIST_RESPONSE" + }, + "REQUESTUSERINTEREST_WITH_REASON_REACTION": { + "method": "content.requestUserInterest", + "validationJsonPath": "result", + "content": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_REACTION_RESPONSE" + }, + "REQUESTUSERINTEREST_WITH_REASON_RECORDING": { + "method": "content.requestUserInterest", + "validationJsonPath": "result", + "content": "DISCOVERY_REQUESTUSERINTEREST_WITH_REASON_RECORDING_RESPONSE" + }, + "NULL_FOR_DISCOVERY_USERINTEREST": { + "method": "discovery.userInterest", + "context": "noContext", + "validationJsonPath": "result", + "content": "NULL", + "expectingError": false + }, + "NOTIFY_USERINTEREST_WITHOUT_ANY_PARAMS": { + "method": "discovery.userInterest", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITHOUT_INTEREST_TYPE": { + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITHOUT_INTEREST_TYPE", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_NUMERIC_INTERESTTYPE":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_INTERESTTYPE_INTEGER", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_STRING_INTERESTTYPE":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_INTERESTTYPE_STRING", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_BOOLEAN_INTERESTTYPE":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_INTERESTTYPE_BOOLEAN", + "expected": "error" + }, + "INVALID_PARAMS_FOR_DISCOVERY_USERINTEREST": { + "method": "discovery.userInterest", + "context": "noContext", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "NOTIFY_USERINTEREST_WITH_INVALID_CHANNELTYPE_IN_CHANNEL_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_CHANNELTYPE_IN_CHANNEL_ENTITY", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_IN_PROGRAM_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_IN_PROGRAM_ENTITY", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_INVALID_MUSICTYPE_IN_MUSIC_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_MUSICTYPE_IN_MUSIC_ENTITY", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_BOOLEAN_CHANNELTYPE_IN_CHANNEL_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_BOOLEAN_CHANNELTYPE_IN_CHANNEL_ENTITY", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_INTEGER_CHANNELTYPE_IN_CHANNEL_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INTEGER_CHANNELTYPE_IN_CHANNEL_ENTITY", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_BOOLEAN_PROGRAMTYPE_IN_PROGRAM_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_BOOLEAN_PROGRAMTYPE_IN_PROGRAM_ENTITY", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_INTEGER_PROGRAMTYPE_IN_PROGRAM_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INTEGER_PROGRAMTYPE_IN_PROGRAM_ENTITY", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_BOOLEAN_MUSICTYPE_IN_MUSIC_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_BOOLEAN_MUSICTYPE_IN_MUSIC_ENTITY", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_INTEGER_MUSICTYPE_IN_MUSIC_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INTEGER_MUSICTYPE_IN_MUSIC_ENTITY", + "expected": "error" + }, + "GET_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST": { + "method": "discovery.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST" + }, + "NOTIFY_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_EPISODE_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_EPISODE_ENTITY", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_INVALID_SEASONID_IN_PROGRAM_EPISODE_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_SEASONID_IN_PROGRAM_EPISODE_ENTITY", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_INVALID_SERIESID_AND_SEASONID_IN_PROGRAM_EPISODE_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_SERIESID_AND_SEASONID_IN_PROGRAM_EPISODE_ENTITY", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_SEASON_ENTITY":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_SERIESID_IN_PROGRAM_SEASON_ENTITY", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SERIESID":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SERIESID", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SEASONID":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_PROGRAMTYPE_FOR_PROGRAM_ENTITY_WITH_SEASONID", + "expected": "error" + }, + "NOTIFY_USERINTEREST_WITH_INVALID_MUSICTYPE_FOR_MUSIC_ENTITY_WITH_ALBUMID":{ + "method": "discovery.userInterest", + "param": "DISCOVERY_USERINTEREST_WITH_INVALID_MUSICTYPE_FOR_MUSIC_ENTITY_WITH_ALBUMID", + "expected": "error" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_INVALID_INTERESTTYPE": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_INVALID_INTERESTTYPE", + "expected": "error" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_BOOLEAN_INTERESTTYPE": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_BOOLEAN_INTERESTTYPE", + "expected": "error" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_INVALID_REASONTYPE": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_INVALID_REASONTYPE", + "expected": "error" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_BOOLEAN_REASONTYPE": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_BOOLEAN_REASONTYPE", + "expected": "error" + }, + "INVALID_PARAMS_FOR_CONTENT_REQUESTUSERINTEREST": { + "method": "discovery_content.requestUserInterest", + "context": "noContext", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "DISCOVERY_ONREQUESTUSERINTEREST":{ + "method": "Discovery.onRequestUserInterest" + }, + "NOT_AVAILABLE_FOR_REQUESTUSERINTEREST": { + "method": "content.requestUserInterest", + "validationJsonPath": "result", + "content": "NOT_AVAILABLE", + "expectingError": true + }, + "INVALID_PARAMETERS_FOR_REQUESTUSERINTEREST": { + "method": "content.requestUserInterest", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_WITHOUT_PROVIDER": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST", + "expected": "error" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_TIMEOUT": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST", + "expected": "error" + }, + "NOTIFY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_RETURNS_ERROR": { + "method": "discovery_content.requestUserInterest", + "params": "DISCOVERY_REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST", + "expected": "error" + } +} \ No newline at end of file diff --git a/cypress/fixtures/modules/discovery.json b/cypress/fixtures/modules/discovery.json index 2929fb80..132aeba8 100644 --- a/cypress/fixtures/modules/discovery.json +++ b/cypress/fixtures/modules/discovery.json @@ -432,6 +432,1344 @@ }, "HOME_INTENT": { "appId": "foo", - "intent": { "action": "home", "context": { "source": "voice" } } - } + "intent": { + "action": "home", + "context": { + "source": "voice" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM": { + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "User Interest", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "User Interest", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_STREAMING": { + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_STREAMING": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_OVERTHEAIR": { + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_CHANNEL_OVERTHEAIR": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_EPISODE": { + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "movie", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_EPISODE": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "movie", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_CONCERT": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_PROGRAM_ADDITIONAL_SPORTINGEVENT": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_MUSIC_SONG": { + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_MUSIC_SONG": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST_ENTITY_MUSIC_ALBUM": { + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST_ENTITY_MUSIC_ALBUM": { + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM": { + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "User Interest", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "User Interest", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING": { + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_CHANNEL_STREAMING": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_PREVIEW": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_ADVERTISEMENT": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MUSICVIDEO": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_MINISODE": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_ADDITIONAL_EXTRA": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION_ENTITY_PROGRAM_TVEPISODE_WITH_SERIESID_AND_SEASONID": { + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM": { + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "User Interest", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM": { + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "User Interest", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING": { + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_STREAMING": { + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR": { + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_CHANNEL_OVERTHEAIR": { + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE": { + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_EPISODE": { + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + } + }, + "USERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON": { + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz", + "seriesId": "breaking-bad" + } + } + }, + "USERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING_ENTITY_PROGRAM_SEASON": { + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz", + "seriesId": "breaking-bad" + } + } + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_REACTION": { + "type": "interest", + "reason": "reaction" + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_PLAYLIST": { + "type": "interest", + "reason": "playlist" + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST_REASON_RECORDING": { + "type": "interest", + "reason": "recording" + }, + "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_REACTION": { + "type": "disinterest", + "reason": "reaction" + }, + "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_PLAYLIST": { + "type": "disinterest", + "reason": "playlist" + }, + "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST_REASON_RECORDING": { + "type": "disinterest", + "reason": "recording" + }, + "REQUESTUSERINTEREST_WITH_INVALID_INTERESTTYPE": { + "type": "test", + "reason": "playlist" + }, + "REQUESTUSERINTEREST_WITH_BOOLEAN_INTERESTTYPE": { + "type": true, + "reason": "playlist" + }, + "REQUESTUSERINTEREST_WITH_INVALID_REASONTYPE": { + "type": "interest", + "reason": "test" + }, + "REQUESTUSERINTEREST_WITH_BOOLEAN_REASONTYPE": { + "type": "interest", + "reason": true + }, + "TYPE_INTEREST_REASON_PLAYLIST": { + "correlationId": "xyz", + "parameters": { + "type": "interest", + "reason": "playlist" + } + }, + "TYPE_INTEREST_REASON_REACTION": { + "correlationId": "xyz", + "parameters": { + "type": "interest", + "reason": "reaction" + } + }, + "TYPE_INTEREST_REASON_RECORDING": { + "correlationId": "xyz", + "parameters": { + "type": "interest", + "reason": "recording" + } + }, + "TYPE_DISINTEREST_REASON_PLAYLIST": { + "correlationId": "xyz", + "parameters": { + "type": "disinterest", + "reason": "playlist" + } + }, + "TYPE_DISINTEREST_REASON_REACTION": { + "correlationId": "xyz", + "parameters": { + "type": "disinterest", + "reason": "reaction" + } + }, + "TYPE_DISINTEREST_REASON_RECORDING": { + "correlationId": "xyz", + "parameters": { + "type": "disinterest", + "reason": "recording" + } + }, + "REQUESTUSERINTEREST_WITH_TYPE_INTEREST": { + "InterestType": "interest" + }, + "REQUESTUSERINTEREST_WITH_TYPE_DISINTEREST": { + "InterestType": "disinterest" + }, + "USERINTEREST_WITH_INVALID_MUSICTYPE_FOR_MUSIC_ENTITY_WITH_ALBUMID": { + "InterestType": "interest", + "entity": { + "entityType": "music", + "musicType": "album", + "entityId": "song/xyz", + "albumId": "album/xyz" + } + }, + "REQUESTUSERINTEREST_WITH_REASON_PLAYLIST_RESPONSE": { + "appId": "foo-app", + "entity":{ + "identifiers": { + "entityId": "345", + "entityType": "playlist" + }, + "info": { + "title": "User Interest", + "synopsis": "User Interest request provider", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "REQUESTUSERINTEREST_WITH_REASON_REACTION_RESPONSE": { + "appId": "foo-app", + "entity":{ + "identifiers": { + "entityId": "123", + "entityType": "channel", + "channelType": "streaming" + }, + "info": { + "title": "User Interest", + "synopsis": "User Interest request provider", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "REQUESTUSERINTEREST_WITH_REASON_RECORDING_RESPONSE": { + "appId": "foo-app", + "entity":{ + "identifiers": { + "entityId": "981", + "entityType": "music", + "musicType": "song" + }, + "info": { + "title": "User Interest", + "synopsis": "User Interest request provider", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-TV", + "rating": "PG" + } + ] + } + } + }, + "TYPE_INTEREST_REASON_PLAYLIST_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "User Interest", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "TYPE_DISINTEREST_REASON_PLAYLIST_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "User Interest", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "TYPE_INTEREST_REASON_PLAYLIST_CHANNEL_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_PLAYLIST_CHANNEL_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_INTEREST_REASON_PLAYLIST_OVERTHEAIR_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_PLAYLIST_OVERTHEAIR_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_INTEREST_REASON_PLAYLIST_PROGRAM_EPISODE_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "movie", + "entityId": "entity/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_PLAYLIST_PROGRAM_EPISODE_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "movie", + "entityId": "entity/xyz" + } + } + }, + "TYPE_INTEREST_REASON_PLAYLIST_ADDITIONAL_CONCERT_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_PLAYLIST_ADDITIONAL_CONCERT_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "concert", + "entityId": "entity/xyz" + } + } + }, + "TYPE_INTEREST_REASON_PLAYLIST_SPORTINGEVENT_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_PLAYLIST_SPORTINGEVENT_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "sportingEvent", + "entityId": "entity/xyz" + } + } + }, + "TYPE_INTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_SONG_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "music", + "musicType": "song", + "entityId": "entity/xyz" + } + } + }, + "TYPE_INTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_PLAYLIST_MUSIC_ALBUM_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "playlist", + "entity": { + "identifiers": { + "entityType": "music", + "musicType": "album", + "entityId": "entity/xyz" + } + } + }, + "TYPE_INTEREST_REASON_REACTION_PROGRAM_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "User Interest", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "User Interest", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "TYPE_INTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_REACTION_CHANNEL_STREAMING_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_PREVIEW_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "preview", + "entityId": "entity/xyz" + } + } + }, + "TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_ADVERTISEMENT_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "advertisement", + "entityId": "entity/xyz" + } + } + }, + "TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MUSICVIDEO_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "musicVideo", + "entityId": "entity/xyz" + } + } + }, + "TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_MINISODE_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "minisode", + "entityId": "entity/xyz" + } + } + }, + "TYPE_INTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_ADDITIONAL_EXTRA_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "extra", + "entityId": "entity/xyz" + } + } + }, + "TYPE_INTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "appId":"foo-app", + "type": "interest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + } + }, + "TYPE_DISINTEREST_REASON_REACTION_PROGRAM_TVEPISODE_ENTITY_WITH_SERIESID_AND_SEASONID": { + "appId":"foo-app", + "type": "disinterest", + "reason": "reaction", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "breaking-bad-pilot", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + } + }, + "TYPE_INTEREST_REASON_RECORDING_PROGRAM_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "User Interest", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityId": "345", + "entityType": "program", + "programType": "movie" + }, + "info": { + "title": "User Interest", + "synopsis": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar sapien et ligula ullamcorper malesuada proin libero nunc.", + "releaseDate": "1993-01-01T00:00:00.000Z", + "contentRatings": [ + { + "scheme": "US-Movie", + "rating": "PG" + }, + { + "scheme": "CA-Movie", + "rating": "G" + } + ] + } + } + }, + "TYPE_INTEREST_REASON_CHANNEL_STREAMING_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_CHANNEL_STREAMING_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "streaming", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_INTEREST_REASON_CHANNEL_OVERTHEAIR_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_DISINTEREST_REASON_CHANNEL_OVERTHEAIR_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "channel", + "channelType": "overTheAir", + "entityId": "streaming/xyz" + } + } + }, + "TYPE_INTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + } + }, + "TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_EPISODE_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "episode", + "entityId": "entity/xyz", + "seriesId": "breaking-bad", + "seasonId": "breaking-bad-season-1" + } + } + }, + "TYPE_INTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "interest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz", + "seriesId": "breaking-bad" + } + } + }, + "TYPE_DISINTEREST_REASON_RECORDING_PROGRAM_SEASON_ENTITY_RESPONSE": { + "appId":"foo-app", + "type": "disinterest", + "reason": "recording", + "entity": { + "identifiers": { + "entityType": "program", + "programType": "season", + "entityId": "entity/xyz", + "seriesId": "breaking-bad" + } + } + } } \ No newline at end of file diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 8a902fb3..61d2bd7c 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -2702,6 +2702,78 @@ } ] } + }, + "UserInterest": { + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type interest and reason playlist": { + "req": [ + { + "method": { + "id": "UserInterest 4.1", + "description": "Positive Scenario: with type interest and reason playlist" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type interest and reason reaction": { + "req": [ + { + "method": { + "id": "UserInterest 4.2", + "description": "Positive Scenario: with type interest and reason reaction" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type interest and reason recording": { + "req": [ + { + "method": { + "id": "UserInterest 4.3", + "description": "Positive Scenario: with type interest and reason recording" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type disinterest and reason playlist": { + "req": [ + { + "method": { + "id": "UserInterest 4.4", + "description": "Positive Scenario: with type disinterest and reason playlist" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type disinterest and reason reaction": { + "req": [ + { + "method": { + "id": "UserInterest 4.5", + "description": "Positive Scenario: with type disinterest and reason reaction" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type disinterest and reason recording": { + "req": [ + { + "method": { + "id": "UserInterest 4.6", + "description": "Positive Scenario: with type disinterest and reason recording" + } + } + ] + }, + "Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest without registering for providers": { + "req": [ + { + "method": { + "id": "UserInterest 4.7", + "description": "Negative Scenario: Notify requestUserInterest without registering for providers" + } + } + ] + } } } } \ No newline at end of file diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 506ac57d..f555978d 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -371,6 +371,7 @@ module.exports = { SETAPIRESPONSE: 'setApiResponse', CLEAREVENTHANDLER: 'clearEventHandler', PERFORMANCETESTHANDLER: 'performanceTestHandler', + REGISTERPROVIDERHANDLER: 'registerProviderHandler', }, TEST_TYPE: 'testType', THIRD_PARTY_APP: '3rd party app', @@ -400,7 +401,7 @@ module.exports = { STOPPED: 'stopped', START: 'start', STOP: 'stop', - FIRST_PARTY_MOCK_USER: 'firstPartyUserId', + FIRST_PARTY_MOCK_USER: 'firstPartyMockUser', THIRD_PARTY_MOCK_USER: 'thirdPartyMockUser', HTTP: 'HTTP', STATE_METHOD: 'state/method/', From 4d16de9537c211fde49ce8c8bf77112538f28e3b Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Wed, 12 Jun 2024 13:58:09 +0530 Subject: [PATCH 125/359] initial commit --- cypress/support/cypress-commands/commands.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 9b5068bb..616a4793 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -684,7 +684,12 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { }, }), }; - requestMap.params.intent.data = data; + const messageIntent = { + action: CONSTANTS.SEARCH, + data: data, + context: { source: CONSTANTS.DEVICE }, + }; + requestMap.params.intent = messageIntent; } Cypress.env(CONSTANTS.CURRENT_APP_ID, appId); From 894e4ac314fec015faf633b1c298130639fe3f2d Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Wed, 12 Jun 2024 14:05:39 +0530 Subject: [PATCH 126/359] added minor change --- cypress/support/cypress-commands/commands.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 616a4793..03e2af9a 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -685,9 +685,7 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { }), }; const messageIntent = { - action: CONSTANTS.SEARCH, - data: data, - context: { source: CONSTANTS.DEVICE }, + data: data }; requestMap.params.intent = messageIntent; } From 3e6a745a9a82b8924c008fb53da1c4492dd8b113 Mon Sep 17 00:00:00 2001 From: rajanika Date: Wed, 12 Jun 2024 15:14:26 +0530 Subject: [PATCH 127/359] fix lint issue --- cypress/support/cypress-commands/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 03e2af9a..31e4b729 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -685,7 +685,7 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { }), }; const messageIntent = { - data: data + data: data, }; requestMap.params.intent = messageIntent; } From 5fe5c68c3ed4921c68687dda777b994f9e1b1e53 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Wed, 12 Jun 2024 16:04:21 +0530 Subject: [PATCH 128/359] Initial commit --- cypress/support/constants/constants.js | 1 + cypress/support/cypress-commands/commands.js | 10 +- cypress/support/cypress-support/src/utils.js | 102 ++++++++++ cypress/support/cypress-support/src/utils.md | 38 +++- .../support/step_definitions/fireboltCalls.js | 187 ++++++++++++++++++ 5 files changed, 336 insertions(+), 2 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 55e9f06d..2d4598b7 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -378,6 +378,7 @@ module.exports = { TOPIC_PUBLISH_SUFFIX: '_FCS', TOPIC_SUBSCRIBE_SUFFIX: '_FCA', TRANSPORT: 'transport', + TYPE_FUNCTION: 'function', TYPE_OBJECT: 'object', TYPE_STRING: 'string', UNDEFINED: 'undefined', diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 028a969e..be6c287a 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -40,8 +40,16 @@ Cypress.Commands.add( } else if (callType == CONSTANTS.SUPPORTED_CALLTYPES.SET_RESPONSE_JSON) { fireboltData = UTILS.getEnvVariable('setResponseJson')[key]; } else { - fireboltData = UTILS.getEnvVariable(CONSTANTS.COMBINEDFIREBOLTCALLS)[key]; + if (key) { + fireboltData = UTILS.getEnvVariable(CONSTANTS.COMBINEDFIREBOLTCALLS)[key]; + if(UTILS.getEnvVariable('runtime')){ + UTILS.getEnvVariable('runtime').fireboltCall = fireboltData; + } + } else { + fireboltData = UTILS.getEnvVariable('runtime')?.fireboltCall; + } } + if (!fireboltData) { fireLog.assert(false, CONSTANTS.NO_DATA_FOR_THE_KEY + key); } diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 52990489..eb717fdf 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -741,6 +741,107 @@ class FireLog { const fireLog = new FireLog(); global.fireLog = fireLog; +/** + * @module utils + * @globalfunction resolveAtRuntime + * @description Return the function which is having logic to resolve the value for the passed input at runtime. + * @param {String || Array} + * @example + * resolveAtRuntime(["result.{{attribute}}", "result.styles.{{attribute}}"]) + * resolveAtRuntime("manage_closedcaptions.set{{attribute.uppercaseFirstChar}}") + * resolveAtRuntime("value") + * + * @returns + * ['result.fontSize', 'result.styles.fontSize'] + * "manage_closedcaptions.setFontSize" + * 1.5 + */ +global.resolveAtRuntime = function (input) { + return function () { + const functions = { + uppercaseFirstChar: function (str) { + return str.charAt(0).toUpperCase() + str.slice(1); + }, + lowercaseFirstChar: function (str) { + return str.charAt(0).toLowerCase() + str.slice(1); + }, + }; + + // Function to check the occurence of the pattern and updating the actual value + function replacingPatternOccurenceWithValue(text) { + return text.replace(/{{(.*?)}}/g, (match, pattern) => { + let functionName; + + // Separating the function name from the pattern, if it exists,. + if (pattern.includes('.')) { + functionName = pattern.split('.')[1]; + pattern = pattern.split('.')[0]; + } + + // If a function name is present in the pattern, call the function with pattern content as input. + // Reading the pattern content from the runtime environment variable + if (functionName && functions.hasOwnProperty(functionName)) { + return functions[functionName](getEnvVariable('runtime')[pattern] || match); + } else { + return getEnvVariable('runtime')[pattern] || match; + } + }); + } + + if (typeof input === CONSTANTS.TYPE_STRING) { + // Returning the actual pattern content for each occurrence of "{{" + if (input.includes('{{')) { + return replacingPatternOccurenceWithValue(input); + } + // If input not having "{{", returning content from runtime environment variable. + else if (!input.includes('{{')) { + return getEnvVariable('runtime')[input] || input; + } + } else if (Array.isArray(input) && input.length > 0) { + // input is an array; iterating through each element, it updates the actual value for that pattern if there is an occurrence of "{{". + return input.map((element) => { + if (element.includes('{{')) { + return replacingPatternOccurenceWithValue(element); + } + }); + } else { + logger.info(`Passed input - ${input} must be an array or a string.`); + } + }; +}; + +/** + * @module utils + * @function parseValue + * @description Function to parse the passed string + * @param {String} + * + * @example + * - parseValue('123') + * - parseValue('true') + * + * @returns + * 123 + * true + */ +function parseValue(str) { + if (str === null || str === undefined) return str; + + if (typeof str === 'string') { + if (str === 'true') return true; + if (str === 'false') return false; + + if (!isNaN(str)) return Number(str); + try { + return JSON.parse(value); + } catch (error) { + fireLog.assert(false, `Failed to parse value - ${erorr}`); + } + } + + return str; +} + module.exports = { replaceJsonStringWithEnvVar, createIntentMessage, @@ -764,4 +865,5 @@ module.exports = { writeJsonToFileForReporting, checkForTags, fireLog, + parseValue }; diff --git a/cypress/support/cypress-support/src/utils.md b/cypress/support/cypress-support/src/utils.md index e2bba8c0..303c6c0a 100644 --- a/cypress/support/cypress-support/src/utils.md +++ b/cypress/support/cypress-support/src/utils.md @@ -291,4 +291,40 @@ resolveDeviceVariable("deviceId") ### Examples: `fireLog.isTrue(isTrueValue, "True message");` `fireLog.isFalse(isFalseValue, "False message");` -`fireLog.deepEqual(actual, expected, "deepEqual message");` \ No newline at end of file +`fireLog.deepEqual(actual, expected, "deepEqual message");` + + +## resolveAtRuntime + +### Purpose: Return the function which is having logic to resolve the value for the passed input at runtime. + +### Params: +| Param | Definition| Type | +| --- | --- | --- | +| input | value which need to resolved | string or Array | + +Note: Values of `attribute` and `value` will be stored in `runtime` environment variable while executing the glue + +### Examples: +request +- `resolveAtRuntime(["result.{{attribute}}", "result.styles.{{attribute}}"])` +- `resolveAtRuntime("manage_closedcaptions.set{{attribute.uppercaseFirstChar}}")` +- `resolveAtRuntime("value")` + +return +- `['result.fontSize', 'result.styles.fontSize']` +- `"manage_closedcaptions.setFontSize"` +- `1.5` + +## parseValue + +### Purpose: Function to parse the passed string. + +### Examples: +request +- `parseValue('123') ` +- `parseValue('true')` + +response +- `123` +- `true` \ No newline at end of file diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index bd01c139..625dcb31 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -422,3 +422,190 @@ Given(/User triggers event with value as '(.+)'/, (key) => { throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); }); }); + +/** + * @module fireboltCalls + * @function And '(.+)' invokes the '(.+)' API '(.+)' to set '(.+)' to '(.+)' + * @description send message to platform to make api call. + * @param {String} appId - app identifier, determines for which App sending the message to make a API call. + * @param {String} sdk - sdk name. + * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. + * @param {String} attribute - The attribute we are setting (ex. fontFamily). + * @param {String} value - The value we set the attribute to (ex. monospaced_sanserif) + * @example + * Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true' + * Given '3rd party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true' + */ +Given( + /'(.+)' invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to '(.+)'$/, + async (appId, sdk, fireboltCallKey, attribute, value) => { + if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { + value = UTILS.parseValue(value); + + Cypress.env('runtime', { + attribute: attribute, + value: value, + }); + + cy.getFireboltData(fireboltCallKey).then((fireboltCallObject) => { + + let setMethod = + typeof fireboltCallObject.setMethod === CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.setMethod() + : fireboltCallObject.setMethod; + let setParams; + + if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_FUNCTION) { + setParams = { value: fireboltCallObject.setParams() }; + } else if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_OBJECT) { + setParams = fireboltCallObject.setParams; + + for (const key in setParams) { + if (typeof setParams[key] === CONSTANTS.TYPE_FUNCTION) { + setParams[key] = setParams[key](); + } + } + } else { + setParams = { value: fireboltCallObject.setParams }; + } + + const context = {}; + //TODO: waiting for answer from jacob on expected + const expected = fireboltCallObject.expected; + appId = + appId === CONSTANTS.THIRD_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.FIRST_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) + : appId; + let action = CONSTANTS.ACTION_CORE.toLowerCase(); + if (setMethod && setMethod.includes('_')) { + action = setMethod.split('_')[0]; + setMethod = setMethod.split('_')[1]; + } + + // If method and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(setMethod, setParams)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } + + if (appId === UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { + const requestMap = { + method: setMethod, + params: setParams, + action: action, + }; + + cy.log( + 'Call from 1st party App, method: ' + + setMethod + + ' params: ' + + JSON.stringify(setParams) + ); + cy.sendMessagetoPlatforms(requestMap).then((response) => { + if (response && typeof response == CONSTANTS.TYPE_OBJECT) { + // If error and the error message having 'Method not found' or 'Method not Implemented' mark the testcase as undefined. + if ( + response && + response.error && + response.error.message && + CONSTANTS.ERROR_LIST.includes(response.error.message) + ) { + if (UTILS.getEnvVariable(CONSTANTS.CERTIFICATION) == true) { + assert(false, `${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${setMethod}`); + } else { + cy.log(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${setMethod}`).then( + () => { + throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); + } + ); + } + } + + cy.updateResponseForFCS(setMethod, setParams, response).then((updatedResponse) => { + // Create a deep copy to avoid reference mutation + const dataToBeCensored = _.cloneDeep(response); + + // Call the 'censorData' command to hide sensitive data + cy.censorData(setMethod, dataToBeCensored).then((maskedResult) => { + cy.log(`Response from Firebolt platform: ${JSON.stringify(maskedResult)}`); + }); + + // Creating object with event name, params, and response etc and storing it in a global list for further validation. + const apiAppObject = new apiObject( + setMethod, + setParams, + context, + updatedResponse, + expected, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + }); + } else { + cy.log(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); + } + }); + } else { + let isNotSupportedApi = false; + + if (UTILS.isScenarioExempted(setMethod, setParams)) { + isNotSupportedApi = true; + } + + const communicationMode = UTILS.getCommunicationMode(); + const additionalParams = { + communicationMode: communicationMode, + action: action, + isNotSupportedApi: isNotSupportedApi, + }; + const params = { method: setMethod, methodParams: setParams }; + + // Creating intent message using above details to send it to 3rd party app. + const intentMessage = UTILS.createIntentMessage( + CONSTANTS.TASK.CALLMETHOD, + params, + additionalParams + ); + + cy.log(`Call from ${appId}, method: ${setMethod} params: ${JSON.stringify(setParams)}`); + + // Adding additional details to created intent if any platform specific data is present in configModule. + cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { + const requestTopic = UTILS.getTopic(appId); + const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); + + // Sending message to 3rd party app. + cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { + if (result === CONSTANTS.NO_RESPONSE) { + assert(false, CONSTANTS.NO_MATCHED_RESPONSE); + } + result = JSON.parse(result); + + // Create a deep copy to avoid reference mutation + const dataToBeCensored = _.cloneDeep(result.report.apiResponse); + + // Call the 'censorData' command to hide sensitive data + cy.censorData(setMethod, dataToBeCensored).then((maskedResult) => { + cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); + }); + + // Creating object with method name, params and response etc and storing it in a global list for further validation. + const apiAppObject = new apiObject( + setMethod, + setParams, + context, + result.report, + expected, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + }); + }); + } + }); + } else { + fireLog.assert(false, `${sdk} SDK not Supported`); + } + } +); \ No newline at end of file From c9b33390056914e63aca1ebce81286c30a0fcd4f Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Wed, 12 Jun 2024 16:20:00 +0530 Subject: [PATCH 129/359] FIRECERT-1760-RpcOnly added glue code to fetch method/event response --- ...AcknowledgeChallengeManage_RpcOnly.feature | 8 +- .../Manage/KeyboardManage_RpcOnly.feature | 8 +- .../Manage/ProfileManage_RpcOnly.feature | 8 +- cypress/support/constants/constants.js | 3 + cypress/support/cypress-support/src/main.js | 4 +- cypress/support/cypress-support/src/utils.js | 2 + .../support/step_definitions/fireboltCalls.js | 84 +++++++++++++++++++ 7 files changed, 104 insertions(+), 13 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature index 3f71b98b..955fe6b2 100644 --- a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature @@ -10,10 +10,10 @@ And User set response for 'set acknowledge granted' When 1st party app registers for the 'acknowledgeChallenge onRequestChallenge manage' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to 'get localization countryCode' - And Fetch response for 'acknowledgeChallenge onRequestChallenge' event + And Fetch response for 'acknowledgeChallenge onRequestChallenge' event from '1st party app' And 1st party app invokes the 'Firebolt' API to 'get acknowledgeChallenge challengeFocus' And 1st party app invokes the 'Firebolt' API to 'get acknowledgeChallenge challengeResponse' - And Fetch response for 'get localization countryCode' method + And Fetch response for 'get localization countryCode' method from '3rd party app' Then 'Firebolt' platform responds with 'expected localization countryCode' @transport @ripple @@ -24,7 +24,7 @@ And User set response for 'set acknowledge granted' When 1st party app registers for the 'acknowledgeChallenge onRequestChallenge manage' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to 'get localization countryCode' - And Fetch response for 'acknowledgeChallenge onRequestChallenge' event + And Fetch response for 'acknowledgeChallenge onRequestChallenge' event from '1st party app' And 1st party app invokes the 'Firebolt' API to 'get acknowledgeChallenge challengeError' - And Fetch response for 'get localization countryCode' method + And Fetch response for 'get localization countryCode' method from '3rd party app' Then 'Firebolt' platform responds with 'expected localization countryCode' \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature index 1ca11615..c526d82a 100644 --- a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature @@ -8,10 +8,10 @@ Feature: Keyboard_Manage_RpcOnly And 3rd party 'certification' app is launched When 1st party app registers for the '' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to '' - And Fetch response for '' event + And Fetch response for '' event from '1st party app' And 1st party app invokes the 'Firebolt' API to '' And 1st party app invokes the 'Firebolt' API to '' - And Fetch response for '' method + And Fetch response for '' method from '3rd party app' Then 'Firebolt' platform responds with '' Examples: | Scenario | ManageEventName | EventName | MethodName | MethodParam | FocusMethod | ResponseMethod | MethodResponse | @@ -25,9 +25,9 @@ Feature: Keyboard_Manage_RpcOnly And 3rd party 'certification' app is launched When 1st party app registers for the '' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to '' - And Fetch response for '' event + And Fetch response for '' event from '1st party app' And 1st party app invokes the 'Firebolt' API to '' - And Fetch response for '' method + And Fetch response for '' method from '3rd party app' Then 'Firebolt' platform responds with '' Examples: diff --git a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature index c8beef43..a4af897e 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature @@ -8,10 +8,10 @@ Feature: Profile_Manage_RpcOnly And 3rd party 'certification' app is launched When 1st party app registers for the 'pinChallenge onRequestChallenge manage' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to 'profile approvePurchase' - And Fetch response for 'pinChallenge onRequestChallenge' event + And Fetch response for 'pinChallenge onRequestChallenge' event from '1st party app' And 1st party app invokes the 'Firebolt' API to 'get pinChallenge challengeFocus' And 1st party app invokes the 'Firebolt' API to 'get pinChallenge challengeResponse' - And Fetch response for 'profile approvePurchase' method + And Fetch response for 'profile approvePurchase' method from '3rd party app' Then 'Firebolt' platform responds with 'true for profile approvepurchase' @@ -21,7 +21,7 @@ Feature: Profile_Manage_RpcOnly And 3rd party 'certification' app is launched When 1st party app registers for the 'pinChallenge onRequestChallenge manage' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to 'profile approvePurchase' - And Fetch response for 'pinChallenge onRequestChallenge' event + And Fetch response for 'pinChallenge onRequestChallenge' event from '1st party app' And 1st party app invokes the 'Firebolt' API to 'get pinChallenge challengeError' - And Fetch response for 'profile approvePurchase' method + And Fetch response for 'profile approvePurchase' method from '3rd party app' Then 'Firebolt' platform responds with 'true for profile approvepurchase' \ No newline at end of file diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 5be43d33..42b1129f 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -59,6 +59,7 @@ module.exports = { CONTEXT: 'Context', CONTEXT_FILE_PATH: 'cypress/fixtures/apiObjectContext.json', CORE: 'core', + CORRELATIONID: 'correlationId', COUNTRYCODE: 'countryCode', CUCUMBER: 'cucumber', CURRENT_APP_ID: 'currentAppId', @@ -176,6 +177,7 @@ module.exports = { INVALID_RESPONSE: 'Invalid response', INVALID_HISTORY_RESPONSE: 'App history response does not contain expected fields', IS_NOT_SUPPORTED_API: 'isNotSupportedApi', + IS_RPC_ONLY: 'isRpcOnlyValidation', IS_SAME_APP_TRANSITION: 'isSameAppTransition', IS_SCENARIO_EXEMPTED: 'isScenarioExempted', JOBID: 'jobId', @@ -363,6 +365,7 @@ module.exports = { CALLMETHOD: 'callMethod', REGISTEREVENT: 'registerEvent', GETEVENTRESPONSE: 'getEventResponse', + GETMETHODRESPONSE: 'getMethodResponse', RUNTEST: 'runTest', HEALTHCHECK: 'healthCheck', STARTLIFECYCLERECORDING: 'startLifecycleRecording', diff --git a/cypress/support/cypress-support/src/main.js b/cypress/support/cypress-support/src/main.js index 449b4c68..8e34c5ea 100644 --- a/cypress/support/cypress-support/src/main.js +++ b/cypress/support/cypress-support/src/main.js @@ -400,7 +400,9 @@ export default function (module) { if (results) { // Response recieved from queue return results; - } + }else if(Cypress.env("isRpcOnlyValidation") ){ + return true + } }); } else { cy.log(CONSTANTS.APP_TRANSPORT_UNAVAILABLE).then(() => { diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index cecd8fea..d01bf399 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -83,6 +83,8 @@ function createIntentMessage(task, jsonParams, map = null) { map && map.hasOwnProperty(CONSTANTS.IS_NOT_SUPPORTED_API) ? (jsonQueryParams.isNotSupportedApi = map.isNotSupportedApi) : false; + + Cypress.env("isRpcOnlyValidation")? jsonQueryParams.responseTimeout = 200000 : null const intent = { action: queryParams.action, data: { query: JSON.stringify(jsonQueryParams) }, diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 12a0a61f..16b24efb 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -409,3 +409,87 @@ Given(/I clear '(.+)' listeners$/, async (key) => { }); }); }); + +/** + * @module fireboltCalls + * @function And Fetch response for '(.+)' (method|event) from (3rd party app|1st party app) + * @description Fetch the Method or Event response from the App + * @param {String} key - key name of the data contains event/method name and parameter. + * @param {String} methodOrEvent - Flag to differentiate between method or event + * @param {String} app - Flag to differentiate between 3rd party/ 1st party app + * @example + * And Fetch response for 'pinChallenge onRequestChallenge' event from '1st party app' + * And Fetch response for 'profile approvePurchase' method from '3rd party app' + */ + +When( + /Fetch response for '(.+)' (method|event) from (3rd party app|1st party app)$/, + (key, methodOrEvent, app) => { + if (Cypress.env(CONSTANTS.TEST_TYPE).includes('rpc-Only')) { + Cypress.env(CONSTANTS.IS_RPC_ONLY, true); + } + + cy.fireboltDataParser(key).then((parsedDataArr) => { + parsedDataArr.forEach((parsedData) => { + const method = parsedData.method; + appId = !appId + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.FIRST_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) + : appId; + + let params; + if (app == CONSTANTS.FIRST_PARTY_APP) { + let extractedEvent = getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).filter( + (element) => element.eventName == method + ); + eventName = extractedEvent[extractedEvent.length - 1].eventObjectId; + const requestMap = { + method: CONSTANTS.REQUEST_OVERRIDE_CALLS.FETCH_EVENT_RESPONSE, + params: eventName, + }; + cy.log( + 'Call from 1st party App, method: ' + method + ' params: ' + JSON.stringify(params) + ); + cy.sendMessagetoPlatforms(requestMap).then((response) => { + cy.log('Response from Firebolt platform: ' + JSON.stringify(response)); + if (response === CONSTANTS.RESPONSE_NOT_FOUND) { + cy.log(CONSTANTS.NO_MATCHED_RESPONSE).then(() => { + assert(false, CONSTANTS.NO_MATCHED_RESPONSE); + }); + } + cy.log(`correlationId - ${response.eventResponse.correlationId}`); + Cypress.env(CONSTANTS.correlationId, response.eventResponse.correlationId); + }); + } else if (app == CONSTANTS.THIRD_PARTY_APP) { + params = { method: method }; + + // Creating intent message using above details to send it to 3rd party app. + let parsedIntent = UTILS.createIntentMessage(CONSTANTS.TASK.GETMETHODRESPONSE, params); + // Fetching method response from third party app + const requestTopic = UTILS.getTopic(appId); + const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); + + // Sending message to 3rd party app. + cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((response) => { + if (response === CONSTANTS.RESPONSE_NOT_FOUND) { + cy.log(CONSTANTS.NO_MATCHED_RESPONSE).then(() => { + assert(false, CONSTANTS.NO_MATCHED_RESPONSE); + }); + } + cy.log(`Updated response of ${method}: ${JSON.stringify(response)}`); + for ( + let index = 0; + index < Cypress.env(CONSTANTS.GLOBAL_API_OBJECT_LIST).length; + index++ + ) { + if (Cypress.env(CONSTANTS.GLOBAL_API_OBJECT_LIST)[index].apiName == method) { + Cypress.env(CONSTANTS.GLOBAL_API_OBJECT_LIST)[index].response = response; + } + } + }); + } + }); + }); + } +); \ No newline at end of file From 34f21e06c8b27121f8fe907ca08ded529ece5b44 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Wed, 12 Jun 2024 16:24:40 +0530 Subject: [PATCH 130/359] fixed lint issue --- cypress/support/cypress-commands/commands.js | 6 +++--- cypress/support/cypress-support/src/utils.js | 20 +++++++++---------- .../support/step_definitions/fireboltCalls.js | 3 +-- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index be6c287a..9bc88586 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -42,11 +42,11 @@ Cypress.Commands.add( } else { if (key) { fireboltData = UTILS.getEnvVariable(CONSTANTS.COMBINEDFIREBOLTCALLS)[key]; - if(UTILS.getEnvVariable('runtime')){ - UTILS.getEnvVariable('runtime').fireboltCall = fireboltData; + if (UTILS.getEnvVariable('runtime', false)) { + UTILS.getEnvVariable('runtime', false).fireboltCall = fireboltData; } } else { - fireboltData = UTILS.getEnvVariable('runtime')?.fireboltCall; + fireboltData = UTILS.getEnvVariable('runtime', false)?.fireboltCall; } } diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index eb717fdf..1d34cfa0 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -745,13 +745,13 @@ global.fireLog = fireLog; * @module utils * @globalfunction resolveAtRuntime * @description Return the function which is having logic to resolve the value for the passed input at runtime. - * @param {String || Array} + * @param {String || Array} * @example * resolveAtRuntime(["result.{{attribute}}", "result.styles.{{attribute}}"]) * resolveAtRuntime("manage_closedcaptions.set{{attribute.uppercaseFirstChar}}") * resolveAtRuntime("value") - * - * @returns + * + * @returns * ['result.fontSize', 'result.styles.fontSize'] * "manage_closedcaptions.setFontSize" * 1.5 @@ -814,13 +814,13 @@ global.resolveAtRuntime = function (input) { * @module utils * @function parseValue * @description Function to parse the passed string - * @param {String} - * - * @example - * - parseValue('123') + * @param {String} + * + * @example + * - parseValue('123') * - parseValue('true') - * - * @returns + * + * @returns * 123 * true */ @@ -865,5 +865,5 @@ module.exports = { writeJsonToFileForReporting, checkForTags, fireLog, - parseValue + parseValue, }; diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 625dcb31..eee0ade7 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -448,7 +448,6 @@ Given( }); cy.getFireboltData(fireboltCallKey).then((fireboltCallObject) => { - let setMethod = typeof fireboltCallObject.setMethod === CONSTANTS.TYPE_FUNCTION ? fireboltCallObject.setMethod() @@ -608,4 +607,4 @@ Given( fireLog.assert(false, `${sdk} SDK not Supported`); } } -); \ No newline at end of file +); From 3111a9c4536e3f8e3a62863ffd69e4491da51c07 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J <43801187+Abhishk123@users.noreply.github.com> Date: Wed, 12 Jun 2024 16:28:11 +0530 Subject: [PATCH 131/359] Update fireboltCalls.js --- cypress/support/step_definitions/fireboltCalls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index eee0ade7..cff96a5a 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -469,7 +469,7 @@ Given( } const context = {}; - //TODO: waiting for answer from jacob on expected + // TODO: waiting for answer from jacob on expected const expected = fireboltCallObject.expected; appId = appId === CONSTANTS.THIRD_PARTY_APP From 20efc2fc011948cd1bdeeff1a767e6f1f5a1cfc0 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Wed, 12 Jun 2024 16:34:27 +0530 Subject: [PATCH 132/359] FIRECERT-1760-RpcOnly fixed linting issues --- cypress/support/cypress-support/src/main.js | 6 +++--- cypress/support/cypress-support/src/utils.js | 2 +- cypress/support/step_definitions/fireboltCalls.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cypress/support/cypress-support/src/main.js b/cypress/support/cypress-support/src/main.js index 8e34c5ea..25ebaf59 100644 --- a/cypress/support/cypress-support/src/main.js +++ b/cypress/support/cypress-support/src/main.js @@ -400,9 +400,9 @@ export default function (module) { if (results) { // Response recieved from queue return results; - }else if(Cypress.env("isRpcOnlyValidation") ){ - return true - } + } else if (Cypress.env('isRpcOnlyValidation')) { + return true; + } }); } else { cy.log(CONSTANTS.APP_TRANSPORT_UNAVAILABLE).then(() => { diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index d01bf399..7011c8aa 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -84,7 +84,7 @@ function createIntentMessage(task, jsonParams, map = null) { ? (jsonQueryParams.isNotSupportedApi = map.isNotSupportedApi) : false; - Cypress.env("isRpcOnlyValidation")? jsonQueryParams.responseTimeout = 200000 : null + Cypress.env('isRpcOnlyValidation') ? (jsonQueryParams.responseTimeout = 200000) : null; const intent = { action: queryParams.action, data: { query: JSON.stringify(jsonQueryParams) }, diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 16b24efb..9affeffb 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -492,4 +492,4 @@ When( }); }); } -); \ No newline at end of file +); From 82443ba58a8ba49f0a72e500d6844ff37c2be5fc Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Wed, 12 Jun 2024 16:38:28 +0530 Subject: [PATCH 133/359] FIRECERT-1760-RpcOnly fixed linting issues-2 --- cypress/support/step_definitions/fireboltCalls.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 9affeffb..937e663b 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -422,7 +422,7 @@ Given(/I clear '(.+)' listeners$/, async (key) => { * And Fetch response for 'profile approvePurchase' method from '3rd party app' */ -When( +Given( /Fetch response for '(.+)' (method|event) from (3rd party app|1st party app)$/, (key, methodOrEvent, app) => { if (Cypress.env(CONSTANTS.TEST_TYPE).includes('rpc-Only')) { @@ -440,7 +440,7 @@ When( let params; if (app == CONSTANTS.FIRST_PARTY_APP) { - let extractedEvent = getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).filter( + const extractedEvent = getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).filter( (element) => element.eventName == method ); eventName = extractedEvent[extractedEvent.length - 1].eventObjectId; @@ -465,7 +465,7 @@ When( params = { method: method }; // Creating intent message using above details to send it to 3rd party app. - let parsedIntent = UTILS.createIntentMessage(CONSTANTS.TASK.GETMETHODRESPONSE, params); + const parsedIntent = UTILS.createIntentMessage(CONSTANTS.TASK.GETMETHODRESPONSE, params); // Fetching method response from third party app const requestTopic = UTILS.getTopic(appId); const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); From 9dc524127eaa3ffc4f0dc5f45929a0d1012da963 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Wed, 12 Jun 2024 16:49:48 +0530 Subject: [PATCH 134/359] Update utils.md file with resolAtRuntime function doc --- cypress/support/cypress-support/src/utils.js | 3 ++- cypress/support/cypress-support/src/utils.md | 24 +++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 46fdf4d2..7b947722 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -744,7 +744,8 @@ global.fireLog = fireLog; /** * @module utils * @globalfunction resolveAtRuntime - * @description Resolve the value for the passed input at runtime. + * @description Return the function which is having logic to resolve the value for the passed input at runtime. + * @param {String || Array} * @example * resolveAtRuntime(["result.{{attribute}}", "result.styles.{{attribute}}"]) * resolveAtRuntime("manage_closedcaptions.set{{attribute.uppercaseFirstChar}}") diff --git a/cypress/support/cypress-support/src/utils.md b/cypress/support/cypress-support/src/utils.md index e2bba8c0..62d3ae66 100644 --- a/cypress/support/cypress-support/src/utils.md +++ b/cypress/support/cypress-support/src/utils.md @@ -291,4 +291,26 @@ resolveDeviceVariable("deviceId") ### Examples: `fireLog.isTrue(isTrueValue, "True message");` `fireLog.isFalse(isFalseValue, "False message");` -`fireLog.deepEqual(actual, expected, "deepEqual message");` \ No newline at end of file +`fireLog.deepEqual(actual, expected, "deepEqual message");` + +## resolveAtRuntime + +### Purpose: Return the function which is having logic to resolve the value for the passed input at runtime. + +### Params: +| Param | Definition| Type | +| --- | --- | --- | +| input | value which need to resolved | string or Array | + +Note: Values of `attribute` and `value` will be stored in `runtime` environment variable while executing the glue + +### Examples: +request +- `resolveAtRuntime(["result.{{attribute}}", "result.styles.{{attribute}}"])` +- `resolveAtRuntime("manage_closedcaptions.set{{attribute.uppercaseFirstChar}}")` +- `resolveAtRuntime("value")` + +return +- `['result.fontSize', 'result.styles.fontSize']` +- `"manage_closedcaptions.setFontSize"` +- `1.5` \ No newline at end of file From abaad3957f5355a06ca911e16ec5af0b021f37ae Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Wed, 12 Jun 2024 16:50:21 +0530 Subject: [PATCH 135/359] added minor change --- cypress/support/cypress-support/src/utils.js | 69 ------------------- cypress/support/cypress-support/src/utils.md | 23 ------- .../support/step_definitions/fireboltCalls.js | 1 - 3 files changed, 93 deletions(-) diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 1d34cfa0..9173f724 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -741,75 +741,6 @@ class FireLog { const fireLog = new FireLog(); global.fireLog = fireLog; -/** - * @module utils - * @globalfunction resolveAtRuntime - * @description Return the function which is having logic to resolve the value for the passed input at runtime. - * @param {String || Array} - * @example - * resolveAtRuntime(["result.{{attribute}}", "result.styles.{{attribute}}"]) - * resolveAtRuntime("manage_closedcaptions.set{{attribute.uppercaseFirstChar}}") - * resolveAtRuntime("value") - * - * @returns - * ['result.fontSize', 'result.styles.fontSize'] - * "manage_closedcaptions.setFontSize" - * 1.5 - */ -global.resolveAtRuntime = function (input) { - return function () { - const functions = { - uppercaseFirstChar: function (str) { - return str.charAt(0).toUpperCase() + str.slice(1); - }, - lowercaseFirstChar: function (str) { - return str.charAt(0).toLowerCase() + str.slice(1); - }, - }; - - // Function to check the occurence of the pattern and updating the actual value - function replacingPatternOccurenceWithValue(text) { - return text.replace(/{{(.*?)}}/g, (match, pattern) => { - let functionName; - - // Separating the function name from the pattern, if it exists,. - if (pattern.includes('.')) { - functionName = pattern.split('.')[1]; - pattern = pattern.split('.')[0]; - } - - // If a function name is present in the pattern, call the function with pattern content as input. - // Reading the pattern content from the runtime environment variable - if (functionName && functions.hasOwnProperty(functionName)) { - return functions[functionName](getEnvVariable('runtime')[pattern] || match); - } else { - return getEnvVariable('runtime')[pattern] || match; - } - }); - } - - if (typeof input === CONSTANTS.TYPE_STRING) { - // Returning the actual pattern content for each occurrence of "{{" - if (input.includes('{{')) { - return replacingPatternOccurenceWithValue(input); - } - // If input not having "{{", returning content from runtime environment variable. - else if (!input.includes('{{')) { - return getEnvVariable('runtime')[input] || input; - } - } else if (Array.isArray(input) && input.length > 0) { - // input is an array; iterating through each element, it updates the actual value for that pattern if there is an occurrence of "{{". - return input.map((element) => { - if (element.includes('{{')) { - return replacingPatternOccurenceWithValue(element); - } - }); - } else { - logger.info(`Passed input - ${input} must be an array or a string.`); - } - }; -}; - /** * @module utils * @function parseValue diff --git a/cypress/support/cypress-support/src/utils.md b/cypress/support/cypress-support/src/utils.md index 303c6c0a..8b540239 100644 --- a/cypress/support/cypress-support/src/utils.md +++ b/cypress/support/cypress-support/src/utils.md @@ -293,29 +293,6 @@ resolveDeviceVariable("deviceId") `fireLog.isFalse(isFalseValue, "False message");` `fireLog.deepEqual(actual, expected, "deepEqual message");` - -## resolveAtRuntime - -### Purpose: Return the function which is having logic to resolve the value for the passed input at runtime. - -### Params: -| Param | Definition| Type | -| --- | --- | --- | -| input | value which need to resolved | string or Array | - -Note: Values of `attribute` and `value` will be stored in `runtime` environment variable while executing the glue - -### Examples: -request -- `resolveAtRuntime(["result.{{attribute}}", "result.styles.{{attribute}}"])` -- `resolveAtRuntime("manage_closedcaptions.set{{attribute.uppercaseFirstChar}}")` -- `resolveAtRuntime("value")` - -return -- `['result.fontSize', 'result.styles.fontSize']` -- `"manage_closedcaptions.setFontSize"` -- `1.5` - ## parseValue ### Purpose: Function to parse the passed string. diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index eee0ade7..353d453f 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -469,7 +469,6 @@ Given( } const context = {}; - //TODO: waiting for answer from jacob on expected const expected = fireboltCallObject.expected; appId = appId === CONSTANTS.THIRD_PARTY_APP From 110e9b92ea5c62bed2dc51abf80208fd54fbc472 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J <43801187+Abhishk123@users.noreply.github.com> Date: Wed, 12 Jun 2024 16:59:16 +0530 Subject: [PATCH 136/359] Update fireboltCalls.js --- cypress/support/step_definitions/fireboltCalls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 353d453f..f2112c8b 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -529,7 +529,7 @@ Given( cy.log(`Response from Firebolt platform: ${JSON.stringify(maskedResult)}`); }); - // Creating object with event name, params, and response etc and storing it in a global list for further validation. + // Creating object with method name, params, and response etc and storing it in a global list for further validation. const apiAppObject = new apiObject( setMethod, setParams, From 05bc397af992cb35ff34a750e42d492c3c2d7bcd Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 12 Jun 2024 17:28:16 +0530 Subject: [PATCH 137/359] FIRECERT-2144-addressed comments --- cypress/support/cypress-commands/commands.js | 7 +++++- cypress/support/cypress-commands/lifecycle.js | 22 +++++++++++++------ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 59099a5a..dda81e5f 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -186,7 +186,12 @@ Cypress.Commands.add('getDeviceVersion', () => { param: {}, action: CONSTANTS.ACTION_CORE.toLowerCase(), }; - cy.log('Device version intent: ' + JSON.stringify(requestMap)); + cy.log( + 'Call from 1st party App, method: ' + + requestMap.method + + ' params: ' + + JSON.stringify(requestMap.param) + ); cy.sendMessagetoPlatforms(requestMap).then((response) => { try { if (response && response.result) { diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 094f1a35..2a9b1859 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -214,32 +214,40 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent (isEventsExpected == false && appHistoryCount == 0) || state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING ) { + const updatedRequirement = lifecycleEventRequirementId?.event?.id.replace( + 'triggered', + 'not triggered' + ); UTILS.assertWithRequirementLogs( - CONSTANTS.PLATFORM_NOT_TRIGGER_EVENT + lifecycleEventRequirementId?.event?.id[0], + CONSTANTS.PLATFORM_NOT_TRIGGER_EVENT + updatedRequirement, CONSTANTS.PASS, CONSTANTS.PASS ); // If events are not expected but received } else if (isEventsExpected == false && appHistoryCount > 0) { + const updatedRequirement = lifecycleEventRequirementId?.event?.id.replace( + 'triggered', + 'not triggered' + ); UTILS.assertWithRequirementLogs( - CONSTANTS.PLATFORM_NOT_TRIGGER_EVENT + lifecycleEventRequirementId?.event?.id[0], + CONSTANTS.PLATFORM_NOT_TRIGGER_EVENT + updatedRequirement, CONSTANTS.FAIL, - CONSTANTS.FAIL + CONSTANTS.PASS ); } else { // If events are expected and received if (isEventsExpected == true && appHistoryCount > 0) { UTILS.assertWithRequirementLogs( - CONSTANTS.PLATFORM_TRIGGER_EVENT + lifecycleEventRequirementId?.event?.id[0], + CONSTANTS.PLATFORM_TRIGGER_EVENT + lifecycleEventRequirementId?.event?.id, CONSTANTS.PASS, CONSTANTS.PASS ); // If events are expected and not received } else if (isEventsExpected == true && appHistoryCount == 0) { UTILS.assertWithRequirementLogs( - CONSTANTS.PLATFORM_TRIGGER_EVENT + lifecycleEventRequirementId?.event?.id[0], + CONSTANTS.PLATFORM_TRIGGER_EVENT + lifecycleEventRequirementId?.event?.id, CONSTANTS.FAIL, - CONSTANTS.FAIL + CONSTANTS.PASS ); } for (let eventIndex = 1; eventIndex <= appHistoryCount; eventIndex++) { @@ -252,7 +260,7 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent appObjectEvent = appObjectStateItem.notification[0]; } // Perform schema and content validation of app event data against app object event data - const id = lifecycleEventRequirementId.event.id[1]; + const id = lifecycleEventRequirementId.event.id; let pretext = id === undefined ? ' : Schema ' : id + ' : Schema '; UTILS.assertWithRequirementLogs( From 2c3ae55a06cb0cf2e06ac2d6c1fce1c6f3395b62 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 13 Jun 2024 10:57:35 +0530 Subject: [PATCH 138/359] Updated log --- cypress/support/cypress-commands/commands.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 9bc88586..396cee09 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -35,6 +35,7 @@ Cypress.Commands.add( (key, callType = CONSTANTS.SUPPORTED_CALLTYPES.FIREBOLTCALLS) => { // Reading the data from combinedJson based on key. let fireboltData; + let logMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + key; if (callType == CONSTANTS.SUPPORTED_CALLTYPES.FIREBOLTMOCKS) { fireboltData = UTILS.getEnvVariable(CONSTANTS.COMBINEDFIREBOLTMOCKS)[key]; } else if (callType == CONSTANTS.SUPPORTED_CALLTYPES.SET_RESPONSE_JSON) { @@ -47,11 +48,12 @@ Cypress.Commands.add( } } else { fireboltData = UTILS.getEnvVariable('runtime', false)?.fireboltCall; + logMessage = 'Unable to find the firebolt object in the runtime environment variable'; } } if (!fireboltData) { - fireLog.assert(false, CONSTANTS.NO_DATA_FOR_THE_KEY + key); + fireLog.assert(false, logMessage); } return fireboltData; } From bf0a0f3ab811f23f418354a224f080fb1684c5ae Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Thu, 13 Jun 2024 11:05:53 +0530 Subject: [PATCH 139/359] Added functionality for userInterest behavioural scenarios --- .../UserInterest.feature | 2 +- .../objects/moduleReqId/moduleReqId.json | 160 ++++++++++-------- cypress/support/constants/constants.js | 3 + cypress/support/cypress-commands/commands.js | 10 ++ 4 files changed, 104 insertions(+), 71 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index 3a909fce..8dbccdf7 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -124,7 +124,7 @@ Feature: UserInterest @coreSDK @sdk @userinterest @notSupported Scenario: Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest without registering for providers - Given the environment has been set up for 'Userinterest' tests + Given the environment has been set up for 'UserInterestProvider' tests And 3rd party 'certification' app is launched When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type interest without provider' Then 'Firebolt' platform responds to '1st party app' with 'not available for requestUserInterest' diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 789a74af..b1edd4ca 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -2678,76 +2678,96 @@ } }, "UserInterest": { - "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type interest and reason playlist": { - "req": [ - { - "method": { - "id": "UserInterest 4.1", - "description": "Positive Scenario: with type interest and reason playlist" - } - } - ] - }, - "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type interest and reason reaction": { - "req": [ - { - "method": { - "id": "UserInterest 4.2", - "description": "Positive Scenario: with type interest and reason reaction" - } - } - ] - }, - "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type interest and reason recording": { - "req": [ - { - "method": { - "id": "UserInterest 4.3", - "description": "Positive Scenario: with type interest and reason recording" - } - } - ] - }, - "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type disinterest and reason playlist": { - "req": [ - { - "method": { - "id": "UserInterest 4.4", - "description": "Positive Scenario: with type disinterest and reason playlist" - } - } - ] - }, - "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type disinterest and reason reaction": { - "req": [ - { - "method": { - "id": "UserInterest 4.5", - "description": "Positive Scenario: with type disinterest and reason reaction" - } - } - ] - }, - "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type disinterest and reason recording": { - "req": [ - { - "method": { - "id": "UserInterest 4.6", - "description": "Positive Scenario: with type disinterest and reason recording" - } - } - ] - }, - "Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest without registering for providers": { - "req": [ - { - "method": { - "id": "UserInterest 4.7", - "description": "Negative Scenario: Notify requestUserInterest without registering for providers" - } - } - ] - } + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type interest and reason playlist": { + "req": [ + { + "method": { + "id": "UserInterest 4.1", + "description": "Positive Scenario: with type interest and reason playlist" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type interest and reason reaction": { + "req": [ + { + "method": { + "id": "UserInterest 4.2", + "description": "Positive Scenario: with type interest and reason reaction" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type interest and reason recording": { + "req": [ + { + "method": { + "id": "UserInterest 4.3", + "description": "Positive Scenario: with type interest and reason recording" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type disinterest and reason playlist": { + "req": [ + { + "method": { + "id": "UserInterest 4.4", + "description": "Positive Scenario: with type disinterest and reason playlist" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type disinterest and reason reaction": { + "req": [ + { + "method": { + "id": "UserInterest 4.5", + "description": "Positive Scenario: with type disinterest and reason reaction" + } + } + ] + }, + "Content.requestUserInterest - Positive Scenario: Platform-UX - Notify requestUserInterest with type disinterest and reason recording": { + "req": [ + { + "method": { + "id": "UserInterest 4.6", + "description": "Positive Scenario: with type disinterest and reason recording" + } + } + ] + }, + "Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest but platform timeout without sending response": { + "req": [ + { + "method": { + "id": "UserInterest 4.7", + "description": "Positive Scenario: with type disinterest and reason recording" + } + } + ] + }, + "Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest but 3rd party app return error": { + "req": [ + { + "method": { + "id": "UserInterest 4.8", + "description": "Negative Scenario: Notify requestUserInterest without registering for providers" + } + } + ] + }, + "Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest without registering for providers": { + "req": [ + { + "method": { + "id": "UserInterest 4.9", + "description": "Negative Scenario: Notify requestUserInterest without registering for providers" + } + } + ] + } } } } \ No newline at end of file diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 1049a00e..9c758a85 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -203,6 +203,7 @@ module.exports = { 'AcknowledgeChallenge', 'userGrants', 'lifeCycleApi', + 'UserInterestProvider' ], LIFECYCLE_FINISHED_ERROR: 'lifecycleFinishedError', LIFECYCLE_HISTORY_FAILED: 'Failed to fetch lifecycle history due to following error: ', @@ -416,6 +417,8 @@ module.exports = { ENV_SETUP_STATUS: 'environmentLaunched', APP_LAUNCH_STATUS: 'appLaunched', NO_EVENT_TRIGGERED: 'Expecting no event to be triggered from platform', + REGISTERPROVIDER: 'registerprovider', + USERINTERESTPROVIDER: 'userinterestprovider', }; function getSanityReportPath() { // Check if Cypress is defined, for cypress test context diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index b1096418..fdedd0f2 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -675,6 +675,16 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { }; requestMap.params.intent.data = data; } + if (Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.USERINTERESTPROVIDER) { + data = { + query: JSON.stringify({ + params: { + [CONSTANTS.REGISTERPROVIDER]: false, + } + }) + }; + requestMap.params.intent.data = data; + } Cypress.env(CONSTANTS.CURRENT_APP_ID, appId); From 35d09f4fd3e78b517c10d9b8265c8c7002bcb588 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Thu, 13 Jun 2024 12:38:04 +0530 Subject: [PATCH 140/359] Fixed lint issues --- cypress/support/constants/constants.js | 2 +- cypress/support/cypress-commands/commands.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 9c758a85..674b742f 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -203,7 +203,7 @@ module.exports = { 'AcknowledgeChallenge', 'userGrants', 'lifeCycleApi', - 'UserInterestProvider' + 'UserInterestProvider', ], LIFECYCLE_FINISHED_ERROR: 'lifecycleFinishedError', LIFECYCLE_HISTORY_FAILED: 'Failed to fetch lifecycle history due to following error: ', diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index fdedd0f2..b15c4e19 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -680,8 +680,8 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { query: JSON.stringify({ params: { [CONSTANTS.REGISTERPROVIDER]: false, - } - }) + }, + }), }; requestMap.params.intent.data = data; } From d9f7e0172d87d6190ef48d5ddf137a0b3d588735 Mon Sep 17 00:00:00 2001 From: rajanika Date: Thu, 13 Jun 2024 19:57:06 +0530 Subject: [PATCH 141/359] Proposed solution --- cypress/support/validations/decodeValidation.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cypress/support/validations/decodeValidation.js b/cypress/support/validations/decodeValidation.js index e430cacc..c1b9a60a 100644 --- a/cypress/support/validations/decodeValidation.js +++ b/cypress/support/validations/decodeValidation.js @@ -129,9 +129,10 @@ class decodeValidations { const decode = atob(token); if (decode.includes(param)) { + const indexOfParam = decode.indexOf(param); const extractedData = decode.slice( - decode.indexOf(param) + REGEXFORMATS[param][0], - decode.indexOf(param) + REGEXFORMATS[param][1] + indexOfParam + param.length + 2, + decode.indexOf(' Date: Thu, 13 Jun 2024 20:38:23 +0530 Subject: [PATCH 142/359] FIRECERT-1760-RpcOnly updated glue code --- .../Manage/AcknowledgeChallengeManage_RpcOnly.feature | 8 ++++---- .../Manage/KeyboardManage_RpcOnly.feature | 8 ++++---- .../Manage/ProfileManage_RpcOnly.feature | 8 ++++---- cypress/support/cypress-commands/commands.js | 8 ++++++++ cypress/support/step_definitions/fireboltCalls.js | 10 ++++++---- cypress/support/step_definitions/testSetup.js | 3 +++ 6 files changed, 29 insertions(+), 16 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature index 955fe6b2..d16f7347 100644 --- a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature @@ -10,10 +10,10 @@ And User set response for 'set acknowledge granted' When 1st party app registers for the 'acknowledgeChallenge onRequestChallenge manage' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to 'get localization countryCode' - And Fetch response for 'acknowledgeChallenge onRequestChallenge' event from '1st party app' + And Fetch response for 'acknowledgeChallenge onRequestChallenge' event from 1st party app And 1st party app invokes the 'Firebolt' API to 'get acknowledgeChallenge challengeFocus' And 1st party app invokes the 'Firebolt' API to 'get acknowledgeChallenge challengeResponse' - And Fetch response for 'get localization countryCode' method from '3rd party app' + And Fetch response for 'get localization countryCode' method from 3rd party app Then 'Firebolt' platform responds with 'expected localization countryCode' @transport @ripple @@ -24,7 +24,7 @@ And User set response for 'set acknowledge granted' When 1st party app registers for the 'acknowledgeChallenge onRequestChallenge manage' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to 'get localization countryCode' - And Fetch response for 'acknowledgeChallenge onRequestChallenge' event from '1st party app' + And Fetch response for 'acknowledgeChallenge onRequestChallenge' event from 1st party app And 1st party app invokes the 'Firebolt' API to 'get acknowledgeChallenge challengeError' - And Fetch response for 'get localization countryCode' method from '3rd party app' + And Fetch response for 'get localization countryCode' method from 3rd party app Then 'Firebolt' platform responds with 'expected localization countryCode' \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature index c526d82a..de758ab1 100644 --- a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature @@ -8,10 +8,10 @@ Feature: Keyboard_Manage_RpcOnly And 3rd party 'certification' app is launched When 1st party app registers for the '' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to '' - And Fetch response for '' event from '1st party app' + And Fetch response for '' event from 1st party app And 1st party app invokes the 'Firebolt' API to '' And 1st party app invokes the 'Firebolt' API to '' - And Fetch response for '' method from '3rd party app' + And Fetch response for '' method from 3rd party app Then 'Firebolt' platform responds with '' Examples: | Scenario | ManageEventName | EventName | MethodName | MethodParam | FocusMethod | ResponseMethod | MethodResponse | @@ -25,9 +25,9 @@ Feature: Keyboard_Manage_RpcOnly And 3rd party 'certification' app is launched When 1st party app registers for the '' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to '' - And Fetch response for '' event from '1st party app' + And Fetch response for '' event from 1st party app And 1st party app invokes the 'Firebolt' API to '' - And Fetch response for '' method from '3rd party app' + And Fetch response for '' method from 3rd party app Then 'Firebolt' platform responds with '' Examples: diff --git a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature index a4af897e..8304d255 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature @@ -8,10 +8,10 @@ Feature: Profile_Manage_RpcOnly And 3rd party 'certification' app is launched When 1st party app registers for the 'pinChallenge onRequestChallenge manage' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to 'profile approvePurchase' - And Fetch response for 'pinChallenge onRequestChallenge' event from '1st party app' + And Fetch response for 'pinChallenge onRequestChallenge' event from 1st party app And 1st party app invokes the 'Firebolt' API to 'get pinChallenge challengeFocus' And 1st party app invokes the 'Firebolt' API to 'get pinChallenge challengeResponse' - And Fetch response for 'profile approvePurchase' method from '3rd party app' + And Fetch response for 'profile approvePurchase' method from 3rd party app Then 'Firebolt' platform responds with 'true for profile approvepurchase' @@ -21,7 +21,7 @@ Feature: Profile_Manage_RpcOnly And 3rd party 'certification' app is launched When 1st party app registers for the 'pinChallenge onRequestChallenge manage' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to 'profile approvePurchase' - And Fetch response for 'pinChallenge onRequestChallenge' event from '1st party app' + And Fetch response for 'pinChallenge onRequestChallenge' event from 1st party app And 1st party app invokes the 'Firebolt' API to 'get pinChallenge challengeError' - And Fetch response for 'profile approvePurchase' method from '3rd party app' + And Fetch response for 'profile approvePurchase' method from 3rd party app Then 'Firebolt' platform responds with 'true for profile approvepurchase' \ No newline at end of file diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index c7718a7f..b9025177 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -80,6 +80,14 @@ Cypress.Commands.add('fireboltDataParser', (key, sdk = CONSTANTS.SUPPORTED_SDK[0 const envParam = params.split('-')[1]; params = UTILS.getEnvVariable(envParam, false); } + // If params contain CYPRESSENV in any parameter assigning corresponding env value + let containEnv = Object.keys(params).find((key) => key.includes('CYPRESSENV')); + if (containEnv) { + let envParam = containEnv.split('-')[1]; + params[envParam] = Cypress.env(envParam); + delete params[containEnv]; + } + method = item.method; const expected = item.expected ? item.expected : CONSTANTS.RESULT; action = CONSTANTS.ACTION_CORE.toLowerCase(); diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 937e663b..d47426ae 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -424,7 +424,7 @@ Given(/I clear '(.+)' listeners$/, async (key) => { Given( /Fetch response for '(.+)' (method|event) from (3rd party app|1st party app)$/, - (key, methodOrEvent, app) => { + async (key, methodOrEvent, app) => { if (Cypress.env(CONSTANTS.TEST_TYPE).includes('rpc-Only')) { Cypress.env(CONSTANTS.IS_RPC_ONLY, true); } @@ -432,6 +432,7 @@ Given( cy.fireboltDataParser(key).then((parsedDataArr) => { parsedDataArr.forEach((parsedData) => { const method = parsedData.method; + let appId; appId = !appId ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : appId === CONSTANTS.FIRST_PARTY_APP @@ -440,7 +441,7 @@ Given( let params; if (app == CONSTANTS.FIRST_PARTY_APP) { - const extractedEvent = getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).filter( + const extractedEvent = UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).filter( (element) => element.eventName == method ); eventName = extractedEvent[extractedEvent.length - 1].eventObjectId; @@ -458,8 +459,8 @@ Given( assert(false, CONSTANTS.NO_MATCHED_RESPONSE); }); } - cy.log(`correlationId - ${response.eventResponse.correlationId}`); - Cypress.env(CONSTANTS.correlationId, response.eventResponse.correlationId); + cy.log(`correlationId - ${response.result.correlationId}`); + Cypress.env(CONSTANTS.CORRELATIONID, response.result.correlationId); }); } else if (app == CONSTANTS.THIRD_PARTY_APP) { params = { method: method }; @@ -487,6 +488,7 @@ Given( Cypress.env(CONSTANTS.GLOBAL_API_OBJECT_LIST)[index].response = response; } } + //create new api object to push to global list }); } }); diff --git a/cypress/support/step_definitions/testSetup.js b/cypress/support/step_definitions/testSetup.js index 7cdc845f..441a70fb 100644 --- a/cypress/support/step_definitions/testSetup.js +++ b/cypress/support/step_definitions/testSetup.js @@ -51,6 +51,9 @@ Given('the environment has been set up for {string} tests', (test) => { cy.getCapabilities(); destroyAppInstance(test); Cypress.env(CONSTANTS.ENV_SETUP_STATUS, true); + if (Cypress.env(CONSTANTS.TEST_TYPE).includes('rpc-Only')) { + Cypress.env(CONSTANTS.IS_RPC_ONLY, true); + } } }); From 919f3006406d60a875c1434655af4fe57c2cd9f8 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Thu, 13 Jun 2024 20:44:59 +0530 Subject: [PATCH 143/359] FIRECERT-1760-RpcOnly fixed linting issues --- cypress/support/cypress-commands/commands.js | 4 ++-- cypress/support/step_definitions/fireboltCalls.js | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index b9025177..61bc3b90 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -81,9 +81,9 @@ Cypress.Commands.add('fireboltDataParser', (key, sdk = CONSTANTS.SUPPORTED_SDK[0 params = UTILS.getEnvVariable(envParam, false); } // If params contain CYPRESSENV in any parameter assigning corresponding env value - let containEnv = Object.keys(params).find((key) => key.includes('CYPRESSENV')); + const containEnv = Object.keys(params).find((key) => key.includes('CYPRESSENV')); if (containEnv) { - let envParam = containEnv.split('-')[1]; + const envParam = containEnv.split('-')[1]; params[envParam] = Cypress.env(envParam); delete params[containEnv]; } diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index d47426ae..dd139b55 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -432,8 +432,7 @@ Given( cy.fireboltDataParser(key).then((parsedDataArr) => { parsedDataArr.forEach((parsedData) => { const method = parsedData.method; - let appId; - appId = !appId + const appId = !appId ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : appId === CONSTANTS.FIRST_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) @@ -488,7 +487,7 @@ Given( Cypress.env(CONSTANTS.GLOBAL_API_OBJECT_LIST)[index].response = response; } } - //create new api object to push to global list + // create new api object to push to global list }); } }); From 45055764dbd07438dc16e823cce1b0eaa51b45f3 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 14 Jun 2024 11:36:18 +0530 Subject: [PATCH 144/359] addressed the comment --- cypress/support/cypress-commands/commands.js | 14 +- cypress/support/cypress-support/src/utils.js | 2 +- .../support/step_definitions/fireboltCalls.js | 143 ++++++------------ 3 files changed, 51 insertions(+), 108 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index fa219826..9b5068bb 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -35,25 +35,15 @@ Cypress.Commands.add( (key, callType = CONSTANTS.SUPPORTED_CALLTYPES.FIREBOLTCALLS) => { // Reading the data from combinedJson based on key. let fireboltData; - let logMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + key; if (callType == CONSTANTS.SUPPORTED_CALLTYPES.FIREBOLTMOCKS) { fireboltData = UTILS.getEnvVariable(CONSTANTS.COMBINEDFIREBOLTMOCKS)[key]; } else if (callType == CONSTANTS.SUPPORTED_CALLTYPES.SET_RESPONSE_JSON) { fireboltData = UTILS.getEnvVariable('setResponseJson')[key]; } else { - if (key) { - fireboltData = UTILS.getEnvVariable(CONSTANTS.COMBINEDFIREBOLTCALLS)[key]; - if (UTILS.getEnvVariable('runtime', false)) { - UTILS.getEnvVariable('runtime', false).fireboltCall = fireboltData; - } - } else { - fireboltData = UTILS.getEnvVariable('runtime', false)?.fireboltCall; - logMessage = 'Unable to find the firebolt object in the runtime environment variable'; - } + fireboltData = UTILS.getEnvVariable(CONSTANTS.COMBINEDFIREBOLTCALLS)[key]; } - if (!fireboltData) { - fireLog.assert(false, logMessage); + fireLog.assert(false, CONSTANTS.NO_DATA_FOR_THE_KEY + key); } return fireboltData; } diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 06ae1cfe..15e31f79 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -766,7 +766,7 @@ function parseValue(str) { try { return JSON.parse(value); } catch (error) { - fireLog.assert(false, `Failed to parse value - ${erorr}`); + fireLog.assert(false, `Failed to parse value - ${error}`); } } diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index f2112c8b..045ac7f2 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -437,57 +437,66 @@ Given(/User triggers event with value as '(.+)'/, (key) => { * Given '3rd party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true' */ Given( - /'(.+)' invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to '(.+)'$/, - async (appId, sdk, fireboltCallKey, attribute, value) => { + /1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)'$/, + async (sdk, fireboltCallKey, attribute, invalidValue, value) => { if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { value = UTILS.parseValue(value); + let fireboltCallObject; + let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; Cypress.env('runtime', { attribute: attribute, value: value, }); - cy.getFireboltData(fireboltCallKey).then((fireboltCallObject) => { - let setMethod = - typeof fireboltCallObject.setMethod === CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.setMethod() - : fireboltCallObject.setMethod; - let setParams; - - if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_FUNCTION) { - setParams = { value: fireboltCallObject.setParams() }; - } else if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_OBJECT) { - setParams = fireboltCallObject.setParams; - - for (const key in setParams) { - if (typeof setParams[key] === CONSTANTS.TYPE_FUNCTION) { - setParams[key] = setParams[key](); + if (fireboltCallKey) { + cy.getFireboltData(fireboltCallKey).then((fireboltData) => { + fireboltCallObject = fireboltData; + UTILS.getEnvVariable('runtime').fireboltCall = fireboltData; + }); + } else { + fireboltCallObject = UTILS.getEnvVariable('runtime').fireboltCall; + fireboltCallObjectErrorMessage = + 'Unable to find the firebolt object in the runtime environment variable'; + } + + cy.then(() => { + if (!fireboltCallObject) { + fireLog.assert(false, fireboltCallObjectErrorMessage); + } else { + let setMethod = + typeof fireboltCallObject.setMethod === CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.setMethod() + : fireboltCallObject.setMethod; + let setParams; + + if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_FUNCTION) { + setParams = { value: fireboltCallObject.setParams() }; + } else if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_OBJECT) { + setParams = fireboltCallObject.setParams; + + for (const key in setParams) { + if (typeof setParams[key] === CONSTANTS.TYPE_FUNCTION) { + setParams[key] = setParams[key](); + } } + } else { + setParams = { value: fireboltCallObject.setParams }; } - } else { - setParams = { value: fireboltCallObject.setParams }; - } - - const context = {}; - const expected = fireboltCallObject.expected; - appId = - appId === CONSTANTS.THIRD_PARTY_APP - ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : appId === CONSTANTS.FIRST_PARTY_APP - ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) - : appId; - let action = CONSTANTS.ACTION_CORE.toLowerCase(); - if (setMethod && setMethod.includes('_')) { - action = setMethod.split('_')[0]; - setMethod = setMethod.split('_')[1]; - } - // If method and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(setMethod, setParams)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } + const context = {}; + const expected = invalidValue ? 'error' : 'result'; + const appId = Cypress.env(CONSTANTS.FIRST_PARTY_APPID); + let action = CONSTANTS.ACTION_CORE.toLowerCase(); + if (setMethod && setMethod.includes('_')) { + action = setMethod.split('_')[0]; + setMethod = setMethod.split('_')[1]; + } - if (appId === UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { + // If method and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(setMethod, setParams)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } const requestMap = { method: setMethod, params: setParams, @@ -544,62 +553,6 @@ Given( cy.log(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); } }); - } else { - let isNotSupportedApi = false; - - if (UTILS.isScenarioExempted(setMethod, setParams)) { - isNotSupportedApi = true; - } - - const communicationMode = UTILS.getCommunicationMode(); - const additionalParams = { - communicationMode: communicationMode, - action: action, - isNotSupportedApi: isNotSupportedApi, - }; - const params = { method: setMethod, methodParams: setParams }; - - // Creating intent message using above details to send it to 3rd party app. - const intentMessage = UTILS.createIntentMessage( - CONSTANTS.TASK.CALLMETHOD, - params, - additionalParams - ); - - cy.log(`Call from ${appId}, method: ${setMethod} params: ${JSON.stringify(setParams)}`); - - // Adding additional details to created intent if any platform specific data is present in configModule. - cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { - const requestTopic = UTILS.getTopic(appId); - const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); - - // Sending message to 3rd party app. - cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { - if (result === CONSTANTS.NO_RESPONSE) { - assert(false, CONSTANTS.NO_MATCHED_RESPONSE); - } - result = JSON.parse(result); - - // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(result.report.apiResponse); - - // Call the 'censorData' command to hide sensitive data - cy.censorData(setMethod, dataToBeCensored).then((maskedResult) => { - cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); - }); - - // Creating object with method name, params and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - setMethod, - setParams, - context, - result.report, - expected, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); - }); - }); } }); } else { From ce358eb482522709d9dae0008215c0949789c337 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 14 Jun 2024 16:19:28 +0530 Subject: [PATCH 145/359] FIRECERT-1760-RpcOnly added changes in new glue code --- cypress/fixtures/fireboltCalls/keyboard.json | 12 ++ cypress/fixtures/fireboltCalls/profile.json | 6 +- cypress/fixtures/modules/keyboard.json | 186 ++++++++---------- cypress/fixtures/modules/profile.json | 40 ++-- .../support/step_definitions/fireboltCalls.js | 70 ++++--- 5 files changed, 166 insertions(+), 148 deletions(-) diff --git a/cypress/fixtures/fireboltCalls/keyboard.json b/cypress/fixtures/fireboltCalls/keyboard.json index 5b9c0bcc..e72961ce 100644 --- a/cypress/fixtures/fireboltCalls/keyboard.json +++ b/cypress/fixtures/fireboltCalls/keyboard.json @@ -20,6 +20,10 @@ "method": "keyboard.password", "params": "KEYBOARD_PASSWORD_PARAMS" }, + "PROMPT_THE_USER_FOR_THEIR_USERNAME": { + "method": "keyboard.standard", + "params": "KEYBOARD_STANDARD_PARAMS" + }, "PROMPT_THE_USER_FOR_THEIR_PASSWORD_AS_EMPTY": { "method": "keyboard.password" }, @@ -99,6 +103,14 @@ "method": "keyboard.email", "params": "KEYBOARD_EMAIL" }, + "KEYBOARD_STANDARD": { + "method": "keyboard.standard", + "params": "KEYBOARD_STANDARD_PARAMS" + }, + "KEYBOARD_PASSWORD": { + "method": "keyboard.password", + "params": "KEYBOARD_PASSWORD_PARAMS" + }, "KEYBOARD_ONREQUESTEMAIL_MANAGE":{ "method": "manage_keyboard.onRequestEmail" }, diff --git a/cypress/fixtures/fireboltCalls/profile.json b/cypress/fixtures/fireboltCalls/profile.json index a5dce0f8..a9f0a624 100644 --- a/cypress/fixtures/fireboltCalls/profile.json +++ b/cypress/fixtures/fireboltCalls/profile.json @@ -54,14 +54,14 @@ }, "GET_PINCHALLENGE_CHALLENGEFOCUS":{ "method": "pinChallenge.challengeFocus", - "params": "PINCHALLENGE_CHALLENGEFOCUS_PARAMS" + "params": "PROFILE_PINCHALLENGE_CHALLENGEFOCUS_PARAMS" }, "GET_PINCHALLENGE_CHALLENGERESPONSE":{ "method": "pinChallenge.challengeResponse", - "params": "PINCHALLENGE_CHALLENGERESPONSE_PARAMS" + "params": "PROFILE_PINCHALLENGE_CHALLENGERESPONSE_PARAMS" }, "GET_PINCHALLENGE_CHALLENGEERROR":{ "method": "pinChallenge.challengeError", - "params": "PINCHALLENGE_CHALLENGE_ERROR_PARAMS" + "params": "PROFILE_PINCHALLENGE_CHALLENGE_ERROR_PARAMS" } } \ No newline at end of file diff --git a/cypress/fixtures/modules/keyboard.json b/cypress/fixtures/modules/keyboard.json index 38f80b86..db8a7a60 100644 --- a/cypress/fixtures/modules/keyboard.json +++ b/cypress/fixtures/modules/keyboard.json @@ -1,102 +1,90 @@ { - "EMAIL_SIGNIN_PARAMS": { - "type": "signIn", - "message": "Enter your email to sign into this app" - }, - "EMAIL_PARAMS_WITH_SIGNUP": { - "type": "signUp", - "message": "Enter your email to sign into this app" - }, - "EMAIL_PARAMS_WITH_TYPE_ALONE": { - "type": "signIn" - }, - "PASSWORD_PARAMS": { - "message": "Enter your password" - }, - "STANDARD_PARAMS": { - "message": "Enter the name you'd like to associate with this device" - }, - "INVALIDSTRING_EMAILUSAGE_AND_MESSAGE": { - "type": "testing", - "message": "Enter email to sing into app" - }, - "INTEGER_EMAILUSAGE_AND_MESSAGE": { - "type": 123, - "message": 123 - }, - "PASSWORD_INTEGER_MESSAGE": { - "message": 123 - }, - "STANDARD_INTEGER_MESSAGE": { - "message": 456 - }, - "EMAIL": { - "result": "john@doe.com" - }, - "PASSWORD": { - "result": "Abc##123" - }, - "EMAILFOCUS": { - "CYPRESSENV-correlationId": "123" - }, - "STANDARDFOCUS": { - "CYPRESSENV-correlationId": "123" - }, - "PASSWORDFOCUS": { - "CYPRESSENV-correlationId": "123" - }, - "EMAILRESPONSE": { - "CYPRESSENV-correlationId": "123", - "result": { - "text": "email@address.com", - "canceled": false - } - }, - "STANDARDRESPONSE": { - "CYPRESSENV-correlationId": "123", - "result": { - "text": "email@address.com", - "canceled": false - } - }, - "PASSWORDRESPONSE": { - "CYPRESSENV-correlationId": "123", - "result": { - "text": "Abc##123", - "canceled": false - } - }, - "KEYBOARD_EMAILERROR": { - "error": { - "CYPRESSENV-correlationId": "123", - "result": { - "code": 1, - "message": "Error" - } - } - }, - "KEYBOARD_STANDARDERROR": { - "error": { - "CYPRESSENV-correlationId": "123", - "result": { - "name": "error", - "value": { - "CYPRESSENV-correlationId": "123", - "result": { - "code": 1, - "message": "Error" - } - } - } - } - }, - "KEYBOARD_PASSWORDERROR": { - "error": { - "CYPRESSENV-correlationId": "123", - "result": { - "code": 1, - "message": "Error" - } - } + "EMAIL_SIGNIN_PARAMS": { + "type": "signIn", + "message": "Enter your email to sign into this app" + }, + "EMAIL_PARAMS_WITH_SIGNUP": { + "type": "signUp", + "message": "Enter your email to sign into this app" + }, + "EMAIL_PARAMS_WITH_TYPE_ALONE": { + "type": "signIn" + }, + "PASSWORD_PARAMS": { + "message": "Enter your password" + }, + "STANDARD_PARAMS": { + "message": "Enter the name you'd like to associate with this device" + }, + "INVALIDSTRING_EMAILUSAGE_AND_MESSAGE": { + "type": "testing", + "message": "Enter email to sing into app" + }, + "INTEGER_EMAILUSAGE_AND_MESSAGE": { + "type": 123, + "message": 123 + }, + "PASSWORD_INTEGER_MESSAGE": { + "message": 123 + }, + "STANDARD_INTEGER_MESSAGE": { + "message": 456 + }, + "EMAIL": { + "result": "john@doe.com" + }, + "PASSWORD": { + "result": "Abc##123" + }, + "EMAILFOCUS": { + "CYPRESSENV-correlationId": "123" + }, + "STANDARDFOCUS": { + "CYPRESSENV-correlationId": "123" + }, + "PASSWORDFOCUS": { + "CYPRESSENV-correlationId": "123" + }, + "EMAILRESPONSE": { + "CYPRESSENV-correlationId": "123", + "result": { + "text": "email@address.com", + "canceled": false + } + }, + "STANDARDRESPONSE": { + "CYPRESSENV-correlationId": "123", + "result": { + "text": "email@address.com", + "canceled": false + } + }, + "PASSWORDRESPONSE": { + "CYPRESSENV-correlationId": "123", + "result": { + "text": "Abc##123", + "canceled": false + } + }, + "EMAILERROR": { + "CYPRESSENV-correlationId": "123", + "error": { + "code": 1, + "message": "Error" + } + }, + "STANDARDERROR": { + "CYPRESSENV-correlationId": "123", + "error": { + "code": 1, + "message": "Error" + } + }, + "PASSWORDERROR": { + "CYPRESSENV-correlationId": "123", + "error": { + "code": 1, + "message": "Error" + } } } \ No newline at end of file diff --git a/cypress/fixtures/modules/profile.json b/cypress/fixtures/modules/profile.json index e363e1b8..4a99de8a 100644 --- a/cypress/fixtures/modules/profile.json +++ b/cypress/fixtures/modules/profile.json @@ -1,24 +1,22 @@ { - "FLAGS": { - "userExperience": "1001" - }, - "PINCHALLENGE_CHALLENGEFOCUS_PARAMS": { - "CYPRESSENV-correlationId": "123" - }, - "PINCHALLENGE_CHALLENGERESPONSE_PARAMS": { - "CYPRESSENV-correlationId": "123", - "result": { - "granted": true, - "reason": "correctPin" - } - }, - "PINCHALLENGE_CHALLENGE_ERROR_PARAMS": { - "error": { - "CYPRESSENV-correlationId": "123", - "result": { - "code": 1, - "message": "Error" - } - } + "FLAGS": { + "userExperience": "1001" + }, + "PINCHALLENGE_CHALLENGEFOCUS_PARAMS": { + "CYPRESSENV-correlationId": "123" + }, + "PINCHALLENGE_CHALLENGERESPONSE_PARAMS": { + "CYPRESSENV-correlationId": "123", + "result": { + "granted": true, + "reason": "correctPin" } + }, + "PINCHALLENGE_CHALLENGE_ERROR_PARAMS": { + "CYPRESSENV-correlationId": "123", + "error": { + "code": 1, + "message": "Error" + } + } } \ No newline at end of file diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index dd139b55..3ffb7e9a 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -159,34 +159,36 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { // Sending message to 3rd party app. cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { - if (result === CONSTANTS.NO_RESPONSE) { - assert(false, CONSTANTS.NO_MATCHED_RESPONSE); - } - result = JSON.parse(result); + if (!Cypress.env('isRpcOnlyValidation')) { + if (result === CONSTANTS.NO_RESPONSE) { + assert(false, CONSTANTS.NO_MATCHED_RESPONSE); + } + result = JSON.parse(result); - // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(result.report.apiResponse); + // Create a deep copy to avoid reference mutation + const dataToBeCensored = _.cloneDeep(result.report.apiResponse); - // Call the 'censorData' command to hide sensitive data - cy.censorData(method, dataToBeCensored).then((maskedResult) => { - cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); - }); + // Call the 'censorData' command to hide sensitive data + cy.censorData(method, dataToBeCensored).then((maskedResult) => { + cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); + }); - // If method and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(method, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } + // If method and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(method, param)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } - // Creating object with method name, params and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - method, - param, - context, - result.report, - expected, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + // Creating object with method name, params and response etc and storing it in a global list for further validation. + const apiAppObject = new apiObject( + method, + param, + context, + result.report, + expected, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + } }); }); }); @@ -432,7 +434,13 @@ Given( cy.fireboltDataParser(key).then((parsedDataArr) => { parsedDataArr.forEach((parsedData) => { const method = parsedData.method; - const appId = !appId + const param = parsedData.params; + const context = parsedData.context; + const action = parsedData.action; + const expected = parsedData.expected; + + let appId = null; + appId = !appId ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : appId === CONSTANTS.FIRST_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) @@ -487,7 +495,19 @@ Given( Cypress.env(CONSTANTS.GLOBAL_API_OBJECT_LIST)[index].response = response; } } + if (typeof response == 'string') { + response = JSON.parse(response); + } // create new api object to push to global list + const apiAppObject = new apiObject( + method, + param, + context, + response.report, + expected, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); }); } }); From 481946a699f8bcd2034fb7a5d9741f26ca1c7e72 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 14 Jun 2024 22:14:47 +0530 Subject: [PATCH 146/359] addressed the comment --- .../support/step_definitions/fireboltCalls.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 045ac7f2..0e753bee 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -425,16 +425,17 @@ Given(/User triggers event with value as '(.+)'/, (key) => { /** * @module fireboltCalls - * @function And '(.+)' invokes the '(.+)' API '(.+)' to set '(.+)' to '(.+)' - * @description send message to platform to make api call. - * @param {String} appId - app identifier, determines for which App sending the message to make a API call. + * @function 1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)' + * @description Sending a message to platform to set a value * @param {String} sdk - sdk name. * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. * @param {String} attribute - The attribute we are setting (ex. fontFamily). - * @param {String} value - The value we set the attribute to (ex. monospaced_sanserif) + * @param {String} invalidValue - Determines whether expecting for an error or result. + * @param {String} value - The value used by the set method to set the value (ex. monospaced_sanserif) * @example * Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true' - * Given '3rd party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true' + * Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to invalid 'test' + * Given '1st party app' invokes the 'Firebolt' API to set 'enable' to 'true' */ Given( /1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)'$/, @@ -444,11 +445,13 @@ Given( let fireboltCallObject; let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; + // runtime environment variable holds attribut and value Cypress.env('runtime', { attribute: attribute, value: value, }); + // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable if (fireboltCallKey) { cy.getFireboltData(fireboltCallKey).then((fireboltData) => { fireboltCallObject = fireboltData; @@ -461,6 +464,7 @@ Given( } cy.then(() => { + // Failing the test when fireboltCall object not there if (!fireboltCallObject) { fireLog.assert(false, fireboltCallObjectErrorMessage); } else { @@ -470,11 +474,13 @@ Given( : fireboltCallObject.setMethod; let setParams; + // Extracting the parameter from the fireboltCall object if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_FUNCTION) { setParams = { value: fireboltCallObject.setParams() }; } else if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_OBJECT) { setParams = fireboltCallObject.setParams; + // Iterating through the object and invoking it if it is a function for (const key in setParams) { if (typeof setParams[key] === CONSTANTS.TYPE_FUNCTION) { setParams[key] = setParams[key](); @@ -488,6 +494,8 @@ Given( const expected = invalidValue ? 'error' : 'result'; const appId = Cypress.env(CONSTANTS.FIRST_PARTY_APPID); let action = CONSTANTS.ACTION_CORE.toLowerCase(); + + // Splitting the method name if it contains an underscore and using the first part to determine the action that decides sdk. if (setMethod && setMethod.includes('_')) { action = setMethod.split('_')[0]; setMethod = setMethod.split('_')[1]; From 2cc5b2e2f84a8c2bc0b8da8a322511d8f50726ba Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 14 Jun 2024 22:32:15 +0530 Subject: [PATCH 147/359] Corrected the parseValue function --- cypress/support/cypress-support/src/utils.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 15e31f79..a20b815c 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -763,11 +763,6 @@ function parseValue(str) { if (str === 'false') return false; if (!isNaN(str)) return Number(str); - try { - return JSON.parse(value); - } catch (error) { - fireLog.assert(false, `Failed to parse value - ${error}`); - } } return str; From 685a036a8c489fff1769edc969ee3cad9f655ff4 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 14 Jun 2024 22:45:57 +0530 Subject: [PATCH 148/359] Updated fireboltCalls.md --- .../support/step_definitions/fireboltCalls.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cypress/support/step_definitions/fireboltCalls.md b/cypress/support/step_definitions/fireboltCalls.md index ff97285c..ea35c3a3 100644 --- a/cypress/support/step_definitions/fireboltCalls.md +++ b/cypress/support/step_definitions/fireboltCalls.md @@ -77,3 +77,22 @@ Note: Key name value is an object and it can contains data as below ### Examples: * `And I clear 'clear accessibility.onClosedCaptionsSettingsChanged' listeners` + +## 1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)' + +### Purpose: Sending a message to platform to set a value + +### Params: +| Param | Definition | +| --- | --- | +| sdk | sdk name | +| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | +| attribute | The attribute we are setting (ex. fontFamily) | +| invalidValue | Determines whether expecting for an error or result | +| value | The value used by the set method to set the value (ex. monospaced_sanserif) | + +### Examples: +* `Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true'` +* `Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to invalid 'test'` +* `Given '1st party app' invokes the 'Firebolt' API to set 'enable' to 'true'` + From 4c59ba0866a4166cdea2ce83718fb9fb3f2e4603 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Mon, 17 Jun 2024 11:17:03 +0530 Subject: [PATCH 149/359] Reverted first party call for mfos --- defaultModule/requestModules/fcs.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/defaultModule/requestModules/fcs.js b/defaultModule/requestModules/fcs.js index 7e6bf889..fc1336e8 100644 --- a/defaultModule/requestModules/fcs.js +++ b/defaultModule/requestModules/fcs.js @@ -32,7 +32,7 @@ const UTILS = require('../../../cypress/support/cypress-support/src/utils'); function setResponse(parsedParam) { try { parsedParam = parsedParam.params; - const { method, firstParty } = parsedParam; + const { method } = parsedParam; let requestJson, URLParam; let publishMessage = {}; if (parsedParam.response) { @@ -42,7 +42,7 @@ function setResponse(parsedParam) { requestJson = { error: parsedParam.error }; URLParam = `${CONSTANTS.STATE_METHOD}${method}/error`; } - publishMessage = { requestJson, URLParam, firstParty }; + publishMessage = { requestJson, URLParam }; return createPublishMessage(publishMessage); } catch (error) { assert(false, `${error.message} in setResponse`); @@ -58,7 +58,7 @@ function setResponse(parsedParam) { * createPublishMessage({"URLParam":"search","requestJson":{"result":"jeo@deo.com"},"userId":"456~A"}) **/ function createPublishMessage(publishMessage) { - const { URLParam, requestJson, firstParty } = publishMessage; + const { URLParam, requestJson } = publishMessage; return { transport: CONSTANTS.HTTP, options: { @@ -66,10 +66,7 @@ function createPublishMessage(publishMessage) { method: 'POST', headers: { 'Content-Type': 'application/json', - 'x-mockfirebolt-userid': - firstParty == true - ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_MOCK_USER) - : UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_MOCK_USER), + 'x-mockfirebolt-userid': UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_MOCK_USER), }, payload: requestJson, }, From da18a3e774a731bd6de0b0c178bb0bf99a586209 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Mon, 17 Jun 2024 13:24:12 +0530 Subject: [PATCH 150/359] FIRECERT-1760-RpcOnly addressed review comments --- ...AcknowledgeChallengeManage_RpcOnly.feature | 14 ++++++------- .../Manage/KeyboardManage_RpcOnly.feature | 16 +++++++------- .../Manage/ProfileManage_RpcOnly.feature | 6 +++--- cypress/fixtures/fireboltCalls/keyboard.json | 18 ++++++++-------- .../fixtures/fireboltCalls/localization.json | 3 +++ cypress/fixtures/fireboltCalls/profile.json | 6 +++--- .../fixtures/fireboltCalls/usergrants.json | 12 +++++------ cypress/fixtures/modules/usergrants.json | 6 +++--- cypress/fixtures/setResponseData.json | 4 ++++ cypress/support/cypress-support/src/main.js | 2 +- .../support/step_definitions/fireboltCalls.js | 21 ++++++------------- 11 files changed, 53 insertions(+), 55 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature index d16f7347..e5f9358d 100644 --- a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature @@ -7,13 +7,13 @@ Given the environment has been set up for 'AcknowledgeChallenge-rpc-Only' tests And 3rd party 'certification' app is launched And Framework registers 'ackchallenge' test provider - And User set response for 'set acknowledge granted' + And User set response for 'granting acknowledge challenge' When 1st party app registers for the 'acknowledgeChallenge onRequestChallenge manage' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to 'get localization countryCode' And Fetch response for 'acknowledgeChallenge onRequestChallenge' event from 1st party app - And 1st party app invokes the 'Firebolt' API to 'get acknowledgeChallenge challengeFocus' - And 1st party app invokes the 'Firebolt' API to 'get acknowledgeChallenge challengeResponse' - And Fetch response for 'get localization countryCode' method from 3rd party app + And 1st party app invokes the 'Firebolt' API to 'request focus for challenge provider' + And 1st party app invokes the 'Firebolt' API to 'send response from challenge provider' + And Fetch response for 'localization countryCode' method from 3rd party app Then 'Firebolt' platform responds with 'expected localization countryCode' @transport @ripple @@ -21,10 +21,10 @@ Given the environment has been set up for 'AcknowledgeChallenge-rpc-Only' tests And 3rd party 'certification' app is launched And Framework registers 'ackchallenge' test provider - And User set response for 'set acknowledge granted' + And User set response for 'granting acknowledge challenge' When 1st party app registers for the 'acknowledgeChallenge onRequestChallenge manage' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to 'get localization countryCode' And Fetch response for 'acknowledgeChallenge onRequestChallenge' event from 1st party app - And 1st party app invokes the 'Firebolt' API to 'get acknowledgeChallenge challengeError' - And Fetch response for 'get localization countryCode' method from 3rd party app + And 1st party app invokes the 'Firebolt' API to 'send error from challenge provider' + And Fetch response for 'localization countryCode' method from 3rd party app Then 'Firebolt' platform responds with 'expected localization countryCode' \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature index de758ab1..5c31aebb 100644 --- a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature @@ -14,10 +14,10 @@ Feature: Keyboard_Manage_RpcOnly And Fetch response for '' method from 3rd party app Then 'Firebolt' platform responds with '' Examples: - | Scenario | ManageEventName | EventName | MethodName | MethodParam | FocusMethod | ResponseMethod | MethodResponse | - | onRequestEmail | keyboard onRequestEmail manage | keyboard onRequestEmail | keyboard email | prompt the user for their email address with signin type | get keyboard emailFocus | get keyboard emailResponse | entered email address | - | onRequestStandard | keyboard onRequestStandard manage | keyboard onRequestStandard | keyboard standard | prompt the user for their standard platform | get keyboard standardFocus | get keyboard standardResponse | entered username | - | onRequestPassword | keyboard onRequestPassword manage | keyboard onRequestPassword | keyboard password | prompt the user for their password | get keyboard passwordFocus | get keyboard passwordResponse | entered password | + | Scenario | ManageEventName | EventName | MethodName | MethodParam | FocusMethod | ResponseMethod | MethodResponse | + | onRequestEmail | keyboard onRequestEmail manage | keyboard onRequestEmail | keyboard email | prompt the user for their email address with signin type | request focus for email provider | send response from email provider | entered email address | + | onRequestStandard | keyboard onRequestStandard manage | keyboard onRequestStandard | keyboard standard | prompt the user for their standard platform | request focus for standard provider | send response from standard provider | entered username | + | onRequestPassword | keyboard onRequestPassword manage | keyboard onRequestPassword | keyboard password | prompt the user for their password | request focus for password provider | send response from password provider | entered password | @transport @ripple Scenario Outline: Keyboard. - Negative Scenario: Validating rpc method @@ -31,7 +31,7 @@ Feature: Keyboard_Manage_RpcOnly Then 'Firebolt' platform responds with '' Examples: - | Scenario | ManageEventName | EventName | MethodName | MethodParam | FocusMethod | MethodResponse | - | Validating rpc method | keyboard onRequestEmail manage | keyboard onRequestEmail | keyboard email | prompt the user for their email address with signin type | get keyboard emailError | entered email address | - | Validating rpc method | keyboard onRequestStandard manage | keyboard onRequestStandard | keyboard standard | prompt the user for their username | get keyboard passwordError | entered username | - | Validating rpc method | keyboard onRequestPassword manage | keyboard onRequestPassword | keyboard password | prompt the user for their password | get keyboard standardError | entered password | \ No newline at end of file + | Scenario | ManageEventName | EventName | MethodName | MethodParam | FocusMethod | MethodResponse | + | Validating rpc method | keyboard onRequestEmail manage | keyboard onRequestEmail | keyboard email | prompt the user for their email address with signin type | send error from email provider | entered email address | + | Validating rpc method | keyboard onRequestStandard manage | keyboard onRequestStandard | keyboard standard | prompt the user for their username | send error from standard provider | entered username | + | Validating rpc method | keyboard onRequestPassword manage | keyboard onRequestPassword | keyboard password | prompt the user for their password | send error from password provider | entered password | \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature index 8304d255..2bb10562 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature @@ -9,8 +9,8 @@ Feature: Profile_Manage_RpcOnly When 1st party app registers for the 'pinChallenge onRequestChallenge manage' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to 'profile approvePurchase' And Fetch response for 'pinChallenge onRequestChallenge' event from 1st party app - And 1st party app invokes the 'Firebolt' API to 'get pinChallenge challengeFocus' - And 1st party app invokes the 'Firebolt' API to 'get pinChallenge challengeResponse' + And 1st party app invokes the 'Firebolt' API to 'request focus for pinchallenge provider' + And 1st party app invokes the 'Firebolt' API to 'send response from pinchallenge provider' And Fetch response for 'profile approvePurchase' method from 3rd party app Then 'Firebolt' platform responds with 'true for profile approvepurchase' @@ -22,6 +22,6 @@ Feature: Profile_Manage_RpcOnly When 1st party app registers for the 'pinChallenge onRequestChallenge manage' event using the 'Firebolt' API When '3rd party app' invokes the 'Firebolt' API to 'profile approvePurchase' And Fetch response for 'pinChallenge onRequestChallenge' event from 1st party app - And 1st party app invokes the 'Firebolt' API to 'get pinChallenge challengeError' + And 1st party app invokes the 'Firebolt' API to 'send error from pinchallenge provider' And Fetch response for 'profile approvePurchase' method from 3rd party app Then 'Firebolt' platform responds with 'true for profile approvepurchase' \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/keyboard.json b/cypress/fixtures/fireboltCalls/keyboard.json index e72961ce..e928ff06 100644 --- a/cypress/fixtures/fireboltCalls/keyboard.json +++ b/cypress/fixtures/fireboltCalls/keyboard.json @@ -129,27 +129,27 @@ "KEYBOARD_ONREQUESTPASSWORD":{ "method": "keyboard.onRequestPassword" }, - "GET_KEYBOARD_EMAILFOCUS":{ + "REQUEST_FOCUS_FOR_EMAIL_PROVIDER":{ "method": "keyboard.emailFocus", "params": "KEYBOARD_EMAILFOCUS" }, - "GET_KEYBOARD_STANDARDFOCUS":{ + "REQUEST_FOCUS_FOR_STANDARD_PROVIDER":{ "method": "keyboard.standardFocus", "params": "KEYBOARD_STANDARDFOCUS" }, - "GET_KEYBOARD_PASSWORDFOCUS":{ + "REQUEST_FOCUS_FOR_PASSWORD_PROVIDER":{ "method": "keyboard.passwordFocus", "params": "KEYBOARD_PASSWORDFOCUS" }, - "GET_KEYBOARD_EMAILRESPONSE":{ + "SEND_RESPONSE_FROM_EMAIL_PROVIDER":{ "method": "keyboard.emailResponse", "params": "KEYBOARD_EMAILRESPONSE" }, - "GET_KEYBOARD_STANDARDRESPONSE":{ + "SEND_RESPONSE_FROM_STANDARD_PROVIDER":{ "method": "keyboard.standardResponse", "params": "KEYBOARD_STANDARDRESPONSE" }, - "GET_KEYBOARD_PASSWORDRESPONSE":{ + "SEND_RESPONSE_FROM_PASSWORD_PROVIDER":{ "method": "keyboard.passwordResponse", "params": "KEYBOARD_PASSWORDRESPONSE" }, @@ -168,15 +168,15 @@ "validationJsonPath": "result", "content": "KEYBOARD_PASSWORD" }, - "GET_KEYBOARD_EMAILERROR":{ + "SEND_ERROR_FROM_EMAIL_PROVIDER":{ "method": "keyboard.emailError", "params": "KEYBOARD_EMAILERROR" }, - "GET_KEYBOARD_STANDARDERROR":{ + "SEND_ERROR_FROM_STANDARD_PROVIDER":{ "method": "keyboard.standardError", "params": "KEYBOARD_STANDARDERROR" }, - "GET_KEYBOARD_PASSWORDERROR":{ + "SEND_ERROR_FROM_PASSWORD_PROVIDER":{ "method": "keyboard.passwordError", "params": "KEYBOARD_PASSWORDERROR" } diff --git a/cypress/fixtures/fireboltCalls/localization.json b/cypress/fixtures/fireboltCalls/localization.json index 5c1cd105..1185c866 100644 --- a/cypress/fixtures/fireboltCalls/localization.json +++ b/cypress/fixtures/fireboltCalls/localization.json @@ -96,6 +96,9 @@ "GET_LOCALIZATION_COUNTRYCODE": { "method": "localization.countryCode" }, + "LOCALIZATION_COUNTRYCODE": { + "method": "localization.countryCode" + }, "PH_FOR_LOCALIZATION_COUNTRYCODE": { "method": "localization.countryCode", "validationJsonPath": "result", diff --git a/cypress/fixtures/fireboltCalls/profile.json b/cypress/fixtures/fireboltCalls/profile.json index a9f0a624..bc3d8d34 100644 --- a/cypress/fixtures/fireboltCalls/profile.json +++ b/cypress/fixtures/fireboltCalls/profile.json @@ -52,15 +52,15 @@ "PINCHALLENGE_ONREQUESTCHALLENGE":{ "method": "pinChallenge.onRequestChallenge" }, - "GET_PINCHALLENGE_CHALLENGEFOCUS":{ + "REQUEST_FOCUS_FOR_PINCHALLENGE_PROVIDER":{ "method": "pinChallenge.challengeFocus", "params": "PROFILE_PINCHALLENGE_CHALLENGEFOCUS_PARAMS" }, - "GET_PINCHALLENGE_CHALLENGERESPONSE":{ + "SEND_RESPONSE_FROM_PINCHALLENGE_PROVIDER":{ "method": "pinChallenge.challengeResponse", "params": "PROFILE_PINCHALLENGE_CHALLENGERESPONSE_PARAMS" }, - "GET_PINCHALLENGE_CHALLENGEERROR":{ + "SEND_ERROR_FROM_PINCHALLENGE_PROVIDER":{ "method": "pinChallenge.challengeError", "params": "PROFILE_PINCHALLENGE_CHALLENGE_ERROR_PARAMS" } diff --git a/cypress/fixtures/fireboltCalls/usergrants.json b/cypress/fixtures/fireboltCalls/usergrants.json index 2713953f..7fd93997 100644 --- a/cypress/fixtures/fireboltCalls/usergrants.json +++ b/cypress/fixtures/fireboltCalls/usergrants.json @@ -89,16 +89,16 @@ "ACKNOWLEDGECHALLENGE_ONREQUESTCHALLENGE":{ "method": "acknowledgeChallenge.onRequestChallenge" }, - "GET_ACKNOWLEDGECHALLENGE_CHALLENGEFOCUS":{ + "REQUEST_FOCUS_FOR_CHALLENGE_PROVIDER":{ "method": "acknowledgeChallenge.challengeFocus", - "params": "ACKNOWLEDGECHALLENGE_CHALLENGEFOCUS_PARAMS" + "params": "USERGRANTS_CHALLENGEFOCUS_PARAMS" }, - "GET_ACKNOWLEDGECHALLENGE_CHALLENGERESPONSE":{ + "SEND_RESPONSE_FROM_CHALLENGE_PROVIDER":{ "method": "acknowledgeChallenge.challengeResponse", - "params": "ACKNOWLEDGECHALLENGE_CHALLENGERESPONSE_PARAMS" + "params": "USERGRANTS_CHALLENGERESPONSE_PARAMS" }, - "GET_ACKNOWLEDGECHALLENGE_CHALLENGEERROR":{ + "SEND_ERROR_FROM_CHALLENGE_PROVIDER":{ "method": "acknowledgeChallenge.challengeError", - "params": "ACKNOWLEDGECHALLENGE_CHALLENGEERROR_PARAMS" + "params": "USERGRANTS_CHALLENGEERROR_PARAMS" } } \ No newline at end of file diff --git a/cypress/fixtures/modules/usergrants.json b/cypress/fixtures/modules/usergrants.json index e12b3008..05f3ca69 100644 --- a/cypress/fixtures/modules/usergrants.json +++ b/cypress/fixtures/modules/usergrants.json @@ -68,17 +68,17 @@ "DEVICE_ID": { "capability": "xrn:firebolt:capability:device:id" }, - "ACKNOWLEDGECHALLENGE_CHALLENGEFOCUS_PARAMS": { + "CHALLENGEFOCUS_PARAMS": { "CYPRESSENV-correlationId": "123" }, - "ACKNOWLEDGECHALLENGE_CHALLENGERESPONSE_PARAMS": { + "CHALLENGERESPONSE_PARAMS": { "CYPRESSENV-correlationId": "123", "result": { "granted": true, "reason": "correctPin" } }, - "ACKNOWLEDGECHALLENGE_CHALLENGE_ERROR_PARAMS": { + "CHALLENGEERROR_PARAMS": { "error": { "CYPRESSENV-correlationId": "123", "result": { diff --git a/cypress/fixtures/setResponseData.json b/cypress/fixtures/setResponseData.json index 10e524a2..06842557 100644 --- a/cypress/fixtures/setResponseData.json +++ b/cypress/fixtures/setResponseData.json @@ -14,5 +14,9 @@ "SET_PINCHALLENGE_CORRECT_PIN": { "fireboltMock": "PINCHALLENGE_CORRECT_PIN_WITH_UI", "firstParty": true + }, + "GRANTING_ACKNOWLEDGE_CHALLENGE": { + "fireboltMock": "ACKNOWLEDGE_CHALLENGE_GRANTED", + "firstParty": true } } diff --git a/cypress/support/cypress-support/src/main.js b/cypress/support/cypress-support/src/main.js index 25ebaf59..de0613bb 100644 --- a/cypress/support/cypress-support/src/main.js +++ b/cypress/support/cypress-support/src/main.js @@ -400,7 +400,7 @@ export default function (module) { if (results) { // Response recieved from queue return results; - } else if (Cypress.env('isRpcOnlyValidation')) { + } else if (Cypress.env(CONSTANTS.IS_RPC_ONLY)) { return true; } }); diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 3ffb7e9a..032e0cee 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -427,10 +427,6 @@ Given(/I clear '(.+)' listeners$/, async (key) => { Given( /Fetch response for '(.+)' (method|event) from (3rd party app|1st party app)$/, async (key, methodOrEvent, app) => { - if (Cypress.env(CONSTANTS.TEST_TYPE).includes('rpc-Only')) { - Cypress.env(CONSTANTS.IS_RPC_ONLY, true); - } - cy.fireboltDataParser(key).then((parsedDataArr) => { parsedDataArr.forEach((parsedData) => { const method = parsedData.method; @@ -459,6 +455,7 @@ Given( cy.log( 'Call from 1st party App, method: ' + method + ' params: ' + JSON.stringify(params) ); + // Sending message to first party app. cy.sendMessagetoPlatforms(requestMap).then((response) => { cy.log('Response from Firebolt platform: ' + JSON.stringify(response)); if (response === CONSTANTS.RESPONSE_NOT_FOUND) { @@ -466,8 +463,11 @@ Given( assert(false, CONSTANTS.NO_MATCHED_RESPONSE); }); } - cy.log(`correlationId - ${response.result.correlationId}`); - Cypress.env(CONSTANTS.CORRELATIONID, response.result.correlationId); + // saving the correlationId of rpc-only methods + if (Cypress.env(CONSTANTS.IS_RPC_ONLY)) { + cy.log(`correlationId - ${response.result.correlationId}`); + Cypress.env(CONSTANTS.CORRELATIONID, response.result.correlationId); + } }); } else if (app == CONSTANTS.THIRD_PARTY_APP) { params = { method: method }; @@ -486,15 +486,6 @@ Given( }); } cy.log(`Updated response of ${method}: ${JSON.stringify(response)}`); - for ( - let index = 0; - index < Cypress.env(CONSTANTS.GLOBAL_API_OBJECT_LIST).length; - index++ - ) { - if (Cypress.env(CONSTANTS.GLOBAL_API_OBJECT_LIST)[index].apiName == method) { - Cypress.env(CONSTANTS.GLOBAL_API_OBJECT_LIST)[index].response = response; - } - } if (typeof response == 'string') { response = JSON.parse(response); } From aecd3fbc8b710e1c635d1a6a64a1b63849b6588d Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 17 Jun 2024 14:55:20 +0530 Subject: [PATCH 151/359] Added minor change --- cypress/support/step_definitions/fireboltCalls.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 0e753bee..3f06e664 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -429,7 +429,7 @@ Given(/User triggers event with value as '(.+)'/, (key) => { * @description Sending a message to platform to set a value * @param {String} sdk - sdk name. * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. - * @param {String} attribute - The attribute we are setting (ex. fontFamily). + * @param {String} attribute - The attribute to which the value is going to be set (ex. fontFamily). * @param {String} invalidValue - Determines whether expecting for an error or result. * @param {String} value - The value used by the set method to set the value (ex. monospaced_sanserif) * @example @@ -445,7 +445,7 @@ Given( let fireboltCallObject; let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; - // runtime environment variable holds attribut and value + // runtime environment variable holds attribute and value Cypress.env('runtime', { attribute: attribute, value: value, From c0c77aedbd9ca24892a9d8eacec8fa9ebd14844f Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Mon, 17 Jun 2024 16:09:04 +0530 Subject: [PATCH 152/359] FIRECERT-2144-addressed comment --- .../fixtures/objects/lifecycleAppObject.json | 8 +-- .../objects/moduleReqId/moduleReqId.json | 60 +++++++++---------- cypress/support/cypress-commands/lifecycle.js | 48 ++++++--------- cypress/support/step_definitions/testSetup.js | 2 +- 4 files changed, 53 insertions(+), 65 deletions(-) diff --git a/cypress/fixtures/objects/lifecycleAppObject.json b/cypress/fixtures/objects/lifecycleAppObject.json index 34121080..0c2d584b 100644 --- a/cypress/fixtures/objects/lifecycleAppObject.json +++ b/cypress/fixtures/objects/lifecycleAppObject.json @@ -8,17 +8,17 @@ "inactive": { "stateValidation": { "req": "R*4.6" }, "historyValidation": { "req": "" }, - "notificationValidation": { "req": "R*2.2.2 [onInactive event triggered]" } + "notificationValidation": { "req": "R*2.2.2 [Platform MUST trigger 'onInactive' event]" } }, "foreground": { "stateValidation": { "req": "R*4.6" }, "historyValidation": { "req": "" }, - "notificationValidation": { "req": "R*2.3.6 [onForeground event triggered]" } + "notificationValidation": { "req": "R*2.3.6 [Platform MUST trigger 'onForeground' event]" } }, "background": { "stateValidation": { "req": "R*4.6" }, "historyValidation": { "req": "" }, - "notificationValidation": { "req": "R*2.4.6 [onBackground event triggered]" } + "notificationValidation": { "req": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" } }, "unloading": { "stateValidation": { "req": "R*2.5.1 & R*2.5.2 & R*4.6" }, @@ -28,7 +28,7 @@ "suspended": { "stateValidation": { "req": "R*4.6" }, "historyValidation": { "req": "" }, - "notificationValidation": { "req": "R*2.6.6 [onSuspended event triggered]" } + "notificationValidation": { "req": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } }, "unloaded": { "stateValidation": { "req": "" }, diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 9c73919f..f691c526 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -1616,7 +1616,7 @@ }, { "event": { - "id": "R*2.2.2 [onInactive event triggered]" + "id": "R*2.2.2 [Platform MUST trigger 'onInactive' event]" } }, { @@ -1640,7 +1640,7 @@ }, { "event": { - "id": "R*2.2.2 [onInactive event triggered]" + "id": "R*2.2.2 [Platform MUST trigger 'onInactive' event]" } }, { @@ -1664,7 +1664,7 @@ }, { "event": { - "id": "R*2.2.2 [onInactive event triggered]" + "id": "" } }, { @@ -1690,7 +1690,7 @@ }, { "event": { - "id": "R*2.3.6 [onForeground event triggered]" + "id": ["R*2.3.6 [Platform MUST trigger 'onForeground' event]", "R*2.2.2 [Platform MUST trigger 'onInactive' event]"] } }, { @@ -1714,7 +1714,7 @@ }, { "event": { - "id": "R*2.3.6 [onForeground event triggered]" + "id": "" } }, { @@ -1738,7 +1738,7 @@ }, { "event": { - "id": "R*2.3.6 [onForeground event triggered]" + "id": "R*2.3.6 [Platform MUST trigger 'onForeground' event]" } }, { @@ -2183,7 +2183,7 @@ }, { "event": { - "id": "R*2.4.6 [onBackground event triggered]" + "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" } }, { @@ -2207,7 +2207,7 @@ }, { "event": { - "id": "R*2.4.6 [onBackground event triggered]" + "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" } }, { @@ -2231,7 +2231,7 @@ }, { "event": { - "id": "R*2.4.6 [onBackground event triggered]" + "id": "" } }, { @@ -2255,7 +2255,7 @@ }, { "event": { - "id": "R*2.4.6 [onBackground event triggered]" + "id": "" } }, { @@ -2279,7 +2279,7 @@ }, { "event": { - "id": "R*2.4.6 [onBackground event triggered]" + "id": "" } }, { @@ -2303,7 +2303,7 @@ }, { "event": { - "id": "R*2.4.6 [onBackground event triggered]" + "id": "" } }, { @@ -2327,7 +2327,7 @@ }, { "event": { - "id": "R*2.4.6 [onBackground event triggered]" + "id": "" } }, { @@ -2353,7 +2353,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2372,7 +2372,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2391,7 +2391,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2410,7 +2410,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] @@ -2429,7 +2429,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] @@ -2448,7 +2448,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] @@ -2467,7 +2467,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] @@ -2486,7 +2486,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] @@ -2505,7 +2505,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] @@ -2524,7 +2524,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2543,7 +2543,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] @@ -2562,7 +2562,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] @@ -2581,7 +2581,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] @@ -2600,7 +2600,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] @@ -2619,7 +2619,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] @@ -2638,7 +2638,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] @@ -2657,7 +2657,7 @@ }, { "event": { - "id": "R*2.6.6 [onSuspended event triggered]" + "id": "" } } ] diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 2a9b1859..715d898e 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -215,41 +215,28 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING ) { const updatedRequirement = lifecycleEventRequirementId?.event?.id.replace( - 'triggered', - 'not triggered' - ); - UTILS.assertWithRequirementLogs( - CONSTANTS.PLATFORM_NOT_TRIGGER_EVENT + updatedRequirement, - CONSTANTS.PASS, - CONSTANTS.PASS + 'trigger', + 'not trigger' ); + cy.log(updatedRequirement + ' : ' + CONSTANTS.PASS); + // If events are not expected but received } else if (isEventsExpected == false && appHistoryCount > 0) { const updatedRequirement = lifecycleEventRequirementId?.event?.id.replace( - 'triggered', - 'not triggered' - ); - UTILS.assertWithRequirementLogs( - CONSTANTS.PLATFORM_NOT_TRIGGER_EVENT + updatedRequirement, - CONSTANTS.FAIL, - CONSTANTS.PASS + 'trigger', + 'not trigger' ); + fireLog.assert(false, updatedRequirement + ' : ' + CONSTANTS.FAIL); } else { // If events are expected and received if (isEventsExpected == true && appHistoryCount > 0) { - UTILS.assertWithRequirementLogs( - CONSTANTS.PLATFORM_TRIGGER_EVENT + lifecycleEventRequirementId?.event?.id, - CONSTANTS.PASS, - CONSTANTS.PASS - ); + cy.log(lifecycleEventRequirementId?.event?.id + ' : ' + CONSTANTS.PASS); + // If events are expected and not received } else if (isEventsExpected == true && appHistoryCount == 0) { - UTILS.assertWithRequirementLogs( - CONSTANTS.PLATFORM_TRIGGER_EVENT + lifecycleEventRequirementId?.event?.id, - CONSTANTS.FAIL, - CONSTANTS.PASS - ); + fireLog.assert(false, lifecycleEventRequirementId?.event?.id + ' : ' + CONSTANTS.FAIL); } + const eventId = lifecycleEventRequirementId?.event?.id; for (let eventIndex = 1; eventIndex <= appHistoryCount; eventIndex++) { const newAppEvent = appHistory[appHistory.length - eventIndex]; let appObjectEvent; @@ -260,14 +247,15 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent appObjectEvent = appObjectStateItem.notification[0]; } // Perform schema and content validation of app event data against app object event data - const id = lifecycleEventRequirementId.event.id; + const id = Array.isArray(eventId) ? eventId[eventIndex - 1] : eventId; let pretext = id === undefined ? ' : Schema ' : id + ' : Schema '; - UTILS.assertWithRequirementLogs( - pretext, - newAppEvent.schemaValidationStatus, - CONSTANTS.PASS - ); + if (newAppEvent.schemaValidationStatus == CONSTANTS.PASS) { + cy.log(pretext + ' : ' + CONSTANTS.PASS); + } else { + fireLog.assert(false, pretext + ' : ' + CONSTANTS.FAIL); + } + pretext = id === undefined ? ' : Content ' : id + ' : Content '; UTILS.assertWithRequirementLogs( pretext, diff --git a/cypress/support/step_definitions/testSetup.js b/cypress/support/step_definitions/testSetup.js index fbb1de88..6e812ab8 100644 --- a/cypress/support/step_definitions/testSetup.js +++ b/cypress/support/step_definitions/testSetup.js @@ -93,7 +93,7 @@ function destroyAppInstance(testType) { params, additionalParams ); - cy.log('Lifecycle close intent: ' + JSON.stringify(intentMessage)); + cy.log('Sending lifecycle close intent to unload app: ' + JSON.stringify(intentMessage)); try { cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((response) => { From 27eeb63f244959359fa7acd6d22524e8b4847ac6 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Mon, 17 Jun 2024 16:35:32 +0530 Subject: [PATCH 153/359] FIRECERT-1760-RpcOnly optimized code --- cypress/support/step_definitions/fireboltCalls.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 02ced193..9373d9dd 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -434,12 +434,7 @@ Given( const action = parsedData.action; const expected = parsedData.expected; - let appId = null; - appId = !appId - ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : appId === CONSTANTS.FIRST_PARTY_APP - ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) - : appId; + const appId = UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID); let params; if (app == CONSTANTS.FIRST_PARTY_APP) { From 6e62029847c128444d1e15a9857f9e2b31cb5dcf Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Mon, 17 Jun 2024 16:56:38 +0530 Subject: [PATCH 154/359] FIRECERT-2144-updated modreqid --- .../objects/moduleReqId/moduleReqId.json | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index f691c526..ee6ed550 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -1664,7 +1664,7 @@ }, { "event": { - "id": "" + "id": "R*2.2.2 [Platform MUST trigger 'onInactive' event]" } }, { @@ -1714,7 +1714,7 @@ }, { "event": { - "id": "" + "id": ["R*2.3.6 [Platform MUST trigger 'onForeground' event]", "R*2.2.2 [Platform MUST trigger 'onInactive' event]"] } }, { @@ -2231,7 +2231,7 @@ }, { "event": { - "id": "" + "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" } }, { @@ -2255,7 +2255,7 @@ }, { "event": { - "id": "" + "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" } }, { @@ -2279,7 +2279,7 @@ }, { "event": { - "id": "" + "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" } }, { @@ -2303,7 +2303,7 @@ }, { "event": { - "id": "" + "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" } }, { @@ -2327,7 +2327,7 @@ }, { "event": { - "id": "" + "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" } }, { @@ -2410,7 +2410,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2429,7 +2429,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2448,7 +2448,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2467,7 +2467,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2486,7 +2486,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2505,7 +2505,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2543,7 +2543,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2562,7 +2562,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2581,7 +2581,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2600,7 +2600,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2619,7 +2619,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2638,7 +2638,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] @@ -2657,7 +2657,7 @@ }, { "event": { - "id": "" + "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } } ] From 826f05cacb91f09ab72c1fb60a447736717ecf20 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 18 Jun 2024 10:04:30 +0530 Subject: [PATCH 155/359] FIRECERT-1760-RpcOnly addressed the review comments --- .../Manage/AcknowledgeChallengeManage_RpcOnly.feature | 4 ++-- .../Manage/KeyboardManage_RpcOnly.feature | 4 ++-- .../Manage/ProfileManage_RpcOnly.feature | 4 ++-- cypress/support/step_definitions/fireboltCalls.js | 8 ++++++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature index e5f9358d..12db09d5 100644 --- a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature @@ -2,7 +2,7 @@ # Note: Reboot required after running this feature file - @transport @ripple + @transport @ripple @requiresPlatformImplementation Scenario: AcknowledgeChallenge.onRequestChallenge - Positive Scenario: Validating rpc method Given the environment has been set up for 'AcknowledgeChallenge-rpc-Only' tests And 3rd party 'certification' app is launched @@ -16,7 +16,7 @@ And Fetch response for 'localization countryCode' method from 3rd party app Then 'Firebolt' platform responds with 'expected localization countryCode' - @transport @ripple + @transport @ripple @requiresPlatformImplementation Scenario: AcknowledgeChallenge.challengeError - Negative Scenario: Validating rpc method Given the environment has been set up for 'AcknowledgeChallenge-rpc-Only' tests And 3rd party 'certification' app is launched diff --git a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature index 5c31aebb..1f66d5a9 100644 --- a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature @@ -2,7 +2,7 @@ Feature: Keyboard_Manage_RpcOnly # Note: Reboot required after running this feature file - @transport @ripple + @transport @ripple @requiresPlatformImplementation Scenario Outline: Keyboard. - Positive Scenario: Validating rpc method Given the environment has been set up for 'Keyboard-rpc-Only' tests And 3rd party 'certification' app is launched @@ -19,7 +19,7 @@ Feature: Keyboard_Manage_RpcOnly | onRequestStandard | keyboard onRequestStandard manage | keyboard onRequestStandard | keyboard standard | prompt the user for their standard platform | request focus for standard provider | send response from standard provider | entered username | | onRequestPassword | keyboard onRequestPassword manage | keyboard onRequestPassword | keyboard password | prompt the user for their password | request focus for password provider | send response from password provider | entered password | - @transport @ripple + @transport @ripple @requiresPlatformImplementation Scenario Outline: Keyboard. - Negative Scenario: Validating rpc method Given the environment has been set up for 'Keyboard-rpc-Only' tests And 3rd party 'certification' app is launched diff --git a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature index 2bb10562..07dbea9c 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature @@ -2,7 +2,7 @@ Feature: Profile_Manage_RpcOnly # Note: Reboot required after running this feature file - @transport @ripple + @transport @ripple @requiresPlatformImplementation Scenario: PinChallenge.onRequestChallenge - Positive Scenario: Validating rpc method Given the environment has been set up for 'PinChallenge-rpc-Only' tests And 3rd party 'certification' app is launched @@ -15,7 +15,7 @@ Feature: Profile_Manage_RpcOnly Then 'Firebolt' platform responds with 'true for profile approvepurchase' - @transport @ripple + @transport @ripple @requiresPlatformImplementation Scenario: PinChallenge.challengeError - Negative Scenario: Validating rpc method Given the environment has been set up for 'PinChallenge-rpc-Only' tests And 3rd party 'certification' app is launched diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 9373d9dd..19d5f113 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -150,7 +150,11 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { ); cy.log(`Call from ${appId}, method: ${method} params: ${JSON.stringify(param)}`); - + if (Cypress.env('isRpcOnlyValidation')) { + cy.log( + `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` + ); + } // Adding additional details to created intent if any platform specific data is present in configModule. cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { const requestTopic = UTILS.getTopic(appId); @@ -479,7 +483,7 @@ Given( assert(false, CONSTANTS.NO_MATCHED_RESPONSE); }); } - cy.log(`Updated response of ${method}: ${JSON.stringify(response)}`); + cy.log(`${method} response from ${appId}: ${JSON.stringify(response)}`); if (typeof response == 'string') { response = JSON.parse(response); } From d2c741d9d5dc15546bf82f66b2eb05c47347ab31 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Tue, 18 Jun 2024 12:18:10 +0530 Subject: [PATCH 156/359] Added support to skip health for non fca apps --- README.md | 1 + cypress.config.js | 1 + cypress/support/constants/constants.js | 1 + cypress/support/cypress-commands/commands.js | 30 +++++++++++--------- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 59ac4d92..da3ee26f 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ To execute the certification suite against any platform, the following setup mus | communicationMode | string | 'SDK' or 'Transport' | Set communicationMode as SDK/transport. Default mode is SDK | | performanceMetrics | boolean | true | Makes a call to platform to start/stop the recording of performance metrics if value is true | +| fcaAppList | array | true | Holds the list of fca app identifiers | - Provide the specPattern mapping details. Update the specHelperConfig.js with the specPattern mapping details. diff --git a/cypress.config.js b/cypress.config.js index 63cc7f5c..6510c525 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -70,6 +70,7 @@ const env = { [3840, 2160], ], }, + fcaAppList: [], }; module.exports = { diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index c4686ebb..e61cd205 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -138,6 +138,7 @@ module.exports = { 'Failed to parse error object from response while setting lifecycle state. Response received : ', FAILED_TO_SET_LIFECYCLE_STATE: 'Failed to set lifecycle state due to the following error received from platform: ', + FCA_APP_LIST: 'fcaAppList', FCS: 'fcs', FCS_MODULEREQID_PATH: 'cypress/fixtures/objects/moduleReqId/moduleReqId.json', FCS_SETRESPONSE_PATH: 'cypress/fixtures/setResponseData.json', diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 31e4b729..98398f2a 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -700,20 +700,22 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { cy.sendMessagetoPlatforms(parsedIntent).then((result) => { cy.log('Response from Firebolt platform: ' + JSON.stringify(result)); - // checking the connection status of a third-party app. - cy.thirdPartyAppHealthcheck(requestTopic, responseTopic).then((healthCheckResponse) => { - if (healthCheckResponse == CONSTANTS.NO_RESPONSE) { - throw Error( - 'FCA not launched as 3rd party app or not subscribed to ' + - requestTopic + - '. Unable to get healthCheck response from FCA in ' + - UTILS.getEnvVariable(CONSTANTS.HEALTH_CHECK_RETRIES) + - ' retries' - ); - } - healthCheckResponse = JSON.parse(healthCheckResponse); - expect(healthCheckResponse.status).to.be.oneOf([CONSTANTS.RESPONSE_STATUS.OK]); - }); + if (CONSTANTS.FCA_APP_LIST.includes(appId)) { + // checking the connection status of a third-party app. + cy.thirdPartyAppHealthcheck(requestTopic, responseTopic).then((healthCheckResponse) => { + if (healthCheckResponse == CONSTANTS.NO_RESPONSE) { + throw Error( + 'FCA not launched as 3rd party app or not subscribed to ' + + requestTopic + + '. Unable to get healthCheck response from FCA in ' + + UTILS.getEnvVariable(CONSTANTS.HEALTH_CHECK_RETRIES) + + ' retries' + ); + } + healthCheckResponse = JSON.parse(healthCheckResponse); + expect(healthCheckResponse.status).to.be.oneOf([CONSTANTS.RESPONSE_STATUS.OK]); + }); + } }); }); }); From b1e0fbebd4939a5062ecb1f051937ef5cd2c99fc Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Tue, 18 Jun 2024 12:22:33 +0530 Subject: [PATCH 157/359] Added minor change --- cypress/support/cypress-commands/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 98398f2a..59a46971 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -700,7 +700,7 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { cy.sendMessagetoPlatforms(parsedIntent).then((result) => { cy.log('Response from Firebolt platform: ' + JSON.stringify(result)); - if (CONSTANTS.FCA_APP_LIST.includes(appId)) { + if (UTILS.getEnvVariable(CONSTANTS.FCA_APP_LIST).includes(appId)) { // checking the connection status of a third-party app. cy.thirdPartyAppHealthcheck(requestTopic, responseTopic).then((healthCheckResponse) => { if (healthCheckResponse == CONSTANTS.NO_RESPONSE) { From 5277799d8b85391207f872f7bf9243ba1825f758 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 18 Jun 2024 13:43:10 +0530 Subject: [PATCH 158/359] FIRECERT-2187 changes to use regexp directly from the configModule --- cypress/plugins/testDataProcessor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index 5f7c04d8..6aa12219 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -267,7 +267,7 @@ function testDataHandler(requestType, dataIdentifier, fireboltObject) { if (REGEXFORMATS[regexType]) { parsedRegexExp = REGEXFORMATS[regexType]; } else { - const regExp = new RegExp(regexType); + const regExp = new RegExp(data.type); parsedRegexExp = regExp; } return (data.type = parsedRegexExp.toString()); From dc718677c6b72f21b3fe181bf57693b2d9af6de6 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 18 Jun 2024 15:46:09 +0530 Subject: [PATCH 159/359] fIRECERT-2144-addressed comments --- .../fixtures/objects/lifecycleAppObject.json | 8 +-- .../objects/moduleReqId/moduleReqId.json | 64 ++++++++++--------- cypress/support/constants/constants.js | 6 +- cypress/support/cypress-commands/lifecycle.js | 33 ++++------ 4 files changed, 53 insertions(+), 58 deletions(-) diff --git a/cypress/fixtures/objects/lifecycleAppObject.json b/cypress/fixtures/objects/lifecycleAppObject.json index 0c2d584b..9c5cdebc 100644 --- a/cypress/fixtures/objects/lifecycleAppObject.json +++ b/cypress/fixtures/objects/lifecycleAppObject.json @@ -8,17 +8,17 @@ "inactive": { "stateValidation": { "req": "R*4.6" }, "historyValidation": { "req": "" }, - "notificationValidation": { "req": "R*2.2.2 [Platform MUST trigger 'onInactive' event]" } + "notificationValidation": { "req": "R*2.2.2 ['onInactive' event triggered]" } }, "foreground": { "stateValidation": { "req": "R*4.6" }, "historyValidation": { "req": "" }, - "notificationValidation": { "req": "R*2.3.6 [Platform MUST trigger 'onForeground' event]" } + "notificationValidation": { "req": "R*2.3.6 ['onForeground' event triggered]" } }, "background": { "stateValidation": { "req": "R*4.6" }, "historyValidation": { "req": "" }, - "notificationValidation": { "req": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" } + "notificationValidation": { "req": "R*2.4.6 ['onBackground' event triggered]" } }, "unloading": { "stateValidation": { "req": "R*2.5.1 & R*2.5.2 & R*4.6" }, @@ -28,7 +28,7 @@ "suspended": { "stateValidation": { "req": "R*4.6" }, "historyValidation": { "req": "" }, - "notificationValidation": { "req": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" } + "notificationValidation": { "req": "R*2.6.6 ['onSuspended' event triggered]" } }, "unloaded": { "stateValidation": { "req": "" }, diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index ee6ed550..7ee6f79a 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -1616,7 +1616,7 @@ }, { "event": { - "id": "R*2.2.2 [Platform MUST trigger 'onInactive' event]" + "id": "R*2.2.2 ['onInactive' event triggered]" } }, { @@ -1640,7 +1640,7 @@ }, { "event": { - "id": "R*2.2.2 [Platform MUST trigger 'onInactive' event]" + "id": "R*2.2.2 ['onInactive' event triggered]" } }, { @@ -1664,7 +1664,7 @@ }, { "event": { - "id": "R*2.2.2 [Platform MUST trigger 'onInactive' event]" + "id": "R*2.2.2 ['onInactive' event triggered]" } }, { @@ -1690,7 +1690,7 @@ }, { "event": { - "id": ["R*2.3.6 [Platform MUST trigger 'onForeground' event]", "R*2.2.2 [Platform MUST trigger 'onInactive' event]"] + "id": ["R*2.3.6 ['onForeground' event triggered]", "R*2.2.2 ['onInactive' event triggered]"] } }, { @@ -1714,7 +1714,7 @@ }, { "event": { - "id": ["R*2.3.6 [Platform MUST trigger 'onForeground' event]", "R*2.2.2 [Platform MUST trigger 'onInactive' event]"] + "id": ["R*2.3.6 ['onForeground' event triggered]", "R*2.2.2 ['onInactive' event triggered]"] } }, { @@ -1738,7 +1738,7 @@ }, { "event": { - "id": "R*2.3.6 [Platform MUST trigger 'onForeground' event]" + "id": "R*2.3.6 ['onForeground' event triggered]" } }, { @@ -2173,7 +2173,9 @@ "req": [ { "state": { - "id": "R*4.6" + "id": + "R*2.1.1, R*2.1.2" + } }, { @@ -2183,7 +2185,7 @@ }, { "event": { - "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" + "id": "R*2.4.6 ['onBackground' event triggered]" } }, { @@ -2207,7 +2209,7 @@ }, { "event": { - "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" + "id": "R*2.4.6 ['onBackground' event triggered]" } }, { @@ -2231,7 +2233,7 @@ }, { "event": { - "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" + "id": "R*2.4.6 ['onBackground' event triggered]" } }, { @@ -2255,7 +2257,7 @@ }, { "event": { - "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" + "id": "R*2.4.6 ['onBackground' event triggered]" } }, { @@ -2279,7 +2281,7 @@ }, { "event": { - "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" + "id": "R*2.4.6 ['onBackground' event triggered]" } }, { @@ -2303,7 +2305,7 @@ }, { "event": { - "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" + "id": "R*2.4.6 ['onBackground' event triggered]" } }, { @@ -2327,7 +2329,7 @@ }, { "event": { - "id": "R*2.4.6 [Platform MUST trigger 'onBackground' event]" + "id": "R*2.4.6 ['onBackground' event triggered]" } }, { @@ -2353,7 +2355,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2372,7 +2374,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2391,7 +2393,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2410,7 +2412,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2429,7 +2431,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2448,7 +2450,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2467,7 +2469,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2486,7 +2488,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2505,7 +2507,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2524,7 +2526,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2543,7 +2545,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2562,7 +2564,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2581,7 +2583,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2600,7 +2602,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2619,7 +2621,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2638,7 +2640,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] @@ -2657,7 +2659,7 @@ }, { "event": { - "id": "R*2.6.6 [Platform MUST trigger 'onSuspended' event]" + "id": "R*2.6.6 ['onSuspended' event triggered]" } } ] diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 7d89a025..07f7ab76 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -344,8 +344,8 @@ module.exports = { SKIPCONTENTVALIDATION: 'skipContentValidation', SKIPPED: 'SKIPPED', SOURCE: 'source', - STATE_CONTENT_VALIDATION_REQ: 'Lifecycle state content validation ', - STATE_SCHEMA_VALIDATION_REQ: 'Lifecycle state schema validation ', + STATE_CONTENT_VALIDATION_REQ: ' Lifecycle state content validation ', + STATE_SCHEMA_VALIDATION_REQ: ' Lifecycle state schema validation ', STATIC_CONTENT_VALIDATION: 'staticContentValidation', STATUS_CODE: [0, 1, 2, 3], STAY: 'stay', @@ -420,7 +420,7 @@ module.exports = { FCS_DEFAULTTESTDATA_PATH: 'cypress/fixtures/defaultTestData.json', ENV_SETUP_STATUS: 'environmentLaunched', APP_LAUNCH_STATUS: 'appLaunched', - VISIBILITYSTATE_VALIDATION_REQ: 'Lifecycle visibility state validation ', + VISIBILITYSTATE_VALIDATION_REQ: ' Lifecycle visibility state validation ', LIFECYCLE_VISIBILITYSTATE_SKIP_MESSAGE: 'App is not reachable to fetch visibility state. Skipping Visibility state validation.', VISIBILITYSTATE_FAILURE_FIX_LOG: diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 715d898e..0f0d9b61 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -97,13 +97,14 @@ Cypress.Commands.add('validateLifecycleState', (state, appId) => { } cy.log(CONSTANTS.APP_RESPONSE + response); // Perform schema and content validation of state response against appObject state - let pretext = CONSTANTS.STATE_SCHEMA_VALIDATION_REQ + lifecycleStateRequirementId.state.id; - UTILS.assertWithRequirementLogs( - pretext, - JSON.parse(response).report.schemaResult.status, - CONSTANTS.PASS - ); - pretext = CONSTANTS.STATE_CONTENT_VALIDATION_REQ + lifecycleStateRequirementId.state.id; + let pretext = lifecycleStateRequirementId.state.id + CONSTANTS.STATE_SCHEMA_VALIDATION_REQ; + if (JSON.parse(response).report.schemaResult.status == CONSTANTS.PASS) { + cy.log(pretext + ' : ' + CONSTANTS.PASS); + } else { + fireLog.assert(false, pretext + ' : ' + CONSTANTS.FAIL); + } + + pretext = lifecycleStateRequirementId.state.id + CONSTANTS.STATE_CONTENT_VALIDATION_REQ; UTILS.assertWithRequirementLogs( pretext, JSON.parse(response).report.result, @@ -214,27 +215,19 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent (isEventsExpected == false && appHistoryCount == 0) || state == CONSTANTS.LIFECYCLE_STATES.INITIALIZING ) { - const updatedRequirement = lifecycleEventRequirementId?.event?.id.replace( - 'trigger', - 'not trigger' - ); - cy.log(updatedRequirement + ' : ' + CONSTANTS.PASS); + cy.log(CONSTANTS.PLATFORM_NOT_TRIGGER_EVENT + ' : ' + CONSTANTS.PASS); // If events are not expected but received } else if (isEventsExpected == false && appHistoryCount > 0) { - const updatedRequirement = lifecycleEventRequirementId?.event?.id.replace( - 'trigger', - 'not trigger' - ); - fireLog.assert(false, updatedRequirement + ' : ' + CONSTANTS.FAIL); + fireLog.assert(false, CONSTANTS.PLATFORM_NOT_TRIGGER_EVENT + ' : ' + CONSTANTS.FAIL); } else { // If events are expected and received if (isEventsExpected == true && appHistoryCount > 0) { - cy.log(lifecycleEventRequirementId?.event?.id + ' : ' + CONSTANTS.PASS); + cy.log(CONSTANTS.PLATFORM_TRIGGER_EVENT + ' : ' + CONSTANTS.PASS); // If events are expected and not received } else if (isEventsExpected == true && appHistoryCount == 0) { - fireLog.assert(false, lifecycleEventRequirementId?.event?.id + ' : ' + CONSTANTS.FAIL); + fireLog.assert(false, CONSTANTS.PLATFORM_TRIGGER_EVENT + ' : ' + CONSTANTS.FAIL); } const eventId = lifecycleEventRequirementId?.event?.id; for (let eventIndex = 1; eventIndex <= appHistoryCount; eventIndex++) { @@ -618,7 +611,7 @@ function validateVisibilityState(state) { } const pretext = - CONSTANTS.VISIBILITYSTATE_VALIDATION_REQ + lifecycleStateRequirementId.visible_check.id; + lifecycleStateRequirementId.visible_check.id + CONSTANTS.VISIBILITYSTATE_VALIDATION_REQ; // checking if actual value is different from the default value if (visibilityState[state] != result.report) { // log to print a reason for failure and how to fix it From cda9d1c27ce122f6dd374420a2fef108cbfa4847 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 18 Jun 2024 19:47:37 +0530 Subject: [PATCH 160/359] FIRECERT-2144-modreqid update --- .../objects/moduleReqId/moduleReqId.json | 244 +++++++----------- 1 file changed, 96 insertions(+), 148 deletions(-) diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 7ee6f79a..4e89719e 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -1606,7 +1606,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*2.2.4" } }, { @@ -1630,7 +1630,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*2.2.5" } }, { @@ -1650,11 +1650,11 @@ } ] }, - "Lifecycle R*3.3 No impact on closing app from inactive state": { + "Lifecycle R*3.3.3 No impact on closing app from inactive state": { "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.3.3" } }, { @@ -1664,7 +1664,7 @@ }, { "event": { - "id": "R*2.2.2 ['onInactive' event triggered]" + "id": "R*3.3.3" } }, { @@ -1680,7 +1680,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.2.7" } }, { @@ -1704,7 +1704,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.2.3" } }, { @@ -1714,7 +1714,7 @@ }, { "event": { - "id": ["R*2.3.6 ['onForeground' event triggered]", "R*2.2.2 ['onInactive' event triggered]"] + "id": "R*3.2.3" } }, { @@ -1728,7 +1728,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.2.7" } }, { @@ -1738,7 +1738,7 @@ }, { "event": { - "id": "R*2.3.6 ['onForeground' event triggered]" + "id": "R*2.4.6 ['onBackground' event triggered]" } }, { @@ -1754,11 +1754,7 @@ "req": [ { "state": { - "id": [ - "R*2.1.1", - "R*2.1.2", - "R*4.6" - ] + "id": "R*4.6, R*2.1.1, R*2.1.2" } }, { @@ -1768,7 +1764,7 @@ }, { "event": { - "id": "" + "id": "R.2.1.4" } } ] @@ -1779,7 +1775,7 @@ "req": [ { "state": { - "id": "" + "id": "R*4.6, R*3.8" } }, { @@ -1789,7 +1785,7 @@ }, { "event": { - "id": "" + "id": "R*3.8" } } ] @@ -1798,7 +1794,7 @@ "req": [ { "state": { - "id": "" + "id": "R*4.6, R*3.8" } }, { @@ -1808,7 +1804,7 @@ }, { "event": { - "id": "" + "id": "R*3.8" } } ] @@ -1817,7 +1813,7 @@ "req": [ { "state": { - "id": "" + "id": "R*4.6, R*3.8" } }, { @@ -1827,7 +1823,7 @@ }, { "event": { - "id": "" + "id": "R*3.8" } } ] @@ -1836,7 +1832,7 @@ "req": [ { "state": { - "id": "" + "id": "R*4.6, R*3.8" } }, { @@ -1846,7 +1842,7 @@ }, { "event": { - "id": "" + "id": "R*3.8" } } ] @@ -1855,7 +1851,7 @@ "req": [ { "state": { - "id": "" + "id": "R*4.6, R*3.8" } }, { @@ -1865,7 +1861,7 @@ }, { "event": { - "id": "" + "id": "R*3.8" } } ] @@ -1874,7 +1870,7 @@ "req": [ { "state": { - "id": "" + "id": "R*4.6, R*3.8" } }, { @@ -1884,7 +1880,7 @@ }, { "event": { - "id": "" + "id": "R*3.8" } } ] @@ -1895,11 +1891,7 @@ "req": [ { "state": { - "id": [ - "R*2.5.1", - "R*2.5.2", - "R*4.6" - ] + "id": "R*4.6, R.4.5.4" } }, { @@ -1909,20 +1901,16 @@ }, { "event": { - "id": "" + "id": "R.4.5.4" } } ] }, - "Lifecycle R*3.7.3 Unloading from Inactive state": { + "Lifecycle R*3.7.5 Unloading from Inactive state": { "req": [ { "state": { - "id": [ - "R*2.5.1", - "R*2.5.2", - "R*4.6" - ] + "id": "R*4.6, R*2.5.1, R*3.7.5" } }, { @@ -1932,7 +1920,7 @@ }, { "event": { - "id": "" + "id": "R*3.7.5, R*2.5.1" } } ] @@ -1941,11 +1929,7 @@ "req": [ { "state": { - "id": [ - "R*2.5.1", - "R*2.5.2", - "R*4.6" - ] + "id": "R*4.6, R.3.3.4" } }, { @@ -1955,7 +1939,7 @@ }, { "event": { - "id": "" + "id": "R.3.3.4" } } ] @@ -1964,11 +1948,7 @@ "req": [ { "state": { - "id": [ - "R*2.5.1", - "R*2.5.2", - "R*4.6" - ] + "id": "R*4.6, R*4.5.3" } }, { @@ -1978,7 +1958,7 @@ }, { "event": { - "id": "" + "id": "R*4.5.3" } } ] @@ -1987,11 +1967,7 @@ "req": [ { "state": { - "id": [ - "R*2.5.1", - "R*2.5.2", - "R*4.6" - ] + "id": "R*4.6, R*3.7.2" } }, { @@ -2001,7 +1977,7 @@ }, { "event": { - "id": "" + "id": "R*3.7.2" } } ] @@ -2010,11 +1986,7 @@ "req": [ { "state": { - "id": [ - "R*2.5.1", - "R*2.5.2", - "R*4.6" - ] + "id": "R*4.6, R.3.5.3" } }, { @@ -2024,7 +1996,7 @@ }, { "event": { - "id": "" + "id": "R.3.5.3" } } ] @@ -2033,11 +2005,7 @@ "req": [ { "state": { - "id": [ - "R*2.5.1", - "R*2.5.2", - "R*4.6" - ] + "id": "R*4.6, R.4.5.4" } }, { @@ -2047,7 +2015,7 @@ }, { "event": { - "id": "" + "id": "R.4.5.4" } } ] @@ -2056,11 +2024,7 @@ "req": [ { "state": { - "id": [ - "R*2.5.1", - "R*2.5.2", - "R*4.6" - ] + "id": "R*4.6, R.4.5.4" } }, { @@ -2070,7 +2034,7 @@ }, { "event": { - "id": "" + "id": "R.4.5.4" } } ] @@ -2079,11 +2043,7 @@ "req": [ { "state": { - "id": [ - "R*2.5.1", - "R*2.5.2", - "R*4.6" - ] + "id": "R*4.6, R.4.5.4" } }, { @@ -2093,7 +2053,7 @@ }, { "event": { - "id": "" + "id": "R.4.5.4" } } ] @@ -2102,11 +2062,7 @@ "req": [ { "state": { - "id": [ - "R*2.5.1", - "R*2.5.2", - "R*4.6" - ] + "id": "R*4.6, R.4.5.4" } }, { @@ -2116,7 +2072,7 @@ }, { "event": { - "id": "" + "id": "R.4.5.4" } } ] @@ -2125,11 +2081,7 @@ "req": [ { "state": { - "id": [ - "R*2.5.1", - "R*2.5.2", - "R*4.6" - ] + "id": "R*4.6, R.4.5.4" } }, { @@ -2139,7 +2091,7 @@ }, { "event": { - "id": "" + "id": "R.4.5.4" } } ] @@ -2148,11 +2100,7 @@ "req": [ { "state": { - "id": [ - "R*2.5.1", - "R*2.5.2", - "R*4.6" - ] + "id": "R*4.6, R.3.3.4" } }, { @@ -2162,7 +2110,7 @@ }, { "event": { - "id": "" + "id": "R.3.3.4" } } ] @@ -2174,7 +2122,7 @@ { "state": { "id": - "R*2.1.1, R*2.1.2" + "R*4.6, R*3.4.6" } }, @@ -2199,7 +2147,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.4.6" } }, { @@ -2223,7 +2171,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R.3.4.4" } }, { @@ -2233,7 +2181,7 @@ }, { "event": { - "id": "R*2.4.6 ['onBackground' event triggered]" + "id": "R.3.4.4" } }, { @@ -2247,7 +2195,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.4.6" } }, { @@ -2257,7 +2205,7 @@ }, { "event": { - "id": "R*2.4.6 ['onBackground' event triggered]" + "id": "R*3.4.3" } }, { @@ -2271,7 +2219,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R.3.4.4" } }, { @@ -2281,7 +2229,7 @@ }, { "event": { - "id": "R*2.4.6 ['onBackground' event triggered]" + "id": "R.3.4.4" } }, { @@ -2295,7 +2243,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R.3.4.4" } }, { @@ -2305,7 +2253,7 @@ }, { "event": { - "id": "R*2.4.6 ['onBackground' event triggered]" + "id": "R.3.4.4" } }, { @@ -2319,7 +2267,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R.3.4.4" } }, { @@ -2329,7 +2277,7 @@ }, { "event": { - "id": "R*2.4.6 ['onBackground' event triggered]" + "id": "R.3.4.4" } }, { @@ -2345,7 +2293,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*2.6.1" } }, { @@ -2355,7 +2303,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*2.6.1" } } ] @@ -2364,7 +2312,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*2.6.5.R*3.5.3" } }, { @@ -2379,11 +2327,11 @@ } ] }, - "Lifecycle R*2.2.8, R*3.2.3 Relaunch a previously Suspended app after Unsuspend": { + "Lifecycle R*2.2.8, R*3.2.5, R*3.2.6, R*3.2.7 Relaunch a previously Suspended app after Unsuspend": { "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.2.7" } }, { @@ -2393,7 +2341,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*2.3.6" } } ] @@ -2402,7 +2350,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.5.2" } }, { @@ -2412,7 +2360,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*3.5.2" } } ] @@ -2421,7 +2369,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*2.5.3" } }, { @@ -2431,7 +2379,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*2.5.3" } } ] @@ -2440,7 +2388,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.2.5" } }, { @@ -2450,7 +2398,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*3.2.5" } } ] @@ -2459,7 +2407,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*2.6.5" } }, { @@ -2469,7 +2417,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*2.6.5" } } ] @@ -2478,7 +2426,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*2.6.5" } }, { @@ -2488,7 +2436,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*2.6.5" } } ] @@ -2497,7 +2445,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R.3.3.4" } }, { @@ -2507,7 +2455,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R.3.3.4" } } ] @@ -2516,7 +2464,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R.3.3.4" } }, { @@ -2526,16 +2474,16 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R.3.3.5" } } ] }, - "Lifecycle R*3.6.3 Cannot Unsuspend in initializing State": { + "Lifecycle R*3.6.2 Cannot Unsuspend in initializing State": { "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.6.2" } }, { @@ -2545,7 +2493,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*3.6.2" } } ] @@ -2554,7 +2502,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.6.2" } }, { @@ -2564,7 +2512,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*3.6.2" } } ] @@ -2573,7 +2521,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.6.2" } }, { @@ -2583,7 +2531,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*3.6.2" } } ] @@ -2592,7 +2540,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.6.2" } }, { @@ -2602,7 +2550,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*3.6.2" } } ] @@ -2611,7 +2559,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.6.2" } }, { @@ -2621,7 +2569,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*3.6.2" } } ] @@ -2630,7 +2578,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R*3.6.2" } }, { @@ -2640,7 +2588,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R*3.6.2" } } ] @@ -2649,7 +2597,7 @@ "req": [ { "state": { - "id": "R*4.6" + "id": "R*4.6, R.3.5.3" } }, { @@ -2659,7 +2607,7 @@ }, { "event": { - "id": "R*2.6.6 ['onSuspended' event triggered]" + "id": "R.3.5.3" } } ] From f73ad8ff8386b0552a9b01a9a87d2ef6c90df866 Mon Sep 17 00:00:00 2001 From: Jordan Roe Date: Tue, 18 Jun 2024 11:46:36 -0400 Subject: [PATCH 161/359] Firecert 2129 2 (#96) * FIRECERT-2129-2 - Removing <\"> backslashes and quotes pair. * FIRECERT-2129-2 - Removing <\"> backslashes and quotes pair. * FIRECERT-2129-2 - lint changes * FIRECERT-2129-2 - lint changes * FIRECERT-2129-2 - lint changes attempt 2 * FIRECERT-2129-2 - change assert to info. fireLog.assert -> fireLog.info * FIRECERT-2129-2 - Went back and made some changes to cy.log override in seemed like the override and adding the JSON.stringify to it was adding in Escapes. Adjsuted firelog class * FIRECERT-2129-2 - lint fix * PR changes addressed * FIRECERT-2129-2 - PR changes addressed from Jarvis team as well. --- cypress/support/cypress-commands/assertion.js | 10 ++-- cypress/support/cypress-commands/commands.js | 32 ++++++------ cypress/support/cypress-support/src/config.js | 2 +- cypress/support/cypress-support/src/utils.js | 9 ++++ cypress/support/e2e.js | 13 +++-- .../support/step_definitions/fireboltCalls.js | 50 +++++++++++-------- 6 files changed, 70 insertions(+), 46 deletions(-) diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index e5893d1a..d62ca557 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -631,15 +631,15 @@ Cypress.Commands.add( if (eventReceived) { try { eventReceived = JSON.parse(eventReceived); - cy.log('Event Response: ' + JSON.stringify(eventReceived.eventResponse)); + fireLog.info('Event Response: ' + JSON.stringify(eventReceived.eventResponse)); } catch (e) { - cy.log('Event Response: ' + eventReceived); + fireLog.info('Event Response: ' + eventReceived); } } - cy.log('Event Received Check : ' + eventReceivedCheck); - cy.log('Event Schema Check : ' + schemaCheck); - cy.log('Event Content Check : ' + contentCheck); + fireLog.info('Event Received Check : ' + eventReceivedCheck); + fireLog.info('Event Schema Check : ' + schemaCheck); + fireLog.info('Event Content Check : ' + contentCheck); } ); diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 9b5068bb..048e3c55 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -195,7 +195,7 @@ Cypress.Commands.add('getDeviceVersion', () => { throw 'Obtained response is null|undefined'; } } catch (error) { - cy.log('Failed to fetch device.version', error); + fireLog.info('Failed to fetch device.version', error); } }); }); @@ -315,7 +315,7 @@ Cypress.Commands.add('getCapabilities', () => { Cypress.env('capabilitiesList', capabilityObject); } } catch (error) { - cy.log('Error while getting capabilities from firebolt config: ', error); + fireLog.info('Error while getting capabilities from firebolt config: ', error); } }); @@ -416,7 +416,7 @@ Cypress.Commands.add('setResponse', (beforeOperation, scenarioName) => { firstParty = beforeOperation.firstParty; } else { firstParty = false; - cy.log( + fireLog.info( 'firstParty property is missing in beforeOperation block, so using default as firstParty=false' ); } @@ -431,9 +431,9 @@ Cypress.Commands.add('setResponse', (beforeOperation, scenarioName) => { action: action, }; - cy.log(`Firebolt Call to 1st party App: ${JSON.stringify(requestMap)} `); + fireLog.info(`Firebolt Call to 1st party App: ${JSON.stringify(requestMap)} `); cy.sendMessagetoPlatforms(requestMap).then((result) => { - cy.log('Response from 1st party App: ' + JSON.stringify(result)); + fireLog.info('Response from 1st party App: ' + JSON.stringify(result)); }); } else { const communicationMode = UTILS.getCommunicationMode(); @@ -457,10 +457,10 @@ Cypress.Commands.add('setResponse', (beforeOperation, scenarioName) => { ); // Sending message to 3rd party app. - cy.log(`Set mock call to 3rd party App: ${JSON.stringify(intentMessage)} `); + fireLog.info(`Set mock call to 3rd party App: ${JSON.stringify(intentMessage)} `); cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((result) => { result = JSON.parse(result); - cy.log( + fireLog.info( `Response from 3rd party App ${Cypress.env( CONSTANTS.THIRD_PARTY_APP_ID )}: ${JSON.stringify(result)}` @@ -477,9 +477,9 @@ Cypress.Commands.add('setResponse', (beforeOperation, scenarioName) => { method: method, params: parsedData, }; - cy.log(`Set mock call to 1st party App: ${JSON.stringify(requestMap)} `); + fireLog.info(`Set mock call to 1st party App: ${JSON.stringify(requestMap)} `); cy.sendMessagetoPlatforms(requestMap).then((result) => { - cy.log('Response from 1st party App: ' + JSON.stringify(result)); + fireLog.info('Response from 1st party App: ' + JSON.stringify(result)); }); } else { const params = { @@ -506,7 +506,7 @@ Cypress.Commands.add('setResponse', (beforeOperation, scenarioName) => { cy.log(`Set mock call to 3rd party App: ${JSON.stringify(intentMessage)} `); cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((result) => { result = JSON.parse(result); - cy.log( + fireLog.info( `Response from 3rd party App ${Cypress.env( CONSTANTS.THIRD_PARTY_APP_ID )}: ${JSON.stringify(result)}` @@ -523,7 +523,7 @@ Cypress.Commands.add('setResponse', (beforeOperation, scenarioName) => { params: scenarioName, }; - cy.log(`Firebolt Call to 1st party App: ${JSON.stringify(requestMap)} `); + fireLog.info(`Firebolt Call to 1st party App: ${JSON.stringify(requestMap)} `); cy.sendMessagetoPlatforms(requestMap).then((result) => { fireLog.isTrue(result.success, 'Response for marker creation: ' + JSON.stringify(result)); }); @@ -567,7 +567,9 @@ Cypress.Commands.add('startOrStopPerformanceService', (action) => { }, task: CONSTANTS.TASK.PERFORMANCETESTHANDLER, }; - cy.log('Request map to send intent to performance test handler: ' + JSON.stringify(requestMap)); + fireLog.info( + 'Request map to send intent to performance test handler: ' + JSON.stringify(requestMap) + ); // Sending message to the platform to call performance test handler cy.sendMessagetoPlatforms(requestMap).then((result) => { if (result?.success) { @@ -622,7 +624,7 @@ Cypress.Commands.add('censorData', (method, response) => { }); } catch (err) { // Log an error if the censorData JSON file is missing. - cy.log('Error occurred while loading censorData: ', err); + fireLog.info('Error occurred while loading censorData: ', err); } }); @@ -693,9 +695,9 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); cy.runIntentAddon(CONSTANTS.LAUNCHAPP, requestMap).then((parsedIntent) => { - cy.log('Discovery launch intent: ' + JSON.stringify(parsedIntent)); + fireLog.info('Discovery launch intent: ' + JSON.stringify(parsedIntent)); cy.sendMessagetoPlatforms(parsedIntent).then((result) => { - cy.log('Response from Firebolt platform: ' + JSON.stringify(result)); + fireLog.info('Response from Firebolt platform: ' + JSON.stringify(result)); // checking the connection status of a third-party app. cy.thirdPartyAppHealthcheck(requestTopic, responseTopic).then((healthCheckResponse) => { diff --git a/cypress/support/cypress-support/src/config.js b/cypress/support/cypress-support/src/config.js index 752be62d..656c3291 100644 --- a/cypress/support/cypress-support/src/config.js +++ b/cypress/support/cypress-support/src/config.js @@ -185,7 +185,7 @@ export default class Config { ? (fireboltResponse = JSON.stringify(fireboltResponse)) : fireboltResponse; - cy.log('Original Response to be converted to firebolt equivalent: ' + fireboltResponse); + fireLog.info('Original Response to be converted to firebolt equivalent: ' + fireboltResponse); // If we've gotten to this point, we have a config override. Call it and return its response return methodConfig(fireboltResponse); } diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 7b947722..4db42765 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -656,6 +656,12 @@ global.resolveDeviceVariable = function (key) { * fireLog.isTrue(isTrueValue, "True message"); * fireLog.isFalse(isFalseValue, "False message"); * fireLog.deepEqual(actual, expected, "deepEqual message"); + * + * fireLog.info('Discovery launch intent: ' + JSON.stringify(parsedIntent)); + * fireLog.info() is being used to log the message without any assertion. + * Removing cy.log and replacing with fireLog.info() to get a cleaner report. + * + * */ class FireLog { @@ -671,6 +677,7 @@ class FireLog { const originalMethod = this[method]; this[method] = function (...args) { const message = args[args.length - 1]; + return cy.log(message).then(() => { return originalMethod.apply(this, args); }); @@ -736,6 +743,8 @@ class FireLog { assert(expression, message) { assert(expression, message); } + + info(message) {} } const fireLog = new FireLog(); diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index c66e8b77..65d7e2c3 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -48,12 +48,15 @@ Cypress.Commands.add('addContext', (context) => { * @returns void * @example cy.log(text, args) */ -Cypress.Commands.overwrite('log', (orig, string, options) => { - orig(string, options); +Cypress.Commands.overwrite('log', (orig, message, options) => { + orig(message, options); const dateString = new Date().toLocaleString().replace(',', ''); - cy.addContext('[' + dateString + '][' + options + ']:[' + JSON.stringify(string) + ']'); + + typeof message == 'object' ? (message = JSON.stringify(message)) : message; + + cy.addContext('[' + dateString + '][' + options + ']:[' + message + ']'); options - ? attach('[' + dateString + '][' + options + '][' + JSON.stringify(string) + ']') - : attach('[' + dateString + '][' + JSON.stringify(string) + ']'); + ? attach('[' + dateString + '][' + options + '][' + message + ']') + : attach('[' + dateString + '][' + message + ']'); }); diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index bd01c139..99ff758e 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -47,7 +47,9 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = action: action, }; - cy.log('Call from 1st party App, method: ' + method + ' params: ' + JSON.stringify(params)); + fireLog.info( + 'Call from 1st party App, method: ' + method + ' params: ' + JSON.stringify(params) + ); cy.sendMessagetoPlatforms(requestMap).then((response) => { if (response && typeof response == CONSTANTS.TYPE_OBJECT) { // If error and the error message having 'Method not found' or 'Method not Implemented' mark the testcase as undefined. @@ -60,9 +62,11 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = if (UTILS.getEnvVariable(CONSTANTS.CERTIFICATION) == true) { assert(false, `${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`); } else { - cy.log(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`).then(() => { - throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); - }); + fireLog + .info(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`) + .then(() => { + throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); + }); } } @@ -72,7 +76,7 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = // Call the 'censorData' command to hide sensitive data cy.censorData(method, dataToBeCensored).then((maskedResult) => { - cy.log(`Response from Firebolt platform: ${JSON.stringify(maskedResult)}`); + fireLog.info(`Response from Firebolt platform: ${JSON.stringify(maskedResult)}`); }); // If event and params are not supported setting isScenarioExempted as true for further validation. if (UTILS.isScenarioExempted(method, params)) { @@ -90,7 +94,7 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); }); } else { - cy.log(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); + fireLog.info(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); } }); }); @@ -149,7 +153,7 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { additionalParams ); - cy.log(`Call from ${appId}, method: ${method} params: ${JSON.stringify(param)}`); + fireLog.info(`Call from ${appId}, method: ${method} params: ${JSON.stringify(param)}`); // Adding additional details to created intent if any platform specific data is present in configModule. cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { @@ -168,7 +172,7 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { // Call the 'censorData' command to hide sensitive data cy.censorData(method, dataToBeCensored).then((maskedResult) => { - cy.log(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); + fireLog.info(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); }); // If method and params are not supported setting isScenarioExempted as true for further validation. @@ -239,7 +243,7 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI additionalParams ); - cy.log( + fireLog.info( `Registering for the ${event} event using ${appId} with params : ${JSON.stringify(param)}` ); @@ -253,7 +257,9 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI assert(false, CONSTANTS.NO_MATCHED_RESPONSE); } result = JSON.parse(result); - cy.log(`Response from ${appId}: ${JSON.stringify(result.report.eventListenerResponse)}`); + fireLog.info( + `Response from ${appId}: ${JSON.stringify(result.report.eventListenerResponse)}` + ); // If event and params are not supported setting isScenarioExempted as true for further validation. if (UTILS.isScenarioExempted(event, param)) { @@ -306,7 +312,7 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn // To Do :debug event_param issue by passing isrequired as false for getEnvVariable,need to debug further requestMap.params = UTILS.getEnvVariable(CONSTANTS.EVENT_PARAM, false); } - cy.log( + fireLog.info( `Registering for the ${event} event using 1st party App with params : ${JSON.stringify( params )}` @@ -325,9 +331,11 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn if (UTILS.getEnvVariable(CONSTANTS.CERTIFICATION) == true) { assert(false, `${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`); } else { - cy.log(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`).then(() => { - throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); - }); + fireLog + .assert(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`) + .then(() => { + throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); + }); } } else if (response && response.error && response.error.message) { assert( @@ -337,7 +345,7 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn } cy.updateResponseForFCS(event, params, response).then((updatedResponse) => { - cy.log('Response from Firebolt platform: ' + JSON.stringify(response)); + fireLog.info('Response from Firebolt platform: ' + JSON.stringify(response)); // If event and params are not supported setting isScenarioExempted as true for further validation. if (UTILS.isScenarioExempted(event, params)) { Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); @@ -355,7 +363,7 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); }); } else { - cy.log(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); + fireLog.info(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); } }); }); @@ -387,9 +395,11 @@ Given(/I clear '(.+)' listeners$/, async (key) => { params: item, }; - cy.log('Call from 1st party App, method: ' + method + ' params: ' + JSON.stringify(params)); + fireLog.info( + 'Call from 1st party App, method: ' + method + ' params: ' + JSON.stringify(params) + ); cy.sendMessagetoPlatforms(requestMap).then((result) => { - cy.log('Response from Firebolt platform: ' + JSON.stringify(result)); + fireLog.info('Response from Firebolt platform: ' + JSON.stringify(result)); }); } else { const appId = item.appId ? item.appId : Cypress.env(CONSTANTS.THIRD_PARTY_APP_ID); @@ -400,7 +410,7 @@ Given(/I clear '(.+)' listeners$/, async (key) => { // Sending message to 3rd party app. cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((result) => { - cy.log( + fireLog.info( `Response from ${Cypress.env(CONSTANTS.THIRD_PARTY_APP_ID)}: ${JSON.stringify(result)}` ); }); @@ -418,7 +428,7 @@ Given(/I clear '(.+)' listeners$/, async (key) => { * And User triggers event with value as ' DEVICE_ONHDCPCHANGED_EVENTS' */ Given(/User triggers event with value as '(.+)'/, (key) => { - cy.log(CONSTANTS.STEP_DEFINITION_NEEDS_TO_IMPLEMENT).then(() => { + fireLog.info(CONSTANTS.STEP_DEFINITION_NEEDS_TO_IMPLEMENT).then(() => { throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); }); }); From 50538e729f2d26d053e90a252c8d93d4acc11c45 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Thu, 20 Jun 2024 17:15:38 +0530 Subject: [PATCH 162/359] FIRECERT-2186 Add support for custom validation in validation glue --- cypress/plugins/testDataProcessor.js | 1 + cypress/support/constants/constants.js | 1 + .../support/step_definitions/validations.js | 25 ++++++++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index 5f7c04d8..1e72e755 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -65,6 +65,7 @@ function testDataProcessor(configEnv) { fireboltCallsJson: resolvedFireboltCallsJson, fireboltMocksJson: combinedFireboltMocksJson, setResponseJson: resolvedSetResponseJson, + combineValidationObjectsJson : validationObjects }; } diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index c4686ebb..145e62fa 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -52,6 +52,7 @@ module.exports = { CERTIFICATION: 'certification', COMBINEDFIREBOLTCALLS: 'combinedFireboltCalls', COMBINEDFIREBOLTMOCKS: 'combinedFireboltMocks', + COMBINEVALIDATIONOBJECTSJSON: 'combineValidationObjectsJson', COMMUNICATION_MODE: 'communicationMode', CONFIG: 'CONFIG', CONFIG_MODULE_SETRESPONSE_PATH: 'cypress/fixtures/external/setResponseData.json', diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index d0b0eb37..e5bb21c6 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -313,7 +313,30 @@ Then(/'(.+)' will (be|stay) in '(.+)' state/, (app, condition, state) => { : app; const isEventsExpected = condition == CONSTANTS.STAY ? false : true; const appObject = UTILS.getEnvVariable(appId); - cy.validateLifecycleState(appObject.getAppObjectState().state, appId); + const scenarioName = cy.state().test.title; + const moduleReqIdJson = Cypress.env(CONSTANTS.MODULEREQIDJSON); + const featureFileName = cy.state().test.parent.title; + const scenarioList = moduleReqIdJson.scenarioNames[featureFileName]; + const validationObject = scenarioList[scenarioName].validationObject; + if (validationObject) { + if (Cypress.env(CONSTANTS.COMBINEVALIDATIONOBJECTSJSON).hasOwnProperty(validationObject)) { + if ( + Cypress.env(CONSTANTS.COMBINEVALIDATIONOBJECTSJSON)[validationObject].data[0].type == + 'custom' + ) { + const validationObjectData = Cypress.env(CONSTANTS.COMBINEVALIDATIONOBJECTSJSON)[ + validationObject + ].data[0]; + cy.customValidation(validationObjectData).then((response) => { + cy.log("Response from configModule for customValidation >>> ") + }) + } else { + assert(false, `Expected validationObject to be of "custom" type. Current value : ${Cypress.env(CONSTANTS.COMBINEVALIDATIONOBJECTSJSON)[validationObject].data[0].type}`); + } + } + } else { + cy.validateLifecycleState(appObject.getAppObjectState().state, appId); + } cy.validateLifecycleHistoryAndEvents( appObject.getAppObjectState().state, appId, From ddb6a821f02bddbd4cb327c37c99e148045b2c3f Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Thu, 20 Jun 2024 17:25:37 +0530 Subject: [PATCH 163/359] FIRECERT-2186 fixed linting issues --- cypress/plugins/testDataProcessor.js | 2 +- cypress/support/step_definitions/validations.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index 1e72e755..b5a36136 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -65,7 +65,7 @@ function testDataProcessor(configEnv) { fireboltCallsJson: resolvedFireboltCallsJson, fireboltMocksJson: combinedFireboltMocksJson, setResponseJson: resolvedSetResponseJson, - combineValidationObjectsJson : validationObjects + combineValidationObjectsJson: validationObjects, }; } diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index e5bb21c6..be2bbe10 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -328,10 +328,13 @@ Then(/'(.+)' will (be|stay) in '(.+)' state/, (app, condition, state) => { validationObject ].data[0]; cy.customValidation(validationObjectData).then((response) => { - cy.log("Response from configModule for customValidation >>> ") - }) + cy.log('Response from configModule for customValidation '); + }); } else { - assert(false, `Expected validationObject to be of "custom" type. Current value : ${Cypress.env(CONSTANTS.COMBINEVALIDATIONOBJECTSJSON)[validationObject].data[0].type}`); + assert( + false, + `Expected validationObject to be of "custom" type. Current value : ${Cypress.env(CONSTANTS.COMBINEVALIDATIONOBJECTSJSON)[validationObject].data[0].type}` + ); } } } else { From a50927c83bef968d6cdf4e5632471b3366368de3 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 20 Jun 2024 20:17:51 +0530 Subject: [PATCH 164/359] Addressed the comment --- cypress.config.js | 2 +- cypress/support/cypress-commands/commands.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index 6510c525..6e1feca5 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -70,7 +70,7 @@ const env = { [3840, 2160], ], }, - fcaAppList: [], + fcaAppList: ['default3rdPartyAppId'], }; module.exports = { diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 59a46971..2a21c605 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -700,7 +700,12 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { cy.sendMessagetoPlatforms(parsedIntent).then((result) => { cy.log('Response from Firebolt platform: ' + JSON.stringify(result)); - if (UTILS.getEnvVariable(CONSTANTS.FCA_APP_LIST).includes(appId)) { + if ( + UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) === appId || + UTILS.getEnvVariable(CONSTANTS.FCA_APP_LIST).find( + (ele) => UTILS.getEnvVariable(ele, false) === appId + ) + ) { // checking the connection status of a third-party app. cy.thirdPartyAppHealthcheck(requestTopic, responseTopic).then((healthCheckResponse) => { if (healthCheckResponse == CONSTANTS.NO_RESPONSE) { From 645d911e334385bf5a9c27ebadb8987251a15256 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 20 Jun 2024 20:34:53 +0530 Subject: [PATCH 165/359] FIRECERT-2144-reqid update --- .../objects/moduleReqId/moduleReqId.json | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 4e89719e..97b06d31 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -1606,7 +1606,7 @@ "req": [ { "state": { - "id": "R*4.6, R*2.2.4" + "id": "R*4.6, R*2.2.5, R*2.2.6" } }, { @@ -1630,7 +1630,7 @@ "req": [ { "state": { - "id": "R*4.6, R*2.2.5" + "id": "R*4.6, R*2.2.5, R*2.2.6" } }, { @@ -1754,7 +1754,7 @@ "req": [ { "state": { - "id": "R*4.6, R*2.1.1, R*2.1.2" + "id": "R*4.6, R*2.1.1" } }, { @@ -1764,7 +1764,7 @@ }, { "event": { - "id": "R.2.1.4" + "id": "R.3.3.4" } } ] @@ -1906,7 +1906,7 @@ } ] }, - "Lifecycle R*3.7.5 Unloading from Inactive state": { + "Lifecycle R*3.7 Unloading from Inactive state": { "req": [ { "state": { @@ -1982,11 +1982,11 @@ } ] }, - "Lifecycle R.3.5.3 Cannot Suspend Unloaded app": { + "Lifecycle R*2.6.5 Cannot Suspend Unloaded app": { "req": [ { "state": { - "id": "R*4.6, R.3.5.3" + "id": "R*4.6, R*2.6.5" } }, { @@ -1996,7 +1996,7 @@ }, { "event": { - "id": "R.3.5.3" + "id": "R*2.6.5" } } ] @@ -2195,7 +2195,7 @@ "req": [ { "state": { - "id": "R*4.6, R*3.4.6" + "id": "R*4.6, R*3.4.3" } }, { @@ -2308,11 +2308,11 @@ } ] }, - "Lifecycle R*2.6.5, R*3.5.3 Suspend App from Inactive state": { + "Lifecycle R*2.6.5 Suspend App from Inactive state": { "req": [ { "state": { - "id": "R*4.6, R*2.6.5.R*3.5.3" + "id": "R*4.6, R*2.6.4" } }, { @@ -2327,11 +2327,11 @@ } ] }, - "Lifecycle R*2.2.8, R*3.2.5, R*3.2.6, R*3.2.7 Relaunch a previously Suspended app after Unsuspend": { + "Lifecycle R*3.2.5, R*3.2.6, R*3.2.7 Relaunch a previously Suspended app after Unsuspend": { "req": [ { "state": { - "id": "R*4.6, R*3.2.7" + "id": "R*4.6, R*3.2.7, R*2.2.8" } }, { @@ -2341,7 +2341,7 @@ }, { "event": { - "id": "R*2.3.6" + "id": "R*2.3.6, R*2.2.8" } } ] @@ -2365,11 +2365,11 @@ } ] }, - "Lifecycle R*2.5.3 Cannot Suspend a unloaded App": { + "Lifecycle R*2.6.5 Cannot Suspend a unloaded App": { "req": [ { "state": { - "id": "R*4.6, R*2.5.3" + "id": "R*4.6, R*2.6.5" } }, { @@ -2379,7 +2379,7 @@ }, { "event": { - "id": "R*2.5.3" + "id": "R*2.6.5" } } ] @@ -2464,7 +2464,7 @@ "req": [ { "state": { - "id": "R*4.6, R.3.3.4" + "id": "R*4.6, R*2.2.8, R*3.6.7" } }, { @@ -2474,7 +2474,7 @@ }, { "event": { - "id": "R.3.3.5" + "id": "R*2.2.8" } } ] From d45b7a1a58463d8a967943c477315b8ec23b748f Mon Sep 17 00:00:00 2001 From: Abhishek urs C J <43801187+Abhishk123@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:38:46 +0530 Subject: [PATCH 166/359] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index da3ee26f..aeb3d7d2 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ To execute the certification suite against any platform, the following setup mus | communicationMode | string | 'SDK' or 'Transport' | Set communicationMode as SDK/transport. Default mode is SDK | | performanceMetrics | boolean | true | Makes a call to platform to start/stop the recording of performance metrics if value is true | -| fcaAppList | array | true | Holds the list of fca app identifiers | +| fcaAppList | array | ['default3rdPartyAppId'] | Holds the list of fca app identifiers | - Provide the specPattern mapping details. Update the specHelperConfig.js with the specPattern mapping details. From f7a404bcdb71983d3345a2d32decf5348a5fbecb Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 20 Jun 2024 20:55:09 +0530 Subject: [PATCH 167/359] Initial commit --- cypress/support/constants/constants.js | 1 + cypress/support/cypress-support/src/utils.js | 3 +- .../support/step_definitions/validations.js | 205 ++++++++++++++++++ 3 files changed, 208 insertions(+), 1 deletion(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index c4686ebb..0bcfea70 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -380,6 +380,7 @@ module.exports = { TOPIC_PUBLISH_SUFFIX: '_FCS', TOPIC_SUBSCRIBE_SUFFIX: '_FCA', TRANSPORT: 'transport', + TYPE_FUNCTION: 'function', TYPE_OBJECT: 'object', TYPE_STRING: 'string', UNDEFINED: 'undefined', diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 7b947722..4415188e 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -795,7 +795,7 @@ global.resolveAtRuntime = function (input) { } // If input not having "{{", returning content from runtime environment variable. else if (!input.includes('{{')) { - return getEnvVariable('runtime')[input] || input; + return getEnvVariable('runtime')[input] !== undefined? getEnvVariable('runtime')[input] : input; } } else if (Array.isArray(input) && input.length > 0) { // input is an array; iterating through each element, it updates the actual value for that pattern if there is an occurrence of "{{". @@ -803,6 +803,7 @@ global.resolveAtRuntime = function (input) { if (element.includes('{{')) { return replacingPatternOccurenceWithValue(element); } + return element; }); } else { logger.info(`Passed input - ${input} must be an array or a string.`); diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index d0b0eb37..523b7a73 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -390,3 +390,208 @@ Given( }); } ); + + +//'' platform validates '' '' '(get|set)' API response (as '') + +/** + * @module validations + * @function And '(.+)' platform validates '(.+)' ('(.+)')? (get|set) API response(?: as '(.+)')? + * @description Performing a validation against the source of truth for the given API response + * @param {String} sdk - name of the sdk. + * @param {String} appId - The object was retrieved by using the appId. + * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData Json. + * @param {String} methodType - Determines which method doing content validation Ex: set or get + * @param {String} errorContent - Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' + * @example + * And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' get API response + * And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' set API response + * And 'Firebolt' platform validates '3rd party app' 'CLOSEDCAPTION_SETTINGS' get API response + * And 'Firebolt' platform validates '1st party app' set API response + * And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' set API response as 'INVALID_TYPE_PARAMS' + */ +// TODO: can we make appId as optional and fireboltCallKey as optional +Given( + /'(.+)' platform validates '([^']*)'(?: '([^']*)')? (get|set) API response(?: as '(.+)')?$/, + async (sdk, appId, fireboltCallKey, methodType, errorContent) => { + if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { + let fireboltCallObject; + appId = !appId + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.FIRST_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) + : appId; + const context = {}; + const expectingError = errorContent ? errorContent : null; + + // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable + if (fireboltCallKey) { + cy.getFireboltData(fireboltCallKey).then((fireboltData) => { + fireboltCallObject = fireboltData; + }); + } else { + fireboltCallObject = UTILS.getEnvVariable('runtime').fireboltCall; + } + + cy.then(() => { + let method = + methodType === 'set' + ? typeof fireboltCallObject.setMethod == CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.setMethod() + : fireboltCallObject.setMethod + : typeof fireboltCallObject.method == CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.method() + : fireboltCallObject.method; + let validationJsonPath = + methodType === 'set' + ? typeof fireboltCallObject.setValidationJsonPath == CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.setValidationJsonPath() + : fireboltCallObject.setValidationJsonPath + : typeof fireboltCallObject.validationJsonPath == CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.validationJsonPath() + : fireboltCallObject.validationJsonPath; + let contentObject = + methodType === 'set' + ? resolveContentObject(fireboltCallObject.setContent) + : resolveContentObject(fireboltCallObject.content); + + method = method.includes('_') ? method.split('_')[1] : method; + + // Fetching the object from the global list. + const apiObject = UTILS.getApiOrEventObjectFromGlobalList(method, context, appId); + const param = apiObject.params; + + // Function to do error null check, schema validation check and event listerner response checks + cy.validateResponseErrorAndSchemaResult(apiObject, CONSTANTS.METHOD).then(() => { + // If response of the method is not supported, checks in the not supported list for that method name, if it is present then pass else mark it as fail + // TODO: Need to add error content validation + if ( + !Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION) && + (UTILS.isScenarioExempted(method, param) || expectingError) + ) { + let errorExpected; + + // If the expected error is false, we set "exceptionErrorObject" to the errorExpected variable, which will be used to retrieve the error content object based on the exception method type. + expectingError === true + ? (errorExpected = contentObject) + : (errorExpected = CONSTANTS.EXCEPTION_ERROR_OBJECT); + + cy.validateErrorObject(method, errorExpected, CONSTANTS.METHOD, context, appId, param).then( + () => { + return true; + } + ); + } else if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { + try { + if (contentObject && contentObject.data) { + contentObject.data.forEach((object) => { + if (object.validations) { + const scenario = object.type; + const methodResponse = apiObject?.response ? apiObject.response : null; + + if (validationJsonPath && Array.isArray(validationJsonPath)) { + let validationPath = validationJsonPath.find((path) => { + if ( + path + .split('.') + .reduce((acc, part) => acc && acc[part], methodResponse) !== undefined + ) { + return path; + } + }); + validationPath + ? (validationJsonPath = validationPath) + : fireLog.assert( + false, + 'Could not find the valid validation path from the validationJsonPath list' + ); + } + + switch (scenario) { + case CONSTANTS.REGEX: + cy.regExValidation( + method, + object.validations[0].type, + validationJsonPath, + methodResponse + ); + break; + case CONSTANTS.MISC: + cy.miscellaneousValidation(method, object.validations[0], apiObject); + break; + case CONSTANTS.DECODE: + const decodeType = object.specialCase; + const responseForDecodeValidation = methodResponse?.result + ? methodResponse.result + : null; + + cy.decodeValidation( + method, + decodeType, + responseForDecodeValidation, + object.validations[0], + null + ); + break; + case CONSTANTS.FIXTURE: + cy.validateContent( + method, + context, + validationJsonPath, + object.validations[0].type, + CONSTANTS.METHOD, + appId + ); + break; + case CONSTANTS.CUSTOM: + cy.customValidation(object, apiObject); + break; + case CONSTANTS.UNDEFINED: + cy.undefinedValidation(object, apiObject, CONSTANTS.METHOD); + break; + default: + assert(false, 'Unsupported validation type'); + break; + } + } + }); + } else { + cy.validateContent( + method, + context, + validationJsonPath, + contentObject, + CONSTANTS.METHOD, + appId + ); + } + } catch (error) { + assert(false, `Unable to validate the response: ${error}`); + } + } else { + cy.log('Content validation is skipped'); + } + }); + }); + } else { + assert(false, `${sdk} SDK not Supported`); + } + + // A Function that recursively check each fields and invokes if it's a function within an array or object. + function resolveContentObject(input) { + if (Array.isArray(input)) { + return input.map((item) => resolveContentObject(item)); + } else if (typeof input == CONSTANTS.TYPE_OBJECT && input !== null) { + for (const key in input) { + if (Object.hasOwnProperty.call(input, key)) { + input[key] = resolveContentObject(input[key]); + } + } + return input; + } else if (typeof input === CONSTANTS.TYPE_FUNCTION) { + return input(); + } + return input; + } + } +); \ No newline at end of file From 3e0e99ca72be2bba4a4c6af9ca9ed297dbb3f912 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 20 Jun 2024 21:54:40 +0530 Subject: [PATCH 168/359] Added minor changes --- .../support/step_definitions/validations.js | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 523b7a73..ef82a780 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -410,7 +410,6 @@ Given( * And 'Firebolt' platform validates '1st party app' set API response * And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' set API response as 'INVALID_TYPE_PARAMS' */ -// TODO: can we make appId as optional and fireboltCallKey as optional Given( /'(.+)' platform validates '([^']*)'(?: '([^']*)')? (get|set) API response(?: as '(.+)')?$/, async (sdk, appId, fireboltCallKey, methodType, errorContent) => { @@ -422,7 +421,7 @@ Given( ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) : appId; const context = {}; - const expectingError = errorContent ? errorContent : null; + const expectingError = errorContent ? true : false; // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable if (fireboltCallKey) { @@ -464,23 +463,31 @@ Given( // Function to do error null check, schema validation check and event listerner response checks cy.validateResponseErrorAndSchemaResult(apiObject, CONSTANTS.METHOD).then(() => { // If response of the method is not supported, checks in the not supported list for that method name, if it is present then pass else mark it as fail - // TODO: Need to add error content validation if ( !Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION) && (UTILS.isScenarioExempted(method, param) || expectingError) ) { - let errorExpected; + // TODO: Need to parse errorSchemaObject + cy.fixture('objects/errorObjects/errorSchemaObject').then((errorSchemaObject) => { + let errorExpected; + let errorObject = errorSchemaObject[errorContent]; - // If the expected error is false, we set "exceptionErrorObject" to the errorExpected variable, which will be used to retrieve the error content object based on the exception method type. - expectingError === true - ? (errorExpected = contentObject) - : (errorExpected = CONSTANTS.EXCEPTION_ERROR_OBJECT); + // If the expected error is false, we set "exceptionErrorObject" to the errorExpected variable, which will be used to retrieve the error content object based on the exception method type. + expectingError === true + ? (errorExpected = errorObject) + : (errorExpected = CONSTANTS.EXCEPTION_ERROR_OBJECT); - cy.validateErrorObject(method, errorExpected, CONSTANTS.METHOD, context, appId, param).then( - () => { + cy.validateErrorObject( + method, + errorExpected, + CONSTANTS.METHOD, + context, + appId, + param + ).then(() => { return true; - } - ); + }); + }); } else if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { try { if (contentObject && contentObject.data) { From 5c68f89742525091283021b9794759ce1ebd966d Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 21 Jun 2024 10:44:46 +0530 Subject: [PATCH 169/359] FIRECERT-2186 addressed review comments --- .../support/step_definitions/validations.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index be2bbe10..ddf8face 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -318,8 +318,11 @@ Then(/'(.+)' will (be|stay) in '(.+)' state/, (app, condition, state) => { const featureFileName = cy.state().test.parent.title; const scenarioList = moduleReqIdJson.scenarioNames[featureFileName]; const validationObject = scenarioList[scenarioName].validationObject; + // custom validation in case of lifecycle test cases where app is not reachable + // if validationObject is present in the modReqId for the specific TC, we have to validate based on that value if (validationObject) { if (Cypress.env(CONSTANTS.COMBINEVALIDATIONOBJECTSJSON).hasOwnProperty(validationObject)) { + // the validation type is expected to be "custom" if ( Cypress.env(CONSTANTS.COMBINEVALIDATIONOBJECTSJSON)[validationObject].data[0].type == 'custom' @@ -327,9 +330,8 @@ Then(/'(.+)' will (be|stay) in '(.+)' state/, (app, condition, state) => { const validationObjectData = Cypress.env(CONSTANTS.COMBINEVALIDATIONOBJECTSJSON)[ validationObject ].data[0]; - cy.customValidation(validationObjectData).then((response) => { - cy.log('Response from configModule for customValidation '); - }); + // passing the validationObject to perform customValidation + cy.customValidation(validationObjectData); } else { assert( false, @@ -339,12 +341,12 @@ Then(/'(.+)' will (be|stay) in '(.+)' state/, (app, condition, state) => { } } else { cy.validateLifecycleState(appObject.getAppObjectState().state, appId); + cy.validateLifecycleHistoryAndEvents( + appObject.getAppObjectState().state, + appId, + isEventsExpected + ); } - cy.validateLifecycleHistoryAndEvents( - appObject.getAppObjectState().state, - appId, - isEventsExpected - ); }); /** From ef778e522771659d08fe8f32c69cb7087e0b96cd Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 21 Jun 2024 11:03:17 +0530 Subject: [PATCH 170/359] FIRECERT-2186 added documentation in validations.md --- cypress/support/step_definitions/validations.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/cypress/support/step_definitions/validations.md b/cypress/support/step_definitions/validations.md index ad5c3aa8..4c905a6d 100644 --- a/cypress/support/step_definitions/validations.md +++ b/cypress/support/step_definitions/validations.md @@ -40,18 +40,21 @@ * `I 'start' performance metrics collection` * `I 'stop' performance metrics collection` - ## {string} is in {string} state + + ## '(.+)' will (be|stay) in '(.+)' state ### Purpose: To validate 3rd party app transitionss wrt state, event and history aagainst appObject as the source of truth +Here, be/stay determines whether the app will get transitioned to new state or will be staying in the same state. +For the validation part, for the states when the app is not reachable for us to get the status or history, we use customValidation , where we get the validation key name from the moduleReqId.json of the specific testcase. The customValidation function will be defined in the corresponding confiModule. Refer to the [custom] validation. ### Params: -| Param | Definition | -| --- | --- | -| app | app type | -| state | expected state to be used for validation | +| Param | Definition | +| --- | --- | +| app | app type | +| state | expected state to be used for validation | ### Examples: - * `'3rd party app' is in 'foreground' state` - + * Then '3rd party app' will stay in 'foreground' state + * Then '3rd party app' will be in 'background' state # Supported Validations From f96a7bd3ab0e1eabde9a3aab550cb1e91f9f0794 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 21 Jun 2024 11:38:12 +0530 Subject: [PATCH 171/359] FIRECERT-1760-RpcOnly addressed review comments --- cypress/support/constants/constants.js | 1 + cypress/support/cypress-support/src/utils.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index fa7ebb5f..004f80c5 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -325,6 +325,7 @@ module.exports = { }, RESPONSE_TOPIC_LIST: 'responseTopicList', RESULT: 'result', + RPC_ONLY_TIMEOUT: 200000, SANITY_REPORT_FILENAME: 'fca_sanity_suite', SANITY_REPORT_FILE_PATH: getSanityReportPath(), SANITY_REPORT_LONGPOLL_TIMEOUT: 200000, diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 04408ba9..5260ba66 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -84,7 +84,9 @@ function createIntentMessage(task, jsonParams, map = null) { ? (jsonQueryParams.isNotSupportedApi = map.isNotSupportedApi) : false; - Cypress.env('isRpcOnlyValidation') ? (jsonQueryParams.responseTimeout = 200000) : null; + Cypress.env('isRpcOnlyValidation') + ? (jsonQueryParams.responseTimeout = CONSTANTS.RPC_ONLY_TIMEOUT) + : null; const intent = { action: queryParams.action, data: { query: JSON.stringify(jsonQueryParams) }, From fac85f0f7899346f80bc0076a0c6ccdd65e970ed Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 21 Jun 2024 12:05:32 +0530 Subject: [PATCH 172/359] noJira-AppLaunchIssue addressed review comments --- cypress/support/cypress-commands/commands.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 85baaa78..e839d13c 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -710,6 +710,8 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { ) { // checking the connection status of a third-party app. cy.thirdPartyAppHealthcheck(requestTopic, responseTopic).then((healthCheckResponse) => { + // checking whether valid healthCheck response is received + // if not received, throwing error with corresponding topic and retry count. if (healthCheckResponse == CONSTANTS.NO_RESPONSE) { throw Error( 'FCA not launched as 3rd party app or not subscribed to ' + From 34c38e75d3af6d22a753e27d03ce7db82aac7dc3 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Fri, 21 Jun 2024 15:09:43 +0530 Subject: [PATCH 173/359] FIRECERT-1529: Added support to use secondary appId --- cypress/support/constants/constants.js | 2 ++ cypress/support/cypress-commands/commands.js | 2 +- cypress/support/cypress-support/src/utils.js | 24 +++++++++++++++++++ .../support/step_definitions/fireboltCalls.js | 4 ++-- .../support/step_definitions/validations.js | 2 +- 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index c1593fa0..7c55e520 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -430,6 +430,8 @@ module.exports = { VISIBILITYSTATE: 'visibilityState', VISIBLE_CHECK: 'visible_check', STEP_DEFINITION_NEEDS_TO_IMPLEMENT: 'Step definition needs to be implemented', + SECONDARY_THIRD_PARTY_APP: 'secondary 3rd party app', + SECONDARY_THIRD_PARTY_APP_ID: 'secondary3rdPartyAppId', }; function getSanityReportPath() { // Check if Cypress is defined, for cypress test context diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 048e3c55..0b4d312f 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -643,7 +643,7 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { // else get the default app id from environment variable. const appId = - appCallSign == undefined ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : appCallSign; // this is for the app to know the appId used for launch, so that it can use the same for creating PubSub connection. + appCallSign == undefined ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : UTILS.checkForSecondaryAppId(appCallSign); // this is for the app to know the appId used for launch, so that it can use the same for creating PubSub connection. // if appType is certification, the appLaunch is for certification purposes. In such a case, discovery.launch should go with a basic intent that has the appId and the certification app role. // create the request map // basic intent to be sent to the app on launch diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 4db42765..8be682be 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -627,6 +627,29 @@ function checkForTags(tags) { } } +/** + * @module utils + * @function checkForSecondaryAppId + * @description Checks whether the appId is available in env + * @example + * checkForSecondaryAppId("appIdKey") + */ +function checkForSecondaryAppId(appId){ + let envAppIdKey; + try { + if (appId === CONSTANTS.SECONDARY_THIRD_PARTY_APP) { + envAppIdKey = CONSTANTS.SECONDARY_THIRD_PARTY_APP_ID; + return getEnvVariable(CONSTANTS.SECONDARY_THIRD_PARTY_APP_ID); + } else { + return appId; + } + } catch (err) { + fireLog.info(`Unable to find the ${envAppIdKey} value in the env, please add the value in config module/constants/config.json`).then(() => { + throw new Error(`Unable to find the ${envAppIdKey} value in the env`); + }); + } +} + /** * @module utils * @globalfunction resolveDeviceVariable @@ -842,4 +865,5 @@ module.exports = { writeJsonToFileForReporting, checkForTags, fireLog, + checkForSecondaryAppId, }; diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 99ff758e..178a42d2 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -121,7 +121,7 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : appId === CONSTANTS.THIRD_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : appId; + : UTILS.checkForSecondaryAppId(appId); const method = parsedData.method; const param = parsedData.params; const context = parsedData.context; @@ -216,7 +216,7 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : appId === CONSTANTS.THIRD_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : appId; + : UTILS.checkForSecondaryAppId(appId); const event = parsedData.method; const param = parsedData.params; const context = parsedData.context ? parsedData.context : CONSTANTS.NO_CONTEXT; diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index d0b0eb37..ffbe4d94 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -66,7 +66,7 @@ Given( ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : appId === CONSTANTS.FIRST_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) - : appId; + : UTILS.checkForSecondaryAppId(appId); // Fetching the object from the global list. const methodOrEventObject = UTILS.getApiOrEventObjectFromGlobalList( From 7341c14a90e2593728f5bf666a3ae12145306459 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 21 Jun 2024 16:20:38 +0530 Subject: [PATCH 174/359] FIRECERT-2144-address comment --- cypress/support/step_definitions/testSetup.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cypress/support/step_definitions/testSetup.js b/cypress/support/step_definitions/testSetup.js index 6e812ab8..0266f3de 100644 --- a/cypress/support/step_definitions/testSetup.js +++ b/cypress/support/step_definitions/testSetup.js @@ -93,7 +93,12 @@ function destroyAppInstance(testType) { params, additionalParams ); - cy.log('Sending lifecycle close intent to unload app: ' + JSON.stringify(intentMessage)); + cy.log( + 'Sending lifecycle close intent to unload app, method: ' + + params.methodName + + ' params: ' + + JSON.stringify(params.methodParams) + ); try { cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((response) => { From 56f88587f27afc40a83665292329b6cb29a6bc3f Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Fri, 21 Jun 2024 19:15:33 +0530 Subject: [PATCH 175/359] Fixed lint issues --- cypress/support/cypress-commands/commands.js | 4 +++- cypress/support/cypress-support/src/utils.js | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 0b4d312f..69ac30cb 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -643,7 +643,9 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { // else get the default app id from environment variable. const appId = - appCallSign == undefined ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : UTILS.checkForSecondaryAppId(appCallSign); // this is for the app to know the appId used for launch, so that it can use the same for creating PubSub connection. + appCallSign == undefined + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : UTILS.checkForSecondaryAppId(appCallSign); // this is for the app to know the appId used for launch, so that it can use the same for creating PubSub connection. // if appType is certification, the appLaunch is for certification purposes. In such a case, discovery.launch should go with a basic intent that has the appId and the certification app role. // create the request map // basic intent to be sent to the app on launch diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 8be682be..3806b525 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -634,7 +634,7 @@ function checkForTags(tags) { * @example * checkForSecondaryAppId("appIdKey") */ -function checkForSecondaryAppId(appId){ +function checkForSecondaryAppId(appId) { let envAppIdKey; try { if (appId === CONSTANTS.SECONDARY_THIRD_PARTY_APP) { @@ -644,9 +644,13 @@ function checkForSecondaryAppId(appId){ return appId; } } catch (err) { - fireLog.info(`Unable to find the ${envAppIdKey} value in the env, please add the value in config module/constants/config.json`).then(() => { - throw new Error(`Unable to find the ${envAppIdKey} value in the env`); - }); + fireLog + .info( + `Unable to find the ${envAppIdKey} value in the env, please add the value in config module/constants/config.json` + ) + .then(() => { + throw new Error(`Unable to find the ${envAppIdKey} value in the env`); + }); } } From 3543d97216c3975cfc95a53f9d4e19fdf95a31fd Mon Sep 17 00:00:00 2001 From: jbigel Date: Fri, 21 Jun 2024 14:55:32 -0400 Subject: [PATCH 176/359] updating readme with SPS info --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index aeb3d7d2..df03593f 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ To execute the certification suite against any platform, the following setup mus | healthCheckRetries | number | 8 | Health check retry count | | communicationMode | string | 'SDK' or 'Transport' | Set communicationMode as SDK/transport. Default mode is SDK | | performanceMetrics | boolean | true | Makes a call to platform to start/stop the recording of performance metrics if value is true | +| pubSubUrl | string | ws://127.0.0.1:8081 | Sets the the url to use for a PubSub server which will be used for 3rd party app communication. | | fcaAppList | array | ['default3rdPartyAppId'] | Holds the list of fca app identifiers | @@ -371,5 +372,18 @@ Example Usage: logger.info('This is an informational message', 'moduleName'); logger.debug('This is a debugging message'); logger.error('This is an error message'); +``` - ``` +## Using Simple PubSub + +If you want to use simplePubSub server as the means of communication for 3rd party app calls follow these steps: + +1. Clone SimplePubSub [server](https://github.com/comcast-firebolt/simplePubSub). +2. Setup SimplePubSub server (i.e. `npm install`) and start (i.e. `npm start`). +3. Clone [firebolt-certification-app](https://github.com/rdkcentral/firebolt-certification-app). +4. In FCA hange the `host` in /webpack.dev.js to . +5. Setup firebolt-certification-app (FCA) (i.e. `npm install`) and start (i.e. `npm start`). +6. Point your device to use your local instance of FCA (i.e. `http://:8081`). +7. When running FCS include env variables: + - deviceMac: `` + - pubSubUrl: `ws://:8080` From 41735f625709d2cd1dcbf4fe0b83a44c97b5494e Mon Sep 17 00:00:00 2001 From: jbigel Date: Fri, 21 Jun 2024 15:09:59 -0400 Subject: [PATCH 177/359] pulling changes from other branch --- cypress.config.js | 1 + cypress/plugins/common.js | 11 ++++--- cypress/support/constants/constants.js | 5 ++- cypress/support/cypress-commands/commands.js | 20 +++++++++--- cypress/support/cypress-support/src/utils.js | 10 ++++-- defaultModule/appTransport/index.js | 32 +++++++++++--------- 6 files changed, 51 insertions(+), 28 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index 6e1feca5..413cfb18 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -42,6 +42,7 @@ const env = { thirdPartyMockUser: '456~A', MFOS_base_url: 'http://localhost:3333/api/v1/', firstPartyAppId: 'firstPartyAppId', + failOnPubSubConnectionError: false, certification: false, reportType: 'cucumber', deleteReport: false, diff --git a/cypress/plugins/common.js b/cypress/plugins/common.js index 640696ec..957ea2fc 100644 --- a/cypress/plugins/common.js +++ b/cypress/plugins/common.js @@ -23,9 +23,14 @@ const CONSTANTS = require('../support/constants/constants'); // If "genericSupport" is set to a falsy value (false, null, etc), take no further action. Simply "return" function genericSupport(config) { + let data; // Read additional config. try { - const data = JSON.parse(fs.readFileSync('supportConfig.json')); + data = JSON.parse(fs.readFileSync('supportConfig.json')); + } catch (error) { + logger.error('Received following error while trying to read supportConfig json', error); + return config; + } // Get the arguments passed from command line during run time. const commandLineArgs = Object.entries(config.resolved.env) @@ -54,10 +59,6 @@ function genericSupport(config) { Object.assign(config.env, testDataEnv); return config; - } catch (error) { - logger.error('Received following error while trying to read supportConfig json', error); - return config; - } } module.exports = { diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 4ffc6c55..bd68cc10 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -116,7 +116,7 @@ module.exports = { EVENT_SCHEMA_RESULT: 'eventSchemaResult', EXCEPTION_ERROR_OBJECT: 'exceptionErrorObject', EXCEPTION_METHODS: 'exceptionMethods', - EXCLUDED_METHODS: [], + EXCLUDED_METHODS: ['Lifecycle.close'], EXCLUDED_MODULES: [], EXCLUDED_VALUES: [null, undefined], EXECUTE_SHELL: 'executeShell', @@ -135,6 +135,7 @@ module.exports = { EXTERNAL_PREREQUISITE_DATA: './cypress/fixtures/external/PreRequisiteData.json', EXTRACTEDAPI_PATH: 'extractedApiObject.response.', FAIL: 'FAIL', + FAIL_ON_PUBSUB_CONNECTION_ERROR: 'failOnPubSubConnectionError', FAILED_TO_PARSE_LIEFECYCLE_ERROR: 'Failed to parse error object from response while setting lifecycle state. Response received : ', FAILED_TO_SET_LIFECYCLE_STATE: @@ -230,6 +231,7 @@ module.exports = { LIMITADTRACKING_OFF: 'limitAdTrackingOFF', LIMITADTRACKING_ON: 'limitAdTrackingON', LONGPOLL_TIMEOUT: 15000, + MACADDRESS_PARAM: 'macaddress', MESSAGE_QUEUE: 'messageQueue', MESSAGE_QUEUE_SIZE: 100, MESSAGE_QUEUE_TIME_DIFF: 150000, @@ -293,6 +295,7 @@ module.exports = { 'Platform returned response in invalid format, which could lead to failures in validations. Response must be an object', PLATFORM_NOT_SUPPORT_LOG: 'Platform does not support method', PREREQUISITE_DATA: 'PreRequisiteData.json', + PUB_SUB_URL: 'pubSubUrl', // Env Var for the URL for the Default Module's pubSub implementation SETUPCHECK: 'Setup Check', SETUPVALUES: 'external/setupValues.json', SETUPVALUES_FILEPATH: 'cypress/fixtures/external/setupValues.json', diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 5aa2be1f..0df281b4 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -17,7 +17,7 @@ */ const CONSTANTS = require('../constants/constants'); const { _ } = Cypress; -import UTILS from '../cypress-support/src/utils'; +import UTILS, { getEnvVariable } from '../cypress-support/src/utils'; const logger = require('../Logger')('command.js'); /** @@ -663,12 +663,12 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { ? UTILS.getEnvVariable(CONSTANTS.APP_TYPE) : CONSTANTS.FIREBOLT; // appType defines in which mode app should be launched data = { - query: JSON.stringify({ + query: { params: { [CONSTANTS.APP_ID]: appId, [CONSTANTS.APP_TYPE]: appCategory, }, - }), + }, }; const messageIntent = { action: CONSTANTS.SEARCH, @@ -686,13 +686,13 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE ) { data = { - query: JSON.stringify({ + query: { params: { [CONSTANTS.APP_ID]: appId, [CONSTANTS.LIFECYCLE_VALIDATION]: true, [CONSTANTS.APP_TYPE]: appCategory, }, - }), + }, }; const messageIntent = { data: data, @@ -700,6 +700,16 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { requestMap.params.intent = messageIntent; } + // Add the PubSub URL if required + if (getEnvVariable(CONSTANTS.PUB_SUB_URL, false)) { + data.query.params[CONSTANTS.PUB_SUB_URL] = getEnvVariable(CONSTANTS.PUB_SUB_URL); + if (getEnvVariable(CONSTANTS.DEVICE_MAC, false) { + data.query.params[CONSTANTS.MACADDRESS_PARAM] = getEnvVariable(CONSTANTS.DEVICE_MAC); + } + } + + // Stringify the query (The intent requires it be a string) + data.query = JSON.stringify(data.query); Cypress.env(CONSTANTS.CURRENT_APP_ID, appId); const requestTopic = UTILS.getTopic(appId); diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index b4c264ac..c48da6b7 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -172,7 +172,7 @@ function overideParamsFromConfigModule(overrideParams) { : CONSTANTS.EXCLUDED_METHODS; overrideParams.modulesToBeExcluded = getEnvVariable('excludedModules', false) ? getEnvVariable('excludedModules') - : CONSTANTS.EXCLUDED_METHODS; + : CONSTANTS.EXCLUDED_MODULES; return overrideParams; } @@ -551,8 +551,12 @@ function pubSubClientCreation(appTransport) { clientCreated = true; resolve(true); } catch (error) { - // If an error occurs, reject the promise with the error - reject('Failed to initiate PubSubClient' + error); + if (getEnvVariable(CONSTANTS.FAIL_ON_PUBSUB_CONNECTION_ERROR, false)) { + // If an error occurs, reject the promise with the error + reject('Failed to initiate PubSubClient' + error); + } else { + resolve(false); + } } } else { resolve(false); diff --git a/defaultModule/appTransport/index.js b/defaultModule/appTransport/index.js index 4fb2870e..410fab7a 100644 --- a/defaultModule/appTransport/index.js +++ b/defaultModule/appTransport/index.js @@ -16,6 +16,8 @@ * SPDX-License-Identifier: Apache-2.0 */ const logger = require('../../../cypress/support/Logger')('index.js'); +const constants = require('../../cypress/support/constants/constants'); +const { getEnvVariable } = require('../../cypress/support/cypress-support/src/utils'); const client = { ws: null, @@ -37,9 +39,12 @@ const client = { function init() { logger.info('Establishing pubsub connection'); - return new Promise((resolve, reject) => { + return new Promise((resolve) => { // Enter a valid WebSocket URL - client.ws = new WebSocket('ws://your-ws-url-here.com'); + const url = getEnvVariable(constants.PUB_SUB_URL, false) + ? getEnvVariable(constants.PUB_SUB_URL) + : 'ws://localhost:8080'; + client.ws = new WebSocket(url); const websocket = client.ws; @@ -48,14 +53,14 @@ function init() { websocket.removeEventListener('error', openCallback); resolve(event.data); }; + // if WebSocket connection fails (error or close event), the errorHandler logs the error and resolves the promise with a default message instead of rejecting it. + const errorHandler = function (event) { + logger.info('WebSocket connection failed. Continuing execution...', event.data); + reject('Default: Connection could not be established'); + }; - client.ws.addEventListener('error', function (event) { - reject(event.data); - }); - - client.ws.addEventListener('close', function (event) { - reject(event.data); - }); + client.ws.addEventListener('error', errorHandler); + client.ws.addEventListener('close', errorHandler); client.ws.addEventListener('open', openCallback); }); @@ -129,19 +134,18 @@ function subscribe(topic, callback) { const formattedMsg = { operation: data.operation, topic: data.topic, - headers: data.payload?.headers, - payload: data.payload.message, + payload: data.payload?.message, }; // Add headers to top level of formatted message if they exist - if (data.payload.headers) { + if (data.payload?.headers) { formattedMsg.headers = data.payload.headers; } // If a callback function is provided, call it with the formattedMsg payload and headers if (typeof callback == 'function') { logger.info( 'Incoming notification is valid. Calling callback:' + JSON.stringify(data), - 'sunscribe' + 'subscribe' ); callback(formattedMsg.payload, formattedMsg.headers); } @@ -171,4 +175,4 @@ function unsubscribe(topic) { } // Uncomment the line below to get app transport working -// module.exports = { init, publish, subscribe, unsubscribe }; +module.exports = { init, publish, subscribe, unsubscribe }; \ No newline at end of file From 1e9dddc3cb828f7b024cc872e95c3d3e92b80daa Mon Sep 17 00:00:00 2001 From: jbigel Date: Fri, 21 Jun 2024 15:20:43 -0400 Subject: [PATCH 178/359] lint/prettier fix --- cypress/plugins/common.js | 48 ++++++++++++++--------------- defaultModule/appTransport/index.js | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/cypress/plugins/common.js b/cypress/plugins/common.js index 957ea2fc..c7b92edd 100644 --- a/cypress/plugins/common.js +++ b/cypress/plugins/common.js @@ -32,33 +32,33 @@ function genericSupport(config) { return config; } - // Get the arguments passed from command line during run time. - const commandLineArgs = Object.entries(config.resolved.env) - .filter(([key, value]) => value.from === 'cli') - .reduce((acc, [key, value]) => { - acc[key] = value.value; - return acc; - }, {}); + // Get the arguments passed from command line during run time. + const commandLineArgs = Object.entries(config.resolved.env) + .filter(([key, value]) => value.from === 'cli') + .reduce((acc, [key, value]) => { + acc[key] = value.value; + return acc; + }, {}); - // fireboltCalls JSON - generateIndexFile(CONSTANTS.FIREBOLTCALLS_FROM_FCS, 'fireboltCalls'); - generateIndexFile(CONSTANTS.FIREBOLTCALLS_FROM_CONFIGMODULE, 'fireboltCalls'); - // fireboltMocks JSON - generateIndexFile(CONSTANTS.FIREBOLTMOCK_FROM_FCS, 'fireboltMocks'); - generateIndexFile(CONSTANTS.FIREBOLTMOCK_FROM_CONFIGMODULE, 'fireboltMocks'); + // fireboltCalls JSON + generateIndexFile(CONSTANTS.FIREBOLTCALLS_FROM_FCS, 'fireboltCalls'); + generateIndexFile(CONSTANTS.FIREBOLTCALLS_FROM_CONFIGMODULE, 'fireboltCalls'); + // fireboltMocks JSON + generateIndexFile(CONSTANTS.FIREBOLTMOCK_FROM_FCS, 'fireboltMocks'); + generateIndexFile(CONSTANTS.FIREBOLTMOCK_FROM_CONFIGMODULE, 'fireboltMocks'); - // The sequence of override - the default config in the config.js file, overriden by supportConfig.json and then by the command line arguments. - config.env = { - ...config.env, - ...data, - ...commandLineArgs, - }; - // To read device data JSON - preprocessDeviceData(config); - const testDataEnv = testDataProcessor.testDataProcessor(config.env); - Object.assign(config.env, testDataEnv); + // The sequence of override - the default config in the config.js file, overriden by supportConfig.json and then by the command line arguments. + config.env = { + ...config.env, + ...data, + ...commandLineArgs, + }; + // To read device data JSON + preprocessDeviceData(config); + const testDataEnv = testDataProcessor.testDataProcessor(config.env); + Object.assign(config.env, testDataEnv); - return config; + return config; } module.exports = { diff --git a/defaultModule/appTransport/index.js b/defaultModule/appTransport/index.js index 410fab7a..c2b609b0 100644 --- a/defaultModule/appTransport/index.js +++ b/defaultModule/appTransport/index.js @@ -175,4 +175,4 @@ function unsubscribe(topic) { } // Uncomment the line below to get app transport working -module.exports = { init, publish, subscribe, unsubscribe }; \ No newline at end of file +module.exports = { init, publish, subscribe, unsubscribe }; From 3d12ce15eb28b365fe2b4f74a8c1a7094b7a5d98 Mon Sep 17 00:00:00 2001 From: jbigel Date: Fri, 21 Jun 2024 15:25:39 -0400 Subject: [PATCH 179/359] attempt at lint fix --- cypress/support/cypress-commands/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 0df281b4..57b070b3 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -703,7 +703,7 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { // Add the PubSub URL if required if (getEnvVariable(CONSTANTS.PUB_SUB_URL, false)) { data.query.params[CONSTANTS.PUB_SUB_URL] = getEnvVariable(CONSTANTS.PUB_SUB_URL); - if (getEnvVariable(CONSTANTS.DEVICE_MAC, false) { + if (getEnvVariable(CONSTANTS.DEVICE_MAC, false)) { data.query.params[CONSTANTS.MACADDRESS_PARAM] = getEnvVariable(CONSTANTS.DEVICE_MAC); } } From 84d9303e1c77afa4b15fa9767bf9f0d80246d251 Mon Sep 17 00:00:00 2001 From: jbigel <111541614+jbigel@users.noreply.github.com> Date: Fri, 21 Jun 2024 15:35:24 -0400 Subject: [PATCH 180/359] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index df03593f..16d87f20 100644 --- a/README.md +++ b/README.md @@ -378,7 +378,7 @@ Example Usage: If you want to use simplePubSub server as the means of communication for 3rd party app calls follow these steps: -1. Clone SimplePubSub [server](https://github.com/comcast-firebolt/simplePubSub). +1. Clone SimplePubSub server. 2. Setup SimplePubSub server (i.e. `npm install`) and start (i.e. `npm start`). 3. Clone [firebolt-certification-app](https://github.com/rdkcentral/firebolt-certification-app). 4. In FCA hange the `host` in /webpack.dev.js to . From 2b217aaf3c78947d51b0de2787d595f3a2eb8f15 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Mon, 24 Jun 2024 11:24:34 +0530 Subject: [PATCH 181/359] Added comments --- cypress/support/cypress-commands/commands.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index d494f0a3..329681bd 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -708,6 +708,7 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { data.query.params[CONSTANTS.MACADDRESS_PARAM] = getEnvVariable(CONSTANTS.DEVICE_MAC); } } + // If the testType is userInterestProvider, send the discovery.launch params with registerProvider = false, then certification app will not register for userInterest provider. if (Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.USERINTERESTPROVIDER) { data = { query: JSON.stringify({ From da4878612660913906e2e4f74cf6ec692d5514d4 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Mon, 24 Jun 2024 14:46:42 +0530 Subject: [PATCH 182/359] FIRECERT-2157-task-2 --- .../Localization.feature | 28 +++++++++++++------ .../fixtures/fireboltCalls/localization.json | 10 +++++++ cypress/fixtures/modules/localization.json | 1 + 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Localization.feature b/cypress/TestCases/FireboltCertification/Localization.feature index 6447fe29..1430eb82 100644 --- a/cypress/TestCases/FireboltCertification/Localization.feature +++ b/cypress/TestCases/FireboltCertification/Localization.feature @@ -36,16 +36,28 @@ Feature: Localization | with key and value as empty string | set localization removeAdditionalInfo with empty string | empty response for localization additionalInfo | @Localization @coreSDK @sdk @transport - Scenario Outline: Localization. - Positive Scenario: Get - When '3rd party app' invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds with '' + Scenario: Localization.latlon - Positive Scenario: Get latlon + When '3rd party app' invokes the 'Firebolt' API to 'get localization latlon' + Then 'Firebolt' platform responds with 'expected localization latlon' + + @Localization @coreSDK @sdk @transport + Scenario Outline: Positive Scenario: Validate interlinked methods - + When '3rd party app' registers for the '' event using the 'Firebolt' API + And '3rd party app' registers for the '' event using the 'Firebolt' API + And '3rd party app' invokes the 'Firebolt' API to '' + And 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + And 'Firebolt' platform triggers event '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + And 'Firebolt' platform triggers event '' Examples: - | Scenario | API_Key | Validation_Key | - | countrycode | get localization countrycode | expected localization countrycode | - | language | get localization language | expected localization language | - | locale | get localization locale | expected localization locale | - | latlon | get localization latlon | expected localization latlon | + | Methods | First_Event_Registration_Key | Second_Event_Registration_Key | Set_API_Key | First_Get_API_Key | Second_Get_API_Key | First_Method_Validation_Key | Second_Method_Validation_Key | First_Event_Validation_Key | Second_Event_Validation_Key | + | Localization.locale and Localization.countrycode | localization onLocaleChanged | localization onCountryCodeChanged | set locale to enUK | get localization locale | get localization countrycode | enUK for localization locale | UK for localization countrycode | onlocalechanged for localization with enUK | oncountrycodechanged for localization with UK | + | Localization.locale and Localization.language | localization onLocaleChanged | localization onLanguageChanged | set locale to enUK | get localization locale | get localization language | enUK for localization locale | en for localization language | onlocalechanged for localization with enUK | onlanguagechanged for localization with en | @Localization @coreSDK @sdk @transport Scenario Outline: - Positive Scenario: Validate diff --git a/cypress/fixtures/fireboltCalls/localization.json b/cypress/fixtures/fireboltCalls/localization.json index 76ba561f..a8d3d0cb 100644 --- a/cypress/fixtures/fireboltCalls/localization.json +++ b/cypress/fixtures/fireboltCalls/localization.json @@ -264,6 +264,16 @@ "validationJsonPath": "eventResponse", "content": "LOCALIZATION_COUNTRYCODE_PH" }, + "ONCOUNTRYCODECHANGED_FOR_LOCALIZATION_WITH_UK": { + "event": "localization.onCountryCodeChanged", + "validationJsonPath": "eventResponse", + "content": "LOCALIZATION_COUNTRYCODE_UK" + }, + "UK_FOR_LOCALIZATION_COUNTRYCODE": { + "method": "localization.countryCode", + "validationJsonPath": "result", + "content": "LOCALIZATION_COUNTRYCODE" + }, "SET_POSTALCODE_TO_12345": { "method": "manage_localization.setPostalCode", "params": "STRING_12345" diff --git a/cypress/fixtures/modules/localization.json b/cypress/fixtures/modules/localization.json index ddbdd62f..2772fd94 100644 --- a/cypress/fixtures/modules/localization.json +++ b/cypress/fixtures/modules/localization.json @@ -16,6 +16,7 @@ "PREFERRED_AUDIO_LANGUAGES_SPA_ENG":["spa","eng"], "PREFERRED_AUDIO_LANGUAGES_ENG_SPA":["eng","spa"], "COUNTRYCODE_PH": "PH", + "COUNTRYCODE_UK": "UK", "LANGUAGE_EN": "en", "LANGUAGE_ES": "es", "LOCALE": "en-US", From a522536993b36229d79ce183789c817b98cb98d0 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 24 Jun 2024 15:47:25 +0530 Subject: [PATCH 183/359] Added error content validation for new glue --- cypress/plugins/testDataProcessor.js | 49 +++++++++++++++++++ cypress/plugins/testDataProcessor.md | 13 +++++ .../support/step_definitions/validations.js | 44 ++++++++--------- .../support/step_definitions/validations.md | 21 +++++++- 4 files changed, 103 insertions(+), 24 deletions(-) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index 6aa12219..23abbb43 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -60,11 +60,15 @@ function testDataProcessor(configEnv) { // Resolving the variables in the SetResponse JSON const resolvedSetResponseJson = processSetResponseJson(mergedSetResponseJson); + // Resolving the variables in the SetResponse JSON + const resolvedErrorContentJson = processErrorContentJson(); + // Below key names are converted into environment variables. return { fireboltCallsJson: resolvedFireboltCallsJson, fireboltMocksJson: combinedFireboltMocksJson, setResponseJson: resolvedSetResponseJson, + errorContentValidationJson: resolvedErrorContentJson }; } @@ -96,6 +100,51 @@ function processSetResponseJson(setResponseJsonData) { return setResponseJsonData; } +/** + * @function processErrorContentJson + * processErrorContentJson function will perform following operations + * - Iterate over each key in the provided JSON + * - Resolve the each type in the array of validations object. + * - Return the JSON with the updated value. + * + * @example + * processErrorContentJson() + */ +function processErrorContentJson() { + let errorSchemaJson = fetchDataFromFile(CONSTANTS.ERROR_SCHEMA_OBJECTS_PATH); + + // Looping through json data + for (const key in errorSchemaJson) { + const object = errorSchemaJson[key]; + if ( + typeof object == CONSTANTS.TYPE_OBJECT && + object.type == CONSTANTS.VALIDATION_FUNCTION && + object.hasOwnProperty('validations') && + Array.isArray(object.validations) + ) { + // Looping through the validations array, obtaining and updating the field type with error content data. + object.validations.forEach((validationObject) => { + const errorContentObject = fetchAndParseDataFromJson( + CONSTANTS.ERROR_CONTENT_OBJECTS_PATH, + validationObject.type + ); + if (errorContentObject == CONSTANTS.NO_DATA) { + logger.info( + `Expected error content object not found in ${CONSTANTS.ERROR_CONTENT_OBJECTS_PATH} for ${validationObject.type}` + ); + validationObject.type = validationObject.type; + } else { + validationObject.type = errorContentObject; + } + }); + } else { + logger.info(`Unable to find data for Error validation for ${key}`); + } + } + return errorSchemaJson; +} + + /** * @function processFireboltJson * processFireboltJson function will perform following operations diff --git a/cypress/plugins/testDataProcessor.md b/cypress/plugins/testDataProcessor.md index bb1f26fa..cb743869 100644 --- a/cypress/plugins/testDataProcessor.md +++ b/cypress/plugins/testDataProcessor.md @@ -45,6 +45,19 @@ Response - {'abc': {'method': 'method_name', 'validationJsonPath': 'result', 'content': true}} ``` +### > processErrorContentJson +processErrorContentJson function will perform following operations +- Iterate over each key in the provided JSON +- Resolve the each type in the array of validations object. +- Return the JSON with the updated value. + +Ex: + +``` +Request +- processErrorContentJson() +``` + ### > testDataHandler This command is used mainly for parsing and fetching test data from various fixture files depending on the requestType passed to the command. RequestType can have different values based on what type of data need to be parsed and fetched from test data file. DataIdentifier specifies the key of the test data which is used to identify and fetch the test data from different test data files. diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index ef82a780..e07809b0 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -417,9 +417,11 @@ Given( let fireboltCallObject; appId = !appId ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : appId === CONSTANTS.FIRST_PARTY_APP - ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) - : appId; + : appId === CONSTANTS.THIRD_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.FIRST_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) + : appId; const context = {}; const expectingError = errorContent ? true : false; @@ -467,26 +469,22 @@ Given( !Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION) && (UTILS.isScenarioExempted(method, param) || expectingError) ) { - // TODO: Need to parse errorSchemaObject - cy.fixture('objects/errorObjects/errorSchemaObject').then((errorSchemaObject) => { - let errorExpected; - let errorObject = errorSchemaObject[errorContent]; - - // If the expected error is false, we set "exceptionErrorObject" to the errorExpected variable, which will be used to retrieve the error content object based on the exception method type. - expectingError === true - ? (errorExpected = errorObject) - : (errorExpected = CONSTANTS.EXCEPTION_ERROR_OBJECT); - - cy.validateErrorObject( - method, - errorExpected, - CONSTANTS.METHOD, - context, - appId, - param - ).then(() => { - return true; - }); + let errorExpected; + + // If the expected error is false, we set "exceptionErrorObject" to the errorExpected variable, which will be used to retrieve the error content object based on the exception method type. + expectingError === true + ? (errorExpected = UTILS.getEnvVariable('errorContentValidationJson')[errorContent]) + : (errorExpected = CONSTANTS.EXCEPTION_ERROR_OBJECT); + + cy.validateErrorObject( + method, + errorExpected, + CONSTANTS.METHOD, + context, + appId, + param + ).then(() => { + return true; }); } else if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { try { diff --git a/cypress/support/step_definitions/validations.md b/cypress/support/step_definitions/validations.md index ad5c3aa8..4ce8651b 100644 --- a/cypress/support/step_definitions/validations.md +++ b/cypress/support/step_definitions/validations.md @@ -409,4 +409,23 @@ Here, the value of the key "assertionDef" will be the customMethod we use for va ] } ] -} \ No newline at end of file +} + +## '(.+)' platform validates '(.+)' ('(.+)')? (get|set) API response(?: as '(.+)')? +### Purpose: Performing a validation against the source of truth for the given API response + +### Params: +| Param | Definition | +| --- | --- | +| sdk | name of the sdk | +| appId | The object was retrieved by using the appId | +| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData Json | +| methodType | Determines which method doing content validation Ex: set or get | +| errorContent | Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' | + +### Examples: +* `And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' get API response` +* `And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' set API response` +* `And 'Firebolt' platform validates '3rd party app' 'CLOSEDCAPTION_SETTINGS' get API response` +* `And 'Firebolt' platform validates '1st party app' set API response` +* `And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' set API response as 'INVALID_TYPE_PARAMS'` From ca614f568a418d7f5514ef64fc12ab8d4a191f10 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 24 Jun 2024 16:28:51 +0530 Subject: [PATCH 184/359] fixed lint issues --- cypress/plugins/testDataProcessor.js | 9 +++------ cypress/support/cypress-support/src/utils.js | 4 +++- cypress/support/step_definitions/validations.js | 12 ++++++------ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index 23abbb43..cc791f96 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -68,7 +68,7 @@ function testDataProcessor(configEnv) { fireboltCallsJson: resolvedFireboltCallsJson, fireboltMocksJson: combinedFireboltMocksJson, setResponseJson: resolvedSetResponseJson, - errorContentValidationJson: resolvedErrorContentJson + errorContentValidationJson: resolvedErrorContentJson, }; } @@ -111,7 +111,7 @@ function processSetResponseJson(setResponseJsonData) { * processErrorContentJson() */ function processErrorContentJson() { - let errorSchemaJson = fetchDataFromFile(CONSTANTS.ERROR_SCHEMA_OBJECTS_PATH); + const errorSchemaJson = fetchDataFromFile(CONSTANTS.ERROR_SCHEMA_OBJECTS_PATH); // Looping through json data for (const key in errorSchemaJson) { @@ -128,12 +128,10 @@ function processErrorContentJson() { CONSTANTS.ERROR_CONTENT_OBJECTS_PATH, validationObject.type ); - if (errorContentObject == CONSTANTS.NO_DATA) { + if (errorContentObject !== CONSTANTS.NO_DATA) { logger.info( `Expected error content object not found in ${CONSTANTS.ERROR_CONTENT_OBJECTS_PATH} for ${validationObject.type}` ); - validationObject.type = validationObject.type; - } else { validationObject.type = errorContentObject; } }); @@ -144,7 +142,6 @@ function processErrorContentJson() { return errorSchemaJson; } - /** * @function processFireboltJson * processFireboltJson function will perform following operations diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 5563d8bc..fce02ace 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -839,7 +839,9 @@ global.resolveAtRuntime = function (input) { } // If input not having "{{", returning content from runtime environment variable. else if (!input.includes('{{')) { - return getEnvVariable('runtime')[input] !== undefined? getEnvVariable('runtime')[input] : input; + return getEnvVariable('runtime')[input] !== undefined + ? getEnvVariable('runtime')[input] + : input; } } else if (Array.isArray(input) && input.length > 0) { // input is an array; iterating through each element, it updates the actual value for that pattern if there is an occurrence of "{{". diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index e07809b0..c9e6002a 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -391,9 +391,6 @@ Given( } ); - -//'' platform validates '' '' '(get|set)' API response (as '') - /** * @module validations * @function And '(.+)' platform validates '(.+)' ('(.+)')? (get|set) API response(?: as '(.+)')? @@ -415,6 +412,7 @@ Given( async (sdk, appId, fireboltCallKey, methodType, errorContent) => { if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { let fireboltCallObject; + // Reading the appId from the environment variable appId = !appId ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : appId === CONSTANTS.THIRD_PARTY_APP @@ -494,6 +492,7 @@ Given( const scenario = object.type; const methodResponse = apiObject?.response ? apiObject.response : null; + // Looping through validationJsonPath to find the valid path for validation. if (validationJsonPath && Array.isArray(validationJsonPath)) { let validationPath = validationJsonPath.find((path) => { if ( @@ -593,10 +592,11 @@ Given( } } return input; - } else if (typeof input === CONSTANTS.TYPE_FUNCTION) { + } else if (input && typeof input === CONSTANTS.TYPE_FUNCTION) { return input(); + } else { + return input; } - return input; } } -); \ No newline at end of file +); From 8daf0e103e95fcaf595893474dee374313aabb31 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Mon, 24 Jun 2024 17:15:26 +0530 Subject: [PATCH 185/359] FIRECERT-2157-SecureStorage Securestorage manage test cases --- .../Manage/SecureStorageManage.feature | 106 +++++++++++++----- .../fixtures/fireboltCalls/securestorage.json | 93 +++++++++++++++ cypress/fixtures/modules/securestorage.json | 93 +++++++++++++++ 3 files changed, 264 insertions(+), 28 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature index 21d2faa2..864fe690 100644 --- a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature @@ -6,52 +6,102 @@ Feature: SecureStorage_Manage @SecureStorage @manageSDK Scenario Outline: SecureStorage.setForApp - Positive Scenario: + Given 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' + And 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'null for getting stored value' When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' for '' When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' with '' Examples: - | Scenario | Set_API_Key | API_Key | Method_Validation_Key | - | setForApp with device scope | set secure data value for an app with scope device | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | - | setForApp with account scope | set secure data value for an app with scope account | get stored value with scope as account and key as authTestTokenAccount | expected value for authTestTokenAccount stored data in securestorage | - | setForApp with device scope and optional parameter | set secure data value for an app with scope device with optional parameter | get stored value with scope as device and key as authTestTokenDevice1 | authTestTokenValue1 for stored data in securestorage | - | setForApp with account scope and optional parameter | set secure data value for an app with scope account with optional parameter | get stored value with scope as account and key as authTestTokenAccount1 | authTestTokenValue1 for stored data in securestorage | + | Scenario | Set_API_Key | API_Key | Method_Validation_Key | Clear_API_Key | + | setForApp with device scope | set secure data value for an app with scope device | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with account scope | set secure data value for an app with scope account | get stored value with scope as account and key as authTestTokenAccount | expected value for authTestTokenAccount stored data in securestorage | clear stored value with scope as account for an app | + | setForApp with device scope and optional parameter | set secure data value for an app with scope device with optional parameter | get stored value with scope as device and key as authTestTokenDevice1 | authTestTokenValue1 for stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with account scope and optional parameter | set secure data value for an app with scope account with optional parameter | get stored value with scope as account and key as authTestTokenAccount1 | authTestTokenValue1 for stored data in securestorage | clear stored value with scope as account for an app | @SecureStorage @manageSDK Scenario Outline: SecureStorage.removeForApp - Positive Scenario: - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with 'null for getting stored value' + Given 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for '' + And 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for '' + And 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value' + And 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for '' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When 1st party app invokes the 'Firebolt' API to '' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with 'Validation_Key2' Examples: - | Scenario | Set_API_Key | API_Key | - | removeForApp with device scope | remove secure data value for an app with scope device | get stored value for authTestTokenDevice with scope device | - | removeForApp with account scope | remove secure data value for an app with scope account | get stored value for authTestTokenAccount with scope account | + | Scenario | Remove_API_Key | API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | + | removeForApp with device scope | remove secure data value for an app with scope device | get stored value for authTestTokenDevice with scope device | set secure data value for an app with scope device1 | set secure data value for an app with scope device2 | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | + | removeForApp with account scope | remove secure data value for an app with scope account | get stored value for authTestTokenAccount with scope account | set secure data value for an app with scope account | set secure data value for an app with scope account | get stored value for an app for authTestTokenAccount1 with scope device | get stored value for an app for authTestTokenAccount2 with scope device | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | @SecureStorage @manageSDK Scenario Outline: SecureStorage.clearForApp - Positive Scenario: - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with 'null for getting stored value' + Given 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for '' + And 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for '' + And 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value' + And 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for '' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When 1st party app invokes the 'Firebolt' API to '' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' Examples: - | Scenario | Set_API_Key | API_Key | - | clearForApp with device scope | clear secure data values for an app with scope device | get stored value for an app with scope device | - | clearForApp with account scope | clear secure data values for an app with scope account | get stored value for an app with scope account | + | Scenario | Clear_API_Key | API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | + | clearForApp with device scope | clear secure data value for an app with scope device | get stored value for authTestTokenDevice with scope device | set secure data value for an app with scope device1 | set secure data value for an app with scope device2 | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | + | clearForApp with account scope | clear secure data value for an app with scope account | get stored value for authTestTokenAccount with scope account | set secure data value for an app with scope account | set secure data value for an app with scope account | get stored value for an app for authTestTokenAccount1 with scope device | get stored value for an app for authTestTokenAccount2 with scope device | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | @SecureStorage @manageSDK - Scenario Outline: SecureStorage. - Negative Scenario: expecting error + Scenario Outline: SecureStorage.setForApp - Negative Scenario: + Given 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' + And 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'null for getting stored value' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for 'invalid params for setting a data value in securestorage' When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with '' + Then 'Firebolt' platform responds to '1st party app' with '' Examples: - | Scenario | Method | API_Key | Method_Validation_key | - | setForApp-integer | setForApp | set secure data value for an app with integer parameter | invalid params for setting a data value in securestorage | - | setForApp-boolean | setForApp | set secure data value for an app with true parameter | invalid params for setting a data value in securestorage | - | removeForApp-integer | removeForApp | remove secure data value for an app with integer parameter | invalid params for removing stored value in securestorage | - | removeForApp-boolean | removeForApp | remove secure data value for an app with true parameter | invalid params for removing stored value in securestorage | - | clearForApp-integer | clearForApp | clear secure data values for an app with integer parameter | invalid params for clearing all data for an app in securestorage | - | clearForApp-boolean | clearForApp | clear secure data values for an app with true parameter | invalid params for clearing all data for an app in securestorage | \ No newline at end of file + | Scenario | Set_API_Key | API_Key | Method_Validation_Key | Clear_API_Key | + | setForApp with invalid scope | set secure data value for an app with invalid scope | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with integer scope | set secure data value for an app with invalid scope | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with null scope | set secure data value for an app with null scope | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with boolean scope | set secure data value for an app with boolean scope | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with empty scope | set secure data value for an app with empty scope | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp without scope | set secure data value for an app without scope | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with integer key | set secure data value for an app with integer key | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with null key | set secure data value for an app with null key | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with boolean key | set secure data value for an app with boolean key | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp without key | set secure data value for an app without key | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with integer value | set secure data value for an app with integer value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with null value | set secure data value for an app with null value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with boolean value | set secure data value for an app with boolean value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp without value | set secure data value for an app without value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + +# @SecureStorage @manageSDK +# Scenario Outline: SecureStorage. - Negative Scenario: expecting error +# When 1st party app invokes the 'Firebolt' API to '' +# Then 'Firebolt' platform responds to '1st party app' with '' + +# Examples: +# | Scenario | Method | API_Key | Method_Validation_key | +# | setForApp-integer | setForApp | set secure data value for an app with integer parameter | invalid params for setting a data value in securestorage | +# | setForApp-boolean | setForApp | set secure data value for an app with true parameter | invalid params for setting a data value in securestorage | +# | removeForApp-integer | removeForApp | remove secure data value for an app with integer parameter | invalid params for removing stored value in securestorage | +# | removeForApp-boolean | removeForApp | remove secure data value for an app with true parameter | invalid params for removing stored value in securestorage | +# | clearForApp-integer | clearForApp | clear secure data values for an app with integer parameter | invalid params for clearing all data for an app in securestorage | +# | clearForApp-boolean | clearForApp | clear secure data values for an app with true parameter | invalid params for clearing all data for an app in securestorage | \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/securestorage.json b/cypress/fixtures/fireboltCalls/securestorage.json index 351ba2a5..5c07b302 100644 --- a/cypress/fixtures/fireboltCalls/securestorage.json +++ b/cypress/fixtures/fireboltCalls/securestorage.json @@ -149,6 +149,14 @@ "method": "securestorage.set", "params": "SECURESTORAGE_SET_DEVICE2" }, + "SET_SECURE_VALUE_FOR_AN_APP_FOR_KEY_AUTHTESTTOKENDEVICE1": { + "method": "securestorage.setForApp", + "params": "SECURESTORAGE_SET_DEVICE1" + }, + "SET_SECURE_VALUE_FOR_AN_APP_FOR_KEY_AUTHTESTTOKENDEVICE2": { + "method": "securestorage.setForApp", + "params": "SECURESTORAGE_SET_DEVICE2" + }, "REMOVE_THE_STORED_VALUE_AUTHTESTTOKENDEVICE1_WITH_SCOPE_DEVICE": { "method": "securestorage.remove", "params": "SECURESTORAGE_REMOVE_DEVICE1" @@ -161,6 +169,14 @@ "method": "securestorage.get", "params": "SECURESTORAGE_GET_DEVICE_KEY2" }, + "GET_STORED_VALUE_FOR_AN_APP_FOR_AUTHTESTTOKENDEVICE1_WITH_SCOPE_DEVICE": { + "method": "securestorage.get", + "params": "SECURESTORAGE_GET_DEVICE_KEY1" + }, + "GET_STORED_VALUE_FOR_AN_APP_FOR_AUTHTESTTOKENDEVICE2_WITH_SCOPE_DEVICE": { + "method": "securestorage.get", + "params": "SECURESTORAGE_GET_DEVICE_KEY2" + }, "EXPECTED_VALUE_FOR_AUTHTESTTOKENDEVICE2_STORED_DATA_IN_SECURESTORAGE": { "method": "securestorage.get", "validationJsonPath": "result", @@ -219,6 +235,70 @@ "method": "manage_securestorage.setForApp", "params": "SECURESTORAGE_SETFORAPP_DEVICE" }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INVALID_SCOPE": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_INVALID_SCOPE" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INTEGER_SCOPE": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_INTEGER_SCOPE" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_NULL_SCOPE": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_NULL_SCOPE" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_BOOLEAN_SCOPE": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_BOOLEAN_SCOPE" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_EMPTY_SCOPE": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_EMPTY_SCOPE" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITHOUT_SCOPE": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_WITHOUT_SCOPE" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INTEGER_KEY": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_WITH_INTEGER_KEY" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_NULL_KEY": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_WITH_NULL_KEY" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_BOOLEAN_KEY": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_WITH_BOOLEAN_KEY" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITHOUT_KEY": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_WITHOUT_KEY" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INTEGER_VALUE": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_WITH_INTEGER_VALUE" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_NULL_VALUE": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_WITH_NULL_VALUE" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_BOOLEAN_VALUE": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_WITH_BOOLEAN_VALUE" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITHOUT_VALUE": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_WITHOUT_VALUE" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_DEVICE1": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_DEVICE1" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_DEVICE2": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_DEVICE2" + }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_ACCOUNT": { "method": "manage_securestorage.setForApp", "params": "SECURESTORAGE_SETFORAPP_ACCOUNT" @@ -560,11 +640,24 @@ "method": "securestorage.clear", "params": "SECURESTORAGE_CLEAR_ACCOUNT" }, + "CLEAR_STORED_VALUE_WITH_SCOPE_AS_DEVICE_FOR_AN_APP": { + "method": "securestorage.clearForApp", + "params": "SECURESTORAGE_CLEARFORAPP_DEVICE" + }, + "CLEAR_STORED_VALUE_WITH_SCOPE_AS_ACCOUNT_FOR_AN_APP": { + "method": "securestorage.clearForApp", + "params": "SECURESTORAGE_CLEARFORAPP_ACCOUNT" + }, "NULL_FOR_CLEARING_STORED_VALUE": { "method": "securestorage.clear", "validationJsonPath": "result", "content": "NULL" }, + "NULL_FOR_CLEARING_STORED_VALUE_FOR_AN_APP": { + "method": "securestorage.clearForApp", + "validationJsonPath": "result", + "content": "NULL" + }, "CLEAR_STORED_VALUE_WITH_INVALID_SCOPE": { "method": "securestorage.clear", "params": "SECURESTORAGE_CLEAR_INVALID_SCOPE", diff --git a/cypress/fixtures/modules/securestorage.json b/cypress/fixtures/modules/securestorage.json index a8b45c27..ca3eef4f 100644 --- a/cypress/fixtures/modules/securestorage.json +++ b/cypress/fixtures/modules/securestorage.json @@ -277,6 +277,99 @@ "key": "authTestTokenDevice", "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, + "SETFORAPP_INVALID_SCOPE": { + "appId": "refui", + "scope": "test", + "key": "authTestTokenDevice", + "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" + }, + "SETFORAPP_INTEGER_SCOPE": { + "appId": "refui", + "scope": 123, + "key": "authTestTokenDevice", + "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" + }, + "SETFORAPP_NULL_SCOPE": { + "appId": "refui", + "scope": null, + "key": "authTestTokenDevice", + "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" + }, + "SETFORAPP_BOOLEAN_SCOPE": { + "appId": "refui", + "scope": true, + "key": "authTestTokenDevice", + "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" + }, + "SETFORAPP_EMPTY_SCOPE": { + "appId": "refui", + "scope": "", + "key": "authTestTokenDevice", + "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" + }, + "SETFORAPP_WITHOUT_SCOPE": { + "appId": "refui", + "key": "authTestTokenDevice", + "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" + }, + "SETFORAPP_WITH_INTEGER_KEY": { + "appId": "refui", + "scope": "device", + "key": 123, + "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" + }, + "SETFORAPP_WITH_NULL_KEY": { + "appId": "refui", + "scope": "device", + "key": null, + "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" + }, + "SETFORAPP_WITH_BOOLEAN_KEY": { + "appId": "refui", + "scope": "device", + "key": true, + "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" + }, + "SETFORAPP_WITHOUT_KEY": { + "appId": "refui", + "scope": "device", + "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" + }, + "SETFORAPP_WITH_INTEGER_VALUE": { + "appId": "refui", + "scope": "device", + "key": "authTestTokenDevice", + "value": 123 + }, + "SETFORAPP_WITH_NULL_VALUE": { + "appId": "refui", + "scope": "device", + "key": "authTestTokenDevice", + "value": null + }, + "SETFORAPP_WITH_BOOLEAN_VALUE": { + "appId": "refui", + "scope": "device", + "key": "authTestTokenDevice", + "value": true + }, + "SETFORAPP_WITHOUT_VALUE": { + "appId": "refui", + "scope": "device", + "key": "authTestTokenDevice" + }, + "SETFORAPP_DEVICE1": { + "appId": "refui", + "scope": "device", + "key": "authTestTokenDevice1", + "value": "authTestTokenDevice1" + }, + "SETFORAPP_DEVICE2": { + "appId": "refui", + "scope": "device", + "key": "authTestTokenDevice2", + "value": "authTestTokenDevice2" + }, "SETFORAPP_ACCOUNT": { "appId": "refui", "scope": "account", From 02e48b53da6ad86e1939a4ea51b8a74106891718 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 24 Jun 2024 17:45:01 +0530 Subject: [PATCH 186/359] fixed lint issues --- cypress/support/step_definitions/validations.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index c9e6002a..120c2a03 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -449,7 +449,7 @@ Given( : typeof fireboltCallObject.validationJsonPath == CONSTANTS.TYPE_FUNCTION ? fireboltCallObject.validationJsonPath() : fireboltCallObject.validationJsonPath; - let contentObject = + const contentObject = methodType === 'set' ? resolveContentObject(fireboltCallObject.setContent) : resolveContentObject(fireboltCallObject.content); @@ -494,7 +494,7 @@ Given( // Looping through validationJsonPath to find the valid path for validation. if (validationJsonPath && Array.isArray(validationJsonPath)) { - let validationPath = validationJsonPath.find((path) => { + const validationPath = validationJsonPath.find((path) => { if ( path .split('.') From 0ab87f9b5aa4e604c33097b414893aaf4def6389 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Mon, 24 Jun 2024 20:32:05 +0530 Subject: [PATCH 187/359] UserGrants feature file --- .../FireboltCertification/UserGrants.feature | 753 ++++++++++++++++++ 1 file changed, 753 insertions(+) create mode 100644 cypress/TestCases/FireboltCertification/UserGrants.feature diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature new file mode 100644 index 00000000..aee9edfc --- /dev/null +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -0,0 +1,753 @@ +Feature: UserGrants + + # If lifespan value is set to once, grant is requested for every attempt. + # Case-1: Validating by allowing the grant + # Case-2: Validating by denying the grant (using pinchallenge and acknowledge). + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.Grant - Positive Scenario: Validate Capabilities with denied (pinChallenge) and lifespan once + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + # Case-1 + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'get postalcode' + Then 'Firebolt' platform responds with '20850 for localization postalcode' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for postalcode' + Then 'Firebolt' platform responds with 'null for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + # Case-2 + When User set response for 'set pinchallenge wrong pin' + And User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'expect error for postalcode' + Then 'Firebolt' platform responds with 'invalid request for postalcode' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for postalcode' + Then 'Firebolt' platform responds with 'null for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + + # Testing with grantPolicy having one option with one step(here step with acknowledge) + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capability Grant access with one step option(only acknowledgeChallenge) + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And Framework registers 'ackchallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'get localization countrycode' + Then 'Firebolt' platform responds with 'expected localization countrycode' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for localization countrycode' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + + # Testing with grantPolicy having with scope device and grant access, so all the apps in that device may have the access + # provide access using any 3rd party and check in another 3rd party + @Usergrants @coreSDK @sdk @transport @notSupported + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capability Grant access with scope device + Given the environment has been set up for 'userGrants' tests + # 3rd party app + And 3rd party 'certification' app is launched + And Framework registers 'pinChallenge' test provider + When '3rd party app' invokes the 'Firebolt' API to 'notify watched content with only entityid' + Then 'Firebolt' platform responds with 'true for watched content in discovery' + When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' + Then 'Firebolt' platform responds with 'true for capabilities granted' + ###### And App will be in 'closed' state + # 1st part app + ###### And 1st party 'certification' app is launched + When '3rd party app' invokes the 'Firebolt' API to 'notify watched content with only entityid' + Then 'Firebolt' platform responds with 'true for watched content in discovery' + When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' + Then 'Firebolt' platform responds with 'true for capabilities granted' + + # Deny access with scope device, so all the apps in that device may not have the access + # launch a 3rd party and provide acess using any 3rd party and check in another 3rd party + @Usergrants @coreSDK @sdk @transport @notSupported + Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capability access denied for pinChallenge with scope device + Given the environment has been set up for 'userGrants' tests + # 3rd party app + And 3rd party 'certification' app is launched + And Framework registers 'pinChallenge' test provider + When '3rd party app' invokes the 'Firebolt' API to 'expect error while notifying watched content with only entityid' + Then 'Firebolt' platform responds with 'invalid request for discovery watched' + When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' + Then 'Firebolt' platform responds with 'false for capabilities granted' + # 1st part app + ###### And 1st party 'certification' app is launched + When '3rd party app' invokes the 'Firebolt' API to 'expect error while notifying watched content with only entityid' + Then 'Firebolt' platform responds with 'invalid request for discovery watched' + When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' + Then 'Firebolt' platform responds with 'false for capabilities granted' + + # If lifespan value forever only once ask for grant until we clear the given grant + # Case-1: Allowing the grant and validating the result + # Case-2: Checking the lifecycle history to check ui is not coming and validating for result because already allowed grant in Case-1. + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan forever + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + #Case-1 + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'get locality' + Then 'Firebolt' platform responds with 'washington for localization locality' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for locality' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + #Case-2 + When User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'get locality' + Then 'Firebolt' platform responds with 'washington for localization locality' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'EMPTY_HISTORY' + + # If lifespan value forever only once ask for grant until we clear the given grant + # Case-1: Denying the grant and validating for error + # Case-2: Checking the lifecycle history to check ui is not coming and calling postal code and validating for error because already denied grant in Case-1. + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan forever + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + #Case-1 + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'expect error localization locality' + Then 'Firebolt' platform responds with 'invalid request for localization locality' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for locality' + Then 'Firebolt' platform responds with 'false for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + #Case-2 + When User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'expect error localization locality' + Then 'Firebolt' platform responds with 'invalid request for localization locality' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'EMPTY_HISTORY' + + # If lifespan value appActive it ask grant once when app is active and it ask again when app is closed and active again. + # Case-1: Allowing grant when app is active and validating + # Case-2: Closing and launching the app, allowing grant and validating ui is coming again + @Usergrants @coreSDK @sdk @transport @notSupported + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan appActive + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + #Case-1 + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'get device name' + Then 'Firebolt' platform responds with 'living hall for device name' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for locality' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + #Case-2 + ###### And App will be in 'closed' state + When 3rd party 'certification' app is launched + And User set response for 'set pinchallenge correct pin' + And User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'get device name' + Then 'Firebolt' platform responds with 'living hall for device name' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + + # If lifespan value appActive it ask grant once when app is active and it ask again when app is closed and active again. + # Case-1: Denying grant when app is active and validating + # Case-2: Closing and launching the app, denying grant and validating ui is coming again + @Usergrants @coreSDK @sdk @transport @notSupported + Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan appActive + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + #Case-1 + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'expect error for device name' + Then 'Firebolt' platform responds with 'invalid request for device name' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device name' + Then 'Firebolt' platform responds with 'false for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + #Case-2 + ###### And App will be in 'closed' state + When 3rd party 'certification' app is launched + And User set response for 'set pinchallenge wrong pin' + And User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'expect error for device name' + Then 'Firebolt' platform responds with 'invalid request for device name' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + + # Assuming lifespan having seconds and ttl is 60 sec + # If lifespan value seconds, after giving the grant it should not ask grant within ttl and it ask after the ttl + # Case-1: Allowing grant and validating the result + # Case-2: Calling the API again within the ttl and it should not ask for grant + # Case-3: Calling API after ttl, here it will ask grant again + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (ackchallenge) and lifespan:seconds lifespanTtl:60 sec + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + #Case-1 + And Framework registers 'ackchallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'fetch device id' + Then 'Firebolt' platform responds with 'expected device id' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + # Case-2 + # Calling once again within ttl - it shouldn't ask for grant + When '3rd party app' invokes the 'Firebolt' API to 'fetch device id' + Then 'Firebolt' platform responds with 'expected device id' + # Case-3 + When Test runner waits for 70 'seconds' + And User set response for 'set acknowledge deny' + And User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'expect error for device id' + Then 'Firebolt' platform responds with 'invalid request for device id' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' + Then 'Firebolt' platform responds with 'false for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + + # Assuming lifespan having seconds and ttl is 60 sec + # If lifespan value seconds, after giving the grant it should not ask grant within ttl and it ask after the ttl + # Case-1: Denying grant and validating the error + # Case-2: Calling the API again within the ttl and it should not ask for grant + # Case-3: Calling API after ttl, here it will ask for grant again + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (ackchallenge) and lifespan:seconds lifespanTtl:60 sec + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + # Case-1 + And Framework registers 'ackchallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'expect error for device id' + Then 'Firebolt' platform responds with 'invalid request for device id' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' + Then 'Firebolt' platform responds with 'false for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + # Case-2 + # Calling once again within ttl - it shouldn't ask for grant + When '3rd party app' invokes the 'Firebolt' API to 'expect error for device id' + Then 'Firebolt' platform responds with 'invalid request for device id' + # Case-3 + When Test runner waits for 70 'seconds' + And User set response for 'set acknowledge granted' + And User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'fetch device id' + Then 'Firebolt' platform responds with 'expected device id' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + + # Assuming lifespan having seconds and ttl is 200 sec + # If lifespan value seconds, after giving the grant it should not ask grant within ttl and it ask after the ttl + # Case-1: Allowing grant and validating the result + # Case-2: Before ttl ends rebooting the device and on calling api, it should return result without asking for grant + @Usergrants @coreSDK @sdk @transport @notSupported + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with grant(pinChallenge) and lifespan:seconds lifespanTtl:800sec - after reboot within ttl it should not ask for grant + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + # Case-1 + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'get localization language' + Then 'Firebolt' platform responds with 'expected localization language' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for localization language' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + # Case-2 + # rebooting the device before ttl ends and validating again + ### When I reboot device + When 3rd party 'certification' app is launched + And User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'get localization language' + Then 'Firebolt' platform responds with 'expected localization language' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for localization language' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'EMPTY_HISTORY' + + # Assuming lifespan having seconds and ttl is 60 sec + # If lifespan value seconds, after giving the grant it should not ask grant within ttl and it ask after the ttl + # Case-1: Allowing grant and validating the result + # Case-2: Reboot the device after ttl, after reboot when API is called again and asks for grant, then deny grant + @Usergrants @coreSDK @sdk @transport @notSupported + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with grant(ackchallenge) and lifespan:seconds lifespanTtl:60sec - reboot after ttl and it should ask grant + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + # Case-1 + And Framework registers 'ackchallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'fetch device id' + Then 'Firebolt' platform responds with 'expected device id' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When Test runner waits for 60 'seconds' + # rebooting the device after ttl and validating again + ### When I reboot device + And 3rd party 'certification' app is launched + And User set response for 'set acknowledge deny' + And Framework registers 'ackchallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'expect error for device id' + Then 'Firebolt' platform responds with 'invalid request for device id' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' + Then 'Firebolt' platform responds with 'false for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + + # Assuming lifespan having seconds and ttl is 200 sec + # If lifespan value seconds, after giving the grant it should not ask grant within ttl and it ask after the ttl + # Case-1: Deny grant and validate error + # Case-2: Before ttl ends rebooting the device, call api and expect to return result without asking for grant + @Usergrants @coreSDK @sdk @transport @notSupported + Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan:seconds lifespanTtl:800sec - after reboot within ttl and it should not ask grant + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + # Case-1 + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'expect error for localization language' + Then 'Firebolt' platform responds with 'invalid request for localization language' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for localization language' + Then 'Firebolt' platform responds with 'false for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + # Case-2 + # rebooting the device before ttl ends and validating again + ### When I reboot device + When 3rd party 'certification' app is launched + And User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'expect error for localization language' + Then 'Firebolt' platform responds with 'invalid request for localization language' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for localization language' + Then 'Firebolt' platform responds with 'false for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'EMPTY_HISTORY' + + # Assuming lifespan having seconds and ttl is 60 sec + # With lifespan seconds, after giving the grant it should not ask grant within ttl and it ask after the ttl + # Case-1: Deny grant and validate error + # Case-2: Reboot device after ttl, after reboot when api is called again, expect to ask grant and then deny grant + @Usergrants @coreSDK @sdk @transport @notSupported + Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (ackchallenge) and lifespan:seconds lifespanTtl:60sec - reboot after ttl and it should ask grant + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + # Case-1 + And Framework registers 'ackchallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'expect error for device id' + Then 'Firebolt' platform responds with 'invalid request for device id' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' + Then 'Firebolt' platform responds with 'false for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + # Case-2 + # rebooting the device after ttl and validating again + ### When I reboot device + When 3rd party 'certification' app is launched + And User set response for 'set acknowledge granted' + And Framework registers 'ackchallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'fetch device id' + Then 'Firebolt' platform responds with 'expected device id' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + + # grantPolicy having lifespan:seconds and lifespanTtl:60 seconds + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.Capabilities - Positive Scenario: privacySetting - autoApplyPolicy:always property-getter:true silently grant + Given the environment has been set up for 'userGrants' tests + And 1st party app invokes the 'Firebolt' API to 'disable closedCaptions' + And 3rd party 'certification' app is launched + And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as true' + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' + Then 'Firebolt' platform responds with 'disabled for closedCaptions settings' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'EMPTY_HISTORY' + When '3rd party app' invokes the 'Firebolt' API to 'check if accessibility closedCaptions capability is granted with role as use' + Then 'Firebolt' platform responds with 'true for capabilities granted' + + # First testcase having grantPolicy with lifespan:seconds and lifespanTtl:60 seconds + # Second testcase having lifespan:appActive + @Usergrants @coreSDK @sdk @transport + Scenario Outline: UserGrants.Capabilities - Positive Scenario: + Given the environment has been set up for 'userGrants' tests + And 1st party app invokes the 'Firebolt' API to '' + And 3rd party 'certification' app is launched + And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as false' + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'EMPTY_HISTORY' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'false for capabilities granted' + + Examples: + | Scenario | Key | API_Key | Invalid_Request_Error | Check_Capabilities_Granted | + | Validate Capability autoApplyPolicy:always property-getter:false silently denied | disable closedCaptions | expect error for closedCaptions settings | invalid request for closedCaptions settings | check if accessibility closedCaptions capability is granted with role as use | + | Validate Capability autoApplyPolicy:disallowed property-getter:false silently denied | disable voiceguidance | expect error for voiceGuidance Settings | invalid request for voiceGuidance settings | check if accessibility voiceGuidance capability is granted with role as use | + + # grantPolicy having lifespan:appActive + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:true silently grant + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as true' + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'fetch device token' + Then 'Firebolt' platform responds with 'authentication device' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'EMPTY_HISTORY' + When '3rd party app' invokes the 'Firebolt' API to 'check if authentication token device capability is granted with role use' + Then 'Firebolt' platform responds with 'true for capabilities granted' + + # grantPolicy having lifespan:appActive + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:false grant + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as false' + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'fetch device token' + Then 'Firebolt' platform responds with 'authentication device' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When 1st party app invokes the 'Firebolt' API to 'get privacy allow watchHistory' + Then 'Firebolt' platform responds to '1st party app' with 'true for privacy allow watchHistory' + When '3rd party app' invokes the 'Firebolt' API to 'check if authentication token device capability is granted with role use' + Then 'Firebolt' platform responds with 'true for capabilities granted' + + # grantPolicy having lifespan:appActive + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:false deny + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as false' + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'expect error for device token' + Then 'Firebolt' platform responds with 'invalid request for authentication device' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When 1st party app invokes the 'Firebolt' API to 'get privacy allow watchHistory' + Then 'Firebolt' platform responds to '1st party app' with 'false for privacy allow watchHistory' + When '3rd party app' invokes the 'Firebolt' API to 'check if authentication token device capability is granted with role use' + Then 'Firebolt' platform responds with 'false for capabilities granted' + + # grantPolicy having lifespan:appActive + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:disallowed property-getter:true grant + Given the environment has been set up for 'userGrants' tests + And 1st party app invokes the 'Firebolt' API to 'disable voiceguidance' + And 3rd party 'certification' app is launched + And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as true' + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance settings' + Then 'Firebolt' platform responds with 'disabled voiceGuidance settings' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When 1st party app invokes the 'Firebolt' API to 'get privacy allow watchHistory' + Then 'Firebolt' platform responds to '1st party app' with 'true for privacy allow watchHistory' + When '3rd party app' invokes the 'Firebolt' API to 'check if accessibility voiceGuidance capability is granted with role use' + Then 'Firebolt' platform responds with 'true for capabilities granted' + + # grantPolicy having lifespan:appActive + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:disallowed property-getter:true deny + Given the environment has been set up for 'userGrants' tests + And 1st party app invokes the 'Firebolt' API to 'disable voiceguidance' + And 3rd party 'certification' app is launched + And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as true' + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'expect error for voiceGuidance settings' + Then 'Firebolt' platform responds with 'invalid request for voiceGuidance settings' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When 1st party app invokes the 'Firebolt' API to 'get privacy allow watchHistory' + Then 'Firebolt' platform responds to '1st party app' with 'false for privacy allow watchHistory' + When '3rd party app' invokes the 'Firebolt' API to 'check if accessibility voiceGuidance capability is granted with role as use' + Then 'Firebolt' platform responds with 'false for capabilities granted' + + # grantPolicy having lifespan:appActive + @Usergrants @coreSDK @sdk @transport + Scenario Outline: UserGrants.Capabilities - Positive Scenario: with privacySetting - + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And 1st party app invokes the 'Firebolt' API to '' + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'get secondscreen device' + Then 'Firebolt' platform responds with 'expected secondscreen device' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When 1st party app invokes the 'Firebolt' API to 'get privacy allow watchHistory' + Then 'Firebolt' platform responds to '1st party app' with 'true for privacy allow watchHistory' + When '3rd party app' invokes the 'Firebolt' API to 'check if secondscreen device capability is granted with role use' + Then 'Firebolt' platform responds with 'true for capabilities granted' + + Examples: + | Scenario | Key | + | Validate Capability autoApplyPolicy:never property-getter:true grant | set privacy allow watchHistory as true | + | Validate Capability autoApplyPolicy:never property-getter:false grant | set privacy allow watchHistory as false | + + #grantPolicy having lifespan:appActive + @Usergrants @coreSDK @sdk @transport + Scenario Outline: UserGrants.Capabilities - Positive Scenario: with privacySetting - + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And 1st party app invokes the 'Firebolt' API to '' + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'expect error for secondscreen device' + Then 'Firebolt' platform responds with 'invalid request for secondscreen device' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When 1st party app invokes the 'Firebolt' API to 'get privacy allow watchHistory' + Then 'Firebolt' platform responds to '1st party app' with 'false for privacy allow watchHistory' + When '3rd party app' invokes the 'Firebolt' API to 'check if secondscreen device capability is granted with role use' + Then 'Firebolt' platform responds with 'false for capabilities granted' + + Examples: + | Scenario | Key | + | Validate Capability autoApplyPolicy:never property-getter:true deny | set privacy allow watchHistory as true | + | Validate Capability autoApplyPolicy:never property-getter:false deny | set privacy allow watchHistory as false | + + #grantPolicy having lifespan:appActive + @Usergrants @coreSDK @sdk @transport + Scenario Outline: UserGrants.Capabilities - Positive Scenario:privacySetting - + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as true' + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When 1st party app invokes the 'Firebolt' API to 'get privacy allow watchHistory' + Then 'Firebolt' platform responds to '1st party app' with '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'false for capabilities granted' + + Examples: + | Scenario | API_Key | Invalid_Request_Error | Method_Content | Check_Capabilities_Granted | + | Validate Capability updateProperty:true - property-getter:true deny property should be set to false | expect error for secondscreen device | invalid request for secondscreen device | false for privacy allow watchHistory | check if secondscreen device capability is granted with role use | + | Validate Capability updateProperty:false - property-getter:true deny property should not be updated | expect error for allow profile flags | invalid request for profile flags | true for privacy allow watchHistory | check if profile flags capability is granted with role use | + + # grantPolicy having lifespan:appActive + @Usergrants @coreSDK @sdk @transport + Scenario Outline: UserGrants.Capabilities - Positive Scenario:privacySetting - + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And 1st party app invokes the 'Firebolt' API to '' + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When 1st party app invokes the 'Firebolt' API to 'get privacy allow watchHistory' + Then 'Firebolt' platform responds to '1st party app' with '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'true for capabilities granted' + + Examples: + | Scenario | Set_API_Key | API_Key | Method_Content | Validation_Key | Check_Capabilities_Granted | + | Validate Capability updateProperty:true - property-getter:false grant property should be set to false | set privacy allow watchHistory as false | get secondscreen device | expected secondscreen device | true for privacy allow watchHistory | check if secondscreen device capability is granted with role use | + | Validate Capability updateProperty:true - property-getter:true grant property should not be changed | set privacy allow watchHistory as true | get secondscreen device | expected secondscreen device | true for privacy allow watchHistory | check if secondscreen device capability is granted with role use | + | Validate Capability updateProperty:false - property-getter:false grant property should not be changed | set privacy allow watchHistory as false | allow profile flags | expected profile flags for the current session | false for privacy allow watchHistory | check if profile flags capability is granted with role use | + + # lifespan having powerActive + # Case-1: Allow grant and validate the result + # Case-2: Call API after device is rebooted,expect to ask for grant, deny grant and validate error + @Usergrants @coreSDK @sdk @transport @notSupported + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with grant (pinChallenge) and lifespan powerActive - after reboot deny and validate + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + # Case-1 + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'fetch device model' + Then 'Firebolt' platform responds with 'expected device model' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device model' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + # Case-2 + # rebooting the device + ###### When I reboot device + When 3rd party 'certification' app is launched + And Framework registers 'pinChallenge' test provider + And User set response for 'set pinchallenge wrong pin' + And User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'expect error for device model' + Then 'Firebolt' platform responds with 'invalid request for device model' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device model' + Then 'Firebolt' platform responds with 'false for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + + # lifespan having powerActive + # Case-1: Deny grant and validate error + # Case-2: Call API after device is rebooted,expect to ask for grant, allow grant and validate result + @Usergrants @coreSDK @sdk @transport @notSupported + Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan powerActive - after reboot grant and validate + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + # Case-1 + And Framework registers 'pinChallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'expect error for device model' + Then 'Firebolt' platform responds with 'invalid request for device model' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device model' + Then 'Firebolt' platform responds with 'false for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + # Case-2 + # rebooting the device + ###### When I reboot device + When 3rd party 'certification' app is launched + And Framework registers 'pinChallenge' test provider + And User set response for 'set pinchallenge correct pin' + And User 'starts' recording lifecycle history for '3rd party app' + And '3rd party app' invokes the 'Firebolt' API to 'fetch device model' + Then 'Firebolt' platform responds with 'expected device model' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device model' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + + # 1st example: Call usergrants.request for account.uid with granting acknowledgeChallenge for role use and validate capabilities.info for same capability and check role use is granted and not any other role + # 2nd example: Call usergrants.request for account.uid with granting acknowledgeChallenge for role manage and validate capabilities.info for same capability and check role manage is granted and not any other role + @Usergrants @coreSDK @sdk @transport + Scenario Outline: UserGrants.request - Positive Scenario: + Given the environment has been set up for 'userGrants' tests + And Framework registers 'ackchallenge' test provider + When 1st party app invokes the 'Firebolt' API to '' + And 3rd party 'certification' app is launched + And '3rd party app' invokes the 'Firebolt' API to 'get info of account uid capability' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as use' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as manage' + Then 'Firebolt' platform responds to '1st party app' with '' + + Examples: + | Scenario | API_Key | Validation_Key | + | Validate userGrants.request by granting for role use | request grant for account uid capability with role use | granted for account uid capability with role use | + | Validate userGrants.request by granting for role manage | request grant for account uid capability with role manage | granted for account uid capability with role manage | + + # 1st example: Call usergrants.request for account.uid with denying acknowledgeChallenge for role use and validate capabilities.info for same capability and check role use is denied + # 2nd example: Call usergrants.request for account.uid with denying acknowledgeChallenge for role manage and validate capabilities.info for same capability and check role manage is denied + @Usergrants @coreSDK @sdk @transport + Scenario Outline: UserGrants.request - Negative Scenario: + Given the environment has been set up for 'userGrants' tests + And Framework registers 'ackchallenge' test provider + When 1st party app invokes the 'Firebolt' API to '' + And 3rd party 'certification' app is launched + And '3rd party app' invokes the 'Firebolt' API to 'get info of account uid capability' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as use' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as manage' + Then 'Firebolt' platform responds to '1st party app' with '' + + Examples: + | Scenario | API_Key | Validation_Key | + | Validate userGrants.request by denying for role use | request grant for account uid capability with role use | denied for account uid capability with role use | + | Validate userGrants.request by denying for role manage | request grant for account uid capability with role manage | denied for account uid capability with role manage | + + # Call usergrants.request with securestorage for role use, but the grant policy has role manage, since role mismatch it should return null since no grantpolicy is matched + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.request - Negative Scenario: Validate userGrants.request call with role use, but grantpolicy having manage capability + Given the environment has been set up for 'userGrants' tests + And Framework registers 'pinChallenge' test provider + When 1st party app invokes the 'Firebolt' API to 'request grant for secure storage capability with role use' + And 3rd party 'certification' app is launched + And '3rd party app' invokes the 'Firebolt' API to 'get stored value with scope as device and key as authTestTokenDevice' + Then 'Firebolt' platform responds with 'expected value for authTestTokenDevice stored data in securestorage' + When '3rd party app' invokes the 'Firebolt' API to 'get info of secure storage capability' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as use' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as manage' + Then 'Firebolt' platform responds to '1st party app' with 'granted for secure storage capability with role use' + + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.request - Positive Scenario: Validate UserGrants.request which grantpolicy is not present in manifest + Given the environment has been set up for 'userGrants' tests + When 1st party app invokes the 'Firebolt' API to 'request grant for device info capability with role use' + And 3rd party 'certification' app is launched + And '3rd party app' invokes the 'Firebolt' API to 'fetch device platform' + Then 'Firebolt' platform responds with 'expected device platform' + When '3rd party app' invokes the 'Firebolt' API to 'get info of device info capability' + And '3rd party app' invokes the 'Firebolt' API to 'check if device info capability is granted with role as use' + And '3rd party app' invokes the 'Firebolt' API to 'check if device info capability is granted with role as manage' + Then 'Firebolt' platform responds to '1st party app' with 'granted for device info capability with role use' + + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.request - Positive Scenario: Validate userGrants.request by deferring + Given the environment has been set up for 'userGrants' tests + And Framework registers 'ackchallenge' test provider + When 1st party app invokes the 'Firebolt' API to 'request grant for account uid capability with role use' + And 3rd party 'certification' app is launched + And '3rd party app' invokes the 'Firebolt' API to 'fetch account UID with error' + Then 'Firebolt' platform responds with 'invalid request for account uid' + When '3rd party app' invokes the 'Firebolt' API to 'get info of account uid capability' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as use' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as manage' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as provide' + Then 'Firebolt' platform responds to '1st party app' with 'deferred for account uid capability with role use' + + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.request - Positive Scenario: Validate userGrants.request by deferring with timeout + Given the environment has been set up for 'userGrants' tests + And Framework registers 'ackchallenge' test provider + When 1st party app invokes the 'Firebolt' API to 'request grant for account uid capability with role use' + And 3rd party 'certification' app is launched + And '3rd party app' invokes the 'Firebolt' API to 'fetch account UID with error' + Then 'Firebolt' platform responds with 'invalid request for account uid' + When '3rd party app' invokes the 'Firebolt' API to 'get info of account uid capability' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as use' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as manage' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as provide' + Then 'Firebolt' platform responds to '1st party app' with 'deferred for account uid capability with role use' + + # Call capabilities.request for account.uid with granting acknowledgeChallenge for role provide and validate by calling capabilities.info with same capability and check which role manage is granted and not any other role + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.request - Positive Scenario: Validate usergrants.request by granting for role provide + Given the environment has been set up for 'userGrants' tests + And Framework registers 'ackchallenge' test provider + When 1st party app invokes the 'Firebolt' API to 'request grant for account uid capability with role provide' + And 3rd party 'certification' app is launched + And '3rd party app' invokes the 'Firebolt' API to 'fetch account UID' + Then 'Firebolt' platform responds with 'account uid' + When '3rd party app' invokes the 'Firebolt' API to 'get info of account uid capability' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as use' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as manage' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as provide' + Then 'Firebolt' platform responds to '1st party app' with 'granted for account uid capability with role provide' + + # Call capabilities.request for account.uid with denying acknowledgeChallenge for role manage and validate by calling capabilities.info with same capability and check which role manage is denied + @Usergrants @coreSDK @sdk @transport + Scenario: UserGrants.request - Negative Scenario: Validate usergrants.request by denying for role provide + Given the environment has been set up for 'userGrants' tests + And Framework registers 'ackchallenge' test provider + When 1st party app invokes the 'Firebolt' API to 'request grant for account uid capability with role provide' + And 3rd party 'certification' app is launched + And '3rd party app' invokes the 'Firebolt' API to 'fetch account UID with error' + Then 'Firebolt' platform responds with 'invalid request for account uid' + When '3rd party app' invokes the 'Firebolt' API to 'get info of account uid capability' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as use' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as manage' + And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as provide' + Then 'Firebolt' platform responds to '1st party app' with 'denied for account uid capability with role provide' \ No newline at end of file From 9e73e3029f2ecc9fff2ae52a1b12756496047db1 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 25 Jun 2024 10:04:10 +0530 Subject: [PATCH 188/359] FIRECERT-2186 addressed review comments, updated validation.md file --- cypress/support/constants/constants.js | 1 + cypress/support/cypress-support/src/main.js | 9 +- .../support/step_definitions/validations.js | 2 +- .../support/step_definitions/validations.md | 85 +++++++++---------- 4 files changed, 50 insertions(+), 47 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 145e62fa..a259a3ef 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -63,6 +63,7 @@ module.exports = { COUNTRYCODE: 'countryCode', CUCUMBER: 'cucumber', CURRENT_APP_ID: 'currentAppId', + CUSTOM_METHOD_PATH: 'https://github.com/rdkcentral/firebolt-certification-suite/blob/main/cypress/support/step_definitions/validations.md#custom', CYPRESS_MODULES_PATH: 'cypress/fixtures/external/modules', DATE: 'date', DECIMAL: 'decimal', diff --git a/cypress/support/cypress-support/src/main.js b/cypress/support/cypress-support/src/main.js index 413f62bd..bb0f1f0b 100644 --- a/cypress/support/cypress-support/src/main.js +++ b/cypress/support/cypress-support/src/main.js @@ -494,19 +494,22 @@ export default function (module) { ) { assert( false, - `Expected customValidationMethod ${functionName} was not found in the validationFunctions file.` + `Expected customValidationMethod ${functionName} was not found in the validationFunctions file. More info - ${CONSTANTS.CUSTOM_METHOD_PATH}` ); } } else { // if config module doesn't have customValidations function assert( false, - `Expected customValidationMethod ${functionName} was not found in the validationFunctions file.` + `Expected customValidationMethod ${functionName} was not found in the validationFunctions file. More info - ${CONSTANTS.CUSTOM_METHOD_PATH}` ); } } else { // if config module doesn't have customValidations function - assert(false, `Expected customValidationMethod was not found in the validationObject.`); + assert( + false, + `Expected customValidationMethod was not found in the validationObject. More info - ${CONSTANTS.CUSTOM_METHOD_PATH}` + ); } }); } diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index ddf8face..ae08c66f 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -296,7 +296,7 @@ Given( /** * @module ValidationGlue - * @function {string} is in {string} state + * @function '(.+)' will (be|stay) in '(.+)' state * @description To validate 3rd party app transitionss wrt state, event and history against appObject as the source of truth * @param {String} app - App type * @param {String} state - Expected state to be used for validation diff --git a/cypress/support/step_definitions/validations.md b/cypress/support/step_definitions/validations.md index 4c905a6d..ad0ebf12 100644 --- a/cypress/support/step_definitions/validations.md +++ b/cypress/support/step_definitions/validations.md @@ -291,6 +291,48 @@ For the validation part, for the states when the app is not reachable for us to ] } +### Custom Validation +## Format +The basic structure of the validation object in configModule with customValidation will be as : +{ + "method": "", + "data": [ + { + "type": "custom", + "override": , + "assertionDef": "", + "validations": [ + { + "type": "", + "description": "" + } + ] + } + ] +} + +Here, the value of the key "assertionDef" will be the customMethod we use for validation. The customValidation method should be added in this file in configModule : customValidations/validationFunctions.js, and should be exported from "customValidations/index.js". + +### Example: +{ + "method": "authentication.token", + "data": [ + { + "type": "custom", + "override": 1, + "assertionDef": "customMethod1", + "validations": [ + { + "field": "issueDate1", + "mode": "regex", + "format": "TOKEN_REGEXP", + "type": "DATEAUTHENTICATION_REGEXP", + "description": "Validation of the Authentication Token issueDate Format" + } + ] + } + ] +} ## undefined ### format: @@ -370,46 +412,3 @@ While validating, if a key is present in both fcs-validation jsons (eg: cypress/ } ] } - -# Custom Validation -## Format -The basic structure of the validation object in configModule with customValidation will be as : -{ - "method": "", - "data": [ - { - "type": "custom", - "override": , - "assertionDef": "", - "validations": [ - { - "type": "", - "description": "" - } - ] - } - ] -} - -Here, the value of the key "assertionDef" will be the customMethod we use for validation. The customValidation method should be added in this file in configModule : customValidations/validationFunctions.js, and should be exported from "customValidations/index.js". - -### Example: -{ - "method": "authentication.token", - "data": [ - { - "type": "custom", - "override": 1, - "assertionDef": "customMethod1", - "validations": [ - { - "field": "issueDate1", - "mode": "regex", - "format": "TOKEN_REGEXP", - "type": "DATEAUTHENTICATION_REGEXP", - "description": "Validation of the Authentication Token issueDate Format" - } - ] - } - ] -} \ No newline at end of file From f3004ed9ea470e814f6068f777906fd098779aca Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 25 Jun 2024 10:08:44 +0530 Subject: [PATCH 189/359] FIRECERT-2186 fixed linting issues --- cypress/support/constants/constants.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index a259a3ef..2498e405 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -63,7 +63,8 @@ module.exports = { COUNTRYCODE: 'countryCode', CUCUMBER: 'cucumber', CURRENT_APP_ID: 'currentAppId', - CUSTOM_METHOD_PATH: 'https://github.com/rdkcentral/firebolt-certification-suite/blob/main/cypress/support/step_definitions/validations.md#custom', + CUSTOM_METHOD_PATH: + 'https://github.com/rdkcentral/firebolt-certification-suite/blob/main/cypress/support/step_definitions/validations.md#custom', CYPRESS_MODULES_PATH: 'cypress/fixtures/external/modules', DATE: 'date', DECIMAL: 'decimal', From 6f443b283b9165b9c5fd137bd49d3e668fb60237 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Tue, 25 Jun 2024 10:25:51 +0530 Subject: [PATCH 190/359] Addressed the comment --- cypress/support/constants/constants.js | 1 + cypress/support/step_definitions/validations.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index bd68cc10..85cb845c 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -342,6 +342,7 @@ module.exports = { SCHEMA_VALIDATION_STATUS: 'schemaValidationStatus', SCHEMA_VALIDATION_STATUS_CODE: ['PASS', 'FAIL', 'SKIPPED', 'PENDING'], SEARCH: 'search', + SET: 'set', SET_APP_STATE: 'Application state set to ', SET_LIFECYCLE_STATE_MISSING: 'setLifecycleState function to send message to platform to set lifecycle state of application not implemented by underlying platform', diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 120c2a03..164ea6e5 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -434,7 +434,7 @@ Given( cy.then(() => { let method = - methodType === 'set' + methodType === CONSTANTS.SET ? typeof fireboltCallObject.setMethod == CONSTANTS.TYPE_FUNCTION ? fireboltCallObject.setMethod() : fireboltCallObject.setMethod @@ -442,7 +442,7 @@ Given( ? fireboltCallObject.method() : fireboltCallObject.method; let validationJsonPath = - methodType === 'set' + methodType === CONSTANTS.SET ? typeof fireboltCallObject.setValidationJsonPath == CONSTANTS.TYPE_FUNCTION ? fireboltCallObject.setValidationJsonPath() : fireboltCallObject.setValidationJsonPath @@ -450,11 +450,13 @@ Given( ? fireboltCallObject.validationJsonPath() : fireboltCallObject.validationJsonPath; const contentObject = - methodType === 'set' + methodType === CONSTANTS.SET ? resolveContentObject(fireboltCallObject.setContent) : resolveContentObject(fireboltCallObject.content); method = method.includes('_') ? method.split('_')[1] : method; + contentObject = contentObject ? contentObject : CONSTANTS.NULL_RESPONSE; + validationJsonPath = validationJsonPath ? validationJsonPath : CONSTANTS.RESULT; // Fetching the object from the global list. const apiObject = UTILS.getApiOrEventObjectFromGlobalList(method, context, appId); From 4db448d0bffc465e13a7c0607a2ce52520f45eb8 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Tue, 25 Jun 2024 19:03:33 +0530 Subject: [PATCH 191/359] FIRECERT-1529: Added logs for secondary 3rd party app --- cypress/support/constants/constants.js | 2 ++ cypress/support/cypress-support/src/utils.js | 4 ++-- cypress/support/step_definitions/fireboltCalls.js | 2 ++ cypress/support/step_definitions/validations.js | 2 ++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 7f935641..63cadec9 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -442,6 +442,8 @@ module.exports = { STEP_DEFINITION_NEEDS_TO_IMPLEMENT: 'Step definition needs to be implemented', SECONDARY_THIRD_PARTY_APP: 'secondary 3rd party app', SECONDARY_THIRD_PARTY_APP_ID: 'secondary3rdPartyAppId', + SECONDARY_APPID_MISSING_ERROR: + '`Unable to find the ${envAppIdKey} value in the env, please add the value in configModule/constants/config.json`', }; function getSanityReportPath() { // Check if Cypress is defined, for cypress test context diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 4716c92e..8e6f9bc3 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -654,10 +654,10 @@ function checkForSecondaryAppId(appId) { } catch (err) { fireLog .info( - `Unable to find the ${envAppIdKey} value in the env, please add the value in config module/constants/config.json` + eval(CONSTANTS.SECONDARY_APPID_MISSING_ERROR) ) .then(() => { - throw new Error(`Unable to find the ${envAppIdKey} value in the env`); + throw new Error(eval(CONSTANTS.SECONDARY_APPID_MISSING_ERROR)); }); } } diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index bcf73bc4..89adc1c4 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -111,6 +111,7 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = * @example * Given '3rd party app' invokes the 'Firebolt' API to 'get device id' * Given 'test.test.test' invokes the 'Firebolt' API to 'get device id' + * Given 'secondary 3rd party app' invokes the 'Firebolt' API to 'get device id' */ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { // Fetching the data like method, param, context and action etc. @@ -214,6 +215,7 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { * @example * Given '3rd party app' registers for the 'Closed Captions Settings' event using the 'Firebolt' API * Given 'test.test.test' registers for the 'Closed Captions Settings' event using the 'Firebolt' API + * Given 'secondary 3rd party app' registers for the 'Closed Captions Settings' event using the 'Firebolt' API */ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appId, key, sdk) => { // Fetching the data like method, param, context and action etc. diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index ffbe4d94..8ff46f84 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -34,7 +34,9 @@ import UTILS from '../cypress-support/src/utils'; * Given 'Firebolt' platform triggers event 'Validate device id' * Given 'Firebolt' platform triggers to '1st party app' event 'Validate device id' * Given 'Firebolt' platform triggers to 'test.test.test' event 'Validate device id' + * Given 'Firebolt' platform triggers to 'secondary 3rd party app' event 'Validate device id' * Given 'Firebolt' platform does not trigger event for 'onclosedCaptionsSettingsChanged' + * Given 'Firebolt' platform does not trigger to 'secondary 3rd party app' event for 'onclosedCaptionsSettingsChanged' */ Given( From b90fb2ca5b0a1ab0378af355238353da7fb3ba13 Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy Date: Tue, 25 Jun 2024 19:14:08 +0530 Subject: [PATCH 192/359] Fixed lint issues --- cypress/support/cypress-support/src/utils.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 8e6f9bc3..6ad8b4be 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -652,13 +652,9 @@ function checkForSecondaryAppId(appId) { return appId; } } catch (err) { - fireLog - .info( - eval(CONSTANTS.SECONDARY_APPID_MISSING_ERROR) - ) - .then(() => { - throw new Error(eval(CONSTANTS.SECONDARY_APPID_MISSING_ERROR)); - }); + fireLog.info(eval(CONSTANTS.SECONDARY_APPID_MISSING_ERROR)).then(() => { + throw new Error(eval(CONSTANTS.SECONDARY_APPID_MISSING_ERROR)); + }); } } From 4aa27dec202910d1478ee820bfab6e2ed6fae5b3 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Tue, 25 Jun 2024 19:40:16 +0530 Subject: [PATCH 193/359] Added minor change --- cypress/support/step_definitions/validations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 164ea6e5..a13a49f9 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -449,7 +449,7 @@ Given( : typeof fireboltCallObject.validationJsonPath == CONSTANTS.TYPE_FUNCTION ? fireboltCallObject.validationJsonPath() : fireboltCallObject.validationJsonPath; - const contentObject = + let contentObject = methodType === CONSTANTS.SET ? resolveContentObject(fireboltCallObject.setContent) : resolveContentObject(fireboltCallObject.content); From 76f956afe9450c9d7b4f560af96d500a7e2fd294 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 25 Jun 2024 23:30:31 +0530 Subject: [PATCH 194/359] FIRECERT-2157-SecureStorage added negative scenarios of secureStorage manage --- .../Manage/SecureStorageManage.feature | 61 +++++++++++++--- .../fixtures/fireboltCalls/securestorage.json | 70 ++++++++++++++++++ cypress/fixtures/modules/securestorage.json | 73 +++++++++++++++++++ 3 files changed, 192 insertions(+), 12 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature index 864fe690..d4cb4f5a 100644 --- a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature @@ -91,17 +91,54 @@ Feature: SecureStorage_Manage | setForApp with null value | set secure data value for an app with null value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | | setForApp with boolean value | set secure data value for an app with boolean value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | | setForApp without value | set secure data value for an app without value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | setForApp with empty key | set secure data value for an app with empty key | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | -# @SecureStorage @manageSDK -# Scenario Outline: SecureStorage. - Negative Scenario: expecting error -# When 1st party app invokes the 'Firebolt' API to '' -# Then 'Firebolt' platform responds to '1st party app' with '' + @SecureStorage @manageSDK + Scenario Outline: SecureStorage.removeForApp - Negative Scenario: + Given 1st party app invokes the 'Firebolt' API to 'set secure data value for an app with scope device1' + And 'Firebolt' platform responds to '1st party app' for 'set secure data value for an app with scope device1' + And 1st party app invokes the 'Firebolt' API to 'get stored value for an app for authTestTokenDevice1 with scope device' + And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenDevice1 stored data in securestorage' + And 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'invalid parameters for securestorage removeForApp' + And 1st party app invokes the 'Firebolt' API to 'get stored value for an app for authTestTokenDevice1 with scope device' + And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenDevice1 stored data in securestorage' + + Examples: + | Scenario | API_Key | + | Passing invalid scope | remove secure data value for an app with invalid scope | + | Passing scope as empty string | remove secure data value for an app with empty scope | + | Passing scope as integer | remove secure data value for an app with integer scope | + | Passing scope as null | remove secure data value for an app with null scope | + | Passing scope as boolean | remove secure data value for an app with boolean scope | + | without scope | remove secure data value for an app without scope | + | Passing key as integer | remove secure data value for an app with integer key | + | Passing key as null | remove secure data value for an app with null key | + | Passing key as boolean | remove secure data value for an app with boolean key | + | Without key | remove secure data value for an app without key | -# Examples: -# | Scenario | Method | API_Key | Method_Validation_key | -# | setForApp-integer | setForApp | set secure data value for an app with integer parameter | invalid params for setting a data value in securestorage | -# | setForApp-boolean | setForApp | set secure data value for an app with true parameter | invalid params for setting a data value in securestorage | -# | removeForApp-integer | removeForApp | remove secure data value for an app with integer parameter | invalid params for removing stored value in securestorage | -# | removeForApp-boolean | removeForApp | remove secure data value for an app with true parameter | invalid params for removing stored value in securestorage | -# | clearForApp-integer | clearForApp | clear secure data values for an app with integer parameter | invalid params for clearing all data for an app in securestorage | -# | clearForApp-boolean | clearForApp | clear secure data values for an app with true parameter | invalid params for clearing all data for an app in securestorage | \ No newline at end of file + @SecureStorage @manageSDK + Scenario Outline: SecureStorage.clearForApp - Negative Scenario: + Given 1st party app invokes the 'Firebolt' API to 'set secure data value for an app with scope device1' + And 'Firebolt' platform responds to '1st party app' for 'set secure data value for an app with scope device1' + And 1st party app invokes the 'Firebolt' API to 'get stored value for an app for authTestTokenDevice1 with scope device' + And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenDevice1 stored data in securestorage' + Given 1st party app invokes the 'Firebolt' API to 'set secure data value for an app with scope account' + And 'Firebolt' platform responds to '1st party app' for 'set secure data value for an app with scope account' + And 1st party app invokes the 'Firebolt' API to 'get stored value for authTestTokenAccount with scope account' + And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenAccount1 stored data in securestorage' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for 'invalid params for clearing all data for an app in securestorage' + And 1st party app invokes the 'Firebolt' API to 'get stored value for an app for authTestTokenDevice1 with scope device' + And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenDevice1 stored data in securestorage' + And 1st party app invokes the 'Firebolt' API to 'get stored value for authTestTokenAccount with scope account' + And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenAccount1 stored data in securestorage' + + Examples: + | Scenario | Clear_API_key | + | Passing invalid scope | clear secure data value for an app with invalid scope | + | Passing scope as empty string | clear secure data value for an app with empty scope | + | Passing scope as integer | clear secure data value for an app with integer scope | + | Passing scope as null | clear secure data value for an app with null scope | + | Passing scope as boolean | clear secure data value for an app with boolean scope | + | without scope | clear secure data value for an app without scope | diff --git a/cypress/fixtures/fireboltCalls/securestorage.json b/cypress/fixtures/fireboltCalls/securestorage.json index 5c07b302..1760f55e 100644 --- a/cypress/fixtures/fireboltCalls/securestorage.json +++ b/cypress/fixtures/fireboltCalls/securestorage.json @@ -291,6 +291,10 @@ "method": "manage_securestorage.setForApp", "params": "SECURESTORAGE_SETFORAPP_WITHOUT_VALUE" }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_EMPTY_KEY": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_WITH_EMPTY_KEY" + }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_DEVICE1": { "method": "manage_securestorage.setForApp", "params": "SECURESTORAGE_SETFORAPP_DEVICE1" @@ -325,6 +329,42 @@ "method": "manage_securestorage.removeForApp", "params": "SECURESTORAGE_REMOVEFORAPP_DEVICE" }, + "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INVALID_SCOPE": { + "method": "manage_securestorage.removeForApp", + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_INVALID_SCOPE" + }, + "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_EMPTY_SCOPE": { + "method": "manage_securestorage.removeForApp", + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_EMPTY_SCOPE" + }, + "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INTEGER_SCOPE": { + "method": "manage_securestorage.removeForApp", + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_INTEGER_SCOPE" + }, + "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_NULL_SCOPE": { + "method": "manage_securestorage.removeForApp", + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_NULL_SCOPE" + }, + "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_BOOLEAN_SCOPE": { + "method": "manage_securestorage.removeForApp", + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_BOOLEAN_SCOPE" + }, + "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INTEGER_KEY": { + "method": "manage_securestorage.removeForApp", + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_INTEGER_KEY" + }, + "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_NULL_KEY": { + "method": "manage_securestorage.removeForApp", + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_NULL_KEY" + }, + "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_BOOLEAN_KEY": { + "method": "manage_securestorage.removeForApp", + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_BOOLEAN_KEY" + }, + "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITHOUT_KEY": { + "method": "manage_securestorage.removeForApp", + "params": "SECURESTORAGE_REMOVEFORAPP_WITHOUT_KEY" + }, "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_ACCOUNT": { "method": "manage_securestorage.removeForApp", "params": "SECURESTORAGE_REMOVEFORAPP_ACCOUNT" @@ -345,6 +385,30 @@ "method": "manage_securestorage.clearForApp", "params": "SECURESTORAGE_CLEARFORAPP_ACCOUNT" }, + "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITH_INVALID_SCOPE": { + "method": "manage_securestorage.clearForApp", + "params": "SECURESTORAGE_CLEARFORAPP_WITH_INVALID_SCOPE" + }, + "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITH_EMPTY_SCOPE": { + "method": "manage_securestorage.clearForApp", + "params": "SECURESTORAGE_CLEARFORAPP_WITH_EMPTY_SCOPE" + }, + "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITH_INTEGER_SCOPE": { + "method": "manage_securestorage.clearForApp", + "params": "SECURESTORAGE_CLEARFORAPP_WITH_INTEGER_SCOPE" + }, + "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITH_NULL_SCOPE": { + "method": "manage_securestorage.clearForApp", + "params": "SECURESTORAGE_CLEARFORAPP_WITH_NULL_SCOPE" + }, + "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITH_BOOLEAN_SCOPE": { + "method": "manage_securestorage.clearForApp", + "params": "SECURESTORAGE_CLEARFORAPP_WITH_BOOLEAN_SCOPE" + }, + "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITHOUT_SCOPE": { + "method": "manage_securestorage.clearForApp", + "params": "SECURESTORAGE_CLEARFORAPP_WITHOUT_SCOPE" + }, "GET_STORED_VALUE_FOR_AN_APP_WITH_SCOPE_DEVICE": { "method": "securestorage.get", "params": "SECURESTORAGE_GET_DEVICE" @@ -412,6 +476,12 @@ "content": "INVALID_TYPE_PARAMS", "expectingError": true }, + "INVALID_PARAMETERS_FOR_SECURESTORAGE_REMOVEFORAPP": { + "method": "securestorage.removeForApp", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", + "expectingError": true + }, "INVALID_PARAMS_FOR_CLEARING_ALL_DATA_FOR_AN_APP_IN_SECURESTORAGE":{ "method": "securestorage.clearForApp", "validationJsonPath": "result", diff --git a/cypress/fixtures/modules/securestorage.json b/cypress/fixtures/modules/securestorage.json index ca3eef4f..9351e8ff 100644 --- a/cypress/fixtures/modules/securestorage.json +++ b/cypress/fixtures/modules/securestorage.json @@ -358,6 +358,12 @@ "scope": "device", "key": "authTestTokenDevice" }, + "SETFORAPP_WITH_EMPTY_KEY": { + "appId": "refui", + "scope": "device", + "key": "", + "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo" + }, "SETFORAPP_DEVICE1": { "appId": "refui", "scope": "device", @@ -399,6 +405,50 @@ "scope": "device", "key": "authTestTokenDevice" }, + "REMOVEFORAPP_WITH_INVALID_SCOPE": { + "appId": "refui", + "scope": "test", + "key": "authTestTokenDevice" + }, + "REMOVEFORAPP_WITH_EMPTY_SCOPE": { + "appId": "refui", + "scope": "", + "key": "authTestTokenDevice" + }, + "REMOVEFORAPP_WITH_INTEGER_SCOPE": { + "appId": "refui", + "scope": 123, + "key": "authTestTokenDevice" + }, + "REMOVEFORAPP_WITH_NULL_SCOPE": { + "appId": "refui", + "scope": null, + "key": "authTestTokenDevice" + }, + "REMOVEFORAPP_WITH_BOOLEAN_SCOPE": { + "appId": "refui", + "scope": true, + "key": "authTestTokenDevice" + }, + "REMOVEFORAPP_WITH_INTEGER_KEY": { + "appId": "refui", + "scope": "device", + "key": 123 + }, + "REMOVEFORAPP_WITH_NULL_KEY": { + "appId": "refui", + "scope": "device", + "key": null + }, + "REMOVEFORAPP_WITH_BOOLEAN_KEY": { + "appId": "refui", + "scope": "device", + "key": true + }, + "REMOVEFORAPP_WITHOUT_KEY": { + "appId": "refui", + "scope": "device" + }, "REMOVEFORAPP_ACCOUNT": { "appId": "refui", "scope": "account", @@ -408,6 +458,29 @@ "appId": "refui", "scope": "device" }, + "CLEARFORAPP_WITH_INVALID_SCOPE": { + "appId": "refui", + "scope": "test" + }, + "CLEARFORAPP_WITH_EMPTY_SCOPE": { + "appId": "refui", + "scope": "" + }, + "CLEARFORAPP_WITH_INTEGER_SCOPE": { + "appId": "refui", + "scope": 123 + }, + "CLEARFORAPP_WITH_NULL_SCOPE": { + "appId": "refui", + "scope": null + }, + "CLEARFORAPP_WITH_BOOLEAN_SCOPE": { + "appId": "refui", + "scope": true + }, + "CLEARFORAPP_WITHOUT_SCOPE": { + "appId": "refui" + }, "CLEARFORAPP_ACCOUNT": { "appId": "refui", "scope": "account" From f661d02cf7d3af00809dc1206223050890b9c032 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Wed, 26 Jun 2024 12:09:54 +0530 Subject: [PATCH 195/359] Changed new glue format --- cypress/support/step_definitions/validations.js | 14 +++++++------- cypress/support/step_definitions/validations.md | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index a13a49f9..3142a720 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -393,7 +393,7 @@ Given( /** * @module validations - * @function And '(.+)' platform validates '(.+)' ('(.+)')? (get|set) API response(?: as '(.+)')? + * @function And '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? * @description Performing a validation against the source of truth for the given API response * @param {String} sdk - name of the sdk. * @param {String} appId - The object was retrieved by using the appId. @@ -401,14 +401,14 @@ Given( * @param {String} methodType - Determines which method doing content validation Ex: set or get * @param {String} errorContent - Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' * @example - * And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' get API response - * And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' set API response - * And 'Firebolt' platform validates '3rd party app' 'CLOSEDCAPTION_SETTINGS' get API response - * And 'Firebolt' platform validates '1st party app' set API response - * And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' set API response as 'INVALID_TYPE_PARAMS' + * And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' get API + * And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API + * And 'Firebolt' platform responds to '3rd party app' 'CLOSEDCAPTION_SETTINGS' get API + * And 'Firebolt' platform responds to '1st party app' set API + * And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API with 'INVALID_TYPE_PARAMS' */ Given( - /'(.+)' platform validates '([^']*)'(?: '([^']*)')? (get|set) API response(?: as '(.+)')?$/, + /'(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')?$/, async (sdk, appId, fireboltCallKey, methodType, errorContent) => { if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { let fireboltCallObject; diff --git a/cypress/support/step_definitions/validations.md b/cypress/support/step_definitions/validations.md index 4ce8651b..629b6d24 100644 --- a/cypress/support/step_definitions/validations.md +++ b/cypress/support/step_definitions/validations.md @@ -411,7 +411,7 @@ Here, the value of the key "assertionDef" will be the customMethod we use for va ] } -## '(.+)' platform validates '(.+)' ('(.+)')? (get|set) API response(?: as '(.+)')? +## '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? ### Purpose: Performing a validation against the source of truth for the given API response ### Params: @@ -424,8 +424,8 @@ Here, the value of the key "assertionDef" will be the customMethod we use for va | errorContent | Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' | ### Examples: -* `And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' get API response` -* `And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' set API response` -* `And 'Firebolt' platform validates '3rd party app' 'CLOSEDCAPTION_SETTINGS' get API response` -* `And 'Firebolt' platform validates '1st party app' set API response` -* `And 'Firebolt' platform validates '1st party app' 'CLOSEDCAPTION_SETTINGS' set API response as 'INVALID_TYPE_PARAMS'` + * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' get API` + * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API` + * `And 'Firebolt' platform responds to '3rd party app' 'CLOSEDCAPTION_SETTINGS' get API` + * `And 'Firebolt' platform responds to '1st party app' set API` + * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API with 'INVALID_TYPE_PARAMS'` From ba21c19f374709deb484bb9d28d12130fdc7da47 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Wed, 26 Jun 2024 18:30:58 +0530 Subject: [PATCH 196/359] FIRECERT-2157-SecureStorage updated TCs with proper appId --- .../Manage/SecureStorageManage.feature | 45 +++--- .../fixtures/fireboltCalls/securestorage.json | 128 ++++++++++++++---- cypress/fixtures/modules/securestorage.json | 107 +++++++++------ 3 files changed, 185 insertions(+), 95 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature index d4cb4f5a..5c2cb8c3 100644 --- a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature @@ -29,19 +29,20 @@ Feature: SecureStorage_Manage And 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for '' And 1st party app invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value' + And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value for an app' And 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for '' When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' for '' When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with 'null for getting stored value' When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with 'Validation_Key2' + Then 'Firebolt' platform responds to '1st party app' with '' Examples: - | Scenario | Remove_API_Key | API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | - | removeForApp with device scope | remove secure data value for an app with scope device | get stored value for authTestTokenDevice with scope device | set secure data value for an app with scope device1 | set secure data value for an app with scope device2 | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | - | removeForApp with account scope | remove secure data value for an app with scope account | get stored value for authTestTokenAccount with scope account | set secure data value for an app with scope account | set secure data value for an app with scope account | get stored value for an app for authTestTokenAccount1 with scope device | get stored value for an app for authTestTokenAccount2 with scope device | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | + | Scenario | Remove_API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | + | removeForApp with device scope | remove secure data value for an app with scope device | set secure data value for an app with scope device1 | set secure data value for an app with scope device2 | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | + | removeForApp with account scope | remove secure data value for an app with scope account1 | set secure data value for an app with scope account1 | set secure data value for an app with scope account2 | get stored value for an app for authTestTokenAccount1 with scope account | get stored value for an app for authTestTokenAccount2 with scope account | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | @SecureStorage @manageSDK Scenario Outline: SecureStorage.clearForApp - Positive Scenario: @@ -50,19 +51,20 @@ Feature: SecureStorage_Manage And 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for '' And 1st party app invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value' + And 'Firebolt' platform responds to '1st party app' for '' And 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for '' When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' for '' When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with 'null for getting stored value' When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with '' + Then 'Firebolt' platform responds to '1st party app' with 'null for getting stored value' Examples: | Scenario | Clear_API_Key | API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | - | clearForApp with device scope | clear secure data value for an app with scope device | get stored value for authTestTokenDevice with scope device | set secure data value for an app with scope device1 | set secure data value for an app with scope device2 | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | - | clearForApp with account scope | clear secure data value for an app with scope account | get stored value for authTestTokenAccount with scope account | set secure data value for an app with scope account | set secure data value for an app with scope account | get stored value for an app for authTestTokenAccount1 with scope device | get stored value for an app for authTestTokenAccount2 with scope device | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | + | clearForApp with device scope | clear secure data values for an app with scope device | get stored value for authTestTokenDevice with scope device | set secure data value for an app with scope device1 | set secure data value for an app with scope device2 | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | + | clearForApp with account scope | clear secure data values for an app with scope account | get stored value for authTestTokenAccount with scope account | set secure data value for an app with scope account1 | set secure data value for an app with scope account2 | get stored value for an app for authTestTokenAccount1 with scope account | get stored value for an app for authTestTokenAccount2 with scope account | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | @SecureStorage @manageSDK Scenario Outline: SecureStorage.setForApp - Negative Scenario: @@ -73,7 +75,7 @@ Feature: SecureStorage_Manage When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' for 'invalid params for setting a data value in securestorage' When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with '' + Then 'Firebolt' platform responds to '1st party app' with 'null for getting stored value' Examples: | Scenario | Set_API_Key | API_Key | Method_Validation_Key | Clear_API_Key | @@ -91,7 +93,6 @@ Feature: SecureStorage_Manage | setForApp with null value | set secure data value for an app with null value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | | setForApp with boolean value | set secure data value for an app with boolean value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | | setForApp without value | set secure data value for an app without value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp with empty key | set secure data value for an app with empty key | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | @SecureStorage @manageSDK Scenario Outline: SecureStorage.removeForApp - Negative Scenario: @@ -123,22 +124,22 @@ Feature: SecureStorage_Manage And 'Firebolt' platform responds to '1st party app' for 'set secure data value for an app with scope device1' And 1st party app invokes the 'Firebolt' API to 'get stored value for an app for authTestTokenDevice1 with scope device' And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenDevice1 stored data in securestorage' - Given 1st party app invokes the 'Firebolt' API to 'set secure data value for an app with scope account' - And 'Firebolt' platform responds to '1st party app' for 'set secure data value for an app with scope account' - And 1st party app invokes the 'Firebolt' API to 'get stored value for authTestTokenAccount with scope account' + Given 1st party app invokes the 'Firebolt' API to 'set secure data value for an app with scope account1' + And 'Firebolt' platform responds to '1st party app' for 'set secure data value for an app with scope account1' + And 1st party app invokes the 'Firebolt' API to 'get stored value for authTestTokenAccount1 with scope account' And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenAccount1 stored data in securestorage' - When 1st party app invokes the 'Firebolt' API to '' + When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' for 'invalid params for clearing all data for an app in securestorage' And 1st party app invokes the 'Firebolt' API to 'get stored value for an app for authTestTokenDevice1 with scope device' And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenDevice1 stored data in securestorage' - And 1st party app invokes the 'Firebolt' API to 'get stored value for authTestTokenAccount with scope account' + And 1st party app invokes the 'Firebolt' API to 'get stored value for authTestTokenAccount1 with scope account' And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenAccount1 stored data in securestorage' Examples: | Scenario | Clear_API_key | - | Passing invalid scope | clear secure data value for an app with invalid scope | - | Passing scope as empty string | clear secure data value for an app with empty scope | - | Passing scope as integer | clear secure data value for an app with integer scope | - | Passing scope as null | clear secure data value for an app with null scope | - | Passing scope as boolean | clear secure data value for an app with boolean scope | - | without scope | clear secure data value for an app without scope | + | Passing invalid scope | clear secure data values for an app with invalid scope | + | Passing scope as empty string | clear secure data values for an app with empty scope | + | Passing scope as integer | clear secure data values for an app with integer scope | + | Passing scope as null | clear secure data values for an app with null scope | + | Passing scope as boolean | clear secure data values for an app with boolean scope | + | without scope | clear secure data values for an app without scope | diff --git a/cypress/fixtures/fireboltCalls/securestorage.json b/cypress/fixtures/fireboltCalls/securestorage.json index 1760f55e..1657d09f 100644 --- a/cypress/fixtures/fireboltCalls/securestorage.json +++ b/cypress/fixtures/fireboltCalls/securestorage.json @@ -44,6 +44,11 @@ "validationJsonPath": "result", "content": "NULL" }, + "NULL_FOR_UPDATING_A_SECURE_DATA_VALUE_FOR_AN_APP": { + "method": "securestorage.setForApp", + "validationJsonPath": "result", + "content": "NULL" + }, "NULL_FOR_REMOVING_STORED_VALUE": { "method": "securestorage.remove", "validationJsonPath": "result", @@ -177,6 +182,14 @@ "method": "securestorage.get", "params": "SECURESTORAGE_GET_DEVICE_KEY2" }, + "GET_STORED_VALUE_FOR_AN_APP_FOR_AUTHTESTTOKENACCOUNT1_WITH_SCOPE_ACCOUNT": { + "method": "securestorage.get", + "params": "SECURESTORAGE_GET_ACCOUNT_KEY1" + }, + "GET_STORED_VALUE_FOR_AN_APP_FOR_AUTHTESTTOKENACCOUNT2_WITH_SCOPE_ACCOUNT": { + "method": "securestorage.get", + "params": "SECURESTORAGE_GET_ACCOUNT_KEY2" + }, "EXPECTED_VALUE_FOR_AUTHTESTTOKENDEVICE2_STORED_DATA_IN_SECURESTORAGE": { "method": "securestorage.get", "validationJsonPath": "result", @@ -237,63 +250,78 @@ }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INVALID_SCOPE": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_INVALID_SCOPE" + "params": "SECURESTORAGE_SETFORAPP_INVALID_SCOPE", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INTEGER_SCOPE": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_INTEGER_SCOPE" + "params": "SECURESTORAGE_SETFORAPP_INTEGER_SCOPE", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_NULL_SCOPE": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_NULL_SCOPE" + "params": "SECURESTORAGE_SETFORAPP_NULL_SCOPE", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_BOOLEAN_SCOPE": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_BOOLEAN_SCOPE" + "params": "SECURESTORAGE_SETFORAPP_BOOLEAN_SCOPE", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_EMPTY_SCOPE": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_EMPTY_SCOPE" + "params": "SECURESTORAGE_SETFORAPP_EMPTY_SCOPE", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITHOUT_SCOPE": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_WITHOUT_SCOPE" + "params": "SECURESTORAGE_SETFORAPP_WITHOUT_SCOPE", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INTEGER_KEY": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_WITH_INTEGER_KEY" + "params": "SECURESTORAGE_SETFORAPP_WITH_INTEGER_KEY", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_NULL_KEY": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_WITH_NULL_KEY" + "params": "SECURESTORAGE_SETFORAPP_WITH_NULL_KEY", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_BOOLEAN_KEY": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_WITH_BOOLEAN_KEY" + "params": "SECURESTORAGE_SETFORAPP_WITH_BOOLEAN_KEY", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITHOUT_KEY": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_WITHOUT_KEY" + "params": "SECURESTORAGE_SETFORAPP_WITHOUT_KEY", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INTEGER_VALUE": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_WITH_INTEGER_VALUE" + "params": "SECURESTORAGE_SETFORAPP_WITH_INTEGER_VALUE", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_NULL_VALUE": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_WITH_NULL_VALUE" + "params": "SECURESTORAGE_SETFORAPP_WITH_NULL_VALUE", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_BOOLEAN_VALUE": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_WITH_BOOLEAN_VALUE" + "params": "SECURESTORAGE_SETFORAPP_WITH_BOOLEAN_VALUE", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITHOUT_VALUE": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_WITHOUT_VALUE" + "params": "SECURESTORAGE_SETFORAPP_WITHOUT_VALUE", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_EMPTY_KEY": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_WITH_EMPTY_KEY" + "params": "SECURESTORAGE_SETFORAPP_WITH_EMPTY_KEY", + "expected": "error" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_DEVICE1": { "method": "manage_securestorage.setForApp", @@ -307,6 +335,14 @@ "method": "manage_securestorage.setForApp", "params": "SECURESTORAGE_SETFORAPP_ACCOUNT" }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_ACCOUNT1": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_ACCOUNT1" + }, + "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_ACCOUNT2": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_ACCOUNT2" + }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_DEVICE_WITH_OPTIONAL_PARAMETER": { "method": "manage_securestorage.setForApp", "params": "SECURESTORAGE_SETFORAPP_DEVICE_OPTIONAL" @@ -331,44 +367,62 @@ }, "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INVALID_SCOPE": { "method": "manage_securestorage.removeForApp", - "params": "SECURESTORAGE_REMOVEFORAPP_WITH_INVALID_SCOPE" + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_INVALID_SCOPE", + "expected": "error" }, "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_EMPTY_SCOPE": { "method": "manage_securestorage.removeForApp", - "params": "SECURESTORAGE_REMOVEFORAPP_WITH_EMPTY_SCOPE" + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_EMPTY_SCOPE", + "expected": "error" + }, + "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITHOUT_SCOPE": { + "method": "manage_securestorage.removeForApp", + "params": "SECURESTORAGE_REMOVEFORAPP_WITHOUT_SCOPE", + "expected": "error" }, "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INTEGER_SCOPE": { "method": "manage_securestorage.removeForApp", - "params": "SECURESTORAGE_REMOVEFORAPP_WITH_INTEGER_SCOPE" + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_INTEGER_SCOPE", + "expected": "error" }, "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_NULL_SCOPE": { "method": "manage_securestorage.removeForApp", - "params": "SECURESTORAGE_REMOVEFORAPP_WITH_NULL_SCOPE" + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_NULL_SCOPE", + "expected": "error" }, "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_BOOLEAN_SCOPE": { "method": "manage_securestorage.removeForApp", - "params": "SECURESTORAGE_REMOVEFORAPP_WITH_BOOLEAN_SCOPE" + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_BOOLEAN_SCOPE", + "expected": "error" }, "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_INTEGER_KEY": { "method": "manage_securestorage.removeForApp", - "params": "SECURESTORAGE_REMOVEFORAPP_WITH_INTEGER_KEY" + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_INTEGER_KEY", + "expected": "error" }, "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_NULL_KEY": { "method": "manage_securestorage.removeForApp", - "params": "SECURESTORAGE_REMOVEFORAPP_WITH_NULL_KEY" + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_NULL_KEY", + "expected": "error" }, "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_BOOLEAN_KEY": { "method": "manage_securestorage.removeForApp", - "params": "SECURESTORAGE_REMOVEFORAPP_WITH_BOOLEAN_KEY" + "params": "SECURESTORAGE_REMOVEFORAPP_WITH_BOOLEAN_KEY", + "expected": "error" }, "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITHOUT_KEY": { "method": "manage_securestorage.removeForApp", - "params": "SECURESTORAGE_REMOVEFORAPP_WITHOUT_KEY" + "params": "SECURESTORAGE_REMOVEFORAPP_WITHOUT_KEY", + "expected": "error" }, "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_ACCOUNT": { "method": "manage_securestorage.removeForApp", "params": "SECURESTORAGE_REMOVEFORAPP_ACCOUNT" }, + "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_ACCOUNT1": { + "method": "manage_securestorage.removeForApp", + "params": "SECURESTORAGE_REMOVEFORAPP_ACCOUNT1" + }, "GET_STORED_VALUE_FOR_AUTHTESTTOKENDEVICE_WITH_SCOPE_DEVICE": { "method": "securestorage.get", "params": "SECURESTORAGE_GET_DEVICE" @@ -377,6 +431,14 @@ "method": "securestorage.get", "params": "SECURESTORAGE_GET_ACCOUNT" }, + "GET_STORED_VALUE_FOR_AUTHTESTTOKENACCOUNT1_WITH_SCOPE_ACCOUNT": { + "method": "securestorage.get", + "params": "SECURESTORAGE_GET_ACCOUNT_KEY1" + }, + "GET_STORED_VALUE_FOR_AUTHTESTTOKENACCOUNT2_WITH_SCOPE_ACCOUNT": { + "method": "securestorage.get", + "params": "SECURESTORAGE_GET_ACCOUNT_KEY2" + }, "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITH_SCOPE_DEVICE": { "method": "manage_securestorage.clearForApp", "params": "SECURESTORAGE_CLEARFORAPP_DEVICE" @@ -387,27 +449,33 @@ }, "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITH_INVALID_SCOPE": { "method": "manage_securestorage.clearForApp", - "params": "SECURESTORAGE_CLEARFORAPP_WITH_INVALID_SCOPE" + "params": "SECURESTORAGE_CLEARFORAPP_WITH_INVALID_SCOPE", + "expected": "error" }, "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITH_EMPTY_SCOPE": { "method": "manage_securestorage.clearForApp", - "params": "SECURESTORAGE_CLEARFORAPP_WITH_EMPTY_SCOPE" + "params": "SECURESTORAGE_CLEARFORAPP_WITH_EMPTY_SCOPE", + "expected": "error" }, "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITH_INTEGER_SCOPE": { "method": "manage_securestorage.clearForApp", - "params": "SECURESTORAGE_CLEARFORAPP_WITH_INTEGER_SCOPE" + "params": "SECURESTORAGE_CLEARFORAPP_WITH_INTEGER_SCOPE", + "expected": "error" }, "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITH_NULL_SCOPE": { "method": "manage_securestorage.clearForApp", - "params": "SECURESTORAGE_CLEARFORAPP_WITH_NULL_SCOPE" + "params": "SECURESTORAGE_CLEARFORAPP_WITH_NULL_SCOPE", + "expected": "error" }, "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITH_BOOLEAN_SCOPE": { "method": "manage_securestorage.clearForApp", - "params": "SECURESTORAGE_CLEARFORAPP_WITH_BOOLEAN_SCOPE" + "params": "SECURESTORAGE_CLEARFORAPP_WITH_BOOLEAN_SCOPE", + "expected": "error" }, "CLEAR_SECURE_DATA_VALUES_FOR_AN_APP_WITHOUT_SCOPE": { "method": "manage_securestorage.clearForApp", - "params": "SECURESTORAGE_CLEARFORAPP_WITHOUT_SCOPE" + "params": "SECURESTORAGE_CLEARFORAPP_WITHOUT_SCOPE", + "expected": "error" }, "GET_STORED_VALUE_FOR_AN_APP_WITH_SCOPE_DEVICE": { "method": "securestorage.get", diff --git a/cypress/fixtures/modules/securestorage.json b/cypress/fixtures/modules/securestorage.json index 9351e8ff..65fa7032 100644 --- a/cypress/fixtures/modules/securestorage.json +++ b/cypress/fixtures/modules/securestorage.json @@ -118,9 +118,9 @@ "key": "authTestTokenAccount2" }, "GET_DEVICE2": "authTestTokenDevice2", - "GET_ACCOUNT2": "authTestTokenAccount2", + "GET_ACCOUNT2": "authTestTokenValue2", "GET_DEVICE1": "authTestTokenDevice1", - "GET_ACCOUNT1": "authTestTokenAccount1", + "GET_ACCOUNT1": "authTestTokenValue1", "INVALID_SCOPE": { "scope": "test", "key": "authTestTokenDevice" @@ -272,118 +272,130 @@ }, "VALUE_TTL": "authTestTokenValueTTL", "SETFORAPP_DEVICE": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": "authTestTokenDevice", "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, "SETFORAPP_INVALID_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": "test", "key": "authTestTokenDevice", "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, "SETFORAPP_INTEGER_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": 123, "key": "authTestTokenDevice", "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, "SETFORAPP_NULL_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": null, "key": "authTestTokenDevice", "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, "SETFORAPP_BOOLEAN_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": true, "key": "authTestTokenDevice", "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, "SETFORAPP_EMPTY_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": "", "key": "authTestTokenDevice", "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, "SETFORAPP_WITHOUT_SCOPE": { - "appId": "refui", + "appId": "boltextn", "key": "authTestTokenDevice", "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, "SETFORAPP_WITH_INTEGER_KEY": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": 123, "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, "SETFORAPP_WITH_NULL_KEY": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": null, "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, "SETFORAPP_WITH_BOOLEAN_KEY": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": true, "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, "SETFORAPP_WITHOUT_KEY": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, "SETFORAPP_WITH_INTEGER_VALUE": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": "authTestTokenDevice", "value": 123 }, "SETFORAPP_WITH_NULL_VALUE": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": "authTestTokenDevice", "value": null }, "SETFORAPP_WITH_BOOLEAN_VALUE": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": "authTestTokenDevice", "value": true }, "SETFORAPP_WITHOUT_VALUE": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": "authTestTokenDevice" }, "SETFORAPP_WITH_EMPTY_KEY": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": "", "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo" }, "SETFORAPP_DEVICE1": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": "authTestTokenDevice1", "value": "authTestTokenDevice1" }, "SETFORAPP_DEVICE2": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": "authTestTokenDevice2", "value": "authTestTokenDevice2" }, "SETFORAPP_ACCOUNT": { - "appId": "refui", + "appId": "boltextn", "scope": "account", "key": "authTestTokenAccount", "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" }, + "SETFORAPP_ACCOUNT1": { + "appId": "boltextn", + "scope": "account", + "key": "authTestTokenAccount1", + "value": "authTestTokenValue1" + }, + "SETFORAPP_ACCOUNT2": { + "appId": "boltextn", + "scope": "account", + "key": "authTestTokenAccount2", + "value": "authTestTokenValue2" + }, "SETFORAPP_DEVICE_OPTIONAL": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": "authTestTokenDevice1", "value": "authTestTokenValue1", @@ -392,7 +404,7 @@ } }, "SETFORAPP_ACCOUNT_OPTIONAL": { - "appId": "refui", + "appId": "boltextn", "scope": "account", "key": "authTestTokenAccount1", "value": "authTestTokenValue1", @@ -401,88 +413,97 @@ } }, "REMOVEFORAPP_DEVICE": { - "appId": "refui", + "appId": "boltextn", "scope": "device", - "key": "authTestTokenDevice" + "key": "authTestTokenDevice1" }, "REMOVEFORAPP_WITH_INVALID_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": "test", "key": "authTestTokenDevice" }, "REMOVEFORAPP_WITH_EMPTY_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": "", "key": "authTestTokenDevice" }, "REMOVEFORAPP_WITH_INTEGER_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": 123, "key": "authTestTokenDevice" }, "REMOVEFORAPP_WITH_NULL_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": null, "key": "authTestTokenDevice" }, "REMOVEFORAPP_WITH_BOOLEAN_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": true, "key": "authTestTokenDevice" }, "REMOVEFORAPP_WITH_INTEGER_KEY": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": 123 }, "REMOVEFORAPP_WITH_NULL_KEY": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": null }, "REMOVEFORAPP_WITH_BOOLEAN_KEY": { - "appId": "refui", + "appId": "boltextn", "scope": "device", "key": true }, "REMOVEFORAPP_WITHOUT_KEY": { - "appId": "refui", + "appId": "boltextn", "scope": "device" }, + "REMOVEFORAPP_WITHOUT_SCOPE": { + "appId": "boltextn", + "key": "authTestTokenDevice" + }, "REMOVEFORAPP_ACCOUNT": { - "appId": "refui", + "appId": "boltextn", "scope": "account", "key": "authTestTokenAccount" }, + "REMOVEFORAPP_ACCOUNT1": { + "appId": "boltextn", + "scope": "account", + "key": "authTestTokenAccount1" + }, "CLEARFORAPP_DEVICE": { - "appId": "refui", + "appId": "boltextn", "scope": "device" }, "CLEARFORAPP_WITH_INVALID_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": "test" }, "CLEARFORAPP_WITH_EMPTY_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": "" }, "CLEARFORAPP_WITH_INTEGER_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": 123 }, "CLEARFORAPP_WITH_NULL_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": null }, "CLEARFORAPP_WITH_BOOLEAN_SCOPE": { - "appId": "refui", + "appId": "boltextn", "scope": true }, "CLEARFORAPP_WITHOUT_SCOPE": { - "appId": "refui" + "appId": "boltextn" }, "CLEARFORAPP_ACCOUNT": { - "appId": "refui", + "appId": "boltextn", "scope": "account" }, "CLEAR_DEVICE": { From 9641161883ce015ad7e714d90ecc6393f5591105 Mon Sep 17 00:00:00 2001 From: jbigel <111541614+jbigel@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:47:53 -0400 Subject: [PATCH 197/359] copy changes from original branch (#128) --- cypress/support/constants/constants.js | 1 + .../step_definitions/getterSetterCalls.js | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 cypress/support/step_definitions/getterSetterCalls.js diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index bd68cc10..77217402 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -330,6 +330,7 @@ module.exports = { RESPONSE_TOPIC_LIST: 'responseTopicList', RESULT: 'result', RPC_ONLY_TIMEOUT: 200000, + RUNTIME: 'runtime', SANITY_REPORT_FILENAME: 'fca_sanity_suite', SANITY_REPORT_FILE_PATH: getSanityReportPath(), SANITY_REPORT_LONGPOLL_TIMEOUT: 200000, diff --git a/cypress/support/step_definitions/getterSetterCalls.js b/cypress/support/step_definitions/getterSetterCalls.js new file mode 100644 index 00000000..acc0db98 --- /dev/null +++ b/cypress/support/step_definitions/getterSetterCalls.js @@ -0,0 +1,40 @@ +/** + * Copyright 2024 Comcast Cable Communications Management, LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +import { Given } from '@badeball/cypress-cucumber-preprocessor'; +const CONSTANTS = require('../constants/constants'); + +/** + * @module settersGetterCalls + * @function Given we test the '(.+)' getters and setters + * @description Define and cache the fireboltCall object to use for getters and setters scenario by saving the object in env variable. + * @param {String} key - key name of the fireboltCall setter/getter data. + * @example + * Given we test the 'CLOSED_CAPTIONS' getters and setters + */ +Given(/we test the '(.+)' getters and setters$/, async (key) => { + // Clear any current env.runtime variables + Cypress.env(CONSTANTS.RUNTIME, {}); + + // Look for the firebolt call key in firebolt data + cy.getFireboltData(key).then((parsedData) => { + // getFireboltData handles the case where the key is not found + // Save the object as env.runtime.fireboltCall + const runtime = { fireboltCall: parsedData }; + Cypress.env(CONSTANTS.RUNTIME, runtime); + }); +}); From ab5c606cf783ba4e3a0af121f1b1ea3fc4216489 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Thu, 27 Jun 2024 14:57:40 +0530 Subject: [PATCH 198/359] FIRECERT-2157-SecureStorage updated negative TCs --- .../Manage/SecureStorageManage.feature | 64 ++++++------------- 1 file changed, 21 insertions(+), 43 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature index 5c2cb8c3..bdb77d34 100644 --- a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature @@ -24,6 +24,8 @@ Feature: SecureStorage_Manage @SecureStorage @manageSDK Scenario Outline: SecureStorage.removeForApp - Positive Scenario: + Given 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' Given 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for '' And 1st party app invokes the 'Firebolt' API to '' @@ -40,9 +42,9 @@ Feature: SecureStorage_Manage Then 'Firebolt' platform responds to '1st party app' with '' Examples: - | Scenario | Remove_API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | - | removeForApp with device scope | remove secure data value for an app with scope device | set secure data value for an app with scope device1 | set secure data value for an app with scope device2 | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | - | removeForApp with account scope | remove secure data value for an app with scope account1 | set secure data value for an app with scope account1 | set secure data value for an app with scope account2 | get stored value for an app for authTestTokenAccount1 with scope account | get stored value for an app for authTestTokenAccount2 with scope account | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | + | Scenario | Remove_API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | Clear_API_Key | + | removeForApp with device scope | remove secure data value for an app with scope device | set secure data value for an app with scope device1 | set secure data value for an app with scope device2 | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | clear stored value with scope as device for an app | + | removeForApp with account scope | remove secure data value for an app with scope account1 | set secure data value for an app with scope account1 | set secure data value for an app with scope account2 | get stored value for an app for authTestTokenAccount1 with scope account | get stored value for an app for authTestTokenAccount2 with scope account | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | clear stored value with scope as account for an app | @SecureStorage @manageSDK Scenario Outline: SecureStorage.clearForApp - Positive Scenario: @@ -68,42 +70,30 @@ Feature: SecureStorage_Manage @SecureStorage @manageSDK Scenario Outline: SecureStorage.setForApp - Negative Scenario: - Given 1st party app invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' - And 1st party app invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to '1st party app' for 'null for getting stored value' When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' for 'invalid params for setting a data value in securestorage' - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with 'null for getting stored value' Examples: - | Scenario | Set_API_Key | API_Key | Method_Validation_Key | Clear_API_Key | - | setForApp with invalid scope | set secure data value for an app with invalid scope | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp with integer scope | set secure data value for an app with invalid scope | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp with null scope | set secure data value for an app with null scope | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp with boolean scope | set secure data value for an app with boolean scope | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp with empty scope | set secure data value for an app with empty scope | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp without scope | set secure data value for an app without scope | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp with integer key | set secure data value for an app with integer key | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp with null key | set secure data value for an app with null key | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp with boolean key | set secure data value for an app with boolean key | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp without key | set secure data value for an app without key | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp with integer value | set secure data value for an app with integer value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp with null value | set secure data value for an app with null value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp with boolean value | set secure data value for an app with boolean value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - | setForApp without value | set secure data value for an app without value | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | Scenario | Set_API_Key | + | setForApp with invalid scope | set secure data value for an app with invalid scope | + | setForApp with integer scope | set secure data value for an app with invalid scope | + | setForApp with null scope | set secure data value for an app with null scope | + | setForApp with boolean scope | set secure data value for an app with boolean scope | + | setForApp with empty scope | set secure data value for an app with empty scope | + | setForApp without scope | set secure data value for an app without scope | + | setForApp with integer key | set secure data value for an app with integer key | + | setForApp with null key | set secure data value for an app with null key | + | setForApp with boolean key | set secure data value for an app with boolean key | + | setForApp without key | set secure data value for an app without key | + | setForApp with integer value | set secure data value for an app with integer value | + | setForApp with null value | set secure data value for an app with null value | + | setForApp with boolean value | set secure data value for an app with boolean value | + | setForApp without value | set secure data value for an app without value | @SecureStorage @manageSDK Scenario Outline: SecureStorage.removeForApp - Negative Scenario: - Given 1st party app invokes the 'Firebolt' API to 'set secure data value for an app with scope device1' - And 'Firebolt' platform responds to '1st party app' for 'set secure data value for an app with scope device1' - And 1st party app invokes the 'Firebolt' API to 'get stored value for an app for authTestTokenDevice1 with scope device' - And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenDevice1 stored data in securestorage' And 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for 'invalid parameters for securestorage removeForApp' - And 1st party app invokes the 'Firebolt' API to 'get stored value for an app for authTestTokenDevice1 with scope device' - And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenDevice1 stored data in securestorage' Examples: | Scenario | API_Key | @@ -120,23 +110,11 @@ Feature: SecureStorage_Manage @SecureStorage @manageSDK Scenario Outline: SecureStorage.clearForApp - Negative Scenario: - Given 1st party app invokes the 'Firebolt' API to 'set secure data value for an app with scope device1' - And 'Firebolt' platform responds to '1st party app' for 'set secure data value for an app with scope device1' - And 1st party app invokes the 'Firebolt' API to 'get stored value for an app for authTestTokenDevice1 with scope device' - And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenDevice1 stored data in securestorage' - Given 1st party app invokes the 'Firebolt' API to 'set secure data value for an app with scope account1' - And 'Firebolt' platform responds to '1st party app' for 'set secure data value for an app with scope account1' - And 1st party app invokes the 'Firebolt' API to 'get stored value for authTestTokenAccount1 with scope account' - And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenAccount1 stored data in securestorage' When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' for 'invalid params for clearing all data for an app in securestorage' - And 1st party app invokes the 'Firebolt' API to 'get stored value for an app for authTestTokenDevice1 with scope device' - And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenDevice1 stored data in securestorage' - And 1st party app invokes the 'Firebolt' API to 'get stored value for authTestTokenAccount1 with scope account' - And 'Firebolt' platform responds to '1st party app' for 'expected value for authTestTokenAccount1 stored data in securestorage' Examples: - | Scenario | Clear_API_key | + | Scenario | Clear_API_key | | Passing invalid scope | clear secure data values for an app with invalid scope | | Passing scope as empty string | clear secure data values for an app with empty scope | | Passing scope as integer | clear secure data values for an app with integer scope | From 4490cfa4832e62bc7a76185ec8e8ec1c64ebedfc Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 27 Jun 2024 17:41:11 +0530 Subject: [PATCH 199/359] FIRECERT-2157-task-3 --- .../Accessibility.feature | 2 +- .../FireboltCertification/Account.feature | 2 +- .../FireboltCertification/Advertising.feature | 2 +- .../Capabilities.feature | 8 ++++---- .../FireboltCertification/Device.feature | 2 +- .../FireboltCertification/Discovery.feature | 2 +- .../DiscoveryLaunchHot.feature | 2 +- .../FireboltCertification/Keyboard.feature | 8 ++++---- .../LifecycleBackground.feature | 12 +++++------ .../LifecycleInactive.feature | 4 ++-- .../LifecycleSuspended.feature | 20 +++++++++---------- .../LifecycleTerminated.feature | 2 +- .../LifecycleUnloading.feature | 12 +++++------ .../Localization.feature | 2 +- .../FireboltCertification/Profile.feature | 8 ++++---- .../SecondScreen.feature | 4 ++-- .../UserInterest.feature | 6 +++--- 17 files changed, 49 insertions(+), 49 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Accessibility.feature b/cypress/TestCases/FireboltCertification/Accessibility.feature index f2a3f14e..a8da02f5 100644 --- a/cypress/TestCases/FireboltCertification/Accessibility.feature +++ b/cypress/TestCases/FireboltCertification/Accessibility.feature @@ -108,7 +108,7 @@ Feature: Accessibility | Disable audioDescriptionSettings | disable audioDescription | disabled audioDescription settings | onaudioDescriptionSettings with disabled | | Enable audioDescriptionSettings | enable audioDescription | enabled audioDescription settings | onaudioDescriptionSettings with enabled | - @Accessibility @coreSDK @sdk @transport + @Accessibility @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: Accessibility.onClosedCaptionsSettingsChanged event - Positive Scenario: Clear listeners When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API And I clear 'accessibility onClosedCaptionsSettingsChanged event' listeners diff --git a/cypress/TestCases/FireboltCertification/Account.feature b/cypress/TestCases/FireboltCertification/Account.feature index 108c3aaf..9eaa77d3 100644 --- a/cypress/TestCases/FireboltCertification/Account.feature +++ b/cypress/TestCases/FireboltCertification/Account.feature @@ -14,7 +14,7 @@ Feature: Account | Validate account ID | fetch account ID | account id | id | | Validate account UID | fetch account UID | account uid | uid | - @Account @coreSDK @sdk @transport @notSupported + @Account @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario Outline: Account. - Negative Scenario: When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with '' diff --git a/cypress/TestCases/FireboltCertification/Advertising.feature b/cypress/TestCases/FireboltCertification/Advertising.feature index 91868282..5ac43513 100644 --- a/cypress/TestCases/FireboltCertification/Advertising.feature +++ b/cypress/TestCases/FireboltCertification/Advertising.feature @@ -140,7 +140,7 @@ Feature: Advertising | Without scope type | get advertisingId without scope type | | Invalid advertisingId scope | get advertisingId with invalid scope | - @Advertising @coreSDK @sdk @transport + @Advertising @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: Advertising.onPolicyChanged - Positive Scenario: Clearing event listeners When '3rd party app' registers for the 'advertising onPolicyChanged' event using the 'Firebolt' API And I clear 'advertising onPolicyChanged event' listeners diff --git a/cypress/TestCases/FireboltCertification/Capabilities.feature b/cypress/TestCases/FireboltCertification/Capabilities.feature index 25e6c50f..c36e7f11 100644 --- a/cypress/TestCases/FireboltCertification/Capabilities.feature +++ b/cypress/TestCases/FireboltCertification/Capabilities.feature @@ -219,7 +219,7 @@ Feature: Capabilities | Validate device sku capability | check if device sku capability is permitted with role use | fetch device sku | expected device sku | | Validate device uid capability | check if device uid capability is permitted with role use | fetch device uid | expected device uid | - @Capabilities @sdk @transport @coreSDK @notSupported + @Capabilities @sdk @transport @coreSDK @requiresPlatformImplementation Scenario: Validate Capabilities.OnAvailable When 1st party app registers for the 'capabilities onAvailable' event using the 'Firebolt' API And User set response for 'set keyboard response in platform' @@ -228,7 +228,7 @@ Feature: Capabilities Then 'Firebolt' platform responds to '1st party app' with 'true for keyboard capability availability' And 'Firebolt' platform triggers to '1st party app' event 'expected value for capabilities onAvailable' - @Capabilities @sdk @transport @coreSDK @notSupported + @Capabilities @sdk @transport @coreSDK @requiresPlatformImplementation Scenario: Validate Capabilities.OnUnavailable When 1st party app registers for the 'capabilities onUnavailable' event using the 'Firebolt' API # And App will be in 'closed' state @@ -238,7 +238,7 @@ Feature: Capabilities Then 'Firebolt' platform responds to '1st party app' with 'false for keyboard capability availability' And 'Firebolt' platform triggers to '1st party app' event 'expected value for capabilities onUnAvailable' - @Capabilities @sdk @transport @coreSDK @notSupported + @Capabilities @sdk @transport @coreSDK @requiresPlatformImplementation Scenario: Validate Capabilities.OnGranted When '3rd party app' registers for the 'capabilities onGranted' event using the 'Firebolt' API And User set response for 'set pinchallenge correct pin' @@ -251,7 +251,7 @@ Feature: Capabilities Then 'Firebolt' platform responds with 'true for granted capability with passed role' And 'Firebolt' platform triggers event 'expected value for capabilities OnGranted' - @Capabilities @sdk @transport @coreSDK @notSupported + @Capabilities @sdk @transport @coreSDK @requiresPlatformImplementation Scenario: Validate Capabilities.OnRevoked When '3rd party app' registers for the 'capabilities onRevoked' event using the 'Firebolt' API And User set response for 'set pinchallenge wrong pin' diff --git a/cypress/TestCases/FireboltCertification/Device.feature b/cypress/TestCases/FireboltCertification/Device.feature index cac42fa4..e6f19c5b 100644 --- a/cypress/TestCases/FireboltCertification/Device.feature +++ b/cypress/TestCases/FireboltCertification/Device.feature @@ -43,7 +43,7 @@ Feature: Device | Validate videoResolution | videoResolution | fetch videoResolution | expected videoResolution | | Validate audio | audio | fetch audio | expected audio | - @Device @coreSDK @regression @sdk + @Device @coreSDK @regression @sdk @requiresPlatformImplementation Scenario: Device.onNameChanged - Positive Scenario: Clearing event listeners When '3rd party app' registers for the 'device onNameChanged' event using the 'Firebolt' API And I clear 'device onNameChanged event' listeners diff --git a/cypress/TestCases/FireboltCertification/Discovery.feature b/cypress/TestCases/FireboltCertification/Discovery.feature index 71c8498f..029f20f2 100644 --- a/cypress/TestCases/FireboltCertification/Discovery.feature +++ b/cypress/TestCases/FireboltCertification/Discovery.feature @@ -155,7 +155,7 @@ Feature: Discovery | Invalid entitlements invalid startTime | notify content access with invalid entitlements invalid startTime | | Invalid entitlements invalid endTime | notify content access with invalid entitlements invalid endTime | - @Device @coreSDK @regression @sdk + @Device @coreSDK @regression @sdk @requiresPlatformImplementation Scenario: Discovery.onPolicyChanged - Positive Scenario: Clearing event listeners When '3rd party app' registers for the 'discovery onPolicyChanged' event using the 'Firebolt' API And I clear 'discovery onPolicyChanged event' listeners diff --git a/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature b/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature index 9d9a61c3..36aa4c0c 100644 --- a/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature +++ b/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature @@ -62,7 +62,7 @@ Feature: Discovery.launch_HotLaunch | PlayEntity Foreground with programType episode | launch app with playentity intent with programtype episode | onNavigateTo with playentity intent with programtype episode | | PlayEntity Foreground with programType concert | launch app with playentity intent with programtype concert | onNavigateTo with playentity intent with programtype concert | - @DiscoveryLaunch @coreSDK @sdk @transport + @DiscoveryLaunch @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Discovery.Launch Hot Launch - Positive Scenario: intent and app in inactive Given the environment has been set up for 'DiscoveryLaunch' tests And '3rd party app' transitions to state 'inactive' diff --git a/cypress/TestCases/FireboltCertification/Keyboard.feature b/cypress/TestCases/FireboltCertification/Keyboard.feature index 2d42e67b..513feeb1 100644 --- a/cypress/TestCases/FireboltCertification/Keyboard.feature +++ b/cypress/TestCases/FireboltCertification/Keyboard.feature @@ -1,6 +1,6 @@ Feature: Keyboard - @Keyboard @coreSDK @sdk @transport + @Keyboard @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Keyboard. - Positive Scenario: without UI Given the environment has been set up for 'Keyboard' tests And 3rd party 'certification' app is launched @@ -19,7 +19,7 @@ Feature: Keyboard | password | password as empty | prompt the user for their password as empty | the entered user password | | standard | standard platform | prompt the user for their standard platform | the entered standard user value | - @Keyboard @coreSDK @sdk @transport + @Keyboard @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Keyboard. - Positive Scenario: with UI Given the environment has been set up for 'Keyboard' tests And User 'starts' recording lifecycle history for '1st party app' @@ -39,7 +39,7 @@ Feature: Keyboard | password | password from keyboard | prompt the user for their password | the entered user password | | standard | standard platform from keyboard | prompt the user for their standard platform | the entered standard user value | - @Keyboard @coreSDK @sdk @transport + @Keyboard @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Keyboard. - Negative Scenario: without UI expecting error Given the environment has been set up for 'Keyboard' tests And 3rd party 'certification' app is launched @@ -57,7 +57,7 @@ Feature: Keyboard | standard | passing standard as empty | prompt the user for their standard as empty | invalid parameter standard | - @Keyboard @coreSDK @sdk @transport + @Keyboard @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Keyboard. - Negative Scenario: with UI expecting error Given the environment has been set up for 'Keyboard' tests And User 'starts' recording lifecycle history for '1st party app' diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature index 2653ecc7..c8b1ba40 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleBackground.feature @@ -2,7 +2,7 @@ # Validation objects are not added for not supported methods Feature: Lifecycle_Background - @Lifecycle @coreSDK + @Lifecycle @coreSDK @requiresPlatformImplementation Scenario Outline: Lifecycle 2.4.2 Background an app from Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with '' state @@ -19,7 +19,7 @@ Feature: Lifecycle_Background | inactive | @needsFurtherInformation @notSupported - @Lifecycle @coreSDK @lifecycleManagement + @Lifecycle @coreSDK @lifecycleManagement @requiresPlatformImplementation Scenario: Lifecycle 2.4.3 Cannot Background app that is not loaded Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'unloaded' state @@ -30,14 +30,14 @@ Feature: Lifecycle_Background # Then 'Firebolt' platform responds with 'message and code for lifecycle background' # Keeping this as notSupported because there is no support to background an already backgrounded app using lifecycle.background method - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.4.1 Cannot Background a Backgrounded App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'background' state When '3rd party app' transitions to state 'background' Then '3rd party app' will stay in 'background' state - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.4.3 Cannot Background app in Unloading state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'unloading' state @@ -45,14 +45,14 @@ Feature: Lifecycle_Background And AppObject state for '3rd party App' is set to 'unloading' Then '3rd party app' will stay in 'unloading' state - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.4.3 Cannot background app from suspended state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When '3rd party app' transitions to state 'background' Then '3rd party app' will stay in 'suspended' state - @Lifecycle @coreSDK + @Lifecycle @coreSDK @requiresPlatformImplementation Scenario: Lifecycle 2.4.3 Should not Background app in initializing state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'initializing' state diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInactive.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInactive.feature index 17c2df93..a7692fd9 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInactive.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleInactive.feature @@ -2,7 +2,7 @@ # Validation objects are not added for not supported methods Feature: Lifecycle_Inactive - @Lifecycle @coreSDK + @Lifecycle @coreSDK @requiresPlatformImplementation Scenario Outline: Lifecycle 2.3.1 Close an app from Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with '' state @@ -13,7 +13,7 @@ Feature: Lifecycle_Inactive | foreground | | background | - @Lifecycle @coreSDK @lifecycleManagement + @Lifecycle @coreSDK @lifecycleManagement @requiresPlatformImplementation Scenario: Lifecycle 2.3.3 No impact on closing app from inactive state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'inactive' state diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature index 92ebb1f5..1aab4d03 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleSuspended.feature @@ -6,14 +6,14 @@ Feature: Lifecycle_Suspended And 3rd party 'certification' app is launched with 'foreground' state When '3rd party app' registers for the 'lifecycle onSuspended' event using the 'Firebolt' API - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.5.4 Suspend App from Inactive state Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'inactive' state When '3rd party app' transitions to state 'suspended' Then '3rd party app' will be in 'suspended' state - @Lifecycle @coreSDK @notSupported @needsFurtherInformation + @Lifecycle @coreSDK @notSupported @needsFurtherInformation @requiresPlatformImplementation Scenario: Lifecycle 2.2.4 Relaunch a previously Suspended app after Unsuspend Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state @@ -21,28 +21,28 @@ Feature: Lifecycle_Suspended Then '3rd party app' transitions to state 'foreground' Then '3rd party app' will be in 'foreground' state - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.5.3 Cannot Suspend a suspended App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When '3rd party app' transitions to state 'suspended' Then '3rd party app' will stay in 'suspended' state - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.5.1 Cannot Suspend a unloaded App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'unloaded' state When '3rd party app' transitions to state 'suspended' Then '3rd party app' will stay in 'unloaded' state - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.5.5 Cannot relaunch Suspended App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When 3rd party 'certification' app is launched Then '3rd party app' will stay in 'suspended' state - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario Outline: Lifecycle 2.5.2 Cannot Suspend app Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with '' state @@ -54,7 +54,7 @@ Feature: Lifecycle_Suspended | foreground | | background | - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.3.2 Cannot Close Suspended App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state @@ -65,14 +65,14 @@ Feature: Lifecycle_Suspended # Then 'Firebolt' platform responds with 'last two responses for lifecycleManagement state' Then 'Firebolt' platform responds with 'message and code for lifecycle close' - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.6, 2.6.2 Unsuspending App Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'suspended' state When '3rd party app' transitions to state 'inactive' Then '3rd party app' will be in 'inactive' state - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario Outline: Lifecycle 2.6.1 Cannot Unsuspend in State Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with '' state @@ -90,7 +90,7 @@ Feature: Lifecycle_Suspended | inactive | | unloading | - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.6.3 Unsuspend unloaded app Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched with 'unloaded' state diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature index 70b1b0fd..864d1f45 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleTerminated.feature @@ -1,6 +1,6 @@ Feature: Lifecycle_Terminated - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario Outline: Lifecycle 2.8 Terminate app in State Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with '' state diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature index ed6e76bb..ef44619d 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/LifecycleUnloading.feature @@ -2,7 +2,7 @@ # Validation objects are not added for not supported methods Feature: Lifecycle_Unloading - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 3.4.4 No impact of multiple Finished events while unloading Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with 'unloading' state @@ -10,21 +10,21 @@ Feature: Lifecycle_Unloading And '3rd party app' invokes the 'Firebolt' API to 'call lifecycle finished and expects error' Then '3rd party app' will stay in 'unloaded' state - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.7.1 Unloading from Inactive state Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with 'inactive' state Then '3rd party app' transitions to state 'unloading' Then '3rd party app' will be in 'unloading' state - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.3.2 Cannot Close an Unloading App Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with 'unloading' state Then '3rd party app' transitions to state 'inactive' Then '3rd party app' will stay in 'unloading' state - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 3.4.3 finished from unloading state Given the environment has been set up for 'lifecycle' tests # And firebolt config 'Lifecycle.appFinishedTimeout' is set to to 60 'seconds' @@ -40,7 +40,7 @@ Feature: Lifecycle_Unloading Then '3rd party app' will stay in 'foreground' state # Then 'Firebolt' platform responds with 'message and code for lifecycle unload' - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario: Lifecycle 2.5.1 Cannot Suspend Unloaded app Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with 'unloaded' state @@ -51,7 +51,7 @@ Feature: Lifecycle_Unloading # Then 'Firebolt' platform responds with 'message and code for lifecycle suspend' # And 'Firebolt' platform responds with 'last two responses for lifecycleManagement state' - @Lifecycle @coreSDK @notSupported + @Lifecycle @coreSDK @notSupported @requiresPlatformImplementation Scenario Outline: Lifecycle 3.4.1 Should not finish from state other than unloading () Given the environment has been set up for 'lifecycle' tests When 3rd party 'certification' app is launched with '' state diff --git a/cypress/TestCases/FireboltCertification/Localization.feature b/cypress/TestCases/FireboltCertification/Localization.feature index 6447fe29..0b544011 100644 --- a/cypress/TestCases/FireboltCertification/Localization.feature +++ b/cypress/TestCases/FireboltCertification/Localization.feature @@ -68,7 +68,7 @@ Feature: Localization | Set & get preferredAudioLanguages(eng-spa) | Localization.preferredAudioLanguages | localization onPreferredAudioLanguagesChanged | set preferredaudiolanguages to eng spa | get localization preferredaudiolanguages | eng spa for localization preferredaudiolanguages | onpreferredaudiolanguageschanged for localization with eng and spa | | Set & get PostalCode | Localization.postalCode | localization onPostalCodeChanged | set postalcode to 12345 | get postalcode | 12345 for localization postalcode | onpostalcodechanged for localization postalCode with 12345 | - @Device @coreSDK @regression @sdk + @Device @coreSDK @regression @sdk @requiresPlatformImplementation Scenario Outline: Localization. - Positive Scenario: Clearing event listeners When '3rd party app' registers for the '' event using the 'Firebolt' API And I clear '' listeners diff --git a/cypress/TestCases/FireboltCertification/Profile.feature b/cypress/TestCases/FireboltCertification/Profile.feature index e5b94ea4..0514e16f 100644 --- a/cypress/TestCases/FireboltCertification/Profile.feature +++ b/cypress/TestCases/FireboltCertification/Profile.feature @@ -1,6 +1,6 @@ Feature: Profile - @Profile @coreSDK @sdk @transport + @Profile @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Profile.approveContentRating - Positive Scenario: without UI Given the environment has been set up for 'Profile' tests And 3rd party 'certification' app is launched @@ -16,7 +16,7 @@ Feature: Profile | Wrong-PIN | false for profile approveContentRating | | Cancelling-PIN | false for profile approveContentRating | - @Profile @coreSDK @sdk @transport + @Profile @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Profile.approveContentRating - Positive Scenario: with UI Given the environment has been set up for 'Profile' tests And User 'starts' recording lifecycle history for '1st party app' @@ -36,7 +36,7 @@ Feature: Profile | Wrong-PIN | false for profile approveContentRating | | Cancelling-PIN | false for profile approveContentRating | - @Profile @coreSDK @sdk @transport + @Profile @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Profile.approvePurchase - Positive Scenario: without UI Given the environment has been set up for 'Profile' tests And 3rd party 'certification' app is launched @@ -52,7 +52,7 @@ Feature: Profile | Wrong-PIN | false for profile approvePurchase | | Cancelling-PIN | false for profile approvePurchase | - @Profile @coreSDK @sdk @transport + @Profile @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Profile.approvePurchase - Positive Scenario: with UI Given the environment has been set up for 'Profile' tests And User 'starts' recording lifecycle history for '1st party app' diff --git a/cypress/TestCases/FireboltCertification/SecondScreen.feature b/cypress/TestCases/FireboltCertification/SecondScreen.feature index 70e25a07..4ea14273 100644 --- a/cypress/TestCases/FireboltCertification/SecondScreen.feature +++ b/cypress/TestCases/FireboltCertification/SecondScreen.feature @@ -34,7 +34,7 @@ Feature: Secondscreen Then 'Firebolt' platform responds with 'guest room for secondscreen friendlyName' And 'Firebolt' platform triggers event 'onFriendlyNameChanged for secondscreen with guest room' - @Secondscreen @coreSDK @regression @sdk + @Secondscreen @coreSDK @regression @sdk @requiresPlatformImplementation Scenario: Secondscreen.onFriendlyNameChanged - Positive Scenario: Validating event clearing listeners Given '3rd party app' registers for the 'secondscreen onFriendlyNameChanged' event using the 'Firebolt' API And I clear 'secondscreen onFriendlyNameChanged event' listeners @@ -55,7 +55,7 @@ Feature: Secondscreen | onCloseRequest | secondscreen onCloseRequest | expected secondscreen onCloseRequest event | onCloseRequest event | | onCloseRequest | secondscreen onCloseRequest | expected secondscreen onCloseRequest event | onCloseRequest event | - @Secondscreen @coreSDK @regression @sdk @notSupported + @Secondscreen @coreSDK @regression @sdk @notSupported @requiresPlatformImplementation Scenario Outline: Secondscreen. - Positive Scenario: Validating event Clearing listeners When '3rd party app' registers for the '' event using the 'Firebolt' API And I clear '' listeners diff --git a/cypress/TestCases/FireboltCertification/UserInterest.feature b/cypress/TestCases/FireboltCertification/UserInterest.feature index 3a909fce..35ad843f 100644 --- a/cypress/TestCases/FireboltCertification/UserInterest.feature +++ b/cypress/TestCases/FireboltCertification/UserInterest.feature @@ -112,17 +112,17 @@ Feature: UserInterest | Invalid reason value - test params | invalid reasonType | | Invalid Interest type - boolean params | boolean reasonType | - @coreSDK @sdk @userinterest @notSupported + @coreSDK @sdk @userinterest @requiresPlatformImplementation Scenario: Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest but platform timeout without sending response When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type interest timeout' Then 'Firebolt' platform responds to '1st party app' with 'not available for requestUserInterest' - @coreSDK @sdk @userinterest @notSupported + @coreSDK @sdk @userinterest @requiresPlatformImplementation Scenario: Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest but 3rd party app return error When 1st party app invokes the 'Firebolt' API to 'notify requestUserInterest with type interest returns error' Then 'Firebolt' platform responds to '1st party app' with 'invalid parameters for requestUserInterest' - @coreSDK @sdk @userinterest @notSupported + @coreSDK @sdk @userinterest @requiresPlatformImplementation Scenario: Content.requestUserInterest - Negative Scenario: Platform-UX - Notify requestUserInterest without registering for providers Given the environment has been set up for 'Userinterest' tests And 3rd party 'certification' app is launched From 129d19f8d742bb2390ac561ef90b67b8670f6f43 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 27 Jun 2024 21:29:10 +0530 Subject: [PATCH 200/359] Added event validation glue for v2 --- .../support/step_definitions/fireboltCalls.js | 202 ++++++++++++++- .../support/step_definitions/fireboltCalls.md | 15 ++ .../support/step_definitions/validations.js | 239 ++++++++++++++++++ .../support/step_definitions/validations.md | 23 +- 4 files changed, 475 insertions(+), 4 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 2a6cec40..d2839c7a 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -314,7 +314,7 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn action: action, task: CONSTANTS.TASK.REGISTEREVENT, }; - const appId = UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID); + const appId = UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID); // Assigning event_param env if param has empty object if (Object.keys(requestMap.params).length === 0) { // To Do :debug event_param issue by passing isrequired as false for getEnvVariable,need to debug further @@ -337,10 +337,10 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn CONSTANTS.ERROR_LIST.includes(response.error.message) ) { if (UTILS.getEnvVariable(CONSTANTS.CERTIFICATION) == true) { - assert(false, `${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`); + assert(false, `${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${event}`); } else { fireLog - .assert(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`) + .assert(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${event}`) .then(() => { throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); }); @@ -674,3 +674,199 @@ Given( } } ); + +/** + * @module fireboltCalls + * @function '(.+)' registers for the '(.*?)'(?: '(.*?)')? event + * @description Sending a message to platform or app to register a event + * @param {String} appId - app identtifier. + * @param {String} sdk - sdk name. + * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. + * @example + * And '1st party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event + * And '3rd party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event + * And '1st party app' registers for the 'Firebolt' event + */ +Given( + /'(.+)' registers for the '(.*?)'(?: '(.*?)')? event$/, + async (appId, sdk, fireboltCallKey) => { + if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { + let fireboltCallObject; + let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; + + // Creating runtime environment variable + if (!UTILS.getEnvVariable('runtime', false)) { + Cypress.env('runtime', {}); + } + + // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable + // TODO: appending the firebolt object will take care in optimization ticket + if (fireboltCallKey) { + cy.getFireboltData(fireboltCallKey).then((fireboltData) => { + fireboltCallObject = fireboltData; + UTILS.getEnvVariable('runtime').fireboltCall = fireboltData; + }); + } else { + fireboltCallObject = UTILS.getEnvVariable('runtime').fireboltCall; + fireboltCallObjectErrorMessage = + 'Unable to find the firebolt object in the runtime environment variable'; + } + + cy.then(() => { + // Failing the test when fireboltCall object not there + if (!fireboltCallObject) { + fireLog.assert(false, fireboltCallObjectErrorMessage); + } else { + let event = + typeof fireboltCallObject.event === CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.event() + : fireboltCallObject.event; + const eventParams = {}; + const context = {}; + appId = + appId === CONSTANTS.THIRD_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.FIRST_PARTY_APP + ? Cypress.env(CONSTANTS.FIRST_PARTY_APPID) + : appId; + let action = CONSTANTS.ACTION_CORE.toLowerCase(); + + // Splitting the method name if it contains an underscore and using the first part to determine the action that decides sdk. + if (event && event.includes('_')) { + action = setMethod.split('_')[0]; + event = event.split('_')[1]; + } + + // If event and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(event, eventParams)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } + if (appId == UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { + const requestMap = { + method: event, + params: eventParams, + action: action, + task: CONSTANTS.TASK.REGISTEREVENT, + }; + + // Assigning event_param env if param has empty object + if (Object.keys(requestMap.params).length === 0) { + // To Do :debug event_param issue by passing isrequired as false for getEnvVariable,need to debug further + requestMap.params = UTILS.getEnvVariable(CONSTANTS.EVENT_PARAM, false); + } + fireLog.info( + `Registering for the ${event} event using 1st party App with params : ${JSON.stringify( + eventParams + )}` + ); + // Sending the message to platform to register the event. + cy.sendMessagetoPlatforms(requestMap).then((response) => { + if (response && typeof response == CONSTANTS.TYPE_OBJECT) { + // If error and the error message having 'Method not found' or 'Method not Implemented' mark the testcase as undefined. + if ( + response && + response.error && + response.error.message && + CONSTANTS.ERROR_LIST.includes(response.error.message) + ) { + if (UTILS.getEnvVariable(CONSTANTS.CERTIFICATION) == true) { + assert(false, `${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${event}`); + } else { + fireLog + .assert(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${event}`) + .then(() => { + throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); + }); + } + } else if (response && response.error && response.error.message) { + assert( + false, + `Event registration failed for event ${event} with error message: ${response.error.message} ` + ); + } + + cy.updateResponseForFCS(event, eventParams, response).then((updatedResponse) => { + fireLog.info('Response from Firebolt platform: ' + JSON.stringify(response)); + // If event and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(event, eventParams)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } + + // Creating object with event name, params and response etc and storing it in a global list for further validation. + const eventAppObject = new eventObject( + event, + eventParams, + context, + updatedResponse, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); + }); + } else { + fireLog.info(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); + } + }); + } else { + let isNotSupportedApi = false; + + if (UTILS.isScenarioExempted(event, eventParams)) { + isNotSupportedApi = true; + } + + const communicationMode = UTILS.getCommunicationMode(); + const additionalParams = { + communicationMode: communicationMode, + action: action, + isNotSupportedApi: isNotSupportedApi, + }; + const params = { event: event, params: eventParams }; + + // Creating intent message using above details to send it to 3rd party app. + const intentMessage = UTILS.createIntentMessage( + CONSTANTS.TASK.REGISTEREVENT, + params, + additionalParams + ); + + fireLog.info( + `Registering for the ${event} event using ${appId} with params : ${JSON.stringify(eventParams)}` + ); + + cy.runIntentAddon(CONSTANTS.TASK.REGISTEREVENT, intentMessage).then((parsedIntent) => { + const requestTopic = UTILS.getTopic(appId); + const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); + + // Sending message to 3rd party app. + cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { + if (result === CONSTANTS.NO_RESPONSE) { + assert(false, CONSTANTS.NO_MATCHED_RESPONSE); + } + result = JSON.parse(result); + fireLog.info( + `Response from ${appId}: ${JSON.stringify(result.report.eventListenerResponse)}` + ); + + // If event and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(event, eventParams)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } + + // Creating object with event name, params and response etc and storing it in a global list for further validation. + const eventAppObject = new eventObject( + event, + eventParams, + context, + result.report, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); + }); + }); + } + } + }); + } else { + fireLog.assert(false, `${sdk} SDK not Supported`); + } + } +); \ No newline at end of file diff --git a/cypress/support/step_definitions/fireboltCalls.md b/cypress/support/step_definitions/fireboltCalls.md index ea35c3a3..1e5f42aa 100644 --- a/cypress/support/step_definitions/fireboltCalls.md +++ b/cypress/support/step_definitions/fireboltCalls.md @@ -96,3 +96,18 @@ Note: Key name value is an object and it can contains data as below * `Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to invalid 'test'` * `Given '1st party app' invokes the 'Firebolt' API to set 'enable' to 'true'` +## '(.+)' registers for the '(.*?)'(?: '(.*?)')? event + +### Purpose: Sending a message to platform or app to register a event + +### Params: +| Param | Definition | +| --- | --- | +| appId |app identtifier | +| sdk | sdk name | +| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | + +### Examples: + * `And '1st party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event` + * `And '3rd party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event` + * `And '1st party app' registers for the 'Firebolt' event` diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index d0b0eb37..8f74bc65 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -390,3 +390,242 @@ Given( }); } ); + +/** + * @module validations + * @function And '(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')? + * @description Performing a event validation against the source of truth + * @param {String} sdk - name of the sdk. + * @param {String} eventExpected - eventExpected will used to decide expecting for an event or not. + * @param {String} appId - The object was retrieved by using the appId. + * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData Json. + * @param {String} errorContent - Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' + * @example + * And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event + * And 'Firebolt' platform triggers '1st party app' event + * And 'Firebolt' platform triggers '3rd party app' 'CLOSEDCAPTION_SETTINGS' event + * And 'Firebolt' platform does not trigger '3rd party app' 'CLOSEDCAPTION_SETTINGS' event + * And 'Firebolt' platform triggers '1st party app' event + * And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event with 'INVALID_TYPE_PARAMS' + */ +Given( + /'(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')?$/, + async (sdk, eventExpected, appId, fireboltCallKey, errorContent) => { + if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { + let fireboltCallObject; + // Reading the appId from the environment variable + appId = !appId + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.THIRD_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.FIRST_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) + : appId; + const context = {}; + const expectingError = errorContent ? true : false; + + // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable + if (fireboltCallKey) { + cy.getFireboltData(fireboltCallKey).then((fireboltData) => { + fireboltCallObject = fireboltData; + }); + } else { + fireboltCallObject = UTILS.getEnvVariable('runtime').fireboltCall; + } + + cy.then(() => { + let event = + typeof fireboltCallObject.event == CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.event() + : fireboltCallObject.event; + let eventValidationJsonPath = + typeof fireboltCallObject.eventValidationJsonPath == CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.eventValidationJsonPath() + : fireboltCallObject.eventValidationJsonPath; + let contentObject = resolveContentObject(fireboltCallObject.content); + + event = event.includes('_') ? event.split('_')[1] : event; + contentObject = contentObject ? contentObject : CONSTANTS.NULL_RESPONSE; + eventValidationJsonPath = eventValidationJsonPath + ? eventValidationJsonPath + : CONSTANTS.EVENT_RESPONSE; + + // Fetching the object from the global list. + const eventObject = UTILS.getApiOrEventObjectFromGlobalList( + event, + context, + appId, + CONSTANTS.EVENT + ); + const param = eventObject.params; + + // If response of the event is not supported, checks in the not supported list for that event name, if it is present then pass else mark it as fail + if ( + !Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION) && + (UTILS.isScenarioExempted(event, param) || expectingError) + ) { + let errorExpected; + + // If the expected error is false, we set "exceptionErrorObject" to the errorExpected variable, which will be used to retrieve the error content object based on the exception event type. + expectingError === true + ? (errorExpected = UTILS.getEnvVariable('errorContentValidationJson')[errorContent]) + : (errorExpected = CONSTANTS.EXCEPTION_ERROR_OBJECT); + + cy.validateErrorObject(event, errorExpected, CONSTANTS.EVENT, context, appId, param).then( + () => { + return true; + } + ); + } else if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { + // If validationType is an event then send a message to the app to retrieve an event response based on the app ID. + const eventName = eventObject.eventObjectId; + if (appId === UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { + const requestMap = { + method: CONSTANTS.REQUEST_OVERRIDE_CALLS.FETCH_EVENT_RESPONSE, + params: eventName, + }; + + cy.sendMessagetoPlatforms(requestMap).then((result) => { + cy.updateResponseForFCS(event, null, result).then((updatedResponse) => { + cy.saveEventResponse( + updatedResponse, + eventObject, + eventName, + eventExpected === 'triggers' ? true : false + ); + }); + }); + } else { + const params = { event: eventName }; + // Generating an intent message using the provided information to send it to a third-party app + const intentMessage = UTILS.createIntentMessage( + CONSTANTS.TASK.GETEVENTRESPONSE, + params + ); + const requestTopic = UTILS.getTopic(appId); + const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); + cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((response) => { + response = JSON.parse(response); + response = response.report; + cy.saveEventResponse( + response, + eventObject, + eventName, + eventExpected === 'triggers' ? true : false + ); + }); + } + + try { + if (contentObject && contentObject.data) { + contentObject.data.forEach((object) => { + if (object.validations) { + const scenario = object.type; + const eventResponse = eventObject?.eventResponse + ? eventObject.eventResponse + : null; + + // Looping through eventValidationJsonPath to find the valid path for validation. + if (eventValidationJsonPath && Array.isArray(eventValidationJsonPath)) { + const validationPath = eventValidationJsonPath.find((path) => { + if ( + path.split('.').reduce((acc, part) => acc && acc[part], eventResponse) !== + undefined + ) { + return path; + } + }); + validationPath + ? (eventValidationJsonPath = validationPath) + : fireLog.assert( + false, + 'Could not find the valid validation path from the eventValidationJsonPath list' + ); + } + + switch (scenario) { + case CONSTANTS.REGEX: + cy.regExValidation( + event, + object.validations[0].type, + eventValidationJsonPath, + eventResponse + ); + break; + case CONSTANTS.MISC: + cy.miscellaneousValidation(event, object.validations[0], eventObject); + break; + case CONSTANTS.DECODE: + const decodeType = object.specialCase; + const responseForDecodeValidation = eventResponse; + + cy.decodeValidation( + event, + decodeType, + responseForDecodeValidation, + object.validations[0], + null + ); + break; + case CONSTANTS.FIXTURE: + cy.validateContent( + event, + context, + eventValidationJsonPath, + object.validations[0].type, + CONSTANTS.EVENT, + appId + ); + break; + case CONSTANTS.CUSTOM: + cy.customValidation(object, eventObject); + break; + case CONSTANTS.UNDEFINED: + cy.undefinedValidation(object, eventObject, CONSTANTS.EVENT); + break; + default: + assert(false, 'Unsupported validation type'); + break; + } + } + }); + } else { + cy.validateContent( + event, + context, + eventValidationJsonPath, + contentObject, + CONSTANTS.EVENT, + appId + ); + } + } catch (error) { + assert(false, `Unable to validate the response: ${error}`); + } + } else { + cy.log('Content validation is skipped'); + } + }); + } else { + assert(false, `${sdk} SDK not Supported`); + } + + // A Function that recursively check each fields and invokes if it's a function within an array or object. + function resolveContentObject(input) { + if (Array.isArray(input)) { + return input.map((item) => resolveContentObject(item)); + } else if (typeof input == CONSTANTS.TYPE_OBJECT && input !== null) { + for (const key in input) { + if (Object.hasOwnProperty.call(input, key)) { + input[key] = resolveContentObject(input[key]); + } + } + return input; + } else if (input && typeof input === CONSTANTS.TYPE_FUNCTION) { + return input(); + } else { + return input; + } + } + } +); diff --git a/cypress/support/step_definitions/validations.md b/cypress/support/step_definitions/validations.md index ad5c3aa8..7d868b11 100644 --- a/cypress/support/step_definitions/validations.md +++ b/cypress/support/step_definitions/validations.md @@ -409,4 +409,25 @@ Here, the value of the key "assertionDef" will be the customMethod we use for va ] } ] -} \ No newline at end of file +} + +## '(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')? + +### Purpose: Performing a event validation against the source of truth + +### Params: +| Param | Definition | +| --- | --- | +| sdk | sdk name | +| eventExpected | eventExpected will used to decide expecting for an event or not. | +| appId |app identtifier | +| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | +| errorContent | Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' | + +### Examples: + * `And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event` + * `And 'Firebolt' platform triggers '1st party app' event` + * `And 'Firebolt' platform triggers '3rd party app' 'CLOSEDCAPTION_SETTINGS' event` + * `And 'Firebolt' platform does not trigger '3rd party app' 'CLOSEDCAPTION_SETTINGS' event` + * `And 'Firebolt' platform triggers '1st party app' event` + * `And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event with 'INVALID_TYPE_PARAMS'` \ No newline at end of file From d8711fd10c0963cf8c5b61a446a56e391531ccd7 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 28 Jun 2024 00:16:28 +0530 Subject: [PATCH 201/359] FIRECERT-2157-SecureStorage updated positive scenarios with valid appId --- .../Manage/SecureStorageManage.feature | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature index bdb77d34..15b9a8fe 100644 --- a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature @@ -8,12 +8,12 @@ Feature: SecureStorage_Manage Scenario Outline: SecureStorage.setForApp - Positive Scenario: Given 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' - And 1st party app invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to '1st party app' for 'null for getting stored value' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for getting stored value' When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' for '' - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' Examples: | Scenario | Set_API_Key | API_Key | Method_Validation_Key | Clear_API_Key | @@ -26,20 +26,18 @@ Feature: SecureStorage_Manage Scenario Outline: SecureStorage.removeForApp - Positive Scenario: Given 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' - Given 1st party app invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to '1st party app' for '' - And 1st party app invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for getting stored value' And 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value for an app' - And 1st party app invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' for '' - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with 'null for getting stored value' - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for getting stored value' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' Examples: | Scenario | Remove_API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | Clear_API_Key | @@ -50,22 +48,23 @@ Feature: SecureStorage_Manage Scenario Outline: SecureStorage.clearForApp - Positive Scenario: Given 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for '' - And 1st party app invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' And 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for '' - And 1st party app invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' for '' - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with 'null for getting stored value' - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with 'null for getting stored value' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for getting stored value' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for getting stored value' + Examples: - | Scenario | Clear_API_Key | API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | - | clearForApp with device scope | clear secure data values for an app with scope device | get stored value for authTestTokenDevice with scope device | set secure data value for an app with scope device1 | set secure data value for an app with scope device2 | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | + | Scenario | Clear_API_Key | API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | + | clearForApp with device scope | clear secure data values for an app with scope device | get stored value for authTestTokenDevice with scope device | set secure data value for an app with scope device1 | set secure data value for an app with scope device2 | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | | clearForApp with account scope | clear secure data values for an app with scope account | get stored value for authTestTokenAccount with scope account | set secure data value for an app with scope account1 | set secure data value for an app with scope account2 | get stored value for an app for authTestTokenAccount1 with scope account | get stored value for an app for authTestTokenAccount2 with scope account | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | @SecureStorage @manageSDK From 30edbdda411a19d962c45aad98791ae73a0d27a8 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 28 Jun 2024 00:22:35 +0530 Subject: [PATCH 202/359] FIRECERT-2157-SecureStorage updated module json file --- .../fixtures/fireboltCalls/securestorage.json | 2 +- cypress/fixtures/modules/securestorage.json | 235 ------------------ 2 files changed, 1 insertion(+), 236 deletions(-) diff --git a/cypress/fixtures/fireboltCalls/securestorage.json b/cypress/fixtures/fireboltCalls/securestorage.json index 1657d09f..57a0cc13 100644 --- a/cypress/fixtures/fireboltCalls/securestorage.json +++ b/cypress/fixtures/fireboltCalls/securestorage.json @@ -779,7 +779,7 @@ "params": "SECURESTORAGE_CLEAR_ACCOUNT" }, "CLEAR_STORED_VALUE_WITH_SCOPE_AS_DEVICE_FOR_AN_APP": { - "method": "securestorage.clearForApp", + "method": "manage_securestorage.clearForApp", "params": "SECURESTORAGE_CLEARFORAPP_DEVICE" }, "CLEAR_STORED_VALUE_WITH_SCOPE_AS_ACCOUNT_FOR_AN_APP": { diff --git a/cypress/fixtures/modules/securestorage.json b/cypress/fixtures/modules/securestorage.json index 65fa7032..2a14b603 100644 --- a/cypress/fixtures/modules/securestorage.json +++ b/cypress/fixtures/modules/securestorage.json @@ -271,241 +271,6 @@ } }, "VALUE_TTL": "authTestTokenValueTTL", - "SETFORAPP_DEVICE": { - "appId": "boltextn", - "scope": "device", - "key": "authTestTokenDevice", - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" - }, - "SETFORAPP_INVALID_SCOPE": { - "appId": "boltextn", - "scope": "test", - "key": "authTestTokenDevice", - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" - }, - "SETFORAPP_INTEGER_SCOPE": { - "appId": "boltextn", - "scope": 123, - "key": "authTestTokenDevice", - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" - }, - "SETFORAPP_NULL_SCOPE": { - "appId": "boltextn", - "scope": null, - "key": "authTestTokenDevice", - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" - }, - "SETFORAPP_BOOLEAN_SCOPE": { - "appId": "boltextn", - "scope": true, - "key": "authTestTokenDevice", - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" - }, - "SETFORAPP_EMPTY_SCOPE": { - "appId": "boltextn", - "scope": "", - "key": "authTestTokenDevice", - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" - }, - "SETFORAPP_WITHOUT_SCOPE": { - "appId": "boltextn", - "key": "authTestTokenDevice", - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" - }, - "SETFORAPP_WITH_INTEGER_KEY": { - "appId": "boltextn", - "scope": "device", - "key": 123, - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" - }, - "SETFORAPP_WITH_NULL_KEY": { - "appId": "boltextn", - "scope": "device", - "key": null, - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" - }, - "SETFORAPP_WITH_BOOLEAN_KEY": { - "appId": "boltextn", - "scope": "device", - "key": true, - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" - }, - "SETFORAPP_WITHOUT_KEY": { - "appId": "boltextn", - "scope": "device", - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" - }, - "SETFORAPP_WITH_INTEGER_VALUE": { - "appId": "boltextn", - "scope": "device", - "key": "authTestTokenDevice", - "value": 123 - }, - "SETFORAPP_WITH_NULL_VALUE": { - "appId": "boltextn", - "scope": "device", - "key": "authTestTokenDevice", - "value": null - }, - "SETFORAPP_WITH_BOOLEAN_VALUE": { - "appId": "boltextn", - "scope": "device", - "key": "authTestTokenDevice", - "value": true - }, - "SETFORAPP_WITHOUT_VALUE": { - "appId": "boltextn", - "scope": "device", - "key": "authTestTokenDevice" - }, - "SETFORAPP_WITH_EMPTY_KEY": { - "appId": "boltextn", - "scope": "device", - "key": "", - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo" - }, - "SETFORAPP_DEVICE1": { - "appId": "boltextn", - "scope": "device", - "key": "authTestTokenDevice1", - "value": "authTestTokenDevice1" - }, - "SETFORAPP_DEVICE2": { - "appId": "boltextn", - "scope": "device", - "key": "authTestTokenDevice2", - "value": "authTestTokenDevice2" - }, - "SETFORAPP_ACCOUNT": { - "appId": "boltextn", - "scope": "account", - "key": "authTestTokenAccount", - "value": "VGhpcyBub3QgYSByZWFsIHRva2VuLgo=" - }, - "SETFORAPP_ACCOUNT1": { - "appId": "boltextn", - "scope": "account", - "key": "authTestTokenAccount1", - "value": "authTestTokenValue1" - }, - "SETFORAPP_ACCOUNT2": { - "appId": "boltextn", - "scope": "account", - "key": "authTestTokenAccount2", - "value": "authTestTokenValue2" - }, - "SETFORAPP_DEVICE_OPTIONAL": { - "appId": "boltextn", - "scope": "device", - "key": "authTestTokenDevice1", - "value": "authTestTokenValue1", - "options": { - "ttl": 2000 - } - }, - "SETFORAPP_ACCOUNT_OPTIONAL": { - "appId": "boltextn", - "scope": "account", - "key": "authTestTokenAccount1", - "value": "authTestTokenValue1", - "options": { - "ttl": 2000 - } - }, - "REMOVEFORAPP_DEVICE": { - "appId": "boltextn", - "scope": "device", - "key": "authTestTokenDevice1" - }, - "REMOVEFORAPP_WITH_INVALID_SCOPE": { - "appId": "boltextn", - "scope": "test", - "key": "authTestTokenDevice" - }, - "REMOVEFORAPP_WITH_EMPTY_SCOPE": { - "appId": "boltextn", - "scope": "", - "key": "authTestTokenDevice" - }, - "REMOVEFORAPP_WITH_INTEGER_SCOPE": { - "appId": "boltextn", - "scope": 123, - "key": "authTestTokenDevice" - }, - "REMOVEFORAPP_WITH_NULL_SCOPE": { - "appId": "boltextn", - "scope": null, - "key": "authTestTokenDevice" - }, - "REMOVEFORAPP_WITH_BOOLEAN_SCOPE": { - "appId": "boltextn", - "scope": true, - "key": "authTestTokenDevice" - }, - "REMOVEFORAPP_WITH_INTEGER_KEY": { - "appId": "boltextn", - "scope": "device", - "key": 123 - }, - "REMOVEFORAPP_WITH_NULL_KEY": { - "appId": "boltextn", - "scope": "device", - "key": null - }, - "REMOVEFORAPP_WITH_BOOLEAN_KEY": { - "appId": "boltextn", - "scope": "device", - "key": true - }, - "REMOVEFORAPP_WITHOUT_KEY": { - "appId": "boltextn", - "scope": "device" - }, - "REMOVEFORAPP_WITHOUT_SCOPE": { - "appId": "boltextn", - "key": "authTestTokenDevice" - }, - "REMOVEFORAPP_ACCOUNT": { - "appId": "boltextn", - "scope": "account", - "key": "authTestTokenAccount" - }, - "REMOVEFORAPP_ACCOUNT1": { - "appId": "boltextn", - "scope": "account", - "key": "authTestTokenAccount1" - }, - "CLEARFORAPP_DEVICE": { - "appId": "boltextn", - "scope": "device" - }, - "CLEARFORAPP_WITH_INVALID_SCOPE": { - "appId": "boltextn", - "scope": "test" - }, - "CLEARFORAPP_WITH_EMPTY_SCOPE": { - "appId": "boltextn", - "scope": "" - }, - "CLEARFORAPP_WITH_INTEGER_SCOPE": { - "appId": "boltextn", - "scope": 123 - }, - "CLEARFORAPP_WITH_NULL_SCOPE": { - "appId": "boltextn", - "scope": null - }, - "CLEARFORAPP_WITH_BOOLEAN_SCOPE": { - "appId": "boltextn", - "scope": true - }, - "CLEARFORAPP_WITHOUT_SCOPE": { - "appId": "boltextn" - }, - "CLEARFORAPP_ACCOUNT": { - "appId": "boltextn", - "scope": "account" - }, "CLEAR_DEVICE": { "scope": "device" }, From 970d34e65a0ceba33c87882d15378b5abe2ff8af Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 28 Jun 2024 01:10:11 +0530 Subject: [PATCH 203/359] Rpc-Only-NegativeTC-Fix Updated rpc-only negative TCs --- .../AcknowledgeChallengeManage_RpcOnly.feature | 2 +- .../Manage/KeyboardManage_RpcOnly.feature | 8 ++++---- .../Manage/ProfileManage_RpcOnly.feature | 2 +- cypress/fixtures/fireboltCalls/keyboard.json | 18 ++++++++++++++++++ .../fixtures/fireboltCalls/localization.json | 6 ++++++ cypress/fixtures/fireboltCalls/profile.json | 6 ++++++ 6 files changed, 36 insertions(+), 6 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature index 12db09d5..369a5c83 100644 --- a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature @@ -27,4 +27,4 @@ And Fetch response for 'acknowledgeChallenge onRequestChallenge' event from 1st party app And 1st party app invokes the 'Firebolt' API to 'send error from challenge provider' And Fetch response for 'localization countryCode' method from 3rd party app - Then 'Firebolt' platform responds with 'expected localization countryCode' \ No newline at end of file + Then 'Firebolt' platform responds with 'expected localization countryCode challengeError' \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature index 1f66d5a9..8b778ff9 100644 --- a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature @@ -31,7 +31,7 @@ Feature: Keyboard_Manage_RpcOnly Then 'Firebolt' platform responds with '' Examples: - | Scenario | ManageEventName | EventName | MethodName | MethodParam | FocusMethod | MethodResponse | - | Validating rpc method | keyboard onRequestEmail manage | keyboard onRequestEmail | keyboard email | prompt the user for their email address with signin type | send error from email provider | entered email address | - | Validating rpc method | keyboard onRequestStandard manage | keyboard onRequestStandard | keyboard standard | prompt the user for their username | send error from standard provider | entered username | - | Validating rpc method | keyboard onRequestPassword manage | keyboard onRequestPassword | keyboard password | prompt the user for their password | send error from password provider | entered password | \ No newline at end of file + | Scenario | ManageEventName | EventName | MethodName | MethodParam | FocusMethod | MethodResponse | + | Validating rpc method | keyboard onRequestEmail manage | keyboard onRequestEmail | keyboard email | prompt the user for their email address with signin type | send error from email provider | entered email address provider error | + | Validating rpc method | keyboard onRequestStandard manage | keyboard onRequestStandard | keyboard standard | prompt the user for their username | send error from standard provider | entered username provider error | + | Validating rpc method | keyboard onRequestPassword manage | keyboard onRequestPassword | keyboard password | prompt the user for their password | send error from password provider | entered password provider error | \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature index 07dbea9c..60b806f8 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature @@ -24,4 +24,4 @@ Feature: Profile_Manage_RpcOnly And Fetch response for 'pinChallenge onRequestChallenge' event from 1st party app And 1st party app invokes the 'Firebolt' API to 'send error from pinchallenge provider' And Fetch response for 'profile approvePurchase' method from 3rd party app - Then 'Firebolt' platform responds with 'true for profile approvepurchase' \ No newline at end of file + Then 'Firebolt' platform responds with 'profile approvepurchase challengeError' \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/keyboard.json b/cypress/fixtures/fireboltCalls/keyboard.json index e928ff06..23bdd69b 100644 --- a/cypress/fixtures/fireboltCalls/keyboard.json +++ b/cypress/fixtures/fireboltCalls/keyboard.json @@ -168,6 +168,24 @@ "validationJsonPath": "result", "content": "KEYBOARD_PASSWORD" }, + "ENTERED_EMAIL_ADDRESS_PROVIDER_ERROR": { + "method": "keyboard.email", + "validationJsonPath": "result", + "content": "CUSTOM_ERROR", + "expectingError": true + }, + "ENTERED_USERNAME_PROVIDER_ERROR": { + "method": "keyboard.standard", + "validationJsonPath": "result", + "content": "CUSTOM_ERROR", + "expectingError": true + }, + "ENTERED_PASSWORD_PROVIDER_ERROR": { + "method": "keyboard.password", + "validationJsonPath": "result", + "content": "CUSTOM_ERROR", + "expectingError": true + }, "SEND_ERROR_FROM_EMAIL_PROVIDER":{ "method": "keyboard.emailError", "params": "KEYBOARD_EMAILERROR" diff --git a/cypress/fixtures/fireboltCalls/localization.json b/cypress/fixtures/fireboltCalls/localization.json index 76ba561f..05b371ed 100644 --- a/cypress/fixtures/fireboltCalls/localization.json +++ b/cypress/fixtures/fireboltCalls/localization.json @@ -640,5 +640,11 @@ "method": "localization.removeAdditionalInfo", "validationJsonPath": "result", "content": "NULL" + }, + "EXPECTED_LOCALIZATION_COUNTRYCODE_CHALLENGEERROR":{ + "method": "localization.countryCode", + "validationJsonPath": "result", + "content": "CUSTOM_ERROR", + "expectingError": true } } \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/profile.json b/cypress/fixtures/fireboltCalls/profile.json index bc3d8d34..169b432c 100644 --- a/cypress/fixtures/fireboltCalls/profile.json +++ b/cypress/fixtures/fireboltCalls/profile.json @@ -63,5 +63,11 @@ "SEND_ERROR_FROM_PINCHALLENGE_PROVIDER":{ "method": "pinChallenge.challengeError", "params": "PROFILE_PINCHALLENGE_CHALLENGE_ERROR_PARAMS" + }, + "PROFILE_APPROVEPURCHASE_CHALLENGEERROR": { + "method": "profile.approvePurchase", + "validationJsonPath": "result", + "content": "CUSTOM_ERROR", + "expectingError": true } } \ No newline at end of file From f86811d5e8a1e9234b57f8026b7c657c2015057d Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Fri, 28 Jun 2024 11:14:07 +0530 Subject: [PATCH 204/359] 2166 - UsergrantsManage feature file --- .../Manage/UserGrantsManage.feature | 190 ++++++++++++ .../fixtures/fireboltCalls/usergrants.json | 289 ++++++++++++++++++ .../fireboltMocks/acknowledgeChallenge.json | 34 +++ cypress/fixtures/modules/usergrants.json | 55 ++++ .../objects/validationObjects/usergrants.json | 86 ++++++ 5 files changed, 654 insertions(+) create mode 100644 cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature create mode 100644 cypress/fixtures/fireboltMocks/acknowledgeChallenge.json create mode 100644 cypress/fixtures/objects/validationObjects/usergrants.json diff --git a/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature b/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature new file mode 100644 index 00000000..1c8dc8ff --- /dev/null +++ b/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature @@ -0,0 +1,190 @@ +Feature: UserGrants_Manage + + # First allowing the grant and calling usergrants.app then checking grant using Capabilities.granted + @Usergrants @manageSDK @sdk @transport + Scenario: Usergrants.app - Positive Scenario: with grant(ackchallenge) + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And Framework registers 'ackchallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'fetch device id' + And User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When 1st party app invokes the 'Firebolt' API to 'get usergrants for 3rd party app' + Then 'Firebolt' platform responds to '1st party app' with 'expected list of grants for 3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' + Then 'Firebolt' platform responds with 'true for capabilities granted' + + # First allowing the grant for device.distributor for the device and calling usergrants.device and validating. + @Usergrants @manageSDK @sdk @transport + Scenario: Usergrants.device - Positive Scenario: with grant(ackchallenge) + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And Framework registers 'ackchallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'fetch device distributor' + And User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When 1st party app invokes the 'Firebolt' API to 'get usergrants for device' + Then 'Firebolt' platform responds to '1st party app' with 'expected list of grants for device' + + # First allowing the grant and calling usergrants.capability then checking grant using Capabilities.granted + @Usergrants @manageSDK @sdk @transport + Scenario: Usergrants.capability - Positive Scenario: with grant(ackchallenge) + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And Framework registers 'ackchallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'fetch device id' + And User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When 1st party app invokes the 'Firebolt' API to 'get usergrants for device id capability' + Then 'Firebolt' platform responds to '1st party app' with 'expected list of grants for device id capability' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' + Then 'Firebolt' platform responds with 'true for capabilities granted' + + @Usergrants @manageSDK @sdk @transport + Scenario Outline: Usergrants. - Positive Scenario: + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' + + Examples: + | Scenario | Grant_Key | Grant_Method_Content | Key | Validation_Key | Method | + | grant capability at device level | grant device distributor capability | null for usergrants grant | get usergrants for device | expected list of grants for device | grant | + | grant capability at app level | grant device id capability | null for usergrants grant | get usergrants for 3rd party app | expected list of grants for 3rd party app | grant | + | deny capability at device level | deny device distributor capability | null for usergrants deny | get usergrants for device | expected list of denied grants for device | deny | + | deny capability at app level | deny device id capability | null for usergrants deny | get usergrants for 3rd party app | expected list of denied grants for 3rd party app | deny | + + @Usergrants @manageSDK @sdk @transport + Scenario Outline: Usergrants.clear - Positive Scenario: + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And Framework registers 'ackchallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When 1st party app invokes the 'Firebolt' API to '' + And User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with 'null for usergrants clear' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' + + Examples: + | Scenario | Api_Key | Grant_Key | Validation_Key | Clear_Api_Key | Grant_Api_Validation_Key | + | clear grant at device level for role use | fetch device distributor | get usergrants for device | expected list of grants for device | clear device distributor capability | empty array for usergrants device distributor | + | clear grant at device app for role use | fetch device id | get usergrants for 3rd party app | expected list of grants for 3rd party app | clear device id capability | empty array for usergrants device id | + + # here requesting a grant for device id for the role use + @Usergrants @manageSDK @sdk @transport + Scenario: Usergrants.request - Positive Scenario: requesting for grant without force params, with force=true + Given the environment has been set up for 'userGrants' tests + And Framework registers 'pinChallenge' test provider + And 1st party app invokes the 'Firebolt' API to 'request grant for discovery watched capability' + Then 'Firebolt' platform responds to '1st party app' with 'granted for discovery watched capability' + When User set response for 'set acknowledge granted' + And Framework registers 'ackchallenge' test provider + When 1st party app invokes the 'Firebolt' API to 'get 3rd party app grants' + Then 'Firebolt' platform responds to '1st party app' with 'granted for usergrants discovery watched capability' + # Calling usergrants.request with force true, so the grant will be asked again + When User set response for 'set pinchallenge wrong pin' + And 1st party app invokes the 'Firebolt' API to 'request grant for discovery watched capability with role use and force true' + Then 'Firebolt' platform responds to '1st party app' with 'denied for discovery watched capability' + When User set response for 'set acknowledge deny' + And Framework registers 'ackchallenge' test provider + When 1st party app invokes the 'Firebolt' API to 'get 3rd party app grants' + Then 'Firebolt' platform responds to '1st party app' with 'denied for usergrants country code capability' + + # here requesting a grant for device id for the role use + @Usergrants @manageSDK @sdk @transport + Scenario: Usergrants.request - Positive Scenario: requesting for grant without force params, with force=true and force=false + Given the environment has been set up for 'userGrants' tests + And Framework registers 'ackchallenge' test provider + And 1st party app invokes the 'Firebolt' API to 'request grant for country code capability' + Then 'Firebolt' platform responds to '1st party app' with 'granted for country code capability' + When 1st party app invokes the 'Firebolt' API to 'get 3rd party app grants' + Then 'Firebolt' platform responds to '1st party app' with 'granted for usergrants country code capability' + # Calling usergrants.request with force true, so the grant will be asked again + When User set response for 'set acknowledge deny' + And 1st party app invokes the 'Firebolt' API to 'request grant for country code capability with role use and force true' + Then 'Firebolt' platform responds to '1st party app' with 'denied for country code capability' + When 1st party app invokes the 'Firebolt' API to 'get 3rd party app grants' + Then 'Firebolt' platform responds to '1st party app' with 'denied for usergrants country code capability' + # Calling usergrants.request with force false, grant will not be asked + When 1st party app invokes the 'Firebolt' API to 'request grant for country code capability with role use and force false' + Then 'Firebolt' platform responds to '1st party app' with 'denied for country code capability' + When 1st party app invokes the 'Firebolt' API to 'get 3rd party app grants' + Then 'Firebolt' platform responds to '1st party app' with 'denied for usergrants country code capability' + + @Usergrants @manageSDK @sdk @transport + Scenario Outline: Usergrants. - Negative Scenario: expecting error + Given the environment has been set up for 'userGrants' tests + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' + + Examples: + | Scenario | Api_Key | Validation_Key | Method | + | With integer appId | get usergrants app with invalid appId parameter | invalid parameter for usergrants app | app | + | With boolean appId | get usergrants app with invalid type boolean appId parameter | invalid parameter for usergrants app | app | + | with integer capability | get usergrants capability with invalid type integer capability parameter | invalid parameter for usergrants capability | capability | + | with boolean capability | get usergrants capability with invalid type boolean capability parameter | invalid parameter for usergrants capability | capability | + + @Usergrants @manageSDK @sdk @transport + Scenario Outline: Usergrants. - Negative Scenario: expecting error + Given the environment has been set up for 'userGrants' tests + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' + + Examples: + | Scenario | Method | Api_Key | Validation_Key | + | invalid role | grant | get usergrants grant with invalid role parameter | invalid parameter for usergrants grant | + | invalid capability | grant | get usergrants grant with invalid capability parameter | invalid parameter for usergrants grant | + | invalid appId | grant | get usergrants grant with invalid options appId parameter | invalid parameter for usergrants grant | + | capability not defined in grantPolicy | grant | get usergrants grant with capability not defined in manifest | custom error for usergrants grant | + | invalid role | deny | get usergrants deny with invalid role parameter | invalid parameter for usergrants deny | + | invalid capability | deny | get usergrants deny with invalid capability parameter | invalid parameter for usergrants deny | + | invalid appId | deny | get usergrants deny with invalid appId parameter | invalid parameter for usergrants deny | + | capability not defined in grantPolicy | deny | get usergrants deny with capability not defined in manifest | custom error for usergrants deny | + | invalid role | clear | get usergrants clear with invalid role parameter | invalid parameter for usergrants clear | + | invalid capability | clear | get usergrants clear with invalid capability parameter | invalid parameter for usergrants clear | + | invalid appId | clear | get usergrants clear with invalid options appId parameter | invalid parameter for usergrants clear | + | invalid role | request | get usergrants request with invalid role parameter | invalid parameter for usergrants request | + | invalid capability | request | get usergrants request with invalid capability parameter | invalid parameter for usergrants request | + | invalid appId | request | get usergrants request with invalid options appId parameter | invalid parameter for usergrants request | + + @Usergrants @manageSDK @sdk @transport + Scenario: UserGrants.Capability - Positive Scenario: by clearing the grant and validating usergrants.capability as empty + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And Framework registers 'ackchallenge' test provider + When '3rd party app' invokes the 'Firebolt' API to 'fetch device distributor' + Then 'Firebolt' platform responds with 'expected device distributor' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device distributor' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When 1st party app invokes the 'Firebolt' API to 'clear device distributor capability' + Then 'Firebolt' platform responds to '1st party app' with 'null for usergrants clear' + When 1st party app invokes the 'Firebolt' API to 'get usergrants for device distributor capability' + Then 'Firebolt' platform responds to '1st party app' with 'empty array for device distributor capability' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device distributor' + Then 'Firebolt' platform responds with 'null for capabilities granted' + + @Usergrants @manageSDK @sdk @transport + Scenario: Usergrants.app - Positive Scenario: by clearing the grant and validating usergrants.app as empty + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And Framework registers 'ackchallenge' test provider + When '3rd party app' invokes the 'Firebolt' API to 'fetch device id' + Then 'Firebolt' platform responds with 'expected device id' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When 1st party app invokes the 'Firebolt' API to 'clear device id capability' + Then 'Firebolt' platform responds to '1st party app' with 'null for usergrants clear' + When 1st party app invokes the 'Firebolt' API to 'get usergrants for 3rd party app' + Then 'Firebolt' platform responds to '1st party app' with 'empty array for usergrants device id' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' + Then 'Firebolt' platform responds with 'null for capabilities granted' \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/usergrants.json b/cypress/fixtures/fireboltCalls/usergrants.json index 7fd93997..2281e5d8 100644 --- a/cypress/fixtures/fireboltCalls/usergrants.json +++ b/cypress/fixtures/fireboltCalls/usergrants.json @@ -100,5 +100,294 @@ "SEND_ERROR_FROM_CHALLENGE_PROVIDER":{ "method": "acknowledgeChallenge.challengeError", "params": "USERGRANTS_CHALLENGEERROR_PARAMS" + }, + "GET_USERGRANTS_FOR_3RD_PARTY_APP": { + "method": "manage_usergrants.app", + "params": "USERGRANTS_COMCAST_TEST_FIRECERT" + }, + "EXPECTED_LIST_OF_GRANTS_FOR_3RD_PARTY_APP": { + "method": "usergrants.app", + "validationJsonPath": "result", + "content": "USERGRANTS_APP_DEVICE_ID_GRANTED_ROLE_USE" + }, + "GET_USERGRANTS_FOR_DEVICE": { + "method": "manage_usergrants.device" + }, + "EXPECTED_LIST_OF_GRANTS_FOR_DEVICE": { + "method": "usergrants.device", + "validationJsonPath": "result", + "content": "USERGRANTS_DEVICE_DISTRIBUTOR_GRANTED_ROLE_USE" + }, + "GET_USERGRANTS_FOR_DEVICE_ID_CAPABILITY": { + "method": "manage_usergrants.capability", + "params": "USERGRANTS_DEVICE_ID" + }, + "EXPECTED_LIST_OF_GRANTS_FOR_DEVICE_ID_CAPABILITY": { + "method": "usergrants.capability", + "validationJsonPath": "result", + "content": "USERGRANTS_CAPABILITY_DEVICE_ID_GRANTED_ROLE_USE" + }, + "GRANT_DEVICE_DISTRIBUTOR_CAPABILITY": { + "method": "manage_usergrants.grant", + "params": "USERGRANTS_GRANT_DEVICE_LEVEL_DEVICE_DISTRIBUTOR_ROLE_USE" + }, + "NULL_FOR_USERGRANTS_GRANT": { + "method": "usergrants.grant", + "validationJsonPath": "result", + "content": "USERGRANTS_GRANT" + }, + "GRANT_DEVICE_ID_CAPABILITY": { + "method": "manage_usergrants.grant", + "params": "USERGRANTS_GRANT_WITH_APP_ID_DEVICE_ID_ROLE_USE" + }, + "DENY_DEVICE_DISTRIBUTOR_CAPABILITY": { + "method": "manage_usergrants.deny", + "params": "USERGRANTS_DENY_DEVICE_LEVEL_DEVICE_DISTRIBUTOR_ROLE_USE" + }, + "NULL_FOR_USERGRANTS_DENY": { + "method": "usergrants.deny", + "validationJsonPath": "result", + "content": "USERGRANTS_DENY" + }, + "DENY_DEVICE_ID_CAPABILITY": { + "method": "manage_usergrants.deny", + "params": "USERGRANTS_DENY_WITH_APP_ID_DEVICE_ID_ROLE_USE" + }, + "EXPECTED_LIST_OF_DENIED_GRANTS_FOR_DEVICE": { + "method": "usergrants.device", + "validationJsonPath": "result", + "content": "USERGRANTS_DEVICE_DISTRIBUTOR_DENIED_ROLE_USE" + }, + "EXPECTED_LIST_OF_DENIED_GRANTS_FOR_3RD_PARTY_APP": { + "method": "usergrants.app", + "validationJsonPath": "result", + "content": "USERGRANTS_APP_DEVICE_ID_DENIED_ROLE_USE" + }, + "GET_USERGRANTS_APP_WITH_INVALID_APPID_PARAMETER": { + "method": "manage_usergrants.app", + "params": "USERGRANTS_APP_INTEGER_VALUE", + "expected": "error" + }, + "GET_USERGRANTS_APP_WITH_INVALID_TYPE_BOOLEAN_APPID_PARAMETER": { + "method": "manage_usergrants.app", + "params": "USERGRANTS_APP_BOOLEAN_APP_ID", + "expected": "error" + }, + "GET_USERGRANTS_CAPABILITY_WITH_INVALID_TYPE_INTEGER_CAPABILITY_PARAMETER": { + "method": "manage_usergrants.capability", + "params": "USERGRANTS_CAPABILITY_INTEGER_CAPABILITY", + "expected": "error" + }, + "GET_USERGRANTS_CAPABILITY_WITH_INVALID_TYPE_BOOLEAN_CAPABILITY_PARAMETER": { + "method": "manage_usergrants.capability", + "params": "USERGRANTS_CAPABILITY_BOOLEAN_CAPABILITY", + "expected": "error" + }, + "INVALID_PARAMETER_FOR_USERGRANTS_APP": { + "method": "usergrants.app", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "INVALID_PARAMETER_FOR_USERGRANTS_CAPABILITY": { + "method": "usergrants.capability", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "GET_USERGRANTS_GRANT_WITH_INVALID_ROLE_PARAMETER": { + "method": "manage_usergrants.grant", + "params": "USERGRANTS_GRANT_INVALID_ROLE", + "expected": "error" + }, + "GET_USERGRANTS_GRANT_WITH_INVALID_CAPABILITY_PARAMETER": { + "method": "manage_usergrants.grant", + "params": "USERGRANTS_GRANT_INTEGER_CAPABILITY", + "expected": "error" + }, + "GET_USERGRANTS_GRANT_WITH_INVALID_OPTIONS_APPID_PARAMETER": { + "method": "manage_usergrants.grant", + "params": "USERGRANTS_GRANT_INTEGER_APP_ID", + "expected": "error" + }, + "GET_USERGRANTS_GRANT_WITH_CAPABILITY_NOT_DEFINED_IN_MANIFEST": { + "method": "manage_usergrants.grant", + "params": "USERGRANTS_GRANT_CAPABILITY_NOT_DEFINED_IN_MANIFEST", + "expected": "error" + }, + "GET_USERGRANTS_DENY_WITH_INVALID_ROLE_PARAMETER": { + "method": "manage_usergrants.deny", + "params": "USERGRANTS_DENY_INVALID_ROLE", + "expected": "error" + }, + "GET_USERGRANTS_DENY_WITH_INVALID_CAPABILITY_PARAMETER": { + "method": "manage_usergrants.deny", + "params": "USERGRANTS_DENY_INTEGER_CAPABILITY", + "expected": "error" + }, + "GET_USERGRANTS_DENY_WITH_INVALID_APPID_PARAMETER": { + "method": "manage_usergrants.deny", + "params": "USERGRANTS_DENY_INTEGER_APP_ID", + "expected": "error" + }, + "GET_USERGRANTS_DENY_WITH_CAPABILITY_NOT_DEFINED_IN_MANIFEST": { + "method": "manage_usergrants.deny", + "params": "USERGRANTS_DENY_CAPABILITY_NOT_DEFINED_IN_MANIFEST", + "expected": "error" + }, + "INVALID_PARAMETER_FOR_USERGRANTS_GRANT": { + "method": "usergrants.grant", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "INVALID_PARAMETER_FOR_USERGRANTS_DENY": { + "method": "usergrants.deny", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "GET_USERGRANTS_CLEAR_WITH_INVALID_ROLE_PARAMETER": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_INVALID_ROLE", + "expected": "error" + }, + "GET_USERGRANTS_CLEAR_WITH_INVALID_CAPABILITY_PARAMETER": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_INTEGER_CAPABILITY", + "expected": "error" + }, + "GET_USERGRANTS_CLEAR_WITH_INVALID_OPTIONS_APPID_PARAMETER": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_INTEGER_APP_ID", + "expected": "error" + }, + "INVALID_PARAMETER_FOR_USERGRANTS_CLEAR": { + "method": "usergrants.clear", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "GET_USERGRANTS_REQUEST_WITH_INVALID_ROLE_PARAMETER": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_INVALID_ROLE", + "expected": "error" + }, + "GET_USERGRANTS_REQUEST_WITH_INVALID_CAPABILITY_PARAMETER": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_INTEGER_CAPABILITY", + "expected": "error" + }, + "GET_USERGRANTS_REQUEST_WITH_INVALID_OPTIONS_APPID_PARAMETER": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_INTEGER_APP_ID", + "expected": "error" + }, + "INVALID_PARAMETER_FOR_USERGRANTS_REQUEST": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", + "expectingError": true + }, + "CUSTOM_ERROR_FOR_USERGRANTS_GRANT": { + "method": "usergrants.grant", + "validationJsonPath": "result", + "content": "CUSTOM_ERROR", + "expectingError": true + }, + "CUSTOM_ERROR_FOR_USERGRANTS_DENY": { + "method": "usergrants.deny", + "validationJsonPath": "result", + "content": "CUSTOM_ERROR", + "expectingError": true + }, + "CLEAR_DEVICE_DISTRIBUTOR_CAPABILITY": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_DEVICE_LEVEL_DEVICE_DISTRIBUTOR" + }, + "NULL_FOR_USERGRANTS_CLEAR": { + "method": "usergrants.clear", + "validationJsonPath": "result", + "content": "USERGRANTS_CLEAR" + }, + "EMPTY_ARRAY_FOR_USERGRANTS_DEVICE_DISTRIBUTOR": { + "method": "usergrants.device", + "validationJsonPath": "result", + "content": "USERGRANTS_DEVICE_EMPTY_LIST" + }, + "CLEAR_DEVICE_ID_CAPABILITY": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_WITH_APP_ID_DEVICE_ID_ROLE_USE" + }, + "EMPTY_ARRAY_FOR_USERGRANTS_DEVICE_ID": { + "method": "usergrants.app", + "validationJsonPath": "result", + "content": "USERGRANTS_APP_EMPTY_LIST" + }, + "REQUEST_GRANT_FOR_DISCOVERY_WATCHED_CAPABILITY": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_DISCOVERY_WATCHED_ROLE_USE" + }, + "GRANTED_FOR_DISCOVERY_WATCHED_CAPABILITY": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "USERGRANTS_REQUEST_DISCOVERY_WATCHED_GRANTED_ROLE_USE" + }, + "GET_3RD_PARTY_APP_USERGRANTS_": { + "method": "manage_usergrants.app", + "params": "USERGRANTS_APP_COUNTRY_CODE" + }, + "GRANTED_FOR_USERGRANTS_DISCOVERY_WATCHED_CAPABILITY": { + "method": "usergrants.app", + "validationJsonPath": "result", + "content": "USERGRANTS_WATCHED_CODE_GRANTED_ROLE_USE" + }, + "REQUEST_GRANT_FOR_DISCOVERY_WATCHED_CAPABILITY_WITH_ROLE_USE_AND_FORCE_TRUE": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_DISCOVERY_WATCHED_ROLE_USE_FORCE_TRUE" + }, + "DENIED_FOR_DISCOVERY_WATCHED_CAPABILITY": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "USERGRANTS_REQUEST_DISCOVERY_WATCHED_DENY_ROLE_USE" + }, + "DENIED_FOR_USERGRANTS_COUNTRY_CODE_CAPABILITY": { + "method": "usergrants.app", + "validationJsonPath": "result", + "content": "USERGRANTS_COUNTRY_CODE_DENY_ROLE_USE" + }, + "USERGRANTS_CLEAR_WITH_DEVICE_LEVEL_DEVICE_DISTRIBUTOR_ROLE_USE_METHOD": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_WITH_DEVICE_LEVEL_DEVICE_DISTRIBUTOR_ROLE_USE_METHOD" + }, + "EMPTY_ARRAY_FOR_DEVICE_DISTRIBUTOR_CAPABILITY": { + "method": "usergrants.capability", + "validationJsonPath": "result", + "content": "USERGRANTS_EMPTY_ARRAY" + }, + "REQUEST_GRANT_FOR_COUNTRY_CODE_CAPABILITY": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_LOCALIZATION_COUNTRYCODE_ROLE_USE" + }, + "REQUEST_GRANT_FOR_COUNTRY_CODE_CAPABILITY_WITH_ROLE_USE_AND_FORCE_TRUE": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_LOCALIZATION_COUNTRYCODE_ROLE_USE_FORCE_TRUE" + }, + "REQUEST_GRANT_FOR_COUNTRY_CODE_CAPABILITY_WITH_ROLE_USE_AND_FORCE_FALSE": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_LOCALIZATION_COUNTRYCODE_ROLE_USE_FORCE_FALSE" + }, + "USERGRANTS_CLEAR_WITH_APP_LEVEL_DISCOVERY_WATCHED_ROLE_USE_METHOD": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_WITH_APP_LEVEL_DISCOVERY_WATCHED_ROLE_USE_METHOD" + }, + "GRANTED_FOR_COUNTRY_CODE_CAPABILITY": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "USERGRANTS_REQUEST_LOCALIZATION_COUNTRYCODE_GRANTED_ROLE_USE" + }, + "GET_USERGRANTS_FOR_DEVICE_DISTRIBUTOR_CAPABILITY": { + "method": "manage_usergrants.capability", + "params": "USERGRANTS_DEVICE_DISTRIBUTOR" } } \ No newline at end of file diff --git a/cypress/fixtures/fireboltMocks/acknowledgeChallenge.json b/cypress/fixtures/fireboltMocks/acknowledgeChallenge.json new file mode 100644 index 00000000..c70b2d84 --- /dev/null +++ b/cypress/fixtures/fireboltMocks/acknowledgeChallenge.json @@ -0,0 +1,34 @@ +{ + "ACKNOWLEDGE_CHALLENGE_DENY": { + "method": "ackchallenge", + "response": [{ + "isCancelled": true, + "withUi": true, + "error":{} + }] + }, + "ACKNOWLEDGE_CHALLENGE_GRANTED": { + "method": "ackchallenge", + "response": [{ + "isCancelled": false, + "withUi": true, + "result":{} + }] + }, + "ACKNOWLEDGE_DEFERRED": { + "method": "ackchallenge", + "response": [{ + "isCancelled": true, + "withUi": true, + "isExit": true, + "result":{} + }] + }, + "ACKNOWLEDGE_TIMEOUT": { + "method": "ackchallenge", + "response": [{ + "withUi": true, + "result":{} + }] + } +} \ No newline at end of file diff --git a/cypress/fixtures/modules/usergrants.json b/cypress/fixtures/modules/usergrants.json index 05f3ca69..ea6eba1f 100644 --- a/cypress/fixtures/modules/usergrants.json +++ b/cypress/fixtures/modules/usergrants.json @@ -86,5 +86,60 @@ "message": "Error" } } + }, + "GRANT_DEVICE_LEVEL_DEVICE_DISTRIBUTOR_ROLE_USE": {"role": "use", "capability": "xrn:firebolt:capability:device:distributor"}, + "DENY_DEVICE_LEVEL_DEVICE_DISTRIBUTOR_ROLE_USE": {"role": "use", "capability": "xrn:firebolt:capability:device:distributor"}, + "APP_INTEGER_VALUE": { + "appId": 1234 + }, + "APP_BOOLEAN_APP_ID": { + "appId": true + }, + "CAPABILITY_INTEGER_CAPABILITY": { + "capability": 1234 + }, + "CAPABILITY_BOOLEAN_CAPABILITY": { + "capability": true + }, + "GRANT_INVALID_ROLE": { + "role": "test", + "capability": "xrn:firebolt:capability:device:id" + }, + "GRANT_INTEGER_CAPABILITY": { + "role": "use", + "capability": 1234 + }, + "GRANT_INTEGER_APP_ID": { + "role": "use", + "capability": "xrn:firebolt:capability:device:id", + "options": { + "appId": 1234 + } + }, + "GRANT_CAPABILITY_NOT_DEFINED_IN_MANIFEST": { + "role": "use", + "capability": "xrn:firebolt:capability:test:test" + }, + "DENY_INVALID_ROLE": { + "role": "test", + "capability": "xrn:firebolt:capability:device:id" + }, + "DENY_INTEGER_CAPABILITY": { + "role": "use", + "capability": 1234 + }, + "CLEAR_DEVICE_LEVEL_DEVICE_DISTRIBUTOR": {"role": "use", "capability": "xrn:firebolt:capability:device:distributor"}, + "DENY_INTEGER_APP_ID": {"role": "use", "capability": "xrn:firebolt:capability:device:id", "options": {"appId": 1234}}, + "DENY_CAPABILITY_NOT_DEFINED_IN_MANIFEST": {"role": "use", "capability": "xrn:firebolt:capability:test:test"}, + "CLEAR_INVALID_ROLE": {"role": "test", "capability": "xrn:firebolt:capability:localization:postal-code"}, + "CLEAR_INTEGER_CAPABILITY": {"role": "use", "capability": 1234}, + "CLEAR_INTEGER_APP_ID": {"role": "use", "capability": "xrn:firebolt:capability:device:id", "options": {"appId": 1234}}, + "REQUEST_INTEGER_APP_ID": {"appId": 1234, "permissions": [{"role": "use", "capability": "xrn:firebolt:capability:localization:country-code"}]}, + "CLEAR_WITH_DEVICE_LEVEL_DEVICE_DISTRIBUTOR_ROLE_USE_METHOD": { + "role": "use", + "capability": "xrn:firebolt:capability:device:distributor" + }, + "DEVICE_DISTRIBUTOR": { + "capability": "xrn:firebolt:capability:device:distributor" } } \ No newline at end of file diff --git a/cypress/fixtures/objects/validationObjects/usergrants.json b/cypress/fixtures/objects/validationObjects/usergrants.json new file mode 100644 index 00000000..211b8220 --- /dev/null +++ b/cypress/fixtures/objects/validationObjects/usergrants.json @@ -0,0 +1,86 @@ +{ + "USERGRANTS_GRANT": { + "data": [ + { + "type": "fixture", + "validations": [ + { + "mode": "staticContentValidation", + "type": "NULL", + "description": "Validation of the usergrants.grant" + } + ] + } + ] + }, + "USERGRANTS_DENY": { + "data": [ + { + "type": "fixture", + "validations": [ + { + "mode": "staticContentValidation", + "type": "NULL", + "description": "Validation of the usergrants.deny" + } + ] + } + ] + }, + "USERGRANTS_CLEAR": { + "data": [ + { + "type": "fixture", + "validations": [ + { + "mode": "staticContentValidation", + "type": "NULL", + "description": "Validation of the usergrants.clear" + } + ] + } + ] + }, + "USERGRANTS_DEVICE_EMPTY_LIST": { + "data": [ + { + "type": "fixture", + "validations": [ + { + "mode": "staticContentValidation", + "type": "EMPTYARRAY", + "description": "Validation of the usergrants.device" + } + ] + } + ] + }, + "USERGRANTS_APP_EMPTY_LIST": { + "data": [ + { + "type": "fixture", + "validations": [ + { + "mode": "staticContentValidation", + "type": "EMPTYARRAY", + "description": "Validation of the usergrants.app" + } + ] + } + ] + }, + "USERGRANTS_EMPTY_ARRAY": { + "data": [ + { + "type": "fixture", + "validations": [ + { + "mode": "staticContentValidation", + "type": "EMPTYARRAY", + "description": "Validation of the usergrants.capability" + } + ] + } + ] + } +} \ No newline at end of file From beab30bf3491b75f866d21054e6a33c13d8e2c14 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 28 Jun 2024 11:34:47 +0530 Subject: [PATCH 205/359] FIRECERT-2157-addressed comment --- cypress/TestCases/FireboltCertification/Capabilities.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/TestCases/FireboltCertification/Capabilities.feature b/cypress/TestCases/FireboltCertification/Capabilities.feature index c36e7f11..fabf7b5c 100644 --- a/cypress/TestCases/FireboltCertification/Capabilities.feature +++ b/cypress/TestCases/FireboltCertification/Capabilities.feature @@ -228,7 +228,7 @@ Feature: Capabilities Then 'Firebolt' platform responds to '1st party app' with 'true for keyboard capability availability' And 'Firebolt' platform triggers to '1st party app' event 'expected value for capabilities onAvailable' - @Capabilities @sdk @transport @coreSDK @requiresPlatformImplementation + @Capabilities @sdk @transport @coreSDK @requiresPlatformImplementation @notSupported Scenario: Validate Capabilities.OnUnavailable When 1st party app registers for the 'capabilities onUnavailable' event using the 'Firebolt' API # And App will be in 'closed' state From 4d6546dbd704b445373498233305c2a1b1fc5296 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 28 Jun 2024 13:10:27 +0530 Subject: [PATCH 206/359] FIRECERT-2157-SecureStorage updated TC params --- .../Manage/SecureStorageManage.feature | 12 +++++++---- .../fixtures/fireboltCalls/securestorage.json | 20 +++++++++++-------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature index 15b9a8fe..3a63bca2 100644 --- a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature @@ -28,8 +28,12 @@ Feature: SecureStorage_Manage And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with 'null for getting stored value' + And 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value for an app' And 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value for an app' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with '' When 1st party app invokes the 'Firebolt' API to '' @@ -41,8 +45,8 @@ Feature: SecureStorage_Manage Examples: | Scenario | Remove_API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | Clear_API_Key | - | removeForApp with device scope | remove secure data value for an app with scope device | set secure data value for an app with scope device1 | set secure data value for an app with scope device2 | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | clear stored value with scope as device for an app | - | removeForApp with account scope | remove secure data value for an app with scope account1 | set secure data value for an app with scope account1 | set secure data value for an app with scope account2 | get stored value for an app for authTestTokenAccount1 with scope account | get stored value for an app for authTestTokenAccount2 with scope account | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | clear stored value with scope as account for an app | + | removeForApp with device scope | remove secure data value for an app with scope device | set secure data value1 for an app with scope device | set secure data value2 for an app with scope device | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | clear stored value with scope as device for an app | + | removeForApp with account scope | remove secure data value1 for an app with scope account | set secure data value1 for an app with scope account | set secure data value2 for an app with scope account | get stored value for an app for authTestTokenAccount1 with scope account | get stored value for an app for authTestTokenAccount2 with scope account | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | clear stored value with scope as account for an app | @SecureStorage @manageSDK Scenario Outline: SecureStorage.clearForApp - Positive Scenario: @@ -64,8 +68,8 @@ Feature: SecureStorage_Manage Examples: | Scenario | Clear_API_Key | API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | - | clearForApp with device scope | clear secure data values for an app with scope device | get stored value for authTestTokenDevice with scope device | set secure data value for an app with scope device1 | set secure data value for an app with scope device2 | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | - | clearForApp with account scope | clear secure data values for an app with scope account | get stored value for authTestTokenAccount with scope account | set secure data value for an app with scope account1 | set secure data value for an app with scope account2 | get stored value for an app for authTestTokenAccount1 with scope account | get stored value for an app for authTestTokenAccount2 with scope account | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | + | clearForApp with device scope | clear secure data values for an app with scope device | get stored value for authTestTokenDevice with scope device | set secure data value1 for an app with scope device | set secure data value2 for an app with scope device | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | + | clearForApp with account scope | clear secure data values for an app with scope account | get stored value for authTestTokenAccount with scope account | set secure data value1 for an app with scope account | set secure data value2 for an app with scope account | get stored value for an app for authTestTokenAccount1 with scope account | get stored value for an app for authTestTokenAccount2 with scope account | expected value for authTestTokenAccount2 stored data in securestorage | expected value for authTestTokenAccount1 stored data in securestorage | @SecureStorage @manageSDK Scenario Outline: SecureStorage.setForApp - Negative Scenario: diff --git a/cypress/fixtures/fireboltCalls/securestorage.json b/cypress/fixtures/fireboltCalls/securestorage.json index 57a0cc13..705f1da7 100644 --- a/cypress/fixtures/fireboltCalls/securestorage.json +++ b/cypress/fixtures/fireboltCalls/securestorage.json @@ -323,25 +323,29 @@ "params": "SECURESTORAGE_SETFORAPP_WITH_EMPTY_KEY", "expected": "error" }, - "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_DEVICE1": { + "SET_SECURE_DATA_VALUE1_FOR_AN_APP_WITH_SCOPE_DEVICE": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_DEVICE1" + "params": "SECURESTORAGE_SETFORAPP_DEVICE_KEY1" }, - "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_DEVICE2": { + "SET_SECURE_DATA_VALUE2_FOR_AN_APP_WITH_SCOPE_DEVICE": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_DEVICE2" + "params": "SECURESTORAGE_SETFORAPP_DEVICE_KEY2" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_ACCOUNT": { "method": "manage_securestorage.setForApp", "params": "SECURESTORAGE_SETFORAPP_ACCOUNT" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_ACCOUNT1": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_ACCOUNT_KEY1" + }, + "SET_SECURE_DATA_VALUE1_FOR_AN_APP_WITH_SCOPE_ACCOUNT": { "method": "manage_securestorage.setForApp", "params": "SECURESTORAGE_SETFORAPP_ACCOUNT1" }, - "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_ACCOUNT2": { + "SET_SECURE_DATA_VALUE2_FOR_AN_APP_WITH_SCOPE_ACCOUNT": { "method": "manage_securestorage.setForApp", - "params": "SECURESTORAGE_SETFORAPP_ACCOUNT2" + "params": "SECURESTORAGE_SETFORAPP_ACCOUNT_KEY2" }, "SET_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_DEVICE_WITH_OPTIONAL_PARAMETER": { "method": "manage_securestorage.setForApp", @@ -419,9 +423,9 @@ "method": "manage_securestorage.removeForApp", "params": "SECURESTORAGE_REMOVEFORAPP_ACCOUNT" }, - "REMOVE_SECURE_DATA_VALUE_FOR_AN_APP_WITH_SCOPE_ACCOUNT1": { + "REMOVE_SECURE_DATA_VALUE1_FOR_AN_APP_WITH_SCOPE_ACCOUNT": { "method": "manage_securestorage.removeForApp", - "params": "SECURESTORAGE_REMOVEFORAPP_ACCOUNT1" + "params": "SECURESTORAGE_REMOVEFORAPP_ACCOUNT_KEY1" }, "GET_STORED_VALUE_FOR_AUTHTESTTOKENDEVICE_WITH_SCOPE_DEVICE": { "method": "securestorage.get", From 7a4e3ba438bf39165623e649d2897a6c3c280d51 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 28 Jun 2024 15:15:50 +0530 Subject: [PATCH 207/359] Reverted intent changes --- cypress/support/cypress-commands/commands.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 57b070b3..86cbac91 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -694,10 +694,7 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { }, }, }; - const messageIntent = { - data: data, - }; - requestMap.params.intent = messageIntent; + requestMap.params.intent.data = data; } // Add the PubSub URL if required From a53b0d6dd67615fdb4bca051bbd4f3f4e16b2552 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Fri, 28 Jun 2024 15:27:52 +0530 Subject: [PATCH 208/359] 2166 usergrants params, objects --- .../FireboltCertification/UserGrants.feature | 3 + .../fixtures/fireboltCalls/usergrants.json | 169 ++++++++++++++++++ cypress/fixtures/modules/usergrants.json | 12 ++ .../objects/validationObjects/usergrants.json | 150 ++++++++++++++++ 4 files changed, 334 insertions(+) diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature index aee9edfc..dd61d79e 100644 --- a/cypress/TestCases/FireboltCertification/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -42,6 +42,7 @@ Feature: UserGrants # Testing with grantPolicy having with scope device and grant access, so all the apps in that device may have the access # provide access using any 3rd party and check in another 3rd party + # Added @notSupported as glue is not implemented yet. @Usergrants @coreSDK @sdk @transport @notSupported Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capability Grant access with scope device Given the environment has been set up for 'userGrants' tests @@ -128,6 +129,7 @@ Feature: UserGrants # If lifespan value appActive it ask grant once when app is active and it ask again when app is closed and active again. # Case-1: Allowing grant when app is active and validating # Case-2: Closing and launching the app, allowing grant and validating ui is coming again + # Added @notSupported as glue is not implemented yet. @Usergrants @coreSDK @sdk @transport @notSupported Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan appActive Given the environment has been set up for 'userGrants' tests @@ -154,6 +156,7 @@ Feature: UserGrants # If lifespan value appActive it ask grant once when app is active and it ask again when app is closed and active again. # Case-1: Denying grant when app is active and validating # Case-2: Closing and launching the app, denying grant and validating ui is coming again + # Added @notSupported as glue is not implemented yet. @Usergrants @coreSDK @sdk @transport @notSupported Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan appActive Given the environment has been set up for 'userGrants' tests diff --git a/cypress/fixtures/fireboltCalls/usergrants.json b/cypress/fixtures/fireboltCalls/usergrants.json index 2281e5d8..82cc2b45 100644 --- a/cypress/fixtures/fireboltCalls/usergrants.json +++ b/cypress/fixtures/fireboltCalls/usergrants.json @@ -389,5 +389,174 @@ "GET_USERGRANTS_FOR_DEVICE_DISTRIBUTOR_CAPABILITY": { "method": "manage_usergrants.capability", "params": "USERGRANTS_DEVICE_DISTRIBUTOR" + }, + "USERGRANTS_CLEAR_APP_DEVICE_NAME_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_APP_DEVICE_NAME_ROLE_USE" + }, + "USERGRANTS_CLEAR_WITH_APP_LEVEL_DEVICE_ID_ROLE_USE_METHOD": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_WITH_APP_LEVEL_DEVICE_ID_ROLE_USE_METHOD" + }, + "USERGRANTS_CLEAR_APP_LEVEL_DEVICE_MODEL_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_APP_LEVEL_DEVICE_MODEL_ROLE_USE" + }, + "USERGRANTS_CLEAR_APP_LOCALIZATION_LANGUAGE_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_APP_LOCALIZATION_LANGUAGE_ROLE_USE" + }, + "USERGRANTS_CLEAR_APP_LOCALIZATION_LATLON_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_APP_LOCALIZATION_LATLON_ROLE_USE" + }, + "USERGRANTS_CLEAR_WITH_APP_ID_CLOSEDCAPTIONS": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_WITH_APP_ID_CLOSEDCAPTIONS" + }, + "USERGRANTS_CLEAR_WITH_APP_ID_AUTHENTICATION_DEVICE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_WITH_APP_ID_AUTHENTICATION_DEVICE" + }, + "USERGRANTS_CLEAR_WITH_APP_ID_SECONDSCREEN_DEVICE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_WITH_APP_ID_SECONDSCREEN_DEVICE" + }, + "USERGRANTS_CLEAR_WITH_APP_ID_PROTOCOL_DIAL": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_WITH_APP_ID_PROTOCOL_DIAL" + }, + "USERGRANTS_CLEAR_APP_DATA_APP_USAGE_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_APP_DATA_APP_USAGE_ROLE_USE" + }, + "USERGRANTS_CLEAR_WITH_APP_ID_VOICEGUIDANCE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_WITH_APP_ID_VOICEGUIDANCE" + }, + "USERGRANTS_CLEAR_DEVICE_LEVEL_DIVICE_DISTRIBUTOR_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_DEVICE_LEVEL_DIVICE_DISTRIBUTOR_ROLE_USE" + }, + "USERGRANTS_CLEAR_DEVICE_ACCOUNT_ID_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_DEVICE_ACCOUNT_ID_ROLE_USE" + }, + "USERGRANTS_CLEAR_APP_DEVICE_MAKE_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_APP_DEVICE_MAKE_ROLE_USE" + }, + "USERGRANTS_CLEAR_APP_POSTALCODE_ROLE_MANAGE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_APP_POSTALCODE_ROLE_MANAGE" + }, + "USERGRANTS_CLEAR_APP_POSTALCODE_ROLE_PROVIDE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_APP_POSTALCODE_ROLE_PROVIDE" + }, + "USERGRANTS_CLEAR_APP_POSTALCODE_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_APP_POSTALCODE_ROLE_USE" + }, + "USERGRANTS_CLEAR_APP_COUNTRY_CODE_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_APP_COUNTRY_CODE_ROLE_USE" + }, + "USERGRANTS_CLEAR_DEVICE_LEVEL_DISCOVERY_WATCHED": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_DEVICE_LEVEL_DISCOVERY_WATCHED" + }, + "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_USE_REFUI": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_USE_REFUI" + }, + "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_MANAGE_REFUI": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_MANAGE_REFUI" + }, + "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_PROVIDE_REFUI": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_PROVIDE_REFUI" + }, + "USERGRANTS_CLEAR_LIFESPAN_APPACTIVE_SECURESTORAGE_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_LIFESPAN_APPACTIVE_SECURESTORAGE_ROLE_USE" + }, + "USERGRANTS_CLEAR_LIFESPAN_APPACTIVE_SECURESTORAGE_ROLE_MANAGE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_LIFESPAN_APPACTIVE_SECURESTORAGE_ROLE_MANAGE" + }, + "USERGRANTS_CLEAR_APP_LOCALIZATION_LOCALITY_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_APP_LOCALIZATION_LOCALITY_ROLE_USE" + }, + "USERGRANTS_CLEAR_LOCALIZATION_LOCALE_ROLE_USE": { + "method": "manage_usergrants.clear", + "params": "USERGRANTS_CLEAR_LOCALIZATION_LOCALE_ROLE_USE" + }, + "REQUEST_GRANT_FOR_ACCOUNT_UID_CAPABILITY_WITH_ROLE_USE": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_ACCOUNT_UID_ROLE_USE" + }, + "GRANTED_FOR_ACCOUNT_UID_CAPABILITY_WITH_ROLE_USE": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "USERGRANTS_REQUEST_INFO_GRANTED_USE_GRANT" + }, + "REQUEST_GRANT_FOR_ACCOUNT_UID_CAPABILITY_WITH_ROLE_MANAGE": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_ACCOUNT_UID_ROLE_MANAGE" + }, + "GRANTED_FOR_ACCOUNT_UID_CAPABILITY_WITH_ROLE_MANAGE": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "USERGRANTS_REQUEST_INFO_GRANTED_MANAGE_GRANT" + }, + "DENIED_FOR_ACCOUNT_UID_CAPABILITY_WITH_ROLE_MANAGE": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "USERGRANTS_REQUEST_INFO_GRANTED_MANAGE_DENY" + }, + "DENIED_FOR_ACCOUNT_UID_CAPABILITY_WITH_ROLE_USE": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "USERGRANTS_REQUEST_INFO_GRANTED_USE_DENY" + }, + "REQUEST_GRANT_FOR_SECURE_STORAGE_CAPABILITY_WITH_ROLE_USE": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_SECURESTORAGE_SET_ROLE_USE" + }, + "GRANTED_FOR_SECURE_STORAGE_CAPABILITY_WITH_ROLE_USE": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "USERGRANTS_REQUEST_SECURESTORAGE_SET_GRANTED_ROLE_USE" + }, + "REQUEST_GRANT_FOR_DEVICE_INFO_CAPABILITY_WITH_ROLE_USE": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_DEVICE_INFO" + }, + "GRANTED_FOR_DEVICE_INFO_CAPABILITY_WITH_ROLE_USE": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "USERGRANTS_REQUEST_INFO_GRANTED_DEVICE_INFO" + }, + "DEFERRED_FOR_ACCOUNT_UID_CAPABILITY_WITH_ROLE_USE": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "USERGRANTS_REQUEST_INFO_GRANTED_DEFERRED_USE" + }, + "GRANTED_FOR_ACCOUNT_UID_CAPABILITY_WITH_ROLE_PROVIDE": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "USERGRANTS_REQUEST_INFO_GRANTED_ACCOUNT_UID_PROVIDE_GRANT" + }, + "DENIED_FOR_ACCOUNT_UID_CAPABILITY_WITH_ROLE_PROVIDE": { + "method": "usergrants.request", + "validationJsonPath": "result", + "content": "USERGRANTS_REQUEST_INFO_GRANTED_ACCOUNT_UID_PROVIDE_DENY" + }, + "REQUEST_GRANT_FOR_ACCOUNT_UID_CAPABILITY_WITH_ROLE_PROVIDE": { + "method": "manage_usergrants.request", + "params": "USERGRANTS_REQUEST_ACCOUNT_UID_ROLE_PROVIDE" } } \ No newline at end of file diff --git a/cypress/fixtures/modules/usergrants.json b/cypress/fixtures/modules/usergrants.json index ea6eba1f..0b76f2d9 100644 --- a/cypress/fixtures/modules/usergrants.json +++ b/cypress/fixtures/modules/usergrants.json @@ -141,5 +141,17 @@ }, "DEVICE_DISTRIBUTOR": { "capability": "xrn:firebolt:capability:device:distributor" + }, + "CLEAR_DEVICE_LEVEL_DIVICE_DISTRIBUTOR_ROLE_USE": { + "role": "use", + "capability": "xrn:firebolt:capability:device:distributor" + }, + "CLEAR_DEVICE_ACCOUNT_ID_ROLE_USE": { + "role": "use", + "capability": "xrn:firebolt:capability:account:id" + }, + "CLEAR_DEVICE_LEVEL_DISCOVERY_WATCHED": { + "role": "use", + "capability": "xrn:firebolt:capability:discovery:watched" } } \ No newline at end of file diff --git a/cypress/fixtures/objects/validationObjects/usergrants.json b/cypress/fixtures/objects/validationObjects/usergrants.json index 211b8220..d6633ab9 100644 --- a/cypress/fixtures/objects/validationObjects/usergrants.json +++ b/cypress/fixtures/objects/validationObjects/usergrants.json @@ -81,6 +81,156 @@ } ] } + ] + }, + "USERGRANTS_REQUEST_SECURESTORAGE_SET_GRANTED_ROLE_USE": { + "data": [ + { + "type": "miscellaneous", + "validations": [ + { + "method": "usergrants.request", + "type": "request", + "expected": [] + } + ] + }, + { + "type": "miscellaneous", + "validations": [ + { + "type": "request", + "specialValidationObject": [ + { + "method": "capabilities.info", + "validationPath": "result[0].use.granted", + "expected": null + }, + { + "method": "capabilities.info", + "validationPath": "result[0].manage.granted", + "expected": null, + "skipChecks": true + }, + { + "method": "capabilities.granted", + "validationPath": "result", + "expected": true, + "context": "CAPABILITIES_GRANTED_USE" + }, + { + "method": "capabilities.granted", + "validationPath": "result", + "expected": null, + "context": "CAPABILITIES_GRANTED_MANAGE", + "skipChecks": true + } + ] + } + ] + } + + + ] + }, + "USERGRANTS_REQUEST_INFO_GRANTED_DEVICE_INFO": { + "data": [ + { + "type": "miscellaneous", + "validations": [ + { + "method": "usergrants.request", + "type": "request", + "expected": [] + } + ] + }, + { + "type": "miscellaneous", + "validations": [ + { + "type": "request", + "specialValidationObject": [ + { + "method": "capabilities.info", + "validationPath": "result[0].use.granted", + "expected": null + }, + { + "method": "capabilities.info", + "validationPath": "result[0].manage.granted", + "expected": null, + "skipChecks": true + }, + { + "method": "capabilities.granted", + "validationPath": "result", + "expected": true, + "context": "CAPABILITIES_GRANTED_USE" + }, + { + "method": "capabilities.granted", + "validationPath": "result", + "expected": true, + "context": "CAPABILITIES_GRANTED_MANAGE", + "skipChecks": true + } + ] + } + ] + } + + + ] + }, + "USERGRANTS_REQUEST_INFO_GRANTED_DEFERRED_USE": { + "data": [ + { + "type": "miscellaneous", + "validations": [ + { + "method": "usergrants.request", + "type": "request", + "expected": [] + } + ] + }, + { + "type": "miscellaneous", + "validations": [ + { + "type": "request", + "specialValidationObject": [ + { + "method": "capabilities.info", + "validationPath": "result[0].use.granted", + "expected": null + }, + { + "method": "capabilities.info", + "validationPath": "result[0].manage.granted", + "expected": null, + "skipChecks": true + }, + { + "method": "capabilities.granted", + "validationPath": "result", + "expected": null, + "context": "CAPABILITIES_GRANTED_USE" + }, + { + "method": "capabilities.granted", + "validationPath": "result", + "expected": null, + "context": "CAPABILITIES_GRANTED_MANAGE", + "skipChecks": true + } + ] + } + ] + } + + ] } } \ No newline at end of file From 433c63ff8f7d932e6e031249920230cae9486077 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Fri, 28 Jun 2024 16:16:16 +0530 Subject: [PATCH 209/359] 2166 - Update requirement id --- .../objects/moduleReqId/moduleReqId.json | 246 +++--------------- 1 file changed, 43 insertions(+), 203 deletions(-) diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index c6441a8c..6606fc5d 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -683,71 +683,11 @@ } }, "UserGrants": { - "UserGrants.Capability - Positive Scenario: Validate Capabilities Grant access with two options, first option(with fingerprint) is not supported and second option(with pinChallenge and acknowledge) is supported": { - "req": [ - { - "method": { - "id": "UserGrants 1.1", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capability - Positive Scenario: Validate Capabilities Grant access with two options, first option(with pinChallenge and acknowledge) is supported and second option(with fingerprint) is not supported": { - "req": [ - { - "method": { - "id": "UserGrants 1.2", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capability - Positive Scenario: Validate Capabilities Grant access with role manage": { - "req": [ - { - "method": { - "id": "UserGrants 1.3", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capability - Positive Scenario: Validate Capabilities Grant access with role provide": { - "req": [ - { - "method": { - "id": "UserGrants 1.4", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capability - Negative Scenario: Validate Capabilities access denied for pinChallenge": { - "req": [ - { - "method": { - "id": "UserGrants 1.5", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capability - Negative Scenario: Validate Capabilities access denied for ackChallenge": { - "req": [ - { - "method": { - "id": "UserGrants 1.6", - "description": "Should not be null" - } - } - ] - }, "UserGrants.Grant - Positive Scenario: Validate Capabilities with denied (pinChallenge) and lifespan once": { "req": [ { "method": { - "id": "UserGrants 1.7", + "id": "UserGrants 1.1", "description": "Should not be null" } } @@ -757,7 +697,7 @@ "req": [ { "method": { - "id": "UserGrants 1.7", + "id": "UserGrants 1.2", "description": "Should not be null" } } @@ -767,7 +707,7 @@ "req": [ { "method": { - "id": "UserGrants 1.8", + "id": "UserGrants 1.3", "description": "Should not be null" } } @@ -777,7 +717,7 @@ "req": [ { "method": { - "id": "UserGrants 1.9", + "id": "UserGrants 1.4", "description": "Should not be null" } } @@ -787,7 +727,7 @@ "req": [ { "method": { - "id": "UserGrants 1.10", + "id": "UserGrants 1.5", "description": "Should not be null" } } @@ -797,7 +737,7 @@ "req": [ { "method": { - "id": "UserGrants 1.11", + "id": "UserGrants 1.6", "description": "Should not be null" } } @@ -807,7 +747,7 @@ "req": [ { "method": { - "id": "UserGrants 1.12", + "id": "UserGrants 1.7", "description": "Should not be null" } } @@ -817,7 +757,7 @@ "req": [ { "method": { - "id": "UserGrants 1.13", + "id": "UserGrants 1.8", "description": "Should not be null" } } @@ -827,7 +767,7 @@ "req": [ { "method": { - "id": "UserGrants 1.14", + "id": "UserGrants 1.9", "description": "Should not be null" } } @@ -837,7 +777,7 @@ "req": [ { "method": { - "id": "UserGrants 1.15", + "id": "UserGrants 1.10", "description": "Should not be null" } } @@ -847,7 +787,7 @@ "req": [ { "method": { - "id": "UserGrants 1.16", + "id": "UserGrants 1.11", "description": "Should not be null" } } @@ -857,7 +797,7 @@ "req": [ { "method": { - "id": "UserGrants 1.17", + "id": "UserGrants 1.12", "description": "Should not be null" } } @@ -867,7 +807,7 @@ "req": [ { "method": { - "id": "UserGrants 1.18", + "id": "UserGrants 1.13", "description": "Should not be null" } } @@ -877,17 +817,7 @@ "req": [ { "method": { - "id": "UserGrants 1.19", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capabilities - Negative Scenario: Validate Capability Without supported capability expecting error": { - "req": [ - { - "method": { - "id": "UserGrants 1.20", + "id": "UserGrants 1.14", "description": "Should not be null" } } @@ -897,7 +827,7 @@ "req": [ { "method": { - "id": "UserGrants 1.21", + "id": "UserGrants 1.15", "description": "Should not be null" } } @@ -907,7 +837,7 @@ "req": [ { "method": { - "id": "UserGrants 1.22", + "id": "UserGrants 1.16", "description": "Should not be null" } } @@ -917,7 +847,7 @@ "req": [ { "method": { - "id": "UserGrants 1.23", + "id": "UserGrants 1.17", "description": "Should not be null" } } @@ -927,7 +857,7 @@ "req": [ { "method": { - "id": "UserGrants 1.24", + "id": "UserGrants 1.18", "description": "Should not be null" } } @@ -937,7 +867,7 @@ "req": [ { "method": { - "id": "UserGrants 1.25", + "id": "UserGrants 1.19", "description": "Should not be null" } } @@ -947,7 +877,7 @@ "req": [ { "method": { - "id": "UserGrants 1.26", + "id": "UserGrants 1.20", "description": "Should not be null" } } @@ -957,7 +887,7 @@ "req": [ { "method": { - "id": "UserGrants 1.27", + "id": "UserGrants 1.21", "description": "Should not be null" } } @@ -967,7 +897,7 @@ "req": [ { "method": { - "id": "UserGrants 1.28", + "id": "UserGrants 1.22", "description": "Should not be null" } } @@ -977,7 +907,7 @@ "req": [ { "method": { - "id": "UserGrants 1.29", + "id": "UserGrants 1.23", "description": "Should not be null" } } @@ -987,7 +917,7 @@ "req": [ { "method": { - "id": "UserGrants 1.30", + "id": "UserGrants 1.24", "description": "Should not be null" } } @@ -997,7 +927,7 @@ "req": [ { "method": { - "id": "UserGrants 1.31", + "id": "UserGrants 1.25", "description": "Should not be null" } } @@ -1007,7 +937,7 @@ "req": [ { "method": { - "id": "UserGrants 1.32", + "id": "UserGrants 1.26", "description": "Should not be null" } } @@ -1017,7 +947,7 @@ "req": [ { "method": { - "id": "UserGrants 1.33", + "id": "UserGrants 1.27", "description": "Should not be null" } } @@ -1027,7 +957,7 @@ "req": [ { "method": { - "id": "UserGrants 1.34", + "id": "UserGrants 1.28", "description": "Should not be null" } } @@ -1037,7 +967,7 @@ "req": [ { "method": { - "id": "UserGrants 1.35", + "id": "UserGrants 1.29", "description": "Should not be null" } } @@ -1047,7 +977,7 @@ "req": [ { "method": { - "id": "UserGrants 1.36", + "id": "UserGrants 1.30", "description": "Should not be null" } } @@ -1057,57 +987,7 @@ "req": [ { "method": { - "id": "UserGrants 1.37", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capabilities - Positive Scenario: Validate Capability Allow grant for one API and all API's should have grant in group": { - "req": [ - { - "method": { - "id": "UserGrants 1.38", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capabilities - Positive Scenario: Validate Capability Allow grant for one API and clear grant, call another API it will ask for grant again": { - "req": [ - { - "method": { - "id": "UserGrants 1.39", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capabilities - Positive Scenario: Validate Capability Deny grant for one API and all API's shouldn't have grant in group": { - "req": [ - { - "method": { - "id": "UserGrants 1.40", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capability - Positive Scenario: AcknowledgeChallenge Grant is deferred by exiting overlay": { - "req": [ - { - "method": { - "id": "UserGrants 1.42", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capability - Positive Scenario: Acknowledgechallenge Grant is deferred based on the timeout (4 seconds)": { - "req": [ - { - "method": { - "id": "UserGrants 1.43", + "id": "UserGrants 1.31", "description": "Should not be null" } } @@ -1117,7 +997,7 @@ "req": [ { "method": { - "id": "UserGrants 1.44", + "id": "UserGrants 1.32", "description": "Should not be null" } } @@ -1127,47 +1007,7 @@ "req": [ { "method": { - "id": "UserGrants 1.45", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:true property:Privacy.allowWatchHistory silently grant": { - "req": [ - { - "method": { - "id": "UserGrants 1.46", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capabilities - Positive Scenario: Validate Capability permission in 2 diff devices": { - "req": [ - { - "method": { - "id": "UserGrants 1.57", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.request - Positive Scenario: Validate Capability.request granted(ackChallenge)": { - "req": [ - { - "method": { - "id": "UserGrants 1.49", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.request - Positive Scenario: Validate Capability.request Denied(ackChallenge)": { - "req": [ - { - "method": { - "id": "UserGrants 1.50", + "id": "UserGrants 1.33", "description": "Should not be null" } } @@ -1177,7 +1017,7 @@ "req": [ { "method": { - "id": "UserGrants 1.51", + "id": "UserGrants 1.34", "description": "Should not be null" } } @@ -1187,7 +1027,7 @@ "req": [ { "method": { - "id": "UserGrants 1.52", + "id": "UserGrants 1.35", "description": "Should not be null" } } @@ -1197,7 +1037,7 @@ "req": [ { "method": { - "id": "UserGrants 1.53", + "id": "UserGrants 1.36", "description": "Should not be null" } } @@ -1207,7 +1047,7 @@ "req": [ { "method": { - "id": "UserGrants 1.54", + "id": "UserGrants 1.37", "description": "Should not be null" } } @@ -1217,7 +1057,7 @@ "req": [ { "method": { - "id": "UserGrants 1.55", + "id": "UserGrants 1.38", "description": "Should not be null" } } @@ -1227,7 +1067,7 @@ "req": [ { "method": { - "id": "UserGrants 1.56", + "id": "UserGrants 1.39", "description": "Should not be null" } } @@ -1237,7 +1077,7 @@ "req": [ { "method": { - "id": "UserGrants 1.57", + "id": "UserGrants 1.40", "description": "Should not be null" } } @@ -1247,7 +1087,7 @@ "req": [ { "method": { - "id": "UserGrants 1.58", + "id": "UserGrants 1.41", "description": "Should not be null" } } @@ -1257,7 +1097,7 @@ "req": [ { "method": { - "id": "UserGrants 1.59", + "id": "UserGrants 1.41", "description": "Should not be null" } } @@ -1267,7 +1107,7 @@ "req": [ { "method": { - "id": "UserGrants 1.60", + "id": "UserGrants 1.43", "description": "Should not be null" } } From ca9ccd594d7fe48c5339b78f79baff797332a4ed Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Fri, 28 Jun 2024 16:31:57 +0530 Subject: [PATCH 210/359] 2166 pinchallenge mock value --- cypress/fixtures/fireboltMocks/profile.json | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 cypress/fixtures/fireboltMocks/profile.json diff --git a/cypress/fixtures/fireboltMocks/profile.json b/cypress/fixtures/fireboltMocks/profile.json new file mode 100644 index 00000000..ff85ffb8 --- /dev/null +++ b/cypress/fixtures/fireboltMocks/profile.json @@ -0,0 +1,28 @@ +{ + "PINCHALLENGE_CORRECT_PIN_WITH_UI": { + "method": "pinchallenge", + "response": [ + { + "pinText": "1111", + "isCancelled": false, + "withUi": true, + "maxAttempts": 3, + "noPinRequired": false, + "result": true + } + ] + }, + "PINCHALLENGE_WRONG_PIN_WITH_UI": { + "method": "pinchallenge", + "response": [ + { + "pinText": "5678", + "isCancelled": false, + "withUi": true, + "maxAttempts": 3, + "noPinRequired": false, + "result": false + } + ] + } +} \ No newline at end of file From 3bb8e4cf536f6b1891211868b32ceecba6eb7ed6 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 28 Jun 2024 18:48:42 +0530 Subject: [PATCH 211/359] FIRECERT-2157-minor changes --- .../FireboltCertification/Localization.feature | 6 +++--- cypress/fixtures/fireboltCalls/localization.json | 16 +++++++++++++++- cypress/fixtures/modules/localization.json | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Localization.feature b/cypress/TestCases/FireboltCertification/Localization.feature index 1430eb82..25328036 100644 --- a/cypress/TestCases/FireboltCertification/Localization.feature +++ b/cypress/TestCases/FireboltCertification/Localization.feature @@ -49,15 +49,15 @@ Feature: Localization Then 'Firebolt' platform responds to '1st party app' for '' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' + And 'Firebolt' platform triggers event '' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' + And 'Firebolt' platform triggers event '' Examples: | Methods | First_Event_Registration_Key | Second_Event_Registration_Key | Set_API_Key | First_Get_API_Key | Second_Get_API_Key | First_Method_Validation_Key | Second_Method_Validation_Key | First_Event_Validation_Key | Second_Event_Validation_Key | | Localization.locale and Localization.countrycode | localization onLocaleChanged | localization onCountryCodeChanged | set locale to enUK | get localization locale | get localization countrycode | enUK for localization locale | UK for localization countrycode | onlocalechanged for localization with enUK | oncountrycodechanged for localization with UK | - | Localization.locale and Localization.language | localization onLocaleChanged | localization onLanguageChanged | set locale to enUK | get localization locale | get localization language | enUK for localization locale | en for localization language | onlocalechanged for localization with enUK | onlanguagechanged for localization with en | + | Localization.locale and Localization.language | localization onLocaleChanged | localization onLanguageChanged | set locale to esUK | get localization locale | get localization language | esUK for localization locale | es for localization language | onlocalechanged for localization with esUK | onlanguagechanged for localization with es | @Localization @coreSDK @sdk @transport Scenario Outline: - Positive Scenario: Validate diff --git a/cypress/fixtures/fireboltCalls/localization.json b/cypress/fixtures/fireboltCalls/localization.json index a8d3d0cb..b4a659c1 100644 --- a/cypress/fixtures/fireboltCalls/localization.json +++ b/cypress/fixtures/fireboltCalls/localization.json @@ -124,7 +124,12 @@ "ENUK_FOR_LOCALIZATION_LOCALE": { "method": "localization.locale", "validationJsonPath": "result", - "content": "LOCALIZATION_LOCALE_UK" + "content": "LOCALIZATION_LOCALE_UK" + }, + "ESUK_FOR_LOCALIZATION_LOCALE": { + "method": "localization.locale", + "validationJsonPath": "result", + "content": "LOCALIZATION_LOCALE_UK_ES" }, "GET_LOCALIZATION_PREFERREDAUDIOLANGUAGES": { "method": "localization.preferredAudioLanguages" @@ -193,6 +198,10 @@ "method": "manage_localization.setLocale", "params": "LOCALIZATION_LOCALE_UK" }, + "SET_LOCALE_TO_ESUK": { + "method": "manage_localization.setLocale", + "params": "LOCALIZATION_LOCALE_UK_ES" + }, "SET_LANGUAGE_TO_ES": { "method": "manage_localization.setLanguage", "params": "LOCALIZATION_LANGUAGE_ES" @@ -259,6 +268,11 @@ "validationJsonPath": "eventResponse", "content": "LOCALIZATION_LOCALE_UK" }, + "ONLOCALECHANGED_FOR_LOCALIZATION_WITH_ESUK": { + "event": "localization.onLocaleChanged", + "validationJsonPath": "eventResponse", + "content": "LOCALIZATION_LOCALE_UK_ES" + }, "ONCOUNTRYCODECHANGED_FOR_LOCALIZATION_WITH_PH": { "event": "localization.onCountryCodeChanged", "validationJsonPath": "eventResponse", diff --git a/cypress/fixtures/modules/localization.json b/cypress/fixtures/modules/localization.json index 2772fd94..e49e4672 100644 --- a/cypress/fixtures/modules/localization.json +++ b/cypress/fixtures/modules/localization.json @@ -21,6 +21,7 @@ "LANGUAGE_ES": "es", "LOCALE": "en-US", "LOCALE_UK": "en-UK", + "LOCALE_UK_ES": "es-UK", "PREFERRED_AUDIO_LANGUAGES_VALUE_SPA_ENG":{"value": ["spa","eng"]}, "PREFERRED_AUDIO_LANGUAGES_VALUE_ENG_SPA":{"value": ["eng","spa"]}, "ADD_ADDITIONALINFO_RESPONSE_AS_STRING": {"defaultKey":"defaultValue="}, From 4c1b9313158b9cc729708c218bc11fe9d8065115 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 1 Jul 2024 11:09:10 +0530 Subject: [PATCH 212/359] addressed the comment --- cypress/support/step_definitions/fireboltCalls.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index d2839c7a..843c3291 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -561,7 +561,10 @@ Given( if (fireboltCallKey) { cy.getFireboltData(fireboltCallKey).then((fireboltData) => { fireboltCallObject = fireboltData; - UTILS.getEnvVariable('runtime').fireboltCall = fireboltData; + cy.wrap(UTILS.getEnvVariable('runtime')).then((object) => { + object.fireboltCall = fireboltData; + Cypress.env('runtime', object); + }); }); } else { fireboltCallObject = UTILS.getEnvVariable('runtime').fireboltCall; @@ -704,7 +707,10 @@ Given( if (fireboltCallKey) { cy.getFireboltData(fireboltCallKey).then((fireboltData) => { fireboltCallObject = fireboltData; - UTILS.getEnvVariable('runtime').fireboltCall = fireboltData; + cy.wrap(UTILS.getEnvVariable('runtime')).then((object) => { + object.fireboltCall = fireboltData; + Cypress.env('runtime', object); + }); }); } else { fireboltCallObject = UTILS.getEnvVariable('runtime').fireboltCall; From 9b750c947c7aacdc987d789e02f06132787b7096 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 1 Jul 2024 12:06:55 +0530 Subject: [PATCH 213/359] fixed lint issues --- cypress/support/step_definitions/fireboltCalls.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 95e9879c..875e5667 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -316,7 +316,7 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn action: action, task: CONSTANTS.TASK.REGISTEREVENT, }; - const appId = UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID); + const appId = UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID); // Assigning event_param env if param has empty object if (Object.keys(requestMap.params).length === 0) { // To Do :debug event_param issue by passing isrequired as false for getEnvVariable,need to debug further @@ -877,4 +877,4 @@ Given( fireLog.assert(false, `${sdk} SDK not Supported`); } } -); \ No newline at end of file +); From fc3f19aacfabfee72a5c4d7fddbd6d65b29b237c Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 1 Jul 2024 15:22:07 +0530 Subject: [PATCH 214/359] Initial commit --- .../support/step_definitions/fireboltCalls.js | 217 ++++++++++++++++++ .../support/step_definitions/fireboltCalls.md | 18 ++ 2 files changed, 235 insertions(+) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 89adc1c4..b02e2cbd 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -676,3 +676,220 @@ Given( } } ); + +/** + * @module fireboltCalls + * @function '(.+)' invokes the '(.+)' get API(?: '(.+)') + * @description Sending a message to platform or app to get a value + * @param {String} appId - app identifier. + * @param {String} sdk - sdk name. + * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. + * @example + * Given '1st party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS' + * Given '3rd party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS' + * Given '3rd party app' invokes the 'Firebolt' get API + * Given 'test_app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS' + */ +Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireboltCallKey) => { + if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { + let fireboltCallObject; + let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; + + // Creating runtime environment variable + if (!UTILS.getEnvVariable(CONSTANTS.RUNTIME, false)) { + Cypress.env(CONSTANTS.RUNTIME, {}); + } + + // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable + if (fireboltCallKey) { + cy.getFireboltData(fireboltCallKey).then((fireboltData) => { + fireboltCallObject = fireboltData; + cy.wrap(UTILS.getEnvVariable(CONSTANTS.RUNTIME)).then((object) => { + object.fireboltCall = fireboltData; + Cypress.env(CONSTANTS.RUNTIME, object); + }); + }); + } else { + fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; + fireboltCallObjectErrorMessage = + 'Unable to find the firebolt object in the runtime environment variable'; + } + + cy.then(() => { + // Failing the test when fireboltCall object not there + if (!fireboltCallObject) { + fireLog.assert(false, fireboltCallObjectErrorMessage); + } else { + let method = + typeof fireboltCallObject.method === CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.method() + : fireboltCallObject.method; + let param; + + // Extracting the parameter from the fireboltCall object + if (typeof fireboltCallObject.params === CONSTANTS.TYPE_FUNCTION) { + param = { value: fireboltCallObject.params() }; + } else if (typeof fireboltCallObject.params === CONSTANTS.TYPE_OBJECT) { + param = fireboltCallObject.params; + + // Iterating through the object and invoking it if it is a function + for (const key in param) { + if (typeof param[key] === CONSTANTS.TYPE_FUNCTION) { + param[key] = param[key](); + } + } + } else { + param = { value: fireboltCallObject.params }; + } + + const context = {}; + const expected = CONSTANTS.RESULT; + appId = + appId === CONSTANTS.THIRD_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.FIRST_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) + : appId; + let action = CONSTANTS.ACTION_CORE.toLowerCase(); + + // Splitting the method name if it contains an underscore and using the first part to determine the action that decides sdk. + if (method && method.includes('_')) { + action = method.split('_')[0]; + method = method.split('_')[1]; + } + + // If method and param are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(method, param)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } + + if (appId == UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { + const requestMap = { + method: method, + params: param, + action: action, + }; + + cy.log( + 'Call from 1st party App, method: ' + method + ' params: ' + JSON.stringify(param) + ); + cy.sendMessagetoPlatforms(requestMap).then((response) => { + if (response && typeof response == CONSTANTS.TYPE_OBJECT) { + // If error and the error message having 'Method not found' or 'Method not Implemented' mark the testcase as undefined. + if ( + response && + response.error && + response.error.message && + CONSTANTS.ERROR_LIST.includes(response.error.message) + ) { + if (UTILS.getEnvVariable(CONSTANTS.CERTIFICATION) == true) { + assert(false, `${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`); + } else { + cy.log(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`).then( + () => { + throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); + } + ); + } + } + + cy.updateResponseForFCS(method, param, response).then((updatedResponse) => { + // Create a deep copy to avoid reference mutation + const dataToBeCensored = _.cloneDeep(response); + + // Call the 'censorData' command to hide sensitive data + cy.censorData(method, dataToBeCensored).then((maskedResult) => { + cy.log(`Response from Firebolt platform: ${JSON.stringify(maskedResult)}`); + }); + + // Creating object with method name, param, and response etc and storing it in a global list for further validation. + const apiAppObject = new apiObject( + method, + param, + context, + updatedResponse, + expected, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + }); + } else { + cy.log(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); + } + }); + } else { + let isNotSupportedApi = false; + + if (UTILS.isScenarioExempted(method, param)) { + isNotSupportedApi = true; + } + if ( + Cypress.env(CONSTANTS.TEST_TYPE) && + Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE + ) { + cy.fetchLifecycleHistory(appId); + } + const communicationMode = UTILS.getCommunicationMode(); + const additionalParams = { + communicationMode: communicationMode, + action: action, + isNotSupportedApi: isNotSupportedApi, + }; + const params = { method: method, methodParams: param }; + + // Creating intent message using above details to send it to 3rd party app. + const intentMessage = UTILS.createIntentMessage( + CONSTANTS.TASK.CALLMETHOD, + params, + additionalParams + ); + + fireLog.info(`Call from ${appId}, method: ${method} params: ${JSON.stringify(param)}`); + if (Cypress.env(CONSTANTS.IS_RPC_ONLY)) { + fireLog.info( + `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` + ); + } + + // Adding additional details to created intent if any platform specific data is present in configModule. + cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { + const requestTopic = UTILS.getTopic(appId); + const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); + + // Sending message to 3rd party app. + cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { + if (!Cypress.env(CONSTANTS.IS_RPC_ONLY)) { + if (result === CONSTANTS.NO_RESPONSE) { + assert(false, CONSTANTS.NO_MATCHED_RESPONSE); + } + + result = JSON.parse(result); + + // Create a deep copy to avoid reference mutation + const dataToBeCensored = _.cloneDeep(result.report.apiResponse); + + // Call the 'censorData' command to hide sensitive data + cy.censorData(method, dataToBeCensored).then((maskedResult) => { + fireLog.info(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); + }); + + // Creating object with method name, param and response etc and storing it in a global list for further validation. + const apiAppObject = new apiObject( + method, + param, + context, + result.report, + expected, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + } + }); + }); + } + } + }); + } else { + fireLog.assert(false, `${sdk} SDK not Supported`); + } +}); diff --git a/cypress/support/step_definitions/fireboltCalls.md b/cypress/support/step_definitions/fireboltCalls.md index ea35c3a3..8e09a1c7 100644 --- a/cypress/support/step_definitions/fireboltCalls.md +++ b/cypress/support/step_definitions/fireboltCalls.md @@ -96,3 +96,21 @@ Note: Key name value is an object and it can contains data as below * `Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to invalid 'test'` * `Given '1st party app' invokes the 'Firebolt' API to set 'enable' to 'true'` + +## '(.+)' invokes the '(.+)' get API(?: '(.+)') + +### Purpose: Sending a message to platform or 3rd party app to get a value + +### Params: +| Param | Definition | +| --- | --- | +| appId | app identifier. | +| sdk | sdk name | +| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | + +### Examples: +* `And '1st party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` +* `And '3rd party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` +* `And '3rd party app' invokes the 'Firebolt' get API` +* `And 'test_app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` + From 8edbb9e2d20276c02a58ea175ece945de3fe873c Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 1 Jul 2024 15:31:56 +0530 Subject: [PATCH 215/359] Added mino change --- .../support/step_definitions/fireboltCalls.js | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index b02e2cbd..934fc80f 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -724,23 +724,10 @@ Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireb typeof fireboltCallObject.method === CONSTANTS.TYPE_FUNCTION ? fireboltCallObject.method() : fireboltCallObject.method; - let param; - - // Extracting the parameter from the fireboltCall object - if (typeof fireboltCallObject.params === CONSTANTS.TYPE_FUNCTION) { - param = { value: fireboltCallObject.params() }; - } else if (typeof fireboltCallObject.params === CONSTANTS.TYPE_OBJECT) { - param = fireboltCallObject.params; - - // Iterating through the object and invoking it if it is a function - for (const key in param) { - if (typeof param[key] === CONSTANTS.TYPE_FUNCTION) { - param[key] = param[key](); - } - } - } else { - param = { value: fireboltCallObject.params }; - } + let param = + fireboltCallObject.params && typeof fireboltCallObject.params === CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.params() + : fireboltCallObject.params; const context = {}; const expected = CONSTANTS.RESULT; From 0bed50969ba07df3f451bffc2ccff5bdd30cceab Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 1 Jul 2024 15:58:49 +0530 Subject: [PATCH 216/359] fixed lint issue --- cypress/support/step_definitions/fireboltCalls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 934fc80f..b9bb8a26 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -724,7 +724,7 @@ Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireb typeof fireboltCallObject.method === CONSTANTS.TYPE_FUNCTION ? fireboltCallObject.method() : fireboltCallObject.method; - let param = + const param = fireboltCallObject.params && typeof fireboltCallObject.params === CONSTANTS.TYPE_FUNCTION ? fireboltCallObject.params() : fireboltCallObject.params; From b52f4aa9a098d836d43895e225afc5ad94026aee Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Mon, 1 Jul 2024 17:20:04 +0530 Subject: [PATCH 217/359] Rpc-Only-NegativeTC-Fix addressed review comments --- .../Manage/AcknowledgeChallengeManage_RpcOnly.feature | 4 ++-- .../Manage/KeyboardManage_RpcOnly.feature | 8 ++++---- .../Manage/ProfileManage_RpcOnly.feature | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature index 369a5c83..43632fe0 100644 --- a/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/AcknowledgeChallengeManage_RpcOnly.feature @@ -1,4 +1,4 @@ - Feature: AcknowledgeChallenge_Manage_RpcOnly +Feature: AcknowledgeChallenge_Manage_RpcOnly # Note: Reboot required after running this feature file @@ -27,4 +27,4 @@ And Fetch response for 'acknowledgeChallenge onRequestChallenge' event from 1st party app And 1st party app invokes the 'Firebolt' API to 'send error from challenge provider' And Fetch response for 'localization countryCode' method from 3rd party app - Then 'Firebolt' platform responds with 'expected localization countryCode challengeError' \ No newline at end of file + Then 'Firebolt' platform responds with 'custom error' \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature index 8b778ff9..468a40ec 100644 --- a/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/KeyboardManage_RpcOnly.feature @@ -31,7 +31,7 @@ Feature: Keyboard_Manage_RpcOnly Then 'Firebolt' platform responds with '' Examples: - | Scenario | ManageEventName | EventName | MethodName | MethodParam | FocusMethod | MethodResponse | - | Validating rpc method | keyboard onRequestEmail manage | keyboard onRequestEmail | keyboard email | prompt the user for their email address with signin type | send error from email provider | entered email address provider error | - | Validating rpc method | keyboard onRequestStandard manage | keyboard onRequestStandard | keyboard standard | prompt the user for their username | send error from standard provider | entered username provider error | - | Validating rpc method | keyboard onRequestPassword manage | keyboard onRequestPassword | keyboard password | prompt the user for their password | send error from password provider | entered password provider error | \ No newline at end of file + | Scenario | ManageEventName | EventName | MethodName | MethodParam | FocusMethod | MethodResponse | + | Validating rpc method | keyboard onRequestEmail manage | keyboard onRequestEmail | keyboard email | prompt the user for their email address with signin type | send error from email provider | custom error | + | Validating rpc method | keyboard onRequestStandard manage | keyboard onRequestStandard | keyboard standard | prompt the user for their username | send error from standard provider | custom error | + | Validating rpc method | keyboard onRequestPassword manage | keyboard onRequestPassword | keyboard password | prompt the user for their password | send error from password provider | custom error | \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature index 60b806f8..57d8cec6 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ProfileManage_RpcOnly.feature @@ -24,4 +24,4 @@ Feature: Profile_Manage_RpcOnly And Fetch response for 'pinChallenge onRequestChallenge' event from 1st party app And 1st party app invokes the 'Firebolt' API to 'send error from pinchallenge provider' And Fetch response for 'profile approvePurchase' method from 3rd party app - Then 'Firebolt' platform responds with 'profile approvepurchase challengeError' \ No newline at end of file + Then 'Firebolt' platform responds with 'custom error' \ No newline at end of file From b4584278babc387bbbb007069768894247937b8d Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Tue, 2 Jul 2024 16:53:25 +0530 Subject: [PATCH 218/359] FIRECERT-2199: Fix for Testcase failing at Validation --- cypress/support/cypress-commands/lifecycle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 14cc49f2..9bba8dbd 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -180,7 +180,7 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent const pretext = CONSTANTS.HISTORY_VALIDATION_REQ + lifecycleHistoryRequirementId.history.id; cy.log( CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + - JSON.stringify(response.report.result._history._value) + JSON.stringify(response.result._history._value) ); // Extract app history value const appHistory = response.result._history._value; From 6ac063d19878334da32da9f518d12bc79113739b Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Tue, 2 Jul 2024 17:15:40 +0530 Subject: [PATCH 219/359] Lint Fix --- cypress/support/cypress-commands/lifecycle.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 9bba8dbd..1cf501ec 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -179,8 +179,7 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent ) { const pretext = CONSTANTS.HISTORY_VALIDATION_REQ + lifecycleHistoryRequirementId.history.id; cy.log( - CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + - JSON.stringify(response.result._history._value) + CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + JSON.stringify(response.result._history._value) ); // Extract app history value const appHistory = response.result._history._value; From a8a40dd5b7667a3df6694fb674e18dfc20e5da71 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Wed, 3 Jul 2024 11:50:40 +0530 Subject: [PATCH 220/359] Initial commit --- cypress/support/cypress-commands/commands.js | 8 +- cypress/support/cypress-support/src/utils.js | 4 +- .../support/step_definitions/fireboltCalls.js | 186 ++++++++++-------- 3 files changed, 111 insertions(+), 87 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 297ca6ae..effbe67b 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -649,7 +649,7 @@ Cypress.Commands.add('censorData', (method, response) => { * cy.launchApp('firebolt', 'foo') * cy.launchApp('certification', 'foo') */ -Cypress.Commands.add('launchApp', (appType, appCallSign) => { +Cypress.Commands.add('launchApp', (appType, appCallSign, deviceIdentifier) => { // use the firebolt command Discovery.launch to launch the app. If app id given, use the app id // else get the default app id from environment variable. @@ -660,7 +660,11 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { // if appType is certification, the appLaunch is for certification purposes. In such a case, discovery.launch should go with a basic intent that has the appId and the certification app role. // create the request map // basic intent to be sent to the app on launch - let requestMap = { method: CONSTANTS.DISCOVERY_LAUNCH, params: { appId: appId } }; + let requestMap = { + method: CONSTANTS.DISCOVERY_LAUNCH, + params: { appId: appId }, + deviceIdentifier: deviceIdentifier, + }; let appCategory, data; if (appType.toLowerCase() === CONSTANTS.CERTIFICATION) { appCategory = diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index b277598a..b67a4097 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -182,9 +182,9 @@ function overideParamsFromConfigModule(overrideParams) { * @description Function to fetch the required topics. */ -function getTopic(appIdentifier = null, operation = null) { +function getTopic(appIdentifier = null, operation = null, deviceIdentifier) { let topic; - let deviceMac = getEnvVariable(CONSTANTS.DEVICE_MAC); + let deviceMac = deviceIdentifier ? deviceIdentifier : getEnvVariable(CONSTANTS.DEVICE_MAC); if (deviceMac.length <= 5 || !deviceMac || deviceMac == undefined) { assert( false, diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 49b43178..0b602113 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -113,100 +113,120 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = * Given 'test.test.test' invokes the 'Firebolt' API to 'get device id' * Given 'secondary 3rd party app' invokes the 'Firebolt' API to 'get device id' */ -Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { - // Fetching the data like method, param, context and action etc. - cy.fireboltDataParser(key, sdk).then((parsedDataArr) => { - parsedDataArr.forEach((parsedData) => { - // If appId is having '3rd party app' taking default appId else using the value as-is. - appId = !appId +Given( + /'(.+)' invokes the '(.+)' API to '(.+)'(?: on '(.+)' device)?$/, + async (appId, sdk, key, deviceIdentifier) => { + // If appId is having '3rd party app' taking default appId else using the value as-is. + appId = !appId + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.THIRD_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : appId === CONSTANTS.THIRD_PARTY_APP - ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : UTILS.checkForSecondaryAppId(appId); - const method = parsedData.method; - const param = parsedData.params; - const context = parsedData.context; - const action = parsedData.action; - const expected = parsedData.expected; - let isNotSupportedApi = false; - - if (UTILS.isScenarioExempted(method, param)) { - isNotSupportedApi = true; - } - if ( - Cypress.env(CONSTANTS.TEST_TYPE) && - Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE - ) { - cy.fetchLifecycleHistory(appId); - } - const communicationMode = UTILS.getCommunicationMode(); - const additionalParams = { - communicationMode: communicationMode, - action: action, - isNotSupportedApi: isNotSupportedApi, - }; - const params = { method: method, methodParams: param }; - - // Creating intent message using above details to send it to 3rd party app. - const intentMessage = UTILS.createIntentMessage( - CONSTANTS.TASK.CALLMETHOD, - params, - additionalParams - ); - - fireLog.info(`Call from ${appId}, method: ${method} params: ${JSON.stringify(param)}`); - if (Cypress.env('isRpcOnlyValidation')) { - fireLog.info( - `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` + : UTILS.checkForSecondaryAppId(appId); + + // Unable to find the ${envAppIdKey} value in the env, please add the value in configModule/constants/config.json + cy.then(() => { + if (deviceIdentifier && !UTILS.getEnvVariable(deviceIdentifier, false)) { + fireLog.assert( + false, + `Unable to find the ${deviceIdentifier} envitonment value, Verify the value of ${deviceIdentifier} in configModule or cli command.}` ); + } else if (deviceIdentifier && UTILS.getEnvVariable(deviceIdentifier, false)) { + deviceIdentifier = UTILS.getEnvVariable(deviceIdentifier, false); + cy.launchApp(CONSTANTS.CERTIFICATION, appId, deviceIdentifier); } + }).then(() => { + const requestTopic = UTILS.getTopic(appId, null, deviceIdentifier); + const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE, deviceIdentifier); + + // Fetching the data like method, param, context and action etc. + cy.fireboltDataParser(key, sdk).then((parsedDataArr) => { + parsedDataArr.forEach((parsedData) => { + const method = parsedData.method; + const param = parsedData.params; + const context = parsedData.context; + const action = parsedData.action; + const expected = parsedData.expected; + let isNotSupportedApi = false; + + if (UTILS.isScenarioExempted(method, param)) { + isNotSupportedApi = true; + } + if ( + Cypress.env(CONSTANTS.TEST_TYPE) && + Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE + ) { + cy.fetchLifecycleHistory(appId); + } + const communicationMode = UTILS.getCommunicationMode(); + const additionalParams = { + communicationMode: communicationMode, + action: action, + isNotSupportedApi: isNotSupportedApi, + }; + const params = { method: method, methodParams: param }; - // Adding additional details to created intent if any platform specific data is present in configModule. - cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { - const requestTopic = UTILS.getTopic(appId); - const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); + // Creating intent message using above details to send it to 3rd party app. + const intentMessage = UTILS.createIntentMessage( + CONSTANTS.TASK.CALLMETHOD, + params, + additionalParams + ); - // Sending message to 3rd party app. - cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { - if (!Cypress.env('isRpcOnlyValidation')) { - if (result === CONSTANTS.NO_RESPONSE) { - assert(false, CONSTANTS.NO_MATCHED_RESPONSE); - } - result = JSON.parse(result); - cy.updateResponseForFCS(method, params, result).then((updatedResponse) => { - // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(result); - - // Call the 'censorData' command to hide sensitive data - cy.censorData(method, dataToBeCensored).then((maskedResult) => { - const responseType = result.error ? CONSTANTS.ERROR : CONSTANTS.RESULT; - fireLog.info( - `Response from ${appId}: ${JSON.stringify(maskedResult[responseType])}` - ); - }); + fireLog.info( + `Call from app: ${appId}, device: ${deviceIdentifier} - method: ${method} params: ${JSON.stringify(param)}` + ); + if (Cypress.env('isRpcOnlyValidation')) { + fireLog.info( + `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` + ); + } - // If method and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(method, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + // Adding additional details to created intent if any platform specific data is present in configModule. + cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { + // Sending message to 3rd party app. + cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { + if (!Cypress.env('isRpcOnlyValidation')) { + if (result === CONSTANTS.NO_RESPONSE) { + assert(false, CONSTANTS.NO_MATCHED_RESPONSE); + } + result = JSON.parse(result); + cy.updateResponseForFCS(method, params, result).then((updatedResponse) => { + // Create a deep copy to avoid reference mutation + const dataToBeCensored = _.cloneDeep(result); + + // Call the 'censorData' command to hide sensitive data + cy.censorData(method, dataToBeCensored).then((maskedResult) => { + const responseType = result.error ? CONSTANTS.ERROR : CONSTANTS.RESULT; + fireLog.info( + `Response from app: ${appId}, device: ${deviceIdentifier} - ${JSON.stringify(maskedResult[responseType])}` + ); + }); + + // If method and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(method, param)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } + + // Creating object with method name, params and response etc and storing it in a global list for further validation. + const apiAppObject = new apiObject( + method, + param, + context, + updatedResponse, + expected, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + }); } - - // Creating object with method name, params and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - method, - param, - context, - updatedResponse, - expected, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); }); - } + }); }); }); }); - }); -}); + } +); + /** * @module fireboltCalls * @function And '(.+)' registers for the '(.+)' event using the '(.+)' API From c4c72fab71c074df77c0943579d9e15a1a610ccf Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Wed, 3 Jul 2024 16:29:36 +0530 Subject: [PATCH 221/359] foreground Testcase fix --- cypress/support/cypress-commands/commands.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 297ca6ae..0f6b7604 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -699,7 +699,11 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { }, }, }; - requestMap.params.intent.data = data; + const messageIntent = { + action: CONSTANTS.SEARCH, + data: data, + }; + requestMap.params.intent = messageIntent; } // Add the PubSub URL if required From dca5b33fd31d50ee00dc3603b7d1a853cc3874c8 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Wed, 3 Jul 2024 16:41:41 +0530 Subject: [PATCH 222/359] Lint fix --- cypress/support/cypress-commands/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 0f6b7604..48e9bc31 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -699,7 +699,7 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { }, }, }; - const messageIntent = { + const messageIntent = { action: CONSTANTS.SEARCH, data: data, }; From c9b90a7b7c2e8a085eb2de7e12daf5bba079944b Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Wed, 3 Jul 2024 19:31:26 +0530 Subject: [PATCH 223/359] FIRECERT-2112 Proper logs and error messages --- .../{ => PreRequisite}/SetDefaultValues.md | 0 cypress/support/constants/constants.js | 2 ++ cypress/support/cypress-commands/assertion.js | 34 ++++++++----------- .../support/step_definitions/fireboltCalls.js | 8 +++-- .../advertisingMiscValidation.js | 25 +++++++++----- 5 files changed, 38 insertions(+), 31 deletions(-) rename cypress/TestCases/FireboltCertification/{ => PreRequisite}/SetDefaultValues.md (100%) diff --git a/cypress/TestCases/FireboltCertification/SetDefaultValues.md b/cypress/TestCases/FireboltCertification/PreRequisite/SetDefaultValues.md similarity index 100% rename from cypress/TestCases/FireboltCertification/SetDefaultValues.md rename to cypress/TestCases/FireboltCertification/PreRequisite/SetDefaultValues.md diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 7572448a..ae756ffe 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -94,6 +94,7 @@ module.exports = { EMAIL: 'email', ENV_PLATFORM_SDK_VERSION: 'platformSdkVersion', ERROR: 'error', + ERROR_CODE: 'Error Code ', ERROR_CONTENT_JSON_PATH: 'objects/errorObjects/errorContent.json', ERROR_CONTENT_OBJECTS_PATH: 'cypress/fixtures/objects/errorObjects/errorContent.json', ERROR_EXPECTED: 'Expected response.error not to be null', @@ -102,6 +103,7 @@ module.exports = { ERROR_INSIDE_RESULT_CHECK: 'Error inside Result check', ERROR_LIFECYCLE_STATE_VALIDATION: 'Lifecycle state validation failed due to following error - ', ERROR_LIST: ['Method not found', 'Method Not Implemented'], + ERROR_MESSAGE_VALIDATION: 'Error Message Validation: ', ERROR_NOT_UNDEFINED_CHECK: 'Error not undefined Check', ERROR_NULL_CHECK: 'Error null Check', ERROR_SCHEMA_OBJECTS_PATH: 'cypress/fixtures/objects/errorObjects/errorSchemaObject.json', diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index b943eb6d..408a99af 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -125,21 +125,26 @@ Cypress.Commands.add( appId, validationType ); + console.log('entered apiOrEventObject >>> ', apiOrEventObject); + // if(apiOrEventObject && apiOrEventObject.eventListenerResponse && apiOrEventObject.eventListenerResponse.error){ + + // } const apiErrorResponse = validationType == CONSTANTS.EVENT ? apiOrEventObject.eventListenerResponse.error : apiOrEventObject.apiResponse.error; - fireLog.include( + assert.include( errorContentObject.errorCode, apiErrorResponse.code, CONSTANTS.ERROR_CODE ); - const checkErrorMessage = errorContentObject.errorMessage.some((errorMessage) => apiErrorResponse.message.includes(errorMessage) ); - fireLog.equal(checkErrorMessage, true, 'Error Message Validation: '); + const pretext = + CONSTANTS.ERROR_MESSAGE_VALIDATION + 'Expected ' + checkErrorMessage + ' to be true'; + fireLog.equal(checkErrorMessage, true, pretext); }); } else { fireLog.assert(false, `Expected error content not found in ${errorContentFilePath}`); @@ -231,18 +236,6 @@ Cypress.Commands.add( ? (isNullCheckSkipped = true) : (isNullCheckSkipped = false); } - - // Checking if the error is null in the response and if the error is expected or not. - if (!UTILS.getEnvVariable(CONSTANTS.IS_SCENARIO_EXEMPTED, false)) { - cy.errorNullCheck(response, errorExpected, isNullCheckSkipped).then((result) => { - validationCheck.push(result); - }); - } - }); - } else { - // Checking if the error is null in the response and if the error is expected or not. - cy.errorNullCheck(response, errorExpected).then((result) => { - validationCheck.push(result); }); } }) @@ -605,10 +598,11 @@ Cypress.Commands.add( } else { expected = eval('extractEventObject.' + verifyPath); } - const expectedValue = expected; - const actualValue = actual; - typeof expected == 'object' ? (expected = JSON.stringify(expected)) : expected; - typeof actual == 'object' ? (actual = JSON.stringify(actual)) : actual; + let expectedValue = expected; + let actualValue = actual; + typeof expected == 'object' ? (expectedValue = JSON.stringify(expected)) : expected; + typeof actual == 'object' ? (actualValue = JSON.stringify(actual)) : actual; + pretext = pretext + ' expected ' + actualValue + ' to be ' + expectedValue; fireLog.deepEqual(expectedValue, actualValue, pretext); } ); @@ -639,7 +633,7 @@ Cypress.Commands.add( fireLog.info('Event Received Check : ' + eventReceivedCheck); fireLog.info('Event Schema Check : ' + schemaCheck); - fireLog.info('Event Content Check : ' + contentCheck); + // fireLog.info('Event Content Check : ' + contentCheck); } ); diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 49b43178..9cc7a710 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -390,13 +390,15 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn /** * @module fireboltCalls - * @function And I clear '(.+)' listeners + * @function And (3rd party|1st party) stops listening to the event '(.+)' * @description sending message to platform/third party App to clear event listener. + * @param {String} app - value to determine 1st party or 3rd party. * @param {String} key - key name of the data contains event name and parameter. * @example - * And I clear 'clear accessibility.onClosedCaptionsSettingsChanged' listeners + * And '1st party' stops listening to the event 'accessibility.onClosedCaptionsSettingsChanged' + * And '3rd party' stops listening to the event 'accessibility.onClosedCaptionsSettingsChanged' */ -Given(/I clear '(.+)' listeners$/, async (key) => { +Given(/(3rd party|1st party) stops listening to the event '(.+)'$/, async (app, key) => { key = key.replaceAll(' ', '_').toUpperCase(); cy.getFireboltData(key, CONSTANTS.SUPPORTED_CALLTYPES.FIREBOLTMOCKS).then((parsedData) => { // Check if parsedData is an array or an object diff --git a/cypress/support/validations/moduleValidations/advertisingMiscValidation.js b/cypress/support/validations/moduleValidations/advertisingMiscValidation.js index 9558fd32..2c1cb988 100644 --- a/cypress/support/validations/moduleValidations/advertisingMiscValidation.js +++ b/cypress/support/validations/moduleValidations/advertisingMiscValidation.js @@ -51,10 +51,7 @@ function validateAdvertisingAdvertisingId(method, validationTypeObject, apiOrEve const pretext = `${CONSTANTS.METHOD_CONTENT} for ${method} method : `; // Ifa is an advertising identifier and it should not be empty. - cy.log( - `${pretext} Ifa is not null or undefined: *******`, - 'validateAdvertisingAdvertisingId' - ).then(() => { + cy.log(`${pretext} Ifa is not null or undefined`, 'validateAdvertisingAdvertisingId').then(() => { assert.exists(response.ifa, `${pretext} : Is not null or undefined`); }); @@ -62,7 +59,10 @@ function validateAdvertisingAdvertisingId(method, validationTypeObject, apiOrEve case CONSTANTS.LIMITADTRACKING_ON: // lmt value equal to 1 when limitAdTracking is on cy.log( - `${pretext} Lmt equal to be 1: ` + response.lmt, + `${pretext} Expected Lmt value ` + + response.lmt + + ` equal to be ` + + CONSTANTS.ADVERTISING_LIMITIADTRACKING_ON_LMT, 'validateAdvertisingAdvertisingId' ).then(() => { assert.equal( @@ -73,7 +73,10 @@ function validateAdvertisingAdvertisingId(method, validationTypeObject, apiOrEve }); if (response.ifa_type) { cy.log( - `${pretext} Ifa_type equal to be sessionId : ` + response.ifa_type, + `${pretext} Expected Ifa_type value ` + + response.ifa_type + + ` equal to be ` + + CONSTANTS.ADVERTISINGID_LIMITIADTRACKING_ON_IFA_TYPE, 'validateAdvertisingAdvertisingId' ).then(() => { assert.equal( @@ -87,7 +90,10 @@ function validateAdvertisingAdvertisingId(method, validationTypeObject, apiOrEve case CONSTANTS.LIMITADTRACKING_OFF: // lmt value equal to 0 when limitAdTracking is off cy.log( - `${pretext} Lmt equal to be 0 : ` + response.lmt, + `${pretext} Expected Lmt value ` + + response.lmt + + ` equal to be ` + + CONSTANTS.ADVERTISING_LIMITIADTRACKING_OFF_LMT, 'validateAdvertisingAdvertisingId' ).then(() => { assert.equal( @@ -98,7 +104,10 @@ function validateAdvertisingAdvertisingId(method, validationTypeObject, apiOrEve }); if (response.ifa_type) { cy.log( - `${pretext} Ifa_type equal to be sessionId: ` + response.ifa_type, + `${pretext} Expected Ifa_type value ` + + response.ifa_type + + ` equal to be ` + + CONSTANTS.ADVERTISINGID_LIMITIADTRACKING_OFF_IFA_TYPE, 'validateAdvertisingAdvertisingId' ).then(() => { assert.equal( From 486302ce6cbcd0a24a7b469c4112d9adc5717102 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Wed, 3 Jul 2024 19:45:58 +0530 Subject: [PATCH 224/359] update key name --- cypress/fixtures/fireboltCalls/usergrants.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cypress/fixtures/fireboltCalls/usergrants.json b/cypress/fixtures/fireboltCalls/usergrants.json index 82cc2b45..03402ccd 100644 --- a/cypress/fixtures/fireboltCalls/usergrants.json +++ b/cypress/fixtures/fireboltCalls/usergrants.json @@ -103,7 +103,7 @@ }, "GET_USERGRANTS_FOR_3RD_PARTY_APP": { "method": "manage_usergrants.app", - "params": "USERGRANTS_COMCAST_TEST_FIRECERT" + "params": "USERGRANTS_3RD_PARTY_APP" }, "EXPECTED_LIST_OF_GRANTS_FOR_3RD_PARTY_APP": { "method": "usergrants.app", @@ -466,17 +466,17 @@ "method": "manage_usergrants.clear", "params": "USERGRANTS_CLEAR_DEVICE_LEVEL_DISCOVERY_WATCHED" }, - "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_USE_REFUI": { + "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_USE": { "method": "manage_usergrants.clear", - "params": "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_USE_REFUI" + "params": "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_USE" }, - "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_MANAGE_REFUI": { + "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_MANAGE": { "method": "manage_usergrants.clear", - "params": "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_MANAGE_REFUI" + "params": "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_MANAGE" }, - "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_PROVIDE_REFUI": { + "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_PROVIDE": { "method": "manage_usergrants.clear", - "params": "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_PROVIDE_REFUI" + "params": "USERGRANTS_CLEAR_LIFESPAN_FOREVER_ACCOUNT_UID_ROLE_PROVIDE" }, "USERGRANTS_CLEAR_LIFESPAN_APPACTIVE_SECURESTORAGE_ROLE_USE": { "method": "manage_usergrants.clear", From af2a1f2e1c2877101faea2d5c17b288afb3a5eb2 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Wed, 3 Jul 2024 19:54:40 +0530 Subject: [PATCH 225/359] added @requiresPlatformImplementation tag --- .../Manage/UserGrantsManage.feature | 22 +++--- .../FireboltCertification/UserGrants.feature | 70 +++++++++---------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature b/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature index 1c8dc8ff..885ad2a3 100644 --- a/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature @@ -1,7 +1,7 @@ Feature: UserGrants_Manage # First allowing the grant and calling usergrants.app then checking grant using Capabilities.granted - @Usergrants @manageSDK @sdk @transport + @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario: Usergrants.app - Positive Scenario: with grant(ackchallenge) Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -16,7 +16,7 @@ Feature: UserGrants_Manage Then 'Firebolt' platform responds with 'true for capabilities granted' # First allowing the grant for device.distributor for the device and calling usergrants.device and validating. - @Usergrants @manageSDK @sdk @transport + @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario: Usergrants.device - Positive Scenario: with grant(ackchallenge) Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -29,7 +29,7 @@ Feature: UserGrants_Manage Then 'Firebolt' platform responds to '1st party app' with 'expected list of grants for device' # First allowing the grant and calling usergrants.capability then checking grant using Capabilities.granted - @Usergrants @manageSDK @sdk @transport + @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario: Usergrants.capability - Positive Scenario: with grant(ackchallenge) Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -43,7 +43,7 @@ Feature: UserGrants_Manage When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' Then 'Firebolt' platform responds with 'true for capabilities granted' - @Usergrants @manageSDK @sdk @transport + @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Usergrants. - Positive Scenario: Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -59,7 +59,7 @@ Feature: UserGrants_Manage | deny capability at device level | deny device distributor capability | null for usergrants deny | get usergrants for device | expected list of denied grants for device | deny | | deny capability at app level | deny device id capability | null for usergrants deny | get usergrants for 3rd party app | expected list of denied grants for 3rd party app | deny | - @Usergrants @manageSDK @sdk @transport + @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Usergrants.clear - Positive Scenario: Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -81,7 +81,7 @@ Feature: UserGrants_Manage | clear grant at device app for role use | fetch device id | get usergrants for 3rd party app | expected list of grants for 3rd party app | clear device id capability | empty array for usergrants device id | # here requesting a grant for device id for the role use - @Usergrants @manageSDK @sdk @transport + @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario: Usergrants.request - Positive Scenario: requesting for grant without force params, with force=true Given the environment has been set up for 'userGrants' tests And Framework registers 'pinChallenge' test provider @@ -101,7 +101,7 @@ Feature: UserGrants_Manage Then 'Firebolt' platform responds to '1st party app' with 'denied for usergrants country code capability' # here requesting a grant for device id for the role use - @Usergrants @manageSDK @sdk @transport + @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario: Usergrants.request - Positive Scenario: requesting for grant without force params, with force=true and force=false Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider @@ -121,7 +121,7 @@ Feature: UserGrants_Manage When 1st party app invokes the 'Firebolt' API to 'get 3rd party app grants' Then 'Firebolt' platform responds to '1st party app' with 'denied for usergrants country code capability' - @Usergrants @manageSDK @sdk @transport + @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Usergrants. - Negative Scenario: expecting error Given the environment has been set up for 'userGrants' tests When 1st party app invokes the 'Firebolt' API to '' @@ -134,7 +134,7 @@ Feature: UserGrants_Manage | with integer capability | get usergrants capability with invalid type integer capability parameter | invalid parameter for usergrants capability | capability | | with boolean capability | get usergrants capability with invalid type boolean capability parameter | invalid parameter for usergrants capability | capability | - @Usergrants @manageSDK @sdk @transport + @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Usergrants. - Negative Scenario: expecting error Given the environment has been set up for 'userGrants' tests When 1st party app invokes the 'Firebolt' API to '' @@ -157,7 +157,7 @@ Feature: UserGrants_Manage | invalid capability | request | get usergrants request with invalid capability parameter | invalid parameter for usergrants request | | invalid appId | request | get usergrants request with invalid options appId parameter | invalid parameter for usergrants request | - @Usergrants @manageSDK @sdk @transport + @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capability - Positive Scenario: by clearing the grant and validating usergrants.capability as empty Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -173,7 +173,7 @@ Feature: UserGrants_Manage When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device distributor' Then 'Firebolt' platform responds with 'null for capabilities granted' - @Usergrants @manageSDK @sdk @transport + @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario: Usergrants.app - Positive Scenario: by clearing the grant and validating usergrants.app as empty Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature index dd61d79e..6c8ad526 100644 --- a/cypress/TestCases/FireboltCertification/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -3,7 +3,7 @@ Feature: UserGrants # If lifespan value is set to once, grant is requested for every attempt. # Case-1: Validating by allowing the grant # Case-2: Validating by denying the grant (using pinchallenge and acknowledge). - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Grant - Positive Scenario: Validate Capabilities with denied (pinChallenge) and lifespan once Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -27,7 +27,7 @@ Feature: UserGrants Then User validates lifecycle history for '3rd party app' with 'background:foreground' # Testing with grantPolicy having one option with one step(here step with acknowledge) - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capability Grant access with one step option(only acknowledgeChallenge) Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -43,7 +43,7 @@ Feature: UserGrants # Testing with grantPolicy having with scope device and grant access, so all the apps in that device may have the access # provide access using any 3rd party and check in another 3rd party # Added @notSupported as glue is not implemented yet. - @Usergrants @coreSDK @sdk @transport @notSupported + @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capability Grant access with scope device Given the environment has been set up for 'userGrants' tests # 3rd party app @@ -63,7 +63,7 @@ Feature: UserGrants # Deny access with scope device, so all the apps in that device may not have the access # launch a 3rd party and provide acess using any 3rd party and check in another 3rd party - @Usergrants @coreSDK @sdk @transport @notSupported + @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capability access denied for pinChallenge with scope device Given the environment has been set up for 'userGrants' tests # 3rd party app @@ -83,7 +83,7 @@ Feature: UserGrants # If lifespan value forever only once ask for grant until we clear the given grant # Case-1: Allowing the grant and validating the result # Case-2: Checking the lifecycle history to check ui is not coming and validating for result because already allowed grant in Case-1. - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan forever Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -106,7 +106,7 @@ Feature: UserGrants # If lifespan value forever only once ask for grant until we clear the given grant # Case-1: Denying the grant and validating for error # Case-2: Checking the lifecycle history to check ui is not coming and calling postal code and validating for error because already denied grant in Case-1. - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan forever Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -130,7 +130,7 @@ Feature: UserGrants # Case-1: Allowing grant when app is active and validating # Case-2: Closing and launching the app, allowing grant and validating ui is coming again # Added @notSupported as glue is not implemented yet. - @Usergrants @coreSDK @sdk @transport @notSupported + @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan appActive Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -157,7 +157,7 @@ Feature: UserGrants # Case-1: Denying grant when app is active and validating # Case-2: Closing and launching the app, denying grant and validating ui is coming again # Added @notSupported as glue is not implemented yet. - @Usergrants @coreSDK @sdk @transport @notSupported + @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan appActive Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -185,7 +185,7 @@ Feature: UserGrants # Case-1: Allowing grant and validating the result # Case-2: Calling the API again within the ttl and it should not ask for grant # Case-3: Calling API after ttl, here it will ask grant again - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (ackchallenge) and lifespan:seconds lifespanTtl:60 sec Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -218,7 +218,7 @@ Feature: UserGrants # Case-1: Denying grant and validating the error # Case-2: Calling the API again within the ttl and it should not ask for grant # Case-3: Calling API after ttl, here it will ask for grant again - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (ackchallenge) and lifespan:seconds lifespanTtl:60 sec Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -250,7 +250,7 @@ Feature: UserGrants # If lifespan value seconds, after giving the grant it should not ask grant within ttl and it ask after the ttl # Case-1: Allowing grant and validating the result # Case-2: Before ttl ends rebooting the device and on calling api, it should return result without asking for grant - @Usergrants @coreSDK @sdk @transport @notSupported + @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with grant(pinChallenge) and lifespan:seconds lifespanTtl:800sec - after reboot within ttl it should not ask for grant Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -279,7 +279,7 @@ Feature: UserGrants # If lifespan value seconds, after giving the grant it should not ask grant within ttl and it ask after the ttl # Case-1: Allowing grant and validating the result # Case-2: Reboot the device after ttl, after reboot when API is called again and asks for grant, then deny grant - @Usergrants @coreSDK @sdk @transport @notSupported + @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with grant(ackchallenge) and lifespan:seconds lifespanTtl:60sec - reboot after ttl and it should ask grant Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -310,7 +310,7 @@ Feature: UserGrants # If lifespan value seconds, after giving the grant it should not ask grant within ttl and it ask after the ttl # Case-1: Deny grant and validate error # Case-2: Before ttl ends rebooting the device, call api and expect to return result without asking for grant - @Usergrants @coreSDK @sdk @transport @notSupported + @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan:seconds lifespanTtl:800sec - after reboot within ttl and it should not ask grant Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -339,7 +339,7 @@ Feature: UserGrants # With lifespan seconds, after giving the grant it should not ask grant within ttl and it ask after the ttl # Case-1: Deny grant and validate error # Case-2: Reboot device after ttl, after reboot when api is called again, expect to ask grant and then deny grant - @Usergrants @coreSDK @sdk @transport @notSupported + @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (ackchallenge) and lifespan:seconds lifespanTtl:60sec - reboot after ttl and it should ask grant Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -367,7 +367,7 @@ Feature: UserGrants Then User validates lifecycle history for '3rd party app' with 'background:foreground' # grantPolicy having lifespan:seconds and lifespanTtl:60 seconds - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: privacySetting - autoApplyPolicy:always property-getter:true silently grant Given the environment has been set up for 'userGrants' tests And 1st party app invokes the 'Firebolt' API to 'disable closedCaptions' @@ -383,7 +383,7 @@ Feature: UserGrants # First testcase having grantPolicy with lifespan:seconds and lifespanTtl:60 seconds # Second testcase having lifespan:appActive - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: UserGrants.Capabilities - Positive Scenario: Given the environment has been set up for 'userGrants' tests And 1st party app invokes the 'Firebolt' API to '' @@ -403,7 +403,7 @@ Feature: UserGrants | Validate Capability autoApplyPolicy:disallowed property-getter:false silently denied | disable voiceguidance | expect error for voiceGuidance Settings | invalid request for voiceGuidance settings | check if accessibility voiceGuidance capability is granted with role as use | # grantPolicy having lifespan:appActive - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:true silently grant Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -417,7 +417,7 @@ Feature: UserGrants Then 'Firebolt' platform responds with 'true for capabilities granted' # grantPolicy having lifespan:appActive - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:false grant Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -434,7 +434,7 @@ Feature: UserGrants Then 'Firebolt' platform responds with 'true for capabilities granted' # grantPolicy having lifespan:appActive - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:false deny Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -451,7 +451,7 @@ Feature: UserGrants Then 'Firebolt' platform responds with 'false for capabilities granted' # grantPolicy having lifespan:appActive - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:disallowed property-getter:true grant Given the environment has been set up for 'userGrants' tests And 1st party app invokes the 'Firebolt' API to 'disable voiceguidance' @@ -469,7 +469,7 @@ Feature: UserGrants Then 'Firebolt' platform responds with 'true for capabilities granted' # grantPolicy having lifespan:appActive - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:disallowed property-getter:true deny Given the environment has been set up for 'userGrants' tests And 1st party app invokes the 'Firebolt' API to 'disable voiceguidance' @@ -487,7 +487,7 @@ Feature: UserGrants Then 'Firebolt' platform responds with 'false for capabilities granted' # grantPolicy having lifespan:appActive - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: UserGrants.Capabilities - Positive Scenario: with privacySetting - Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -509,7 +509,7 @@ Feature: UserGrants | Validate Capability autoApplyPolicy:never property-getter:false grant | set privacy allow watchHistory as false | #grantPolicy having lifespan:appActive - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: UserGrants.Capabilities - Positive Scenario: with privacySetting - Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -531,7 +531,7 @@ Feature: UserGrants | Validate Capability autoApplyPolicy:never property-getter:false deny | set privacy allow watchHistory as false | #grantPolicy having lifespan:appActive - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: UserGrants.Capabilities - Positive Scenario:privacySetting - Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -553,7 +553,7 @@ Feature: UserGrants | Validate Capability updateProperty:false - property-getter:true deny property should not be updated | expect error for allow profile flags | invalid request for profile flags | true for privacy allow watchHistory | check if profile flags capability is granted with role use | # grantPolicy having lifespan:appActive - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: UserGrants.Capabilities - Positive Scenario:privacySetting - Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -578,7 +578,7 @@ Feature: UserGrants # lifespan having powerActive # Case-1: Allow grant and validate the result # Case-2: Call API after device is rebooted,expect to ask for grant, deny grant and validate error - @Usergrants @coreSDK @sdk @transport @notSupported + @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with grant (pinChallenge) and lifespan powerActive - after reboot deny and validate Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -608,7 +608,7 @@ Feature: UserGrants # lifespan having powerActive # Case-1: Deny grant and validate error # Case-2: Call API after device is rebooted,expect to ask for grant, allow grant and validate result - @Usergrants @coreSDK @sdk @transport @notSupported + @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan powerActive - after reboot grant and validate Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched @@ -637,7 +637,7 @@ Feature: UserGrants # 1st example: Call usergrants.request for account.uid with granting acknowledgeChallenge for role use and validate capabilities.info for same capability and check role use is granted and not any other role # 2nd example: Call usergrants.request for account.uid with granting acknowledgeChallenge for role manage and validate capabilities.info for same capability and check role manage is granted and not any other role - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: UserGrants.request - Positive Scenario: Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider @@ -655,7 +655,7 @@ Feature: UserGrants # 1st example: Call usergrants.request for account.uid with denying acknowledgeChallenge for role use and validate capabilities.info for same capability and check role use is denied # 2nd example: Call usergrants.request for account.uid with denying acknowledgeChallenge for role manage and validate capabilities.info for same capability and check role manage is denied - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: UserGrants.request - Negative Scenario: Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider @@ -672,7 +672,7 @@ Feature: UserGrants | Validate userGrants.request by denying for role manage | request grant for account uid capability with role manage | denied for account uid capability with role manage | # Call usergrants.request with securestorage for role use, but the grant policy has role manage, since role mismatch it should return null since no grantpolicy is matched - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.request - Negative Scenario: Validate userGrants.request call with role use, but grantpolicy having manage capability Given the environment has been set up for 'userGrants' tests And Framework registers 'pinChallenge' test provider @@ -685,7 +685,7 @@ Feature: UserGrants And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as manage' Then 'Firebolt' platform responds to '1st party app' with 'granted for secure storage capability with role use' - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.request - Positive Scenario: Validate UserGrants.request which grantpolicy is not present in manifest Given the environment has been set up for 'userGrants' tests When 1st party app invokes the 'Firebolt' API to 'request grant for device info capability with role use' @@ -697,7 +697,7 @@ Feature: UserGrants And '3rd party app' invokes the 'Firebolt' API to 'check if device info capability is granted with role as manage' Then 'Firebolt' platform responds to '1st party app' with 'granted for device info capability with role use' - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.request - Positive Scenario: Validate userGrants.request by deferring Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider @@ -711,7 +711,7 @@ Feature: UserGrants And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as provide' Then 'Firebolt' platform responds to '1st party app' with 'deferred for account uid capability with role use' - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.request - Positive Scenario: Validate userGrants.request by deferring with timeout Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider @@ -726,7 +726,7 @@ Feature: UserGrants Then 'Firebolt' platform responds to '1st party app' with 'deferred for account uid capability with role use' # Call capabilities.request for account.uid with granting acknowledgeChallenge for role provide and validate by calling capabilities.info with same capability and check which role manage is granted and not any other role - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.request - Positive Scenario: Validate usergrants.request by granting for role provide Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider @@ -741,7 +741,7 @@ Feature: UserGrants Then 'Firebolt' platform responds to '1st party app' with 'granted for account uid capability with role provide' # Call capabilities.request for account.uid with denying acknowledgeChallenge for role manage and validate by calling capabilities.info with same capability and check which role manage is denied - @Usergrants @coreSDK @sdk @transport + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.request - Negative Scenario: Validate usergrants.request by denying for role provide Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider From 90e9e0685f8b1277d9c19bc456017010afda3066 Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Thu, 4 Jul 2024 11:15:25 +0530 Subject: [PATCH 226/359] Review comments address --- cypress/support/cypress-commands/commands.js | 29 ++++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 48e9bc31..ddd9d335 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -658,9 +658,6 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : UTILS.checkForSecondaryAppId(appCallSign); // this is for the app to know the appId used for launch, so that it can use the same for creating PubSub connection. // if appType is certification, the appLaunch is for certification purposes. In such a case, discovery.launch should go with a basic intent that has the appId and the certification app role. - // create the request map - // basic intent to be sent to the app on launch - let requestMap = { method: CONSTANTS.DISCOVERY_LAUNCH, params: { appId: appId } }; let appCategory, data; if (appType.toLowerCase() === CONSTANTS.CERTIFICATION) { appCategory = @@ -675,16 +672,6 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { }, }, }; - const messageIntent = { - action: CONSTANTS.SEARCH, - data: data, - context: { source: CONSTANTS.DEVICE }, - }; - - requestMap = { - method: CONSTANTS.DISCOVERY_LAUNCH, - params: { [CONSTANTS.APP_ID]: appId, [CONSTANTS.INTENT]: messageIntent }, - }; } if ( Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLEAPI || @@ -699,12 +686,18 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { }, }, }; - const messageIntent = { - action: CONSTANTS.SEARCH, - data: data, - }; - requestMap.params.intent = messageIntent; } + const messageIntent = { + action: CONSTANTS.SEARCH, + data: data, + context: { source: CONSTANTS.DEVICE }, + }; + // intent to be sent to the app on launch + // create the request map + const requestMap = { + method: CONSTANTS.DISCOVERY_LAUNCH, + params: { [CONSTANTS.APP_ID]: appId, [CONSTANTS.INTENT]: messageIntent }, + }; // Add the PubSub URL if required if (getEnvVariable(CONSTANTS.PUB_SUB_URL, false)) { From b328651a8d998d719807f679d8b16d4ddf5d6086 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 4 Jul 2024 15:27:45 +0530 Subject: [PATCH 227/359] Added minor changes --- cypress/support/cypress-commands/commands.js | 13 +++++-------- cypress/support/step_definitions/fireboltCalls.js | 8 +++++++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index effbe67b..427da332 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -663,7 +663,6 @@ Cypress.Commands.add('launchApp', (appType, appCallSign, deviceIdentifier) => { let requestMap = { method: CONSTANTS.DISCOVERY_LAUNCH, params: { appId: appId }, - deviceIdentifier: deviceIdentifier, }; let appCategory, data; if (appType.toLowerCase() === CONSTANTS.CERTIFICATION) { @@ -725,12 +724,13 @@ Cypress.Commands.add('launchApp', (appType, appCallSign, deviceIdentifier) => { requestMap.params.intent.data = data; } + requestMap.deviceIdentifier = deviceIdentifier; // Stringify the query (The intent requires it be a string) data.query = JSON.stringify(data.query); Cypress.env(CONSTANTS.CURRENT_APP_ID, appId); - const requestTopic = UTILS.getTopic(appId); - const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); + const requestTopic = UTILS.getTopic(appId, null, deviceIdentifier); + const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE, deviceIdentifier); cy.runIntentAddon(CONSTANTS.LAUNCHAPP, requestMap).then((parsedIntent) => { fireLog.info('Discovery launch intent: ' + JSON.stringify(parsedIntent)); @@ -749,11 +749,8 @@ Cypress.Commands.add('launchApp', (appType, appCallSign, deviceIdentifier) => { // if not received, throwing error with corresponding topic and retry count. if (healthCheckResponse == CONSTANTS.NO_RESPONSE) { throw Error( - 'FCA not launched as 3rd party app or not subscribed to ' + - requestTopic + - '. Unable to get healthCheck response from FCA in ' + - UTILS.getEnvVariable(CONSTANTS.HEALTH_CHECK_RETRIES) + - ' retries' + `Unable to get healthCheck response from App in ${getEnvVariable(CONSTANTS.HEALTH_CHECK_RETRIES)} retries. Failed to launch the 3rd party app on ${deviceIdentifier | getEnvVariable(CONSTANTS.DEVICE_MAC)} or not subscribed to + ${requestTopic} topic.` ); } healthCheckResponse = JSON.parse(healthCheckResponse); diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 0b602113..66fb6671 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -125,7 +125,11 @@ Given( // Unable to find the ${envAppIdKey} value in the env, please add the value in configModule/constants/config.json cy.then(() => { - if (deviceIdentifier && !UTILS.getEnvVariable(deviceIdentifier, false)) { + if ( + deviceIdentifier && + !UTILS.getEnvVariable(deviceIdentifier, false) && + deviceIdentifier != 'device1' + ) { fireLog.assert( false, `Unable to find the ${deviceIdentifier} envitonment value, Verify the value of ${deviceIdentifier} in configModule or cli command.}` @@ -133,6 +137,8 @@ Given( } else if (deviceIdentifier && UTILS.getEnvVariable(deviceIdentifier, false)) { deviceIdentifier = UTILS.getEnvVariable(deviceIdentifier, false); cy.launchApp(CONSTANTS.CERTIFICATION, appId, deviceIdentifier); + } else if (deviceIdentifier === 'device1') { + deviceIdentifier = UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC); } }).then(() => { const requestTopic = UTILS.getTopic(appId, null, deviceIdentifier); From 5c0d5a2f23287b4c6d7aa2b3f632102f7883a25f Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 4 Jul 2024 16:07:30 +0530 Subject: [PATCH 228/359] Added minor changes --- cypress/support/constants/constants.js | 1 + cypress/support/step_definitions/fireboltCalls.js | 12 +++++++----- cypress/support/step_definitions/fireboltCalls.md | 2 ++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 7572448a..0d7338be 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -77,6 +77,7 @@ module.exports = { DEFAULT_TEST_DATA: 'defaultTestData.json', DEREFERENCE_OPENRPC: 'dereferenceOpenRPC', DEVICE: 'device', + DEVICE1: 'device1', DEVICEMANIFESTDATA: 'deviceManifestData', DEVICEMODULEFORMAT: 'deviceModelFormat', DEVICE_AUDIO: 'device.audio', diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 66fb6671..a37bdbac 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -108,10 +108,12 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = * @param {String} appId - 3rd party app id. * @param {String} sdk - sdk name. * @param {String} key - key name of the firebolt data contains method/param/context. + * @param {String} deviceIdentifier - Contains environment variable name which is having device mac. * @example * Given '3rd party app' invokes the 'Firebolt' API to 'get device id' * Given 'test.test.test' invokes the 'Firebolt' API to 'get device id' * Given 'secondary 3rd party app' invokes the 'Firebolt' API to 'get device id' + * And '3rd party app' invokes the 'Firebolt' API to 'get device id' on 'device1' device */ Given( /'(.+)' invokes the '(.+)' API to '(.+)'(?: on '(.+)' device)?$/, @@ -128,16 +130,16 @@ Given( if ( deviceIdentifier && !UTILS.getEnvVariable(deviceIdentifier, false) && - deviceIdentifier != 'device1' + deviceIdentifier != CONSTANTS.DEVICE1 ) { fireLog.assert( false, - `Unable to find the ${deviceIdentifier} envitonment value, Verify the value of ${deviceIdentifier} in configModule or cli command.}` + `Unable to find the ${deviceIdentifier} environment value, Verify the value of ${deviceIdentifier} in configModule or cli command.}` ); } else if (deviceIdentifier && UTILS.getEnvVariable(deviceIdentifier, false)) { deviceIdentifier = UTILS.getEnvVariable(deviceIdentifier, false); cy.launchApp(CONSTANTS.CERTIFICATION, appId, deviceIdentifier); - } else if (deviceIdentifier === 'device1') { + } else if (deviceIdentifier === CONSTANTS.DEVICE1) { deviceIdentifier = UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC); } }).then(() => { @@ -179,7 +181,7 @@ Given( ); fireLog.info( - `Call from app: ${appId}, device: ${deviceIdentifier} - method: ${method} params: ${JSON.stringify(param)}` + `Call from app: ${appId}, device: ${deviceIdentifier || UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC)} - method: ${method} params: ${JSON.stringify(param)}` ); if (Cypress.env('isRpcOnlyValidation')) { fireLog.info( @@ -204,7 +206,7 @@ Given( cy.censorData(method, dataToBeCensored).then((maskedResult) => { const responseType = result.error ? CONSTANTS.ERROR : CONSTANTS.RESULT; fireLog.info( - `Response from app: ${appId}, device: ${deviceIdentifier} - ${JSON.stringify(maskedResult[responseType])}` + `Response from app: ${appId}, device: ${deviceIdentifier || UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC)} - ${JSON.stringify(maskedResult[responseType])}` ); }); diff --git a/cypress/support/step_definitions/fireboltCalls.md b/cypress/support/step_definitions/fireboltCalls.md index ea35c3a3..6706f761 100644 --- a/cypress/support/step_definitions/fireboltCalls.md +++ b/cypress/support/step_definitions/fireboltCalls.md @@ -25,10 +25,12 @@ | appId | 3rd party app id | | sdk | name of the sdk | | key | key name of the request data. | +| deviceIdentifier | Contains environment variable name which is having device mac. | ### Examples: * `Given '3rd party app' invokes the 'Firebolt' API to 'get device id'` * `Given 'test.test.test' invokes the 'Firebolt' API to 'get device id'` +* `And '3rd party app' invokes the 'Firebolt' API to 'get device id' on 'device1' device` ## '(.+)' registers for the '(.+)' event using the '(.+)' API From 28eb59e892af4b4ff047b51e36fe62f9a257afd8 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 4 Jul 2024 16:57:51 +0530 Subject: [PATCH 229/359] Fixed app launch issue for device1 --- cypress/support/step_definitions/fireboltCalls.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index a37bdbac..753e69b8 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -141,6 +141,7 @@ Given( cy.launchApp(CONSTANTS.CERTIFICATION, appId, deviceIdentifier); } else if (deviceIdentifier === CONSTANTS.DEVICE1) { deviceIdentifier = UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC); + cy.launchApp(CONSTANTS.CERTIFICATION, appId, deviceIdentifier); } }).then(() => { const requestTopic = UTILS.getTopic(appId, null, deviceIdentifier); From e78db0847f29516494bec310bd17a48c76d23993 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Thu, 4 Jul 2024 17:11:34 +0530 Subject: [PATCH 230/359] FIRECERT-2112 Added changes for updating logs and miscValidations --- cypress/support/appObjectConfigs.js | 11 ++++++++++- cypress/support/cypress-commands/assertion.js | 4 ++-- cypress/support/cypress-support/src/utils.js | 5 ++++- .../moduleValidations/deviceMiscValidation.js | 12 ++++++++---- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/cypress/support/appObjectConfigs.js b/cypress/support/appObjectConfigs.js index 84735d88..05cb12be 100644 --- a/cypress/support/appObjectConfigs.js +++ b/cypress/support/appObjectConfigs.js @@ -58,7 +58,16 @@ class eventObject { this.eventSchemaResult = response.eventSchemaResult; this.eventTime = response.eventTime; } else { - assert(false, 'Platform does not trigger event'); + cy.logValidationResult( + ' Did not receive eventResponse,' + ' Actual: ' + response.eventResponse, + CONSTANTS.FAIL, + CONSTANTS.SKIPPED, + CONSTANTS.SKIPPED + ).then(() => { + const pretext = 'Event Not Received : '; + + fireLog.equal(response.eventResponse, content, pretext); + }); } } } diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index 408a99af..4eda191f 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -497,9 +497,9 @@ Cypress.Commands.add( ); cy.assertValidationsForEvent( 'Schema Validation Failed', - 'FAIL', + verifyPath, 'PASS', - 'Event Schema Validation' + 'Event Schema Validation :' ); } else if (eventSchemaStatus && eventSchemaStatus.status === 'PASS') { // Doing event content validation diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index b277598a..9dbbfbd8 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -285,7 +285,10 @@ function getApiOrEventObjectFromGlobalList(method, context, appId, validationTyp ); // Failing when the filteredObjectList is empty. - assert.isNotEmpty(filteredObjectList, 'filteredObjectList is not to be empty'); + assert.isNotEmpty( + filteredObjectList, + `Required response not found in ${validationType} object list` + ); // When the context is empty, the most recent apiOrEventObject is obtained from the filtered list. // If the context is not empty, the filtered list is iterated, and the API object that has the same context is retrieved. diff --git a/cypress/support/validations/moduleValidations/deviceMiscValidation.js b/cypress/support/validations/moduleValidations/deviceMiscValidation.js index cfee7a18..e760e90a 100644 --- a/cypress/support/validations/moduleValidations/deviceMiscValidation.js +++ b/cypress/support/validations/moduleValidations/deviceMiscValidation.js @@ -39,9 +39,11 @@ export function deviceMiscValidation(method, validationTypeObject, apiOrEventObj case CONSTANTS.DEVICE_HDCP: case CONSTANTS.DEVICE_HDR: for (const key in response) { - cy.log(`Expected ${key} value to be boolean`).then(() => { - assert.isBoolean(response[key], 'Expected to be'); - }); + cy.log(`Miscellaneous Validation for ${method}: Expected ${key} value to be boolean`).then( + () => { + assert.isBoolean(response[key], 'Expected to be'); + } + ); } break; case CONSTANTS.DEVICE_SCREENRESOLUTION: @@ -52,7 +54,9 @@ export function deviceMiscValidation(method, validationTypeObject, apiOrEventObj const isPresent = validationTypeObject.type.some((resolution) => { return resolution[0] === response[0] && resolution[1] === response[1]; }); - cy.log(`Expected [${response}] to be present in [${deviceResolution}]`).then(() => { + cy.log( + `Miscellaneous Validation for ${method}: Expected [${response}] to be present in [${deviceResolution}]` + ).then(() => { assert.equal(true, isPresent, 'Expected to be present'); }); break; From 86a973a88420c58c4081f5dd3203a112a444fdef Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Thu, 4 Jul 2024 17:34:29 +0530 Subject: [PATCH 231/359] FIRECERT-2112 updated Lifecycle.feature --- .../LifecycleTestcases/Lifecycle.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/Lifecycle.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/Lifecycle.feature index 084cc972..ace8806c 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/Lifecycle.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/Lifecycle.feature @@ -20,14 +20,14 @@ Feature: Lifecycle @Lifecycle @sdk @transport @coreSDK @regression Scenario: Lifecycle R*4.6 Validate lifecycle.state - Get the current state - Given the environment has been set up for 'lifecycle' tests + Given the environment has been set up for 'lifeCycleApi' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to 'fetch lifecycle state' Then 'Firebolt' platform responds with 'foreground for lifecycle state' @Lifecycle @coreSDK @regression @sdk @transport Scenario Outline: Lifecycle R*4.3 Validate lifecycle.close - '' expecting error - Given the environment has been set up for 'lifecycle' tests + Given the environment has been set up for 'lifeCycleApi' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with '' @@ -47,7 +47,7 @@ Feature: Lifecycle @Lifecycle @coreSDK @regression @sdk @transport Scenario Outline: Lifecycle R*4.3 Validate lifecycle.close - Positive Scenario - '' - Given the environment has been set up for 'lifecycle' tests + Given the environment has been set up for 'lifeCycleApi' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with 'null for lifecycle close' @@ -61,7 +61,7 @@ Feature: Lifecycle @Lifecycle @sdk @transport @coreSDK @regression Scenario: Lifecycle R*4.5 Validate 'lifecycle.finished' - expecting error - Given the environment has been set up for 'lifecycle' tests + Given the environment has been set up for 'lifeCycleApi' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to 'notify that the app is done unloading' Then 'Firebolt' platform responds with 'error for lifecycle finished' From 884e2ce7657477289ed47bf4b4165e96136c451b Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Thu, 4 Jul 2024 18:09:46 +0530 Subject: [PATCH 232/359] 2166 - update Requirement Id --- .../AdditionalTestcases/UserGrants.feature | 23 ++++ .../FireboltCertification/UserGrants.feature | 32 ++++- .../objects/moduleReqId/moduleReqId.json | 118 ++++++++++-------- 3 files changed, 114 insertions(+), 59 deletions(-) create mode 100644 cypress/TestCases/FireboltCertification/AdditionalTestcases/UserGrants.feature diff --git a/cypress/TestCases/FireboltCertification/AdditionalTestcases/UserGrants.feature b/cypress/TestCases/FireboltCertification/AdditionalTestcases/UserGrants.feature new file mode 100644 index 00000000..50fc8e57 --- /dev/null +++ b/cypress/TestCases/FireboltCertification/AdditionalTestcases/UserGrants.feature @@ -0,0 +1,23 @@ +Feature: UserGrants + + # 1st example - #Deferred testcase - For acknowledgechallenge the grant is neither denied nor granted, instead exit the acknowledgechallenge overlay + # 2nd example - #Timeout testcase - For acknowledgechallenge the grant is neither denied nor granted, since no response is given it will be timed out + @Usergrants @coreSDK @sdk @transport + Scenario Outline: UserGrants.Capability - Positive Scenario: + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And Framework registers 'ackchallenge' test provider + And User 'starts' recording lifecycle history for '3rd party app' + When '3rd party app' invokes the 'Firebolt' API to 'expect error for device distributor' + Then 'Firebolt' platform responds with 'invalid request for device distributor' + When User 'stops' recording lifecycle history for '3rd party app' + Then User validates lifecycle history for '3rd party app' with 'background:foreground' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device distributor' + Then 'Firebolt' platform responds with 'null for capabilities granted' + When '3rd party app' invokes the 'Firebolt' API to 'get info of device distributor capability' + Then 'Firebolt' platform responds with 'null for capabilities info granted' + + Examples: + | scenario | + | AcknowledgeChallenge Grant is deferred by exiting overlay | + | Acknowledgechallenge Grant is deferred based on the timeout (4 seconds) | \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature index 6c8ad526..045df031 100644 --- a/cypress/TestCases/FireboltCertification/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -42,8 +42,8 @@ Feature: UserGrants # Testing with grantPolicy having with scope device and grant access, so all the apps in that device may have the access # provide access using any 3rd party and check in another 3rd party - # Added @notSupported as glue is not implemented yet. - @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation + # Involves 2 apps, Will be handled in FIRECERT-2194 + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capability Grant access with scope device Given the environment has been set up for 'userGrants' tests # 3rd party app @@ -53,7 +53,7 @@ Feature: UserGrants Then 'Firebolt' platform responds with 'true for watched content in discovery' When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' Then 'Firebolt' platform responds with 'true for capabilities granted' - ###### And App will be in 'closed' state + When '3rd party app' invokes the 'Firebolt' API to 'close app with user exit' # 1st part app ###### And 1st party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to 'notify watched content with only entityid' @@ -63,6 +63,7 @@ Feature: UserGrants # Deny access with scope device, so all the apps in that device may not have the access # launch a 3rd party and provide acess using any 3rd party and check in another 3rd party + # Involves 2 apps, Will be handled in FIRECERT-2194 @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capability access denied for pinChallenge with scope device Given the environment has been set up for 'userGrants' tests @@ -80,6 +81,27 @@ Feature: UserGrants When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' Then 'Firebolt' platform responds with 'false for capabilities granted' + # Testing with grantPolicy having device level grant access and check in another device + # Involves multiple devices, Will be handled in FIRECERT-2195 + @Usergrants @coreSDK @sdk @transport @notSupported + Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capability permission in 2 diff devices + Given the environment has been set up for 'userGrants' tests + # 1st device + And 3rd party 'certification' app is launched + And Framework registers 'ackchallenge' test provider + When '3rd party app' invokes the 'Firebolt' API to 'fetch device distributor' + Then 'Firebolt' platform responds with 'expected device distributor' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device distributor' + Then 'Firebolt' platform responds with 'true for capabilities granted' + # 2nd device + When 3rd party 'certification' app is launched + # in another device + And '3rd party app' invokes the 'Firebolt' API to 'fetch device distributor' + Then 'Firebolt' platform responds with 'expect error for device distributor' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device distributor' + Then 'Firebolt' platform responds with 'true for capabilities granted' + + # If lifespan value forever only once ask for grant until we clear the given grant # Case-1: Allowing the grant and validating the result # Case-2: Checking the lifecycle history to check ui is not coming and validating for result because already allowed grant in Case-1. @@ -144,7 +166,7 @@ Feature: UserGrants When User 'stops' recording lifecycle history for '3rd party app' Then User validates lifecycle history for '3rd party app' with 'background:foreground' #Case-2 - ###### And App will be in 'closed' state + When '3rd party app' invokes the 'Firebolt' API to 'close app with user exit' When 3rd party 'certification' app is launched And User set response for 'set pinchallenge correct pin' And User 'starts' recording lifecycle history for '3rd party app' @@ -171,7 +193,7 @@ Feature: UserGrants When User 'stops' recording lifecycle history for '3rd party app' Then User validates lifecycle history for '3rd party app' with 'background:foreground' #Case-2 - ###### And App will be in 'closed' state + When '3rd party app' invokes the 'Firebolt' API to 'close app with user exit' When 3rd party 'certification' app is launched And User set response for 'set pinchallenge wrong pin' And User 'starts' recording lifecycle history for '3rd party app' diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 6606fc5d..68a93f27 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -687,7 +687,7 @@ "req": [ { "method": { - "id": "UserGrants 1.1", + "id": "UserGrants R*2.2.2.1, R.1.2", "description": "Should not be null" } } @@ -697,7 +697,7 @@ "req": [ { "method": { - "id": "UserGrants 1.2", + "id": "UserGrants R.2.1.1, R.1.1", "description": "Should not be null" } } @@ -707,7 +707,7 @@ "req": [ { "method": { - "id": "UserGrants 1.3", + "id": "UserGrants R.4.4.1.1, R.1.1", "description": "Should not be null" } } @@ -717,7 +717,17 @@ "req": [ { "method": { - "id": "UserGrants 1.4", + "id": "UserGrants R.4.4.1.1, R.1.2", + "description": "Should not be null" + } + } + ] + }, + "UserGrants.Capabilities - Positive Scenario: Validate Capability permission in 2 diff devices": { + "req": [ + { + "method": { + "id": "UserGrants R.4.4.1.1, R.1.1", "description": "Should not be null" } } @@ -727,7 +737,7 @@ "req": [ { "method": { - "id": "UserGrants 1.5", + "id": "UserGrants R*2.2.2.2, R.1.1", "description": "Should not be null" } } @@ -737,7 +747,7 @@ "req": [ { "method": { - "id": "UserGrants 1.6", + "id": "UserGrants R*2.2.2.2, R.1.2", "description": "Should not be null" } } @@ -747,7 +757,7 @@ "req": [ { "method": { - "id": "UserGrants 1.7", + "id": "UserGrants R*2.2.2.3, R.1.1", "description": "Should not be null" } } @@ -757,7 +767,7 @@ "req": [ { "method": { - "id": "UserGrants 1.8", + "id": "UserGrants R*2.2.2.3, R.1.2", "description": "Should not be null" } } @@ -767,7 +777,7 @@ "req": [ { "method": { - "id": "UserGrants 1.9", + "id": "UserGrants R*2.2.2.5, R.1.1, R.1.2", "description": "Should not be null" } } @@ -777,7 +787,7 @@ "req": [ { "method": { - "id": "UserGrants 1.10", + "id": "UserGrants R*2.2.2.5, R.1.2, R.1.1", "description": "Should not be null" } } @@ -787,7 +797,7 @@ "req": [ { "method": { - "id": "UserGrants 1.11", + "id": "UserGrants R*2.2.2.5, R.1.1", "description": "Should not be null" } } @@ -797,7 +807,7 @@ "req": [ { "method": { - "id": "UserGrants 1.12", + "id": "UserGrants R*2.2.2.5, R.1.1", "description": "Should not be null" } } @@ -807,7 +817,7 @@ "req": [ { "method": { - "id": "UserGrants 1.13", + "id": "UserGrants R*2.2.2.5, R.1.2", "description": "Should not be null" } } @@ -817,7 +827,7 @@ "req": [ { "method": { - "id": "UserGrants 1.14", + "id": "UserGrants R*2.2.2.5, R.1.2", "description": "Should not be null" } } @@ -827,7 +837,7 @@ "req": [ { "method": { - "id": "UserGrants 1.15", + "id": "UserGrants R*2.2.3.4, R.1.1", "description": "Should not be null" } } @@ -837,7 +847,7 @@ "req": [ { "method": { - "id": "UserGrants 1.16", + "id": "UserGrants R*2.2.3.4, R.1.2", "description": "Should not be null" } } @@ -847,7 +857,7 @@ "req": [ { "method": { - "id": "UserGrants 1.17", + "id": "UserGrants R*2.2.3.6, R.1.2", "description": "Should not be null" } } @@ -857,7 +867,7 @@ "req": [ { "method": { - "id": "UserGrants 1.18", + "id": "UserGrants R*2.2.3.5, R.1.1", "description": "Should not be null" } } @@ -867,7 +877,7 @@ "req": [ { "method": { - "id": "UserGrants 1.19", + "id": "UserGrants R*2.2.3.5, R.1.1", "description": "Should not be null" } } @@ -877,7 +887,7 @@ "req": [ { "method": { - "id": "UserGrants 1.20", + "id": "UserGrants R*2.2.3.5, R.1.2", "description": "Should not be null" } } @@ -887,7 +897,7 @@ "req": [ { "method": { - "id": "UserGrants 1.21", + "id": "UserGrants R*2.2.3.6, R.1.1", "description": "Should not be null" } } @@ -897,7 +907,7 @@ "req": [ { "method": { - "id": "UserGrants 1.22", + "id": "UserGrants R*2.2.3.6, R.1.2", "description": "Should not be null" } } @@ -907,7 +917,7 @@ "req": [ { "method": { - "id": "UserGrants 1.23", + "id": "UserGrants R*2.2.3.7, R.1.1", "description": "Should not be null" } } @@ -917,7 +927,7 @@ "req": [ { "method": { - "id": "UserGrants 1.24", + "id": "UserGrants R*2.2.3.7, R.1.1", "description": "Should not be null" } } @@ -927,7 +937,7 @@ "req": [ { "method": { - "id": "UserGrants 1.25", + "id": "UserGrants R*2.2.3.7, R.1.2", "description": "Should not be null" } } @@ -937,7 +947,7 @@ "req": [ { "method": { - "id": "UserGrants 1.26", + "id": "UserGrants R*2.2.3.7, R.1.2", "description": "Should not be null" } } @@ -947,7 +957,7 @@ "req": [ { "method": { - "id": "UserGrants 1.27", + "id": "UserGrants R*2.2.3.9, R.1.2", "description": "Should not be null" } } @@ -957,7 +967,7 @@ "req": [ { "method": { - "id": "UserGrants 1.28", + "id": "UserGrants R*2.2.3.10, R.1.2", "description": "Should not be null" } } @@ -967,7 +977,7 @@ "req": [ { "method": { - "id": "UserGrants 1.29", + "id": "UserGrants R*2.2.3.9, R.1.1", "description": "Should not be null" } } @@ -977,7 +987,7 @@ "req": [ { "method": { - "id": "UserGrants 1.30", + "id": "UserGrants R*2.2.3.9, R.1.1", "description": "Should not be null" } } @@ -987,7 +997,7 @@ "req": [ { "method": { - "id": "UserGrants 1.31", + "id": "UserGrants R*2.2.3.9, R.1.1", "description": "Should not be null" } } @@ -997,7 +1007,7 @@ "req": [ { "method": { - "id": "UserGrants 1.32", + "id": "UserGrants R*2.2.2.4", "description": "Should not be null" } } @@ -1007,7 +1017,7 @@ "req": [ { "method": { - "id": "UserGrants 1.33", + "id": "UserGrants R*2.2.2.4", "description": "Should not be null" } } @@ -1017,7 +1027,7 @@ "req": [ { "method": { - "id": "UserGrants 1.34", + "id": "UserGrants R.1.1", "description": "Should not be null" } } @@ -1027,7 +1037,7 @@ "req": [ { "method": { - "id": "UserGrants 1.35", + "id": "UserGrants R.1.1", "description": "Should not be null" } } @@ -1037,7 +1047,7 @@ "req": [ { "method": { - "id": "UserGrants 1.36", + "id": "UserGrants R.1.2", "description": "Should not be null" } } @@ -1047,7 +1057,7 @@ "req": [ { "method": { - "id": "UserGrants 1.37", + "id": "UserGrants R.1.2", "description": "Should not be null" } } @@ -1057,7 +1067,7 @@ "req": [ { "method": { - "id": "UserGrants 1.38", + "id": "UserGrants R.1.1", "description": "Should not be null" } } @@ -1067,7 +1077,7 @@ "req": [ { "method": { - "id": "UserGrants 1.39", + "id": "UserGrants R.1.2", "description": "Should not be null" } } @@ -1097,7 +1107,7 @@ "req": [ { "method": { - "id": "UserGrants 1.41", + "id": "UserGrants R.2.1.1, R.1.1", "description": "Should not be null" } } @@ -1107,7 +1117,7 @@ "req": [ { "method": { - "id": "UserGrants 1.43", + "id": "UserGrants R.2.1.1, R.1.2", "description": "Should not be null" } } @@ -1303,7 +1313,7 @@ "req": [ { "method": { - "id": "UserGrants 1.1", + "id": "UserGrants R.5.1.2", "description": "Should not be null" } } @@ -1313,7 +1323,7 @@ "req": [ { "method": { - "id": "UserGrants 1.2", + "id": "UserGrants R.5.1.3", "description": "Should not be null" } } @@ -1323,7 +1333,7 @@ "req": [ { "method": { - "id": "UserGrants 1.3", + "id": "UserGrants R.5.1.4", "description": "Should not be null" } } @@ -1333,7 +1343,7 @@ "req": [ { "method": { - "id": "UserGrants 1.4", + "id": "UserGrants R.5.1.5", "description": "Should not be null" } } @@ -1343,7 +1353,7 @@ "req": [ { "method": { - "id": "UserGrants 1.5", + "id": "UserGrants R.5.1.5", "description": "Should not be null" } } @@ -1353,7 +1363,7 @@ "req": [ { "method": { - "id": "UserGrants 1.6", + "id": "UserGrants R.5.1.6", "description": "Should not be null" } } @@ -1363,7 +1373,7 @@ "req": [ { "method": { - "id": "UserGrants 1.7", + "id": "UserGrants R.5.1.6", "description": "Should not be null" } } @@ -1373,7 +1383,7 @@ "req": [ { "method": { - "id": "UserGrants 1.8", + "id": "UserGrants R.5.1.7", "description": "Should not be null" } } @@ -1383,7 +1393,7 @@ "req": [ { "method": { - "id": "UserGrants 1.9", + "id": "UserGrants R.5.1.7", "description": "Should not be null" } } @@ -1413,7 +1423,7 @@ "req": [ { "method": { - "id": "UserGrants 1.12", + "id": "UserGrants R.5.1.2", "description": "Should not be null" } } @@ -1423,17 +1433,17 @@ "req": [ { "method": { - "id": "UserGrants 1.13", + "id": "UserGrants R.5.1.7, R.5.1.4", "description": "Should not be null" } } ] }, - "UserGrants.Capability - Positive Scenario: by clearing the grant and validating usergrants.app as empty": { + "UserGrants.app - Positive Scenario: by clearing the grant and validating usergrants.app as empty": { "req": [ { "method": { - "id": "UserGrants 1.14", + "id": "UserGrants R.5.1.7, R.5.1.2", "description": "Should not be null" } } From b6bdc9895ea0fa9c4b2dcef777f5f5fa3de83b54 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 5 Jul 2024 12:54:36 +0530 Subject: [PATCH 233/359] Added logic to close the app --- .../support/step_definitions/fireboltCalls.js | 171 ++++++++++-------- 1 file changed, 92 insertions(+), 79 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 753e69b8..da8af2bb 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -124,6 +124,8 @@ Given( : appId === CONSTANTS.THIRD_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : UTILS.checkForSecondaryAppId(appId); + let requestTopic, responseTopic; + const deviceName = deviceIdentifier; // Unable to find the ${envAppIdKey} value in the env, please add the value in configModule/constants/config.json cy.then(() => { @@ -143,96 +145,107 @@ Given( deviceIdentifier = UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC); cy.launchApp(CONSTANTS.CERTIFICATION, appId, deviceIdentifier); } - }).then(() => { - const requestTopic = UTILS.getTopic(appId, null, deviceIdentifier); - const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE, deviceIdentifier); - - // Fetching the data like method, param, context and action etc. - cy.fireboltDataParser(key, sdk).then((parsedDataArr) => { - parsedDataArr.forEach((parsedData) => { - const method = parsedData.method; - const param = parsedData.params; - const context = parsedData.context; - const action = parsedData.action; - const expected = parsedData.expected; - let isNotSupportedApi = false; - - if (UTILS.isScenarioExempted(method, param)) { - isNotSupportedApi = true; - } - if ( - Cypress.env(CONSTANTS.TEST_TYPE) && - Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE - ) { - cy.fetchLifecycleHistory(appId); - } - const communicationMode = UTILS.getCommunicationMode(); - const additionalParams = { - communicationMode: communicationMode, - action: action, - isNotSupportedApi: isNotSupportedApi, - }; - const params = { method: method, methodParams: param }; + }) + .then(() => { + requestTopic = UTILS.getTopic(appId, null, deviceIdentifier); + responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE, deviceIdentifier); + + // Fetching the data like method, param, context and action etc. + cy.fireboltDataParser(key, sdk).then((parsedDataArr) => { + parsedDataArr.forEach((parsedData) => { + const method = parsedData.method; + const param = parsedData.params; + const context = parsedData.context; + const action = parsedData.action; + const expected = parsedData.expected; + let isNotSupportedApi = false; + + if (UTILS.isScenarioExempted(method, param)) { + isNotSupportedApi = true; + } + if ( + Cypress.env(CONSTANTS.TEST_TYPE) && + Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE + ) { + cy.fetchLifecycleHistory(appId); + } + const communicationMode = UTILS.getCommunicationMode(); + const additionalParams = { + communicationMode: communicationMode, + action: action, + isNotSupportedApi: isNotSupportedApi, + }; + const params = { method: method, methodParams: param }; - // Creating intent message using above details to send it to 3rd party app. - const intentMessage = UTILS.createIntentMessage( - CONSTANTS.TASK.CALLMETHOD, - params, - additionalParams - ); + // Creating intent message using above details to send it to 3rd party app. + const intentMessage = UTILS.createIntentMessage( + CONSTANTS.TASK.CALLMETHOD, + params, + additionalParams + ); - fireLog.info( - `Call from app: ${appId}, device: ${deviceIdentifier || UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC)} - method: ${method} params: ${JSON.stringify(param)}` - ); - if (Cypress.env('isRpcOnlyValidation')) { fireLog.info( - `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` + `Call from app: ${appId}, device: ${deviceIdentifier || UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC)} - method: ${method} params: ${JSON.stringify(param)}` ); - } - - // Adding additional details to created intent if any platform specific data is present in configModule. - cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { - // Sending message to 3rd party app. - cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { - if (!Cypress.env('isRpcOnlyValidation')) { - if (result === CONSTANTS.NO_RESPONSE) { - assert(false, CONSTANTS.NO_MATCHED_RESPONSE); - } - result = JSON.parse(result); - cy.updateResponseForFCS(method, params, result).then((updatedResponse) => { - // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(result); - - // Call the 'censorData' command to hide sensitive data - cy.censorData(method, dataToBeCensored).then((maskedResult) => { - const responseType = result.error ? CONSTANTS.ERROR : CONSTANTS.RESULT; - fireLog.info( - `Response from app: ${appId}, device: ${deviceIdentifier || UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC)} - ${JSON.stringify(maskedResult[responseType])}` - ); - }); + if (Cypress.env('isRpcOnlyValidation')) { + fireLog.info( + `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` + ); + } - // If method and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(method, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + // Adding additional details to created intent if any platform specific data is present in configModule. + cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { + // Sending message to 3rd party app. + cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { + if (!Cypress.env('isRpcOnlyValidation')) { + if (result === CONSTANTS.NO_RESPONSE) { + assert(false, CONSTANTS.NO_MATCHED_RESPONSE); } + result = JSON.parse(result); + cy.updateResponseForFCS(method, params, result).then((updatedResponse) => { + // Create a deep copy to avoid reference mutation + const dataToBeCensored = _.cloneDeep(result); + + // Call the 'censorData' command to hide sensitive data + cy.censorData(method, dataToBeCensored).then((maskedResult) => { + const responseType = result.error ? CONSTANTS.ERROR : CONSTANTS.RESULT; + fireLog.info( + `Response from app: ${appId}, device: ${deviceIdentifier || UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC)} - ${JSON.stringify(maskedResult[responseType])}` + ); + }); + + // If method and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(method, param)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } - // Creating object with method name, params and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - method, - param, - context, - updatedResponse, - expected, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); - }); - } + // Creating object with method name, params and response etc and storing it in a global list for further validation. + const apiAppObject = new apiObject( + method, + param, + context, + updatedResponse, + expected, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + }); + } + }); }); }); }); + }) + .then(() => { + if (deviceIdentifier && deviceName !== CONSTANTS.DEVICE1) { + const publishMessage = UTILS.createIntentMessage( + CONSTANTS.TASK.CALLMETHOD, + { method: 'Lifecycle.close', methodParams: { reason: 'userExit' } }, + { communicationMode: UTILS.getCommunicationMode() } + ); + cy.sendMessagetoApp(requestTopic, responseTopic, publishMessage); + } }); - }); } ); From 37c2deda38ed12dfd530089551cb587ac236ea7c Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 5 Jul 2024 16:37:54 +0530 Subject: [PATCH 234/359] Added minor change --- cypress/support/step_definitions/fireboltCalls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index da8af2bb..0d99abf0 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -240,7 +240,7 @@ Given( if (deviceIdentifier && deviceName !== CONSTANTS.DEVICE1) { const publishMessage = UTILS.createIntentMessage( CONSTANTS.TASK.CALLMETHOD, - { method: 'Lifecycle.close', methodParams: { reason: 'userExit' } }, + { method: 'Lifecycle.close', methodParams: { reason: 'error' } }, { communicationMode: UTILS.getCommunicationMode() } ); cy.sendMessagetoApp(requestTopic, responseTopic, publishMessage); From f49216cfb53ea3b7a4f12bc75b94d9a32d501b1a Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 8 Jul 2024 14:01:37 +0530 Subject: [PATCH 235/359] Addressed the comment --- cypress/support/cypress-commands/lifecycle.js | 4 ++-- .../support/step_definitions/fireboltCalls.js | 17 +++++++++++++---- .../support/step_definitions/fireboltCalls.md | 5 +++++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index 14cc49f2..dab177af 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -169,6 +169,7 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent // Send message to 3rd party app to invoke lifecycle history API to get history response cy.invokeLifecycleApi(appId, CONSTANTS.LIFECYCLE_APIS.HISTORY, '{}').then((response) => { + console.log('@@@@response', response) // Perform a null check on history response and check if response has nested properties result, _history, _value response = JSON.parse(response ?? '{}'); if ( @@ -179,8 +180,7 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent ) { const pretext = CONSTANTS.HISTORY_VALIDATION_REQ + lifecycleHistoryRequirementId.history.id; cy.log( - CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + - JSON.stringify(response.report.result._history._value) + CONSTANTS.LIFECYCLE_HISTORY_RESPONSE + JSON.stringify(response.result._history._value) ); // Extract app history value const appHistory = response.result._history._value; diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 0d99abf0..adcca35f 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -114,6 +114,11 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = * Given 'test.test.test' invokes the 'Firebolt' API to 'get device id' * Given 'secondary 3rd party app' invokes the 'Firebolt' API to 'get device id' * And '3rd party app' invokes the 'Firebolt' API to 'get device id' on 'device1' device + * + * Note: + * - deviceIdentifier should have values like device1, device2 or device3 + * - When device1 passed it will launch the default 3rd party app + * - Other than device1 passed, launching the app on another devices based on the value associated with device indentifier. */ Given( /'(.+)' invokes the '(.+)' API to '(.+)'(?: on '(.+)' device)?$/, @@ -127,8 +132,8 @@ Given( let requestTopic, responseTopic; const deviceName = deviceIdentifier; - // Unable to find the ${envAppIdKey} value in the env, please add the value in configModule/constants/config.json cy.then(() => { + // Failing the test, When device identifier is passed and corresponding value not there in environment variable. if ( deviceIdentifier && !UTILS.getEnvVariable(deviceIdentifier, false) && @@ -136,12 +141,16 @@ Given( ) { fireLog.assert( false, - `Unable to find the ${deviceIdentifier} environment value, Verify the value of ${deviceIdentifier} in configModule or cli command.}` + `Unable to find the ${deviceIdentifier} environment value, Check whether environment variable value added for ${deviceIdentifier}` ); - } else if (deviceIdentifier && UTILS.getEnvVariable(deviceIdentifier, false)) { + } + // Launching the App, when device identifier is passed and corresponding environment value present. + else if (deviceIdentifier && UTILS.getEnvVariable(deviceIdentifier, false)) { deviceIdentifier = UTILS.getEnvVariable(deviceIdentifier, false); cy.launchApp(CONSTANTS.CERTIFICATION, appId, deviceIdentifier); - } else if (deviceIdentifier === CONSTANTS.DEVICE1) { + } + // Launching the default 3rd party app when device idnetifier has "device1" + else if (deviceIdentifier === CONSTANTS.DEVICE1) { deviceIdentifier = UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC); cy.launchApp(CONSTANTS.CERTIFICATION, appId, deviceIdentifier); } diff --git a/cypress/support/step_definitions/fireboltCalls.md b/cypress/support/step_definitions/fireboltCalls.md index 6706f761..88fef7fb 100644 --- a/cypress/support/step_definitions/fireboltCalls.md +++ b/cypress/support/step_definitions/fireboltCalls.md @@ -43,6 +43,11 @@ | sdk | name of the sdk | | key | key name of the firebolt data contains method/param/context. | +Note: + - deviceIdentifier should have values like device1, device2 or device3 + - When device1 passed it will launch the default 3rd party app + - Other than device1 passed, launching the app on another devices based on the value associated with device indentifier. + ### Examples: * `Given '3rd party app' registers for the 'Closed Captions Settings' event using the 'Firebolt' API` * `Given 'test.test.test' registers for the 'Closed Captions Settings' event using the 'Firebolt' API` From 204f82ce0aeba0e80304ce2d431978ab6bc0a485 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 8 Jul 2024 14:11:48 +0530 Subject: [PATCH 236/359] fixed lint issues --- cypress/support/cypress-commands/lifecycle.js | 1 - cypress/support/step_definitions/fireboltCalls.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cypress/support/cypress-commands/lifecycle.js b/cypress/support/cypress-commands/lifecycle.js index dab177af..1cf501ec 100644 --- a/cypress/support/cypress-commands/lifecycle.js +++ b/cypress/support/cypress-commands/lifecycle.js @@ -169,7 +169,6 @@ Cypress.Commands.add('validateLifecycleHistoryAndEvents', (state, appId, isEvent // Send message to 3rd party app to invoke lifecycle history API to get history response cy.invokeLifecycleApi(appId, CONSTANTS.LIFECYCLE_APIS.HISTORY, '{}').then((response) => { - console.log('@@@@response', response) // Perform a null check on history response and check if response has nested properties result, _history, _value response = JSON.parse(response ?? '{}'); if ( diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index adcca35f..712c39b4 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -114,8 +114,8 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = * Given 'test.test.test' invokes the 'Firebolt' API to 'get device id' * Given 'secondary 3rd party app' invokes the 'Firebolt' API to 'get device id' * And '3rd party app' invokes the 'Firebolt' API to 'get device id' on 'device1' device - * - * Note: + * + * Note: * - deviceIdentifier should have values like device1, device2 or device3 * - When device1 passed it will launch the default 3rd party app * - Other than device1 passed, launching the app on another devices based on the value associated with device indentifier. From 734c442b75743f991391d2c4361aa7e051566c5c Mon Sep 17 00:00:00 2001 From: SnehalP251 Date: Tue, 9 Jul 2024 10:44:00 +0530 Subject: [PATCH 237/359] review comments address --- cypress/support/cypress-commands/commands.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index ddd9d335..cb708527 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -658,6 +658,7 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : UTILS.checkForSecondaryAppId(appCallSign); // this is for the app to know the appId used for launch, so that it can use the same for creating PubSub connection. // if appType is certification, the appLaunch is for certification purposes. In such a case, discovery.launch should go with a basic intent that has the appId and the certification app role. + // Creating data for basic intent to be sent to the app on launch let appCategory, data; if (appType.toLowerCase() === CONSTANTS.CERTIFICATION) { appCategory = @@ -673,6 +674,7 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { }, }; } + // If testType == lifecycle, modifying data to include lifecycle_validation = true in the intent to be sent to the app if ( Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLEAPI || Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE @@ -687,13 +689,12 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { }, }; } + // Creating intent and request map to be sent to the app on launch const messageIntent = { action: CONSTANTS.SEARCH, data: data, context: { source: CONSTANTS.DEVICE }, }; - // intent to be sent to the app on launch - // create the request map const requestMap = { method: CONSTANTS.DISCOVERY_LAUNCH, params: { [CONSTANTS.APP_ID]: appId, [CONSTANTS.INTENT]: messageIntent }, From 8bc4e37b2d31962502d00641dafe9975d00fde1c Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Tue, 9 Jul 2024 11:30:14 +0530 Subject: [PATCH 238/359] 2166 addressing review comments --- .../Manage/UserGrantsManage.feature | 22 ++-- .../FireboltCertification/UserGrants.feature | 86 +++++++------- .../fixtures/fireboltCalls/localization.json | 7 +- .../objects/moduleReqId/moduleReqId.json | 108 +++++++++--------- 4 files changed, 110 insertions(+), 113 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature b/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature index 885ad2a3..064c1378 100644 --- a/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature @@ -2,7 +2,7 @@ Feature: UserGrants_Manage # First allowing the grant and calling usergrants.app then checking grant using Capabilities.granted @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation - Scenario: Usergrants.app - Positive Scenario: with grant(ackchallenge) + Scenario: Usergrants.app R.5.1.2 - Positive Scenario: with grant(ackchallenge) Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And Framework registers 'ackchallenge' test provider @@ -17,7 +17,7 @@ Feature: UserGrants_Manage # First allowing the grant for device.distributor for the device and calling usergrants.device and validating. @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation - Scenario: Usergrants.device - Positive Scenario: with grant(ackchallenge) + Scenario: Usergrants.device R.5.1.3 - Positive Scenario: with grant(ackchallenge) Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And Framework registers 'ackchallenge' test provider @@ -30,7 +30,7 @@ Feature: UserGrants_Manage # First allowing the grant and calling usergrants.capability then checking grant using Capabilities.granted @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation - Scenario: Usergrants.capability - Positive Scenario: with grant(ackchallenge) + Scenario: Usergrants.capability R.5.1.4 - Positive Scenario: with grant(ackchallenge) Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And Framework registers 'ackchallenge' test provider @@ -53,14 +53,14 @@ Feature: UserGrants_Manage Then 'Firebolt' platform responds to '1st party app' with '' Examples: - | Scenario | Grant_Key | Grant_Method_Content | Key | Validation_Key | Method | - | grant capability at device level | grant device distributor capability | null for usergrants grant | get usergrants for device | expected list of grants for device | grant | - | grant capability at app level | grant device id capability | null for usergrants grant | get usergrants for 3rd party app | expected list of grants for 3rd party app | grant | - | deny capability at device level | deny device distributor capability | null for usergrants deny | get usergrants for device | expected list of denied grants for device | deny | - | deny capability at app level | deny device id capability | null for usergrants deny | get usergrants for 3rd party app | expected list of denied grants for 3rd party app | deny | + | Scenario | Grant_Key | Grant_Method_Content | Key | Validation_Key | Method | + | grant capability at device level | grant device distributor capability | null for usergrants grant | get usergrants for device | expected list of grants for device | grant R.5.1.5 | + | grant capability at app level | grant device id capability | null for usergrants grant | get usergrants for 3rd party app | expected list of grants for 3rd party app | grant R.5.1.5 | + | deny capability at device level | deny device distributor capability | null for usergrants deny | get usergrants for device | expected list of denied grants for device | deny R.5.1.6 | + | deny capability at app level | deny device id capability | null for usergrants deny | get usergrants for 3rd party app | expected list of denied grants for 3rd party app | deny R.5.1.6 | @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation - Scenario Outline: Usergrants.clear - Positive Scenario: + Scenario Outline: Usergrants.clear R.5.1.7 - Positive Scenario: Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And Framework registers 'ackchallenge' test provider @@ -158,7 +158,7 @@ Feature: UserGrants_Manage | invalid appId | request | get usergrants request with invalid options appId parameter | invalid parameter for usergrants request | @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capability - Positive Scenario: by clearing the grant and validating usergrants.capability as empty + Scenario: UserGrants.Capability R.5.1.4 - Positive Scenario: by clearing the grant and validating usergrants.capability as empty Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And Framework registers 'ackchallenge' test provider @@ -174,7 +174,7 @@ Feature: UserGrants_Manage Then 'Firebolt' platform responds with 'null for capabilities granted' @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation - Scenario: Usergrants.app - Positive Scenario: by clearing the grant and validating usergrants.app as empty + Scenario: Usergrants.app R.5.1.2 - Positive Scenario: by clearing the grant and validating usergrants.app as empty Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And Framework registers 'ackchallenge' test provider diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature index 045df031..2735ab02 100644 --- a/cypress/TestCases/FireboltCertification/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -4,14 +4,14 @@ Feature: UserGrants # Case-1: Validating by allowing the grant # Case-2: Validating by denying the grant (using pinchallenge and acknowledge). @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Grant - Positive Scenario: Validate Capabilities with denied (pinChallenge) and lifespan once + Scenario: UserGrants.Grant R*2.2.2.1 - Positive Scenario: Validate Capabilities with denied (pinChallenge) and lifespan once Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched # Case-1 And Framework registers 'pinChallenge' test provider And User 'starts' recording lifecycle history for '3rd party app' When '3rd party app' invokes the 'Firebolt' API to 'get postalcode' - Then 'Firebolt' platform responds with '20850 for localization postalcode' + Then 'Firebolt' platform responds with 'expected value for localization postalcode' When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for postalcode' Then 'Firebolt' platform responds with 'null for capabilities granted' When User 'stops' recording lifecycle history for '3rd party app' @@ -28,7 +28,7 @@ Feature: UserGrants # Testing with grantPolicy having one option with one step(here step with acknowledge) @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capability Grant access with one step option(only acknowledgeChallenge) + Scenario: UserGrants.Capabilities R.2.1.1 - Positive Scenario: Validate Capability Grant access with one step option(only acknowledgeChallenge) Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And Framework registers 'ackchallenge' test provider @@ -42,9 +42,9 @@ Feature: UserGrants # Testing with grantPolicy having with scope device and grant access, so all the apps in that device may have the access # provide access using any 3rd party and check in another 3rd party - # Involves 2 apps, Will be handled in FIRECERT-2194 + # Involves 2 apps, Will be handled in separate ticket @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capability Grant access with scope device + Scenario: UserGrants.Capabilities R.4.4.1.1 - Positive Scenario: Validate Capability Grant access with scope device Given the environment has been set up for 'userGrants' tests # 3rd party app And 3rd party 'certification' app is launched @@ -63,9 +63,9 @@ Feature: UserGrants # Deny access with scope device, so all the apps in that device may not have the access # launch a 3rd party and provide acess using any 3rd party and check in another 3rd party - # Involves 2 apps, Will be handled in FIRECERT-2194 + # Involves 2 apps, Will be handled in separate ticket @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capability access denied for pinChallenge with scope device + Scenario: UserGrants.Capabilities R.4.4.1.1 - Negative Scenario: Validate Capability access denied for pinChallenge with scope device Given the environment has been set up for 'userGrants' tests # 3rd party app And 3rd party 'certification' app is launched @@ -82,7 +82,7 @@ Feature: UserGrants Then 'Firebolt' platform responds with 'false for capabilities granted' # Testing with grantPolicy having device level grant access and check in another device - # Involves multiple devices, Will be handled in FIRECERT-2195 + # Involves multiple devices, Will be handled in separate ticket @Usergrants @coreSDK @sdk @transport @notSupported Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capability permission in 2 diff devices Given the environment has been set up for 'userGrants' tests @@ -106,7 +106,7 @@ Feature: UserGrants # Case-1: Allowing the grant and validating the result # Case-2: Checking the lifecycle history to check ui is not coming and validating for result because already allowed grant in Case-1. @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan forever + Scenario: UserGrants.Capabilities R*2.2.2.2 - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan forever Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched #Case-1 @@ -129,7 +129,7 @@ Feature: UserGrants # Case-1: Denying the grant and validating for error # Case-2: Checking the lifecycle history to check ui is not coming and calling postal code and validating for error because already denied grant in Case-1. @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan forever + Scenario: UserGrants.Capabilities R*2.2.2.2 - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan forever Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched #Case-1 @@ -153,7 +153,7 @@ Feature: UserGrants # Case-2: Closing and launching the app, allowing grant and validating ui is coming again # Added @notSupported as glue is not implemented yet. @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan appActive + Scenario: UserGrants.Capabilities R*2.2.2.3 - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan appActive Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched #Case-1 @@ -180,7 +180,7 @@ Feature: UserGrants # Case-2: Closing and launching the app, denying grant and validating ui is coming again # Added @notSupported as glue is not implemented yet. @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan appActive + Scenario: UserGrants.Capabilities R*2.2.2.3 - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan appActive Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched #Case-1 @@ -208,7 +208,7 @@ Feature: UserGrants # Case-2: Calling the API again within the ttl and it should not ask for grant # Case-3: Calling API after ttl, here it will ask grant again @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (ackchallenge) and lifespan:seconds lifespanTtl:60 sec + Scenario: UserGrants.Capabilities R*2.2.2.5 - Positive Scenario: Validate Capabilities with granted (ackchallenge) and lifespan:seconds lifespanTtl:60 sec Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched #Case-1 @@ -241,7 +241,7 @@ Feature: UserGrants # Case-2: Calling the API again within the ttl and it should not ask for grant # Case-3: Calling API after ttl, here it will ask for grant again @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (ackchallenge) and lifespan:seconds lifespanTtl:60 sec + Scenario: UserGrants.Capabilities R*2.2.2.5 - Negative Scenario: Validate Capabilities with denied (ackchallenge) and lifespan:seconds lifespanTtl:60 sec Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched # Case-1 @@ -273,7 +273,7 @@ Feature: UserGrants # Case-1: Allowing grant and validating the result # Case-2: Before ttl ends rebooting the device and on calling api, it should return result without asking for grant @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with grant(pinChallenge) and lifespan:seconds lifespanTtl:800sec - after reboot within ttl it should not ask for grant + Scenario: UserGrants.Capabilities R*2.2.2.5 - Positive Scenario: Validate Capabilities with grant(pinChallenge) and lifespan:seconds lifespanTtl:800sec - after reboot within ttl it should not ask for grant Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched # Case-1 @@ -302,7 +302,7 @@ Feature: UserGrants # Case-1: Allowing grant and validating the result # Case-2: Reboot the device after ttl, after reboot when API is called again and asks for grant, then deny grant @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with grant(ackchallenge) and lifespan:seconds lifespanTtl:60sec - reboot after ttl and it should ask grant + Scenario: UserGrants.Capabilities R*2.2.2.5 - Positive Scenario: Validate Capabilities with grant(ackchallenge) and lifespan:seconds lifespanTtl:60sec - reboot after ttl and it should ask grant Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched # Case-1 @@ -333,7 +333,7 @@ Feature: UserGrants # Case-1: Deny grant and validate error # Case-2: Before ttl ends rebooting the device, call api and expect to return result without asking for grant @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan:seconds lifespanTtl:800sec - after reboot within ttl and it should not ask grant + Scenario: UserGrants.Capabilities R*2.2.2.5 - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan:seconds lifespanTtl:800sec - after reboot within ttl and it should not ask grant Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched # Case-1 @@ -362,7 +362,7 @@ Feature: UserGrants # Case-1: Deny grant and validate error # Case-2: Reboot device after ttl, after reboot when api is called again, expect to ask grant and then deny grant @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (ackchallenge) and lifespan:seconds lifespanTtl:60sec - reboot after ttl and it should ask grant + Scenario: UserGrants.Capabilities R*2.2.2.5 - Negative Scenario: Validate Capabilities with denied (ackchallenge) and lifespan:seconds lifespanTtl:60sec - reboot after ttl and it should ask grant Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched # Case-1 @@ -390,7 +390,7 @@ Feature: UserGrants # grantPolicy having lifespan:seconds and lifespanTtl:60 seconds @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: privacySetting - autoApplyPolicy:always property-getter:true silently grant + Scenario: UserGrants.Capabilities R*2.2.3.4 - Positive Scenario: privacySetting - autoApplyPolicy:always property-getter:true silently grant Given the environment has been set up for 'userGrants' tests And 1st party app invokes the 'Firebolt' API to 'disable closedCaptions' And 3rd party 'certification' app is launched @@ -406,7 +406,7 @@ Feature: UserGrants # First testcase having grantPolicy with lifespan:seconds and lifespanTtl:60 seconds # Second testcase having lifespan:appActive @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario Outline: UserGrants.Capabilities - Positive Scenario: + Scenario Outline: UserGrants.Capabilities - Positive Scenario: Given the environment has been set up for 'userGrants' tests And 1st party app invokes the 'Firebolt' API to '' And 3rd party 'certification' app is launched @@ -420,13 +420,13 @@ Feature: UserGrants Then 'Firebolt' platform responds with 'false for capabilities granted' Examples: - | Scenario | Key | API_Key | Invalid_Request_Error | Check_Capabilities_Granted | - | Validate Capability autoApplyPolicy:always property-getter:false silently denied | disable closedCaptions | expect error for closedCaptions settings | invalid request for closedCaptions settings | check if accessibility closedCaptions capability is granted with role as use | - | Validate Capability autoApplyPolicy:disallowed property-getter:false silently denied | disable voiceguidance | expect error for voiceGuidance Settings | invalid request for voiceGuidance settings | check if accessibility voiceGuidance capability is granted with role as use | + | Scenario | Key | API_Key | Invalid_Request_Error | Check_Capabilities_Granted | ReqId | + | Validate Capability autoApplyPolicy:always property-getter:false silently denied | disable closedCaptions | expect error for closedCaptions settings | invalid request for closedCaptions settings | check if accessibility closedCaptions capability is granted with role as use | R*2.2.3.4 | + | Validate Capability autoApplyPolicy:disallowed property-getter:false silently denied | disable voiceguidance | expect error for voiceGuidance Settings | invalid request for voiceGuidance settings | check if accessibility voiceGuidance capability is granted with role as use | R*2.2.3.6 | # grantPolicy having lifespan:appActive @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:true silently grant + Scenario: UserGrants.Capabilities R*2.2.3.5 - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:true silently grant Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as true' @@ -440,7 +440,7 @@ Feature: UserGrants # grantPolicy having lifespan:appActive @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:false grant + Scenario: UserGrants.Capabilities R*2.2.3.5 - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:false grant Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as false' @@ -457,7 +457,7 @@ Feature: UserGrants # grantPolicy having lifespan:appActive @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:false deny + Scenario: UserGrants.Capabilities R*2.2.3.5 - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:false deny Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as false' @@ -474,7 +474,7 @@ Feature: UserGrants # grantPolicy having lifespan:appActive @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:disallowed property-getter:true grant + Scenario: UserGrants.Capabilities R*2.2.3.6 - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:disallowed property-getter:true grant Given the environment has been set up for 'userGrants' tests And 1st party app invokes the 'Firebolt' API to 'disable voiceguidance' And 3rd party 'certification' app is launched @@ -492,7 +492,7 @@ Feature: UserGrants # grantPolicy having lifespan:appActive @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:disallowed property-getter:true deny + Scenario: UserGrants.Capabilities R*2.2.3.6 - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:disallowed property-getter:true deny Given the environment has been set up for 'userGrants' tests And 1st party app invokes the 'Firebolt' API to 'disable voiceguidance' And 3rd party 'certification' app is launched @@ -510,7 +510,7 @@ Feature: UserGrants # grantPolicy having lifespan:appActive @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario Outline: UserGrants.Capabilities - Positive Scenario: with privacySetting - + Scenario Outline: UserGrants.Capabilities R*2.2.3.7 - Positive Scenario: with privacySetting - Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And 1st party app invokes the 'Firebolt' API to '' @@ -532,7 +532,7 @@ Feature: UserGrants #grantPolicy having lifespan:appActive @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario Outline: UserGrants.Capabilities - Positive Scenario: with privacySetting - + Scenario Outline: UserGrants.Capabilities R*2.2.3.7 - Positive Scenario: with privacySetting - Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And 1st party app invokes the 'Firebolt' API to '' @@ -554,7 +554,7 @@ Feature: UserGrants #grantPolicy having lifespan:appActive @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario Outline: UserGrants.Capabilities - Positive Scenario:privacySetting - + Scenario Outline: UserGrants.Capabilities - Positive Scenario:privacySetting - Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as true' @@ -570,13 +570,13 @@ Feature: UserGrants Then 'Firebolt' platform responds with 'false for capabilities granted' Examples: - | Scenario | API_Key | Invalid_Request_Error | Method_Content | Check_Capabilities_Granted | - | Validate Capability updateProperty:true - property-getter:true deny property should be set to false | expect error for secondscreen device | invalid request for secondscreen device | false for privacy allow watchHistory | check if secondscreen device capability is granted with role use | - | Validate Capability updateProperty:false - property-getter:true deny property should not be updated | expect error for allow profile flags | invalid request for profile flags | true for privacy allow watchHistory | check if profile flags capability is granted with role use | + | Scenario | API_Key | Invalid_Request_Error | Method_Content | Check_Capabilities_Granted | ReqId | + | Validate Capability updateProperty:true - property-getter:true deny property should be set to false | expect error for secondscreen device | invalid request for secondscreen device | false for privacy allow watchHistory | check if secondscreen device capability is granted with role use | R*2.2.3.9 | + | Validate Capability updateProperty:false - property-getter:true deny property should not be updated | expect error for allow profile flags | invalid request for profile flags | true for privacy allow watchHistory | check if profile flags capability is granted with role use | R*2.2.3.10 | # grantPolicy having lifespan:appActive @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario Outline: UserGrants.Capabilities - Positive Scenario:privacySetting - + Scenario Outline: UserGrants.Capabilities R*2.2.3.9 - Positive Scenario:privacySetting - Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And 1st party app invokes the 'Firebolt' API to '' @@ -601,7 +601,7 @@ Feature: UserGrants # Case-1: Allow grant and validate the result # Case-2: Call API after device is rebooted,expect to ask for grant, deny grant and validate error @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capabilities with grant (pinChallenge) and lifespan powerActive - after reboot deny and validate + Scenario: UserGrants.Capabilities R*2.2.2.4 - Positive Scenario: Validate Capabilities with grant (pinChallenge) and lifespan powerActive - after reboot deny and validate Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched # Case-1 @@ -631,7 +631,7 @@ Feature: UserGrants # Case-1: Deny grant and validate error # Case-2: Call API after device is rebooted,expect to ask for grant, allow grant and validate result @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan powerActive - after reboot grant and validate + Scenario: UserGrants.Capabilities R*2.2.2.4 - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan powerActive - after reboot grant and validate Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched # Case-1 @@ -660,7 +660,7 @@ Feature: UserGrants # 1st example: Call usergrants.request for account.uid with granting acknowledgeChallenge for role use and validate capabilities.info for same capability and check role use is granted and not any other role # 2nd example: Call usergrants.request for account.uid with granting acknowledgeChallenge for role manage and validate capabilities.info for same capability and check role manage is granted and not any other role @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario Outline: UserGrants.request - Positive Scenario: + Scenario Outline: UserGrants.request R.1.1 - Positive Scenario: Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider When 1st party app invokes the 'Firebolt' API to '' @@ -678,7 +678,7 @@ Feature: UserGrants # 1st example: Call usergrants.request for account.uid with denying acknowledgeChallenge for role use and validate capabilities.info for same capability and check role use is denied # 2nd example: Call usergrants.request for account.uid with denying acknowledgeChallenge for role manage and validate capabilities.info for same capability and check role manage is denied @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario Outline: UserGrants.request - Negative Scenario: + Scenario Outline: UserGrants.request R.1.2 - Negative Scenario: Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider When 1st party app invokes the 'Firebolt' API to '' @@ -695,7 +695,7 @@ Feature: UserGrants # Call usergrants.request with securestorage for role use, but the grant policy has role manage, since role mismatch it should return null since no grantpolicy is matched @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.request - Negative Scenario: Validate userGrants.request call with role use, but grantpolicy having manage capability + Scenario: UserGrants.request R.1.1 - Negative Scenario: Validate userGrants.request call with role use, but grantpolicy having manage capability Given the environment has been set up for 'userGrants' tests And Framework registers 'pinChallenge' test provider When 1st party app invokes the 'Firebolt' API to 'request grant for secure storage capability with role use' @@ -708,7 +708,7 @@ Feature: UserGrants Then 'Firebolt' platform responds to '1st party app' with 'granted for secure storage capability with role use' @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.request - Positive Scenario: Validate UserGrants.request which grantpolicy is not present in manifest + Scenario: UserGrants.request R.1.2 - Positive Scenario: Validate UserGrants.request which grantpolicy is not present in manifest Given the environment has been set up for 'userGrants' tests When 1st party app invokes the 'Firebolt' API to 'request grant for device info capability with role use' And 3rd party 'certification' app is launched @@ -749,7 +749,7 @@ Feature: UserGrants # Call capabilities.request for account.uid with granting acknowledgeChallenge for role provide and validate by calling capabilities.info with same capability and check which role manage is granted and not any other role @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.request - Positive Scenario: Validate usergrants.request by granting for role provide + Scenario: UserGrants.request R.2.1.1 - Positive Scenario: Validate usergrants.request by granting for role provide Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider When 1st party app invokes the 'Firebolt' API to 'request grant for account uid capability with role provide' @@ -764,7 +764,7 @@ Feature: UserGrants # Call capabilities.request for account.uid with denying acknowledgeChallenge for role manage and validate by calling capabilities.info with same capability and check which role manage is denied @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.request - Negative Scenario: Validate usergrants.request by denying for role provide + Scenario: UserGrants.request R.2.1.1 - Negative Scenario: Validate usergrants.request by denying for role provide Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider When 1st party app invokes the 'Firebolt' API to 'request grant for account uid capability with role provide' diff --git a/cypress/fixtures/fireboltCalls/localization.json b/cypress/fixtures/fireboltCalls/localization.json index 76ba561f..20005cd2 100644 --- a/cypress/fixtures/fireboltCalls/localization.json +++ b/cypress/fixtures/fireboltCalls/localization.json @@ -293,13 +293,10 @@ "validationJsonPath": "result", "content": "LOCALIZATION_POSTALCODE" }, - "20850_FOR_LOCALIZATION_POSTALCODE":{ + "EXPECTED_VALUE_FOR_LOCALIZATION_POSTALCODE":{ "method": "localization.postalCode", - "event": null, - "context": "noContext", "validationJsonPath": "result", - "content": "LOCALIZATION_POSTALCODE", - "expectingError": false + "content": "LOCALIZATION_POSTALCODE" }, "ONPOSTALCODECHANGED_FOR_LOCALIZATION_POSTALCODE_WITH_12345": { "event": "localization.onPostalCodeChanged", diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 68a93f27..b6704d46 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -683,7 +683,7 @@ } }, "UserGrants": { - "UserGrants.Grant - Positive Scenario: Validate Capabilities with denied (pinChallenge) and lifespan once": { + "UserGrants.Grant R*2.2.2.1 - Positive Scenario: Validate Capabilities with denied (pinChallenge) and lifespan once": { "req": [ { "method": { @@ -693,7 +693,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capability Grant access with one step option(only acknowledgeChallenge)": { + "UserGrants.Capabilities R.2.1.1 - Positive Scenario: Validate Capability Grant access with one step option(only acknowledgeChallenge)": { "req": [ { "method": { @@ -703,7 +703,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capability Grant access with scope device": { + "UserGrants.Capabilities R.4.4.1.1 - Positive Scenario: Validate Capability Grant access with scope device": { "req": [ { "method": { @@ -713,7 +713,7 @@ } ] }, - "UserGrants.Capabilities - Negative Scenario: Validate Capability access denied for pinchallenge with scope device": { + "UserGrants.Capabilities R.4.4.1.1 - Negative Scenario: Validate Capability access denied for pinchallenge with scope device": { "req": [ { "method": { @@ -727,13 +727,13 @@ "req": [ { "method": { - "id": "UserGrants R.4.4.1.1, R.1.1", + "id": "UserGrants 1.1", "description": "Should not be null" } } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan forever": { + "UserGrants.Capabilities R*2.2.2.2 - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan forever": { "req": [ { "method": { @@ -743,7 +743,7 @@ } ] }, - "UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan forever": { + "UserGrants.Capabilities R*2.2.2.2 - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan forever": { "req": [ { "method": { @@ -753,7 +753,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan appActive": { + "UserGrants.Capabilities R*2.2.2.3 - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan appActive": { "req": [ { "method": { @@ -763,7 +763,7 @@ } ] }, - "UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan appActive": { + "UserGrants.Capabilities R*2.2.2.3 - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan appActive": { "req": [ { "method": { @@ -773,7 +773,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capabilities with granted (ackchallenge) and lifespan:seconds lifespanTtl:60 sec": { + "UserGrants.Capabilities R*2.2.2.5 - Positive Scenario: Validate Capabilities with granted (ackchallenge) and lifespan:seconds lifespanTtl:60 sec": { "req": [ { "method": { @@ -783,7 +783,7 @@ } ] }, - "UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (ackchallenge) and lifespan:seconds lifespanTtl:60 sec": { + "UserGrants.Capabilities R*2.2.2.5 - Negative Scenario: Validate Capabilities with denied (ackchallenge) and lifespan:seconds lifespanTtl:60 sec": { "req": [ { "method": { @@ -793,7 +793,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capabilities with grant(pinChallenge) and lifespan:seconds lifespanTtl:800sec - after reboot within ttl it should not ask for grant": { + "UserGrants.Capabilities R*2.2.2.5 - Positive Scenario: Validate Capabilities with grant(pinChallenge) and lifespan:seconds lifespanTtl:800sec - after reboot within ttl it should not ask for grant": { "req": [ { "method": { @@ -803,7 +803,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capabilities with grant(ackchallenge) and lifespan:seconds lifespanTtl:60sec - reboot after ttl and it should ask grant": { + "UserGrants.Capabilities R*2.2.2.5 - Positive Scenario: Validate Capabilities with grant(ackchallenge) and lifespan:seconds lifespanTtl:60sec - reboot after ttl and it should ask grant": { "req": [ { "method": { @@ -813,7 +813,7 @@ } ] }, - "UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan:seconds lifespanTtl:800sec - after reboot within ttl and it should not ask grant": { + "UserGrants.Capabilities R*2.2.2.5 - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan:seconds lifespanTtl:800sec - after reboot within ttl and it should not ask grant": { "req": [ { "method": { @@ -823,7 +823,7 @@ } ] }, - "UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (ackchallenge) and lifespan:seconds lifespanTtl:60sec - reboot after ttl and it should ask grant": { + "UserGrants.Capabilities R*2.2.2.5 - Negative Scenario: Validate Capabilities with denied (ackchallenge) and lifespan:seconds lifespanTtl:60sec - reboot after ttl and it should ask grant": { "req": [ { "method": { @@ -833,7 +833,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: privacySetting - autoApplyPolicy:always property-getter:true silently grant": { + "UserGrants.Capabilities R*2.2.3.4 - Positive Scenario: privacySetting - autoApplyPolicy:always property-getter:true silently grant": { "req": [ { "method": { @@ -843,7 +843,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capability autoApplyPolicy:always property-getter:false silently denied": { + "UserGrants.Capabilities R*2.2.3.4 - Positive Scenario: Validate Capability autoApplyPolicy:always property-getter:false silently denied": { "req": [ { "method": { @@ -853,7 +853,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capability autoApplyPolicy:disallowed property-getter:false silently denied": { + "UserGrants.Capabilities R*2.2.3.6 - Positive Scenario: Validate Capability autoApplyPolicy:disallowed property-getter:false silently denied": { "req": [ { "method": { @@ -863,7 +863,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:true silently grant": { + "UserGrants.Capabilities R*2.2.3.5 - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:true silently grant": { "req": [ { "method": { @@ -873,7 +873,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:false grant": { + "UserGrants.Capabilities R*2.2.3.5 - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:false grant": { "req": [ { "method": { @@ -883,7 +883,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:false deny": { + "UserGrants.Capabilities R*2.2.3.5 - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:allowed property-getter:false deny": { "req": [ { "method": { @@ -893,7 +893,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:disallowed property-getter:true grant": { + "UserGrants.Capabilities R*2.2.3.6 - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:disallowed property-getter:true grant": { "req": [ { "method": { @@ -903,7 +903,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:disallowed property-getter:true deny": { + "UserGrants.Capabilities R*2.2.3.6 - Positive Scenario: Validate Capabilities with privacySetting - autoApplyPolicy:disallowed property-getter:true deny": { "req": [ { "method": { @@ -913,7 +913,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: with privacySetting - Validate Capability autoApplyPolicy:never property-getter:true grant": { + "UserGrants.Capabilities R*2.2.3.7 - Positive Scenario: with privacySetting - Validate Capability autoApplyPolicy:never property-getter:true grant": { "req": [ { "method": { @@ -923,7 +923,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: with privacySetting - Validate Capability autoApplyPolicy:never property-getter:false grant": { + "UserGrants.Capabilities R*2.2.3.7 - Positive Scenario: with privacySetting - Validate Capability autoApplyPolicy:never property-getter:false grant": { "req": [ { "method": { @@ -933,7 +933,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: with privacySetting - Validate Capability autoApplyPolicy:never property-getter:true deny": { + "UserGrants.Capabilities R*2.2.3.7 - Positive Scenario: with privacySetting - Validate Capability autoApplyPolicy:never property-getter:true deny": { "req": [ { "method": { @@ -943,7 +943,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: with privacySetting - Validate Capability autoApplyPolicy:never property-getter:false deny": { + "UserGrants.Capabilities R*2.2.3.7 - Positive Scenario: with privacySetting - Validate Capability autoApplyPolicy:never property-getter:false deny": { "req": [ { "method": { @@ -953,7 +953,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario:privacySetting - Validate Capability updateProperty:true - property-getter:true deny property should be set to false": { + "UserGrants.Capabilities R*2.2.3.9 - Positive Scenario:privacySetting - Validate Capability updateProperty:true - property-getter:true deny property should be set to false": { "req": [ { "method": { @@ -963,7 +963,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario:privacySetting - Validate Capability updateProperty:false - property-getter:true deny property should not be updated": { + "UserGrants.Capabilities R*2.2.3.10 - Positive Scenario:privacySetting - Validate Capability updateProperty:false - property-getter:true deny property should not be updated": { "req": [ { "method": { @@ -973,7 +973,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario:privacySetting - Validate Capability updateProperty:true - property-getter:false grant property should be set to false": { + "UserGrants.Capabilities R*2.2.3.9 - Positive Scenario:privacySetting - Validate Capability updateProperty:true - property-getter:false grant property should be set to false": { "req": [ { "method": { @@ -983,7 +983,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario:privacySetting - Validate Capability updateProperty:true - property-getter:true grant property should not be changed": { + "UserGrants.Capabilities R*2.2.3.9 - Positive Scenario:privacySetting - Validate Capability updateProperty:true - property-getter:true grant property should not be changed": { "req": [ { "method": { @@ -993,7 +993,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario:privacySetting - Validate Capability updateProperty:false - property-getter:false grant property should not be changed": { + "UserGrants.Capabilities R*2.2.3.9 - Positive Scenario:privacySetting - Validate Capability updateProperty:false - property-getter:false grant property should not be changed": { "req": [ { "method": { @@ -1003,7 +1003,7 @@ } ] }, - "UserGrants.Capabilities - Positive Scenario: Validate Capabilities with grant (pinChallenge) and lifespan powerActive - after reboot deny and validate": { + "UserGrants.Capabilities R*2.2.2.4 - Positive Scenario: Validate Capabilities with grant (pinChallenge) and lifespan powerActive - after reboot deny and validate": { "req": [ { "method": { @@ -1013,7 +1013,7 @@ } ] }, - "UserGrants.Capabilities - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan powerActive - after reboot grant and validate": { + "UserGrants.Capabilities R*2.2.2.4 - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan powerActive - after reboot grant and validate": { "req": [ { "method": { @@ -1023,7 +1023,7 @@ } ] }, - "UserGrants.request - Positive Scenario: Validate userGrants.request by granting for role use": { + "UserGrants.request R.1.1 - Positive Scenario: Validate userGrants.request by granting for role use": { "req": [ { "method": { @@ -1033,7 +1033,7 @@ } ] }, - "UserGrants.request - Positive Scenario: Validate userGrants.request by granting for role manage": { + "UserGrants.request R.1.1 - Positive Scenario: Validate userGrants.request by granting for role manage": { "req": [ { "method": { @@ -1043,7 +1043,7 @@ } ] }, - "UserGrants.request - Negative Scenario: Validate userGrants.request by denying for role use": { + "UserGrants.request R.1.2 - Negative Scenario: Validate userGrants.request by denying for role use": { "req": [ { "method": { @@ -1053,7 +1053,7 @@ } ] }, - "UserGrants.request - Negative Scenario: Validate userGrants.request by denying for role manage": { + "UserGrants.request R.1.2 - Negative Scenario: Validate userGrants.request by denying for role manage": { "req": [ { "method": { @@ -1063,7 +1063,7 @@ } ] }, - "UserGrants.request - Negative Scenario: Validate userGrants.request call with role use, but grantpolicy having manage capability": { + "UserGrants.request R.1.1 - Negative Scenario: Validate userGrants.request call with role use, but grantpolicy having manage capability": { "req": [ { "method": { @@ -1073,7 +1073,7 @@ } ] }, - "UserGrants.request - Positive Scenario: Validate UserGrants.request which grantpolicy is not present in manifest": { + "UserGrants.request R.1.2 - Positive Scenario: Validate UserGrants.request which grantpolicy is not present in manifest": { "req": [ { "method": { @@ -1103,7 +1103,7 @@ } ] }, - "UserGrants.request - Positive Scenario: Validate usergrants.request by granting for role provide": { + "UserGrants.request R.2.1.1 - Positive Scenario: Validate usergrants.request by granting for role provide": { "req": [ { "method": { @@ -1113,7 +1113,7 @@ } ] }, - "UserGrants.request - Negative Scenario: Validate usergrants.request by denying for role provide": { + "UserGrants.request R.2.1.1 - Negative Scenario: Validate usergrants.request by denying for role provide": { "req": [ { "method": { @@ -1309,7 +1309,7 @@ } }, "UserGrants_Manage": { - "Usergrants.app - Positive Scenario: with grant(ackchallenge)": { + "Usergrants.app R.5.1.2 - Positive Scenario: with grant(ackchallenge)": { "req": [ { "method": { @@ -1319,7 +1319,7 @@ } ] }, - "Usergrants.device - Positive Scenario: with grant(ackchallenge)": { + "Usergrants.device R.5.1.3 - Positive Scenario: with grant(ackchallenge)": { "req": [ { "method": { @@ -1329,7 +1329,7 @@ } ] }, - "Usergrants.capability - Positive Scenario: with grant(ackchallenge)": { + "Usergrants.capability R.5.1.4 - Positive Scenario: with grant(ackchallenge)": { "req": [ { "method": { @@ -1339,7 +1339,7 @@ } ] }, - "Usergrants.grant - Positive Scenario: grant capability at device level": { + "Usergrants.grant R.5.1.5 - Positive Scenario: grant capability at device level": { "req": [ { "method": { @@ -1349,7 +1349,7 @@ } ] }, - "Usergrants.grant - Positive Scenario: grant capability at app level": { + "Usergrants.grant R.5.1.5 - Positive Scenario: grant capability at app level": { "req": [ { "method": { @@ -1359,7 +1359,7 @@ } ] }, - "Usergrants.deny - Positive Scenario: deny capability at device level": { + "Usergrants.deny R.5.1.6 - Positive Scenario: deny capability at device level": { "req": [ { "method": { @@ -1369,7 +1369,7 @@ } ] }, - "Usergrants.deny - Positive Scenario: deny capability at app level": { + "Usergrants.deny R.5.1.6 - Positive Scenario: deny capability at app level": { "req": [ { "method": { @@ -1379,7 +1379,7 @@ } ] }, - "Usergrants.clear - Positive Scenario: clear grant at device level for role use": { + "Usergrants.clear R.5.1.7 - Positive Scenario: clear grant at device level for role use": { "req": [ { "method": { @@ -1389,7 +1389,7 @@ } ] }, - "Usergrants.clear - Positive Scenario: clear grant at app level for role use": { + "Usergrants.clear R.5.1.7 - Positive Scenario: clear grant at app level for role use": { "req": [ { "method": { @@ -1419,7 +1419,7 @@ } ] }, - "Usergrants.app - Positive Scenario: with grant(pinChallenge)": { + "Usergrants.app R.5.1.2 - Positive Scenario: with grant(pinChallenge)": { "req": [ { "method": { @@ -1429,7 +1429,7 @@ } ] }, - "UserGrants.Capability - Positive Scenario: by clearing the grant and validating usergrants.capability as empty": { + "UserGrants.Capability R.5.1.4 - Positive Scenario: by clearing the grant and validating usergrants.capability as empty": { "req": [ { "method": { @@ -1439,7 +1439,7 @@ } ] }, - "UserGrants.app - Positive Scenario: by clearing the grant and validating usergrants.app as empty": { + "UserGrants.app R.5.1.2 - Positive Scenario: by clearing the grant and validating usergrants.app as empty": { "req": [ { "method": { From 8352bb42431411e087c7d8e79404141b8bf57ed3 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Tue, 9 Jul 2024 17:53:50 +0530 Subject: [PATCH 239/359] 2166 - update scenario name --- .../TestCases/FireboltCertification/UserGrants.feature | 4 ++-- cypress/fixtures/objects/moduleReqId/moduleReqId.json | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature index 2735ab02..63c9d0f7 100644 --- a/cypress/TestCases/FireboltCertification/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -749,7 +749,7 @@ Feature: UserGrants # Call capabilities.request for account.uid with granting acknowledgeChallenge for role provide and validate by calling capabilities.info with same capability and check which role manage is granted and not any other role @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.request R.2.1.1 - Positive Scenario: Validate usergrants.request by granting for role provide + Scenario: UserGrants.request R.1.1 - Positive Scenario: Validate usergrants.request by granting for role provide Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider When 1st party app invokes the 'Firebolt' API to 'request grant for account uid capability with role provide' @@ -764,7 +764,7 @@ Feature: UserGrants # Call capabilities.request for account.uid with denying acknowledgeChallenge for role manage and validate by calling capabilities.info with same capability and check which role manage is denied @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.request R.2.1.1 - Negative Scenario: Validate usergrants.request by denying for role provide + Scenario: UserGrants.request R.1.2 - Negative Scenario: Validate usergrants.request by denying for role provide Given the environment has been set up for 'userGrants' tests And Framework registers 'ackchallenge' test provider When 1st party app invokes the 'Firebolt' API to 'request grant for account uid capability with role provide' diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index b6704d46..52f72162 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -1103,21 +1103,21 @@ } ] }, - "UserGrants.request R.2.1.1 - Positive Scenario: Validate usergrants.request by granting for role provide": { + "UserGrants.request R.1.1 - Positive Scenario: Validate usergrants.request by granting for role provide": { "req": [ { "method": { - "id": "UserGrants R.2.1.1, R.1.1", + "id": "UserGrants R.1.1", "description": "Should not be null" } } ] }, - "UserGrants.request R.2.1.1 - Negative Scenario: Validate usergrants.request by denying for role provide": { + "UserGrants.request R.1.2 - Negative Scenario: Validate usergrants.request by denying for role provide": { "req": [ { "method": { - "id": "UserGrants R.2.1.1, R.1.2", + "id": "UserGrants R.1.2", "description": "Should not be null" } } From 9c2f711b0e42f26e1f846ccf74249181a3c16fbd Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Tue, 9 Jul 2024 18:01:18 +0530 Subject: [PATCH 240/359] 2166 - additional TC --- .../TestCases/FireboltCertification/UserGrants.feature | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature index 63c9d0f7..a9ebf209 100644 --- a/cypress/TestCases/FireboltCertification/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -388,6 +388,16 @@ Feature: UserGrants When User 'stops' recording lifecycle history for '3rd party app' Then User validates lifecycle history for '3rd party app' with 'background:foreground' + # Testing with grantPolicy having not supported capability, so it will return error since capability is not supported + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation + Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capability Without supported capability expecting error + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And Framework registers 'pinChallenge' test provider + # use localization.laton capability which is not supported xrn:firebolt:capability:localization:location + When '3rd party app' invokes the 'Firebolt' API to 'expect error for localization latlon' + Then 'Firebolt' platform responds with 'not supported error for localization latlon' + # grantPolicy having lifespan:seconds and lifespanTtl:60 seconds @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities R*2.2.3.4 - Positive Scenario: privacySetting - autoApplyPolicy:always property-getter:true silently grant From 9c544dec93f9f697fa074790aa576b2925b602eb Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 9 Jul 2024 18:21:21 +0530 Subject: [PATCH 241/359] FIRECERT-2194 Port Test cases to FCS which involves 2 apps --- .../DiscoveryLaunchHot.feature | 33 ++++++- .../Manage/SecureStorageManage.feature | 74 +++++++++++++++ .../SecureStorage.feature | 94 ++++++++++++++++++- .../fireboltCalls/discoverylaunch.json | 5 + .../fixtures/fireboltCalls/securestorage.json | 4 + 5 files changed, 208 insertions(+), 2 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature b/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature index 36aa4c0c..e8e175e9 100644 --- a/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature +++ b/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature @@ -211,4 +211,35 @@ Feature: Discovery.launch_HotLaunch Given the environment has been set up for 'DiscoveryLaunch' tests And '3rd party app' transitions to state 'foreground' When 1st party app invokes the 'Firebolt' API to 'launch app with search intent int source' - Then 'Firebolt' platform responds to '1st party app' with 'invalid parameters for discovery launch' \ No newline at end of file + Then 'Firebolt' platform responds to '1st party app' with 'invalid parameters for discovery launch' + + @DiscoveryLaunch @coreSDK @sdk @transport + Scenario: Discovery.Launch Hot Launch - Positive Scenario: Event validation where one app is in background and one is in foreground + Given the environment has been set up for 'DiscoveryLaunch' tests + And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId + When Test runner waits for 10 'seconds' + And 'secondary 3rd party app' registers for the 'discovery onNavigateTo' event using the 'Firebolt' API + And 3rd party 'certification' app is launched + And '3rd party app' registers for the 'discovery onNavigateTo' event using the 'Firebolt' API + When 1st party app invokes the 'Firebolt' API to 'launch app with home intent' + Then 'Firebolt' platform responds to '1st party app' with 'true for discoverylaunch' + And '3rd party app' invokes the 'Firebolt' API to 'fetch lifecycle state' + Then 'Firebolt' platform responds with 'foreground for lifecycle state' + And 'Firebolt' platform triggers event 'onNavigateTo with home intent' + And 'Firebolt' platform triggers to 'secondary 3rd party app' event 'onNavigateTo with null response' + + @DiscoveryLaunch @coreSDK @sdk @transport + Scenario: Discovery.Launch Hot Launch - Positive Scenario: Event validation where one app is in inactive and one is in foreground + Given the environment has been set up for 'DiscoveryLaunch' tests + And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId + When Test runner waits for 10 'seconds' + And '3rd party app' transitions to state 'inactive' + And 'secondary 3rd party app' registers for the 'discovery onNavigateTo' event using the 'Firebolt' API + And 3rd party 'certification' app is launched + And '3rd party app' registers for the 'discovery onNavigateTo' event using the 'Firebolt' API + When 1st party app invokes the 'Firebolt' API to 'launch app with home intent' + Then 'Firebolt' platform responds to '1st party app' with 'true for discoverylaunch' + And '3rd party app' invokes the 'Firebolt' API to 'fetch lifecycle state' + Then 'Firebolt' platform responds with 'foreground for lifecycle state' + And 'Firebolt' platform triggers event 'onNavigateTo with home intent' + And 'Firebolt' platform triggers to 'secondary 3rd party app' event 'onNavigateTo with null response' diff --git a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature index 3a63bca2..8a728d5e 100644 --- a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature @@ -124,3 +124,77 @@ Feature: SecureStorage_Manage | Passing scope as null | clear secure data values for an app with null scope | | Passing scope as boolean | clear secure data values for an app with boolean scope | | without scope | clear secure data values for an app without scope | + + @SecureStorage @manageSDK + Scenario Outline: SecureStorage.setForApp - Positive Scenario: + Given 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for getting stored value' + Given 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for getting stored value' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + Given 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for getting stored value' + + Examples: + | Scenario | Set_API_Key | API_Key | Method_Validation_Key | Clear_API_Key | + | setForApp with device scope with 2 apps | set secure data value for an app with scope device | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + + @SecureStorage @manageSDK + Scenario Outline: SecureStorage.removeForApp - Positive Scenario: + Given 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for getting stored value' + Given 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for getting stored value' + And 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value for an app' + And 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value for an app' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + And 1st party app invokes the 'Firebolt' API to 'set secure data value1 for second app with scope device' + And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value for an app' + When 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for getting stored value' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + When 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + + Examples: + | Scenario | Remove_API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | Clear_API_Key | + | removeForApp with device scope with 2 apps | remove secure data value for an app with scope device | set secure data value1 for an app with scope device | set secure data value2 for an app with scope device | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | clear stored value with scope as device for an app | + + @SecureStorage @manageSDK + Scenario Outline: SecureStorage.clearForApp - Positive Scenario: + Given 1st party app invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to '1st party app' for '' + And 1st party app invokes the 'Firebolt' API to 'set secure data value1 for second app with scope device' + And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value for an app' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + When 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for getting stored value' + When 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + + + Examples: + | Scenario | Clear_API_Key | API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | + | clearForApp with device scope | clear secure data values for an app with scope device | get stored value for authTestTokenDevice with scope device | set secure data value1 for an app with scope device | set secure data value2 for an app with scope device | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | diff --git a/cypress/TestCases/FireboltCertification/SecureStorage.feature b/cypress/TestCases/FireboltCertification/SecureStorage.feature index 6ef0ec52..b68768a4 100644 --- a/cypress/TestCases/FireboltCertification/SecureStorage.feature +++ b/cypress/TestCases/FireboltCertification/SecureStorage.feature @@ -224,4 +224,96 @@ Feature: SecureStorage | Passing scope as number | clear stored value with scope as number | | Passing scope as null | clear stored value with scope as null | | Passing scope as boolean | clear stored value with scope as boolean | - | without scope | clear stored value without scope | \ No newline at end of file + | without scope | clear stored value without scope | + + @Securestorage @coreSDK @sdk @transport + Scenario Outline: SecureStorage.set - Positive Scenario: Validate + Given '3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds with 'null for clearing stored value' + And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId + Given 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for clearing stored value' + And '3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds with 'null for getting stored value' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for getting stored value' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for updating a secure data value' + When 'secondary 3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for updating a secure data value' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + + Examples: + | Scenario | Get_API_Key | Set_API_Key | Validation_Key | Clear_API_Key | + | Adding scope as device in 2 apps | get stored value with scope as device and key as authTestTokenDevice | update stored value for key authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device | + + @Securestorage @coreSDK @sdk @transport + Scenario Outline: SecureStorage.remove - Positive Scenario: Validate + Given '3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds with 'null for updating a secure data value' + And '3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds with '' + And '3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds with 'null for updating a secure data value' + And '3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds with '' + Given 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for updating a secure data value' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for updating a secure data value' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for removing stored value' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for getting stored value' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with '' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + + + Examples: + | Scenario | Set_API_Key1 | Set_API_Key2 | Remove_API_Key | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | Clear_API_Key | + | Removing device scope in 2 apps | set secure value for key authTestTokenDevice1 | set secure value for key authTestTokenDevice2 | remove the stored value authTestTokenDevice1 with scope device | get stored value for authTestTokenDevice1 with scope device | get stored value for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | clear stored value with scope as device | + + @Securestorage @coreSDK @sdk @transport + Scenario Outline: SecureStorage.clear - Positive Scenario: Clears all the data values + Given '3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds with 'null for updating a secure data value' + And '3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds with 'null for updating a secure data value' + And '3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds with '' + And '3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds with '' + Given 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for updating a secure data value' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for updating a secure data value' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for clearing stored value' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for getting stored value' + When '3rd party app' invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds with 'null for getting stored value' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + + + Examples: + | Scenario | Clear_API_Key | Get_API_Key1 | Get_API_Key2 | Set_API_Key1 | Set_API_Key2 | Validation_Key1 | Validation_Key2 | + | with device scope in 2 apps | clear stored value with scope as device | get stored value with scope as device and key as authTestTokenDevice | get stored value with scope as device and key as authTestTokenDevice1 | update stored value for key authTestTokenDevice | update stored value for key authTestTokenDevice1 | expected value for authTestTokenDevice stored data in securestorage | authTestTokenValue2 for stored value in securestorage | diff --git a/cypress/fixtures/fireboltCalls/discoverylaunch.json b/cypress/fixtures/fireboltCalls/discoverylaunch.json index 1a913187..f6a09579 100644 --- a/cypress/fixtures/fireboltCalls/discoverylaunch.json +++ b/cypress/fixtures/fireboltCalls/discoverylaunch.json @@ -716,5 +716,10 @@ "event": "discovery.onNavigateTo", "validationJsonPath": "eventResponse", "content": "DISCOVERYLAUNCH_SEARCH_INTENT_SOURCE" + }, + "ONNAVIGATETO_WITH_NULL_RESPONSE": { + "event": "discovery.onNavigateTo", + "validationJsonPath": "eventResponse", + "content": "NULL" } } \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/securestorage.json b/cypress/fixtures/fireboltCalls/securestorage.json index 705f1da7..f5c75d24 100644 --- a/cypress/fixtures/fireboltCalls/securestorage.json +++ b/cypress/fixtures/fireboltCalls/securestorage.json @@ -327,6 +327,10 @@ "method": "manage_securestorage.setForApp", "params": "SECURESTORAGE_SETFORAPP_DEVICE_KEY1" }, + "SET_SECURE_DATA_VALUE1_FOR_SECOND_APP_WITH_SCOPE_DEVICE": { + "method": "manage_securestorage.setForApp", + "params": "SECURESTORAGE_SETFORAPP_DEVICE_KEY1_APP1" + }, "SET_SECURE_DATA_VALUE2_FOR_AN_APP_WITH_SCOPE_DEVICE": { "method": "manage_securestorage.setForApp", "params": "SECURESTORAGE_SETFORAPP_DEVICE_KEY2" From 9e3b68859db9313de2492b392e014e05928e4531 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 9 Jul 2024 18:30:13 +0530 Subject: [PATCH 242/359] FIRECERT-2194 removed scenario outline from HdmiInput single testcase --- .../TestCases/FireboltCertification/Manage/HdmiInput.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature index cdf0ca07..828a166a 100644 --- a/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature +++ b/cypress/TestCases/FireboltCertification/Manage/HdmiInput.feature @@ -175,7 +175,7 @@ Feature: HdmiInput_Manage # Needs to confirm whether the event gets triggered. Event parameters are not added yet as they are not known. @HdmiInput @manageSDK @sdk @notsupported - Scenario Outline: HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - hdmiinput.open + Scenario: HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - hdmiinput.open When 1st party app registers for the 'hdmiinput onConnectionChanged' event using the 'Firebolt' API And 1st party app invokes the 'Firebolt' API to 'open HDMI1 port' Then 'Firebolt' platform responds to '1st party app' with 'null for hdmi input open' @@ -184,7 +184,7 @@ Feature: HdmiInput_Manage # Needs to confirm whether the event gets triggered. Event parameters are not added yet as they are not known. @HdmiInput @manageSDK @sdk @notsupported - Scenario Outline: HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - hdmiinput.close + Scenario: HdmiInput.onConnectionChanged - Positive Scenario: Validate Hdmi1 - hdmiinput.close When 1st party app registers for the 'hdmiinput onConnectionChanged' event using the 'Firebolt' API And 1st party app invokes the 'Firebolt' API to 'close HDMI port' Then 'Firebolt' platform responds to '1st party app' with 'null for hdmi input close' From 50c8751e0254ce1ddc67a8e8e64b6575e3cde2dd Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Wed, 10 Jul 2024 10:57:52 +0530 Subject: [PATCH 243/359] Addressed the comments --- cypress/support/step_definitions/fireboltCalls.js | 7 +------ cypress/support/step_definitions/fireboltCalls.md | 15 +++++++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 712c39b4..42e2b04d 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -114,11 +114,6 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = * Given 'test.test.test' invokes the 'Firebolt' API to 'get device id' * Given 'secondary 3rd party app' invokes the 'Firebolt' API to 'get device id' * And '3rd party app' invokes the 'Firebolt' API to 'get device id' on 'device1' device - * - * Note: - * - deviceIdentifier should have values like device1, device2 or device3 - * - When device1 passed it will launch the default 3rd party app - * - Other than device1 passed, launching the app on another devices based on the value associated with device indentifier. */ Given( /'(.+)' invokes the '(.+)' API to '(.+)'(?: on '(.+)' device)?$/, @@ -149,7 +144,7 @@ Given( deviceIdentifier = UTILS.getEnvVariable(deviceIdentifier, false); cy.launchApp(CONSTANTS.CERTIFICATION, appId, deviceIdentifier); } - // Launching the default 3rd party app when device idnetifier has "device1" + // Launching the default 3rd party app when device identifier has "device1" else if (deviceIdentifier === CONSTANTS.DEVICE1) { deviceIdentifier = UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC); cy.launchApp(CONSTANTS.CERTIFICATION, appId, deviceIdentifier); diff --git a/cypress/support/step_definitions/fireboltCalls.md b/cypress/support/step_definitions/fireboltCalls.md index 88fef7fb..5f48848e 100644 --- a/cypress/support/step_definitions/fireboltCalls.md +++ b/cypress/support/step_definitions/fireboltCalls.md @@ -30,7 +30,15 @@ ### Examples: * `Given '3rd party app' invokes the 'Firebolt' API to 'get device id'` * `Given 'test.test.test' invokes the 'Firebolt' API to 'get device id'` -* `And '3rd party app' invokes the 'Firebolt' API to 'get device id' on 'device1' device` +* `Given 'secondary 3rd party app' invokes the 'Firebolt' API to 'get device id'` +* `Given '3rd party app' invokes the 'Firebolt' API to 'get device id' on 'device1' device` + - This should launch the default 3rd party app on device1(this is same as default device) and then call the device.id api +* `Given 'Secondary 3rd party app' invokes the 'Firebolt' API to 'get device id' on 'device2' device` + - This should launch the secondarty 3rd party app on device2 and then call the device.id api +* `Given 'appId' invokes the 'Firebolt' API to 'get device id' on 'device2' device` + - This should launch the app with the appId specified on device2 and then call the device.id api +* `Given 'Secondary 3rd party app' invokes the 'Firebolt' API to 'get device id'` + - If device identifier is not present, there is no need for a launch. It will just need to invoke the api ## '(.+)' registers for the '(.+)' event using the '(.+)' API @@ -43,11 +51,6 @@ | sdk | name of the sdk | | key | key name of the firebolt data contains method/param/context. | -Note: - - deviceIdentifier should have values like device1, device2 or device3 - - When device1 passed it will launch the default 3rd party app - - Other than device1 passed, launching the app on another devices based on the value associated with device indentifier. - ### Examples: * `Given '3rd party app' registers for the 'Closed Captions Settings' event using the 'Firebolt' API` * `Given 'test.test.test' registers for the 'Closed Captions Settings' event using the 'Firebolt' API` From e842941ed885b24b7716bf7289798f7c80018b34 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Wed, 10 Jul 2024 12:23:30 +0530 Subject: [PATCH 244/359] removed app close logic --- .../support/step_definitions/fireboltCalls.js | 172 ++++++++---------- 1 file changed, 80 insertions(+), 92 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 42e2b04d..5d5e6b9b 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -125,7 +125,6 @@ Given( ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : UTILS.checkForSecondaryAppId(appId); let requestTopic, responseTopic; - const deviceName = deviceIdentifier; cy.then(() => { // Failing the test, When device identifier is passed and corresponding value not there in environment variable. @@ -144,112 +143,101 @@ Given( deviceIdentifier = UTILS.getEnvVariable(deviceIdentifier, false); cy.launchApp(CONSTANTS.CERTIFICATION, appId, deviceIdentifier); } - // Launching the default 3rd party app when device identifier has "device1" + // Launching the default 3rd party app when device identifier has 'device1' else if (deviceIdentifier === CONSTANTS.DEVICE1) { deviceIdentifier = UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC); cy.launchApp(CONSTANTS.CERTIFICATION, appId, deviceIdentifier); } - }) - .then(() => { - requestTopic = UTILS.getTopic(appId, null, deviceIdentifier); - responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE, deviceIdentifier); - - // Fetching the data like method, param, context and action etc. - cy.fireboltDataParser(key, sdk).then((parsedDataArr) => { - parsedDataArr.forEach((parsedData) => { - const method = parsedData.method; - const param = parsedData.params; - const context = parsedData.context; - const action = parsedData.action; - const expected = parsedData.expected; - let isNotSupportedApi = false; - - if (UTILS.isScenarioExempted(method, param)) { - isNotSupportedApi = true; - } - if ( - Cypress.env(CONSTANTS.TEST_TYPE) && - Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE - ) { - cy.fetchLifecycleHistory(appId); - } - const communicationMode = UTILS.getCommunicationMode(); - const additionalParams = { - communicationMode: communicationMode, - action: action, - isNotSupportedApi: isNotSupportedApi, - }; - const params = { method: method, methodParams: param }; + }).then(() => { + requestTopic = UTILS.getTopic(appId, null, deviceIdentifier); + responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE, deviceIdentifier); + + // Fetching the data like method, param, context and action etc. + cy.fireboltDataParser(key, sdk).then((parsedDataArr) => { + parsedDataArr.forEach((parsedData) => { + const method = parsedData.method; + const param = parsedData.params; + const context = parsedData.context; + const action = parsedData.action; + const expected = parsedData.expected; + let isNotSupportedApi = false; + + if (UTILS.isScenarioExempted(method, param)) { + isNotSupportedApi = true; + } + if ( + Cypress.env(CONSTANTS.TEST_TYPE) && + Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE + ) { + cy.fetchLifecycleHistory(appId); + } + const communicationMode = UTILS.getCommunicationMode(); + const additionalParams = { + communicationMode: communicationMode, + action: action, + isNotSupportedApi: isNotSupportedApi, + }; + const params = { method: method, methodParams: param }; - // Creating intent message using above details to send it to 3rd party app. - const intentMessage = UTILS.createIntentMessage( - CONSTANTS.TASK.CALLMETHOD, - params, - additionalParams - ); + // Creating intent message using above details to send it to 3rd party app. + const intentMessage = UTILS.createIntentMessage( + CONSTANTS.TASK.CALLMETHOD, + params, + additionalParams + ); + fireLog.info( + `Call from app: ${appId}, device: ${deviceIdentifier || UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC)} - method: ${method} params: ${JSON.stringify(param)}` + ); + if (Cypress.env('isRpcOnlyValidation')) { fireLog.info( - `Call from app: ${appId}, device: ${deviceIdentifier || UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC)} - method: ${method} params: ${JSON.stringify(param)}` + `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` ); - if (Cypress.env('isRpcOnlyValidation')) { - fireLog.info( - `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` - ); - } - - // Adding additional details to created intent if any platform specific data is present in configModule. - cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { - // Sending message to 3rd party app. - cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { - if (!Cypress.env('isRpcOnlyValidation')) { - if (result === CONSTANTS.NO_RESPONSE) { - assert(false, CONSTANTS.NO_MATCHED_RESPONSE); - } - result = JSON.parse(result); - cy.updateResponseForFCS(method, params, result).then((updatedResponse) => { - // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(result); - - // Call the 'censorData' command to hide sensitive data - cy.censorData(method, dataToBeCensored).then((maskedResult) => { - const responseType = result.error ? CONSTANTS.ERROR : CONSTANTS.RESULT; - fireLog.info( - `Response from app: ${appId}, device: ${deviceIdentifier || UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC)} - ${JSON.stringify(maskedResult[responseType])}` - ); - }); - - // If method and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(method, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } + } - // Creating object with method name, params and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - method, - param, - context, - updatedResponse, - expected, - appId + // Adding additional details to created intent if any platform specific data is present in configModule. + cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { + // Sending message to 3rd party app. + cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { + if (!Cypress.env('isRpcOnlyValidation')) { + if (result === CONSTANTS.NO_RESPONSE) { + assert(false, CONSTANTS.NO_MATCHED_RESPONSE); + } + result = JSON.parse(result); + cy.updateResponseForFCS(method, params, result).then((updatedResponse) => { + // Create a deep copy to avoid reference mutation + const dataToBeCensored = _.cloneDeep(result); + + // Call the 'censorData' command to hide sensitive data + cy.censorData(method, dataToBeCensored).then((maskedResult) => { + const responseType = result.error ? CONSTANTS.ERROR : CONSTANTS.RESULT; + fireLog.info( + `Response from app: ${appId}, device: ${deviceIdentifier || UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC)} - ${JSON.stringify(maskedResult[responseType])}` ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); }); - } - }); + + // If method and params are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(method, param)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } + + // Creating object with method name, params and response etc and storing it in a global list for further validation. + const apiAppObject = new apiObject( + method, + param, + context, + updatedResponse, + expected, + appId + ); + UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); + }); + } }); }); }); - }) - .then(() => { - if (deviceIdentifier && deviceName !== CONSTANTS.DEVICE1) { - const publishMessage = UTILS.createIntentMessage( - CONSTANTS.TASK.CALLMETHOD, - { method: 'Lifecycle.close', methodParams: { reason: 'error' } }, - { communicationMode: UTILS.getCommunicationMode() } - ); - cy.sendMessagetoApp(requestTopic, responseTopic, publishMessage); - } }); + }); } ); From 234acc72924774b7ee28852ded4b13705fc3c916 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 10 Jul 2024 12:48:07 +0530 Subject: [PATCH 245/359] FIRECERT-2128-trigger event changes --- cypress/support/constants/constants.js | 4 ++++ .../support/step_definitions/fireboltCalls.js | 20 +++++++++++++------ .../support/step_definitions/fireboltCalls.md | 14 ++++++++++++- defaultModule/requestModules/fcs.js | 14 +++++++++++++ 4 files changed, 45 insertions(+), 7 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 7572448a..d101c535 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -325,6 +325,7 @@ module.exports = { RECORD_LIFECYCLE_HISTORY: 'fcs.recordLifecycleHistory', SETPERFORMANCETESTHANDLER: 'performance.setPerformanceTestHandler', SETLIFECYCLESTATE: 'fcs.setLifecycleState', + TRIGGEREVENT: 'fcs.triggerEvent', FETCH_EVENT_RESPONSE: 'fcs.fetchEventResponse', PERFORMANCE_THRESHOLD_VALIDATOR: 'performance.fetchPerformanceThreshold', CREATE_MARKER: 'performance.createMarker', @@ -457,6 +458,9 @@ module.exports = { SECONDARY_THIRD_PARTY_APP_ID: 'secondary3rdPartyAppId', SECONDARY_APPID_MISSING_ERROR: '`Unable to find the ${envAppIdKey} value in the env, please add the value in configModule/constants/config.json`', + TRIGGER_EVENT_MISSING: 'triggerEvent request override function to set event values not implemented by underlying platform', + TRIGGER_EVENT_REQUEST: 'Request sent to platform to trigger event: ', + TRIGGER_EVENT_SUCCESS: 'Event triggered successfully' }; function getSanityReportPath() { // Check if Cypress is defined, for cypress test context diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index aaafe7a9..0c5b7f3c 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -527,15 +527,23 @@ Given( ); /** - * @function User triggers event with value '{}}' - * @description sending message to platform to make post call to set values. - * @param {String} key - Name of event to be called. + * @function User triggers event with value as '(.+)' + * @description sending message to platform to make post call to set event values. + * @param {String} key - key name of the event data * @example - * And User triggers event with value as ' DEVICE_ONHDCPCHANGED_EVENTS' + * And User triggers event with value as 'onColorimetryChanged event with colorimetry as BT2020cYCC' */ Given(/User triggers event with value as '(.+)'/, (key) => { - fireLog.info(CONSTANTS.STEP_DEFINITION_NEEDS_TO_IMPLEMENT).then(() => { - throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); + const requestMap = { + method: CONSTANTS.REQUEST_OVERRIDE_CALLS.TRIGGEREVENT, + params: { key: key}, + }; + cy.log(CONSTANTS.TRIGGER_EVENT_REQUEST + JSON.stringify(requestMap)).then(() => { + cy.sendMessagetoPlatforms(requestMap).then((result) => { + if (result) { + logger.info(CONSTANTS.TRIGGER_EVENT_SUCCESS); + } + }); }); }); diff --git a/cypress/support/step_definitions/fireboltCalls.md b/cypress/support/step_definitions/fireboltCalls.md index a4fbb3ae..14be583a 100644 --- a/cypress/support/step_definitions/fireboltCalls.md +++ b/cypress/support/step_definitions/fireboltCalls.md @@ -127,4 +127,16 @@ Note: Key name value is an object and it can contains data as below * `And '1st party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` * `And '3rd party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` * `And '3rd party app' invokes the 'Firebolt' get API` -* `And 'test_app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` \ No newline at end of file +* `And 'test_app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` + +## User triggers event with value as '(.+)' + +### Purpose: sending message to platform to make post call to set event values. + +### Params: +| Param | Definition | +| --- | --- | +| key | key name of the event data | + +### Examples: +* `And User triggers event with value as 'onColorimetryChanged event with colorimetry as BT2020cYCC'` diff --git a/defaultModule/requestModules/fcs.js b/defaultModule/requestModules/fcs.js index fc1336e8..08f958f4 100644 --- a/defaultModule/requestModules/fcs.js +++ b/defaultModule/requestModules/fcs.js @@ -109,4 +109,18 @@ function fetchEventResponse(parsedParam) { } } +/** + * @module fcs + * @function triggerEvent + * @description sending message to platform to make post call to set event values. + * @param {String} key - key name of the event data + * @example + * triggerEvent('onColorimetryChanged event with colorimetry as BT2020cYCC') + */ +function triggerEvent(key) { + fireLog.info(CONSTANTS.TRIGGER_EVENT_MISSING).then(() => { + throw new Error(CONSTANTS.TRIGGER_EVENT_MISSING); + }); +} + module.exports = { setResponse, setTestProvider, setLifecycleState, fetchEventResponse }; From 8e4a4e11e0248f3538179558a21ac41b1de340ac Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 10 Jul 2024 13:08:26 +0530 Subject: [PATCH 246/359] FIRECERT-2128-lint fix --- cypress/support/constants/constants.js | 5 +++-- cypress/support/step_definitions/fireboltCalls.js | 2 +- defaultModule/requestModules/fcs.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index d101c535..fefda93b 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -458,9 +458,10 @@ module.exports = { SECONDARY_THIRD_PARTY_APP_ID: 'secondary3rdPartyAppId', SECONDARY_APPID_MISSING_ERROR: '`Unable to find the ${envAppIdKey} value in the env, please add the value in configModule/constants/config.json`', - TRIGGER_EVENT_MISSING: 'triggerEvent request override function to set event values not implemented by underlying platform', + TRIGGER_EVENT_MISSING: + 'triggerEvent request override function to set event values not implemented by underlying platform', TRIGGER_EVENT_REQUEST: 'Request sent to platform to trigger event: ', - TRIGGER_EVENT_SUCCESS: 'Event triggered successfully' + TRIGGER_EVENT_SUCCESS: 'Event triggered successfully', }; function getSanityReportPath() { // Check if Cypress is defined, for cypress test context diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 0c5b7f3c..8c3fc0aa 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -536,7 +536,7 @@ Given( Given(/User triggers event with value as '(.+)'/, (key) => { const requestMap = { method: CONSTANTS.REQUEST_OVERRIDE_CALLS.TRIGGEREVENT, - params: { key: key}, + params: { key: key }, }; cy.log(CONSTANTS.TRIGGER_EVENT_REQUEST + JSON.stringify(requestMap)).then(() => { cy.sendMessagetoPlatforms(requestMap).then((result) => { diff --git a/defaultModule/requestModules/fcs.js b/defaultModule/requestModules/fcs.js index 08f958f4..d01a3df0 100644 --- a/defaultModule/requestModules/fcs.js +++ b/defaultModule/requestModules/fcs.js @@ -123,4 +123,4 @@ function triggerEvent(key) { }); } -module.exports = { setResponse, setTestProvider, setLifecycleState, fetchEventResponse }; +module.exports = { setResponse, setTestProvider, setLifecycleState, fetchEventResponse, triggerEvent }; From 6f76f7305adcec1228f653b32caa8814bca1f364 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 10 Jul 2024 13:11:14 +0530 Subject: [PATCH 247/359] FIRECERT-2128-lint fix --- defaultModule/requestModules/fcs.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/defaultModule/requestModules/fcs.js b/defaultModule/requestModules/fcs.js index d01a3df0..c549420b 100644 --- a/defaultModule/requestModules/fcs.js +++ b/defaultModule/requestModules/fcs.js @@ -123,4 +123,10 @@ function triggerEvent(key) { }); } -module.exports = { setResponse, setTestProvider, setLifecycleState, fetchEventResponse, triggerEvent }; +module.exports = { + setResponse, + setTestProvider, + setLifecycleState, + fetchEventResponse, + triggerEvent, +}; From 46d27cdd03bed93257dab1536fa82db905b6bead Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 10 Jul 2024 16:54:54 +0530 Subject: [PATCH 248/359] FIRECERT-2128 addressed comment --- .../support/step_definitions/fireboltCalls.js | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 8c3fc0aa..c2576ae1 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -534,15 +534,18 @@ Given( * And User triggers event with value as 'onColorimetryChanged event with colorimetry as BT2020cYCC' */ Given(/User triggers event with value as '(.+)'/, (key) => { - const requestMap = { - method: CONSTANTS.REQUEST_OVERRIDE_CALLS.TRIGGEREVENT, - params: { key: key }, - }; - cy.log(CONSTANTS.TRIGGER_EVENT_REQUEST + JSON.stringify(requestMap)).then(() => { - cy.sendMessagetoPlatforms(requestMap).then((result) => { - if (result) { - logger.info(CONSTANTS.TRIGGER_EVENT_SUCCESS); - } + cy.fireboltDataParser(key).then((parsedData) => { + let value = parsedData[0].params; + const requestMap = { + method: CONSTANTS.REQUEST_OVERRIDE_CALLS.TRIGGEREVENT, + params: { value: value }, + }; + cy.log(CONSTANTS.TRIGGER_EVENT_REQUEST + JSON.stringify(requestMap)).then(() => { + cy.sendMessagetoPlatforms(requestMap).then((result) => { + if (result) { + logger.info(CONSTANTS.TRIGGER_EVENT_SUCCESS); + } + }); }); }); }); From 6569f4b00a21885ce4ff3b4c2738cf37e84f9807 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 10 Jul 2024 16:58:53 +0530 Subject: [PATCH 249/359] FIRECERT-2128 addressed comment --- cypress/support/step_definitions/fireboltCalls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index c2576ae1..5f971164 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -535,7 +535,7 @@ Given( */ Given(/User triggers event with value as '(.+)'/, (key) => { cy.fireboltDataParser(key).then((parsedData) => { - let value = parsedData[0].params; + const value = parsedData[0].params; const requestMap = { method: CONSTANTS.REQUEST_OVERRIDE_CALLS.TRIGGEREVENT, params: { value: value }, From 921d4078a16d2750ff62f65b500a920ce72f6b81 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 10 Jul 2024 17:03:27 +0530 Subject: [PATCH 250/359] FIRECERT-2128 addressed comment --- cypress/support/step_definitions/fireboltCalls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 5f971164..3d975e71 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -543,7 +543,7 @@ Given(/User triggers event with value as '(.+)'/, (key) => { cy.log(CONSTANTS.TRIGGER_EVENT_REQUEST + JSON.stringify(requestMap)).then(() => { cy.sendMessagetoPlatforms(requestMap).then((result) => { if (result) { - logger.info(CONSTANTS.TRIGGER_EVENT_SUCCESS); + console.log(CONSTANTS.TRIGGER_EVENT_SUCCESS); } }); }); From 9944ec541d8ec8a5e8b9f27466a555d0f32e9db9 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Wed, 10 Jul 2024 19:28:11 +0530 Subject: [PATCH 251/359] FIRECERT-2112 addressed review comments-1 --- cypress/plugins/testDataProcessor.js | 3 - cypress/support/appObjectConfigs.js | 9 +-- cypress/support/constants/constants.js | 2 +- cypress/support/cypress-commands/assertion.js | 56 +++++++++++-------- cypress/support/cypress-support/src/utils.js | 6 +- 5 files changed, 40 insertions(+), 36 deletions(-) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index abbd37b8..e78ad412 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -487,9 +487,6 @@ function combineValidationObjectsJson() { // Function to print logs when data is having "no data" else returning as is. function paramDataLogs(paramData, dataIdentifier, defaultRetVal, requestType) { if (paramData == CONSTANTS.NO_DATA) { - logger.info( - `Expected ${requestType || 'data'} ${dataIdentifier} was not found in fixtures. Returning ${dataIdentifier} as is.` - ); return defaultRetVal; } else { return paramData; diff --git a/cypress/support/appObjectConfigs.js b/cypress/support/appObjectConfigs.js index 05cb12be..d91cbb2a 100644 --- a/cypress/support/appObjectConfigs.js +++ b/cypress/support/appObjectConfigs.js @@ -59,14 +59,15 @@ class eventObject { this.eventTime = response.eventTime; } else { cy.logValidationResult( - ' Did not receive eventResponse,' + ' Actual: ' + response.eventResponse, + ' Did not receive eventResponse,' + ' Actual: ' + typeof response == 'string' + ? response + : JSON.stringify(response), CONSTANTS.FAIL, CONSTANTS.SKIPPED, CONSTANTS.SKIPPED ).then(() => { - const pretext = 'Event Not Received : '; - - fireLog.equal(response.eventResponse, content, pretext); + const pretext = 'Event Not Received '; + assert(false, pretext); }); } } diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index ae756ffe..b76d758c 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -103,7 +103,7 @@ module.exports = { ERROR_INSIDE_RESULT_CHECK: 'Error inside Result check', ERROR_LIFECYCLE_STATE_VALIDATION: 'Lifecycle state validation failed due to following error - ', ERROR_LIST: ['Method not found', 'Method Not Implemented'], - ERROR_MESSAGE_VALIDATION: 'Error Message Validation: ', + ERROR_MESSAGE_VALIDATION: 'Error Message Validation ', ERROR_NOT_UNDEFINED_CHECK: 'Error not undefined Check', ERROR_NULL_CHECK: 'Error null Check', ERROR_SCHEMA_OBJECTS_PATH: 'cypress/fixtures/objects/errorObjects/errorSchemaObject.json', diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index 4eda191f..d604f5c5 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -142,8 +142,13 @@ Cypress.Commands.add( const checkErrorMessage = errorContentObject.errorMessage.some((errorMessage) => apiErrorResponse.message.includes(errorMessage) ); - const pretext = - CONSTANTS.ERROR_MESSAGE_VALIDATION + 'Expected ' + checkErrorMessage + ' to be true'; + let pretext = CONSTANTS.ERROR_MESSAGE_VALIDATION + `for ${method} : `; + if (checkErrorMessage) { + pretext = pretext + `apiResponse errorMessage is present in errorContent object list`; + } else { + pretext = + pretext + `apiResponse errorMessage is not present in errorContent object list`; + } fireLog.equal(checkErrorMessage, true, pretext); }); } else { @@ -218,27 +223,32 @@ Cypress.Commands.add( ) { skipSchema = true; } - // Verifying whether the error is undefined or not in the response received. - cy.errorNotUndefinedCheck(response) - .then((result) => { - // Pushing the validation status object into an array. - validationCheck.push(result); - }) - .then(() => { - if (apiSchemaResult && !skipSchema) { - // Validating the schema validation result - cy.schemaValidationCheck(apiSchemaResult).then((result) => { - let isNullCheckSkipped = false; - - // Enable the isNullCheckSkipped flag when an error is not present in the response and the schema is passed without expecting an error. - if (response.error == null || response.error == undefined) { - result.validationStatus == CONSTANTS.PASS && errorExpected != CONSTANTS.ERROR - ? (isNullCheckSkipped = true) - : (isNullCheckSkipped = false); - } - }); - } - }) + cy.then(() => { + if (apiSchemaResult && !skipSchema) { + // Validating the schema validation result + cy.schemaValidationCheck(apiSchemaResult).then((result) => { + let isNullCheckSkipped = false; + + // Enable the isNullCheckSkipped flag when an error is not present in the response and the schema is passed without expecting an error. + if (response.error == null || response.error == undefined) { + result.validationStatus == CONSTANTS.PASS && errorExpected != CONSTANTS.ERROR + ? (isNullCheckSkipped = true) + : (isNullCheckSkipped = false); + } + // Checking if the error is null in the response and if the error is expected or not. + if (!UTILS.getEnvVariable(CONSTANTS.IS_SCENARIO_EXEMPTED, false)) { + cy.errorNullCheck(response, errorExpected, isNullCheckSkipped).then((result) => { + validationCheck.push(result); + }); + } + }); + } else { + // Checking if the error is null in the response and if the error is expected or not. + cy.errorNullCheck(response, errorExpected).then((result) => { + validationCheck.push(result); + }); + } + }) .then(() => { if (apiSchemaResult) { // Validating the schema validation result diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 9dbbfbd8..84918b28 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -285,11 +285,7 @@ function getApiOrEventObjectFromGlobalList(method, context, appId, validationTyp ); // Failing when the filteredObjectList is empty. - assert.isNotEmpty( - filteredObjectList, - `Required response not found in ${validationType} object list` - ); - + assert.isNotEmpty(filteredObjectList, `Could not find the api response in api list `); // When the context is empty, the most recent apiOrEventObject is obtained from the filtered list. // If the context is not empty, the filtered list is iterated, and the API object that has the same context is retrieved. if (context == undefined) { From de2260cf9bd9ce2912cbe927e98198f921f80d8d Mon Sep 17 00:00:00 2001 From: neeradanelxsi Date: Wed, 10 Jul 2024 16:25:21 -0400 Subject: [PATCH 252/359] FixDefaultModule : Pushing fix --- cypress/plugins/common.js | 3 +-- defaultModule/appTransport/index.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cypress/plugins/common.js b/cypress/plugins/common.js index c7b92edd..be2a4364 100644 --- a/cypress/plugins/common.js +++ b/cypress/plugins/common.js @@ -28,8 +28,7 @@ function genericSupport(config) { try { data = JSON.parse(fs.readFileSync('supportConfig.json')); } catch (error) { - logger.error('Received following error while trying to read supportConfig json', error); - return config; + logger.info('Received following error while trying to read supportConfig json', error); } // Get the arguments passed from command line during run time. diff --git a/defaultModule/appTransport/index.js b/defaultModule/appTransport/index.js index c2b609b0..9557a64e 100644 --- a/defaultModule/appTransport/index.js +++ b/defaultModule/appTransport/index.js @@ -16,8 +16,8 @@ * SPDX-License-Identifier: Apache-2.0 */ const logger = require('../../../cypress/support/Logger')('index.js'); -const constants = require('../../cypress/support/constants/constants'); -const { getEnvVariable } = require('../../cypress/support/cypress-support/src/utils'); +const constants = require('../../../cypress/support/constants/constants'); +const { getEnvVariable } = require('../../../cypress/support/cypress-support/src/utils'); const client = { ws: null, From 640ce022abd6f87ed8d4feca3faa9d948efa2914 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 11 Jul 2024 11:37:26 +0530 Subject: [PATCH 253/359] FIRECERT-2128-addressed comment --- cypress/support/constants/constants.js | 7 +++---- cypress/support/step_definitions/fireboltCalls.js | 6 +++--- cypress/support/step_definitions/fireboltCalls.md | 2 +- defaultModule/requestModules/fcs.js | 4 ++-- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index fefda93b..cb364790 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -55,6 +55,7 @@ module.exports = { COMBINEVALIDATIONOBJECTSJSON: 'combineValidationObjectsJson', COMMUNICATION_MODE: 'communicationMode', CONFIG: 'CONFIG', + CONFIG_IMPLEMENTATION_MISSING: 'Config module implementation missing', CONFIG_MODULE_SETRESPONSE_PATH: 'cypress/fixtures/external/setResponseData.json', CONTENT: 'Content', CONTEXT: 'Context', @@ -458,10 +459,8 @@ module.exports = { SECONDARY_THIRD_PARTY_APP_ID: 'secondary3rdPartyAppId', SECONDARY_APPID_MISSING_ERROR: '`Unable to find the ${envAppIdKey} value in the env, please add the value in configModule/constants/config.json`', - TRIGGER_EVENT_MISSING: - 'triggerEvent request override function to set event values not implemented by underlying platform', - TRIGGER_EVENT_REQUEST: 'Request sent to platform to trigger event: ', - TRIGGER_EVENT_SUCCESS: 'Event triggered successfully', + SET_EVENT_REQUEST: 'Request sent to set event values in platform: ', + SET_EVENT_SUCCESS: 'Event value set successfully in platform', }; function getSanityReportPath() { // Check if Cypress is defined, for cypress test context diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 3d975e71..08092002 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -531,7 +531,7 @@ Given( * @description sending message to platform to make post call to set event values. * @param {String} key - key name of the event data * @example - * And User triggers event with value as 'onColorimetryChanged event with colorimetry as BT2020cYCC' + * And User triggers event with value as 'onNetworkChanged events with wifi connected' */ Given(/User triggers event with value as '(.+)'/, (key) => { cy.fireboltDataParser(key).then((parsedData) => { @@ -540,10 +540,10 @@ Given(/User triggers event with value as '(.+)'/, (key) => { method: CONSTANTS.REQUEST_OVERRIDE_CALLS.TRIGGEREVENT, params: { value: value }, }; - cy.log(CONSTANTS.TRIGGER_EVENT_REQUEST + JSON.stringify(requestMap)).then(() => { + cy.log(CONSTANTS.SET_EVENT_REQUEST + JSON.stringify(requestMap)).then(() => { cy.sendMessagetoPlatforms(requestMap).then((result) => { if (result) { - console.log(CONSTANTS.TRIGGER_EVENT_SUCCESS); + console.log(CONSTANTS.SET_EVENT_SUCCESS); } }); }); diff --git a/cypress/support/step_definitions/fireboltCalls.md b/cypress/support/step_definitions/fireboltCalls.md index 14be583a..e3a7e828 100644 --- a/cypress/support/step_definitions/fireboltCalls.md +++ b/cypress/support/step_definitions/fireboltCalls.md @@ -139,4 +139,4 @@ Note: Key name value is an object and it can contains data as below | key | key name of the event data | ### Examples: -* `And User triggers event with value as 'onColorimetryChanged event with colorimetry as BT2020cYCC'` +* `And User triggers event with value as 'onNetworkChanged events with wifi connected'` diff --git a/defaultModule/requestModules/fcs.js b/defaultModule/requestModules/fcs.js index c549420b..c43825cd 100644 --- a/defaultModule/requestModules/fcs.js +++ b/defaultModule/requestModules/fcs.js @@ -118,8 +118,8 @@ function fetchEventResponse(parsedParam) { * triggerEvent('onColorimetryChanged event with colorimetry as BT2020cYCC') */ function triggerEvent(key) { - fireLog.info(CONSTANTS.TRIGGER_EVENT_MISSING).then(() => { - throw new Error(CONSTANTS.TRIGGER_EVENT_MISSING); + fireLog.info(CONSTANTS.CONFIG_IMPLEMENTATION_MISSING).then(() => { + throw new Error(CONSTANTS.CONFIG_IMPLEMENTATION_MISSING); }); } From 3a7395ee1d6ba00497c0a8c869f69d33d167a3c6 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Thu, 11 Jul 2024 14:07:20 +0530 Subject: [PATCH 254/359] FIRECERT-2194 added UserGrants TCs with 2 apps --- .../FireboltCertification/UserGrants.feature | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 cypress/TestCases/FireboltCertification/UserGrants.feature diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature new file mode 100644 index 00000000..987ef95a --- /dev/null +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -0,0 +1,36 @@ +Feature: UserGrants + + # Testing with grantPolicy having with scope device and grant access, so all the apps in that device may have the access + # provide access using any 3rd party and check in another 3rd party + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation + Scenario: UserGrants.Capabilities R.4.4.1.1 - Positive Scenario: Validate Capability Grant access with scope device + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And Framework registers 'pinChallenge' test provider + When '3rd party app' invokes the 'Firebolt' API to 'notify watched content with only entityid' + Then 'Firebolt' platform responds with 'true for watched content in discovery' + When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' + Then 'Firebolt' platform responds with 'true for capabilities granted' + When '3rd party app' invokes the 'Firebolt' API to 'close app with user exit' + And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId + Given 'secondary 3rd party app' invokes the 'Firebolt' API to 'notify watched content with only entityid' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'true for watched content in discovery' + When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' + Then 'Firebolt' platform responds with 'true for capabilities granted' + + # Deny access with scope device, so all the apps in that device may not have the access + # launch a 3rd party and provide acess using any 3rd party and check in another 3rd party + @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation + Scenario: UserGrants.Capabilities R.4.4.1.1 - Negative Scenario: Validate Capability access denied for pinChallenge with scope device + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And Framework registers 'pinChallenge' test provider + When '3rd party app' invokes the 'Firebolt' API to 'expect error while notifying watched content with only entityid' + Then 'Firebolt' platform responds with 'invalid request for discovery watched' + When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' + Then 'Firebolt' platform responds with 'false for capabilities granted' + And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId + When 'secondary 3rd party app' invokes the 'Firebolt' API to 'expect error while notifying watched content with only entityid' + Then 'Firebolt' platform responds to 'secondary 3rd party app' with 'invalid request for discovery watched' + When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' + Then 'Firebolt' platform responds to 'secondary 3rd party app' with 'false for capabilities granted' \ No newline at end of file From 5c2b670c2ea35fbf2e69163f8c990c37cd10791d Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 11 Jul 2024 14:11:42 +0530 Subject: [PATCH 255/359] FIRECERT-2128-addressed comment --- defaultModule/requestModules/fcs.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/defaultModule/requestModules/fcs.js b/defaultModule/requestModules/fcs.js index c43825cd..12f5e09b 100644 --- a/defaultModule/requestModules/fcs.js +++ b/defaultModule/requestModules/fcs.js @@ -115,7 +115,13 @@ function fetchEventResponse(parsedParam) { * @description sending message to platform to make post call to set event values. * @param {String} key - key name of the event data * @example - * triggerEvent('onColorimetryChanged event with colorimetry as BT2020cYCC') + * triggerEvent({method: 'fcs.triggerevent', params: {'value': { + "method": "device.onNetworkChanged", + "result": { + "state": "disconnected", + "type": "ethernet" + } + }}}) */ function triggerEvent(key) { fireLog.info(CONSTANTS.CONFIG_IMPLEMENTATION_MISSING).then(() => { From 5056d156d89e20fbca3c03b447530fea848dcebc Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 11 Jul 2024 14:30:13 +0530 Subject: [PATCH 256/359] Initial commit --- cypress/support/constants/constants.js | 4 +- cypress/support/cypress-commands/commands.js | 291 ++++++++ cypress/support/cypress-support/src/utils.js | 5 + .../support/step_definitions/fireboltCalls.js | 631 +++--------------- .../support/step_definitions/validations.js | 545 ++------------- .../support/validations/schemaValidation.js | 6 +- 6 files changed, 453 insertions(+), 1029 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 7572448a..72307cf9 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -297,8 +297,6 @@ module.exports = { PARAMS: 'Params', PASS: 'PASS', PASSWORD: 'password', - PLATFORM_INVALID_RESPONSE_LOG: - 'Platform returned response in invalid format, which could lead to failures in validations. Response must be an object', PLATFORM_NOT_SUPPORT_LOG: 'Platform does not support method', PLATFORM_NOT_TRIGGER_EVENT: 'Platform MUST not trigger event ', PLATFORM_TRIGGER_EVENT: 'Platform MUST trigger event ', @@ -331,6 +329,8 @@ module.exports = { }, PERFORMANCE_METRICS: 'performanceMetrics', RESPONSE: 'Response: ', + RESPONSE_INVALID_RESPONSE_LOG: + 'Platform or App returned response in invalid format, which could lead to failures in validations. Response must be in JSON RPC format', RESPONSE_NOT_FOUND: 'No_Response', RESPONSE_STATUS: { OK: 'OK', diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 297ca6ae..7e72c665 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -19,6 +19,7 @@ const CONSTANTS = require('../constants/constants'); const { _ } = Cypress; import UTILS, { getEnvVariable } from '../cypress-support/src/utils'; const logger = require('../Logger')('command.js'); +import { apiObject, eventObject } from '../appObjectConfigs'; /** * @module commands @@ -833,3 +834,293 @@ Cypress.Commands.add('clearCache', () => { cy.clearAllSessionStorage(); cy.reload(true); }); + + +Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, task) => { + const { method, params, context, action, expected, appId } = additionalParams; + task = task ? task : CONSTANTS.TASK.CALLMETHOD; + let isNotSupportedApi = false; + + if (UTILS.isScenarioExempted(method, params)) { + isNotSupportedApi = true; + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } + + cy.then(() => { + if (target === 'App') { + const additionalParams = { + communicationMode: UTILS.getCommunicationMode(), + action: action, + isNotSupportedApi: isNotSupportedApi, + }; + const methodKey = task == CONSTANTS.TASK.REGISTEREVENT ? 'event' : 'method'; + const paramKey = task == CONSTANTS.TASK.REGISTEREVENT ? 'params' : 'methodParams'; + + const requestParams = { [methodKey]: method, [paramKey]: params }; + + // Creating intent message using above details to send it to 3rd party app. + const intentMessage = UTILS.createIntentMessage(task, requestParams, additionalParams); + + // Adding additional details to created intent if any platform specific data is present in configModule. + cy.runIntentAddon(task, intentMessage).then((parsedIntent) => { + const requestTopic = UTILS.getTopic(appId); + const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); + cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent); + }); + } else if (target === 'Platform') { + const requestMap = { + method: method, + params: params, + action: action, + task: task, + }; + // Assigning event_param env if param has empty object + if (task == CONSTANTS.TASK.REGISTEREVENT && Object.keys(requestMap.params).length === 0) { + // To Do :debug event_param issue by passing isrequired as false for getEnvVariable,need to debug further + requestMap.params = UTILS.getEnvVariable(CONSTANTS.EVENT_PARAM, false); + } + + cy.sendMessagetoPlatforms(requestMap); + } else { + fireLog.assert(false, `Invalid ${target} target, it should be either app or platfrom`); + } + }).then((response) => { + if (Cypress.env('isRpcOnlyValidation')) { + fireLog.info( + `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` + ); + return; + } + if ( + (response && typeof response == CONSTANTS.TYPE_OBJECT) || + (typeof response == CONSTANTS.TYPE_STRING && + (JSON.parse(response).hasOwnProperty('result') || + JSON.parse(response).hasOwnProperty('error'))) + ) { + if (response === CONSTANTS.NO_RESPONSE) { + assert(false, CONSTANTS.NO_MATCHED_RESPONSE); + } + + response = typeof response == CONSTANTS.TYPE_STRING ? JSON.parse(response) : response; + + if ( + response && + response.error && + response.error.message && + CONSTANTS.ERROR_LIST.includes(response.error.message) + ) { + if (UTILS.getEnvVariable(CONSTANTS.CERTIFICATION) == true) { + fireLog.assert(false, `${target} does not support method: ${method}`); + } else { + fireLog.info(`NotSupported: ${target} does not support method: ${method}`).then(() => { + throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); + }); + } + } + + if (task == CONSTANTS.TASK.REGISTEREVENT) { + if (response && response.result && response.result.hasOwnProperty(CONSTANTS.LISTENING)) { + const eventResponse = { + eventListenerId: response.result.event + '-' + response.id, + eventListenerResponse: response.result, + }; + response.result = eventResponse; + } + if (response && response.error && response.error.message) { + fireLog.assert( + false, + `Event registration failed for event ${method} with error message: ${response.error.message} ` + ); + } + } + + cy.updateResponseForFCS(method, params, response).then((updatedResponse) => { + // Create a deep copy to avoid reference mutation + const dataToBeCensored = _.cloneDeep(response); + + // Call the 'censorData' command to hide sensitive data + cy.censorData(method, dataToBeCensored).then((maskedResult) => { + fireLog.info(`Response from ${target}: ${JSON.stringify(maskedResult)}`); + }); + // Creating object with event name, params, and response etc and storing it in a global list for further validation. + const apiOrEventAppObject = + task === CONSTANTS.TASK.REGISTEREVENT + ? new eventObject(method, params, context, updatedResponse, appId, expected) + : new apiObject(method, params, context, updatedResponse, expected, appId); + + const globalList = + task === CONSTANTS.TASK.REGISTEREVENT + ? CONSTANTS.GLOBAL_EVENT_OBJECT_LIST + : CONSTANTS.GLOBAL_API_OBJECT_LIST; + UTILS.getEnvVariable(globalList).push(apiOrEventAppObject); + }); + } else { + fireLog.info( + `${target} returned response in invalid format, which could lead to failures in validations. Response must be in JSON RPC format - ${response}` + ); + } + }); +}); + +Cypress.Commands.add('methodorEventResponseValidation', (validationType, additionalParams) => { + const { method, context, contentObject, expectingError, appId, eventExpected } = additionalParams; + let validationJsonPath = additionalParams.validationJsonPath; + + // Extracting the api or event object from the global list. + const methodOrEventObject = UTILS.getApiOrEventObjectFromGlobalList( + method, + context, + appId, + validationType + ); + const param = methodOrEventObject.params; + + cy.validateResponseErrorAndSchemaResult(methodOrEventObject, validationType).then(() => { + // If passed method is exception method or expecting a error in response, doing error content validation. + if (UTILS.isScenarioExempted(method, param) || expectingError) { + // If not expecting for an error and it's a exception method, storing "exceptionErrorObject" to errorContent variable to fetch the error content object based on the exception type. + let errorContent = expectingError === true ? contentObject : CONSTANTS.EXCEPTION_ERROR_OBJECT; + cy.validateErrorObject(method, errorContent, validationType, context, appId, param); + } else { + if (validationType == CONSTANTS.EVENT) { + const eventName = methodOrEventObject.eventObjectId; + if (appId === UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { + const requestMap = { + method: CONSTANTS.REQUEST_OVERRIDE_CALLS.FETCH_EVENT_RESPONSE, + params: eventName, + }; + + cy.sendMessagetoPlatforms(requestMap).then((result) => { + cy.updateResponseForFCS(method, null, result, true).then((updatedResponse) => { + cy.saveEventResponse( + updatedResponse, + methodOrEventObject, + eventName, + eventExpected === 'triggers' ? true : false + ); + }); + }); + } else { + const params = { event: eventName }; + // Generating an intent message using the provided information to send it to a third-party app + const intentMessage = UTILS.createIntentMessage(CONSTANTS.TASK.GETEVENTRESPONSE, params); + const requestTopic = UTILS.getTopic(appId); + const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); + cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((response) => { + response = JSON.parse(response); + if ( + response && + response.result && + response.result.hasOwnProperty(CONSTANTS.EVENT_RESPONSE) + ) { + response.result = response.result.eventResponse; + } + cy.updateResponseForFCS(method, null, response, true).then((updatedResponse) => { + cy.saveEventResponse( + updatedResponse, + methodOrEventObject, + eventName, + eventExpected === 'triggers' ? true : false + ); + }); + }); + } + } + + try { + if (contentObject && contentObject.data) { + contentObject.data.forEach((object) => { + if (object.validations) { + const scenario = object.type; + const methodOrEventResponse = + validationType == CONSTANTS.EVENT + ? methodOrEventObject.eventResponse + : validationType == CONSTANTS.METHOD + ? methodOrEventObject.apiResponse + : null; + + // Looping through validationJsonPath to find the valid path for validation. + if (validationJsonPath && Array.isArray(validationJsonPath)) { + const validationPath = validationJsonPath.find((path) => { + if ( + path + .split('.') + .reduce((acc, part) => acc && acc[part], methodOrEventResponse) !== undefined + ) { + return path; + } + }); + validationPath + ? (validationJsonPath = validationPath) + : fireLog.assert( + false, + 'Could not find the valid validation path from the validationJsonPath list' + ); + } + switch (scenario) { + case CONSTANTS.REGEX: + cy.regExValidation( + method, + object.validations[0].type, + validationJsonPath, + methodOrEventResponse + ); + break; + case CONSTANTS.MISC: + cy.miscellaneousValidation(method, object.validations[0], methodOrEventObject); + break; + case CONSTANTS.DECODE: + const decodeType = object.specialCase; + const responseForDecodeValidation = + validationType == CONSTANTS.EVENT + ? methodOrEventResponse + : validationType == CONSTANTS.METHOD + ? methodOrEventResponse.result + : null; + + cy.decodeValidation( + method, + decodeType, + responseForDecodeValidation, + object.validations[0], + null + ); + break; + case CONSTANTS.FIXTURE: + cy.validateContent( + method, + context, + validationJsonPath, + object.validations[0].type, + validationType, + appId + ); + break; + case CONSTANTS.CUSTOM: + cy.customValidation(object, methodOrEventObject); + break; + case CONSTANTS.UNDEFINED: + cy.undefinedValidation(object, methodOrEventObject, validationType); + break; + default: + assert(false, 'Unsupported validation type'); + break; + } + } + }); + } else { + cy.validateContent( + method, + context, + validationJsonPath, + contentObject, + validationType, + appId + ); + } + } catch (error) { + assert(false, `Unable to validate the response: ${error}`); + } + } + }); +}); diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index b277598a..122c155d 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -803,6 +803,11 @@ function parseValue(str) { if (str === 'false') return false; if (!isNaN(str)) return Number(str); + + // If the string contains comma, split it into an array + if (str.includes(',')) { + return str.split(','); + } } return str; diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index aaafe7a9..5c5b57de 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -35,68 +35,22 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = // Fetching the data like method, param, context and action etc. cy.fireboltDataParser(key, sdk).then((parsedDataArr) => { parsedDataArr.forEach((parsedData) => { - const method = parsedData.method; - const params = parsedData.params; - const context = parsedData.context; - const action = parsedData.action; - const expected = parsedData.expected; - const appId = Cypress.env(CONSTANTS.FIRST_PARTY_APPID); - const requestMap = { - method: method, - params: params, - action: action, + const additionalParams = { + method: parsedData.method, + params: parsedData.params, + context: parsedData.context, + action: parsedData.action, + expected: parsedData.expected, + appId: Cypress.env(CONSTANTS.FIRST_PARTY_APPID), }; fireLog.info( - 'Call from 1st party App, method: ' + method + ' params: ' + JSON.stringify(params) + 'Call from 1st party App, method: ' + + parsedData.method + + ' params: ' + + JSON.stringify(parsedData.params) ); - cy.sendMessagetoPlatforms(requestMap).then((response) => { - if (response && typeof response == CONSTANTS.TYPE_OBJECT) { - // If error and the error message having 'Method not found' or 'Method not Implemented' mark the testcase as undefined. - if ( - response && - response.error && - response.error.message && - CONSTANTS.ERROR_LIST.includes(response.error.message) - ) { - if (UTILS.getEnvVariable(CONSTANTS.CERTIFICATION) == true) { - assert(false, `${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`); - } else { - fireLog - .info(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`) - .then(() => { - throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); - }); - } - } - - cy.updateResponseForFCS(method, params, response).then((updatedResponse) => { - // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(response); - - // Call the 'censorData' command to hide sensitive data - cy.censorData(method, dataToBeCensored).then((maskedResult) => { - fireLog.info(`Response from Firebolt platform: ${JSON.stringify(maskedResult)}`); - }); - // If event and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(method, params)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } - // Creating object with event name, params, and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - method, - params, - context, - updatedResponse, - expected, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); - }); - } else { - fireLog.info(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); - } - }); + cy.sendMessageToPlatformOrApp('Platform', additionalParams); }); }); }); @@ -123,90 +77,30 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { : appId === CONSTANTS.THIRD_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : UTILS.checkForSecondaryAppId(appId); - const method = parsedData.method; - const param = parsedData.params; - const context = parsedData.context; - const action = parsedData.action; - const expected = parsedData.expected; - let isNotSupportedApi = false; - if (UTILS.isScenarioExempted(method, param)) { - isNotSupportedApi = true; - } if ( Cypress.env(CONSTANTS.TEST_TYPE) && Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE ) { cy.fetchLifecycleHistory(appId); } - const communicationMode = UTILS.getCommunicationMode(); const additionalParams = { - communicationMode: communicationMode, - action: action, - isNotSupportedApi: isNotSupportedApi, + method: parsedData.method, + params: parsedData.params, + context: parsedData.context, + action: parsedData.action, + expected: parsedData.expected, + appId: appId, }; - const params = { method: method, methodParams: param }; - - // Creating intent message using above details to send it to 3rd party app. - const intentMessage = UTILS.createIntentMessage( - CONSTANTS.TASK.CALLMETHOD, - params, - additionalParams + fireLog.info( + `Call from ${appId}, method: ${parsedData.method} params: ${JSON.stringify(parsedData.params)}` ); - fireLog.info(`Call from ${appId}, method: ${method} params: ${JSON.stringify(param)}`); - if (Cypress.env('isRpcOnlyValidation')) { - fireLog.info( - `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` - ); - } - - // Adding additional details to created intent if any platform specific data is present in configModule. - cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { - const requestTopic = UTILS.getTopic(appId); - const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); - - // Sending message to 3rd party app. - cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { - if (!Cypress.env('isRpcOnlyValidation')) { - if (result === CONSTANTS.NO_RESPONSE) { - assert(false, CONSTANTS.NO_MATCHED_RESPONSE); - } - result = JSON.parse(result); - cy.updateResponseForFCS(method, params, result).then((updatedResponse) => { - // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(result); - - // Call the 'censorData' command to hide sensitive data - cy.censorData(method, dataToBeCensored).then((maskedResult) => { - const responseType = result.error ? CONSTANTS.ERROR : CONSTANTS.RESULT; - fireLog.info( - `Response from ${appId}: ${JSON.stringify(maskedResult[responseType])}` - ); - }); - - // If method and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(method, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } - - // Creating object with method name, params and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - method, - param, - context, - updatedResponse, - expected, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); - }); - } - }); - }); + cy.sendMessageToPlatformOrApp('App', additionalParams); }); }); }); + /** * @module fireboltCalls * @function And '(.+)' registers for the '(.+)' event using the '(.+)' API @@ -229,73 +123,19 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI : appId === CONSTANTS.THIRD_PARTY_APP ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : UTILS.checkForSecondaryAppId(appId); - const event = parsedData.method; - const param = parsedData.params; - const context = parsedData.context ? parsedData.context : CONSTANTS.NO_CONTEXT; - const action = parsedData.action; - const expected = parsedData.expected; - let isNotSupportedApi = false; - if (UTILS.isScenarioExempted(event, param)) { - isNotSupportedApi = true; - } - - const communicationMode = UTILS.getCommunicationMode(); const additionalParams = { - communicationMode: communicationMode, - action: action, - isNotSupportedApi: isNotSupportedApi, + method: parsedData.method, + params: parsedData.params, + context: parsedData.context, + action: parsedData.action, + expected: parsedData.expected, + appId: appId, }; - const params = { event: event, params: param }; - - // Creating intent message using above details to send it to 3rd party app. - const intentMessage = UTILS.createIntentMessage( - CONSTANTS.TASK.REGISTEREVENT, - params, - additionalParams - ); - fireLog.info( - `Registering for the ${event} event using ${appId} with params : ${JSON.stringify(param)}` + `Registering for the ${parsedData.method} event using ${appId} with params : ${JSON.stringify(parsedData.params)}` ); - - cy.runIntentAddon(CONSTANTS.TASK.REGISTEREVENT, intentMessage).then((parsedIntent) => { - const requestTopic = UTILS.getTopic(appId); - const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); - - // Sending message to 3rd party app. - cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { - if (result === CONSTANTS.NO_RESPONSE) { - assert(false, CONSTANTS.NO_MATCHED_RESPONSE); - } - result = JSON.parse(result); - fireLog.info(`Response from ${appId}: ${JSON.stringify(result.result)}`); - if (result && result.result && result.result.hasOwnProperty(CONSTANTS.LISTENING)) { - const eventResponse = { - eventListenerId: result.result.event + '-' + result.id, - eventListenerResponse: result.result, - }; - result.result = eventResponse; - } - cy.updateResponseForFCS(event, params, result).then((updatedResponse) => { - // If event and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(event, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } - - // Creating object with event name, params and response etc and storing it in a global list for further validation. - const eventAppObject = new eventObject( - event, - param, - context, - updatedResponse, - appId, - expected - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); - }); - }); - }); + cy.sendMessageToPlatformOrApp('App', additionalParams, CONSTANTS.TASK.REGISTEREVENT); }); }); }); @@ -313,77 +153,20 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn // Fetching the data like method, param, context and action etc. cy.fireboltDataParser(key, sdk).then((parsedDataArr) => { parsedDataArr.forEach((parsedData) => { - const event = parsedData.method; - const params = parsedData.params; - const context = parsedData.context; - const action = parsedData.action; - const expected = parsedData.expected; - const requestMap = { - method: event, - params: params, - action: action, - task: CONSTANTS.TASK.REGISTEREVENT, + const additionalParams = { + method: parsedData.method, + params: parsedData.params, + context: parsedData.context, + action: parsedData.action, + expected: parsedData.expected, + appId: UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID), }; - const appId = UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID); - // Assigning event_param env if param has empty object - if (Object.keys(requestMap.params).length === 0) { - // To Do :debug event_param issue by passing isrequired as false for getEnvVariable,need to debug further - requestMap.params = UTILS.getEnvVariable(CONSTANTS.EVENT_PARAM, false); - } fireLog.info( - `Registering for the ${event} event using 1st party App with params : ${JSON.stringify( - params + `Registering for the ${parsedData.method} event using 1st party App with params : ${JSON.stringify( + parsedData.params )}` ); - - // Sending the message to platform to register the event. - cy.sendMessagetoPlatforms(requestMap).then((response) => { - if (response && typeof response == CONSTANTS.TYPE_OBJECT) { - // If error and the error message having 'Method not found' or 'Method not Implemented' mark the testcase as undefined. - if ( - response && - response.error && - response.error.message && - CONSTANTS.ERROR_LIST.includes(response.error.message) - ) { - if (UTILS.getEnvVariable(CONSTANTS.CERTIFICATION) == true) { - assert(false, `${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${event}`); - } else { - fireLog - .assert(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${event}`) - .then(() => { - throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); - }); - } - } else if (response && response.error && response.error.message) { - assert( - false, - `Event registration failed for event ${event} with error message: ${response.error.message} ` - ); - } - - cy.updateResponseForFCS(event, params, response).then((updatedResponse) => { - fireLog.info('Response from Firebolt platform: ' + JSON.stringify(response)); - // If event and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(event, params)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } - - // Creating object with event name, params and response etc and storing it in a global list for further validation. - const eventAppObject = new eventObject( - event, - params, - context, - updatedResponse, - appId, - expected - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); - }); - } else { - fireLog.info(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); - } - }); + cy.sendMessageToPlatformOrApp('Platform', additionalParams, CONSTANTS.TASK.REGISTEREVENT); }); }); }); @@ -562,22 +345,29 @@ Given( let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; // runtime environment variable holds attribute and value - Cypress.env('runtime', { + if (!UTILS.getEnvVariable(CONSTANTS.RUNTIME, false)) { + Cypress.env(CONSTANTS.RUNTIME, {}); + } + let object = UTILS.getEnvVariable(CONSTANTS.RUNTIME); + object = Object.assign(object, { attribute: attribute, value: value, }); + // runtime environment variable holds attribute and value + Cypress.env(CONSTANTS.RUNTIME, object); + // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable if (fireboltCallKey) { cy.getFireboltData(fireboltCallKey).then((fireboltData) => { fireboltCallObject = fireboltData; - cy.wrap(UTILS.getEnvVariable('runtime')).then((object) => { + cy.wrap(UTILS.getEnvVariable(CONSTANTS.RUNTIME)).then((object) => { object.fireboltCall = fireboltData; - Cypress.env('runtime', object); + Cypress.env(CONSTANTS.RUNTIME, object); }); }); } else { - fireboltCallObject = UTILS.getEnvVariable('runtime').fireboltCall; + fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; fireboltCallObjectErrorMessage = 'Unable to find the firebolt object in the runtime environment variable'; } @@ -611,7 +401,6 @@ Given( const context = {}; const expected = invalidValue ? 'error' : 'result'; - const appId = Cypress.env(CONSTANTS.FIRST_PARTY_APPID); let action = CONSTANTS.ACTION_CORE.toLowerCase(); // Splitting the method name if it contains an underscore and using the first part to determine the action that decides sdk. @@ -620,66 +409,22 @@ Given( setMethod = setMethod.split('_')[1]; } - // If method and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(setMethod, setParams)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } - const requestMap = { + const additionalParams = { method: setMethod, params: setParams, + context: context, action: action, + expected: expected, + appId: Cypress.env(CONSTANTS.FIRST_PARTY_APPID), }; - cy.log( + fireLog.info( 'Call from 1st party App, method: ' + setMethod + ' params: ' + JSON.stringify(setParams) ); - cy.sendMessagetoPlatforms(requestMap).then((response) => { - if (response && typeof response == CONSTANTS.TYPE_OBJECT) { - // If error and the error message having 'Method not found' or 'Method not Implemented' mark the testcase as undefined. - if ( - response && - response.error && - response.error.message && - CONSTANTS.ERROR_LIST.includes(response.error.message) - ) { - if (UTILS.getEnvVariable(CONSTANTS.CERTIFICATION) == true) { - assert(false, `${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${setMethod}`); - } else { - cy.log(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${setMethod}`).then( - () => { - throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); - } - ); - } - } - - cy.updateResponseForFCS(setMethod, setParams, response).then((updatedResponse) => { - // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(response); - - // Call the 'censorData' command to hide sensitive data - cy.censorData(setMethod, dataToBeCensored).then((maskedResult) => { - cy.log(`Response from Firebolt platform: ${JSON.stringify(maskedResult)}`); - }); - - // Creating object with method name, params, and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - setMethod, - setParams, - context, - updatedResponse, - expected, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); - }); - } else { - cy.log(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); - } - }); + cy.sendMessageToPlatformOrApp('Platform', additionalParams); } }); } else { @@ -706,7 +451,7 @@ Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireb let fireboltCallObject; let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; - // Creating runtime environment variable + // Creating runtime environment variable, if not present if (!UTILS.getEnvVariable(CONSTANTS.RUNTIME, false)) { Cypress.env(CONSTANTS.RUNTIME, {}); } @@ -761,129 +506,29 @@ Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireb Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); } - if (appId == UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { - const requestMap = { - method: method, - params: param, - action: action, - }; + const additionalParams = { + method: method, + params: param, + context: context, + action: action, + expected: expected, + appId: appId, + }; - cy.log( + if (appId == UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { + fireLog.info( 'Call from 1st party App, method: ' + method + ' params: ' + JSON.stringify(param) ); - cy.sendMessagetoPlatforms(requestMap).then((response) => { - if (response && typeof response == CONSTANTS.TYPE_OBJECT) { - // If error and the error message having 'Method not found' or 'Method not Implemented' mark the testcase as undefined. - if ( - response && - response.error && - response.error.message && - CONSTANTS.ERROR_LIST.includes(response.error.message) - ) { - if (UTILS.getEnvVariable(CONSTANTS.CERTIFICATION) == true) { - assert(false, `${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`); - } else { - cy.log(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${method}`).then( - () => { - throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); - } - ); - } - } - - cy.updateResponseForFCS(method, param, response).then((updatedResponse) => { - // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(response); - - // Call the 'censorData' command to hide sensitive data - cy.censorData(method, dataToBeCensored).then((maskedResult) => { - cy.log(`Response from Firebolt platform: ${JSON.stringify(maskedResult)}`); - }); - - // Creating object with method name, param, and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - method, - param, - context, - updatedResponse, - expected, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); - }); - } else { - cy.log(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); - } - }); + cy.sendMessageToPlatformOrApp('Platform', additionalParams); } else { - let isNotSupportedApi = false; - - if (UTILS.isScenarioExempted(method, param)) { - isNotSupportedApi = true; - } if ( Cypress.env(CONSTANTS.TEST_TYPE) && Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE ) { cy.fetchLifecycleHistory(appId); } - const communicationMode = UTILS.getCommunicationMode(); - const additionalParams = { - communicationMode: communicationMode, - action: action, - isNotSupportedApi: isNotSupportedApi, - }; - const params = { method: method, methodParams: param }; - - // Creating intent message using above details to send it to 3rd party app. - const intentMessage = UTILS.createIntentMessage( - CONSTANTS.TASK.CALLMETHOD, - params, - additionalParams - ); - fireLog.info(`Call from ${appId}, method: ${method} params: ${JSON.stringify(param)}`); - if (Cypress.env(CONSTANTS.IS_RPC_ONLY)) { - fireLog.info( - `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` - ); - } - - // Adding additional details to created intent if any platform specific data is present in configModule. - cy.runIntentAddon(CONSTANTS.TASK.CALLMETHOD, intentMessage).then((parsedIntent) => { - const requestTopic = UTILS.getTopic(appId); - const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); - - // Sending message to 3rd party app. - cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { - if (!Cypress.env(CONSTANTS.IS_RPC_ONLY)) { - if (result === CONSTANTS.NO_RESPONSE) { - assert(false, CONSTANTS.NO_MATCHED_RESPONSE); - } - - result = JSON.parse(result); - - // Create a deep copy to avoid reference mutation - const dataToBeCensored = _.cloneDeep(result.report.apiResponse); - - // Call the 'censorData' command to hide sensitive data - cy.censorData(method, dataToBeCensored).then((maskedResult) => { - fireLog.info(`Response from ${appId}: ${JSON.stringify(maskedResult)}`); - }); - - // Creating object with method name, param and response etc and storing it in a global list for further validation. - const apiAppObject = new apiObject( - method, - param, - context, - result.report, - expected, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_API_OBJECT_LIST).push(apiAppObject); - } - }); - }); + cy.sendMessageToPlatformOrApp('App', additionalParams); } } }); @@ -912,22 +557,21 @@ Given( let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; // Creating runtime environment variable - if (!UTILS.getEnvVariable('runtime', false)) { - Cypress.env('runtime', {}); + if (!UTILS.getEnvVariable(CONSTANTS.RUNTIME, false)) { + Cypress.env(CONSTANTS.RUNTIME, {}); } // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable - // TODO: appending the firebolt object will take care in optimization ticket if (fireboltCallKey) { cy.getFireboltData(fireboltCallKey).then((fireboltData) => { fireboltCallObject = fireboltData; - cy.wrap(UTILS.getEnvVariable('runtime')).then((object) => { + cy.wrap(UTILS.getEnvVariable(CONSTANTS.RUNTIME)).then((object) => { object.fireboltCall = fireboltData; - Cypress.env('runtime', object); + Cypress.env(CONSTANTS.RUNTIME, object); }); }); } else { - fireboltCallObject = UTILS.getEnvVariable('runtime').fireboltCall; + fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; fireboltCallObjectErrorMessage = 'Unable to find the firebolt object in the runtime environment variable'; } @@ -957,131 +601,26 @@ Given( event = event.split('_')[1]; } - // If event and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(event, eventParams)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } + const additionalParams = { + method: event, + params: eventParams, + context: context, + action: action, + expected: CONSTANTS.RESULT, + appId: appId, + }; if (appId == UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { - const requestMap = { - method: event, - params: eventParams, - action: action, - task: CONSTANTS.TASK.REGISTEREVENT, - }; - - // Assigning event_param env if param has empty object - if (Object.keys(requestMap.params).length === 0) { - // To Do :debug event_param issue by passing isrequired as false for getEnvVariable,need to debug further - requestMap.params = UTILS.getEnvVariable(CONSTANTS.EVENT_PARAM, false); - } fireLog.info( `Registering for the ${event} event using 1st party App with params : ${JSON.stringify( eventParams )}` ); - // Sending the message to platform to register the event. - cy.sendMessagetoPlatforms(requestMap).then((response) => { - if (response && typeof response == CONSTANTS.TYPE_OBJECT) { - // If error and the error message having 'Method not found' or 'Method not Implemented' mark the testcase as undefined. - if ( - response && - response.error && - response.error.message && - CONSTANTS.ERROR_LIST.includes(response.error.message) - ) { - if (UTILS.getEnvVariable(CONSTANTS.CERTIFICATION) == true) { - assert(false, `${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${event}`); - } else { - fireLog - .assert(`NotSupported: ${CONSTANTS.PLATFORM_NOT_SUPPORT_LOG}: ${event}`) - .then(() => { - throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); - }); - } - } else if (response && response.error && response.error.message) { - assert( - false, - `Event registration failed for event ${event} with error message: ${response.error.message} ` - ); - } - - cy.updateResponseForFCS(event, eventParams, response).then((updatedResponse) => { - fireLog.info('Response from Firebolt platform: ' + JSON.stringify(response)); - // If event and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(event, eventParams)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } - - // Creating object with event name, params and response etc and storing it in a global list for further validation. - const eventAppObject = new eventObject( - event, - eventParams, - context, - updatedResponse, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); - }); - } else { - fireLog.info(`${CONSTANTS.PLATFORM_INVALID_RESPONSE_LOG} - ${response}`); - } - }); + cy.sendMessageToPlatformOrApp('Platform', additionalParams, CONSTANTS.TASK.REGISTEREVENT); } else { - let isNotSupportedApi = false; - - if (UTILS.isScenarioExempted(event, eventParams)) { - isNotSupportedApi = true; - } - - const communicationMode = UTILS.getCommunicationMode(); - const additionalParams = { - communicationMode: communicationMode, - action: action, - isNotSupportedApi: isNotSupportedApi, - }; - const params = { event: event, params: eventParams }; - - // Creating intent message using above details to send it to 3rd party app. - const intentMessage = UTILS.createIntentMessage( - CONSTANTS.TASK.REGISTEREVENT, - params, - additionalParams - ); - fireLog.info( `Registering for the ${event} event using ${appId} with params : ${JSON.stringify(eventParams)}` ); - - cy.runIntentAddon(CONSTANTS.TASK.REGISTEREVENT, intentMessage).then((parsedIntent) => { - const requestTopic = UTILS.getTopic(appId); - const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); - - // Sending message to 3rd party app. - cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent).then((result) => { - if (result === CONSTANTS.NO_RESPONSE) { - assert(false, CONSTANTS.NO_MATCHED_RESPONSE); - } - result = JSON.parse(result); - fireLog.info( - `Response from ${appId}: ${JSON.stringify(result.report.eventListenerResponse)}` - ); - - // If event and params are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(event, eventParams)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } - - // Creating object with event name, params and response etc and storing it in a global list for further validation. - const eventAppObject = new eventObject( - event, - eventParams, - context, - result.report, - appId - ); - UTILS.getEnvVariable(CONSTANTS.GLOBAL_EVENT_OBJECT_LIST).push(eventAppObject); - }); - }); + cy.sendMessageToPlatformOrApp('App', additionalParams, CONSTANTS.TASK.REGISTEREVENT); } } }); diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index 557d91ba..bdb3b2cc 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -70,177 +70,22 @@ Given( ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) : UTILS.checkForSecondaryAppId(appId); - // Fetching the object from the global list. - const methodOrEventObject = UTILS.getApiOrEventObjectFromGlobalList( - methodOrEvent, - context, - appId, - validationType - ); - const param = methodOrEventObject.params; - // Function to do error null check, schema validation check and event listerner response checks - cy.validateResponseErrorAndSchemaResult(methodOrEventObject, validationType).then(() => { - // If response of the method is not supported, checks in the not supported list for that method name, if it is present then pass else mark it as fail - if ( - !Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION) && - (UTILS.isScenarioExempted(methodOrEvent, param) || expectingError) - ) { - let errorExpected; - - // If the expected error is false, we set "exceptionErrorObject" to the errorExpected variable, which will be used to retrieve the error content object based on the exception method type. - expectingError === true - ? (errorExpected = contentObject) - : (errorExpected = CONSTANTS.EXCEPTION_ERROR_OBJECT); - - cy.validateErrorObject( - methodOrEvent, - errorExpected, - validationType, - context, - appId, - param - ).then(() => { - return true; - }); - } else if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { - // If validationType is an event then send a message to the app to retrieve an event response based on the app ID. - if (validationType == CONSTANTS.EVENT) { - const eventName = methodOrEventObject.eventObjectId; - if (appId === UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { - const requestMap = { - method: CONSTANTS.REQUEST_OVERRIDE_CALLS.FETCH_EVENT_RESPONSE, - params: eventName, - }; - - cy.sendMessagetoPlatforms(requestMap).then((result) => { - cy.updateResponseForFCS(methodOrEvent, null, result, true).then( - (updatedResponse) => { - cy.saveEventResponse( - updatedResponse, - methodOrEventObject, - eventName, - eventExpected === 'triggers' ? true : false - ); - } - ); - }); - } else { - const params = { event: eventName }; - // Generating an intent message using the provided information to send it to a third-party app - const intentMessage = UTILS.createIntentMessage( - CONSTANTS.TASK.GETEVENTRESPONSE, - params - ); - const requestTopic = UTILS.getTopic(appId); - const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); - cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then( - (response) => { - response = JSON.parse(response); - if ( - response && - response.result && - response.result.hasOwnProperty(CONSTANTS.EVENT_RESPONSE) - ) { - response.result = response.result.eventResponse; - } - cy.updateResponseForFCS(methodOrEvent, null, response, true).then( - (updatedResponse) => { - cy.saveEventResponse( - updatedResponse, - methodOrEventObject, - eventName, - eventExpected === 'triggers' ? true : false - ); - } - ); - } - ); - } - } - - try { - if (contentObject && contentObject.data) { - contentObject.data.forEach((object) => { - if (object.validations) { - const scenario = object.type; - const methodOrEventResponse = - validationType == CONSTANTS.EVENT - ? methodOrEventObject.eventResponse - : validationType == CONSTANTS.METHOD - ? methodOrEventObject.apiResponse - : null; - switch (scenario) { - case CONSTANTS.REGEX: - cy.regExValidation( - methodOrEvent, - object.validations[0].type, - validationJsonPath, - methodOrEventResponse - ); - break; - case CONSTANTS.MISC: - cy.miscellaneousValidation( - methodOrEvent, - object.validations[0], - methodOrEventObject - ); - break; - case CONSTANTS.DECODE: - const decodeType = object.specialCase; - const responseForDecodeValidation = - validationType == CONSTANTS.EVENT - ? methodOrEventResponse - : validationType == CONSTANTS.METHOD - ? methodOrEventResponse.result - : null; - - cy.decodeValidation( - methodOrEvent, - decodeType, - responseForDecodeValidation, - object.validations[0], - null - ); - break; - case CONSTANTS.FIXTURE: - cy.validateContent( - methodOrEvent, - context, - validationJsonPath, - object.validations[0].type, - validationType, - appId - ); - break; - case CONSTANTS.CUSTOM: - cy.customValidation(object, methodOrEventObject); - break; - case CONSTANTS.UNDEFINED: - cy.undefinedValidation(object, methodOrEventObject, validationType); - break; - default: - assert(false, 'Unsupported validation type'); - break; - } - } - }); - } else { - cy.validateContent( - methodOrEvent, - context, - validationJsonPath, - contentObject, - validationType, - appId - ); - } - } catch (error) { - assert(false, `Unable to validate the response: ${error}`); - } - } else { - cy.log('Content validation is skipped'); - } - }); + const additionalParams = { + method: methodOrEvent, + context: context, + validationJsonPath: validationJsonPath, + contentObject: contentObject, + expectingError: expectingError, + appId: appId, + eventExpected: eventExpected, + }; + if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { + cy.methodorEventResponseValidation(validationType, additionalParams); + } else { + cy.log( + `${CONSTANTS.SKIPCONTENTVALIDATION} flag is enabled, Skipping the Content validation` + ); + } }); }); } else { @@ -500,148 +345,28 @@ Given( contentObject = contentObject ? contentObject : CONSTANTS.NULL_RESPONSE; validationJsonPath = validationJsonPath ? validationJsonPath : CONSTANTS.RESULT; - // Fetching the object from the global list. - const apiObject = UTILS.getApiOrEventObjectFromGlobalList(method, context, appId); - const param = apiObject.params; - - // Function to do error null check, schema validation check and event listerner response checks - cy.validateResponseErrorAndSchemaResult(apiObject, CONSTANTS.METHOD).then(() => { - // If response of the method is not supported, checks in the not supported list for that method name, if it is present then pass else mark it as fail - if ( - !Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION) && - (UTILS.isScenarioExempted(method, param) || expectingError) - ) { - let errorExpected; - - // If the expected error is false, we set "exceptionErrorObject" to the errorExpected variable, which will be used to retrieve the error content object based on the exception method type. - expectingError === true - ? (errorExpected = UTILS.getEnvVariable('errorContentValidationJson')[errorContent]) - : (errorExpected = CONSTANTS.EXCEPTION_ERROR_OBJECT); - - cy.validateErrorObject( - method, - errorExpected, - CONSTANTS.METHOD, - context, - appId, - param - ).then(() => { - return true; - }); - } else if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { - try { - if (contentObject && contentObject.data) { - contentObject.data.forEach((object) => { - if (object.validations) { - const scenario = object.type; - const methodResponse = apiObject?.response ? apiObject.response : null; - - // Looping through validationJsonPath to find the valid path for validation. - if (validationJsonPath && Array.isArray(validationJsonPath)) { - const validationPath = validationJsonPath.find((path) => { - if ( - path - .split('.') - .reduce((acc, part) => acc && acc[part], methodResponse) !== undefined - ) { - return path; - } - }); - validationPath - ? (validationJsonPath = validationPath) - : fireLog.assert( - false, - 'Could not find the valid validation path from the validationJsonPath list' - ); - } - - switch (scenario) { - case CONSTANTS.REGEX: - cy.regExValidation( - method, - object.validations[0].type, - validationJsonPath, - methodResponse - ); - break; - case CONSTANTS.MISC: - cy.miscellaneousValidation(method, object.validations[0], apiObject); - break; - case CONSTANTS.DECODE: - const decodeType = object.specialCase; - const responseForDecodeValidation = methodResponse?.result - ? methodResponse.result - : null; - - cy.decodeValidation( - method, - decodeType, - responseForDecodeValidation, - object.validations[0], - null - ); - break; - case CONSTANTS.FIXTURE: - cy.validateContent( - method, - context, - validationJsonPath, - object.validations[0].type, - CONSTANTS.METHOD, - appId - ); - break; - case CONSTANTS.CUSTOM: - cy.customValidation(object, apiObject); - break; - case CONSTANTS.UNDEFINED: - cy.undefinedValidation(object, apiObject, CONSTANTS.METHOD); - break; - default: - assert(false, 'Unsupported validation type'); - break; - } - } - }); - } else { - cy.validateContent( - method, - context, - validationJsonPath, - contentObject, - CONSTANTS.METHOD, - appId - ); - } - } catch (error) { - assert(false, `Unable to validate the response: ${error}`); - } - } else { - cy.log('Content validation is skipped'); - } - }); + if (expectingError) { + contentObject = UTILS.getEnvVariable('errorContentValidationJson')[errorContent]; + } + const additionalParams = { + method: method, + context: context, + validationJsonPath: validationJsonPath, + contentObject: contentObject, + expectingError: expectingError, + appId: appId, + }; + if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { + cy.methodorEventResponseValidation(CONSTANTS.METHOD, additionalParams); + } else { + cy.log( + `${CONSTANTS.SKIPCONTENTVALIDATION} flag is enabled, Skipping the Content validation` + ); + } }); } else { assert(false, `${sdk} SDK not Supported`); } - - // A Function that recursively check each fields and invokes if it's a function within an array or object. - function resolveContentObject(input) { - if (Array.isArray(input)) { - return input.map((item) => resolveContentObject(item)); - } else if (typeof input == CONSTANTS.TYPE_OBJECT && input !== null) { - for (const key in input) { - if (Object.hasOwnProperty.call(input, key)) { - input[key] = resolveContentObject(input[key]); - } - } - return input; - } else if (input && typeof input === CONSTANTS.TYPE_FUNCTION) { - return input(); - } else { - return input; - } - } } ); @@ -704,182 +429,46 @@ Given( ? eventValidationJsonPath : CONSTANTS.EVENT_RESPONSE; - // Fetching the object from the global list. - const eventObject = UTILS.getApiOrEventObjectFromGlobalList( - event, - context, - appId, - CONSTANTS.EVENT - ); - const param = eventObject.params; - - // If response of the event is not supported, checks in the not supported list for that event name, if it is present then pass else mark it as fail - if ( - !Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION) && - (UTILS.isScenarioExempted(event, param) || expectingError) - ) { - let errorExpected; - - // If the expected error is false, we set "exceptionErrorObject" to the errorExpected variable, which will be used to retrieve the error content object based on the exception event type. - expectingError === true - ? (errorExpected = UTILS.getEnvVariable('errorContentValidationJson')[errorContent]) - : (errorExpected = CONSTANTS.EXCEPTION_ERROR_OBJECT); - - cy.validateErrorObject(event, errorExpected, CONSTANTS.EVENT, context, appId, param).then( - () => { - return true; - } - ); - } else if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { - // If validationType is an event then send a message to the app to retrieve an event response based on the app ID. - const eventName = eventObject.eventObjectId; - if (appId === UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { - const requestMap = { - method: CONSTANTS.REQUEST_OVERRIDE_CALLS.FETCH_EVENT_RESPONSE, - params: eventName, - }; - - cy.sendMessagetoPlatforms(requestMap).then((result) => { - cy.updateResponseForFCS(event, null, result).then((updatedResponse) => { - cy.saveEventResponse( - updatedResponse, - eventObject, - eventName, - eventExpected === 'triggers' ? true : false - ); - }); - }); - } else { - const params = { event: eventName }; - // Generating an intent message using the provided information to send it to a third-party app - const intentMessage = UTILS.createIntentMessage( - CONSTANTS.TASK.GETEVENTRESPONSE, - params - ); - const requestTopic = UTILS.getTopic(appId); - const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); - cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((response) => { - response = JSON.parse(response); - response = response.report; - cy.saveEventResponse( - response, - eventObject, - eventName, - eventExpected === 'triggers' ? true : false - ); - }); - } - - try { - if (contentObject && contentObject.data) { - contentObject.data.forEach((object) => { - if (object.validations) { - const scenario = object.type; - const eventResponse = eventObject?.eventResponse - ? eventObject.eventResponse - : null; - - // Looping through eventValidationJsonPath to find the valid path for validation. - if (eventValidationJsonPath && Array.isArray(eventValidationJsonPath)) { - const validationPath = eventValidationJsonPath.find((path) => { - if ( - path.split('.').reduce((acc, part) => acc && acc[part], eventResponse) !== - undefined - ) { - return path; - } - }); - validationPath - ? (eventValidationJsonPath = validationPath) - : fireLog.assert( - false, - 'Could not find the valid validation path from the eventValidationJsonPath list' - ); - } - - switch (scenario) { - case CONSTANTS.REGEX: - cy.regExValidation( - event, - object.validations[0].type, - eventValidationJsonPath, - eventResponse - ); - break; - case CONSTANTS.MISC: - cy.miscellaneousValidation(event, object.validations[0], eventObject); - break; - case CONSTANTS.DECODE: - const decodeType = object.specialCase; - const responseForDecodeValidation = eventResponse; - - cy.decodeValidation( - event, - decodeType, - responseForDecodeValidation, - object.validations[0], - null - ); - break; - case CONSTANTS.FIXTURE: - cy.validateContent( - event, - context, - eventValidationJsonPath, - object.validations[0].type, - CONSTANTS.EVENT, - appId - ); - break; - case CONSTANTS.CUSTOM: - cy.customValidation(object, eventObject); - break; - case CONSTANTS.UNDEFINED: - cy.undefinedValidation(object, eventObject, CONSTANTS.EVENT); - break; - default: - assert(false, 'Unsupported validation type'); - break; - } - } - }); - } else { - cy.validateContent( - event, - context, - eventValidationJsonPath, - contentObject, - CONSTANTS.EVENT, - appId - ); - } - } catch (error) { - assert(false, `Unable to validate the response: ${error}`); - } + if (expectingError) { + contentObject = UTILS.getEnvVariable('errorContentValidationJson')[errorContent]; + } + const additionalParams = { + method: event, + context: context, + validationJsonPath: eventValidationJsonPath, + contentObject: contentObject, + expectingError: expectingError, + appId: appId, + eventExpected: eventExpected, + }; + if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { + cy.methodorEventResponseValidation(CONSTANTS.EVENT, additionalParams); } else { - cy.log('Content validation is skipped'); + cy.log( + `${CONSTANTS.SKIPCONTENTVALIDATION} flag is enabled, Skipping the Content validation` + ); } }); } else { assert(false, `${sdk} SDK not Supported`); } + } +); - // A Function that recursively check each fields and invokes if it's a function within an array or object. - function resolveContentObject(input) { - if (Array.isArray(input)) { - return input.map((item) => resolveContentObject(item)); - } else if (typeof input == CONSTANTS.TYPE_OBJECT && input !== null) { - for (const key in input) { - if (Object.hasOwnProperty.call(input, key)) { - input[key] = resolveContentObject(input[key]); - } - } - return input; - } else if (input && typeof input === CONSTANTS.TYPE_FUNCTION) { - return input(); - } else { - return input; +// A Function that recursively check each fields and invokes if it's a function within an array or object. +function resolveContentObject(input) { + if (Array.isArray(input)) { + return input.map((item) => resolveContentObject(item)); + } else if (typeof input == CONSTANTS.TYPE_OBJECT && input !== null) { + for (const key in input) { + if (Object.hasOwnProperty.call(input, key)) { + input[key] = resolveContentObject(input[key]); } } + return input; + } else if (input && typeof input === CONSTANTS.TYPE_FUNCTION) { + return input(); + } else { + return input; } -); +} diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 01dabbbd..244f10e3 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -68,14 +68,14 @@ Cypress.Commands.add( if (response.hasOwnProperty(CONSTANTS.RESULT)) { if ( response && - response.result && + response.result !== undefined && response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) ) { formattedResponse = Object.assign(formattedResponse, response.result); formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; } else if ( response && - response.result && + response.result !== undefined && !response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) ) { formattedResponse.eventResponse = response.result; @@ -85,7 +85,7 @@ Cypress.Commands.add( } else if (response.hasOwnProperty(CONSTANTS.ERROR)) { if ( response && - response.result && + response.result !== undefined && response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) ) { formattedResponse = Object.assign(formattedResponse, response.error); From d53d88ea8c18e468079bd0e2678ad5b25d2d5572 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Thu, 11 Jul 2024 15:05:54 +0530 Subject: [PATCH 257/359] FIRECERT-2194 removed notSupported tag from userGrants TCs --- cypress/TestCases/FireboltCertification/UserGrants.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature index 987ef95a..49f976a8 100644 --- a/cypress/TestCases/FireboltCertification/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -20,7 +20,7 @@ Feature: UserGrants # Deny access with scope device, so all the apps in that device may not have the access # launch a 3rd party and provide acess using any 3rd party and check in another 3rd party - @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities R.4.4.1.1 - Negative Scenario: Validate Capability access denied for pinChallenge with scope device Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched From 5bc8e1099d6add2771c30b70cc5cfde1e6153ecf Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Thu, 11 Jul 2024 16:19:31 +0530 Subject: [PATCH 258/359] FIRECERT-2128-json fix --- cypress/fixtures/modules/device.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/fixtures/modules/device.json b/cypress/fixtures/modules/device.json index 06585a8b..0bc7ec77 100644 --- a/cypress/fixtures/modules/device.json +++ b/cypress/fixtures/modules/device.json @@ -88,14 +88,14 @@ "method": "device.onNetworkChanged", "result": { "state": "connected", - "type": "ethernet" + "type": "hybrid" } }, "ONNETWORKCHANGED_HYBRIDDISCONNECT_EVENTS": { "method": "device.onNetworkChanged", "result": { "state": "disconnected", - "type": "ethernet" + "type": "hybrid" } } } \ No newline at end of file From 458b5dc7de4eab78eaa77ebbd599102bb82f21b0 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 11 Jul 2024 16:20:53 +0530 Subject: [PATCH 259/359] moved new glue codes to getterSetter js file --- cypress/support/constants/constants.js | 3 + cypress/support/cypress-commands/commands.js | 12 +- .../support/step_definitions/fireboltCalls.js | 310 +--------- .../step_definitions/getterSetterCalls.js | 547 +++++++++++++++++- .../support/step_definitions/validations.js | 195 ------- 5 files changed, 546 insertions(+), 521 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 72307cf9..c70541ef 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -31,6 +31,7 @@ module.exports = { ALPHANUMERIC: 'alphanumeric', API_NAME: 'apiName', API_VERSION: 'apiVersion', + APP: 'App', APP_HISTORY_EMPTY: 'App history is empty', APP_ID: 'appId', APP_LIFECYCLE_HISTORY: 'appLifeCycleHistory', @@ -96,6 +97,7 @@ module.exports = { ERROR: 'error', ERROR_CONTENT_JSON_PATH: 'objects/errorObjects/errorContent.json', ERROR_CONTENT_OBJECTS_PATH: 'cypress/fixtures/objects/errorObjects/errorContent.json', + ERROR_CONTENT_VALIDATIONJSON: 'errorContentValidationJson', ERROR_EXPECTED: 'Expected response.error not to be null', ERROR_EXPECTED_DEFINED: 'Expected response.error to be defined', ERROR_EXPECTED_NULL: 'Expected response.error to be null', @@ -297,6 +299,7 @@ module.exports = { PARAMS: 'Params', PASS: 'PASS', PASSWORD: 'password', + PLATFORM: 'Platform', PLATFORM_NOT_SUPPORT_LOG: 'Platform does not support method', PLATFORM_NOT_TRIGGER_EVENT: 'Platform MUST not trigger event ', PLATFORM_TRIGGER_EVENT: 'Platform MUST trigger event ', diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 7e72c665..c355e577 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -847,13 +847,13 @@ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, ta } cy.then(() => { - if (target === 'App') { + if (target === CONSTANTS.APP) { const additionalParams = { communicationMode: UTILS.getCommunicationMode(), action: action, isNotSupportedApi: isNotSupportedApi, }; - const methodKey = task == CONSTANTS.TASK.REGISTEREVENT ? 'event' : 'method'; + const methodKey = task == CONSTANTS.TASK.REGISTEREVENT ? CONSTANTS.EVENT : CONSTANTS.METHOD; const paramKey = task == CONSTANTS.TASK.REGISTEREVENT ? 'params' : 'methodParams'; const requestParams = { [methodKey]: method, [paramKey]: params }; @@ -867,7 +867,7 @@ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, ta const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent); }); - } else if (target === 'Platform') { + } else if (target === CONSTANTS.PLATFORM) { const requestMap = { method: method, params: params, @@ -885,7 +885,7 @@ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, ta fireLog.assert(false, `Invalid ${target} target, it should be either app or platfrom`); } }).then((response) => { - if (Cypress.env('isRpcOnlyValidation')) { + if (Cypress.env(CONSTANTS.IS_RPC_ONLY)) { fireLog.info( `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` ); @@ -894,8 +894,8 @@ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, ta if ( (response && typeof response == CONSTANTS.TYPE_OBJECT) || (typeof response == CONSTANTS.TYPE_STRING && - (JSON.parse(response).hasOwnProperty('result') || - JSON.parse(response).hasOwnProperty('error'))) + (JSON.parse(response).hasOwnProperty(CONSTANTS.RESULT) || + JSON.parse(response).hasOwnProperty(CONSTANTS.ERROR))) ) { if (response === CONSTANTS.NO_RESPONSE) { assert(false, CONSTANTS.NO_MATCHED_RESPONSE); diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 5c5b57de..b5b50d91 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -18,7 +18,7 @@ import { Given } from '@badeball/cypress-cucumber-preprocessor'; const CONSTANTS = require('../constants/constants'); const _ = require('lodash'); -import { apiObject, eventObject } from '../appObjectConfigs'; +import { apiObject } from '../appObjectConfigs'; import UTILS, { fireLog } from '../cypress-support/src/utils'; /** @@ -321,311 +321,3 @@ Given(/User triggers event with value as '(.+)'/, (key) => { throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); }); }); - -/** - * @module fireboltCalls - * @function 1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)' - * @description Sending a message to platform to set a value - * @param {String} sdk - sdk name. - * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. - * @param {String} attribute - The attribute to which the value is going to be set (ex. fontFamily). - * @param {String} invalidValue - Determines whether expecting for an error or result. - * @param {String} value - The value used by the set method to set the value (ex. monospaced_sanserif) - * @example - * Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true' - * Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to invalid 'test' - * Given '1st party app' invokes the 'Firebolt' API to set 'enable' to 'true' - */ -Given( - /1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)'$/, - async (sdk, fireboltCallKey, attribute, invalidValue, value) => { - if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { - value = UTILS.parseValue(value); - let fireboltCallObject; - let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; - - // runtime environment variable holds attribute and value - if (!UTILS.getEnvVariable(CONSTANTS.RUNTIME, false)) { - Cypress.env(CONSTANTS.RUNTIME, {}); - } - let object = UTILS.getEnvVariable(CONSTANTS.RUNTIME); - object = Object.assign(object, { - attribute: attribute, - value: value, - }); - - // runtime environment variable holds attribute and value - Cypress.env(CONSTANTS.RUNTIME, object); - - // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable - if (fireboltCallKey) { - cy.getFireboltData(fireboltCallKey).then((fireboltData) => { - fireboltCallObject = fireboltData; - cy.wrap(UTILS.getEnvVariable(CONSTANTS.RUNTIME)).then((object) => { - object.fireboltCall = fireboltData; - Cypress.env(CONSTANTS.RUNTIME, object); - }); - }); - } else { - fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; - fireboltCallObjectErrorMessage = - 'Unable to find the firebolt object in the runtime environment variable'; - } - - cy.then(() => { - // Failing the test when fireboltCall object not there - if (!fireboltCallObject) { - fireLog.assert(false, fireboltCallObjectErrorMessage); - } else { - let setMethod = - typeof fireboltCallObject.setMethod === CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.setMethod() - : fireboltCallObject.setMethod; - let setParams; - - // Extracting the parameter from the fireboltCall object - if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_FUNCTION) { - setParams = { value: fireboltCallObject.setParams() }; - } else if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_OBJECT) { - setParams = fireboltCallObject.setParams; - - // Iterating through the object and invoking it if it is a function - for (const key in setParams) { - if (typeof setParams[key] === CONSTANTS.TYPE_FUNCTION) { - setParams[key] = setParams[key](); - } - } - } else { - setParams = { value: fireboltCallObject.setParams }; - } - - const context = {}; - const expected = invalidValue ? 'error' : 'result'; - let action = CONSTANTS.ACTION_CORE.toLowerCase(); - - // Splitting the method name if it contains an underscore and using the first part to determine the action that decides sdk. - if (setMethod && setMethod.includes('_')) { - action = setMethod.split('_')[0]; - setMethod = setMethod.split('_')[1]; - } - - const additionalParams = { - method: setMethod, - params: setParams, - context: context, - action: action, - expected: expected, - appId: Cypress.env(CONSTANTS.FIRST_PARTY_APPID), - }; - - fireLog.info( - 'Call from 1st party App, method: ' + - setMethod + - ' params: ' + - JSON.stringify(setParams) - ); - cy.sendMessageToPlatformOrApp('Platform', additionalParams); - } - }); - } else { - fireLog.assert(false, `${sdk} SDK not Supported`); - } - } -); - -/** - * @module fireboltCalls - * @function '(.+)' invokes the '(.+)' get API(?: '(.+)') - * @description Sending a message to platform or app to get a value - * @param {String} appId - app identifier. - * @param {String} sdk - sdk name. - * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. - * @example - * Given '1st party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS' - * Given '3rd party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS' - * Given '3rd party app' invokes the 'Firebolt' get API - * Given 'test_app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS' - */ -Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireboltCallKey) => { - if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { - let fireboltCallObject; - let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; - - // Creating runtime environment variable, if not present - if (!UTILS.getEnvVariable(CONSTANTS.RUNTIME, false)) { - Cypress.env(CONSTANTS.RUNTIME, {}); - } - - // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable - if (fireboltCallKey) { - cy.getFireboltData(fireboltCallKey).then((fireboltData) => { - fireboltCallObject = fireboltData; - cy.wrap(UTILS.getEnvVariable(CONSTANTS.RUNTIME)).then((object) => { - object.fireboltCall = fireboltData; - Cypress.env(CONSTANTS.RUNTIME, object); - }); - }); - } else { - fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; - fireboltCallObjectErrorMessage = - 'Unable to find the firebolt object in the runtime environment variable'; - } - - cy.then(() => { - // Failing the test when fireboltCall object not there - if (!fireboltCallObject) { - fireLog.assert(false, fireboltCallObjectErrorMessage); - } else { - let method = - typeof fireboltCallObject.method === CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.method() - : fireboltCallObject.method; - const param = - fireboltCallObject.params && typeof fireboltCallObject.params === CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.params() - : fireboltCallObject.params; - - const context = {}; - const expected = CONSTANTS.RESULT; - appId = - appId === CONSTANTS.THIRD_PARTY_APP - ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : appId === CONSTANTS.FIRST_PARTY_APP - ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) - : appId; - let action = CONSTANTS.ACTION_CORE.toLowerCase(); - - // Splitting the method name if it contains an underscore and using the first part to determine the action that decides sdk. - if (method && method.includes('_')) { - action = method.split('_')[0]; - method = method.split('_')[1]; - } - - // If method and param are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(method, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } - - const additionalParams = { - method: method, - params: param, - context: context, - action: action, - expected: expected, - appId: appId, - }; - - if (appId == UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { - fireLog.info( - 'Call from 1st party App, method: ' + method + ' params: ' + JSON.stringify(param) - ); - cy.sendMessageToPlatformOrApp('Platform', additionalParams); - } else { - if ( - Cypress.env(CONSTANTS.TEST_TYPE) && - Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE - ) { - cy.fetchLifecycleHistory(appId); - } - fireLog.info(`Call from ${appId}, method: ${method} params: ${JSON.stringify(param)}`); - cy.sendMessageToPlatformOrApp('App', additionalParams); - } - } - }); - } else { - fireLog.assert(false, `${sdk} SDK not Supported`); - } -}); - -/** - * @module fireboltCalls - * @function '(.+)' registers for the '(.*?)'(?: '(.*?)')? event - * @description Sending a message to platform or app to register a event - * @param {String} appId - app identtifier. - * @param {String} sdk - sdk name. - * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. - * @example - * And '1st party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event - * And '3rd party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event - * And '1st party app' registers for the 'Firebolt' event - */ -Given( - /'(.+)' registers for the '(.*?)'(?: '(.*?)')? event$/, - async (appId, sdk, fireboltCallKey) => { - if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { - let fireboltCallObject; - let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; - - // Creating runtime environment variable - if (!UTILS.getEnvVariable(CONSTANTS.RUNTIME, false)) { - Cypress.env(CONSTANTS.RUNTIME, {}); - } - - // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable - if (fireboltCallKey) { - cy.getFireboltData(fireboltCallKey).then((fireboltData) => { - fireboltCallObject = fireboltData; - cy.wrap(UTILS.getEnvVariable(CONSTANTS.RUNTIME)).then((object) => { - object.fireboltCall = fireboltData; - Cypress.env(CONSTANTS.RUNTIME, object); - }); - }); - } else { - fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; - fireboltCallObjectErrorMessage = - 'Unable to find the firebolt object in the runtime environment variable'; - } - - cy.then(() => { - // Failing the test when fireboltCall object not there - if (!fireboltCallObject) { - fireLog.assert(false, fireboltCallObjectErrorMessage); - } else { - let event = - typeof fireboltCallObject.event === CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.event() - : fireboltCallObject.event; - const eventParams = {}; - const context = {}; - appId = - appId === CONSTANTS.THIRD_PARTY_APP - ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : appId === CONSTANTS.FIRST_PARTY_APP - ? Cypress.env(CONSTANTS.FIRST_PARTY_APPID) - : appId; - let action = CONSTANTS.ACTION_CORE.toLowerCase(); - - // Splitting the method name if it contains an underscore and using the first part to determine the action that decides sdk. - if (event && event.includes('_')) { - action = setMethod.split('_')[0]; - event = event.split('_')[1]; - } - - const additionalParams = { - method: event, - params: eventParams, - context: context, - action: action, - expected: CONSTANTS.RESULT, - appId: appId, - }; - if (appId == UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { - fireLog.info( - `Registering for the ${event} event using 1st party App with params : ${JSON.stringify( - eventParams - )}` - ); - cy.sendMessageToPlatformOrApp('Platform', additionalParams, CONSTANTS.TASK.REGISTEREVENT); - } else { - fireLog.info( - `Registering for the ${event} event using ${appId} with params : ${JSON.stringify(eventParams)}` - ); - cy.sendMessageToPlatformOrApp('App', additionalParams, CONSTANTS.TASK.REGISTEREVENT); - } - } - }); - } else { - fireLog.assert(false, `${sdk} SDK not Supported`); - } - } -); diff --git a/cypress/support/step_definitions/getterSetterCalls.js b/cypress/support/step_definitions/getterSetterCalls.js index acc0db98..21ba7810 100644 --- a/cypress/support/step_definitions/getterSetterCalls.js +++ b/cypress/support/step_definitions/getterSetterCalls.js @@ -16,6 +16,7 @@ * SPDX-License-Identifier: Apache-2.0 */ import { Given } from '@badeball/cypress-cucumber-preprocessor'; +import UTILS, { fireLog } from '../cypress-support/src/utils'; const CONSTANTS = require('../constants/constants'); /** @@ -25,16 +26,540 @@ const CONSTANTS = require('../constants/constants'); * @param {String} key - key name of the fireboltCall setter/getter data. * @example * Given we test the 'CLOSED_CAPTIONS' getters and setters + * Given we test the 'CLOSED_CAPTIONS' getters and setters 'enabled' to 'true' */ -Given(/we test the '(.+)' getters and setters$/, async (key) => { - // Clear any current env.runtime variables - Cypress.env(CONSTANTS.RUNTIME, {}); - - // Look for the firebolt call key in firebolt data - cy.getFireboltData(key).then((parsedData) => { - // getFireboltData handles the case where the key is not found - // Save the object as env.runtime.fireboltCall - const runtime = { fireboltCall: parsedData }; - Cypress.env(CONSTANTS.RUNTIME, runtime); - }); +Given( + /we test the '(.+)' getters and setters(?: '(.+)' to '(.+)')?$/, + async (key, attribute, value) => { + // Clear any current env.runtime variables + Cypress.env(CONSTANTS.RUNTIME, {}); + + // Look for the firebolt call key in firebolt data + cy.getFireboltData(key).then((parsedData) => { + // getFireboltData handles the case where the key is not found + // Save the object as env.runtime.fireboltCall + const runtime = { fireboltCall: parsedData }; + if (attribute && value) { + value = UTILS.parseValue(value); + runtime.attribute = attribute; + runtime.value = value; + } + Cypress.env(CONSTANTS.RUNTIME, runtime); + }); + } +); + +/** + * @module fireboltCalls + * @function 1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)' + * @description Sending a message to platform to set a value + * @param {String} sdk - sdk name. + * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. + * @param {String} attribute - The attribute to which the value is going to be set (ex. fontFamily). + * @param {String} invalidValue - Determines whether expecting for an error or result. + * @param {String} value - The value used by the set method to set the value (ex. monospaced_sanserif) + * @example + * Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true' + * Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to invalid 'test' + * Given '1st party app' invokes the 'Firebolt' API to set 'enable' to 'true' + */ +Given( + /1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)'$/, + async (sdk, fireboltCallKey, attribute, invalidValue, value) => { + if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { + value = UTILS.parseValue(value); + let fireboltCallObject; + let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; + + // runtime environment variable holds attribute and value + if (!UTILS.getEnvVariable(CONSTANTS.RUNTIME, false)) { + Cypress.env(CONSTANTS.RUNTIME, {}); + } + let object = UTILS.getEnvVariable(CONSTANTS.RUNTIME); + object = Object.assign(object, { + attribute: attribute, + value: value, + }); + + // runtime environment variable holds attribute and value + Cypress.env(CONSTANTS.RUNTIME, object); + + // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable + if (fireboltCallKey) { + cy.getFireboltData(fireboltCallKey).then((fireboltData) => { + fireboltCallObject = fireboltData; + cy.wrap(UTILS.getEnvVariable(CONSTANTS.RUNTIME)).then((object) => { + object.fireboltCall = fireboltData; + Cypress.env(CONSTANTS.RUNTIME, object); + }); + }); + } else { + fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; + fireboltCallObjectErrorMessage = + 'Unable to find the firebolt object in the runtime environment variable'; + } + + cy.then(() => { + // Failing the test when fireboltCall object not there + if (!fireboltCallObject) { + fireLog.assert(false, fireboltCallObjectErrorMessage); + } else { + let setMethod = + typeof fireboltCallObject.setMethod === CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.setMethod() + : fireboltCallObject.setMethod; + let setParams; + + // Extracting the parameter from the fireboltCall object + if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_FUNCTION) { + setParams = { value: fireboltCallObject.setParams() }; + } else if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_OBJECT) { + setParams = fireboltCallObject.setParams; + + // Iterating through the object and invoking it if it is a function + for (const key in setParams) { + if (typeof setParams[key] === CONSTANTS.TYPE_FUNCTION) { + setParams[key] = setParams[key](); + } + } + } else { + setParams = { value: fireboltCallObject.setParams }; + } + + const context = {}; + const expected = invalidValue ? CONSTANTS.ERROR : CONSTANTS.RESULT; + let action = CONSTANTS.ACTION_CORE.toLowerCase(); + + // Splitting the method name if it contains an underscore and using the first part to determine the action that decides sdk. + if (setMethod && setMethod.includes('_')) { + action = setMethod.split('_')[0]; + setMethod = setMethod.split('_')[1]; + } + + const additionalParams = { + method: setMethod, + params: setParams, + context: context, + action: action, + expected: expected, + appId: Cypress.env(CONSTANTS.FIRST_PARTY_APPID), + }; + + fireLog.info( + 'Call from 1st party App, method: ' + + setMethod + + ' params: ' + + JSON.stringify(setParams) + ); + cy.sendMessageToPlatformOrApp(CONSTANTS.PLATFORM, additionalParams); + } + }); + } else { + fireLog.assert(false, `${sdk} SDK not Supported`); + } + } +); + +/** + * @module fireboltCalls + * @function '(.+)' invokes the '(.+)' get API(?: '(.+)') + * @description Sending a message to platform or app to get a value + * @param {String} appId - app identifier. + * @param {String} sdk - sdk name. + * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. + * @example + * Given '1st party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS' + * Given '3rd party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS' + * Given '3rd party app' invokes the 'Firebolt' get API + * Given 'test_app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS' + */ +Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireboltCallKey) => { + if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { + let fireboltCallObject; + let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; + + // Creating runtime environment variable, if not present + if (!UTILS.getEnvVariable(CONSTANTS.RUNTIME, false)) { + Cypress.env(CONSTANTS.RUNTIME, {}); + } + + // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable + if (fireboltCallKey) { + cy.getFireboltData(fireboltCallKey).then((fireboltData) => { + fireboltCallObject = fireboltData; + cy.wrap(UTILS.getEnvVariable(CONSTANTS.RUNTIME)).then((object) => { + object.fireboltCall = fireboltData; + Cypress.env(CONSTANTS.RUNTIME, object); + }); + }); + } else { + fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; + fireboltCallObjectErrorMessage = + 'Unable to find the firebolt object in the runtime environment variable'; + } + + cy.then(() => { + // Failing the test when fireboltCall object not there + if (!fireboltCallObject) { + fireLog.assert(false, fireboltCallObjectErrorMessage); + } else { + let method = + typeof fireboltCallObject.method === CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.method() + : fireboltCallObject.method; + const param = + fireboltCallObject.params && typeof fireboltCallObject.params === CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.params() + : fireboltCallObject.params; + + const context = {}; + const expected = CONSTANTS.RESULT; + appId = + appId === CONSTANTS.THIRD_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.FIRST_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) + : appId; + let action = CONSTANTS.ACTION_CORE.toLowerCase(); + + // Splitting the method name if it contains an underscore and using the first part to determine the action that decides sdk. + if (method && method.includes('_')) { + action = method.split('_')[0]; + method = method.split('_')[1]; + } + + // If method and param are not supported setting isScenarioExempted as true for further validation. + if (UTILS.isScenarioExempted(method, param)) { + Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); + } + + const additionalParams = { + method: method, + params: param, + context: context, + action: action, + expected: expected, + appId: appId, + }; + + if (appId == UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { + fireLog.info( + 'Call from 1st party App, method: ' + method + ' params: ' + JSON.stringify(param) + ); + cy.sendMessageToPlatformOrApp(CONSTANTS.PLATFORM, additionalParams); + } else { + if ( + Cypress.env(CONSTANTS.TEST_TYPE) && + Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE + ) { + cy.fetchLifecycleHistory(appId); + } + fireLog.info(`Call from ${appId}, method: ${method} params: ${JSON.stringify(param)}`); + cy.sendMessageToPlatformOrApp(CONSTANTS.APP, additionalParams); + } + } + }); + } else { + fireLog.assert(false, `${sdk} SDK not Supported`); + } }); + +/** + * @module fireboltCalls + * @function '(.+)' registers for the '(.*?)'(?: '(.*?)')? event + * @description Sending a message to platform or app to register a event + * @param {String} appId - app identtifier. + * @param {String} sdk - sdk name. + * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. + * @example + * And '1st party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event + * And '3rd party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event + * And '1st party app' registers for the 'Firebolt' event + */ +Given( + /'(.+)' registers for the '(.*?)'(?: '(.*?)')? event$/, + async (appId, sdk, fireboltCallKey) => { + if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { + let fireboltCallObject; + let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; + + // Creating runtime environment variable + if (!UTILS.getEnvVariable(CONSTANTS.RUNTIME, false)) { + Cypress.env(CONSTANTS.RUNTIME, {}); + } + + // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable + if (fireboltCallKey) { + cy.getFireboltData(fireboltCallKey).then((fireboltData) => { + fireboltCallObject = fireboltData; + cy.wrap(UTILS.getEnvVariable(CONSTANTS.RUNTIME)).then((object) => { + object.fireboltCall = fireboltData; + Cypress.env(CONSTANTS.RUNTIME, object); + }); + }); + } else { + fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; + fireboltCallObjectErrorMessage = + 'Unable to find the firebolt object in the runtime environment variable'; + } + + cy.then(() => { + // Failing the test when fireboltCall object not there + if (!fireboltCallObject) { + fireLog.assert(false, fireboltCallObjectErrorMessage); + } else { + let event = + typeof fireboltCallObject.event === CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.event() + : fireboltCallObject.event; + const eventParams = {}; + const context = {}; + appId = + appId === CONSTANTS.THIRD_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.FIRST_PARTY_APP + ? Cypress.env(CONSTANTS.FIRST_PARTY_APPID) + : appId; + let action = CONSTANTS.ACTION_CORE.toLowerCase(); + + // Splitting the method name if it contains an underscore and using the first part to determine the action that decides sdk. + if (event && event.includes('_')) { + action = setMethod.split('_')[0]; + event = event.split('_')[1]; + } + + const additionalParams = { + method: event, + params: eventParams, + context: context, + action: action, + expected: CONSTANTS.RESULT, + appId: appId, + }; + if (appId == UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { + fireLog.info( + `Registering for the ${event} event using 1st party App with params : ${JSON.stringify( + eventParams + )}` + ); + cy.sendMessageToPlatformOrApp( + CONSTANTS.PLATFORM, + additionalParams, + CONSTANTS.TASK.REGISTEREVENT + ); + } else { + fireLog.info( + `Registering for the ${event} event using ${appId} with params : ${JSON.stringify(eventParams)}` + ); + cy.sendMessageToPlatformOrApp( + CONSTANTS.APP, + additionalParams, + CONSTANTS.TASK.REGISTEREVENT + ); + } + } + }); + } else { + fireLog.assert(false, `${sdk} SDK not Supported`); + } + } +); + +/** + * @module validations + * @function And '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? + * @description Performing a validation against the source of truth for the given API response + * @param {String} sdk - name of the sdk. + * @param {String} appId - The object was retrieved by using the appId. + * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData Json. + * @param {String} methodType - Determines which method doing content validation Ex: set or get + * @param {String} errorContent - Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' + * @example + * And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' get API + * And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API + * And 'Firebolt' platform responds to '3rd party app' 'CLOSEDCAPTION_SETTINGS' get API + * And 'Firebolt' platform responds to '1st party app' set API + * And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API with 'INVALID_TYPE_PARAMS' + */ +Given( + /'(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')?$/, + async (sdk, appId, fireboltCallKey, methodType, errorContent) => { + if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { + let fireboltCallObject; + // Reading the appId from the environment variable + appId = !appId + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.THIRD_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.FIRST_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) + : appId; + const context = {}; + const expectingError = errorContent ? true : false; + + // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable + if (fireboltCallKey) { + cy.getFireboltData(fireboltCallKey).then((fireboltData) => { + fireboltCallObject = fireboltData; + }); + } else { + fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; + } + + cy.then(() => { + let method = + methodType === CONSTANTS.SET + ? typeof fireboltCallObject.setMethod == CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.setMethod() + : fireboltCallObject.setMethod + : typeof fireboltCallObject.method == CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.method() + : fireboltCallObject.method; + let validationJsonPath = + methodType === CONSTANTS.SET + ? typeof fireboltCallObject.setValidationJsonPath == CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.setValidationJsonPath() + : fireboltCallObject.setValidationJsonPath + : typeof fireboltCallObject.validationJsonPath == CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.validationJsonPath() + : fireboltCallObject.validationJsonPath; + let contentObject = + methodType === CONSTANTS.SET + ? resolveContentObject(fireboltCallObject.setContent) + : resolveContentObject(fireboltCallObject.content); + + method = method.includes('_') ? method.split('_')[1] : method; + contentObject = contentObject ? contentObject : CONSTANTS.NULL_RESPONSE; + validationJsonPath = validationJsonPath ? validationJsonPath : CONSTANTS.RESULT; + + if (expectingError) { + contentObject = UTILS.getEnvVariable(CONSTANTS.ERROR_CONTENT_VALIDATIONJSON)[ + errorContent + ]; + } + const additionalParams = { + method: method, + context: context, + validationJsonPath: validationJsonPath, + contentObject: contentObject, + expectingError: expectingError, + appId: appId, + }; + if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { + cy.methodorEventResponseValidation(CONSTANTS.METHOD, additionalParams); + } else { + cy.log( + `${CONSTANTS.SKIPCONTENTVALIDATION} flag is enabled, Skipping the Content validation` + ); + } + }); + } else { + assert(false, `${sdk} SDK not Supported`); + } + } +); + +/** + * @module validations + * @function And '(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')? + * @description Performing a event validation against the source of truth + * @param {String} sdk - name of the sdk. + * @param {String} eventExpected - eventExpected will used to decide expecting for an event or not. + * @param {String} appId - The object was retrieved by using the appId. + * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData Json. + * @param {String} errorContent - Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' + * @example + * And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event + * And 'Firebolt' platform triggers '1st party app' event + * And 'Firebolt' platform triggers '3rd party app' 'CLOSEDCAPTION_SETTINGS' event + * And 'Firebolt' platform does not trigger '3rd party app' 'CLOSEDCAPTION_SETTINGS' event + * And 'Firebolt' platform triggers '1st party app' event + * And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event with 'INVALID_TYPE_PARAMS' + */ +Given( + /'(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')?$/, + async (sdk, eventExpected, appId, fireboltCallKey, errorContent) => { + if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { + let fireboltCallObject; + // Reading the appId from the environment variable + appId = !appId + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.THIRD_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) + : appId === CONSTANTS.FIRST_PARTY_APP + ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) + : appId; + const context = {}; + const expectingError = errorContent ? true : false; + + // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable + if (fireboltCallKey) { + cy.getFireboltData(fireboltCallKey).then((fireboltData) => { + fireboltCallObject = fireboltData; + }); + } else { + fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; + } + + cy.then(() => { + let event = + typeof fireboltCallObject.event == CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.event() + : fireboltCallObject.event; + let eventValidationJsonPath = + typeof fireboltCallObject.eventValidationJsonPath == CONSTANTS.TYPE_FUNCTION + ? fireboltCallObject.eventValidationJsonPath() + : fireboltCallObject.eventValidationJsonPath; + let contentObject = resolveContentObject(fireboltCallObject.content); + + event = event.includes('_') ? event.split('_')[1] : event; + contentObject = contentObject ? contentObject : CONSTANTS.NULL_RESPONSE; + eventValidationJsonPath = eventValidationJsonPath + ? eventValidationJsonPath + : CONSTANTS.EVENT_RESPONSE; + + if (expectingError) { + contentObject = UTILS.getEnvVariable(CONSTANTS.ERROR_CONTENT_VALIDATIONJSON)[ + errorContent + ]; + } + const additionalParams = { + method: event, + context: context, + validationJsonPath: eventValidationJsonPath, + contentObject: contentObject, + expectingError: expectingError, + appId: appId, + eventExpected: eventExpected, + }; + if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { + cy.methodorEventResponseValidation(CONSTANTS.EVENT, additionalParams); + } else { + cy.log( + `${CONSTANTS.SKIPCONTENTVALIDATION} flag is enabled, Skipping the Content validation` + ); + } + }); + } else { + assert(false, `${sdk} SDK not Supported`); + } + } +); + +// A Function that recursively check each fields and invokes if it's a function within an array or object. +function resolveContentObject(input) { + if (Array.isArray(input)) { + return input.map((item) => resolveContentObject(item)); + } else if (typeof input == CONSTANTS.TYPE_OBJECT && input !== null) { + for (const key in input) { + if (Object.hasOwnProperty.call(input, key)) { + input[key] = resolveContentObject(input[key]); + } + } + return input; + } else if (input && typeof input === CONSTANTS.TYPE_FUNCTION) { + return input(); + } else { + return input; + } +} diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index bdb3b2cc..ac1ecf69 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -277,198 +277,3 @@ Given( }); } ); - -/** - * @module validations - * @function And '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? - * @description Performing a validation against the source of truth for the given API response - * @param {String} sdk - name of the sdk. - * @param {String} appId - The object was retrieved by using the appId. - * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData Json. - * @param {String} methodType - Determines which method doing content validation Ex: set or get - * @param {String} errorContent - Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' - * @example - * And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' get API - * And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API - * And 'Firebolt' platform responds to '3rd party app' 'CLOSEDCAPTION_SETTINGS' get API - * And 'Firebolt' platform responds to '1st party app' set API - * And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API with 'INVALID_TYPE_PARAMS' - */ -Given( - /'(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')?$/, - async (sdk, appId, fireboltCallKey, methodType, errorContent) => { - if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { - let fireboltCallObject; - // Reading the appId from the environment variable - appId = !appId - ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : appId === CONSTANTS.THIRD_PARTY_APP - ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : appId === CONSTANTS.FIRST_PARTY_APP - ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) - : appId; - const context = {}; - const expectingError = errorContent ? true : false; - - // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable - if (fireboltCallKey) { - cy.getFireboltData(fireboltCallKey).then((fireboltData) => { - fireboltCallObject = fireboltData; - }); - } else { - fireboltCallObject = UTILS.getEnvVariable('runtime').fireboltCall; - } - - cy.then(() => { - let method = - methodType === CONSTANTS.SET - ? typeof fireboltCallObject.setMethod == CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.setMethod() - : fireboltCallObject.setMethod - : typeof fireboltCallObject.method == CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.method() - : fireboltCallObject.method; - let validationJsonPath = - methodType === CONSTANTS.SET - ? typeof fireboltCallObject.setValidationJsonPath == CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.setValidationJsonPath() - : fireboltCallObject.setValidationJsonPath - : typeof fireboltCallObject.validationJsonPath == CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.validationJsonPath() - : fireboltCallObject.validationJsonPath; - let contentObject = - methodType === CONSTANTS.SET - ? resolveContentObject(fireboltCallObject.setContent) - : resolveContentObject(fireboltCallObject.content); - - method = method.includes('_') ? method.split('_')[1] : method; - contentObject = contentObject ? contentObject : CONSTANTS.NULL_RESPONSE; - validationJsonPath = validationJsonPath ? validationJsonPath : CONSTANTS.RESULT; - - if (expectingError) { - contentObject = UTILS.getEnvVariable('errorContentValidationJson')[errorContent]; - } - const additionalParams = { - method: method, - context: context, - validationJsonPath: validationJsonPath, - contentObject: contentObject, - expectingError: expectingError, - appId: appId, - }; - if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { - cy.methodorEventResponseValidation(CONSTANTS.METHOD, additionalParams); - } else { - cy.log( - `${CONSTANTS.SKIPCONTENTVALIDATION} flag is enabled, Skipping the Content validation` - ); - } - }); - } else { - assert(false, `${sdk} SDK not Supported`); - } - } -); - -/** - * @module validations - * @function And '(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')? - * @description Performing a event validation against the source of truth - * @param {String} sdk - name of the sdk. - * @param {String} eventExpected - eventExpected will used to decide expecting for an event or not. - * @param {String} appId - The object was retrieved by using the appId. - * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData Json. - * @param {String} errorContent - Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' - * @example - * And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event - * And 'Firebolt' platform triggers '1st party app' event - * And 'Firebolt' platform triggers '3rd party app' 'CLOSEDCAPTION_SETTINGS' event - * And 'Firebolt' platform does not trigger '3rd party app' 'CLOSEDCAPTION_SETTINGS' event - * And 'Firebolt' platform triggers '1st party app' event - * And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event with 'INVALID_TYPE_PARAMS' - */ -Given( - /'(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')?$/, - async (sdk, eventExpected, appId, fireboltCallKey, errorContent) => { - if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { - let fireboltCallObject; - // Reading the appId from the environment variable - appId = !appId - ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : appId === CONSTANTS.THIRD_PARTY_APP - ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) - : appId === CONSTANTS.FIRST_PARTY_APP - ? UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID) - : appId; - const context = {}; - const expectingError = errorContent ? true : false; - - // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable - if (fireboltCallKey) { - cy.getFireboltData(fireboltCallKey).then((fireboltData) => { - fireboltCallObject = fireboltData; - }); - } else { - fireboltCallObject = UTILS.getEnvVariable('runtime').fireboltCall; - } - - cy.then(() => { - let event = - typeof fireboltCallObject.event == CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.event() - : fireboltCallObject.event; - let eventValidationJsonPath = - typeof fireboltCallObject.eventValidationJsonPath == CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.eventValidationJsonPath() - : fireboltCallObject.eventValidationJsonPath; - let contentObject = resolveContentObject(fireboltCallObject.content); - - event = event.includes('_') ? event.split('_')[1] : event; - contentObject = contentObject ? contentObject : CONSTANTS.NULL_RESPONSE; - eventValidationJsonPath = eventValidationJsonPath - ? eventValidationJsonPath - : CONSTANTS.EVENT_RESPONSE; - - if (expectingError) { - contentObject = UTILS.getEnvVariable('errorContentValidationJson')[errorContent]; - } - const additionalParams = { - method: event, - context: context, - validationJsonPath: eventValidationJsonPath, - contentObject: contentObject, - expectingError: expectingError, - appId: appId, - eventExpected: eventExpected, - }; - if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { - cy.methodorEventResponseValidation(CONSTANTS.EVENT, additionalParams); - } else { - cy.log( - `${CONSTANTS.SKIPCONTENTVALIDATION} flag is enabled, Skipping the Content validation` - ); - } - }); - } else { - assert(false, `${sdk} SDK not Supported`); - } - } -); - -// A Function that recursively check each fields and invokes if it's a function within an array or object. -function resolveContentObject(input) { - if (Array.isArray(input)) { - return input.map((item) => resolveContentObject(item)); - } else if (typeof input == CONSTANTS.TYPE_OBJECT && input !== null) { - for (const key in input) { - if (Object.hasOwnProperty.call(input, key)) { - input[key] = resolveContentObject(input[key]); - } - } - return input; - } else if (input && typeof input === CONSTANTS.TYPE_FUNCTION) { - return input(); - } else { - return input; - } -} From 5652ac7b9e81e33c9abcd5b7100f2db4c4c8af71 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 11 Jul 2024 17:02:24 +0530 Subject: [PATCH 260/359] fixed the issues of 2198 --- cypress/support/step_definitions/getterSetterCalls.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cypress/support/step_definitions/getterSetterCalls.js b/cypress/support/step_definitions/getterSetterCalls.js index 21ba7810..a736dd26 100644 --- a/cypress/support/step_definitions/getterSetterCalls.js +++ b/cypress/support/step_definitions/getterSetterCalls.js @@ -551,12 +551,13 @@ function resolveContentObject(input) { if (Array.isArray(input)) { return input.map((item) => resolveContentObject(item)); } else if (typeof input == CONSTANTS.TYPE_OBJECT && input !== null) { + const newObj = {}; for (const key in input) { if (Object.hasOwnProperty.call(input, key)) { - input[key] = resolveContentObject(input[key]); + newObj[key] = resolveContentObject(input[key]); } } - return input; + return newObj; } else if (input && typeof input === CONSTANTS.TYPE_FUNCTION) { return input(); } else { From 389bfd6a4e6d857d5d3be728a4bcb789fb976db1 Mon Sep 17 00:00:00 2001 From: rajanika Date: Thu, 11 Jul 2024 19:24:58 +0530 Subject: [PATCH 261/359] add error message --- cypress/fixtures/objects/errorObjects/errorContent.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/fixtures/objects/errorObjects/errorContent.json b/cypress/fixtures/objects/errorObjects/errorContent.json index ec9314b1..1c665938 100644 --- a/cypress/fixtures/objects/errorObjects/errorContent.json +++ b/cypress/fixtures/objects/errorObjects/errorContent.json @@ -24,7 +24,8 @@ "not a valid OpenRPC date-time format", "data did not match any variant of untagged enum NavigationIntent ", "Invalid Value for set speed", - "data did not match" + "data did not match", + "is not one of" ], "errorCode": [-32602, -32400, -40300] }, From ff2131bed3dbc4d077f28ea53b6391f8f6ef57c9 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Thu, 11 Jul 2024 20:01:14 +0530 Subject: [PATCH 262/359] adding documentation --- .../support/step_definitions/fireboltCalls.md | 52 ------- .../step_definitions/getterSetterCalls.js | 31 ++-- .../step_definitions/getterSetterCalls.md | 132 ++++++++++++++++++ .../support/step_definitions/validations.md | 40 ------ 4 files changed, 150 insertions(+), 105 deletions(-) create mode 100644 cypress/support/step_definitions/getterSetterCalls.md diff --git a/cypress/support/step_definitions/fireboltCalls.md b/cypress/support/step_definitions/fireboltCalls.md index a4fbb3ae..613468ff 100644 --- a/cypress/support/step_definitions/fireboltCalls.md +++ b/cypress/support/step_definitions/fireboltCalls.md @@ -76,55 +76,3 @@ Note: Key name value is an object and it can contains data as below ### Examples: * `And I clear 'clear accessibility.onClosedCaptionsSettingsChanged' listeners` - - -## 1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)' - -### Purpose: Sending a message to platform to set a value - -### Params: -| Param | Definition | -| --- | --- | -| sdk | sdk name | -| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | -| attribute | The attribute we are setting (ex. fontFamily) | -| invalidValue | Determines whether expecting for an error or result | -| value | The value used by the set method to set the value (ex. monospaced_sanserif) | - -### Examples: -* `Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true'` -* `Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to invalid 'test'` -* `Given '1st party app' invokes the 'Firebolt' API to set 'enable' to 'true'` - -## '(.+)' registers for the '(.*?)'(?: '(.*?)')? event - -### Purpose: Sending a message to platform or app to register a event - -### Params: -| Param | Definition | -| --- | --- | -| appId |app identtifier | -| sdk | sdk name | -| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | - -### Examples: - * `And '1st party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event` - * `And '3rd party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event` - * `And '1st party app' registers for the 'Firebolt' event` - -## '(.+)' invokes the '(.+)' get API(?: '(.+)') - -### Purpose: Sending a message to platform or 3rd party app to get a value - -### Params: -| Param | Definition | -| --- | --- | -| appId | app identifier. | -| sdk | sdk name | -| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | - -### Examples: -* `And '1st party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` -* `And '3rd party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` -* `And '3rd party app' invokes the 'Firebolt' get API` -* `And 'test_app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` \ No newline at end of file diff --git a/cypress/support/step_definitions/getterSetterCalls.js b/cypress/support/step_definitions/getterSetterCalls.js index a736dd26..e09b160a 100644 --- a/cypress/support/step_definitions/getterSetterCalls.js +++ b/cypress/support/step_definitions/getterSetterCalls.js @@ -50,7 +50,7 @@ Given( ); /** - * @module fireboltCalls + * @module getterSetterCalls * @function 1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)' * @description Sending a message to platform to set a value * @param {String} sdk - sdk name. @@ -81,7 +81,7 @@ Given( value: value, }); - // runtime environment variable holds attribute and value + // Store attribute and value in the runtime environment variable Cypress.env(CONSTANTS.RUNTIME, object); // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable @@ -116,7 +116,7 @@ Given( } else if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_OBJECT) { setParams = fireboltCallObject.setParams; - // Iterating through the object and invoking it if it is a function + // Iterating through the object and invoke if it is a function for (const key in setParams) { if (typeof setParams[key] === CONSTANTS.TYPE_FUNCTION) { setParams[key] = setParams[key](); @@ -161,7 +161,7 @@ Given( ); /** - * @module fireboltCalls + * @module getterSetterCalls * @function '(.+)' invokes the '(.+)' get API(?: '(.+)') * @description Sending a message to platform or app to get a value * @param {String} appId - app identifier. @@ -185,6 +185,7 @@ Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireb // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable if (fireboltCallKey) { + // Fetching fireboltCall object from fireboltCalls data cy.getFireboltData(fireboltCallKey).then((fireboltData) => { fireboltCallObject = fireboltData; cy.wrap(UTILS.getEnvVariable(CONSTANTS.RUNTIME)).then((object) => { @@ -193,6 +194,7 @@ Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireb }); }); } else { + // Reading fireboltCall object from the environment variable fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; fireboltCallObjectErrorMessage = 'Unable to find the firebolt object in the runtime environment variable'; @@ -265,10 +267,10 @@ Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireb }); /** - * @module fireboltCalls + * @module getterSetterCalls * @function '(.+)' registers for the '(.*?)'(?: '(.*?)')? event - * @description Sending a message to platform or app to register a event - * @param {String} appId - app identtifier. + * @description Sending a message to platform or app to register an event + * @param {String} appId - app identifier. * @param {String} sdk - sdk name. * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. * @example @@ -290,6 +292,7 @@ Given( // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable if (fireboltCallKey) { + // Fetching fireboltCall object from fireboltCalls data cy.getFireboltData(fireboltCallKey).then((fireboltData) => { fireboltCallObject = fireboltData; cy.wrap(UTILS.getEnvVariable(CONSTANTS.RUNTIME)).then((object) => { @@ -298,6 +301,7 @@ Given( }); }); } else { + // Reading fireboltCall object from the environment variable fireboltCallObject = UTILS.getEnvVariable(CONSTANTS.RUNTIME).fireboltCall; fireboltCallObjectErrorMessage = 'Unable to find the firebolt object in the runtime environment variable'; @@ -366,13 +370,13 @@ Given( ); /** - * @module validations + * @module getterSetterCalls * @function And '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? * @description Performing a validation against the source of truth for the given API response * @param {String} sdk - name of the sdk. - * @param {String} appId - The object was retrieved by using the appId. + * @param {String} appId - app identifier. * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData Json. - * @param {String} methodType - Determines which method doing content validation Ex: set or get + * @param {String} methodType - Determines the type of method being validated Ex: set or get * @param {String} errorContent - Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' * @example * And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' get API @@ -460,12 +464,12 @@ Given( ); /** - * @module validations + * @module getterSetterCalls * @function And '(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')? * @description Performing a event validation against the source of truth * @param {String} sdk - name of the sdk. - * @param {String} eventExpected - eventExpected will used to decide expecting for an event or not. - * @param {String} appId - The object was retrieved by using the appId. + * @param {String} eventExpected - Determines whether the event is expected or not. + * @param {String} appId - app identifier. * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData Json. * @param {String} errorContent - Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' * @example @@ -512,6 +516,7 @@ Given( : fireboltCallObject.eventValidationJsonPath; let contentObject = resolveContentObject(fireboltCallObject.content); + // Extract the event name event = event.includes('_') ? event.split('_')[1] : event; contentObject = contentObject ? contentObject : CONSTANTS.NULL_RESPONSE; eventValidationJsonPath = eventValidationJsonPath diff --git a/cypress/support/step_definitions/getterSetterCalls.md b/cypress/support/step_definitions/getterSetterCalls.md new file mode 100644 index 00000000..abf8db26 --- /dev/null +++ b/cypress/support/step_definitions/getterSetterCalls.md @@ -0,0 +1,132 @@ +# GetterSetterCallsGlue + +## 1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)' + +### Purpose: Sending a message to platform to set a value + +### Params: +| Param | Definition | +| --- | --- | +| sdk | sdk name | +| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | +| attribute | The attribute we are setting (ex. fontFamily) | +| invalidValue | Determines whether an error or result is expected. | +| value | The value used by the set method to set the value (ex. monospaced_sanserif) | + +### Examples: +* `Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true'` +* `Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to invalid 'test'` +* `Given '1st party app' invokes the 'Firebolt' API to set 'enable' to 'true'` + +## '(.+)' registers for the '(.*?)'(?: '(.*?)')? event + +### Purpose: Sending a message to platform or app to register a event + +### Params: +| Param | Definition | +| --- | --- | +| appId |app identifier | +| sdk | sdk name | +| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | + +### Examples: + * `And '1st party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event` + * `And '3rd party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event` + * `And '1st party app' registers for the 'Firebolt' event` + +## '(.+)' invokes the '(.+)' get API(?: '(.+)') + +### Purpose: Sending a message to platform or 3rd party app to get a value + +### Params: +| Param | Definition | +| --- | --- | +| appId | app identifier. | +| sdk | sdk name | +| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | + +### Examples: +* `And '1st party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` +* `And '3rd party app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` +* `And '3rd party app' invokes the 'Firebolt' get API` +* `And 'test_app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` + +## '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? +### Purpose: Performing a validation against the source of truth for the given API response + +### Params: +| Param | Definition | +| --- | --- | +| sdk | name of the sdk | +| appId | app identifier | +| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData Json | +| methodType | Determines which method doing content validation Ex: set or get | +| errorContent | Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' | + +### Examples: + * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' get API` + * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API` + * `And 'Firebolt' platform responds to '3rd party app' 'CLOSEDCAPTION_SETTINGS' get API` + * `And 'Firebolt' platform responds to '1st party app' set API` + * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API with 'INVALID_TYPE_PARAMS'` + +## '(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')? + +### Purpose: Performing a event validation against the source of truth + +### Params: +| Param | Definition | +| --- | --- | +| sdk | sdk name | +| eventExpected | Determines whether the event is expected or not. | +| appId |app identifier | +| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | +| errorContent | Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' | + +### Examples: + * `And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event` + * `And 'Firebolt' platform triggers '1st party app' event` + * `And 'Firebolt' platform triggers '3rd party app' 'CLOSEDCAPTION_SETTINGS' event` + * `And 'Firebolt' platform does not trigger '3rd party app' 'CLOSEDCAPTION_SETTINGS' event` + * `And 'Firebolt' platform triggers '1st party app' event` + * `And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event with 'INVALID_TYPE_PARAMS'` + +## '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? +### Purpose: Performing a validation against the source of truth for the given API response + +### Params: +| Param | Definition | +| --- | --- | +| sdk | name of the sdk | +| appId | app identifier | +| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData Json | +| methodType | Determines which method doing content validation Ex: set or get | +| errorContent | Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' | + +### Examples: + * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' get API` + * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API` + * `And 'Firebolt' platform responds to '3rd party app' 'CLOSEDCAPTION_SETTINGS' get API` + * `And 'Firebolt' platform responds to '1st party app' set API` + * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API with 'INVALID_TYPE_PARAMS'` + +## '(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')? + +### Purpose: Performing a event validation against the source of truth + +### Params: +| Param | Definition | +| --- | --- | +| sdk | sdk name | +| eventExpected | Determines whether the event is expected or not. | +| appId |app identifier | +| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | +| errorContent | Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' | + +### Examples: + * `And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event` + * `And 'Firebolt' platform triggers '1st party app' event` + * `And 'Firebolt' platform triggers '3rd party app' 'CLOSEDCAPTION_SETTINGS' event` + * `And 'Firebolt' platform does not trigger '3rd party app' 'CLOSEDCAPTION_SETTINGS' event` + * `And 'Firebolt' platform triggers '1st party app' event` + * `And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event with 'INVALID_TYPE_PARAMS'` diff --git a/cypress/support/step_definitions/validations.md b/cypress/support/step_definitions/validations.md index 6cad013a..ad0ebf12 100644 --- a/cypress/support/step_definitions/validations.md +++ b/cypress/support/step_definitions/validations.md @@ -412,43 +412,3 @@ While validating, if a key is present in both fcs-validation jsons (eg: cypress/ } ] } - -## '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? -### Purpose: Performing a validation against the source of truth for the given API response - -### Params: -| Param | Definition | -| --- | --- | -| sdk | name of the sdk | -| appId | The object was retrieved by using the appId | -| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData Json | -| methodType | Determines which method doing content validation Ex: set or get | -| errorContent | Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' | - -### Examples: - * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' get API` - * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API` - * `And 'Firebolt' platform responds to '3rd party app' 'CLOSEDCAPTION_SETTINGS' get API` - * `And 'Firebolt' platform responds to '1st party app' set API` - * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API with 'INVALID_TYPE_PARAMS'` - -## '(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')? - -### Purpose: Performing a event validation against the source of truth - -### Params: -| Param | Definition | -| --- | --- | -| sdk | sdk name | -| eventExpected | eventExpected will used to decide expecting for an event or not. | -| appId |app identtifier | -| fireboltCallKey | key name passed to look for firebolt call object in fireboltCallData | -| errorContent | Doing error content validation when error content object key passed. Ex: 'INVALID_TYPE_PARAMS' | - -### Examples: - * `And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event` - * `And 'Firebolt' platform triggers '1st party app' event` - * `And 'Firebolt' platform triggers '3rd party app' 'CLOSEDCAPTION_SETTINGS' event` - * `And 'Firebolt' platform does not trigger '3rd party app' 'CLOSEDCAPTION_SETTINGS' event` - * `And 'Firebolt' platform triggers '1st party app' event` - * `And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event with 'INVALID_TYPE_PARAMS'` From 42643f20472b68deae5a56af81343ed4cfd1a3b8 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 11 Jul 2024 20:16:57 +0530 Subject: [PATCH 263/359] Added minor changes --- cypress/support/cypress-commands/commands.js | 5 +- cypress/support/cypress-support/src/utils.js | 20 ++++ .../support/step_definitions/fireboltCalls.js | 12 ++- .../step_definitions/getterSetterCalls.js | 93 +++++-------------- 4 files changed, 56 insertions(+), 74 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index c355e577..00ab5af7 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -901,7 +901,7 @@ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, ta assert(false, CONSTANTS.NO_MATCHED_RESPONSE); } - response = typeof response == CONSTANTS.TYPE_STRING ? JSON.parse(response) : response; + response = typeof response === CONSTANTS.TYPE_STRING ? JSON.parse(response) : response; if ( response && @@ -940,7 +940,8 @@ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, ta // Call the 'censorData' command to hide sensitive data cy.censorData(method, dataToBeCensored).then((maskedResult) => { - fireLog.info(`Response from ${target}: ${JSON.stringify(maskedResult)}`); + const appLog = target === CONSTANTS.PLATFORM ? 'Firebolt platform' : `app: ${appId}`; + fireLog.info(`Response from ${appLog}: ${JSON.stringify(maskedResult)}`); }); // Creating object with event name, params, and response etc and storing it in a global list for further validation. const apiOrEventAppObject = diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 122c155d..8713facb 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -885,6 +885,25 @@ global.resolveAtRuntime = function (input) { }; }; +// A Function that recursively check each fields and invokes if it's a function within an array or object. +function resolveRecursiveValues(input) { + if (Array.isArray(input)) { + return input.map((item) => resolveRecursiveValues(item)); + } else if (typeof input == CONSTANTS.TYPE_OBJECT && input !== null) { + const newObj = {}; + for (const key in input) { + if (Object.hasOwnProperty.call(input, key)) { + newObj[key] = resolveRecursiveValues(input[key]); + } + } + return newObj; + } else if (input && typeof input === CONSTANTS.TYPE_FUNCTION) { + return input(); + } else { + return input; + } +} + module.exports = { replaceJsonStringWithEnvVar, createIntentMessage, @@ -910,4 +929,5 @@ module.exports = { fireLog, parseValue, checkForSecondaryAppId, + resolveRecursiveValues, }; diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index b5b50d91..615db912 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -50,7 +50,7 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = ' params: ' + JSON.stringify(parsedData.params) ); - cy.sendMessageToPlatformOrApp('Platform', additionalParams); + cy.sendMessageToPlatformOrApp(CONSTANTS.PLATFORM, additionalParams); }); }); }); @@ -96,7 +96,7 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { `Call from ${appId}, method: ${parsedData.method} params: ${JSON.stringify(parsedData.params)}` ); - cy.sendMessageToPlatformOrApp('App', additionalParams); + cy.sendMessageToPlatformOrApp(CONSTANTS.APP, additionalParams); }); }); }); @@ -135,7 +135,7 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI fireLog.info( `Registering for the ${parsedData.method} event using ${appId} with params : ${JSON.stringify(parsedData.params)}` ); - cy.sendMessageToPlatformOrApp('App', additionalParams, CONSTANTS.TASK.REGISTEREVENT); + cy.sendMessageToPlatformOrApp(CONSTANTS.APP, additionalParams, CONSTANTS.TASK.REGISTEREVENT); }); }); }); @@ -166,7 +166,11 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn parsedData.params )}` ); - cy.sendMessageToPlatformOrApp('Platform', additionalParams, CONSTANTS.TASK.REGISTEREVENT); + cy.sendMessageToPlatformOrApp( + CONSTANTS.PLATFORM, + additionalParams, + CONSTANTS.TASK.REGISTEREVENT + ); }); }); }); diff --git a/cypress/support/step_definitions/getterSetterCalls.js b/cypress/support/step_definitions/getterSetterCalls.js index a736dd26..accfbb21 100644 --- a/cypress/support/step_definitions/getterSetterCalls.js +++ b/cypress/support/step_definitions/getterSetterCalls.js @@ -104,16 +104,14 @@ Given( if (!fireboltCallObject) { fireLog.assert(false, fireboltCallObjectErrorMessage); } else { - let setMethod = - typeof fireboltCallObject.setMethod === CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.setMethod() - : fireboltCallObject.setMethod; + let setMethod = UTILS.resolveRecursiveValues(fireboltCallObject.setMethod); let setParams; // Extracting the parameter from the fireboltCall object - if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_FUNCTION) { - setParams = { value: fireboltCallObject.setParams() }; - } else if (typeof fireboltCallObject.setParams === CONSTANTS.TYPE_OBJECT) { + if ( + fireboltCallObject.setParams && + typeof fireboltCallObject.setParams === CONSTANTS.TYPE_OBJECT + ) { setParams = fireboltCallObject.setParams; // Iterating through the object and invoking it if it is a function @@ -123,7 +121,7 @@ Given( } } } else { - setParams = { value: fireboltCallObject.setParams }; + setParams = { value: UTILS.resolveRecursiveValues(fireboltCallObject.setParams) }; } const context = {}; @@ -203,14 +201,10 @@ Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireb if (!fireboltCallObject) { fireLog.assert(false, fireboltCallObjectErrorMessage); } else { - let method = - typeof fireboltCallObject.method === CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.method() - : fireboltCallObject.method; - const param = - fireboltCallObject.params && typeof fireboltCallObject.params === CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.params() - : fireboltCallObject.params; + let method = UTILS.resolveRecursiveValues(fireboltCallObject.method); + const param = UTILS.resolveRecursiveValues(fireboltCallObject.params); + console.log('method', method); + console.log('param', param); const context = {}; const expected = CONSTANTS.RESULT; @@ -228,11 +222,6 @@ Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireb method = method.split('_')[1]; } - // If method and param are not supported setting isScenarioExempted as true for further validation. - if (UTILS.isScenarioExempted(method, param)) { - Cypress.env(CONSTANTS.IS_SCENARIO_EXEMPTED, true); - } - const additionalParams = { method: method, params: param, @@ -308,10 +297,7 @@ Given( if (!fireboltCallObject) { fireLog.assert(false, fireboltCallObjectErrorMessage); } else { - let event = - typeof fireboltCallObject.event === CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.event() - : fireboltCallObject.event; + let event = UTILS.resolveRecursiveValues(fireboltCallObject.event); const eventParams = {}; const context = {}; appId = @@ -324,7 +310,7 @@ Given( // Splitting the method name if it contains an underscore and using the first part to determine the action that decides sdk. if (event && event.includes('_')) { - action = setMethod.split('_')[0]; + action = event.split('_')[0]; event = event.split('_')[1]; } @@ -409,24 +395,18 @@ Given( cy.then(() => { let method = methodType === CONSTANTS.SET - ? typeof fireboltCallObject.setMethod == CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.setMethod() - : fireboltCallObject.setMethod - : typeof fireboltCallObject.method == CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.method() - : fireboltCallObject.method; + ? UTILS.resolveRecursiveValues(fireboltCallObject.setMethod) + : UTILS.resolveRecursiveValues(fireboltCallObject.method); + let validationJsonPath = methodType === CONSTANTS.SET - ? typeof fireboltCallObject.setValidationJsonPath == CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.setValidationJsonPath() - : fireboltCallObject.setValidationJsonPath - : typeof fireboltCallObject.validationJsonPath == CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.validationJsonPath() - : fireboltCallObject.validationJsonPath; + ? UTILS.resolveRecursiveValues(fireboltCallObject.setValidationJsonPath) + : UTILS.resolveRecursiveValues(fireboltCallObject.validationJsonPath); + let contentObject = methodType === CONSTANTS.SET - ? resolveContentObject(fireboltCallObject.setContent) - : resolveContentObject(fireboltCallObject.content); + ? UTILS.resolveRecursiveValues(fireboltCallObject.setContent) + : UTILS.resolveRecursiveValues(fireboltCallObject.content); method = method.includes('_') ? method.split('_')[1] : method; contentObject = contentObject ? contentObject : CONSTANTS.NULL_RESPONSE; @@ -502,15 +482,11 @@ Given( } cy.then(() => { - let event = - typeof fireboltCallObject.event == CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.event() - : fireboltCallObject.event; - let eventValidationJsonPath = - typeof fireboltCallObject.eventValidationJsonPath == CONSTANTS.TYPE_FUNCTION - ? fireboltCallObject.eventValidationJsonPath() - : fireboltCallObject.eventValidationJsonPath; - let contentObject = resolveContentObject(fireboltCallObject.content); + let event = UTILS.resolveRecursiveValues(fireboltCallObject.event); + let eventValidationJsonPath = UTILS.resolveRecursiveValues( + fireboltCallObject.eventValidationJsonPath + ); + let contentObject = UTILS.resolveRecursiveValues(fireboltCallObject.content); event = event.includes('_') ? event.split('_')[1] : event; contentObject = contentObject ? contentObject : CONSTANTS.NULL_RESPONSE; @@ -545,22 +521,3 @@ Given( } } ); - -// A Function that recursively check each fields and invokes if it's a function within an array or object. -function resolveContentObject(input) { - if (Array.isArray(input)) { - return input.map((item) => resolveContentObject(item)); - } else if (typeof input == CONSTANTS.TYPE_OBJECT && input !== null) { - const newObj = {}; - for (const key in input) { - if (Object.hasOwnProperty.call(input, key)) { - newObj[key] = resolveContentObject(input[key]); - } - } - return newObj; - } else if (input && typeof input === CONSTANTS.TYPE_FUNCTION) { - return input(); - } else { - return input; - } -} From 4713e3df167807addf3a6843706b59be29771b8d Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Thu, 11 Jul 2024 20:38:59 +0530 Subject: [PATCH 264/359] resolved conflicts --- cypress/support/step_definitions/getterSetterCalls.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cypress/support/step_definitions/getterSetterCalls.js b/cypress/support/step_definitions/getterSetterCalls.js index 8247ef8b..54ae3867 100644 --- a/cypress/support/step_definitions/getterSetterCalls.js +++ b/cypress/support/step_definitions/getterSetterCalls.js @@ -20,7 +20,7 @@ import UTILS, { fireLog } from '../cypress-support/src/utils'; const CONSTANTS = require('../constants/constants'); /** - * @module settersGetterCalls + * @module getterSetterCalls * @function Given we test the '(.+)' getters and setters * @description Define and cache the fireboltCall object to use for getters and setters scenario by saving the object in env variable. * @param {String} key - key name of the fireboltCall setter/getter data. @@ -71,7 +71,6 @@ Given( let fireboltCallObject; let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; - // runtime environment variable holds attribute and value if (!UTILS.getEnvVariable(CONSTANTS.RUNTIME, false)) { Cypress.env(CONSTANTS.RUNTIME, {}); } @@ -492,7 +491,7 @@ Given( ); let contentObject = UTILS.resolveRecursiveValues(fireboltCallObject.content); - // Extract the event name + // Extract the event name event = event.includes('_') ? event.split('_')[1] : event; contentObject = contentObject ? contentObject : CONSTANTS.NULL_RESPONSE; eventValidationJsonPath = eventValidationJsonPath From e75ecc66feb546ab88d4b3e9bd05b1759311736d Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 12 Jul 2024 11:28:54 +0530 Subject: [PATCH 265/359] addressed the comments --- cypress/support/cypress-commands/commands.js | 25 +++++++++- cypress/support/cypress-support/src/utils.js | 9 +++- cypress/support/cypress-support/src/utils.md | 14 ++++++ .../support/step_definitions/fireboltCalls.js | 49 ++++--------------- .../step_definitions/getterSetterCalls.js | 29 +++++------ .../step_definitions/getterSetterCalls.md | 18 +++---- .../support/step_definitions/validations.js | 2 +- 7 files changed, 77 insertions(+), 69 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 00ab5af7..e6932696 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -835,7 +835,18 @@ Cypress.Commands.add('clearCache', () => { cy.reload(true); }); - +/** + * @module commands + * @function sendMessageToPlatformOrApp + * @description Function to send message to Platform or App to make an Api call. + * @param {String} target - 'App' or 'Platform' + * @param {String} additionalParams - Contains the data which required to create request message to make a call. + * @param {String} task - Task/Handler name that decides whether make a api call or event call. + * @example + * cy.sendMessageToPlatformOrApp('App', {method: 'account.id', params: {}, context: {}, action: 'core', expected: 'result', appId: 'test.test'} + * cy.sendMessageToPlatformOrApp('Platform', {method: 'account.id', params: {}, context: {}, action: 'core', expected: 'result'} + * cy.sendMessageToPlatformOrApp('App', {method: 'accessibility.onClosedCaptionsSettingsChanged', params: {}, context: {}, action: 'core', expected: 'result', appId: 'test.test', 'registerEvent'} + */ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, task) => { const { method, params, context, action, expected, appId } = additionalParams; task = task ? task : CONSTANTS.TASK.CALLMETHOD; @@ -963,7 +974,17 @@ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, ta }); }); -Cypress.Commands.add('methodorEventResponseValidation', (validationType, additionalParams) => { +/** + * @module commands + * @function sendMessageToPlatformOrApp + * @description Function to send message to Platform or App to make an Api call. + * @param {String} validationType - Determines whether method or event validation is being performed. Ex: 'method' or 'event' + * @param {String} additionalParams - Contains the data which required to do content validation for the specified method. + * @example + * cy.sendMessageToPlatformOrApp('method', {method: 'account.id', context: {}, contentObject: {}, expectingError: false, appId: 'test.test'} + * cy.sendMessageToPlatformOrApp('event', {method: 'accessibility.onClosedCaptionsSettingsChanged', context: {}, contentObject: {}, expectingError: false, appId: 'test.test', eventExpected: 'triggers'} + */ +Cypress.Commands.add('methodOrEventResponseValidation', (validationType, additionalParams) => { const { method, context, contentObject, expectingError, appId, eventExpected } = additionalParams; let validationJsonPath = additionalParams.validationJsonPath; diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 8713facb..9f5b49b2 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -885,7 +885,14 @@ global.resolveAtRuntime = function (input) { }; }; -// A Function that recursively check each fields and invokes if it's a function within an array or object. +/** + * @module utils + * @function resolveRecursiveValues + * @description A Function that recursively check each fields and invoke if it is a function within an array or object. + * @param {*} input - value which need to resolved and it may be string/object/array/function + * @example + * resolveRecursiveValues(function()) + */ function resolveRecursiveValues(input) { if (Array.isArray(input)) { return input.map((item) => resolveRecursiveValues(item)); diff --git a/cypress/support/cypress-support/src/utils.md b/cypress/support/cypress-support/src/utils.md index b668e49c..3c1e1ea3 100644 --- a/cypress/support/cypress-support/src/utils.md +++ b/cypress/support/cypress-support/src/utils.md @@ -305,6 +305,7 @@ request response - `123` - `true` + ## resolveAtRuntime ### Purpose: Return the function which is having logic to resolve the value for the passed input at runtime. @@ -326,3 +327,16 @@ return - `['result.fontSize', 'result.styles.fontSize']` - `"manage_closedcaptions.setFontSize"` - `1.5` + +## resolveRecursiveValues + +### Purpose: A Function that recursively check each fields and invoke if it is a function within an array or object. + +### Params: +| Param | Definition| Type | +| --- | --- | --- | +| input | value which need to resolved | * | + +### Examples: +request +- `resolveRecursiveValues(function())` diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 615db912..60265d4f 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -35,14 +35,7 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = // Fetching the data like method, param, context and action etc. cy.fireboltDataParser(key, sdk).then((parsedDataArr) => { parsedDataArr.forEach((parsedData) => { - const additionalParams = { - method: parsedData.method, - params: parsedData.params, - context: parsedData.context, - action: parsedData.action, - expected: parsedData.expected, - appId: Cypress.env(CONSTANTS.FIRST_PARTY_APPID), - }; + parsedData.appId = Cypress.env(CONSTANTS.FIRST_PARTY_APPID); fireLog.info( 'Call from 1st party App, method: ' + @@ -50,7 +43,7 @@ Given(/1st party app invokes the (?:'(.+)' )?API to '(.+)'$/, async (sdk, key) = ' params: ' + JSON.stringify(parsedData.params) ); - cy.sendMessageToPlatformOrApp(CONSTANTS.PLATFORM, additionalParams); + cy.sendMessageToPlatformOrApp(CONSTANTS.PLATFORM, parsedData); }); }); }); @@ -84,19 +77,13 @@ Given(/'(.+)' invokes the '(.+)' API to '(.+)'$/, async (appId, sdk, key) => { ) { cy.fetchLifecycleHistory(appId); } - const additionalParams = { - method: parsedData.method, - params: parsedData.params, - context: parsedData.context, - action: parsedData.action, - expected: parsedData.expected, - appId: appId, - }; + parsedData.appId = appId; + fireLog.info( `Call from ${appId}, method: ${parsedData.method} params: ${JSON.stringify(parsedData.params)}` ); - cy.sendMessageToPlatformOrApp(CONSTANTS.APP, additionalParams); + cy.sendMessageToPlatformOrApp(CONSTANTS.APP, parsedData); }); }); }); @@ -124,18 +111,11 @@ Given(/'(.+)' registers for the '(.+)' event using the '(.+)' API$/, async (appI ? UTILS.getEnvVariable(CONSTANTS.THIRD_PARTY_APP_ID) : UTILS.checkForSecondaryAppId(appId); - const additionalParams = { - method: parsedData.method, - params: parsedData.params, - context: parsedData.context, - action: parsedData.action, - expected: parsedData.expected, - appId: appId, - }; + parsedData.appId = appId; fireLog.info( `Registering for the ${parsedData.method} event using ${appId} with params : ${JSON.stringify(parsedData.params)}` ); - cy.sendMessageToPlatformOrApp(CONSTANTS.APP, additionalParams, CONSTANTS.TASK.REGISTEREVENT); + cy.sendMessageToPlatformOrApp(CONSTANTS.APP, parsedData, CONSTANTS.TASK.REGISTEREVENT); }); }); }); @@ -153,24 +133,13 @@ Given(/1st party app registers for the '(.+)' event using the '(.+)' API$/, asyn // Fetching the data like method, param, context and action etc. cy.fireboltDataParser(key, sdk).then((parsedDataArr) => { parsedDataArr.forEach((parsedData) => { - const additionalParams = { - method: parsedData.method, - params: parsedData.params, - context: parsedData.context, - action: parsedData.action, - expected: parsedData.expected, - appId: UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID), - }; + parsedData.appId = UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID); fireLog.info( `Registering for the ${parsedData.method} event using 1st party App with params : ${JSON.stringify( parsedData.params )}` ); - cy.sendMessageToPlatformOrApp( - CONSTANTS.PLATFORM, - additionalParams, - CONSTANTS.TASK.REGISTEREVENT - ); + cy.sendMessageToPlatformOrApp(CONSTANTS.PLATFORM, parsedData, CONSTANTS.TASK.REGISTEREVENT); }); }); }); diff --git a/cypress/support/step_definitions/getterSetterCalls.js b/cypress/support/step_definitions/getterSetterCalls.js index 54ae3867..44b35ed3 100644 --- a/cypress/support/step_definitions/getterSetterCalls.js +++ b/cypress/support/step_definitions/getterSetterCalls.js @@ -51,7 +51,7 @@ Given( /** * @module getterSetterCalls - * @function 1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)' + * @function Given 1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)' * @description Sending a message to platform to set a value * @param {String} sdk - sdk name. * @param {String} fireboltCallKey - key name passed to look for firebolt call object in fireboltCallData. @@ -59,9 +59,9 @@ Given( * @param {String} invalidValue - Determines whether expecting for an error or result. * @param {String} value - The value used by the set method to set the value (ex. monospaced_sanserif) * @example - * Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true' - * Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to invalid 'test' - * Given '1st party app' invokes the 'Firebolt' API to set 'enable' to 'true' + * Given 1st party app invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true' + * Given 1st party app invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to invalid 'test' + * Given 1st party app invokes the 'Firebolt' API to set 'enable' to 'true' */ Given( /1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)'$/, @@ -74,16 +74,16 @@ Given( if (!UTILS.getEnvVariable(CONSTANTS.RUNTIME, false)) { Cypress.env(CONSTANTS.RUNTIME, {}); } + + // Store attribute and value in the runtime environment variable let object = UTILS.getEnvVariable(CONSTANTS.RUNTIME); object = Object.assign(object, { attribute: attribute, value: value, }); - - // Store attribute and value in the runtime environment variable Cypress.env(CONSTANTS.RUNTIME, object); - // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable + // When fireboltCall object key passed fetching the object from the fireboltCalls data else reading it from environment variable. if (fireboltCallKey) { cy.getFireboltData(fireboltCallKey).then((fireboltData) => { fireboltCallObject = fireboltData; @@ -159,7 +159,7 @@ Given( /** * @module getterSetterCalls - * @function '(.+)' invokes the '(.+)' get API(?: '(.+)') + * @function Given '(.+)' invokes the '(.+)' get API(?: '(.+)') * @description Sending a message to platform or app to get a value * @param {String} appId - app identifier. * @param {String} sdk - sdk name. @@ -204,9 +204,6 @@ Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireb } else { let method = UTILS.resolveRecursiveValues(fireboltCallObject.method); const param = UTILS.resolveRecursiveValues(fireboltCallObject.params); - console.log('method', method); - console.log('param', param); - const context = {}; const expected = CONSTANTS.RESULT; appId = @@ -256,7 +253,7 @@ Given(/'(.+)' invokes the '(.+)' get API(?: '(.+)')?$/, async (appId, sdk, fireb /** * @module getterSetterCalls - * @function '(.+)' registers for the '(.*?)'(?: '(.*?)')? event + * @function Given '(.+)' registers for the '(.*?)'(?: '(.*?)')? event * @description Sending a message to platform or app to register an event * @param {String} appId - app identifier. * @param {String} sdk - sdk name. @@ -356,7 +353,7 @@ Given( /** * @module getterSetterCalls - * @function And '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? + * @function Given '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? * @description Performing a validation against the source of truth for the given API response * @param {String} sdk - name of the sdk. * @param {String} appId - app identifier. @@ -429,7 +426,7 @@ Given( appId: appId, }; if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { - cy.methodorEventResponseValidation(CONSTANTS.METHOD, additionalParams); + cy.methodOrEventResponseValidation(CONSTANTS.METHOD, additionalParams); } else { cy.log( `${CONSTANTS.SKIPCONTENTVALIDATION} flag is enabled, Skipping the Content validation` @@ -444,7 +441,7 @@ Given( /** * @module getterSetterCalls - * @function And '(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')? + * @function Given '(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')? * @description Performing a event validation against the source of truth * @param {String} sdk - name of the sdk. * @param {String} eventExpected - Determines whether the event is expected or not. @@ -513,7 +510,7 @@ Given( eventExpected: eventExpected, }; if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { - cy.methodorEventResponseValidation(CONSTANTS.EVENT, additionalParams); + cy.methodOrEventResponseValidation(CONSTANTS.EVENT, additionalParams); } else { cy.log( `${CONSTANTS.SKIPCONTENTVALIDATION} flag is enabled, Skipping the Content validation` diff --git a/cypress/support/step_definitions/getterSetterCalls.md b/cypress/support/step_definitions/getterSetterCalls.md index abf8db26..2559b774 100644 --- a/cypress/support/step_definitions/getterSetterCalls.md +++ b/cypress/support/step_definitions/getterSetterCalls.md @@ -1,6 +1,6 @@ # GetterSetterCallsGlue -## 1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)' +## Given 1st party app invokes the '(.+)' API (?:'(.+)' )?to set '(.+)' to( invalid)? '(.+)' ### Purpose: Sending a message to platform to set a value @@ -14,11 +14,11 @@ | value | The value used by the set method to set the value (ex. monospaced_sanserif) | ### Examples: -* `Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true'` -* `Given '1st party app' invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to invalid 'test'` -* `Given '1st party app' invokes the 'Firebolt' API to set 'enable' to 'true'` +* `Given 1st party app invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to 'true'` +* `Given 1st party app invokes the 'Firebolt' API 'CLOSEDCAPTION_SETTINGS' to set 'enable' to invalid 'test'` +* `Given 1st party app invokes the 'Firebolt' API to set 'enable' to 'true'` -## '(.+)' registers for the '(.*?)'(?: '(.*?)')? event +## Given '(.+)' registers for the '(.*?)'(?: '(.*?)')? event ### Purpose: Sending a message to platform or app to register a event @@ -34,7 +34,7 @@ * `And '3rd party app' registers for the 'Firebolt' 'CLOSEDCAPTION_SETTINGS' event` * `And '1st party app' registers for the 'Firebolt' event` -## '(.+)' invokes the '(.+)' get API(?: '(.+)') +## Given '(.+)' invokes the '(.+)' get API(?: '(.+)') ### Purpose: Sending a message to platform or 3rd party app to get a value @@ -51,7 +51,7 @@ * `And '3rd party app' invokes the 'Firebolt' get API` * `And 'test_app' invokes the 'Firebolt' get API 'CLOSEDCAPTION_SETTINGS'` -## '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? +## Given '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? ### Purpose: Performing a validation against the source of truth for the given API response ### Params: @@ -70,7 +70,7 @@ * `And 'Firebolt' platform responds to '1st party app' set API` * `And 'Firebolt' platform responds to '1st party app' 'CLOSEDCAPTION_SETTINGS' set API with 'INVALID_TYPE_PARAMS'` -## '(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')? +## Given '(.+)' platform (triggers|does not trigger) '(.*?)'(?: '(.*?)')? event(?: with '(.+)')? ### Purpose: Performing a event validation against the source of truth @@ -91,7 +91,7 @@ * `And 'Firebolt' platform triggers '1st party app' event` * `And 'Firebolt' platform triggers '1st party app' 'CLOSEDCAPTION_SETTINGS' event with 'INVALID_TYPE_PARAMS'` -## '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? +## Given '(.+)' platform responds to '([^']*)'(?: '([^']*)')? (get|set) API(?: with '(.+)')? ### Purpose: Performing a validation against the source of truth for the given API response ### Params: diff --git a/cypress/support/step_definitions/validations.js b/cypress/support/step_definitions/validations.js index ac1ecf69..87714966 100644 --- a/cypress/support/step_definitions/validations.js +++ b/cypress/support/step_definitions/validations.js @@ -80,7 +80,7 @@ Given( eventExpected: eventExpected, }; if (!Cypress.env(CONSTANTS.SKIPCONTENTVALIDATION)) { - cy.methodorEventResponseValidation(validationType, additionalParams); + cy.methodOrEventResponseValidation(validationType, additionalParams); } else { cy.log( `${CONSTANTS.SKIPCONTENTVALIDATION} flag is enabled, Skipping the Content validation` From ec91d103027b3fd262aad8380865af8a4a6cba96 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 12 Jul 2024 12:11:41 +0530 Subject: [PATCH 266/359] FIRECERT-2194 updated discoveryHotLaunch TCs --- .../FireboltCertification/DiscoveryLaunchHot.feature | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature b/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature index e8e175e9..54e85897 100644 --- a/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature +++ b/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature @@ -219,6 +219,7 @@ Feature: Discovery.launch_HotLaunch And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId When Test runner waits for 10 'seconds' And 'secondary 3rd party app' registers for the 'discovery onNavigateTo' event using the 'Firebolt' API + And 'secondary 3rd party app' transitions to state 'background' And 3rd party 'certification' app is launched And '3rd party app' registers for the 'discovery onNavigateTo' event using the 'Firebolt' API When 1st party app invokes the 'Firebolt' API to 'launch app with home intent' @@ -226,15 +227,15 @@ Feature: Discovery.launch_HotLaunch And '3rd party app' invokes the 'Firebolt' API to 'fetch lifecycle state' Then 'Firebolt' platform responds with 'foreground for lifecycle state' And 'Firebolt' platform triggers event 'onNavigateTo with home intent' - And 'Firebolt' platform triggers to 'secondary 3rd party app' event 'onNavigateTo with null response' + And 'Firebolt' platform does not trigger to 'secondary 3rd party app' event 'onNavigateTo' @DiscoveryLaunch @coreSDK @sdk @transport Scenario: Discovery.Launch Hot Launch - Positive Scenario: Event validation where one app is in inactive and one is in foreground Given the environment has been set up for 'DiscoveryLaunch' tests And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId When Test runner waits for 10 'seconds' - And '3rd party app' transitions to state 'inactive' And 'secondary 3rd party app' registers for the 'discovery onNavigateTo' event using the 'Firebolt' API + And 'secondary 3rd party app' transitions to state 'inactive' And 3rd party 'certification' app is launched And '3rd party app' registers for the 'discovery onNavigateTo' event using the 'Firebolt' API When 1st party app invokes the 'Firebolt' API to 'launch app with home intent' @@ -242,4 +243,4 @@ Feature: Discovery.launch_HotLaunch And '3rd party app' invokes the 'Firebolt' API to 'fetch lifecycle state' Then 'Firebolt' platform responds with 'foreground for lifecycle state' And 'Firebolt' platform triggers event 'onNavigateTo with home intent' - And 'Firebolt' platform triggers to 'secondary 3rd party app' event 'onNavigateTo with null response' + And 'Firebolt' platform does not trigger to 'secondary 3rd party app' event 'onNavigateTo' From 1a2ac95801a0932e721033a245107d18edb5861e Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 12 Jul 2024 14:22:42 +0530 Subject: [PATCH 267/359] FIRECERT-2112 updated logs for validationCheck --- cypress/support/cypress-commands/assertion.js | 89 +++++++++---------- 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index d604f5c5..483cf210 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -125,10 +125,6 @@ Cypress.Commands.add( appId, validationType ); - console.log('entered apiOrEventObject >>> ', apiOrEventObject); - // if(apiOrEventObject && apiOrEventObject.eventListenerResponse && apiOrEventObject.eventListenerResponse.error){ - - // } const apiErrorResponse = validationType == CONSTANTS.EVENT ? apiOrEventObject.eventListenerResponse.error @@ -223,32 +219,38 @@ Cypress.Commands.add( ) { skipSchema = true; } - cy.then(() => { - if (apiSchemaResult && !skipSchema) { - // Validating the schema validation result - cy.schemaValidationCheck(apiSchemaResult).then((result) => { - let isNullCheckSkipped = false; - - // Enable the isNullCheckSkipped flag when an error is not present in the response and the schema is passed without expecting an error. - if (response.error == null || response.error == undefined) { - result.validationStatus == CONSTANTS.PASS && errorExpected != CONSTANTS.ERROR - ? (isNullCheckSkipped = true) - : (isNullCheckSkipped = false); - } + // Verifying whether the error is undefined or not in the response received. + cy.errorNotUndefinedCheck(response) + .then((result) => { + // Pushing the validation status object into an array. + validationCheck.push(result); + }) + .then(() => { + if (apiSchemaResult && !skipSchema) { + // Validating the schema validation result + cy.schemaValidationCheck(apiSchemaResult).then((result) => { + let isNullCheckSkipped = false; + + // Enable the isNullCheckSkipped flag when an error is not present in the response and the schema is passed without expecting an error. + if (response.error == null || response.error == undefined) { + result.validationStatus == CONSTANTS.PASS && errorExpected != CONSTANTS.ERROR + ? (isNullCheckSkipped = true) + : (isNullCheckSkipped = false); + } + // Checking if the error is null in the response and if the error is expected or not. + if (!UTILS.getEnvVariable(CONSTANTS.IS_SCENARIO_EXEMPTED, false)) { + cy.errorNullCheck(response, errorExpected, isNullCheckSkipped).then((result) => { + validationCheck.push(result); + }); + } + }); + } else { // Checking if the error is null in the response and if the error is expected or not. - if (!UTILS.getEnvVariable(CONSTANTS.IS_SCENARIO_EXEMPTED, false)) { - cy.errorNullCheck(response, errorExpected, isNullCheckSkipped).then((result) => { - validationCheck.push(result); - }); - } - }); - } else { - // Checking if the error is null in the response and if the error is expected or not. - cy.errorNullCheck(response, errorExpected).then((result) => { - validationCheck.push(result); - }); - } - }) + cy.errorNullCheck(response, errorExpected).then((result) => { + validationCheck.push(result); + }); + } + }) .then(() => { if (apiSchemaResult) { // Validating the schema validation result @@ -444,23 +446,20 @@ function loggingValidationCheckResult(validationCheck) { }); // Printing the status of all checks in the report. - cy.get(validationCheck) - .each((logging) => { - cy.log( - `${logging.validationPoint}: ${logging.validationStatus}. ${logging.message}`, - 'loggingValidationCheckResult' + cy.get(validationCheck); + // Assume the checks. If anything is marked other than skipped or pass, then fail the testcase. + validationCheck.forEach((assertion) => { + if (assertion.validationStatus == CONSTANTS.SKIPPED) { + fireLog.info(`${assertion.validationPoint}: ${assertion.validationStatus}`); + } else { + fireLog.info( + `${assertion.validationPoint}: ${assertion.validationStatus} ${assertion.message}` ); - }) - .then(() => { - // Assume the checks. If anything is marked other than skipped or pass, then fail the testcase. - validationCheck.forEach((assertion) => { - if (assertion.validationStatus == CONSTANTS.SKIPPED) { - assert.equal(assertion.validationStatus, CONSTANTS.SKIPPED, assertion.validationPoint); - } else { - assert.equal(assertion.validationStatus, CONSTANTS.PASS, assertion.validationPoint); - } - }); - }); + if (assertion.validationStatus == CONSTANTS.FAIL) { + throw new Error(`${assertion.validationPoint} failed, ${assertion.message}`); + } + } + }); } /** From fe7df2b81ff41666e5a15f85c3e281b81296138b Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 12 Jul 2024 15:12:28 +0530 Subject: [PATCH 268/359] FIRECERT-2112 updated methodContentValidation logs --- cypress/support/cypress-commands/assertion.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index 483cf210..b19a07e3 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -191,7 +191,11 @@ Cypress.Commands.add( ' to be ' + JSON.stringify(expected); // Executing fireLog.deepEqual() after logging - fireLog.deepEqual(apiResponseContent, expected, pretext); + if (apiResponseContent != expected) { + throw new Error(`${pretext}`); + } else { + fireLog.info(`${pretext}`); + } } } ); From e84bce64587ce116daccbde2c32bd99b0ec06577 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 12 Jul 2024 15:43:00 +0530 Subject: [PATCH 269/359] Added 2198 changes --- .../Accessibility.feature | 284 +++++++++--------- .../Manage/ClosedCaptionsManage.feature | 193 ++++++------ .../fixtures/fireboltCalls/accessibility.js | 145 +++++++++ .../fixtures/fireboltCalls/closedcaptions.js | 27 ++ cypress/support/cypress-commands/commands.js | 247 ++++++++------- cypress/support/cypress-support/src/utils.js | 1 + .../step_definitions/getterSetterCalls.js | 2 + .../support/validations/schemaValidation.js | 6 +- 8 files changed, 561 insertions(+), 344 deletions(-) create mode 100644 cypress/fixtures/fireboltCalls/accessibility.js create mode 100644 cypress/fixtures/fireboltCalls/closedcaptions.js diff --git a/cypress/TestCases/FireboltCertification/Accessibility.feature b/cypress/TestCases/FireboltCertification/Accessibility.feature index a8da02f5..1268a55f 100644 --- a/cypress/TestCases/FireboltCertification/Accessibility.feature +++ b/cypress/TestCases/FireboltCertification/Accessibility.feature @@ -1,157 +1,155 @@ Feature: Accessibility - Background: Launch FCA for 'Accessibility' - Given the environment has been set up for 'Accessibility' tests - And 3rd party 'certification' app is launched + Background: Launch FCA for 'Accessibility' + Given the environment has been set up for 'Accessibility' tests + And 3rd party 'certification' app is launched - @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: - When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API - And '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' - Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' + @Accessibility @coreSDK @sdk @transport + Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: + Given we test the 'CLOSEDCAPTIONS_SETTINGS' getters and setters '' to '' + When '3rd party app' registers for the 'Firebolt' event + When '3rd party app' invokes the 'Firebolt' get API + Given 1st party app invokes the 'Firebolt' API to set '' to '' + And 'Firebolt' platform responds to '1st party app' set API + When '3rd party app' invokes the 'Firebolt' get API + And 'Firebolt' platform responds to '3rd party app' get API + And 'Firebolt' platform triggers '3rd party app' event - Examples: - | Scenario | Key | Method_Content | Event_Content | - | Disable closedcaptions | disable closedCaptions | disabled for closedCaptions settings | onclosedCaptionsSettingsChanged with disabled | - | Enable closedcaptions | enable closedCaptions | enabled for closedCaptions settings | onclosedCaptionsSettingsChanged with enabled | - | Set fontFamily-monospaced_sanserif | set fontFamily to monospaced_sanserif | monospace sanserif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with monospace sanserif for fontfamily | - | Set fontFamily-cursive | set fontFamily to cursive | cursive for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with cursive for fontfamily | - | Set fontFamily-proportional_serif | set fontFamily to proportional_serif | proportional serif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with proportional serif for fontfamily | - | Set fontFamily-monospaced_serif | set fontFamily to monospaced_serif | monospaced serif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with monospaced serif for fontfamily | - | Set fontFamily-proportional_sanserif | set fontFamily to proportional_sanserif | proportional sanserif for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with proportional sanserif for fontfamily | - | Set fontFamily-smallcaps | set fontFamily to smallcaps | smallcaps for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with smallcaps for fontfamily | - | Set fontFamily-casual | set fontFamily to casual | casual for fontfamily in closedcaptions settings | onclosedCaptionsSettingsChanged with casual for fontfamily | - | Set fontSize-1 | set fontSize to 1 | 1 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 1 for fontSize | - | Set fontSize-0.5 | set fontSize to 0.5 | 0.5 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 0.5 for fontSize | - | Set fontSize-1.5 | set fontSize to 1.5 | 1.5 for fontSize in closedcaptions settings | onclosedCaptionsSettingsChanged with 1.5 for fontSize | - | Set fontColor-#ff00ff | set fontColor to #ff00ff | #ff00ff for fontColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #ff00ff for fontColor | - | Set fontEdge-raised | set fontEdge to raised | raised for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with raised for fontEdge | - | Set fontEdge-none | set fontEdge to none | none for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with none for fontEdge | - | Set fontEdge-depressed | set fontEdge to depressed | depressed for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with depressed for fontEdge | - | Set fontEdge-uniform | set fontEdge to uniform | uniform for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with uniform for fontEdge | - | Set fontEdge-dropShadow-left | set fontEdge to dropShadow_left | dropShadowLeft for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with dropShadowLeft for fontEdge | - | Set fontEdge-dropShadow-right | set fontEdge to dropShadow_right | dropShadowRight for fontEdge in closedcaptions settings | onclosedCaptionsSettingsChanged with dropShadowRight for fontEdge | - | Set fontEdgeColor-#FFFFFF | set fontEdgeColor to #FFFFFF | #ffffff for fontEdgeColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #ffffff for fontEdgeColor | - | Set backgroundColor-#7f7f7f | set backgroundColor to #7f7f7f | #7f7f7f for backgroundColor in closedcaptions settings | onclosedCaptionsSettingsChanged with #7f7f7f for backgroundColor | - | Set fontOpacity-75 | set fontOpacity to 75 | 75 for fontOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 75 for fontOpacity | - | Set backgroundOpacity-75 | set backgroundOpacity to 75 | 75 for backgroundOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 75 for backgroundOpacity | - | Set textAlign-left | set textAlign to left | left for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with left for textAlign | - | Set textAlign-center | set textAlign to center | center for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with center for textAlign | - | Set textAlign-right | set textAlign to right | right for textAlign in closedcaptions settings | onclosedCaptionsSettingsChanged with right for textAlign | - | Set textAlignVertical-top | set textAlignVertical to top | top for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with top for textAlignVertical | - | Set textAlignVertical-middle | set textAlignVertical to middle | middle for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with middle for textAlignVertical | - | Set textAlignVertical-bottom | set textAlignVertical to bottom | bottom for textAlignVertical in closedcaptions settings | onclosedCaptionsSettingsChanged with bottom for textAlignVertical | - | Set windowColor-white | set windowColor to white | white for windowColor in closedcaptions settings | onclosedCaptionsSettingsChanged with white for windowColor | - | Set windowOpacity-50 | set windowOpacity to 50 | 50 for windowOpacity in closedcaptions settings | onclosedCaptionsSettingsChanged with 50 for windowOpacity | - | Set preferredLanguages | set preferredLanguages to spanish english | spanish for preferredLanguages in closedcaptions settings | onclosedCaptionsSettingsChanged with spanish for preferredLanguages | + Examples: + | Scenario | Method | Value | + | Disable closedcaptions | enabled | false | + | Enable closedcaptions | enabled | true | + | Set fontFamily-monospaced_sanserif | fontFamily | monospaced_sanserif | + | Set fontFamily-cursive | fontFamily | cursive | + | Set fontFamily-proportional_serif | fontFamily | proportional_serif | + | Set fontFamily-monospaced_serif | fontFamily | monospaced_serif | + | Set fontFamily-proportional_sanserif | fontFamily | proportional_sanserif | + | Set fontFamily-smallcaps | fontFamily | smallcaps | + | Set fontFamily-casual | fontFamily | casual | + | Set fontSize-1 | fontSize | 1 | + | Set fontSize-0.5 | fontSize | 0.5 | + | Set fontSize-1.5 | fontSize | 1.5 | + | Set fontColor-#ff00ff | fontColor | #ff00ff | + | Set fontEdge-raised | fontEdge | raised | + | Set fontEdge-none | fontEdge | none | + | Set fontEdge-depressed | fontEdge | depressed | + | Set fontEdge-uniform | fontEdge | uniform | + | Set fontEdge-dropShadow-left | fontEdge | drop_shadow_left | + | Set fontEdge-dropShadow-right | fontEdge | drop_shadow_right | + | Set fontEdgeColor-#FFFFFF | fontEdgeColor | #FFFFFF | + | Set backgroundColor-#7f7f7f | backgroundColor | #7f7f7 | + | Set fontOpacity-75 | fontOpacity | 75 | + | Set backgroundOpacity-75 | fontOpacity | 75 | + | Set textAlign-left | textAlign | left | + | Set textAlign-center | textAlign | center | + | Set textAlign-right | textAlign | right | + | Set textAlignVertical-top | textAlignVertical | top | + | Set textAlignVertical-middle | textAlignVertical | middle | + | Set textAlignVertical-bottom | textAlignVertical | bottom | + | Set windowColor-white | windowColor | white | + | Set windowOpacity-50 | windowOpacity | 50 | + | Set preferredLanguages | preferredLanguages | spa,eng | - @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: with 'null' params - When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API - And '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' - Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' + @Accessibility @coreSDK @sdk @transport + Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: with 'null' params + Given we test the 'CLOSEDCAPTIONS_SETTINGS' getters and setters '' to '' + When '3rd party app' registers for the 'Firebolt' event + When '3rd party app' invokes the 'Firebolt' get API + Given 1st party app invokes the 'Firebolt' API to set '' to 'null' + And 'Firebolt' platform responds to '1st party app' set API + When '3rd party app' invokes the 'Firebolt' get API + And 'Firebolt' platform responds to '3rd party app' get API + And 'Firebolt' platform triggers '3rd party app' event - Examples: - | Scenario | Key | Method_Content | Event_Content | - | fontFamily | set fontFamily as null | default value for fontFamily | onclosedCaptionsSettingsChanged with default value for fontfamily | - | fontSize | set fontSize as null | default value for fontSize | onclosedCaptionsSettingsChanged with default value for fontSize | - | fontColor | set fontColor as null | default value for fontColor | onclosedCaptionsSettingsChanged with default value for fontColor | - | fontEdge | set fontEdge as null | default value for fontEdge | onclosedCaptionsSettingsChanged with default value for fontEdge | - | fontEdgeColor | set fontEdgeColor as null | default value for fontEdgeColor | onclosedCaptionsSettingsChanged with default value for fontEdgeColor | - | fontOpacity | set fontOpacity as null | default value for fontOpacity | onclosedCaptionsSettingsChanged with default value for fontOpacity | - | backgroundColor | set backgroundColor as null | default value for backgroundColor | onclosedCaptionsSettingsChanged with default value for backgroundColor | - | backgroundOpacity | set backgroundOpacity as null | default value for backgroundOpacity | onclosedCaptionsSettingsChanged with default value for backgroundOpacity | - | textAlign | set textAlign as null | default value for textAlign | onclosedCaptionsSettingsChanged with default value for textAlign | - | textAlignVertical | set textAlignVertical as null | default value for textAlignVertical | onclosedCaptionsSettingsChanged with default value for textAlignVertical | - | windowColor | set windowColor as null | default value for windowColor | onclosedCaptionsSettingsChanged with default value for windowColor | - | windowOpacity | set windowOpacity as null | default value for windowOpacity | onclosedCaptionsSettingsChanged with default value for windowOpacity | + Examples: + | Scenario | Method | + | fontFamily | fontFamily | + | fontSize | fontSize | + | fontColor | fontColor | + | fontEdge | fontEdge | + | fontEdgeColor | fontEdgeColor | + | fontOpacity | fontOpacity | + | backgroundColor | backgroundColor | + | backgroundOpacity | backgroundOpacity | + | textAlign | textAlign | + | textAlignVertical | textAlignVertical | + | windowColor | windowColor | + | windowOpacity | windowOpacity | - @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.voiceGuidanceSettings - Positive Scenario: - When '3rd party app' registers for the 'accessibility onVoiceGuidanceSettingsChanged' event using the 'Firebolt' API - And '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance settings' - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance settings' - Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' + @Accessibility @coreSDK @sdk @transport + Scenario Outline: Accessibility.voiceGuidanceSettings - Positive Scenario: + Given we test the 'VOICEGUIDANCE_SETTINGS' getters and setters '' to '' + When '3rd party app' registers for the 'Firebolt' event + When '3rd party app' invokes the 'Firebolt' get API + Given 1st party app invokes the 'Firebolt' API to set '' to '' + And 'Firebolt' platform responds to '1st party app' set API + When '3rd party app' invokes the 'Firebolt' get API + And 'Firebolt' platform responds to '3rd party app' get API + And 'Firebolt' platform triggers '3rd party app' event + Examples: + | Scenario | Method | Value | + | Disable voiceguidance | enabled | false | + | Enable voiceguidance | enabled | true | + | Set speed-1 | speed | 1 | + | Set speed-0.5 | speed | 0.5 | + | Set speed-2 | speed | 2 | - Examples: - | Scenario | Key | Method_Content | Event_Content | - | Disable voiceguidance | disable voiceGuidance | disabled voiceGuidance settings | onvoiceGuidanceSettings with disabled | - | Enable voiceguidance | enable voiceGuidance | enabled voiceGuidance settings | onvoiceGuidanceSettings with enabled | - | Set speed-1 | set speed as 1 | 1 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 1 for speed | - | Set speed-0.5 | set speed as 0.5 | 0.5 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 0.5 for speed | - | Set speed-2 | set speed as 2 | 2 for speed in voiceGuidance settings | onvoiceGuidanceSettings with 2 for speed | + @Accessibility @coreSDK @sdk @transport + Scenario Outline: Accessibility.audioDescriptionSettings - Positive Scenario: + Given we test the 'AUDIODESCRIPTIONS_SETTINGS' getters and setters '' to '' + When '3rd party app' registers for the 'Firebolt' event + When '3rd party app' invokes the 'Firebolt' get API + Given 1st party app invokes the 'Firebolt' API to set '' to '' + And 'Firebolt' platform responds to '1st party app' set API + When '3rd party app' invokes the 'Firebolt' get API + And 'Firebolt' platform responds to '3rd party app' get API + And 'Firebolt' platform triggers '3rd party app' event - @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.audioDescriptionSettings - Positive Scenario: - When '3rd party app' registers for the 'accessibility onAudioDescriptionSettingsChanged' event using the 'Firebolt' API - And '3rd party app' invokes the 'Firebolt' API to 'get audioDescriptionSettings settings' - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When '3rd party app' invokes the 'Firebolt' API to 'get audioDescriptionSettings settings' - Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' + Examples: + | Scenario | Method | Value | + | Disable audioDescriptionSettings | enabled | false | + | Enable audioDescriptionSettings | enabled | true | - Examples: - | Scenario | Key | Method_Content | Event_Content | - | Disable audioDescriptionSettings | disable audioDescription | disabled audioDescription settings | onaudioDescriptionSettings with disabled | - | Enable audioDescriptionSettings | enable audioDescription | enabled audioDescription settings | onaudioDescriptionSettings with enabled | + @Accessibility @coreSDK @sdk @transport + Scenario Outline: Accessibility.closedCaptions - Positive Scenario: + Given we test the 'CLOSEDCAPTIONS' getters and setters '' to '' + When '3rd party app' registers for the 'Firebolt' event + Given 1st party app invokes the 'Firebolt' API to set '' to '' + And 'Firebolt' platform responds to '1st party app' set API + When '3rd party app' invokes the 'Firebolt' get API + And 'Firebolt' platform responds to '3rd party app' get API + And 'Firebolt' platform triggers '3rd party app' event - @Accessibility @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: Accessibility.onClosedCaptionsSettingsChanged event - Positive Scenario: Clear listeners - When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API - And I clear 'accessibility onClosedCaptionsSettingsChanged event' listeners - And 1st party app invokes the 'Firebolt' API to 'disable closedCaptions' - Then 'Firebolt' platform responds to '1st party app' for 'disable closedCaptions' - And 'Firebolt' platform does not trigger event for 'onclosedCaptionsSettingsChanged' + Examples: + | Scenario | Method | Value | + | Enable closedcaptions | enabled | true | + | Set fontFamily-monospaced_sanserif | fontFamily | monospaced_sanserif | + | Set fontSize-1 | fontSize | 1 | + | Set fontColor-#ffffff | fontColor | #ffffff | + | Set fontEdge-raised | fontEdge | raised | + | Set fontEdgeColor-#7f7f7f | fontEdge | #7F7F7F | + | Set backgroundColor-#000000 | backgroundColor | #000000 | + | Set fontOpacity-100 | fontOpacity | 100 | + | Set backgroundOpacity-100 | backgroundOpacity | 100 | + | Set textAlign-left | textAlign | left | + | Set textAlignVertical-top | textAlignVertical | top | + | Set windowColor-#7f7f7f | windowColor | #7F7F7F | + | Set windowOpacity-40 | windowOpacity | 40 | - @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.closedCaptions - Positive Scenario: - When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions' - Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' + @Accessibility @coreSDK @sdk @transport + Scenario Outline: Accessibility.voiceGuidance - Positive Scenario: + Given we test the 'VOICEGUIDANCE' getters and setters '' to '' + When '3rd party app' registers for the 'Firebolt' event + When '3rd party app' invokes the 'Firebolt' get API + Given 1st party app invokes the 'Firebolt' API to set '' to '' + And 'Firebolt' platform responds to '1st party app' set API + When '3rd party app' invokes the 'Firebolt' get API + And 'Firebolt' platform responds to '3rd party app' get API + And 'Firebolt' platform triggers '3rd party app' event - Examples: - | Scenario | Set_Method_Key | Method_Content | Event_Content | - | Enable closedcaptions | enable closedCaptions | enabled for accessibility closedCaptions | onclosedCaptionsSettingsChanged with enabled | - | Set fontFamily-monospaced_sanserif | set fontFamily to monospaced_sanserif | monospace sanserif for fontfamily in accessibility closedcaptions | onclosedCaptionsSettingsChanged with monospace sanserif for fontfamily | - | Set fontSize-1 | set fontSize to 1 | 1 for fontSize in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 1 for fontSize | - | Set fontColor-#ffffff | set fontColor to #ffffff | #ffffff for fontColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #ffffff for fontColor | - | Set fontEdge-raised | set fontEdge to raised | raised for fontEdge in accessibility closedcaptions | onclosedCaptionsSettingsChanged with raised for fontEdge | - | Set fontEdgeColor-#7f7f7f | set fontEdgeColor to #7f7f7f | #7f7f7f for fontEdgeColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #7f7f7f for fontEdgeColor | - | Set backgroundColor-#000000 | set backgroundColor to #000000 | #000000 for backgroundColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #000000 for backgroundColor | - | Set fontOpacity-100 | set fontOpacity to 100 | 100 for fontOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 100 for fontOpacity | - | Set backgroundOpacity-100 | set backgroundOpacity to 100 | 100 for backgroundOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 100 for backgroundOpacity | - | Set textAlign-left | set textAlign to left | left for textAlign in accessibility closedcaptions | onclosedCaptionsSettingsChanged with left for textAlign | - | Set textAlignVertical-top | set textAlignVertical to top | top for textAlignVertical in accessibility closedcaptions | onclosedCaptionsSettingsChanged with top for textAlignVertical | - | Set windowColor-#7f7f7f | set windowColor to #7f7f7f | #7f7f7f for windowColor in accessibility closedcaptions | onclosedCaptionsSettingsChanged with #7f7f7f for windowColor | - | Set windowOpacity-40 | set windowOpacity to 40 | 40 for windowOpacity in accessibility closedcaptions | onclosedCaptionsSettingsChanged with 40 for windowOpacity | - - @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.voiceGuidance - Positive Scenario: - When '3rd party app' registers for the 'accessibility onVoiceGuidanceSettingsChanged' event using the 'Firebolt' API - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When '3rd party app' invokes the 'Firebolt' API to 'get voiceGuidance' - Then 'Firebolt' platform responds with '' - And 'Firebolt' platform triggers event '' - - Examples: - | Scenario | Set_Method_Key | Method_Content | Event_Content | - | Disable voiceguidance | disable voiceGuidance | disabled voiceGuidance | onvoiceGuidanceSettings with disabled | - | Enable voiceguidance | enable voiceGuidance | enabled voiceGuidance | onvoiceGuidanceSettings with enabled | - | Set speed-1 | set speed as 1 | 1 for speed in voiceGuidance | onvoiceGuidanceSettings with 1 for speed | \ No newline at end of file + Examples: + | Scenario | Method | Value | + | Disable voiceguidance | enabled | false | + | Enable voiceguidance | enabled | true | + | Set speed-1 | speed | 1 | \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature index 5c3fe21f..8c44c341 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature @@ -2,113 +2,114 @@ Feature: ClosedCaptions_Manage Background: Launch FCA for 'ClosedCaptions' Given the environment has been set up for 'ClosedCaptions' tests - And 3rd party 'certification' app is launched @ClosedCaptions @manageSDK Scenario Outline: ClosedCaptions. - Positive Scenario: - When 1st party app registers for the '' event using the 'Firebolt' API - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with '' - And 'Firebolt' platform triggers to '1st party app' event '' + Given we test the 'CLOSED_CAPTIONS_SETTINGS' getters and setters '' to '' + When '1st party app' registers for the 'Firebolt' event + And 1st party app invokes the 'Firebolt' API to set '' to '' + Then 'Firebolt' platform responds to '1st party app' set API + When '1st party app' invokes the 'Firebolt' get API + Then 'Firebolt' platform responds to '1st party app' get API + And 'Firebolt' platform triggers '1st party app' event Examples: - | Scenario | Method | Event | Set_API_Key | API_Key | Method_Validation_Key | Event_Validation_Key | - | Set backgroundColor-#7f7f7f | backgroundColor | closedcaptions onBackgroundColorChanged | set backgroundColor to #7f7f7f | get backgroundColor | #7f7f7f for backgroundColor in closedCaptions | onBackgroundColorChanged for closedcaptions with #7f7f7f | - | Set backgroundOpacity-75 | backgroundOpacity | closedcaptions onBackgroundOpacityChanged | set backgroundOpacity to 75 | get backgroundOpacity | 75 for backgroundOpacity in closedCaptions | onBackgroundOpacityChanged for closedcaptions with 75 | - | Set closedcaptions-false | enabled | closedcaptions onEnabledChanged | disable closedCaptions | get enabled | disabled for closedCaptions | onEnabledChanged for closedcaptions with disable | - | Set closedcaptions-true | enabled | closedcaptions onEnabledChanged | enable closedCaptions | get enabled | enabled for closedCaptions | onEnabledChanged for closedcaptions with enable | - | Set fontColor-#ff00ff | fontColor | closedcaptions onFontColorChanged | set fontColor to #ff00ff | get fontColor | #ff00ff for fontColor in closedCaptions | onFontColorChanged for closedcaptions with #ff00ff | - | Set fontEdge-raised | fontEdge | closedcaptions onFontEdgeChanged | set fontEdge to raised | get fontEdge | raised for fontEdge in closedCaptions | onFontEdgeChanged for closedcaptions with raised | - | Set fontEdge-none | fontEdge | closedcaptions onFontEdgeChanged | set fontEdge to none | get fontEdge | none for fontEdge in closedCaptions | onFontEdgeChanged for closedcaptions with none | - | Set fontEdge-depressed | fontEdge | closedcaptions onFontEdgeChanged | set fontEdge to depressed | get fontEdge | depressed for fontEdge in closedCaptions | onFontEdgeChanged for closedcaptions with depressed | - | Set fontEdge-uniform | fontEdge | closedcaptions onFontEdgeChanged | set fontEdge to uniform | get fontEdge | uniform for fontEdge in closedCaptions | onFontEdgeChanged for closedcaptions with uniform | - | Set fontEdge-drop-shadow-left | fontEdge | closedcaptions onFontEdgeChanged | set fontEdge to dropShadow left | get fontEdge | dropShadow left for fontEdge in closedCaptions | onFontEdgeChanged for closedcaptions with dropShadow left | - | Set fontEdge-drop-shadow-right | fontEdge | closedcaptions onFontEdgeChanged | set fontEdge to dropShadow right | get fontEdge | dropShadow right for fontEdge in closedCaptions | onFontEdgeChanged for closedcaptions with dropShadow right | - | Set fontEdgeColor-#FFFFFF | fontEdgeColor | closedcaptions onFontEdgeColorChanged | set fontEdgeColor to #FFFFFF | get fontEdgeColor | #FFFFFF for fontEdgeColor in closedCaptions | onFontEdgeColorChanged for closedcaptions with #FFFFFF | - | Set fontFamily-cursive | fontFamily | closedcaptions onFontFamilyChanged | set fontFamily to cursive | get fontfamily | cursive for fontFamily in closedCaptions | onFontFamilyChanged for closedcaptions with cursive | - | Set fontFamily-monospaced_sanserif | fontFamily | closedcaptions onFontFamilyChanged | set fontFamily to monospaced sanserif | get fontFamily | monospaced sanserif for fontFamily in closedCaptions | onFontFamilyChanged for closedcaptions with monospaced sanserif | - | Set fontFamily-proportional_serif | fontFamily | closedcaptions onFontFamilyChanged | set fontFamily to proportional serif | get fontFamily | proportional serif for fontFamily in closedCaptions | onFontFamilyChanged for closedcaptions with proportional serif | - | Set fontFamily-monospaced_serif | fontFamily | closedcaptions onFontFamilyChanged | set fontFamily to monospaced serif | get fontFamily | monospaced serif for fontFamily in closedCaptions | onFontFamilyChanged for closedcaptions with monospaced serif | - | Set fontFamily-proportional_sanserif | fontFamily | closedcaptions onFontFamilyChanged | set fontFamily to proportional sanserif | get fontFamily | proportional sanserif for fontFamily in closedCaptions | onFontFamilyChanged for closedcaptions with proportional sanserif | - | Set fontFamily-smallcaps | fontFamily | closedcaptions onFontFamilyChanged | set fontFamily to smallcaps | get fontFamily | smallcaps for fontFamily in closedCaptions | onFontFamilyChanged for closedcaptions with smallcaps | - | Set fontFamily-casual | fontFamily | closedcaptions onFontFamilyChanged | set fontFamily to casual | get fontFamily | casual for fontFamily in closedCaptions | onFontFamilyChanged for closedcaptions with casual | - | Set fontOpacity-75 | fontOpacity | closedcaptions onFontOpacityChanged | set fontOpacity to 75 | get fontOpacity | 75 for fontOpacity in closedCaptions | onFontOpacityChanged for closedcaptions with 75 | - | Set fontSize-0.5 | fontSize | closedcaptions onFontSizeChanged | set fontSize to 0.5 | get fontSize | 0.5 for fontSize in closedCaptions | onFontSizeChanged for closedcaptions with 0.5 | - | Set fontSize-1 | fontSize | closedcaptions onFontSizeChanged | set fontSize to 1 | get fontSize | 1 for fontSize in closedCaptions | onFontSizeChanged for closedcaptions with 1 | - | Set fontSize-1.5 | fontSize | closedcaptions onFontSizeChanged | set fontSize to 1.5 | get fontSize | 1.5 for fontSize in closedCaptions | onFontSizeChanged for closedcaptions with 1.5 | - | Set textAlign-left | textAlign | closedcaptions onTextAlignChanged | set textAlign to left | get textAlign | left for textAlign in closedCaptions | onTextAlignChanged for closedcaptions with left | - | Set textAlign-center | textAlign | closedcaptions onTextAlignChanged | set textAlign to center | get textAlign | center for textAlign in closedCaptions | onTextAlignChanged for closedcaptions with center | - | Set textAlign-right | textAlign | closedcaptions onTextAlignChanged | set textAlign to right | get textAlign | right for textAlign in closedCaptions | onTextAlignChanged for closedcaptions with right | - | Set textAlignVertical-top | textAlignVertical | closedcaptions onTextAlignVerticalChanged | set textAlignVertical to top | get textAlignVertical | top for textAlignVertical in closedCaptions | onTextAlignVerticalChanged for closedcaptions with top | - | Set textAlignVertical-middle | textAlignVertical | closedcaptions onTextAlignVerticalChanged | set textAlignVertical to middle | get textAlignVertical | middle for textAlignVertical in closedCaptions | onTextAlignVerticalChanged for closedcaptions with middle | - | Set textAlignVertical-bottom | textAlignVertical | closedcaptions onTextAlignVerticalChanged | set textAlignVertical to bottom | get textAlignVertical | bottom for textAlignVertical in closedCaptions | onTextAlignVerticalChanged for closedcaptions with bottom | - | Set preferredLanguages | preferredLanguages | closedcaptions onPreferredLanguagesChanged | set preferredLanguages to spanish | get preferredLanguages | spanish for preferredLanguages in closedCaptions | onPreferredLanguagesChanged for closedcaptions with spanish | - | Set windowColor-white | windowColor | closedcaptions onWindowColorChanged | set windowColor to white | get windowColor | white for windowColor in closedCaptions | onWindowColorChanged for closedcaptions with #000000 | - | Set windowOpacity-50 | windowOpacity | closedcaptions onWindowOpacityChanged | set windowOpacity to 50 | get windowOpacity | 50 for windowOpacity in closedCaptions | onWindowOpacityChanged for closedcaptions with 50 | + | Scenario | Method | Value | + | Set backgroundColor-#7f7f7f | backgroundColor | #7f7f7f | + | Set backgroundOpacity-75 | backgroundOpacity | 75 | + | Set closedcaptions-false | enabled | false | + | Set closedcaptions-true | enabled | true | + | Set fontColor-#ff00ff | fontColor | #ff00ff | + | Set fontEdge-raised | fontEdge | raised | + | Set fontEdge-none | fontEdge | none | + | Set fontEdge-depressed | fontEdge | depressed | + | Set fontEdge-uniform | fontEdge | uniform | + | Set fontEdge-drop-shadow-left | fontEdge | drop_shadow_left | + | Set fontEdge-drop-shadow-right | fontEdge | drop_shadow_right | + | Set fontEdgeColor-#FFFFFF | fontEdgeColor | #FFFFFF | + | Set fontFamily-cursive | fontFamily | cursive | + | Set fontFamily-monospaced_sanserif | fontFamily | monospaced_sanserif | + | Set fontFamily-proportional_serif | fontFamily | proportional_serif | + | Set fontFamily-monospaced_serif | fontFamily | monospaced_serif | + | Set fontFamily-proportional_sanserif | fontFamily | proportional_sanserif | + | Set fontFamily-smallcaps | fontFamily | smallcaps | + | Set fontFamily-casual | fontFamily | casual | + | Set fontOpacity-75 | fontOpacity | 75 | + | Set fontSize-0.5 | fontSize | 0.5 | + | Set fontSize-1 | fontSize | 1 | + | Set fontSize-1.5 | fontSize | 1.5 | + | Set textAlign-left | textAlign | left | + | Set textAlign-center | textAlign | center | + | Set textAlign-right | textAlign | right | + | Set textAlignVertical-top | textAlignVertical | top | + | Set textAlignVertical-bottom | textAlignVertical | bottom | + | Set preferredLanguages | preferredLanguages | spa,eng | + | Set windowColor-white | windowColor | white | + | Set windowOpacity-50 | windowOpacity | 50 | @ClosedCaptions @manageSDK - Scenario Outline: Closedcaptions. - Positive Scenario: with 'null' params - When 1st party app registers for the '' event using the 'Firebolt' API - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' for '' - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with '' - And 'Firebolt' platform triggers to '1st party app' with '' + Scenario Outline: ClosedCaptions. - Positive Scenario: + Given we test the 'CLOSED_CAPTIONS_SETTINGS' getters and setters '' to '' + When '1st party app' registers for the 'Firebolt' event + And 1st party app invokes the 'Firebolt' API to set '' to 'null' + Then 'Firebolt' platform responds to '1st party app' set API + When '1st party app' invokes the 'Firebolt' get API + Then 'Firebolt' platform responds to '1st party app' get API + And 'Firebolt' platform triggers '1st party app' event Examples: - | Scenario | Method | Set_API_Key | API_Key | Method_Validation_Key | Event_Validation_Key | Event | - | fontFamily | fontFamily | set fontFamily as null | get fontFamily | default value for fontFamily in closedcaptions | onFontFamilyChanged for closedcaptions with default value | closedcaptions onFontFamilyChanged | - | fontSize | fontSize | set fontSize as null | get fontSize | default value for fontSize in closedcaptions | onFontSizeChanged for closedcaptions with default value | closedcaptions onFontSizeChanged | - | fontColor | fontColor | set fontColor as null | get fontColor | default value for fontColor in closedcaptions | onFontColorChanged for closedcaptions with default value | closedcaptions onFontColorChanged | - | fontEdge | fontEdge | set fontEdge as null | get fontEdge | default value for fontEdge in closedcaptions | onFontEdgeChanged for closedcaptions with default value | closedcaptions onFontEdgeChanged | - | fontEdgeColor | fontEdgeColor | set fontEdgeColor as null | get fontEdgeColor | default value for fontEdgeColor in closedcaptions | onFontEdgeColorChanged for closedcaptions with default value | closedcaptions onFontEdgeColorChanged | - | fontOpacity | fontOpacity | set fontOpacity as null | get fontOpacity | default value for fontOpacity in closedcaptions | onFontOpacityChanged for closedcaptions with default value | closedcaptions onFontOpacityChanged | - | backgroundColor | backgroundColor | set backgroundColor as null | get backgroundColor | default value for backgroundColor in closedcaptions | onBackgroundColorChanged for closedcaptions with default value | closedcaptions onBackgroundColorChanged | - | backgroundOpacity | backgroundOpacity | set backgroundOpacity as null | get backgroundOpacity | default value for backgroundOpacity in closedcaptions | onBackgroundOpacityChanged for closedcaptions with default value | closedcaptions onBackgroundOpacityChanged | - | textAlign | textAlign | set textAlign as null | get textAlign | default value for textAlign in closedcaptions | onTextAlignChanged for closedcaptions with default value | closedcaptions onTextAlignChanged | - | textAlignVertical | textAlignVertical | set textAlignVertical as null | get textAlignVertical | default value for textAlignVertical in closedcaptions | onTextAlignVerticalChanged for closedcaptions with default value | closedcaptions onTextAlignVerticalChanged | - | windowColor | windowColor | set windowColor as null | get windowColor | default value for windowColor in closedcaptions | onWindowColorChanged for closedcaptions with default value | closedcaptions onWindowColorChanged | - | windowOpacity | windowOpacity | set windowOpacity as null | get windowOpacity | default value for windowOpacity in closedcaptions | onWindowOpacityChanged for closedcaptions with default value | closedcaptions onWindowOpacityChanged | + | Scenario | Method | + | fontFamily | fontFamily | + | fontSize | fontSize | + | fontColor | fontColor | + | fontEdge | fontEdge | + | fontEdgeColor | fontEdgeColor | + | fontOpacity | fontOpacity | + | backgroundColor | backgroundColor | + | backgroundOpacity | backgroundOpacity | + | textAlign | textAlign | + | textAlignVertical | ftextAlignVerticalontColor | + | windowColor | windowColor | + | windowOpacity | windowOpacity | @ClosedCaptions @manageSDK Scenario Outline: ClosedCaptions. - Negative Scenario: expecting error - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with '' + Given we test the 'CLOSED_CAPTIONS_SETTINGS' getters and setters '' to '' + When 1st party app invokes the 'Firebolt' API to set '' to invalid '' + And 'Firebolt' platform responds to '1st party app' set API with '' Examples: - | Scenario | Method | API_Key | Method_Validation_key | - | Set enabled-test | setEnabled | enable closedCaptions with test parameter | invalid params for closedcaptions setEnabled | - | Set enabled-123 | setEnabled | enable closedCaptions with integer parameter | invalid params for closedcaptions setEnabled | - | Set fontFamily-123 | setFontFamily | set fontFamily to 123 | invalid params for closedcaptions setFontFamily | - | Set fontFamily-true | setFontFamily | set fontFamily to true | invalid params for closedcaptions setFontFamily | - | Set fontSize-true | setFontSize | set fontSize to true | invalid params for closedcaptions setFontSize | - | Set fontSize-test | setFontSize | set fontSize to test | invalid params for closedcaptions setFontSize | - | Set fontSize-true | setFontSize | set fontSize to true | invalid params for closedcaptions setFontSize | - | Set fontSize-0.25 | setFontSize | set fontSize to 0.25 | custom error for closedcaptions setFontSize | - | Set fontFamily-sans-serif | setFontFamily | set fontFamily to sans serif | custom error for closedcaptions setFontFamily | - | Set fontEdge-123 | setFontEdge | set fontEdge to 123 | invalid params for closedcaptions setFontEdge | - | Set fontEdge-true | setFontEdge | set fontEdge to true | invalid params for closedcaptions setFontEdge | - | Set fontEdge-solid | setFontEdge | set fontEdge to solid | custom error for closedcaptions setFontEdge | - | Set preferredLanguages-true | setPreferredLanguages | set preferredLanguages to true | invalid params for closedcaptions setPreferredLanguages | - | Set preferredLanguages-123 | setPreferredLanguages | set preferredLanguages to 123 | invalid params for closedcaptions setPreferredLanguages | - | Set preferredLanguage-test | setPreferredLanguages | set preferredLanguages to test | invalid params for closedcaptions setPreferredLanguages | - | Set windowColor-123 | setWindowColor | set windowColor to 123 | invalid params for closedcaptions setWindowColor | - | Set windowOpacity-true | setWindowOpacity | set windowOpacity to true | invalid params for closedcaptions setWindowOpacity | - | Set fontEdgeColor-123 | setFontEdgeColor | set fontEdgeColor to 123 | invalid params for closedcaptions setFontEdgeColor | - | Set fontEdgeColor-true | setFontEdgeColor | set fontEdgeColor to true | invalid params for closedcaptions setFontEdgeColor | - | Set backgroundColor-123 | setBackgroundColor | set backgroundColor to 123 | invalid params for closedcaptions setBackgroundColor | - | Set backgroundColor-true | setBackgroundColor | set backgroundColor to true | invalid params for closedcaptions setBackgroundColor | - | Set textAlign-123 | setTextAlign | set textAlign to 123 | invalid params for closedcaptions setTextAlign | - | Set textAlign-true | setTextAlign | set textAlign to true | invalid params for closedcaptions setTextAlign | - | Set textAlignVertical-123 | setTextAlignVertical | set textAlignVertical to 123 | invalid params for closedcaptions setTextAlignVertical | - | Set textAlignVertical-true | setTextAlignVertical | set textAlignVertical to true | invalid params for closedcaptions setTextAlignVertical | - | Set fontColor-123 | setFontColor | set fontColor to 123 | invalid params for closedcaptions setFontColor | - | Set fontColor-true | setFontColor | set fontColor to true | invalid params for closedcaptions setFontColor | - | Set fontOpacity-120 | setFontOpacity | set fontOpacity to 120 | custom error for closedcaptions setFontOpacity | - | Set fontOpacity-test | setFontOpacity | set fontOpacity to test | invalid params for closedcaptions setFontOpacity | - | Set fontOpacity-true | setFontOpacity | set fontOpacity to true | invalid params for closedcaptions setFontOpacity | - | Set backgroundOpacity-120 | setBackgroundOpacity | set backgroundOpacity to 120 | custom error for closedcaptions setBackgroundOpacity | - | Set backgroundOpacity-test | setBackgroundOpacity | set backgroundOpacity to test | invalid params for closedcaptions setBackgroundOpacity | - | Set backgroundOpacity-true | setBackgroundOpacity | set backgroundOpacity to true | invalid params for closedcaptions setBackgroundOpacity | \ No newline at end of file + | Scenario | Method | Value | Error | + | Set enabled-test | enabled | test | INVALID_TYPE_PARAMS | + | Set enabled-123 | enabled | 123 | INVALID_TYPE_PARAMS | + | Set fontFamily-123 | fontFamily | 123 | INVALID_TYPE_PARAMS | + | Set fontFamily-true | fontFamily | true | INVALID_TYPE_PARAMS | + | Set fontSize-true | fontSize | true | INVALID_TYPE_PARAMS | + | Set fontSize-test | fontSize | test | INVALID_TYPE_PARAMS | + | Set fontSize-true | fontSize | true | INVALID_TYPE_PARAMS | + | Set fontSize-0.25 | fontSize | 0.25 | CUSTOM_ERROR | + | Set fontFamily-sans-serif | fontFamily | sans-serif | CUSTOM_ERROR | + | Set fontEdge-123 | fontEdge | 123 | INVALID_TYPE_PARAMS | + | Set fontEdge-true | fontEdge | true | INVALID_TYPE_PARAMS | + | Set fontEdge-solid | fontEdge | solid | CUSTOM_ERROR | + | Set preferredLanguages-true | preferredLanguages | true | INVALID_TYPE_PARAMS | + | Set preferredLanguages-123 | preferredLanguages | 123 | INVALID_TYPE_PARAMS | + | Set preferredLanguages-test | preferredLanguages | test | INVALID_TYPE_PARAMS | + | Set windowColor-123 | windowColor | 123 | INVALID_TYPE_PARAMS | + | Set windowOpacity-true | windowOpacity | true | INVALID_TYPE_PARAMS | + | Set fontEdgeColor-123 | fontEdgeColor | 123 | INVALID_TYPE_PARAMS | + | Set fontEdgeColor-true | fontEdgeColor | true | INVALID_TYPE_PARAMS | + | Set backgroundColor-123 | backgroundColor | 123 | INVALID_TYPE_PARAMS | + | Set backgroundColor-true | backgroundColor | true | INVALID_TYPE_PARAMS | + | Set textAlign-123 | textAlign | 123 | INVALID_TYPE_PARAMS | + | Set textAlign-true | textAlign | true | INVALID_TYPE_PARAMS | + | Set textAlignVertical-123 | textAlignVertical | 123 | INVALID_TYPE_PARAMS | + | Set textAlignVertical-true | textAlignVertical | true | INVALID_TYPE_PARAMS | + | Set fontColor-123 | fontColor | 123 | INVALID_TYPE_PARAMS | + | Set fontColor-true | fontColor | true | INVALID_TYPE_PARAMS | + | Set fontOpacity-120 | fontOpacity | 120 | CUSTOM_ERROR | + | Set fontOpacity-test | fontOpacity | test | INVALID_TYPE_PARAMS | + | Set fontOpacity-true | fontOpacity | true | INVALID_TYPE_PARAMS | + | Set backgroundOpacity-120 | backgroundOpacity | 120 | CUSTOM_ERROR | + | Set backgroundOpacity-test | backgroundOpacity | test | INVALID_TYPE_PARAMS | + | Set backgroundOpacity-true | backgroundOpacity | true | INVALID_TYPE_PARAMS | diff --git a/cypress/fixtures/fireboltCalls/accessibility.js b/cypress/fixtures/fireboltCalls/accessibility.js new file mode 100644 index 00000000..17a4087c --- /dev/null +++ b/cypress/fixtures/fireboltCalls/accessibility.js @@ -0,0 +1,145 @@ +exports.CLOSEDCAPTIONS_SETTINGS = { + method: 'accessibility.closedCaptionsSettings', + params: null, + validationJsonPath: resolveAtRuntime(['result.{{attribute}}', 'result.styles.{{attribute}}']), + setMethod: resolveAtRuntime('manage_closedcaptions.set{{attribute.uppercaseFirstChar}}'), + setParams: resolveAtRuntime('value'), + setValidationJsonPath: 'result', + setContent: null, + event: 'accessibility.onClosedCaptionsSettingsChanged', + eventValidationJsonPath: resolveAtRuntime([ + 'eventResponse.{{attribute}}', + 'eventResponse.styles.{{attribute}}', + ]), + content: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'staticContentValidation', + type: resolveAtRuntime('value'), + description: resolveAtRuntime( + 'Validating that accessibility.closedCaptionSettings {{attribute}} is {{value}}' + ), + }, + ], + }, + ], + }, +}; + +exports.VOICEGUIDANCE_SETTINGS = { + method: 'accessibility.voiceGuidanceSettings', + params: null, + validationJsonPath: resolveAtRuntime(['result.{{attribute}}']), + setMethod: resolveAtRuntime('manage_voiceguidance.set{{attribute.uppercaseFirstChar}}'), + setParams: resolveAtRuntime('value'), + setValidationJsonPath: 'result', + setContent: null, + event: 'accessibility.onVoiceGuidanceSettingsChanged', + eventValidationJsonPath: resolveAtRuntime(['eventResponse.{{attribute}}']), + content: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'staticContentValidation', + type: resolveAtRuntime('value'), + description: resolveAtRuntime( + 'Validating that accessibility.voiceGuidanceSettings {{attribute}} is {{value}}' + ), + }, + ], + }, + ], + }, +}; + +exports.AUDIODESCRIPTIONS_SETTINGS = { + method: 'accessibility.audioDescriptionSettings', + params: null, + validationJsonPath: resolveAtRuntime(['result.{{attribute}}']), + setMethod: resolveAtRuntime('manage_audiodescriptions.set{{attribute.uppercaseFirstChar}}'), + setParams: resolveAtRuntime('value'), + setValidationJsonPath: 'result', + setContent: null, + event: 'accessibility.onAudioDescriptionSettingsChanged', + eventValidationJsonPath: resolveAtRuntime(['eventResponse.{{attribute}}']), + content: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'staticContentValidation', + type: resolveAtRuntime('value'), + description: resolveAtRuntime( + 'Validating that accessibility.audioDescriptionSettings {{attribute}} is {{value}}' + ), + }, + ], + }, + ], + }, +}; + +exports.CLOSEDCAPTIONS = { + method: 'accessibility.closedCaptions', + params: null, + validationJsonPath: resolveAtRuntime(['result.{{attribute}}', 'result.styles.{{attribute}}']), + setMethod: resolveAtRuntime('manage_closedcaptions.set{{attribute.uppercaseFirstChar}}'), + setParams: resolveAtRuntime('value'), + setValidationJsonPath: 'result', + setContent: null, + event: 'accessibility.onClosedCaptionsSettingsChanged', + eventValidationJsonPath: resolveAtRuntime([ + 'eventResponse.{{attribute}}', + 'eventResponse.styles.{{attribute}}', + ]), + content: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'staticContentValidation', + type: resolveAtRuntime('value'), + description: resolveAtRuntime( + 'Validating that accessibility.closedCaptions {{attribute}} is {{value}}' + ), + }, + ], + }, + ], + }, +}; + +exports.VOICEGUIDANCE = { + method: 'accessibility.voiceGuidance', + params: null, + validationJsonPath: resolveAtRuntime(['result.{{attribute}}']), + setMethod: resolveAtRuntime('manage_voiceguidance.set{{attribute.uppercaseFirstChar}}'), + setParams: resolveAtRuntime('value'), + setValidationJsonPath: 'result', + setContent: null, + event: 'accessibility.onVoiceGuidanceSettingsChanged', + eventValidationJsonPath: resolveAtRuntime(['eventResponse.{{attribute}}']), + content: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'staticContentValidation', + type: resolveAtRuntime('value'), + description: resolveAtRuntime( + 'Validating that accessibility.voiceGuidance {{attribute}} is {{value}}' + ), + }, + ], + }, + ], + }, +}; diff --git a/cypress/fixtures/fireboltCalls/closedcaptions.js b/cypress/fixtures/fireboltCalls/closedcaptions.js new file mode 100644 index 00000000..25f3e0f4 --- /dev/null +++ b/cypress/fixtures/fireboltCalls/closedcaptions.js @@ -0,0 +1,27 @@ +exports.CLOSED_CAPTIONS_SETTINGS = { + method: resolveAtRuntime('manage_closedcaptions.{{attribute}}'), + params: null, + validationJsonPath: 'result', + setMethod: resolveAtRuntime('manage_closedcaptions.set{{attribute.uppercaseFirstChar}}'), + setParams: resolveAtRuntime('value'), + setValidationJsonPath: 'result', + setContent: null, + event: resolveAtRuntime('manage_closedcaptions.on{{attribute.uppercaseFirstChar}}Changed'), + eventValidationJsonPath: 'eventResponse', + content: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'staticContentValidation', + type: resolveAtRuntime('value'), + description: resolveAtRuntime( + 'Validating that manage_closedcaptions.on{{event.uppercaseFirstChar}} {{attribute}} is {{value}}' + ), + }, + ], + }, + ], + }, +}; diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index e6932696..5f4f5d81 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -840,15 +840,15 @@ Cypress.Commands.add('clearCache', () => { * @function sendMessageToPlatformOrApp * @description Function to send message to Platform or App to make an Api call. * @param {String} target - 'App' or 'Platform' - * @param {String} additionalParams - Contains the data which required to create request message to make a call. + * @param {String} requestData - Contains the data which required to create request message to make a call. * @param {String} task - Task/Handler name that decides whether make a api call or event call. * @example * cy.sendMessageToPlatformOrApp('App', {method: 'account.id', params: {}, context: {}, action: 'core', expected: 'result', appId: 'test.test'} * cy.sendMessageToPlatformOrApp('Platform', {method: 'account.id', params: {}, context: {}, action: 'core', expected: 'result'} * cy.sendMessageToPlatformOrApp('App', {method: 'accessibility.onClosedCaptionsSettingsChanged', params: {}, context: {}, action: 'core', expected: 'result', appId: 'test.test', 'registerEvent'} */ -Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, task) => { - const { method, params, context, action, expected, appId } = additionalParams; +Cypress.Commands.add('sendMessageToPlatformOrApp', (target, requestData, task) => { + const { method, params, context, action, expected, appId } = requestData; task = task ? task : CONSTANTS.TASK.CALLMETHOD; let isNotSupportedApi = false; @@ -896,6 +896,10 @@ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, ta fireLog.assert(false, `Invalid ${target} target, it should be either app or platfrom`); } }).then((response) => { + if (response === CONSTANTS.NO_RESPONSE) { + assert(false, CONSTANTS.NO_MATCHED_RESPONSE); + } + if (Cypress.env(CONSTANTS.IS_RPC_ONLY)) { fireLog.info( `${method} response will be retrieved in subsequent steps and validated when the rpc-only methods are invoked. Proceeding to the next step.` @@ -908,10 +912,6 @@ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, ta (JSON.parse(response).hasOwnProperty(CONSTANTS.RESULT) || JSON.parse(response).hasOwnProperty(CONSTANTS.ERROR))) ) { - if (response === CONSTANTS.NO_RESPONSE) { - assert(false, CONSTANTS.NO_MATCHED_RESPONSE); - } - response = typeof response === CONSTANTS.TYPE_STRING ? JSON.parse(response) : response; if ( @@ -979,14 +979,14 @@ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, additionalParams, ta * @function sendMessageToPlatformOrApp * @description Function to send message to Platform or App to make an Api call. * @param {String} validationType - Determines whether method or event validation is being performed. Ex: 'method' or 'event' - * @param {String} additionalParams - Contains the data which required to do content validation for the specified method. + * @param {String} requestData - Contains the data which required to do content validation for the specified method. * @example * cy.sendMessageToPlatformOrApp('method', {method: 'account.id', context: {}, contentObject: {}, expectingError: false, appId: 'test.test'} * cy.sendMessageToPlatformOrApp('event', {method: 'accessibility.onClosedCaptionsSettingsChanged', context: {}, contentObject: {}, expectingError: false, appId: 'test.test', eventExpected: 'triggers'} */ -Cypress.Commands.add('methodOrEventResponseValidation', (validationType, additionalParams) => { - const { method, context, contentObject, expectingError, appId, eventExpected } = additionalParams; - let validationJsonPath = additionalParams.validationJsonPath; +Cypress.Commands.add('methodOrEventResponseValidation', (validationType, requestData) => { + const { method, context, contentObject, expectingError, appId, eventExpected } = requestData; + let validationJsonPath = requestData.validationJsonPath; // Extracting the api or event object from the global list. const methodOrEventObject = UTILS.getApiOrEventObjectFromGlobalList( @@ -1049,100 +1049,143 @@ Cypress.Commands.add('methodOrEventResponseValidation', (validationType, additio } } - try { - if (contentObject && contentObject.data) { - contentObject.data.forEach((object) => { - if (object.validations) { - const scenario = object.type; - const methodOrEventResponse = - validationType == CONSTANTS.EVENT - ? methodOrEventObject.eventResponse - : validationType == CONSTANTS.METHOD - ? methodOrEventObject.apiResponse - : null; - - // Looping through validationJsonPath to find the valid path for validation. - if (validationJsonPath && Array.isArray(validationJsonPath)) { - const validationPath = validationJsonPath.find((path) => { - if ( - path - .split('.') - .reduce((acc, part) => acc && acc[part], methodOrEventResponse) !== undefined - ) { - return path; - } - }); - validationPath - ? (validationJsonPath = validationPath) - : fireLog.assert( - false, - 'Could not find the valid validation path from the validationJsonPath list' - ); - } - switch (scenario) { - case CONSTANTS.REGEX: - cy.regExValidation( - method, - object.validations[0].type, - validationJsonPath, - methodOrEventResponse - ); - break; - case CONSTANTS.MISC: - cy.miscellaneousValidation(method, object.validations[0], methodOrEventObject); - break; - case CONSTANTS.DECODE: - const decodeType = object.specialCase; - const responseForDecodeValidation = - validationType == CONSTANTS.EVENT - ? methodOrEventResponse - : validationType == CONSTANTS.METHOD - ? methodOrEventResponse.result - : null; - - cy.decodeValidation( - method, - decodeType, - responseForDecodeValidation, - object.validations[0], - null - ); - break; - case CONSTANTS.FIXTURE: - cy.validateContent( - method, - context, - validationJsonPath, - object.validations[0].type, - validationType, - appId - ); - break; - case CONSTANTS.CUSTOM: - cy.customValidation(object, methodOrEventObject); - break; - case CONSTANTS.UNDEFINED: - cy.undefinedValidation(object, methodOrEventObject, validationType); - break; - default: - assert(false, 'Unsupported validation type'); - break; - } + cy.then(() => { + if (validationType == CONSTANTS.EVENT) { + const eventName = methodOrEventObject.eventObjectId; + let eventResponse; + if (appId === UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { + const requestMap = { + method: CONSTANTS.REQUEST_OVERRIDE_CALLS.FETCH_EVENT_RESPONSE, + params: eventName, + }; + eventResponse = cy.sendMessagetoPlatforms(requestMap); + } else { + const params = { event: eventName }; + // Generating an intent message using the provided information to send it to a third-party app + const intentMessage = UTILS.createIntentMessage( + CONSTANTS.TASK.GETEVENTRESPONSE, + params + ); + const requestTopic = UTILS.getTopic(appId); + const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); + eventResponse = cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage); + } + eventResponse.then((response) => { + response = typeof response === CONSTANTS.TYPE_STRING ? JSON.parse(response) : response; + if ( + response && + response.result && + response.result.hasOwnProperty(CONSTANTS.EVENT_RESPONSE) + ) { + response.result = response.result.eventResponse; } + cy.updateResponseForFCS(method, null, response, true).then((updatedResponse) => { + cy.saveEventResponse( + updatedResponse, + methodOrEventObject, + eventName, + eventExpected === 'triggers' ? true : false + ); + }); }); - } else { - cy.validateContent( - method, - context, - validationJsonPath, - contentObject, - validationType, - appId - ); } - } catch (error) { - assert(false, `Unable to validate the response: ${error}`); - } + }).then(() => { + try { + if (contentObject && contentObject.data) { + contentObject.data.forEach((object) => { + if (object.validations) { + const scenario = object.type; + const methodOrEventResponse = + validationType == CONSTANTS.EVENT + ? methodOrEventObject + : validationType == CONSTANTS.METHOD + ? methodOrEventObject.apiResponse + : null; + + // Looping through validationJsonPath to find the valid path for validation. + if (validationJsonPath && Array.isArray(validationJsonPath)) { + const validationPath = validationJsonPath.find((path) => { + if ( + path + .split('.') + .reduce((acc, part) => acc && acc[part], methodOrEventResponse) !== + undefined + ) { + return path; + } + }); + validationPath + ? (validationJsonPath = validationPath) + : fireLog.assert( + false, + 'Could not find the valid validation path from the validationJsonPath list' + ); + } + switch (scenario) { + case CONSTANTS.REGEX: + cy.regExValidation( + method, + object.validations[0].type, + validationJsonPath, + methodOrEventResponse + ); + break; + case CONSTANTS.MISC: + cy.miscellaneousValidation(method, object.validations[0], methodOrEventObject); + break; + case CONSTANTS.DECODE: + const decodeType = object.specialCase; + const responseForDecodeValidation = + validationType == CONSTANTS.EVENT + ? methodOrEventResponse.eventResponse + : validationType == CONSTANTS.METHOD + ? methodOrEventResponse.result + : null; + + cy.decodeValidation( + method, + decodeType, + responseForDecodeValidation, + object.validations[0], + null + ); + break; + case CONSTANTS.FIXTURE: + cy.validateContent( + method, + context, + validationJsonPath, + object.validations[0].type, + validationType, + appId + ); + break; + case CONSTANTS.CUSTOM: + cy.customValidation(object, methodOrEventObject); + break; + case CONSTANTS.UNDEFINED: + cy.undefinedValidation(object, methodOrEventObject, validationType); + break; + default: + assert(false, 'Unsupported validation type'); + break; + } + } + }); + } else { + cy.validateContent( + method, + context, + validationJsonPath, + contentObject, + validationType, + appId + ); + } + } catch (error) { + assert(false, `Unable to validate the response: ${error}`); + } + }); } }); }); diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 9f5b49b2..78e87a77 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -801,6 +801,7 @@ function parseValue(str) { if (typeof str === 'string') { if (str === 'true') return true; if (str === 'false') return false; + if (str === 'null') return null; if (!isNaN(str)) return Number(str); diff --git a/cypress/support/step_definitions/getterSetterCalls.js b/cypress/support/step_definitions/getterSetterCalls.js index 44b35ed3..ce28abd3 100644 --- a/cypress/support/step_definitions/getterSetterCalls.js +++ b/cypress/support/step_definitions/getterSetterCalls.js @@ -68,6 +68,7 @@ Given( async (sdk, fireboltCallKey, attribute, invalidValue, value) => { if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { value = UTILS.parseValue(value); + console.log('value', value) let fireboltCallObject; let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; @@ -122,6 +123,7 @@ Given( } else { setParams = { value: UTILS.resolveRecursiveValues(fireboltCallObject.setParams) }; } + console.log('setParams', setParams) const context = {}; const expected = invalidValue ? CONSTANTS.ERROR : CONSTANTS.RESULT; diff --git a/cypress/support/validations/schemaValidation.js b/cypress/support/validations/schemaValidation.js index 244f10e3..ee16dabd 100644 --- a/cypress/support/validations/schemaValidation.js +++ b/cypress/support/validations/schemaValidation.js @@ -68,14 +68,14 @@ Cypress.Commands.add( if (response.hasOwnProperty(CONSTANTS.RESULT)) { if ( response && - response.result !== undefined && + response.result != undefined && response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) ) { formattedResponse = Object.assign(formattedResponse, response.result); formattedResponse.eventListenerSchemaResult = formattedSchemaValidationResult; } else if ( response && - response.result !== undefined && + response.result != undefined && !response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) ) { formattedResponse.eventResponse = response.result; @@ -85,7 +85,7 @@ Cypress.Commands.add( } else if (response.hasOwnProperty(CONSTANTS.ERROR)) { if ( response && - response.result !== undefined && + response.result != undefined && response.result.hasOwnProperty(CONSTANTS.EVENT_LISTENER_RESPONSE) ) { formattedResponse = Object.assign(formattedResponse, response.error); From b2e8cb8991fd81304dc5e58a1326d1a48138e262 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 12 Jul 2024 16:03:25 +0530 Subject: [PATCH 270/359] fixed lint issues --- cypress/support/cypress-commands/commands.js | 2 +- cypress/support/step_definitions/getterSetterCalls.js | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 5f4f5d81..fb1b927d 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -1001,7 +1001,7 @@ Cypress.Commands.add('methodOrEventResponseValidation', (validationType, request // If passed method is exception method or expecting a error in response, doing error content validation. if (UTILS.isScenarioExempted(method, param) || expectingError) { // If not expecting for an error and it's a exception method, storing "exceptionErrorObject" to errorContent variable to fetch the error content object based on the exception type. - let errorContent = expectingError === true ? contentObject : CONSTANTS.EXCEPTION_ERROR_OBJECT; + const errorContent = expectingError === true ? contentObject : CONSTANTS.EXCEPTION_ERROR_OBJECT; cy.validateErrorObject(method, errorContent, validationType, context, appId, param); } else { if (validationType == CONSTANTS.EVENT) { diff --git a/cypress/support/step_definitions/getterSetterCalls.js b/cypress/support/step_definitions/getterSetterCalls.js index ce28abd3..44b35ed3 100644 --- a/cypress/support/step_definitions/getterSetterCalls.js +++ b/cypress/support/step_definitions/getterSetterCalls.js @@ -68,7 +68,6 @@ Given( async (sdk, fireboltCallKey, attribute, invalidValue, value) => { if (CONSTANTS.SUPPORTED_SDK.includes(sdk)) { value = UTILS.parseValue(value); - console.log('value', value) let fireboltCallObject; let fireboltCallObjectErrorMessage = CONSTANTS.NO_DATA_FOR_THE_KEY + fireboltCallKey; @@ -123,7 +122,6 @@ Given( } else { setParams = { value: UTILS.resolveRecursiveValues(fireboltCallObject.setParams) }; } - console.log('setParams', setParams) const context = {}; const expected = invalidValue ? CONSTANTS.ERROR : CONSTANTS.RESULT; From 2d2b501086becc7f578f73e652b0207452b34be6 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Fri, 12 Jul 2024 16:09:44 +0530 Subject: [PATCH 271/359] fixed lint issues --- cypress/support/cypress-commands/commands.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index fb1b927d..11a387a0 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -1001,7 +1001,8 @@ Cypress.Commands.add('methodOrEventResponseValidation', (validationType, request // If passed method is exception method or expecting a error in response, doing error content validation. if (UTILS.isScenarioExempted(method, param) || expectingError) { // If not expecting for an error and it's a exception method, storing "exceptionErrorObject" to errorContent variable to fetch the error content object based on the exception type. - const errorContent = expectingError === true ? contentObject : CONSTANTS.EXCEPTION_ERROR_OBJECT; + const errorContent = + expectingError === true ? contentObject : CONSTANTS.EXCEPTION_ERROR_OBJECT; cy.validateErrorObject(method, errorContent, validationType, context, appId, param); } else { if (validationType == CONSTANTS.EVENT) { From 71ed0b023edf64b055a33e1669e0609fca91054a Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Fri, 12 Jul 2024 17:31:53 +0530 Subject: [PATCH 272/359] FIRECERT-2194 updated secureStorage TCs --- .../Manage/SecureStorageManage.feature | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature index 8a728d5e..9ca2ae9e 100644 --- a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature @@ -127,7 +127,8 @@ Feature: SecureStorage_Manage @SecureStorage @manageSDK Scenario Outline: SecureStorage.setForApp - Positive Scenario: - Given 1st party app invokes the 'Firebolt' API to '' + Given 3rd party 'certification' app is launched with 'secondary 3rd party app' appId + And 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with 'null for getting stored value' @@ -141,12 +142,14 @@ Feature: SecureStorage_Manage And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for getting stored value' Examples: - | Scenario | Set_API_Key | API_Key | Method_Validation_Key | Clear_API_Key | - | setForApp with device scope with 2 apps | set secure data value for an app with scope device | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + | Scenario | Set_API_Key | API_Key | Method_Validation_Key | Clear_API_Key | + | setForApp with device scope with 2 apps | set secure data value for an app with scope device | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | + @SecureStorage @manageSDK Scenario Outline: SecureStorage.removeForApp - Positive Scenario: - Given 1st party app invokes the 'Firebolt' API to '' + Given 3rd party 'certification' app is launched with 'secondary 3rd party app' appId + And 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with 'null for getting stored value' @@ -179,6 +182,7 @@ Feature: SecureStorage_Manage @SecureStorage @manageSDK Scenario Outline: SecureStorage.clearForApp - Positive Scenario: + Given 3rd party 'certification' app is launched with 'secondary 3rd party app' appId Given 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for '' And 1st party app invokes the 'Firebolt' API to 'set secure data value1 for second app with scope device' From a081ffa8fcb707f3f713ab44eb18b86642c4e04e Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 12 Jul 2024 18:18:09 +0530 Subject: [PATCH 273/359] FIRECERT-2128-latest commit --- .../FireboltCertification/Device.feature | 3 ++- .../SecondScreen.feature | 16 ++++++++-------- .../fixtures/fireboltCalls/secondscreen.json | 6 +++--- cypress/fixtures/modules/secondscreen.json | 5 +++++ .../validationObjects/secondscreen.json | 19 +++++++++++++++++-- 5 files changed, 35 insertions(+), 14 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Device.feature b/cypress/TestCases/FireboltCertification/Device.feature index e6f19c5b..0c1ac4b6 100644 --- a/cypress/TestCases/FireboltCertification/Device.feature +++ b/cypress/TestCases/FireboltCertification/Device.feature @@ -51,7 +51,7 @@ Feature: Device Then 'Firebolt' platform responds to '1st party app' for 'set device name to kitchen' And 'Firebolt' platform does not trigger event for 'onDeviceNameChanged' - @Device @coreSDK @sdk @transport @notSupported + @Device @coreSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Device.network - Positive Scenario: When '3rd party app' registers for the 'device onNetworkChanged' event using the 'Firebolt' API And '3rd party app' invokes the 'Firebolt' API to 'fetch device network' @@ -67,3 +67,4 @@ Feature: Device | Validate network_Ethernet_disconnected | device network as ethernet disconnected | onNetworkChanged with ethernet disconnected | onNetworkChanged events with ethernet disconnected | | Validate network_Hybrid_connected | device network as hybrid connected | onNetworkChanged with hybrid connected | onNetworkChanged events with hybrid connected | | Validate network_Hybrid_disconnected | device network as hybrid disconnected | onNetworkChanged with hybrid disconnected | onNetworkChanged events with hybrid disconnected | + \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/SecondScreen.feature b/cypress/TestCases/FireboltCertification/SecondScreen.feature index 4ea14273..e050da8b 100644 --- a/cypress/TestCases/FireboltCertification/SecondScreen.feature +++ b/cypress/TestCases/FireboltCertification/SecondScreen.feature @@ -42,20 +42,20 @@ Feature: Secondscreen Then 'Firebolt' platform responds to '1st party app' for 'set friendlyName to guest room' And 'Firebolt' platform does not trigger event for 'onFriendlyNameChanged' - @Secondscreen @coreSDK @regression @sdk @notSupported + @Secondscreen @coreSDK @regression @sdk @requiresPlatformImplementation Scenario Outline: Secondscreen. - Positive Scenario: Validating event name in response When '3rd party app' registers for the '' event using the 'Firebolt' API And User triggers event with value as '' - Then 'Firebolt' platform responds with '' + Then 'Firebolt' platform triggers event '' Examples: - | EventName | RegisteredEvent | Event_Validation_Key | EventParams | - | onLaunchRequest | secondscreen onLaunchRequest | expected secondscreen onLaunchRequest event | onLaunchRequest event | - | onLaunchRequest | secondscreen onLaunchRequest | expected secondscreen onLaunchRequest event | onLaunchRequest event | - | onCloseRequest | secondscreen onCloseRequest | expected secondscreen onCloseRequest event | onCloseRequest event | - | onCloseRequest | secondscreen onCloseRequest | expected secondscreen onCloseRequest event | onCloseRequest event | + | EventName | RegisteredEvent | Event_Validation_Key | EventParams | + | onLaunchRequest | secondscreen onLaunchRequest | secondscreen onLaunchRequest event | onLaunchRequest event | + | onLaunchRequest | secondscreen onLaunchRequest | secondscreen onLaunchRequest event | onLaunchRequest event | + | onCloseRequest | secondscreen onCloseRequest | secondscreen onCloseRequest event | onCloseRequest event | + | onCloseRequest | secondscreen onCloseRequest | secondscreen onCloseRequest event | onCloseRequest event | - @Secondscreen @coreSDK @regression @sdk @notSupported @requiresPlatformImplementation + @Secondscreen @coreSDK @regression @sdk @requiresPlatformImplementation Scenario Outline: Secondscreen. - Positive Scenario: Validating event Clearing listeners When '3rd party app' registers for the '' event using the 'Firebolt' API And I clear '' listeners diff --git a/cypress/fixtures/fireboltCalls/secondscreen.json b/cypress/fixtures/fireboltCalls/secondscreen.json index 5259055a..69d1ac26 100644 --- a/cypress/fixtures/fireboltCalls/secondscreen.json +++ b/cypress/fixtures/fireboltCalls/secondscreen.json @@ -92,12 +92,12 @@ "content": "INVALID_REQUEST", "expectingError": true }, - "EXPECTED_SECONDSCREEN_ONLAUNCHREQUEST_EVENT": { + "SECONDSCREEN_ONLAUNCHREQUEST_EVENT": { "event": "secondscreen.onLaunchRequest", "validationJsonPath": "eventResponse", - "content": "SECONDSCREEN_ONLAUNCHREQUEST" + "content": "SECONDSCREEN_ONLAUNCHREQUEST_TYPE_DIAL_WITH_TEST_DATA" }, - "EXPECTED_SECONDSCREEN_ONCLOSEREQUEST_EVENT": { + "SECONDSCREEN_ONCLOSEREQUEST_EVENT": { "event": "secondscreen.onCloseRequest", "validationJsonPath": "eventResponse", "content": "SECONDSCREEN_ONCLOSEREQUEST" diff --git a/cypress/fixtures/modules/secondscreen.json b/cypress/fixtures/modules/secondscreen.json index 3f9359e4..066c5124 100644 --- a/cypress/fixtures/modules/secondscreen.json +++ b/cypress/fixtures/modules/secondscreen.json @@ -15,6 +15,11 @@ "version": "1.7", "data": "{\"code\":\"AQDPQZiQcb3KQ7gY7yy5tHTMbbkGHR9Zjp-KL53H3eKBZIeAt7O9UKYPu6B21l2UZVmIqkFXDXBmXvK4g2e3EgZtjMNmKPsTltgnRl95DImtOXjSpWtTjSaOkW4w1kZKUTwLKdwVWTzBVH8ERHorvLU6vCGOVHxXt65LNwdl5HKRweShVC1V9QsyvRnQS61ov0UclmrH_xZML2Bt-Q-rZFjey5MjwupIb4x4f53XUJMhjHpDHoIUKrjpdPDQvK2a\",\"friendlyName\":\"Operator_TX061AEI\",\"UDN\":\"608fef11-2800-482a-962b-23a6690c93c1\"}" }, + "ONLAUNCHREQUEST_TYPE_DIAL_WITH_TEST_DATA": { + "type": "dial", + "version": "1.7", + "data": "test" + }, "ONCLOSEREQUEST_TYPE_DIAL": { "type": "dial", "version": "1.7" diff --git a/cypress/fixtures/objects/validationObjects/secondscreen.json b/cypress/fixtures/objects/validationObjects/secondscreen.json index 9feb4eee..99125587 100644 --- a/cypress/fixtures/objects/validationObjects/secondscreen.json +++ b/cypress/fixtures/objects/validationObjects/secondscreen.json @@ -59,7 +59,7 @@ } ] }, - "ONCLOSEREQUEST": { + "SECONDSCREEN_ONCLOSEREQUEST": { "method": "secondscreen.onCloseRequest", "data": [ { @@ -73,6 +73,21 @@ ] } ] + }, + + "SECONDSCREEN_ONLAUNCHREQUEST_TYPE_DIAL_WITH_TEST_DATA": { + "method": "secondscreen.onCloseRequest", + "data": [ + { + "type": "fixture", + "validations": [ + { + "mode": "staticContentValidation", + "type": "SECONDSCREEN_ONLAUNCHREQUEST_TYPE_DIAL_WITH_TEST_DATA", + "description": "Validation of the Secondscreen onLaunchRequest event" + } + ] + } + ] } - } From 8edb46bda6cc4b3fba982e12dc3dd9a5d16fc4ab Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Mon, 15 Jul 2024 11:04:47 +0530 Subject: [PATCH 274/359] FIRECERT-2128-tag comment addressed --- cypress/TestCases/FireboltCertification/Device.feature | 2 +- cypress/TestCases/FireboltCertification/SecondScreen.feature | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Device.feature b/cypress/TestCases/FireboltCertification/Device.feature index 0c1ac4b6..7d2e40ae 100644 --- a/cypress/TestCases/FireboltCertification/Device.feature +++ b/cypress/TestCases/FireboltCertification/Device.feature @@ -51,7 +51,7 @@ Feature: Device Then 'Firebolt' platform responds to '1st party app' for 'set device name to kitchen' And 'Firebolt' platform does not trigger event for 'onDeviceNameChanged' - @Device @coreSDK @sdk @transport @requiresPlatformImplementation + @Device @coreSDK @sdk @transport @requiresPlatformImplementation @notSupported Scenario Outline: Device.network - Positive Scenario: When '3rd party app' registers for the 'device onNetworkChanged' event using the 'Firebolt' API And '3rd party app' invokes the 'Firebolt' API to 'fetch device network' diff --git a/cypress/TestCases/FireboltCertification/SecondScreen.feature b/cypress/TestCases/FireboltCertification/SecondScreen.feature index e050da8b..30874120 100644 --- a/cypress/TestCases/FireboltCertification/SecondScreen.feature +++ b/cypress/TestCases/FireboltCertification/SecondScreen.feature @@ -42,7 +42,7 @@ Feature: Secondscreen Then 'Firebolt' platform responds to '1st party app' for 'set friendlyName to guest room' And 'Firebolt' platform does not trigger event for 'onFriendlyNameChanged' - @Secondscreen @coreSDK @regression @sdk @requiresPlatformImplementation + @Secondscreen @coreSDK @regression @sdk @requiresPlatformImplementation @notSupported Scenario Outline: Secondscreen. - Positive Scenario: Validating event name in response When '3rd party app' registers for the '' event using the 'Firebolt' API And User triggers event with value as '' @@ -55,7 +55,7 @@ Feature: Secondscreen | onCloseRequest | secondscreen onCloseRequest | secondscreen onCloseRequest event | onCloseRequest event | | onCloseRequest | secondscreen onCloseRequest | secondscreen onCloseRequest event | onCloseRequest event | - @Secondscreen @coreSDK @regression @sdk @requiresPlatformImplementation + @Secondscreen @coreSDK @regression @sdk @requiresPlatformImplementation @notSupported Scenario Outline: Secondscreen. - Positive Scenario: Validating event Clearing listeners When '3rd party app' registers for the '' event using the 'Firebolt' API And I clear '' listeners From 9503dd0ad449ddbde47d98d7d320c2d23c3c3eab Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Mon, 15 Jul 2024 12:03:33 +0530 Subject: [PATCH 275/359] 2166 - Addressing review comments --- .../AdditionalTestcases/UserGrants.feature | 12 +- .../Manage/UserGrantsManage.feature | 4 + .../FireboltCertification/UserGrants.feature | 105 ++---------------- .../FireboltCertification/UserGrants.md | 79 +++++++++++++ cypress/fixtures/fireboltCalls/device.json | 6 + .../fixtures/fireboltCalls/localization.json | 5 + .../fireboltMocks/acknowledgeChallenge.json | 34 ------ cypress/fixtures/fireboltMocks/profile.json | 28 ----- .../objects/moduleReqId/moduleReqId.json | 30 ----- .../support/step_definitions/fireboltCalls.js | 12 ++ 10 files changed, 128 insertions(+), 187 deletions(-) create mode 100644 cypress/TestCases/FireboltCertification/UserGrants.md delete mode 100644 cypress/fixtures/fireboltMocks/acknowledgeChallenge.json delete mode 100644 cypress/fixtures/fireboltMocks/profile.json diff --git a/cypress/TestCases/FireboltCertification/AdditionalTestcases/UserGrants.feature b/cypress/TestCases/FireboltCertification/AdditionalTestcases/UserGrants.feature index 50fc8e57..55b4b3ed 100644 --- a/cypress/TestCases/FireboltCertification/AdditionalTestcases/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/AdditionalTestcases/UserGrants.feature @@ -20,4 +20,14 @@ Feature: UserGrants Examples: | scenario | | AcknowledgeChallenge Grant is deferred by exiting overlay | - | Acknowledgechallenge Grant is deferred based on the timeout (4 seconds) | \ No newline at end of file + | Acknowledgechallenge Grant is deferred based on the timeout (4 seconds) | + + # Testing with grantPolicy having not supported capability, so it will return error since capability is not supported + @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation + Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capability Without supported capability expecting error + Given the environment has been set up for 'userGrants' tests + And 3rd party 'certification' app is launched + And Framework registers 'pinChallenge' test provider + # use localization.laton capability which is not supported xrn:firebolt:capability:localization:location + When '3rd party app' invokes the 'Firebolt' API to 'expect error for localization latlon' + Then 'Firebolt' platform responds with 'not supported error for localization latlon' \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature b/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature index 064c1378..f325a0bb 100644 --- a/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature @@ -43,6 +43,10 @@ Feature: UserGrants_Manage When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' Then 'Firebolt' platform responds with 'true for capabilities granted' + # Example - 1: Granting the device distributor capability at device level and validating by retrieving the list of active grants for the device. + # Example - 2: Granting the device ID capability to specific 3rd party app and validating by retrieving the list of active grants for that app. + # Example - 3: Denying the device distributor capability at device level and validating by retrieving the list of denied grants for the device. + # Example - 4: Denying the device ID capability to specific 3rd party app and validating by retrieving the list of denied grants for that app. @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Usergrants. - Positive Scenario: Given the environment has been set up for 'userGrants' tests diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature index a9ebf209..c0e788a1 100644 --- a/cypress/TestCases/FireboltCertification/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -40,68 +40,6 @@ Feature: UserGrants When User 'stops' recording lifecycle history for '3rd party app' Then User validates lifecycle history for '3rd party app' with 'background:foreground' - # Testing with grantPolicy having with scope device and grant access, so all the apps in that device may have the access - # provide access using any 3rd party and check in another 3rd party - # Involves 2 apps, Will be handled in separate ticket - @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities R.4.4.1.1 - Positive Scenario: Validate Capability Grant access with scope device - Given the environment has been set up for 'userGrants' tests - # 3rd party app - And 3rd party 'certification' app is launched - And Framework registers 'pinChallenge' test provider - When '3rd party app' invokes the 'Firebolt' API to 'notify watched content with only entityid' - Then 'Firebolt' platform responds with 'true for watched content in discovery' - When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' - Then 'Firebolt' platform responds with 'true for capabilities granted' - When '3rd party app' invokes the 'Firebolt' API to 'close app with user exit' - # 1st part app - ###### And 1st party 'certification' app is launched - When '3rd party app' invokes the 'Firebolt' API to 'notify watched content with only entityid' - Then 'Firebolt' platform responds with 'true for watched content in discovery' - When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' - Then 'Firebolt' platform responds with 'true for capabilities granted' - - # Deny access with scope device, so all the apps in that device may not have the access - # launch a 3rd party and provide acess using any 3rd party and check in another 3rd party - # Involves 2 apps, Will be handled in separate ticket - @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation - Scenario: UserGrants.Capabilities R.4.4.1.1 - Negative Scenario: Validate Capability access denied for pinChallenge with scope device - Given the environment has been set up for 'userGrants' tests - # 3rd party app - And 3rd party 'certification' app is launched - And Framework registers 'pinChallenge' test provider - When '3rd party app' invokes the 'Firebolt' API to 'expect error while notifying watched content with only entityid' - Then 'Firebolt' platform responds with 'invalid request for discovery watched' - When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' - Then 'Firebolt' platform responds with 'false for capabilities granted' - # 1st part app - ###### And 1st party 'certification' app is launched - When '3rd party app' invokes the 'Firebolt' API to 'expect error while notifying watched content with only entityid' - Then 'Firebolt' platform responds with 'invalid request for discovery watched' - When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' - Then 'Firebolt' platform responds with 'false for capabilities granted' - - # Testing with grantPolicy having device level grant access and check in another device - # Involves multiple devices, Will be handled in separate ticket - @Usergrants @coreSDK @sdk @transport @notSupported - Scenario: UserGrants.Capabilities - Positive Scenario: Validate Capability permission in 2 diff devices - Given the environment has been set up for 'userGrants' tests - # 1st device - And 3rd party 'certification' app is launched - And Framework registers 'ackchallenge' test provider - When '3rd party app' invokes the 'Firebolt' API to 'fetch device distributor' - Then 'Firebolt' platform responds with 'expected device distributor' - When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device distributor' - Then 'Firebolt' platform responds with 'true for capabilities granted' - # 2nd device - When 3rd party 'certification' app is launched - # in another device - And '3rd party app' invokes the 'Firebolt' API to 'fetch device distributor' - Then 'Firebolt' platform responds with 'expect error for device distributor' - When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device distributor' - Then 'Firebolt' platform responds with 'true for capabilities granted' - - # If lifespan value forever only once ask for grant until we clear the given grant # Case-1: Allowing the grant and validating the result # Case-2: Checking the lifecycle history to check ui is not coming and validating for result because already allowed grant in Case-1. @@ -113,7 +51,7 @@ Feature: UserGrants And Framework registers 'pinChallenge' test provider And User 'starts' recording lifecycle history for '3rd party app' When '3rd party app' invokes the 'Firebolt' API to 'get locality' - Then 'Firebolt' platform responds with 'washington for localization locality' + Then 'Firebolt' platform responds with 'expected value for localization locality' When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for locality' Then 'Firebolt' platform responds with 'true for capabilities granted' When User 'stops' recording lifecycle history for '3rd party app' @@ -121,7 +59,7 @@ Feature: UserGrants #Case-2 When User 'starts' recording lifecycle history for '3rd party app' And '3rd party app' invokes the 'Firebolt' API to 'get locality' - Then 'Firebolt' platform responds with 'washington for localization locality' + Then 'Firebolt' platform responds with 'expected value for localization locality' When User 'stops' recording lifecycle history for '3rd party app' Then User validates lifecycle history for '3rd party app' with 'EMPTY_HISTORY' @@ -151,7 +89,6 @@ Feature: UserGrants # If lifespan value appActive it ask grant once when app is active and it ask again when app is closed and active again. # Case-1: Allowing grant when app is active and validating # Case-2: Closing and launching the app, allowing grant and validating ui is coming again - # Added @notSupported as glue is not implemented yet. @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities R*2.2.2.3 - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan appActive Given the environment has been set up for 'userGrants' tests @@ -160,7 +97,7 @@ Feature: UserGrants And Framework registers 'pinChallenge' test provider And User 'starts' recording lifecycle history for '3rd party app' When '3rd party app' invokes the 'Firebolt' API to 'get device name' - Then 'Firebolt' platform responds with 'living hall for device name' + Then 'Firebolt' platform responds with 'expected value for device name' When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for locality' Then 'Firebolt' platform responds with 'true for capabilities granted' When User 'stops' recording lifecycle history for '3rd party app' @@ -171,14 +108,13 @@ Feature: UserGrants And User set response for 'set pinchallenge correct pin' And User 'starts' recording lifecycle history for '3rd party app' And '3rd party app' invokes the 'Firebolt' API to 'get device name' - Then 'Firebolt' platform responds with 'living hall for device name' + Then 'Firebolt' platform responds with 'expected value for device name' When User 'stops' recording lifecycle history for '3rd party app' Then User validates lifecycle history for '3rd party app' with 'background:foreground' # If lifespan value appActive it ask grant once when app is active and it ask again when app is closed and active again. # Case-1: Denying grant when app is active and validating - # Case-2: Closing and launching the app, denying grant and validating ui is coming again - # Added @notSupported as glue is not implemented yet. + # Case-2: Closing and launching the app, denying grant and validating ui is coming again @Usergrants @coreSDK @sdk @transport @notSupported @requiresPlatformImplementation Scenario: UserGrants.Capabilities R*2.2.2.3 - Negative Scenario: Validate Capabilities with denied (pinChallenge) and lifespan appActive Given the environment has been set up for 'userGrants' tests @@ -287,7 +223,7 @@ Feature: UserGrants Then User validates lifecycle history for '3rd party app' with 'background:foreground' # Case-2 # rebooting the device before ttl ends and validating again - ### When I reboot device + When I reboot device When 3rd party 'certification' app is launched And User 'starts' recording lifecycle history for '3rd party app' And '3rd party app' invokes the 'Firebolt' API to 'get localization language' @@ -316,7 +252,7 @@ Feature: UserGrants Then User validates lifecycle history for '3rd party app' with 'background:foreground' When Test runner waits for 60 'seconds' # rebooting the device after ttl and validating again - ### When I reboot device + When I reboot device And 3rd party 'certification' app is launched And User set response for 'set acknowledge deny' And Framework registers 'ackchallenge' test provider @@ -347,7 +283,7 @@ Feature: UserGrants Then User validates lifecycle history for '3rd party app' with 'background:foreground' # Case-2 # rebooting the device before ttl ends and validating again - ### When I reboot device + When I reboot device When 3rd party 'certification' app is launched And User 'starts' recording lifecycle history for '3rd party app' And '3rd party app' invokes the 'Firebolt' API to 'expect error for localization language' @@ -376,7 +312,7 @@ Feature: UserGrants Then User validates lifecycle history for '3rd party app' with 'background:foreground' # Case-2 # rebooting the device after ttl and validating again - ### When I reboot device + When I reboot device When 3rd party 'certification' app is launched And User set response for 'set acknowledge granted' And Framework registers 'ackchallenge' test provider @@ -388,16 +324,6 @@ Feature: UserGrants When User 'stops' recording lifecycle history for '3rd party app' Then User validates lifecycle history for '3rd party app' with 'background:foreground' - # Testing with grantPolicy having not supported capability, so it will return error since capability is not supported - @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation - Scenario: UserGrants.Capabilities - Negative Scenario: Validate Capability Without supported capability expecting error - Given the environment has been set up for 'userGrants' tests - And 3rd party 'certification' app is launched - And Framework registers 'pinChallenge' test provider - # use localization.laton capability which is not supported xrn:firebolt:capability:localization:location - When '3rd party app' invokes the 'Firebolt' API to 'expect error for localization latlon' - Then 'Firebolt' platform responds with 'not supported error for localization latlon' - # grantPolicy having lifespan:seconds and lifespanTtl:60 seconds @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.Capabilities R*2.2.3.4 - Positive Scenario: privacySetting - autoApplyPolicy:always property-getter:true silently grant @@ -405,11 +331,8 @@ Feature: UserGrants And 1st party app invokes the 'Firebolt' API to 'disable closedCaptions' And 3rd party 'certification' app is launched And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as true' - And User 'starts' recording lifecycle history for '3rd party app' When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' Then 'Firebolt' platform responds with 'disabled for closedCaptions settings' - When User 'stops' recording lifecycle history for '3rd party app' - Then User validates lifecycle history for '3rd party app' with 'EMPTY_HISTORY' When '3rd party app' invokes the 'Firebolt' API to 'check if accessibility closedCaptions capability is granted with role as use' Then 'Firebolt' platform responds with 'true for capabilities granted' @@ -421,11 +344,8 @@ Feature: UserGrants And 1st party app invokes the 'Firebolt' API to '' And 3rd party 'certification' app is launched And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as false' - And User 'starts' recording lifecycle history for '3rd party app' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with '' - When User 'stops' recording lifecycle history for '3rd party app' - Then User validates lifecycle history for '3rd party app' with 'EMPTY_HISTORY' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with 'false for capabilities granted' @@ -440,11 +360,8 @@ Feature: UserGrants Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And 1st party app invokes the 'Firebolt' API to 'set privacy allow watchHistory as true' - And User 'starts' recording lifecycle history for '3rd party app' When '3rd party app' invokes the 'Firebolt' API to 'fetch device token' Then 'Firebolt' platform responds with 'authentication device' - When User 'stops' recording lifecycle history for '3rd party app' - Then User validates lifecycle history for '3rd party app' with 'EMPTY_HISTORY' When '3rd party app' invokes the 'Firebolt' API to 'check if authentication token device capability is granted with role use' Then 'Firebolt' platform responds with 'true for capabilities granted' @@ -625,7 +542,7 @@ Feature: UserGrants Then User validates lifecycle history for '3rd party app' with 'background:foreground' # Case-2 # rebooting the device - ###### When I reboot device + When I reboot device When 3rd party 'certification' app is launched And Framework registers 'pinChallenge' test provider And User set response for 'set pinchallenge wrong pin' @@ -655,7 +572,7 @@ Feature: UserGrants Then User validates lifecycle history for '3rd party app' with 'background:foreground' # Case-2 # rebooting the device - ###### When I reboot device + When I reboot device When 3rd party 'certification' app is launched And Framework registers 'pinChallenge' test provider And User set response for 'set pinchallenge correct pin' diff --git a/cypress/TestCases/FireboltCertification/UserGrants.md b/cypress/TestCases/FireboltCertification/UserGrants.md new file mode 100644 index 00000000..a9daebcf --- /dev/null +++ b/cypress/TestCases/FireboltCertification/UserGrants.md @@ -0,0 +1,79 @@ +# Firebolt Certification +Feature file for Firebolt Certification UserGrants Module. + +## Purpose +A module for managing grants given by the user. + +## Pre requisites : +1.**Grant Policies** +* Grant Policies specify details like how long the grant lasts and what is the scope of the grant. +* We have to add the corresponding grantPolicy of the capability we are testing inside "grantPolicies" object within "capabilities" object of deviceManifest file. +* This object will be having the grantpolicy for manage, use and provide roles. + For eg:, for localization.postalCode, + "capabilities": { + "supported": [ + ... + ], + "dependencies": { + ... + }, + "grantPolicies": { + "xrn:firebolt:capability:localization:postal-code": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + }, + { + "capability": "xrn:firebolt:capability:usergrant:acknowledgechallenge" + } + ] + } + ], + "scope": "app", + "lifespan": "once", + "overridable": false + } + } + + } + + 2.**Dependencies** + * Capabilities which are dependent on other grantPolicy, have to be added inside "dependencies" object of "capabilities" object. + * For eg:, if "discovery.watched" api has to use the grantPolicy of "app-usage", then we have to add the dependency as following : + "capabilities": { + "supported": [ + ... + ], + "dependencies": { + "xrn:firebolt:capability:discovery:watched": [ + "xrn:firebolt:capability:data:app-usage" + ] + }, + "grantPolicies": { + "xrn:firebolt:capability:data:app-usage": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "appActive", + "overridable": false + } + } + } + } \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/device.json b/cypress/fixtures/fireboltCalls/device.json index a758cf86..3d0693cf 100644 --- a/cypress/fixtures/fireboltCalls/device.json +++ b/cypress/fixtures/fireboltCalls/device.json @@ -393,5 +393,11 @@ "ONNETWORKCHANGED_EVENTS_WITH_HYBRID_DISCONNECTED": { "method": "device.onNetworkChanged", "params": "DEVICE_ONNETWORKCHANGED_HYBRIDDISCONNECT_EVENTS" + }, + "EXPECTED_VALUE_FOR_DEVICE_NAME": { + "method": "device.name", + "validationJsonPath": "result", + "content": "Living hall", + "expectingError": false } } \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/localization.json b/cypress/fixtures/fireboltCalls/localization.json index 20005cd2..55cdbed3 100644 --- a/cypress/fixtures/fireboltCalls/localization.json +++ b/cypress/fixtures/fireboltCalls/localization.json @@ -637,5 +637,10 @@ "method": "localization.removeAdditionalInfo", "validationJsonPath": "result", "content": "NULL" + }, + "EXPECTED_VALUE_FOR_LOCALIZATION_LOCALITY": { + "method": "localization.locality", + "validationJsonPath": "result", + "content": "LOCALIZATION_LOCALITY" } } \ No newline at end of file diff --git a/cypress/fixtures/fireboltMocks/acknowledgeChallenge.json b/cypress/fixtures/fireboltMocks/acknowledgeChallenge.json deleted file mode 100644 index c70b2d84..00000000 --- a/cypress/fixtures/fireboltMocks/acknowledgeChallenge.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "ACKNOWLEDGE_CHALLENGE_DENY": { - "method": "ackchallenge", - "response": [{ - "isCancelled": true, - "withUi": true, - "error":{} - }] - }, - "ACKNOWLEDGE_CHALLENGE_GRANTED": { - "method": "ackchallenge", - "response": [{ - "isCancelled": false, - "withUi": true, - "result":{} - }] - }, - "ACKNOWLEDGE_DEFERRED": { - "method": "ackchallenge", - "response": [{ - "isCancelled": true, - "withUi": true, - "isExit": true, - "result":{} - }] - }, - "ACKNOWLEDGE_TIMEOUT": { - "method": "ackchallenge", - "response": [{ - "withUi": true, - "result":{} - }] - } -} \ No newline at end of file diff --git a/cypress/fixtures/fireboltMocks/profile.json b/cypress/fixtures/fireboltMocks/profile.json deleted file mode 100644 index ff85ffb8..00000000 --- a/cypress/fixtures/fireboltMocks/profile.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "PINCHALLENGE_CORRECT_PIN_WITH_UI": { - "method": "pinchallenge", - "response": [ - { - "pinText": "1111", - "isCancelled": false, - "withUi": true, - "maxAttempts": 3, - "noPinRequired": false, - "result": true - } - ] - }, - "PINCHALLENGE_WRONG_PIN_WITH_UI": { - "method": "pinchallenge", - "response": [ - { - "pinText": "5678", - "isCancelled": false, - "withUi": true, - "maxAttempts": 3, - "noPinRequired": false, - "result": false - } - ] - } -} \ No newline at end of file diff --git a/cypress/fixtures/objects/moduleReqId/moduleReqId.json b/cypress/fixtures/objects/moduleReqId/moduleReqId.json index 52f72162..36b01848 100644 --- a/cypress/fixtures/objects/moduleReqId/moduleReqId.json +++ b/cypress/fixtures/objects/moduleReqId/moduleReqId.json @@ -703,36 +703,6 @@ } ] }, - "UserGrants.Capabilities R.4.4.1.1 - Positive Scenario: Validate Capability Grant access with scope device": { - "req": [ - { - "method": { - "id": "UserGrants R.4.4.1.1, R.1.1", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capabilities R.4.4.1.1 - Negative Scenario: Validate Capability access denied for pinchallenge with scope device": { - "req": [ - { - "method": { - "id": "UserGrants R.4.4.1.1, R.1.2", - "description": "Should not be null" - } - } - ] - }, - "UserGrants.Capabilities - Positive Scenario: Validate Capability permission in 2 diff devices": { - "req": [ - { - "method": { - "id": "UserGrants 1.1", - "description": "Should not be null" - } - } - ] - }, "UserGrants.Capabilities R*2.2.2.2 - Positive Scenario: Validate Capabilities with granted (pinChallenge) and lifespan forever": { "req": [ { diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 2a6cec40..c6295ac4 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -674,3 +674,15 @@ Given( } } ); + +/** + * @function I reboot device + * @description Reboot a device during test execution + * @example + * When I reboot device + */ + Given('I reboot device', () => { + fireLog.info(CONSTANTS.STEP_DEFINITION_NEEDS_TO_IMPLEMENT).then(() => { + throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); + }); +}); \ No newline at end of file From 11c1340f4f7d2779e196f0c34c791b79e16705ad Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Mon, 15 Jul 2024 14:28:31 +0530 Subject: [PATCH 276/359] FIRECERT-2112 updated logs --- cypress/plugins/testDataProcessor.js | 6 ------ cypress/support/cypress-commands/assertion.js | 9 +++++---- cypress/support/validations/decodeValidation.js | 13 +++++++++++-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/cypress/plugins/testDataProcessor.js b/cypress/plugins/testDataProcessor.js index e78ad412..04303408 100644 --- a/cypress/plugins/testDataProcessor.js +++ b/cypress/plugins/testDataProcessor.js @@ -219,9 +219,6 @@ function testDataHandler(requestType, dataIdentifier, fireboltObject) { const contextImportFile = CONSTANTS.CONTEXT_FILE_PATH; const contextValue = fetchAndParseDataFromJson(contextImportFile, dataIdentifier); if (contextValue === CONSTANTS.NO_DATA) { - logger.info( - `Expected context not found for ${dataIdentifier}. Returning ${dataIdentifier} as is.` - ); return dataIdentifier; } else { return contextValue; @@ -333,9 +330,6 @@ function testDataHandler(requestType, dataIdentifier, fireboltObject) { } 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; } return (data.type = deviceData); diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index b19a07e3..a40dabd4 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -140,10 +140,9 @@ Cypress.Commands.add( ); let pretext = CONSTANTS.ERROR_MESSAGE_VALIDATION + `for ${method} : `; if (checkErrorMessage) { - pretext = pretext + `apiResponse errorMessage is present in errorContent object list`; + pretext = pretext + `Error message present in list of expected error messages`; } else { - pretext = - pretext + `apiResponse errorMessage is not present in errorContent object list`; + pretext = pretext + `Error message not present in list of expected error messages`; } fireLog.equal(checkErrorMessage, true, pretext); }); @@ -186,11 +185,13 @@ Cypress.Commands.add( const apiResponseContent = eval(CONSTANTS.EXTRACTEDAPI_PATH + validationPath); const pretext = CONSTANTS.METHOD_CONTENT + + ' for ' + + methodOrEvent + + ':' + ' expected ' + JSON.stringify(apiResponseContent) + ' to be ' + JSON.stringify(expected); - // Executing fireLog.deepEqual() after logging if (apiResponseContent != expected) { throw new Error(`${pretext}`); } else { diff --git a/cypress/support/validations/decodeValidation.js b/cypress/support/validations/decodeValidation.js index c1b9a60a..a91deaa0 100644 --- a/cypress/support/validations/decodeValidation.js +++ b/cypress/support/validations/decodeValidation.js @@ -140,7 +140,11 @@ class decodeValidations { `Regular Expression Validation: expected ${param} to be in a valid ${regexFormat} format`, 'decodeBase64AndJwtToken' ).then(() => { - assert.equal(true, resultSet, 'RegEx Validation:'); + if (resultSet == false) { + throw new Error(`RegEx Validation failed for ${param} value`); + } else { + fireLog.info(`RegEx Validation passed for ${param} value`); + } }); } else { cy.log(`Decode base64: Expected ${param} field not present in Decoded data`).then(() => { @@ -159,7 +163,12 @@ class decodeValidations { `Regular Expression Validation: expected ${param} to be in a valid ${regexFormat} format`, 'decodeBase64AndJwtToken' ).then(() => { - assert.equal(true, resultSet, 'RegEx Validation:'); + // assert.equal(true, resultSet, 'RegEx Validation:'); + if (resultSet == false) { + throw new Error(`RegEx Validation failed for ${param} value`); + } else { + fireLog.info(`RegEx Validation passed for ${param} value`); + } }); } else { cy.log(`Decode jwt: Expected ${param} field not present in Decoded data`).then(() => { From 0e41b423682f9db19ff650ce94ae77b7d388551b Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Mon, 15 Jul 2024 15:51:50 +0530 Subject: [PATCH 277/359] Addressed the comments --- .../Accessibility.feature | 40 ++++++++-------- .../Manage/ClosedCaptionsManage.feature | 30 ++++++------ .../fixtures/fireboltCalls/accessibility.js | 8 ++-- cypress/support/appObjectConfigs.js | 6 ++- cypress/support/cypress-commands/commands.js | 47 +------------------ cypress/support/cypress-support/src/utils.js | 3 ++ 6 files changed, 47 insertions(+), 87 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Accessibility.feature b/cypress/TestCases/FireboltCertification/Accessibility.feature index 1268a55f..37eb67f6 100644 --- a/cypress/TestCases/FireboltCertification/Accessibility.feature +++ b/cypress/TestCases/FireboltCertification/Accessibility.feature @@ -6,7 +6,7 @@ Feature: Accessibility @Accessibility @coreSDK @sdk @transport Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: - Given we test the 'CLOSEDCAPTIONS_SETTINGS' getters and setters '' to '' + Given we test the 'ACCESSIBILITY_CLOSEDCAPTIONS_SETTINGS' getters and setters '' to '' When '3rd party app' registers for the 'Firebolt' event When '3rd party app' invokes the 'Firebolt' get API Given 1st party app invokes the 'Firebolt' API to set '' to '' @@ -39,7 +39,7 @@ Feature: Accessibility | Set fontEdgeColor-#FFFFFF | fontEdgeColor | #FFFFFF | | Set backgroundColor-#7f7f7f | backgroundColor | #7f7f7 | | Set fontOpacity-75 | fontOpacity | 75 | - | Set backgroundOpacity-75 | fontOpacity | 75 | + | Set backgroundOpacity-75 | backgroundOpacity | 75 | | Set textAlign-left | textAlign | left | | Set textAlign-center | textAlign | center | | Set textAlign-right | textAlign | right | @@ -51,8 +51,8 @@ Feature: Accessibility | Set preferredLanguages | preferredLanguages | spa,eng | @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: with 'null' params - Given we test the 'CLOSEDCAPTIONS_SETTINGS' getters and setters '' to '' + Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: with 'null' params + Given we test the 'ACCESSIBILITY_CLOSEDCAPTIONS_SETTINGS' getters and setters '' to 'null' When '3rd party app' registers for the 'Firebolt' event When '3rd party app' invokes the 'Firebolt' get API Given 1st party app invokes the 'Firebolt' API to set '' to 'null' @@ -62,23 +62,23 @@ Feature: Accessibility And 'Firebolt' platform triggers '3rd party app' event Examples: - | Scenario | Method | - | fontFamily | fontFamily | - | fontSize | fontSize | - | fontColor | fontColor | - | fontEdge | fontEdge | - | fontEdgeColor | fontEdgeColor | - | fontOpacity | fontOpacity | - | backgroundColor | backgroundColor | - | backgroundOpacity | backgroundOpacity | - | textAlign | textAlign | - | textAlignVertical | textAlignVertical | - | windowColor | windowColor | - | windowOpacity | windowOpacity | + | Method | + | fontFamily | + | fontSize | + | fontColor | + | fontEdge | + | fontEdgeColor | + | fontOpacity | + | backgroundColor | + | backgroundOpacity | + | textAlign | + | textAlignVertical | + | windowColor | + | windowOpacity | @Accessibility @coreSDK @sdk @transport Scenario Outline: Accessibility.voiceGuidanceSettings - Positive Scenario: - Given we test the 'VOICEGUIDANCE_SETTINGS' getters and setters '' to '' + Given we test the 'ACCESSIBILITY_VOICEGUIDANCE_SETTINGS' getters and setters '' to '' When '3rd party app' registers for the 'Firebolt' event When '3rd party app' invokes the 'Firebolt' get API Given 1st party app invokes the 'Firebolt' API to set '' to '' @@ -113,7 +113,7 @@ Feature: Accessibility @Accessibility @coreSDK @sdk @transport Scenario Outline: Accessibility.closedCaptions - Positive Scenario: - Given we test the 'CLOSEDCAPTIONS' getters and setters '' to '' + Given we test the 'ACCESSIBILITY_CLOSEDCAPTIONS' getters and setters '' to '' When '3rd party app' registers for the 'Firebolt' event Given 1st party app invokes the 'Firebolt' API to set '' to '' And 'Firebolt' platform responds to '1st party app' set API @@ -139,7 +139,7 @@ Feature: Accessibility @Accessibility @coreSDK @sdk @transport Scenario Outline: Accessibility.voiceGuidance - Positive Scenario: - Given we test the 'VOICEGUIDANCE' getters and setters '' to '' + Given we test the 'ACCESSIBILITY_VOICEGUIDANCE' getters and setters '' to '' When '3rd party app' registers for the 'Firebolt' event When '3rd party app' invokes the 'Firebolt' get API Given 1st party app invokes the 'Firebolt' API to set '' to '' diff --git a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature index 8c44c341..ea004d25 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature @@ -48,8 +48,8 @@ Feature: ClosedCaptions_Manage | Set windowOpacity-50 | windowOpacity | 50 | @ClosedCaptions @manageSDK - Scenario Outline: ClosedCaptions. - Positive Scenario: - Given we test the 'CLOSED_CAPTIONS_SETTINGS' getters and setters '' to '' + Scenario Outline: ClosedCaptions. - Positive Scenario: + Given we test the 'CLOSED_CAPTIONS_SETTINGS' getters and setters '' to 'null' When '1st party app' registers for the 'Firebolt' event And 1st party app invokes the 'Firebolt' API to set '' to 'null' Then 'Firebolt' platform responds to '1st party app' set API @@ -58,19 +58,19 @@ Feature: ClosedCaptions_Manage And 'Firebolt' platform triggers '1st party app' event Examples: - | Scenario | Method | - | fontFamily | fontFamily | - | fontSize | fontSize | - | fontColor | fontColor | - | fontEdge | fontEdge | - | fontEdgeColor | fontEdgeColor | - | fontOpacity | fontOpacity | - | backgroundColor | backgroundColor | - | backgroundOpacity | backgroundOpacity | - | textAlign | textAlign | - | textAlignVertical | ftextAlignVerticalontColor | - | windowColor | windowColor | - | windowOpacity | windowOpacity | + | Method | + | fontFamily | + | fontSize | + | fontColor | + | fontEdge | + | fontEdgeColor | + | fontOpacity | + | backgroundColor | + | backgroundOpacity | + | textAlign | + | textAlignVerticalontColor | + | windowColor | + | windowOpacity | @ClosedCaptions @manageSDK Scenario Outline: ClosedCaptions. - Negative Scenario: expecting error diff --git a/cypress/fixtures/fireboltCalls/accessibility.js b/cypress/fixtures/fireboltCalls/accessibility.js index 17a4087c..56b70b14 100644 --- a/cypress/fixtures/fireboltCalls/accessibility.js +++ b/cypress/fixtures/fireboltCalls/accessibility.js @@ -1,4 +1,4 @@ -exports.CLOSEDCAPTIONS_SETTINGS = { +exports.ACCESSIBILITY_CLOSEDCAPTIONS_SETTINGS = { method: 'accessibility.closedCaptionsSettings', params: null, validationJsonPath: resolveAtRuntime(['result.{{attribute}}', 'result.styles.{{attribute}}']), @@ -29,7 +29,7 @@ exports.CLOSEDCAPTIONS_SETTINGS = { }, }; -exports.VOICEGUIDANCE_SETTINGS = { +exports.ACCESSIBILITY_VOICEGUIDANCE_SETTINGS = { method: 'accessibility.voiceGuidanceSettings', params: null, validationJsonPath: resolveAtRuntime(['result.{{attribute}}']), @@ -85,7 +85,7 @@ exports.AUDIODESCRIPTIONS_SETTINGS = { }, }; -exports.CLOSEDCAPTIONS = { +exports.ACCESSIBILITY_CLOSEDCAPTIONS = { method: 'accessibility.closedCaptions', params: null, validationJsonPath: resolveAtRuntime(['result.{{attribute}}', 'result.styles.{{attribute}}']), @@ -116,7 +116,7 @@ exports.CLOSEDCAPTIONS = { }, }; -exports.VOICEGUIDANCE = { +exports.ACCESSIBILITY_VOICEGUIDANCE = { method: 'accessibility.voiceGuidance', params: null, validationJsonPath: resolveAtRuntime(['result.{{attribute}}']), diff --git a/cypress/support/appObjectConfigs.js b/cypress/support/appObjectConfigs.js index 84735d88..2d8b7eb0 100644 --- a/cypress/support/appObjectConfigs.js +++ b/cypress/support/appObjectConfigs.js @@ -51,8 +51,10 @@ class eventObject { // Function to update the event response in event object. setEventResponseData(response) { if ( - (response.eventSchemaResult && response.eventResponse != null) || - response.hasOwnProperty(CONSTANTS.EVENT_RESPONSE) + (response && response.eventResponse && response.eventResponse[this.eventObjectId] != null) || + (response && + response.eventResponse != null && + !response.eventResponse.hasOwnProperty(this.eventObjectId)) ) { this.eventResponse = response.eventResponse; this.eventSchemaResult = response.eventSchemaResult; diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 11a387a0..77482c92 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -1005,51 +1005,6 @@ Cypress.Commands.add('methodOrEventResponseValidation', (validationType, request expectingError === true ? contentObject : CONSTANTS.EXCEPTION_ERROR_OBJECT; cy.validateErrorObject(method, errorContent, validationType, context, appId, param); } else { - if (validationType == CONSTANTS.EVENT) { - const eventName = methodOrEventObject.eventObjectId; - if (appId === UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) { - const requestMap = { - method: CONSTANTS.REQUEST_OVERRIDE_CALLS.FETCH_EVENT_RESPONSE, - params: eventName, - }; - - cy.sendMessagetoPlatforms(requestMap).then((result) => { - cy.updateResponseForFCS(method, null, result, true).then((updatedResponse) => { - cy.saveEventResponse( - updatedResponse, - methodOrEventObject, - eventName, - eventExpected === 'triggers' ? true : false - ); - }); - }); - } else { - const params = { event: eventName }; - // Generating an intent message using the provided information to send it to a third-party app - const intentMessage = UTILS.createIntentMessage(CONSTANTS.TASK.GETEVENTRESPONSE, params); - const requestTopic = UTILS.getTopic(appId); - const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); - cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((response) => { - response = JSON.parse(response); - if ( - response && - response.result && - response.result.hasOwnProperty(CONSTANTS.EVENT_RESPONSE) - ) { - response.result = response.result.eventResponse; - } - cy.updateResponseForFCS(method, null, response, true).then((updatedResponse) => { - cy.saveEventResponse( - updatedResponse, - methodOrEventObject, - eventName, - eventExpected === 'triggers' ? true : false - ); - }); - }); - } - } - cy.then(() => { if (validationType == CONSTANTS.EVENT) { const eventName = methodOrEventObject.eventObjectId; @@ -1119,7 +1074,7 @@ Cypress.Commands.add('methodOrEventResponseValidation', (validationType, request ? (validationJsonPath = validationPath) : fireLog.assert( false, - 'Could not find the valid validation path from the validationJsonPath list' + `Could not find the valid validation path from the validationJsonPath list - ${validationJsonPath}` ); } switch (scenario) { diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 78e87a77..4ab6266d 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -809,6 +809,9 @@ function parseValue(str) { if (str.includes(',')) { return str.split(','); } + if (/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(str)) { + return str; + } } return str; From 843c213f2b9d90dac37f00e887be70419ec03aba Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Mon, 15 Jul 2024 16:38:48 +0530 Subject: [PATCH 278/359] FIRECERT-2112 updated logs of eventValidation --- cypress/support/cypress-commands/assertion.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index a40dabd4..93e1dc97 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -17,7 +17,7 @@ */ const CONSTANTS = require('../constants/constants'); const { _ } = Cypress; -import UTILS from '../cypress-support/src/utils'; +import UTILS, { fireLog } from '../cypress-support/src/utils'; /** * @module assertion @@ -510,7 +510,7 @@ Cypress.Commands.add( CONSTANTS.SKIPPED ); cy.assertValidationsForEvent( - 'Schema Validation Failed', + extractEventObject, verifyPath, 'PASS', 'Event Schema Validation :' @@ -602,7 +602,6 @@ Cypress.Commands.add( const verifyEventResponse = verifyPath.split('.')[0]; const verifyInnerObject = verifyPath.split('.')[1]; const verifyOuterObject = verifyPath.split('.')[2]; - // Checks for multi level object structure and does the event content validation if (verifyOuterObject) { const eventResponseInnerObject = verifyEventResponse + '.' + verifyInnerObject; @@ -610,7 +609,13 @@ Cypress.Commands.add( expected = eval('extractEventObject.' + verifyPath); } } else { - expected = eval('extractEventObject.' + verifyPath); + if (extractEventObject && eval('extractEventObject.' + verifyPath)) { + expected = eval('extractEventObject.' + verifyPath); + } else if (!extractEventObject) { + throw new Error('Event Not Received'); + } else { + throw new Error('Event Response Does Not Contain the required field'); + } } let expectedValue = expected; let actualValue = actual; From 42f248e6b465036077c44238cfe762d416f48731 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Mon, 15 Jul 2024 16:59:27 +0530 Subject: [PATCH 279/359] FIRECERT-2112 updated logs of eventValidation --- cypress/support/cypress-commands/assertion.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index 93e1dc97..9be7a485 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -614,7 +614,7 @@ Cypress.Commands.add( } else if (!extractEventObject) { throw new Error('Event Not Received'); } else { - throw new Error('Event Response Does Not Contain the required field'); + throw new Error('Event Not Received'); } } let expectedValue = expected; From e19fee12ebfdfe09e8cbbaf3553f232369beb276 Mon Sep 17 00:00:00 2001 From: Preethi M R <102140979+PreethiMaai@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:01:00 +0530 Subject: [PATCH 280/359] Minor update --- .../Manage/UserGrantsManage.feature | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature b/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature index f325a0bb..296cb19c 100644 --- a/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature @@ -43,10 +43,10 @@ Feature: UserGrants_Manage When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' Then 'Firebolt' platform responds with 'true for capabilities granted' - # Example - 1: Granting the device distributor capability at device level and validating by retrieving the list of active grants for the device. - # Example - 2: Granting the device ID capability to specific 3rd party app and validating by retrieving the list of active grants for that app. - # Example - 3: Denying the device distributor capability at device level and validating by retrieving the list of denied grants for the device. - # Example - 4: Denying the device ID capability to specific 3rd party app and validating by retrieving the list of denied grants for that app. + # Example - 1: Granting the device distributor capability by calling usergrants.grant method at device level and validating by retrieving the list of active grants for the device by usergrants.device. + # Example - 2: Granting the device ID capability by calling usergrants.grant method to specific 3rd party app and validating by retrieving the list of active grants for that app by usergrants.app. + # Example - 3: Denying the device distributor capability by calling usergrants.deny method at device level and validating by retrieving the list of denied grants for the device by usergrants.device. + # Example - 4: Denying the device ID capability by calling usergrants.deny method to specific 3rd party app and validating by retrieving the list of denied grants for that app by usergrants.app. @Usergrants @manageSDK @sdk @transport @requiresPlatformImplementation Scenario Outline: Usergrants. - Positive Scenario: Given the environment has been set up for 'userGrants' tests @@ -191,4 +191,4 @@ Feature: UserGrants_Manage When 1st party app invokes the 'Firebolt' API to 'get usergrants for 3rd party app' Then 'Firebolt' platform responds to '1st party app' with 'empty array for usergrants device id' When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for device id' - Then 'Firebolt' platform responds with 'null for capabilities granted' \ No newline at end of file + Then 'Firebolt' platform responds with 'null for capabilities granted' From 914b8dbb1b41608bd0ceeb25c3f485a3e612c8a0 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 16 Jul 2024 00:41:07 +0530 Subject: [PATCH 281/359] Updated TCs with 2 app launch --- .../DiscoveryLaunchHot.feature | 25 +++-------- .../Manage/SecureStorageManage.feature | 35 ++++++++++++--- .../SecureStorage.feature | 45 +++++++++++++------ .../FireboltCertification/UserGrants.feature | 12 ++--- 4 files changed, 75 insertions(+), 42 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature b/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature index 54e85897..b87e1414 100644 --- a/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature +++ b/cypress/TestCases/FireboltCertification/DiscoveryLaunchHot.feature @@ -213,13 +213,13 @@ Feature: Discovery.launch_HotLaunch When 1st party app invokes the 'Firebolt' API to 'launch app with search intent int source' Then 'Firebolt' platform responds to '1st party app' with 'invalid parameters for discovery launch' - @DiscoveryLaunch @coreSDK @sdk @transport - Scenario: Discovery.Launch Hot Launch - Positive Scenario: Event validation where one app is in background and one is in foreground + @DiscoveryLaunch @coreSDK @sdk @transport @requiresPlatformImplementation + Scenario Outline: Discovery.Launch Hot Launch - Positive Scenario: Event validation where one app is in and one is in foreground Given the environment has been set up for 'DiscoveryLaunch' tests And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId When Test runner waits for 10 'seconds' And 'secondary 3rd party app' registers for the 'discovery onNavigateTo' event using the 'Firebolt' API - And 'secondary 3rd party app' transitions to state 'background' + And 'secondary 3rd party app' transitions to state '' And 3rd party 'certification' app is launched And '3rd party app' registers for the 'discovery onNavigateTo' event using the 'Firebolt' API When 1st party app invokes the 'Firebolt' API to 'launch app with home intent' @@ -229,18 +229,7 @@ Feature: Discovery.launch_HotLaunch And 'Firebolt' platform triggers event 'onNavigateTo with home intent' And 'Firebolt' platform does not trigger to 'secondary 3rd party app' event 'onNavigateTo' - @DiscoveryLaunch @coreSDK @sdk @transport - Scenario: Discovery.Launch Hot Launch - Positive Scenario: Event validation where one app is in inactive and one is in foreground - Given the environment has been set up for 'DiscoveryLaunch' tests - And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId - When Test runner waits for 10 'seconds' - And 'secondary 3rd party app' registers for the 'discovery onNavigateTo' event using the 'Firebolt' API - And 'secondary 3rd party app' transitions to state 'inactive' - And 3rd party 'certification' app is launched - And '3rd party app' registers for the 'discovery onNavigateTo' event using the 'Firebolt' API - When 1st party app invokes the 'Firebolt' API to 'launch app with home intent' - Then 'Firebolt' platform responds to '1st party app' with 'true for discoverylaunch' - And '3rd party app' invokes the 'Firebolt' API to 'fetch lifecycle state' - Then 'Firebolt' platform responds with 'foreground for lifecycle state' - And 'Firebolt' platform triggers event 'onNavigateTo with home intent' - And 'Firebolt' platform does not trigger to 'secondary 3rd party app' event 'onNavigateTo' + Examples: + | state | + | background | + | inactive | \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature index 9ca2ae9e..56eb54c0 100644 --- a/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/SecureStorageManage.feature @@ -125,6 +125,13 @@ Feature: SecureStorage_Manage | Passing scope as boolean | clear secure data values for an app with boolean scope | | without scope | clear secure data values for an app without scope | + + # secondary 3rd party app is launched + # clears the existing key for 1st app + # validates the cleared value for 1st app + # set value for 1st app + # validates the set value for 1st app + # validates the set value for 2nd app @SecureStorage @manageSDK Scenario Outline: SecureStorage.setForApp - Positive Scenario: Given 3rd party 'certification' app is launched with 'secondary 3rd party app' appId @@ -132,20 +139,30 @@ Feature: SecureStorage_Manage And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with 'null for getting stored value' - Given 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for getting stored value' When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' for '' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with '' - Given 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for getting stored value' Examples: | Scenario | Set_API_Key | API_Key | Method_Validation_Key | Clear_API_Key | | setForApp with device scope with 2 apps | set secure data value for an app with scope device | get stored value with scope as device and key as authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device for an app | - + # secondary 3rd party app is launched + # clears the existing key for 1st app + # validates the cleared value for 1st app + # set value1 for 1st app + # set value2 for 1st app + # validates the set values for 1st app + # set value1 for 2nd app + # validates the set value for 2nd app + # remove value1 for 1st app + # validate the values for 1st app + # validate the value for 2nd app @SecureStorage @manageSDK Scenario Outline: SecureStorage.removeForApp - Positive Scenario: Given 3rd party 'certification' app is launched with 'secondary 3rd party app' appId @@ -153,7 +170,7 @@ Feature: SecureStorage_Manage And 'Firebolt' platform responds to '1st party app' for 'null for clearing stored value for an app' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with 'null for getting stored value' - Given 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for getting stored value' And 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value for an app' @@ -180,10 +197,18 @@ Feature: SecureStorage_Manage | Scenario | Remove_API_Key | Set_API_Key1 | Set_API_Key2 | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | Clear_API_Key | | removeForApp with device scope with 2 apps | remove secure data value for an app with scope device | set secure data value1 for an app with scope device | set secure data value2 for an app with scope device | get stored value for an app for authTestTokenDevice1 with scope device | get stored value for an app for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | clear stored value with scope as device for an app | + # secondary 3rd party app is launched + # set value1 for 1st app + # set value1 for 2nd app + # validates the set values for 1st app + # validates the set value for 2nd app + # clears the existing key for 1st app + # validates the cleared value for 1st app + # validate the values for 2nd app @SecureStorage @manageSDK Scenario Outline: SecureStorage.clearForApp - Positive Scenario: Given 3rd party 'certification' app is launched with 'secondary 3rd party app' appId - Given 1st party app invokes the 'Firebolt' API to '' + And 1st party app invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to '1st party app' for '' And 1st party app invokes the 'Firebolt' API to 'set secure data value1 for second app with scope device' And 'Firebolt' platform responds to '1st party app' for 'null for updating a secure data value for an app' diff --git a/cypress/TestCases/FireboltCertification/SecureStorage.feature b/cypress/TestCases/FireboltCertification/SecureStorage.feature index b68768a4..6191fb82 100644 --- a/cypress/TestCases/FireboltCertification/SecureStorage.feature +++ b/cypress/TestCases/FireboltCertification/SecureStorage.feature @@ -226,12 +226,20 @@ Feature: SecureStorage | Passing scope as boolean | clear stored value with scope as boolean | | without scope | clear stored value without scope | + # clears the existing key for 1st app + # 2nd app is launched + # clears the existing key for 2nd app + # validates the cleared value for 1st app + # validates the cleared value for 2nd app + # set value1 in device scope + # validates the set values for 1st app + # validates the set value for 2nd app @Securestorage @coreSDK @sdk @transport Scenario Outline: SecureStorage.set - Positive Scenario: Validate Given '3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds with 'null for clearing stored value' And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId - Given 'secondary 3rd party app' invokes the 'Firebolt' API to '' + And 'secondary 3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for clearing stored value' And '3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds with 'null for getting stored value' @@ -239,8 +247,6 @@ Feature: SecureStorage And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for getting stored value' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with 'null for updating a secure data value' - When 'secondary 3rd party app' invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for updating a secure data value' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with '' And 'secondary 3rd party app' invokes the 'Firebolt' API to '' @@ -250,8 +256,20 @@ Feature: SecureStorage | Scenario | Get_API_Key | Set_API_Key | Validation_Key | Clear_API_Key | | Adding scope as device in 2 apps | get stored value with scope as device and key as authTestTokenDevice | update stored value for key authTestTokenDevice | expected value for authTestTokenDevice stored data in securestorage | clear stored value with scope as device | + # 2nd app is launched + # set value1 in device scope + # validates the set values for 1st app + # set value2 in device scope + # validates the set values for 1st app + # validates the set values for 2nd app + # removes value1 with device scope + # validates the removed value for 1st app + # validates the removed value for 2nd app + # validates the remaining value for 1st app + # validates the remaining value for 2nd app @Securestorage @coreSDK @sdk @transport Scenario Outline: SecureStorage.remove - Positive Scenario: Validate + And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId Given '3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds with 'null for updating a secure data value' And '3rd party app' invokes the 'Firebolt' API to '' @@ -260,12 +278,8 @@ Feature: SecureStorage And 'Firebolt' platform responds with 'null for updating a secure data value' And '3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds with '' - Given 'secondary 3rd party app' invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for updating a secure data value' And 'secondary 3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to 'secondary 3rd party app' with '' - And 'secondary 3rd party app' invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for updating a secure data value' And 'secondary 3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to 'secondary 3rd party app' with '' When '3rd party app' invokes the 'Firebolt' API to '' @@ -284,8 +298,17 @@ Feature: SecureStorage | Scenario | Set_API_Key1 | Set_API_Key2 | Remove_API_Key | Get_API_Key1 | Get_API_Key2 | Validation_Key2 | Validation_Key1 | Clear_API_Key | | Removing device scope in 2 apps | set secure value for key authTestTokenDevice1 | set secure value for key authTestTokenDevice2 | remove the stored value authTestTokenDevice1 with scope device | get stored value for authTestTokenDevice1 with scope device | get stored value for authTestTokenDevice2 with scope device | expected value for authTestTokenDevice2 stored data in securestorage | expected value for authTestTokenDevice1 stored data in securestorage | clear stored value with scope as device | + # 2nd app is launched + # set value1 in device scope + # set value2 in device scope + # validates the set values for 1st app + # validates the set values for 2nd app + # clear values with device scope + # validates the null value for 1st app + # validates the null value for 2nd app @Securestorage @coreSDK @sdk @transport Scenario Outline: SecureStorage.clear - Positive Scenario: Clears all the data values + And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId Given '3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds with 'null for updating a secure data value' And '3rd party app' invokes the 'Firebolt' API to '' @@ -294,10 +317,6 @@ Feature: SecureStorage And 'Firebolt' platform responds with '' And '3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds with '' - Given 'secondary 3rd party app' invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for updating a secure data value' - And 'secondary 3rd party app' invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for updating a secure data value' And 'secondary 3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds to 'secondary 3rd party app' with '' And 'secondary 3rd party app' invokes the 'Firebolt' API to '' @@ -309,9 +328,9 @@ Feature: SecureStorage When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with 'null for getting stored value' And 'secondary 3rd party app' invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for getting stored value' And 'secondary 3rd party app' invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for getting stored value' Examples: diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature index 49f976a8..2f97304d 100644 --- a/cypress/TestCases/FireboltCertification/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -9,14 +9,14 @@ Feature: UserGrants And Framework registers 'pinChallenge' test provider When '3rd party app' invokes the 'Firebolt' API to 'notify watched content with only entityid' Then 'Firebolt' platform responds with 'true for watched content in discovery' - When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' Then 'Firebolt' platform responds with 'true for capabilities granted' When '3rd party app' invokes the 'Firebolt' API to 'close app with user exit' And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId - Given 'secondary 3rd party app' invokes the 'Firebolt' API to 'notify watched content with only entityid' + And 'secondary 3rd party app' invokes the 'Firebolt' API to 'notify watched content with only entityid' And 'Firebolt' platform responds to 'secondary 3rd party app' with 'true for watched content in discovery' - When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' - Then 'Firebolt' platform responds with 'true for capabilities granted' + When 'secondary 3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' + Then 'Firebolt' platform responds to 'secondary 3rd party app' with 'true for capabilities granted' # Deny access with scope device, so all the apps in that device may not have the access # launch a 3rd party and provide acess using any 3rd party and check in another 3rd party @@ -27,10 +27,10 @@ Feature: UserGrants And Framework registers 'pinChallenge' test provider When '3rd party app' invokes the 'Firebolt' API to 'expect error while notifying watched content with only entityid' Then 'Firebolt' platform responds with 'invalid request for discovery watched' - When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' + When '3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' Then 'Firebolt' platform responds with 'false for capabilities granted' And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId When 'secondary 3rd party app' invokes the 'Firebolt' API to 'expect error while notifying watched content with only entityid' Then 'Firebolt' platform responds to 'secondary 3rd party app' with 'invalid request for discovery watched' - When 1st party app invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' + When 'secondary 3rd party app' invokes the 'Firebolt' API to 'check if capabilities is granted for discovery watched' Then 'Firebolt' platform responds to 'secondary 3rd party app' with 'false for capabilities granted' \ No newline at end of file From fc0aac960d6128fea558f58c52103f884fdb6d12 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 16 Jul 2024 09:30:13 +0530 Subject: [PATCH 282/359] addressed review comments for secureStorage TCs --- .../FireboltCertification/SecureStorage.feature | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/SecureStorage.feature b/cypress/TestCases/FireboltCertification/SecureStorage.feature index 6191fb82..fc5406d7 100644 --- a/cypress/TestCases/FireboltCertification/SecureStorage.feature +++ b/cypress/TestCases/FireboltCertification/SecureStorage.feature @@ -269,8 +269,8 @@ Feature: SecureStorage # validates the remaining value for 2nd app @Securestorage @coreSDK @sdk @transport Scenario Outline: SecureStorage.remove - Positive Scenario: Validate - And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId - Given '3rd party app' invokes the 'Firebolt' API to '' + Given 3rd party 'certification' app is launched with 'secondary 3rd party app' appId + And '3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds with 'null for updating a secure data value' And '3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds with '' @@ -287,7 +287,7 @@ Feature: SecureStorage When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with 'null for getting stored value' And 'secondary 3rd party app' invokes the 'Firebolt' API to '' - And 'Firebolt' platform responds to 'secondary 3rd party app' with '' + And 'Firebolt' platform responds to 'secondary 3rd party app' with 'null for getting stored value' When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with '' And 'secondary 3rd party app' invokes the 'Firebolt' API to '' @@ -308,8 +308,8 @@ Feature: SecureStorage # validates the null value for 2nd app @Securestorage @coreSDK @sdk @transport Scenario Outline: SecureStorage.clear - Positive Scenario: Clears all the data values - And 3rd party 'certification' app is launched with 'secondary 3rd party app' appId - Given '3rd party app' invokes the 'Firebolt' API to '' + Given 3rd party 'certification' app is launched with 'secondary 3rd party app' appId + And '3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds with 'null for updating a secure data value' And '3rd party app' invokes the 'Firebolt' API to '' And 'Firebolt' platform responds with 'null for updating a secure data value' From 2b23d21cb11d05bdf1f76cb667e938839d51c06b Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Tue, 16 Jul 2024 11:30:58 +0530 Subject: [PATCH 283/359] 2166 - Adding grantpolicy and key name changes --- .../AdditionalTestcases/UserGrants.feature | 6 +- .../Manage/UserGrantsManage.feature | 10 +- .../FireboltCertification/UserGrants.feature | 2 +- .../FireboltCertification/UserGrants.md | 22 +- .../fixtures/fireboltCalls/localization.json | 4 +- .../fixtures/fireboltCalls/usergrants.json | 2 +- cypress/fixtures/grantPolicy.json | 575 ++++++++++++++++++ cypress/fixtures/grantPolicyDependencies.json | 8 + 8 files changed, 610 insertions(+), 19 deletions(-) create mode 100644 cypress/fixtures/grantPolicy.json create mode 100644 cypress/fixtures/grantPolicyDependencies.json diff --git a/cypress/TestCases/FireboltCertification/AdditionalTestcases/UserGrants.feature b/cypress/TestCases/FireboltCertification/AdditionalTestcases/UserGrants.feature index 55b4b3ed..5e081271 100644 --- a/cypress/TestCases/FireboltCertification/AdditionalTestcases/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/AdditionalTestcases/UserGrants.feature @@ -28,6 +28,6 @@ Feature: UserGrants Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched And Framework registers 'pinChallenge' test provider - # use localization.laton capability which is not supported xrn:firebolt:capability:localization:location - When '3rd party app' invokes the 'Firebolt' API to 'expect error for localization latlon' - Then 'Firebolt' platform responds with 'not supported error for localization latlon' \ No newline at end of file + # Using a capability that is not supported + When '3rd party app' invokes the 'Firebolt' API to 'expect error for notsupported capability' + Then 'Firebolt' platform responds with 'not supported error for given capability' \ No newline at end of file diff --git a/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature b/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature index f325a0bb..030307a2 100644 --- a/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/UserGrantsManage.feature @@ -51,13 +51,13 @@ Feature: UserGrants_Manage Scenario Outline: Usergrants. - Positive Scenario: Given the environment has been set up for 'userGrants' tests And 3rd party 'certification' app is launched - And 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with '' - When 1st party app invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds to '1st party app' with '' + And 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' Examples: - | Scenario | Grant_Key | Grant_Method_Content | Key | Validation_Key | Method | + | Scenario | API_Key1 | Validation_Key1 | API_Key2 | Validation_Key2 | Method | | grant capability at device level | grant device distributor capability | null for usergrants grant | get usergrants for device | expected list of grants for device | grant R.5.1.5 | | grant capability at app level | grant device id capability | null for usergrants grant | get usergrants for 3rd party app | expected list of grants for 3rd party app | grant R.5.1.5 | | deny capability at device level | deny device distributor capability | null for usergrants deny | get usergrants for device | expected list of denied grants for device | deny R.5.1.6 | diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature index c0e788a1..9091ae1a 100644 --- a/cypress/TestCases/FireboltCertification/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -644,7 +644,7 @@ Feature: UserGrants When '3rd party app' invokes the 'Firebolt' API to 'get info of device info capability' And '3rd party app' invokes the 'Firebolt' API to 'check if device info capability is granted with role as use' And '3rd party app' invokes the 'Firebolt' API to 'check if device info capability is granted with role as manage' - Then 'Firebolt' platform responds to '1st party app' with 'granted for device info capability with role use' + Then 'Firebolt' platform responds to '1st party app' with 'default values for device info capability with role use' @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.request - Positive Scenario: Validate userGrants.request by deferring diff --git a/cypress/TestCases/FireboltCertification/UserGrants.md b/cypress/TestCases/FireboltCertification/UserGrants.md index a9daebcf..8d6336f7 100644 --- a/cypress/TestCases/FireboltCertification/UserGrants.md +++ b/cypress/TestCases/FireboltCertification/UserGrants.md @@ -4,12 +4,12 @@ Feature file for Firebolt Certification UserGrants Module. ## Purpose A module for managing grants given by the user. -## Pre requisites : +## Requirements : 1.**Grant Policies** * Grant Policies specify details like how long the grant lasts and what is the scope of the grant. -* We have to add the corresponding grantPolicy of the capability we are testing inside "grantPolicies" object within "capabilities" object of deviceManifest file. -* This object will be having the grantpolicy for manage, use and provide roles. - For eg:, for localization.postalCode, +* The corresponding grant policy of the capability being tested must be added inside the "grantPolicies" object within the "capabilities" object. +* This object will include the grant policy for different roles such as manage, use, and provide. + Example structure for a capability (e.g., localization.postalCode): "capabilities": { "supported": [ ... @@ -44,8 +44,8 @@ A module for managing grants given by the user. } 2.**Dependencies** - * Capabilities which are dependent on other grantPolicy, have to be added inside "dependencies" object of "capabilities" object. - * For eg:, if "discovery.watched" api has to use the grantPolicy of "app-usage", then we have to add the dependency as following : + * Capabilities which are dependent on other grant policies must be added inside "dependencies" object of "capabilities" object. + * Example structure for a capability with dependencies (e.g., discovery.watched depends on app-usage): "capabilities": { "supported": [ ... @@ -76,4 +76,12 @@ A module for managing grants given by the user. } } } - } \ No newline at end of file + } + +3.**Acknowledgement** + * The Acknowledgement capability enables a user to acknowledge a user grant by simply clicking a button. + * This requires additional implementation on the config module side. The prompt should appear for the user to acknowledge the challenge, allowing the grant to be either denied or granted based on user action. + +4.**Pin Challenge** +* The Pin Challenge capability enables a user to confirm that they are the account owner, or a delegate of, by responding to a numeric PIN challenge. +* This requires additional implementation on the config module side. The prompt should appear for the user to enter the PIN, allowing the grant to be either denied or granted based on user input. \ No newline at end of file diff --git a/cypress/fixtures/fireboltCalls/localization.json b/cypress/fixtures/fireboltCalls/localization.json index 55cdbed3..83afdb02 100644 --- a/cypress/fixtures/fireboltCalls/localization.json +++ b/cypress/fixtures/fireboltCalls/localization.json @@ -618,11 +618,11 @@ "content": "INVALID_REQUEST", "expectingError": true }, - "EXPECT_ERROR_FOR_LOCALIZATION_LATLON": { + "EXPECT_ERROR_FOR_NOTSUPPORTED_CAPABILITY": { "method": "localization.latlon", "expected": "error" }, - "NOT_SUPPORTED_ERROR_FOR_LOCALIZATION_LATLON": { + "NOT_SUPPORTED_ERROR_FOR_GIVEN_CAPABILITY": { "method": "localization.latlon", "validationJsonPath": "result", "content": "NOT_SUPPORTED", diff --git a/cypress/fixtures/fireboltCalls/usergrants.json b/cypress/fixtures/fireboltCalls/usergrants.json index 03402ccd..b803d8ef 100644 --- a/cypress/fixtures/fireboltCalls/usergrants.json +++ b/cypress/fixtures/fireboltCalls/usergrants.json @@ -535,7 +535,7 @@ "method": "manage_usergrants.request", "params": "USERGRANTS_REQUEST_DEVICE_INFO" }, - "GRANTED_FOR_DEVICE_INFO_CAPABILITY_WITH_ROLE_USE": { + "DEFAULT_VALUES_FOR_DEVICE_INFO_CAPABILITY_WITH_ROLE_USE": { "method": "usergrants.request", "validationJsonPath": "result", "content": "USERGRANTS_REQUEST_INFO_GRANTED_DEVICE_INFO" diff --git a/cypress/fixtures/grantPolicy.json b/cypress/fixtures/grantPolicy.json new file mode 100644 index 00000000..f8af286f --- /dev/null +++ b/cypress/fixtures/grantPolicy.json @@ -0,0 +1,575 @@ +{ + "xrn:firebolt:capability:account:id": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:fingerprint" + } + ] + }, + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + }, + { + "capability": "xrn:firebolt:capability:usergrant:acknowledgechallenge" + } + ] + } + ], + "scope": "device", + "lifespan": "appActive", + "overridable": false + } + }, + "xrn:firebolt:capability:device:make": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + }, + { + "capability": "xrn:firebolt:capability:usergrant:acknowledgechallenge" + } + ] + }, + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:fingerprint" + } + ] + } + ], + "scope": "app", + "lifespan": "appActive", + "overridable": false + } + }, + "xrn:firebolt:capability:metrics:media": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "seconds", + "lifespanTtl": 300, + "overridable": false + } + }, + "xrn:firebolt:capability:localization:postal-code": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "once", + "overridable": false + }, + "manage": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "once", + "overridable": false + }, + "provide": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "once", + "overridable": false + } + }, + "xrn:firebolt:capability:localization:country-code": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:acknowledgechallenge" + } + ] + } + ], + "scope": "app", + "lifespan": "appActive", + "overridable": false + } + }, + "xrn:firebolt:capability:device:distributor": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:acknowledgechallenge" + } + ] + } + ], + "scope": "device", + "lifespan": "appActive", + "overridable": false + } + }, + "xrn:firebolt:capability:localization:locality": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "forever", + "overridable": false + } + }, + "xrn:firebolt:capability:device:name": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "appActive", + "overridable": false + } + }, + "xrn:firebolt:capability:localization:latlon": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:fingerprint" + } + ] + }, + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "seconds", + "lifespanTtl": 60, + "overridable": false + } + }, + "xrn:firebolt:capability:device:sku": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:invalid:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + }, + { + "capability": "xrn:firebolt:capability:usergrant:acknowledgechallenge" + } + ] + } + ], + "scope": "app", + "lifespan": "seconds", + "lifespanTtl": 60, + "overridable": false + } + }, + "xrn:firebolt:capability:device:uid": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + }, + { + "capability": "xrn:firebolt:capability:invalid:acknowledgechallenge" + } + ] + } + ], + "scope": "app", + "lifespan": "seconds", + "lifespanTtl": 60, + "overridable": false + } + }, + "xrn:firebolt:capability:device:id": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:acknowledgechallenge" + } + ] + } + ], + "scope": "app", + "lifespan": "seconds", + "lifespanTtl": 60, + "overridable": false + } + }, + "xrn:firebolt:capability:device:model": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "powerActive", + "overridable": false + } + }, + "xrn:firebolt:capability:localization:language": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "seconds", + "lifespanTtl": 800, + "overridable": false + } + }, + "xrn:firebolt:capability:accessibility:closedcaptions": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "seconds", + "lifespanTtl": 80, + "overridable": false, + "privacySetting": { + "property": "privacy.allowWatchHistory", + "autoApplyPolicy": "always", + "updateProperty": true + } + } + }, + "xrn:firebolt:capability:token:device": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "appActive", + "overridable": false, + "privacySetting": { + "property": "privacy.allowWatchHistory", + "autoApplyPolicy": "allowed", + "updateProperty": true + } + } + }, + "xrn:firebolt:capability:accessibility:voiceguidance": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "appActive", + "overridable": false, + "privacySetting": { + "property": "privacy.allowWatchHistory", + "autoApplyPolicy": "disallowed", + "updateProperty": true + } + } + }, + "xrn:firebolt:capability:protocol:dial": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "appActive", + "overridable": false, + "privacySetting": { + "property": "privacy.allowWatchHistory", + "autoApplyPolicy": "never", + "updateProperty": true + } + } + }, + "xrn:firebolt:capability:profile:flags": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "appActive", + "overridable": false, + "privacySetting": { + "property": "privacy.allowWatchHistory", + "autoApplyPolicy": "never", + "updateProperty": false + } + } + }, + "xrn:firebolt:capability:data:app-usage": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "appActive", + "overridable": false + } + }, + "xrn:firebolt:capability:discovery:watched": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "device", + "lifespan": "appActive", + "overridable": false + } + }, + "xrn:firebolt:capability:storage:secure": { + "manage": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:acknowledgechallenge" + } + ] + } + ], + "scope": "app", + "lifespan": "appActive", + "overridable": false + } + }, + "xrn:firebolt:capability:account:uid": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:acknowledgechallenge" + } + ] + } + ], + "scope": "app", + "lifespan": "forever", + "overridable": false + }, + "manage": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:acknowledgechallenge" + } + ] + } + ], + "scope": "app", + "lifespan": "forever", + "overridable": false + }, + "provide": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:acknowledgechallenge" + } + ] + } + ], + "scope": "app", + "lifespan": "forever", + "overridable": false + } + }, + "xrn:firebolt:capability:localization:locale": { + "use": { + "options": [ + { + "steps": [ + { + "capability": "xrn:firebolt:capability:usergrant:pinchallenge", + "configuration": { + "pinSpace": "purchase" + } + } + ] + } + ], + "scope": "app", + "lifespan": "appActive", + "overridable": false, + "privacySetting": { + "property": "Privacy.allowWatchHistory", + "autoApplyPolicy": "allowed", + "updateProperty": true + } + } + } +} \ No newline at end of file diff --git a/cypress/fixtures/grantPolicyDependencies.json b/cypress/fixtures/grantPolicyDependencies.json new file mode 100644 index 00000000..9b97ce37 --- /dev/null +++ b/cypress/fixtures/grantPolicyDependencies.json @@ -0,0 +1,8 @@ +{ + "xrn:firebolt:capability:privacy:advertising": [ + "xrn:firebolt:capability:data:app-usage" + ], + "xrn:firebolt:capability:discovery:watch-next": [ + "xrn:firebolt:capability:data:app-usage" + ] +} From 55a89ee709ec590372ba602c507aab4143216776 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Tue, 16 Jul 2024 12:04:06 +0530 Subject: [PATCH 284/359] 2166 - fix lint errors --- cypress/TestCases/FireboltCertification/UserGrants.feature | 4 ++-- cypress/support/step_definitions/fireboltCalls.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/UserGrants.feature b/cypress/TestCases/FireboltCertification/UserGrants.feature index 9091ae1a..e6da0370 100644 --- a/cypress/TestCases/FireboltCertification/UserGrants.feature +++ b/cypress/TestCases/FireboltCertification/UserGrants.feature @@ -674,7 +674,7 @@ Feature: UserGrants And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as provide' Then 'Firebolt' platform responds to '1st party app' with 'deferred for account uid capability with role use' - # Call capabilities.request for account.uid with granting acknowledgeChallenge for role provide and validate by calling capabilities.info with same capability and check which role manage is granted and not any other role + # Call userGrants.request for account.uid with granting acknowledgeChallenge for role provide and validate by calling capabilities.info with same capability and check which role manage is granted and not any other role @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.request R.1.1 - Positive Scenario: Validate usergrants.request by granting for role provide Given the environment has been set up for 'userGrants' tests @@ -689,7 +689,7 @@ Feature: UserGrants And '3rd party app' invokes the 'Firebolt' API to 'check if account uid capability is granted with role as provide' Then 'Firebolt' platform responds to '1st party app' with 'granted for account uid capability with role provide' - # Call capabilities.request for account.uid with denying acknowledgeChallenge for role manage and validate by calling capabilities.info with same capability and check which role manage is denied + # Call userGrants.request for account.uid with denying acknowledgeChallenge for role manage and validate by calling capabilities.info with same capability and check which role manage is denied @Usergrants @coreSDK @sdk @transport @requiresPlatformImplementation Scenario: UserGrants.request R.1.2 - Negative Scenario: Validate usergrants.request by denying for role provide Given the environment has been set up for 'userGrants' tests diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 2a593150..7d250061 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -1097,8 +1097,8 @@ Given( * @example * When I reboot device */ - Given('I reboot device', () => { +Given('I reboot device', () => { fireLog.info(CONSTANTS.STEP_DEFINITION_NEEDS_TO_IMPLEMENT).then(() => { throw new Error(CONSTANTS.STEP_IMPLEMENTATION_MISSING); }); -}); \ No newline at end of file +}); From 6b83d02b0398a81805f679026d2edd981e61913d Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Tue, 16 Jul 2024 13:40:18 +0530 Subject: [PATCH 285/359] Addressed the comments --- .../Accessibility.feature | 2 +- .../Manage/ClosedCaptionsManage.feature | 29 ++++++++++--------- cypress/support/cypress-commands/commands.js | 15 ++++++---- cypress/support/cypress-support/src/utils.js | 3 -- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Accessibility.feature b/cypress/TestCases/FireboltCertification/Accessibility.feature index 37eb67f6..2992ca18 100644 --- a/cypress/TestCases/FireboltCertification/Accessibility.feature +++ b/cypress/TestCases/FireboltCertification/Accessibility.feature @@ -128,7 +128,7 @@ Feature: Accessibility | Set fontSize-1 | fontSize | 1 | | Set fontColor-#ffffff | fontColor | #ffffff | | Set fontEdge-raised | fontEdge | raised | - | Set fontEdgeColor-#7f7f7f | fontEdge | #7F7F7F | + | Set fontEdgeColor-#7f7f7f | fontEdgeColor | #7F7F7F | | Set backgroundColor-#000000 | backgroundColor | #000000 | | Set fontOpacity-100 | fontOpacity | 100 | | Set backgroundOpacity-100 | backgroundOpacity | 100 | diff --git a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature index ea004d25..d3d20edc 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature @@ -42,13 +42,14 @@ Feature: ClosedCaptions_Manage | Set textAlign-center | textAlign | center | | Set textAlign-right | textAlign | right | | Set textAlignVertical-top | textAlignVertical | top | + | Set textAlignVertical-middle | textAlignVertical | middle | | Set textAlignVertical-bottom | textAlignVertical | bottom | | Set preferredLanguages | preferredLanguages | spa,eng | | Set windowColor-white | windowColor | white | | Set windowOpacity-50 | windowOpacity | 50 | @ClosedCaptions @manageSDK - Scenario Outline: ClosedCaptions. - Positive Scenario: + Scenario Outline: ClosedCaptions. - Positive Scenario: with 'null' params Given we test the 'CLOSED_CAPTIONS_SETTINGS' getters and setters '' to 'null' When '1st party app' registers for the 'Firebolt' event And 1st party app invokes the 'Firebolt' API to set '' to 'null' @@ -58,19 +59,19 @@ Feature: ClosedCaptions_Manage And 'Firebolt' platform triggers '1st party app' event Examples: - | Method | - | fontFamily | - | fontSize | - | fontColor | - | fontEdge | - | fontEdgeColor | - | fontOpacity | - | backgroundColor | - | backgroundOpacity | - | textAlign | - | textAlignVerticalontColor | - | windowColor | - | windowOpacity | + | Method | + | fontFamily | + | fontSize | + | fontColor | + | fontEdge | + | fontEdgeColor | + | fontOpacity | + | backgroundColor | + | backgroundOpacity | + | textAlign | + | textAlignVertical | + | windowColor | + | windowOpacity | @ClosedCaptions @manageSDK Scenario Outline: ClosedCaptions. - Negative Scenario: expecting error diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 77482c92..8140b039 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -1070,12 +1070,15 @@ Cypress.Commands.add('methodOrEventResponseValidation', (validationType, request return path; } }); - validationPath - ? (validationJsonPath = validationPath) - : fireLog.assert( - false, - `Could not find the valid validation path from the validationJsonPath list - ${validationJsonPath}` - ); + if (validationPath) { + validationJsonPath = validationPath; + } else { + fireLog.info('Response: ', methodOrEventResponse); + fireLog.assert( + false, + `Could not find the valid validation path from the validationJsonPath list - ${validationJsonPath}` + ); + } } switch (scenario) { case CONSTANTS.REGEX: diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 4ab6266d..78e87a77 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -809,9 +809,6 @@ function parseValue(str) { if (str.includes(',')) { return str.split(','); } - if (/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(str)) { - return str; - } } return str; From 71c013612dd8e52c28a0bcd30ea46e046365f9a8 Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Tue, 16 Jul 2024 13:49:34 +0530 Subject: [PATCH 286/359] Added minor change --- cypress/support/cypress-commands/commands.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 8140b039..0abee173 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -1070,15 +1070,12 @@ Cypress.Commands.add('methodOrEventResponseValidation', (validationType, request return path; } }); - if (validationPath) { - validationJsonPath = validationPath; - } else { - fireLog.info('Response: ', methodOrEventResponse); - fireLog.assert( - false, - `Could not find the valid validation path from the validationJsonPath list - ${validationJsonPath}` - ); - } + validationPath + ? (validationJsonPath = validationPath) + : fireLog.assert( + false, + `Could not find the valid validation path from the validationJsonPath list - ${JSON.stringify(validationJsonPath)}` + ); } switch (scenario) { case CONSTANTS.REGEX: From 48938322e555d308944c613af05c2f8ee01496b6 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 16 Jul 2024 13:56:38 +0530 Subject: [PATCH 287/359] Updated lifecycleApi testType conditions --- cypress/support/cypress-commands/commands.js | 5 +---- cypress/support/step_definitions/testSetup.js | 3 --- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 297ca6ae..6cb69cae 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -686,10 +686,7 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { params: { [CONSTANTS.APP_ID]: appId, [CONSTANTS.INTENT]: messageIntent }, }; } - if ( - Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLEAPI || - Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE - ) { + if (Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE) { data = { query: { params: { diff --git a/cypress/support/step_definitions/testSetup.js b/cypress/support/step_definitions/testSetup.js index 83bb2065..de401c58 100644 --- a/cypress/support/step_definitions/testSetup.js +++ b/cypress/support/step_definitions/testSetup.js @@ -35,9 +35,6 @@ Given('the environment has been set up for {string} tests', (test) => { ) { Cypress.env(CONSTANTS.PREVIOUS_TEST_TYPE, Cypress.env(CONSTANTS.TEST_TYPE)); Cypress.env(CONSTANTS.TEST_TYPE, test); - if (test.toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLEAPI) { - Cypress.env(CONSTANTS.LIFECYCLE_VALIDATION, true); - } if (test == CONSTANTS.SETUPCHECK) { UTILS.getSetupDetails(); From bd97df93c4e170c87a17410fa22a2b55a1d3cd22 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 16 Jul 2024 18:51:23 +0530 Subject: [PATCH 288/359] updated miscValidation logs --- cypress/support/cypress-commands/assertion.js | 33 ++++++++--------- .../advertisingMiscValidation.js | 36 +++++++++---------- 2 files changed, 32 insertions(+), 37 deletions(-) diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index 9be7a485..3c5d9b7c 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -141,10 +141,11 @@ Cypress.Commands.add( let pretext = CONSTANTS.ERROR_MESSAGE_VALIDATION + `for ${method} : `; if (checkErrorMessage) { pretext = pretext + `Error message present in list of expected error messages`; + fireLog.assert(true, pretext); } else { pretext = pretext + `Error message not present in list of expected error messages`; + fireLog.assert(false, pretext); } - fireLog.equal(checkErrorMessage, true, pretext); }); } else { fireLog.assert(false, `Expected error content not found in ${errorContentFilePath}`); @@ -193,7 +194,7 @@ Cypress.Commands.add( ' to be ' + JSON.stringify(expected); if (apiResponseContent != expected) { - throw new Error(`${pretext}`); + fireLog.assert(false, pretext); } else { fireLog.info(`${pretext}`); } @@ -455,10 +456,14 @@ function loggingValidationCheckResult(validationCheck) { // Assume the checks. If anything is marked other than skipped or pass, then fail the testcase. validationCheck.forEach((assertion) => { if (assertion.validationStatus == CONSTANTS.SKIPPED) { - fireLog.info(`${assertion.validationPoint}: ${assertion.validationStatus}`); + cy.log( + `${assertion.validationPoint}: ${assertion.validationStatus}. ${assertion.message}`, + 'loggingValidationCheckResult' + ); } else { - fireLog.info( - `${assertion.validationPoint}: ${assertion.validationStatus} ${assertion.message}` + cy.log( + `${assertion.validationPoint}: ${assertion.validationStatus}. ${assertion.message}`, + 'loggingValidationCheckResult' ); if (assertion.validationStatus == CONSTANTS.FAIL) { throw new Error(`${assertion.validationPoint} failed, ${assertion.message}`); @@ -466,7 +471,6 @@ function loggingValidationCheckResult(validationCheck) { } }); } - /** * @module assertion * @function validateEvent @@ -609,19 +613,12 @@ Cypress.Commands.add( expected = eval('extractEventObject.' + verifyPath); } } else { - if (extractEventObject && eval('extractEventObject.' + verifyPath)) { - expected = eval('extractEventObject.' + verifyPath); - } else if (!extractEventObject) { - throw new Error('Event Not Received'); - } else { - throw new Error('Event Not Received'); - } + expected = eval('extractEventObject.' + verifyPath); } - let expectedValue = expected; - let actualValue = actual; - typeof expected == 'object' ? (expectedValue = JSON.stringify(expected)) : expected; - typeof actual == 'object' ? (actualValue = JSON.stringify(actual)) : actual; - pretext = pretext + ' expected ' + actualValue + ' to be ' + expectedValue; + const expectedValue = expected; + const actualValue = actual; + typeof expected == 'object' ? (expected = JSON.stringify(expected)) : expected; + typeof actual == 'object' ? (actual = JSON.stringify(actual)) : actual; fireLog.deepEqual(expectedValue, actualValue, pretext); } ); diff --git a/cypress/support/validations/moduleValidations/advertisingMiscValidation.js b/cypress/support/validations/moduleValidations/advertisingMiscValidation.js index 2c1cb988..9cc3fd05 100644 --- a/cypress/support/validations/moduleValidations/advertisingMiscValidation.js +++ b/cypress/support/validations/moduleValidations/advertisingMiscValidation.js @@ -51,18 +51,19 @@ function validateAdvertisingAdvertisingId(method, validationTypeObject, apiOrEve const pretext = `${CONSTANTS.METHOD_CONTENT} for ${method} method : `; // Ifa is an advertising identifier and it should not be empty. - cy.log(`${pretext} Ifa is not null or undefined`, 'validateAdvertisingAdvertisingId').then(() => { - assert.exists(response.ifa, `${pretext} : Is not null or undefined`); - }); + cy.log(`${pretext} Ifa value is not null or undefined`, 'validateAdvertisingAdvertisingId').then( + () => { + assert.exists(response.ifa, `${pretext} : Is not null or undefined`); + } + ); switch (ScenarioType) { case CONSTANTS.LIMITADTRACKING_ON: // lmt value equal to 1 when limitAdTracking is on cy.log( - `${pretext} Expected Lmt value ` + - response.lmt + - ` equal to be ` + - CONSTANTS.ADVERTISING_LIMITIADTRACKING_ON_LMT, + `${pretext} Expected Lmt value : ${CONSTANTS.ADVERTISING_LIMITIADTRACKING_ON_LMT},` + + ` Actual value : ` + + response.lmt, 'validateAdvertisingAdvertisingId' ).then(() => { assert.equal( @@ -73,10 +74,9 @@ function validateAdvertisingAdvertisingId(method, validationTypeObject, apiOrEve }); if (response.ifa_type) { cy.log( - `${pretext} Expected Ifa_type value ` + - response.ifa_type + - ` equal to be ` + - CONSTANTS.ADVERTISINGID_LIMITIADTRACKING_ON_IFA_TYPE, + `${pretext} Expected Ifa_type value : ${CONSTANTS.ADVERTISINGID_LIMITIADTRACKING_ON_IFA_TYPE}, ` + + ` Actual value : ` + + response.ifa_type, 'validateAdvertisingAdvertisingId' ).then(() => { assert.equal( @@ -90,10 +90,9 @@ function validateAdvertisingAdvertisingId(method, validationTypeObject, apiOrEve case CONSTANTS.LIMITADTRACKING_OFF: // lmt value equal to 0 when limitAdTracking is off cy.log( - `${pretext} Expected Lmt value ` + - response.lmt + - ` equal to be ` + - CONSTANTS.ADVERTISING_LIMITIADTRACKING_OFF_LMT, + `${pretext} Expected Lmt value : ${CONSTANTS.ADVERTISING_LIMITIADTRACKING_OFF_LMT},` + + ` Actual value : ` + + response.lmt, 'validateAdvertisingAdvertisingId' ).then(() => { assert.equal( @@ -104,10 +103,9 @@ function validateAdvertisingAdvertisingId(method, validationTypeObject, apiOrEve }); if (response.ifa_type) { cy.log( - `${pretext} Expected Ifa_type value ` + - response.ifa_type + - ` equal to be ` + - CONSTANTS.ADVERTISINGID_LIMITIADTRACKING_OFF_IFA_TYPE, + `${pretext} Expected Ifa_type value : ${CONSTANTS.ADVERTISINGID_LIMITIADTRACKING_OFF_IFA_TYPE}, ` + + ` Actual value : ` + + response.ifa_type, 'validateAdvertisingAdvertisingId' ).then(() => { assert.equal( From 9f34bfd701ec6bae9b652061f4d724767f5688eb Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 16 Jul 2024 19:07:45 +0530 Subject: [PATCH 289/359] removed unwanted logs --- cypress/support/cypress-commands/assertion.js | 3 +-- cypress/support/validations/decodeValidation.js | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index 3c5d9b7c..42cfa5ba 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -337,7 +337,7 @@ Cypress.Commands.add('errorNullCheck', (response, errorExpected, isNullCheckSkip let validationStatus = CONSTANTS.PASS; let message = ''; const isForcedSkip = false; - + errorExpected == CONSTANTS.ERROR // If isNullCheckSkipped is true, skip the null check error since it passed the schema validation check. // If isNullCheckSkipped is false and the error expected is false, the error property in the response should be null. If it is other than null, the check should fail. // If isNullCheckSkipped is false and the error expected is true, the error property in the response should not be null. If it is null, the check should fail. @@ -649,7 +649,6 @@ Cypress.Commands.add( fireLog.info('Event Received Check : ' + eventReceivedCheck); fireLog.info('Event Schema Check : ' + schemaCheck); - // fireLog.info('Event Content Check : ' + contentCheck); } ); diff --git a/cypress/support/validations/decodeValidation.js b/cypress/support/validations/decodeValidation.js index a91deaa0..5b87fe34 100644 --- a/cypress/support/validations/decodeValidation.js +++ b/cypress/support/validations/decodeValidation.js @@ -163,7 +163,6 @@ class decodeValidations { `Regular Expression Validation: expected ${param} to be in a valid ${regexFormat} format`, 'decodeBase64AndJwtToken' ).then(() => { - // assert.equal(true, resultSet, 'RegEx Validation:'); if (resultSet == false) { throw new Error(`RegEx Validation failed for ${param} value`); } else { From b75b56bebbe774181eae962ac3b3bc9993f7f4a4 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 16 Jul 2024 19:13:53 +0530 Subject: [PATCH 290/359] removed unwanted logs --- cypress/support/cypress-commands/assertion.js | 1 - 1 file changed, 1 deletion(-) diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index 42cfa5ba..a56a34a9 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -337,7 +337,6 @@ Cypress.Commands.add('errorNullCheck', (response, errorExpected, isNullCheckSkip let validationStatus = CONSTANTS.PASS; let message = ''; const isForcedSkip = false; - errorExpected == CONSTANTS.ERROR // If isNullCheckSkipped is true, skip the null check error since it passed the schema validation check. // If isNullCheckSkipped is false and the error expected is false, the error property in the response should be null. If it is other than null, the check should fail. // If isNullCheckSkipped is false and the error expected is true, the error property in the response should not be null. If it is null, the check should fail. From d6da96cf96b759482fcd1625c4ecccf26d68ad6f Mon Sep 17 00:00:00 2001 From: Abhishek urs C J Date: Tue, 16 Jul 2024 21:20:56 +0530 Subject: [PATCH 291/359] resolved merge conflicts --- cypress/support/step_definitions/fireboltCalls.js | 1 - 1 file changed, 1 deletion(-) diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 2afdf0e7..2e839ec6 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -115,7 +115,6 @@ Given( }); } ); - /** * @module fireboltCalls From cae436ee2ee19213088f1f49578f7d2f77660cb0 Mon Sep 17 00:00:00 2001 From: anjalimukundan Date: Tue, 16 Jul 2024 21:24:35 +0530 Subject: [PATCH 292/359] reverted lifecycle TC changes --- .../LifecycleTestcases/Lifecycle.feature | 8 ++++---- cypress/support/cypress-commands/commands.js | 6 +++++- cypress/support/step_definitions/testSetup.js | 4 ++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/LifecycleTestcases/Lifecycle.feature b/cypress/TestCases/FireboltCertification/LifecycleTestcases/Lifecycle.feature index ace8806c..084cc972 100644 --- a/cypress/TestCases/FireboltCertification/LifecycleTestcases/Lifecycle.feature +++ b/cypress/TestCases/FireboltCertification/LifecycleTestcases/Lifecycle.feature @@ -20,14 +20,14 @@ Feature: Lifecycle @Lifecycle @sdk @transport @coreSDK @regression Scenario: Lifecycle R*4.6 Validate lifecycle.state - Get the current state - Given the environment has been set up for 'lifeCycleApi' tests + Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to 'fetch lifecycle state' Then 'Firebolt' platform responds with 'foreground for lifecycle state' @Lifecycle @coreSDK @regression @sdk @transport Scenario Outline: Lifecycle R*4.3 Validate lifecycle.close - '' expecting error - Given the environment has been set up for 'lifeCycleApi' tests + Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with '' @@ -47,7 +47,7 @@ Feature: Lifecycle @Lifecycle @coreSDK @regression @sdk @transport Scenario Outline: Lifecycle R*4.3 Validate lifecycle.close - Positive Scenario - '' - Given the environment has been set up for 'lifeCycleApi' tests + Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds with 'null for lifecycle close' @@ -61,7 +61,7 @@ Feature: Lifecycle @Lifecycle @sdk @transport @coreSDK @regression Scenario: Lifecycle R*4.5 Validate 'lifecycle.finished' - expecting error - Given the environment has been set up for 'lifeCycleApi' tests + Given the environment has been set up for 'lifecycle' tests And 3rd party 'certification' app is launched When '3rd party app' invokes the 'Firebolt' API to 'notify that the app is done unloading' Then 'Firebolt' platform responds with 'error for lifecycle finished' diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 4ad115a4..cb708527 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -674,7 +674,11 @@ Cypress.Commands.add('launchApp', (appType, appCallSign) => { }, }; } - if (Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE) { + // If testType == lifecycle, modifying data to include lifecycle_validation = true in the intent to be sent to the app + if ( + Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLEAPI || + Cypress.env(CONSTANTS.TEST_TYPE).toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLE + ) { data = { query: { params: { diff --git a/cypress/support/step_definitions/testSetup.js b/cypress/support/step_definitions/testSetup.js index de401c58..9101d340 100644 --- a/cypress/support/step_definitions/testSetup.js +++ b/cypress/support/step_definitions/testSetup.js @@ -36,6 +36,10 @@ Given('the environment has been set up for {string} tests', (test) => { Cypress.env(CONSTANTS.PREVIOUS_TEST_TYPE, Cypress.env(CONSTANTS.TEST_TYPE)); Cypress.env(CONSTANTS.TEST_TYPE, test); + if (test.toLowerCase() == CONSTANTS.MODULE_NAMES.LIFECYCLEAPI) { + Cypress.env(CONSTANTS.LIFECYCLE_VALIDATION, true); + } + if (test == CONSTANTS.SETUPCHECK) { UTILS.getSetupDetails(); } From d9a86ec23010416a6bec3f47f45f83bd33935cb1 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Wed, 17 Jul 2024 15:55:05 +0530 Subject: [PATCH 293/359] Revert null TC changes and adding missing changes --- .../Accessibility.feature | 43 +++++++++---------- .../Manage/ClosedCaptionsManage.feature | 41 +++++++++--------- cypress/support/cypress-commands/commands.js | 5 ++- cypress/support/cypress-support/src/utils.js | 37 +++++++++++++++- .../support/step_definitions/fireboltCalls.js | 1 + 5 files changed, 80 insertions(+), 47 deletions(-) diff --git a/cypress/TestCases/FireboltCertification/Accessibility.feature b/cypress/TestCases/FireboltCertification/Accessibility.feature index 2992ca18..1beb86d8 100644 --- a/cypress/TestCases/FireboltCertification/Accessibility.feature +++ b/cypress/TestCases/FireboltCertification/Accessibility.feature @@ -51,30 +51,29 @@ Feature: Accessibility | Set preferredLanguages | preferredLanguages | spa,eng | @Accessibility @coreSDK @sdk @transport - Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: with 'null' params - Given we test the 'ACCESSIBILITY_CLOSEDCAPTIONS_SETTINGS' getters and setters '' to 'null' - When '3rd party app' registers for the 'Firebolt' event - When '3rd party app' invokes the 'Firebolt' get API - Given 1st party app invokes the 'Firebolt' API to set '' to 'null' - And 'Firebolt' platform responds to '1st party app' set API - When '3rd party app' invokes the 'Firebolt' get API - And 'Firebolt' platform responds to '3rd party app' get API - And 'Firebolt' platform triggers '3rd party app' event + Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: with 'null' params + When '3rd party app' registers for the 'accessibility onClosedCaptionsSettingsChanged' event using the 'Firebolt' API + And '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' + And 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When '3rd party app' invokes the 'Firebolt' API to 'get closedCaptions settings' + Then 'Firebolt' platform responds with '' + And 'Firebolt' platform triggers event '' Examples: - | Method | - | fontFamily | - | fontSize | - | fontColor | - | fontEdge | - | fontEdgeColor | - | fontOpacity | - | backgroundColor | - | backgroundOpacity | - | textAlign | - | textAlignVertical | - | windowColor | - | windowOpacity | + | Scenario | Key | Method_Content | Event_Content | + | fontFamily | set fontFamily as null | default value for fontFamily | onclosedCaptionsSettingsChanged with default value for fontfamily | + | fontSize | set fontSize as null | default value for fontSize | onclosedCaptionsSettingsChanged with default value for fontSize | + | fontColor | set fontColor as null | default value for fontColor | onclosedCaptionsSettingsChanged with default value for fontColor | + | fontEdge | set fontEdge as null | default value for fontEdge | onclosedCaptionsSettingsChanged with default value for fontEdge | + | fontEdgeColor | set fontEdgeColor as null | default value for fontEdgeColor | onclosedCaptionsSettingsChanged with default value for fontEdgeColor | + | fontOpacity | set fontOpacity as null | default value for fontOpacity | onclosedCaptionsSettingsChanged with default value for fontOpacity | + | backgroundColor | set backgroundColor as null | default value for backgroundColor | onclosedCaptionsSettingsChanged with default value for backgroundColor | + | backgroundOpacity | set backgroundOpacity as null | default value for backgroundOpacity | onclosedCaptionsSettingsChanged with default value for backgroundOpacity | + | textAlign | set textAlign as null | default value for textAlign | onclosedCaptionsSettingsChanged with default value for textAlign | + | textAlignVertical | set textAlignVertical as null | default value for textAlignVertical | onclosedCaptionsSettingsChanged with default value for textAlignVertical | + | windowColor | set windowColor as null | default value for windowColor | onclosedCaptionsSettingsChanged with default value for windowColor | + | windowOpacity | set windowOpacity as null | default value for windowOpacity | onclosedCaptionsSettingsChanged with default value for windowOpacity | @Accessibility @coreSDK @sdk @transport Scenario Outline: Accessibility.voiceGuidanceSettings - Positive Scenario: diff --git a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature index d3d20edc..a7a31916 100644 --- a/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/ClosedCaptionsManage.feature @@ -49,29 +49,28 @@ Feature: ClosedCaptions_Manage | Set windowOpacity-50 | windowOpacity | 50 | @ClosedCaptions @manageSDK - Scenario Outline: ClosedCaptions. - Positive Scenario: with 'null' params - Given we test the 'CLOSED_CAPTIONS_SETTINGS' getters and setters '' to 'null' - When '1st party app' registers for the 'Firebolt' event - And 1st party app invokes the 'Firebolt' API to set '' to 'null' - Then 'Firebolt' platform responds to '1st party app' set API - When '1st party app' invokes the 'Firebolt' get API - Then 'Firebolt' platform responds to '1st party app' get API - And 'Firebolt' platform triggers '1st party app' event + Scenario Outline: Closedcaptions. - Positive Scenario: with 'null' params + When 1st party app registers for the '' event using the 'Firebolt' API + And 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' for '' + When 1st party app invokes the 'Firebolt' API to '' + Then 'Firebolt' platform responds to '1st party app' with '' + And 'Firebolt' platform triggers to '1st party app' with '' Examples: - | Method | - | fontFamily | - | fontSize | - | fontColor | - | fontEdge | - | fontEdgeColor | - | fontOpacity | - | backgroundColor | - | backgroundOpacity | - | textAlign | - | textAlignVertical | - | windowColor | - | windowOpacity | + | Scenario | Method | Set_API_Key | API_Key | Method_Validation_Key | Event_Validation_Key | Event | + | fontFamily | fontFamily | set fontFamily as null | get fontFamily | default value for fontFamily in closedcaptions | onFontFamilyChanged for closedcaptions with default value | closedcaptions onFontFamilyChanged | + | fontSize | fontSize | set fontSize as null | get fontSize | default value for fontSize in closedcaptions | onFontSizeChanged for closedcaptions with default value | closedcaptions onFontSizeChanged | + | fontColor | fontColor | set fontColor as null | get fontColor | default value for fontColor in closedcaptions | onFontColorChanged for closedcaptions with default value | closedcaptions onFontColorChanged | + | fontEdge | fontEdge | set fontEdge as null | get fontEdge | default value for fontEdge in closedcaptions | onFontEdgeChanged for closedcaptions with default value | closedcaptions onFontEdgeChanged | + | fontEdgeColor | fontEdgeColor | set fontEdgeColor as null | get fontEdgeColor | default value for fontEdgeColor in closedcaptions | onFontEdgeColorChanged for closedcaptions with default value | closedcaptions onFontEdgeColorChanged | + | fontOpacity | fontOpacity | set fontOpacity as null | get fontOpacity | default value for fontOpacity in closedcaptions | onFontOpacityChanged for closedcaptions with default value | closedcaptions onFontOpacityChanged | + | backgroundColor | backgroundColor | set backgroundColor as null | get backgroundColor | default value for backgroundColor in closedcaptions | onBackgroundColorChanged for closedcaptions with default value | closedcaptions onBackgroundColorChanged | + | backgroundOpacity | backgroundOpacity | set backgroundOpacity as null | get backgroundOpacity | default value for backgroundOpacity in closedcaptions | onBackgroundOpacityChanged for closedcaptions with default value | closedcaptions onBackgroundOpacityChanged | + | textAlign | textAlign | set textAlign as null | get textAlign | default value for textAlign in closedcaptions | onTextAlignChanged for closedcaptions with default value | closedcaptions onTextAlignChanged | + | textAlignVertical | textAlignVertical | set textAlignVertical as null | get textAlignVertical | default value for textAlignVertical in closedcaptions | onTextAlignVerticalChanged for closedcaptions with default value | closedcaptions onTextAlignVerticalChanged | + | windowColor | windowColor | set windowColor as null | get windowColor | default value for windowColor in closedcaptions | onWindowColorChanged for closedcaptions with default value | closedcaptions onWindowColorChanged | + | windowOpacity | windowOpacity | set windowOpacity as null | get windowOpacity | default value for windowOpacity in closedcaptions | onWindowOpacityChanged for closedcaptions with default value | closedcaptions onWindowOpacityChanged | @ClosedCaptions @manageSDK Scenario Outline: ClosedCaptions. - Negative Scenario: expecting error diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 60deb9d0..9502231f 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -845,6 +845,7 @@ Cypress.Commands.add('clearCache', () => { */ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, requestData, task) => { const { method, params, context, action, expected, appId } = requestData; + const deviceIdentifier = requestData.deviceIdentifier task = task ? task : CONSTANTS.TASK.CALLMETHOD; let isNotSupportedApi = false; @@ -870,8 +871,8 @@ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, requestData, task) = // Adding additional details to created intent if any platform specific data is present in configModule. cy.runIntentAddon(task, intentMessage).then((parsedIntent) => { - const requestTopic = UTILS.getTopic(appId); - const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE); + const requestTopic = UTILS.getTopic(appId, null, deviceIdentifier); + const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE, deviceIdentifier); cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent); }); } else if (target === CONSTANTS.PLATFORM) { diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index b277598a..e21abc12 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -182,9 +182,9 @@ function overideParamsFromConfigModule(overrideParams) { * @description Function to fetch the required topics. */ -function getTopic(appIdentifier = null, operation = null) { +function getTopic(appIdentifier = null, operation = null, deviceIdentifier) { let topic; - let deviceMac = getEnvVariable(CONSTANTS.DEVICE_MAC); + let deviceMac = deviceIdentifier ? deviceIdentifier : getEnvVariable(CONSTANTS.DEVICE_MAC); if (deviceMac.length <= 5 || !deviceMac || deviceMac == undefined) { assert( false, @@ -803,6 +803,11 @@ function parseValue(str) { if (str === 'false') return false; if (!isNaN(str)) return Number(str); + + // If the string contains comma, split it into an array + if (str.includes(',')) { + return str.split(','); + } } return str; @@ -880,6 +885,33 @@ global.resolveAtRuntime = function (input) { }; }; + +/** + * @module utils + * @function resolveRecursiveValues + * @description A Function that recursively check each fields and invoke if it is a function within an array or object. + * @param {*} input - value which need to resolved and it may be string/object/array/function + * @example + * resolveRecursiveValues(function()) + */ + function resolveRecursiveValues(input) { + if (Array.isArray(input)) { + return input.map((item) => resolveRecursiveValues(item)); + } else if (typeof input == CONSTANTS.TYPE_OBJECT && input !== null) { + const newObj = {}; + for (const key in input) { + if (Object.hasOwnProperty.call(input, key)) { + newObj[key] = resolveRecursiveValues(input[key]); + } + } + return newObj; + } else if (input && typeof input === CONSTANTS.TYPE_FUNCTION) { + return input(); + } else { + return input; + } +} + module.exports = { replaceJsonStringWithEnvVar, createIntentMessage, @@ -905,4 +937,5 @@ module.exports = { fireLog, parseValue, checkForSecondaryAppId, + resolveRecursiveValues, }; diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index 2e839ec6..e276f540 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -104,6 +104,7 @@ Given( cy.fetchLifecycleHistory(appId); } parsedData.appId = appId; + parsedData.deviceIdentifier = deviceIdentifier; fireLog.info( `Call from app: ${appId}, device: ${deviceIdentifier || UTILS.getEnvVariable(CONSTANTS.DEVICE_MAC)} - method: ${parsedData.method} params: ${JSON.stringify(parsedData.params)}` From d701090fa60fcf768353f40a4a169f9620385477 Mon Sep 17 00:00:00 2001 From: "preethi.m" Date: Wed, 17 Jul 2024 16:22:12 +0530 Subject: [PATCH 294/359] fixing lint errors --- cypress/support/cypress-commands/commands.js | 4 ++-- cypress/support/cypress-support/src/utils.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 9502231f..a82bf921 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -845,7 +845,7 @@ Cypress.Commands.add('clearCache', () => { */ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, requestData, task) => { const { method, params, context, action, expected, appId } = requestData; - const deviceIdentifier = requestData.deviceIdentifier + const deviceIdentifier = requestData.deviceIdentifier; task = task ? task : CONSTANTS.TASK.CALLMETHOD; let isNotSupportedApi = false; @@ -871,7 +871,7 @@ Cypress.Commands.add('sendMessageToPlatformOrApp', (target, requestData, task) = // Adding additional details to created intent if any platform specific data is present in configModule. cy.runIntentAddon(task, intentMessage).then((parsedIntent) => { - const requestTopic = UTILS.getTopic(appId, null, deviceIdentifier); + const requestTopic = UTILS.getTopic(appId, null, deviceIdentifier); const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE, deviceIdentifier); cy.sendMessagetoApp(requestTopic, responseTopic, parsedIntent); }); diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index e21abc12..203643c2 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -885,7 +885,6 @@ global.resolveAtRuntime = function (input) { }; }; - /** * @module utils * @function resolveRecursiveValues @@ -894,7 +893,7 @@ global.resolveAtRuntime = function (input) { * @example * resolveRecursiveValues(function()) */ - function resolveRecursiveValues(input) { +function resolveRecursiveValues(input) { if (Array.isArray(input)) { return input.map((item) => resolveRecursiveValues(item)); } else if (typeof input == CONSTANTS.TYPE_OBJECT && input !== null) { From 13d915eafc7ce12fe90592ead14b393604e4e929 Mon Sep 17 00:00:00 2001 From: bpvstaty366 <148532497+bpvstaty366@users.noreply.github.com> Date: Wed, 17 Jul 2024 18:59:48 +0300 Subject: [PATCH 295/359] Firelog does not work without child assertion function (#114) * make FireLog work as a function * update fireLog * minor fix * minor fix * minor change * update fireLog message * update fireLog message * minor change for fireLog * add fireLog fail * minor fix * add change to fireLog * minor fix * minor fix --- cypress/support/constants/constants.js | 1 + cypress/support/cypress-commands/assertion.js | 18 ++--- cypress/support/cypress-commands/commands.js | 10 +-- cypress/support/cypress-support/src/utils.js | 81 +++++++++++++++---- .../support/step_definitions/fireboltCalls.js | 4 +- 5 files changed, 78 insertions(+), 36 deletions(-) diff --git a/cypress/support/constants/constants.js b/cypress/support/constants/constants.js index 0d7338be..1b55f6cb 100644 --- a/cypress/support/constants/constants.js +++ b/cypress/support/constants/constants.js @@ -95,6 +95,7 @@ module.exports = { EMAIL: 'email', ENV_PLATFORM_SDK_VERSION: 'platformSdkVersion', ERROR: 'error', + ERROR_CODE: 'Error code', ERROR_CONTENT_JSON_PATH: 'objects/errorObjects/errorContent.json', ERROR_CONTENT_OBJECTS_PATH: 'cypress/fixtures/objects/errorObjects/errorContent.json', ERROR_EXPECTED: 'Expected response.error not to be null', diff --git a/cypress/support/cypress-commands/assertion.js b/cypress/support/cypress-commands/assertion.js index b943eb6d..45215c19 100644 --- a/cypress/support/cypress-commands/assertion.js +++ b/cypress/support/cypress-commands/assertion.js @@ -18,7 +18,6 @@ const CONSTANTS = require('../constants/constants'); const { _ } = Cypress; import UTILS from '../cypress-support/src/utils'; - /** * @module assertion * @function validateErrorObject @@ -139,13 +138,13 @@ Cypress.Commands.add( const checkErrorMessage = errorContentObject.errorMessage.some((errorMessage) => apiErrorResponse.message.includes(errorMessage) ); - fireLog.equal(checkErrorMessage, true, 'Error Message Validation: '); + fireLog.equal(checkErrorMessage, true, 'Error Message Validation:'); }); } else { - fireLog.assert(false, `Expected error content not found in ${errorContentFilePath}`); + fireLog.fail(`Expected error content not found in ${errorContentFilePath}`); } } catch (error) { - fireLog.assert(false, 'Failed to validate error: ' + error); + fireLog.fail(error.message); } } } @@ -178,14 +177,7 @@ Cypress.Commands.add( cy.validateEvent(extractedApiObject, context, validationPath, expected, appId); } else { const apiResponseContent = eval(CONSTANTS.EXTRACTEDAPI_PATH + validationPath); - const pretext = - CONSTANTS.METHOD_CONTENT + - ' expected ' + - JSON.stringify(apiResponseContent) + - ' to be ' + - JSON.stringify(expected); - // Executing fireLog.deepEqual() after logging - fireLog.deepEqual(apiResponseContent, expected, pretext); + fireLog.deepEqual(apiResponseContent, expected, CONSTANTS.METHOD_CONTENT); } } ); @@ -660,7 +652,7 @@ Cypress.Commands.add( (response, methodOrEventObject, eventName, eventExpected) => { const eventNameForLog = eventName.split('-')[0]; if (!response) { - fireLog.assert(false, `Event response not received for ${eventNameForLog}`); + fireLog.fail(`Event response not received for ${eventNameForLog}`); } if (response.error) { fireLog.isNull(response.error, 'Expected event response.error to be null'); diff --git a/cypress/support/cypress-commands/commands.js b/cypress/support/cypress-commands/commands.js index 0494349f..48feb499 100644 --- a/cypress/support/cypress-commands/commands.js +++ b/cypress/support/cypress-commands/commands.js @@ -43,7 +43,7 @@ Cypress.Commands.add( fireboltData = UTILS.getEnvVariable(CONSTANTS.COMBINEDFIREBOLTCALLS)[key]; } if (!fireboltData) { - fireLog.assert(false, CONSTANTS.NO_DATA_FOR_THE_KEY + key); + fireLog.fail(CONSTANTS.NO_DATA_FOR_THE_KEY + key); } return fireboltData; } @@ -112,7 +112,7 @@ Cypress.Commands.add('fireboltDataParser', (key, sdk = CONSTANTS.SUPPORTED_SDK[0 }); }); } else { - fireLog.assert(false, `${sdk} SDK not Supported`); + fireLog.fail(`${sdk} SDK not Supported`); } }); @@ -404,7 +404,7 @@ Cypress.Commands.add('getBeforeOperationObject', () => { } }); } else { - fireLog.assert(false, CONSTANTS.BEFORE_OPERATION_FORMAT); + fireLog.fail(CONSTANTS.BEFORE_OPERATION_FORMAT); } } }); @@ -419,7 +419,7 @@ Cypress.Commands.add('getBeforeOperationObject', () => { */ Cypress.Commands.add('setResponse', (beforeOperation, scenarioName) => { if (!beforeOperation) { - fireLog.assert(false, 'Before operation object is null/undefined - setResponse'); + fireLog.fail('Before operation object is null/undefined - setResponse'); } let firstParty; if (beforeOperation.hasOwnProperty('firstParty')) { @@ -587,7 +587,7 @@ Cypress.Commands.add('startOrStopPerformanceService', (action) => { fireLog(true, eval(CONSTANTS.PERFORMANCE_METRICS_SUCCESS_MESSAGE)); return true; } else { - fireLog.assert(false, eval(CONSTANTS.PERFORMANCE_METRICS_FAILURE_MESSAGE)); + fireLog.fail(eval(CONSTANTS.PERFORMANCE_METRICS_FAILURE_MESSAGE)); } }); }); diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index b67a4097..5f3b2943 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -695,28 +695,70 @@ global.resolveDeviceVariable = function (key) { * */ -class FireLog { +class FireLog extends Function { constructor() { - if (!FireLog.instance) { - FireLog.instance = this; - } + // Creating the function body dynamically + const functionBody = ` + return function (...args) { + return this.log(...args); + } + `; + super('...args', functionBody); + + const handler = { + apply: function (target, thisArg, argumentsList) { + let message; + const methodName = target.name; + if (target.hasOwnLog) { + // If the method has its own logging, just apply it + return Reflect.apply(target, thisArg, argumentsList); + } else { + if (argumentsList.length > 2) + message = + 'Expected: ' + + JSON.stringify(argumentsList[0]) + + ' Actual: ' + + JSON.stringify(argumentsList[1]); + else + message = + argumentsList[argumentsList.length - 1] + + ' Actual: ' + + JSON.stringify(argumentsList[0]); + return cy.log(message).then(() => { + return Reflect.apply(target, thisArg, argumentsList); + }); + } + }, + }; + // Proxy for the fireLog method + const instanceProxy = new Proxy(this, handler); + const fireLogProxy = new Proxy(instanceProxy, { + apply: function (target, thisArg, argumentsList) { + const message = argumentsList[argumentsList.length - 1]; + return cy.log(message); + }, + }); // Use cy.log(message) for every method in the class - const prototype = Object.getPrototypeOf(this); + const prototype = Object.getPrototypeOf(instanceProxy); Object.getOwnPropertyNames(prototype).forEach((method) => { - if (method !== 'constructor' && typeof this[method] === 'function') { - const originalMethod = this[method]; - this[method] = function (...args) { - const message = args[args.length - 1]; - - return cy.log(message).then(() => { - return originalMethod.apply(this, args); - }); - }; + if ( + method !== 'constructor' && + method !== 'fireLog' && + typeof instanceProxy[method] === 'function' + ) { + instanceProxy[method] = new Proxy(instanceProxy[method], handler); + const methodSource = instanceProxy[method].toString(); + instanceProxy[method].hasOwnLog = methodSource.includes('cy.log'); } }); - return FireLog.instance; + return fireLogProxy; + } + + // Method to log a message without any assertion + log(message) { + return cy.log(message); } isNull(value, message) { @@ -764,9 +806,11 @@ class FireLog { } include(haystack, needle, message) { + cy.log( + message + ' ' + JSON.stringify(needle) + ' expected to be in ' + JSON.stringify(haystack) + ); assert.include(haystack, needle, message); } - exists(value, message) { assert.exists(value, message); } @@ -775,6 +819,11 @@ class FireLog { assert(expression, message); } + fail(message) { + cy.log(message); + assert.fail(message); + } + info(message) {} } diff --git a/cypress/support/step_definitions/fireboltCalls.js b/cypress/support/step_definitions/fireboltCalls.js index c5013f87..b9ecc096 100644 --- a/cypress/support/step_definitions/fireboltCalls.js +++ b/cypress/support/step_definitions/fireboltCalls.js @@ -619,7 +619,7 @@ Given( cy.then(() => { // Failing the test when fireboltCall object not there if (!fireboltCallObject) { - fireLog.assert(false, fireboltCallObjectErrorMessage); + fireLog.fail(fireboltCallObjectErrorMessage); } else { let setMethod = typeof fireboltCallObject.setMethod === CONSTANTS.TYPE_FUNCTION @@ -717,7 +717,7 @@ Given( } }); } else { - fireLog.assert(false, `${sdk} SDK not Supported`); + fireLog.fail(`${sdk} SDK not Supported`); } } ); From b50a97c0f3cadbcd6472a24093120d83cdbf5817 Mon Sep 17 00:00:00 2001 From: bpvstaty366 <148532497+bpvstaty366@users.noreply.github.com> Date: Wed, 17 Jul 2024 19:41:48 +0300 Subject: [PATCH 296/359] Decouple cucumber report footer from landing page and individual modules (#88) * add customFooter * Update PageFooter * add custom metadata * add suport for configModule file * add suport for configModule file * customReportData * change the handle of files * update json * update local generator * add customreportdata md * add readme * add readme * FIRECERT-2149 - Just cleaned up a little bit With html flags it was causing some of the examples to be cut off. --------- Co-authored-by: Roebot926 --- cypress/fixtures/customReportData.json | 11 +++++ cypress/fixtures/customReportData.md | 35 +++++++++++++ cypress/plugins/index.js | 7 +++ cypress/plugins/localReportGenerator.js | 65 ++++++++++++++++++++++++- 4 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 cypress/fixtures/customReportData.json create mode 100644 cypress/fixtures/customReportData.md diff --git a/cypress/fixtures/customReportData.json b/cypress/fixtures/customReportData.json new file mode 100644 index 00000000..cb09a1e3 --- /dev/null +++ b/cypress/fixtures/customReportData.json @@ -0,0 +1,11 @@ +{ + "customFooter": { + "PageFooter": "Custom footer for main page", + "Account": "

Custom for Account pages

", + "Device": "

Custom for Device pages

" + }, + "customMetadata": { + "Account": "SetupAccount1
SetupAccount2", + "Device": "SetupDevice1
SetupDevice2" + } +} diff --git a/cypress/fixtures/customReportData.md b/cypress/fixtures/customReportData.md new file mode 100644 index 00000000..a37297fa --- /dev/null +++ b/cypress/fixtures/customReportData.md @@ -0,0 +1,35 @@ +# Overview +We use a JSON structure to define `customFooter` and `customMetadata` for various pages within the report. This allows dynamic customization, ensuring that each page can have specific information and design elements as needed. + +## Loading the JSON Data +The JSON data will first be loaded from `configModule/fixtures/external/objects/customReportData.json`. If this file is not available in the configModule, the data will be loaded from the local JSON file located at `cypress/fixtures/customReportData.json`. + +## Fields +`customFooter` + Contains customizable HTML content for the footers of different modules. + +- #### PageFooter: + - Type: string + - Description: HTML content for the main page footer. + - Example: `

Main page footer:

` +- #### Account: + - Type: string + - Description: HTML content for the Account page footer. + - Example: `

Custom for Account pages

` + +`customMetadata` + Contains customizable HTML content for the metadata sections of different modules. + + +- #### Account: + - Type: string + - Description: HTML content for the Account page metadata. + - Example: `SetupAccount1
SetupAccount2` + +# Usage Notes +- The `customFooter` object defines HTML content for footers on various pages. +- The `customMetadata` object defines HTML content for metadata sections on various pages. +- Ensure that the HTML content is properly escaped to avoid any issues with rendering. + +# Additional Information +- The JSON structure can be extended to include additional pages by adding new keys based on the feature file names, to the customFooter and customMetadata objects as needed. diff --git a/cypress/plugins/index.js b/cypress/plugins/index.js index 2efd281e..ebcf38dd 100644 --- a/cypress/plugins/index.js +++ b/cypress/plugins/index.js @@ -301,7 +301,14 @@ module.exports = async (on, config) => { jsonReport = readDataFromFile(filePath + fileName); } const reportProperties = {}; + let customReportData; + try { + customReportData = require('../fixtures/external/objects/customReportData.json'); + } catch (error) { + customReportData = require('../fixtures/customReportData.json'); + } reportProperties.isCombinedTestRun = process.env.CYPRESS_isCombinedTestRun; + reportProperties.customReportData = customReportData; // Add the report to the reportObj if (reportType === CONSTANTS.CUCUMBER) { reportObj.cucumberReport = jsonReport; diff --git a/cypress/plugins/localReportGenerator.js b/cypress/plugins/localReportGenerator.js index 8ddbbe18..8f1c6ab1 100644 --- a/cypress/plugins/localReportGenerator.js +++ b/cypress/plugins/localReportGenerator.js @@ -28,6 +28,8 @@ const logger = require('../support/Logger')('localReportGenerator.js'); const rename = util.promisify(fs.rename); const readdir = util.promisify(fs.readdir); const mkdir = util.promisify(fs.mkdir); +const readFileAsync = util.promisify(fs.readFile); +const writeFileAsync = util.promisify(fs.writeFile); /** * Generates local reports for Mochawesome and Cucumber based on the provided report data. @@ -70,16 +72,28 @@ async function generateLocalReport(reportObj, jobId) { if (reportObj.cucumberReport && reportObj.cucumberReportFilePath) { // Move cucumber json to a separate directory and get the path const cucumberDir = await filterCucumberJson(reportObj.cucumberReportFilePath); - + let customReportData; + try { + customReportData = require('../fixtures/external/objects/customReportData.json'); + } catch (error) { + customReportData = require('../fixtures/customReportData.json'); + } // Configure cucumber report options reportEnv.jsonDir = cucumberDir; reportEnv.reportPath = `./reports/${jobId}/cucumber-html-report`; + const featuresDir = `./reports/${jobId}/cucumber-html-report/features`; + if (customReportData.customFooter) + reportEnv.pageFooter = customReportData.customFooter.PageFooter; // Generate the cucumber report await cucumberReportGenerator.generate(reportEnv); // Remove tags from the generated cucumber report removeTagsFromCukeHtml(reportEnv.reportPath + '/index.html'); + if (customReportData.customFooter) + await processFeaturesFiles(featuresDir, customReportData.customFooter, 'customFooter'); + if (customReportData.customMetadata) + await processFeaturesFiles(featuresDir, customReportData.customMetadata, 'customMetadata'); logger.info( `A local report has been generated and can be accessed at ./reports/${jobId}/cucumber-html-report/index.html`, @@ -165,4 +179,53 @@ function removeTagsFromCukeHtml(htmlReportPath) { } } +async function updateCustomData(filePath, newCustomData, flag) { + const data = await readFileAsync(filePath, 'utf8'); + let updatedData; + if (flag.includes('customFooter')) { + const regex = /