From b1aa5b43799c4bf1d6b405a668c7718fbe4bd2bb Mon Sep 17 00:00:00 2001 From: Preethi M R <102140979+PreethiMaai@users.noreply.github.com> Date: Fri, 20 Sep 2024 11:36:22 +0530 Subject: [PATCH] feat: Modify all test cases to use static v2 objects with v1 glue code (#208) Co-authored-by: anjalimukundan --- .../FireboltCertification/Account.feature | 18 +- .../FireboltCertification/Device.feature | 30 +- .../Localization.feature | 4 +- .../Manage/DeviceManage.feature | 4 +- cypress/fixtures/fireboltCalls/account.js | 138 +++ cypress/fixtures/fireboltCalls/account.json | 86 +- cypress/fixtures/fireboltCalls/advertising.js | 332 ++++++- .../fixtures/fireboltCalls/advertising.json | 322 +++---- .../fixtures/fireboltCalls/authentication.js | 199 ++++ .../fireboltCalls/authentication.json | 74 +- cypress/fixtures/fireboltCalls/device.js | 596 ++++++++++++ cypress/fixtures/fireboltCalls/device.json | 52 +- cypress/fixtures/fireboltCalls/discovery.js | 879 ++++++++++++++++++ cypress/fixtures/fireboltCalls/discovery.json | 8 +- .../fireboltCalls/dynamicVariables.js | 21 + .../fixtures/fireboltCalls/localization.js | 307 ++++++ .../fixtures/fireboltCalls/localization.json | 189 ++-- .../fixtures/fireboltCalls/parameters.json | 2 +- .../fixtures/objects/errorContentObjects.js | 29 + cypress/support/cypress-support/src/utils.js | 43 + 20 files changed, 2938 insertions(+), 395 deletions(-) create mode 100644 cypress/fixtures/fireboltCalls/account.js create mode 100644 cypress/fixtures/fireboltCalls/authentication.js create mode 100644 cypress/fixtures/objects/errorContentObjects.js diff --git a/cypress/TestCases/FireboltCertification/Account.feature b/cypress/TestCases/FireboltCertification/Account.feature index 6a976d909..ff6fb82d7 100644 --- a/cypress/TestCases/FireboltCertification/Account.feature +++ b/cypress/TestCases/FireboltCertification/Account.feature @@ -6,14 +6,14 @@ Feature: Account And 3rd party 'certification' app is launched @sdk @transport - Scenario Outline: Account. - Positive Scenario: - When '3rd party app' invokes the 'Firebolt' API to '' - Then 'Firebolt' platform responds with '' - + Scenario Outline: Account. - Positive Scenario: + Given we test the 'ACCOUNT_ID_UID' getters and setters '' + When '3rd party app' invokes the 'Firebolt' get API + Then 'Firebolt' platform responds with '' 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 | + | Scenario | Method | Validation_key | + | Validate account ID | id | account id | + | Validate account UID | uid | account uid | @sdk @transport @notSupported @requiresPlatformImplementation Scenario Outline: Account. - Negative Scenario: @@ -24,5 +24,5 @@ Feature: Account | 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 + | Account ID Account retrieval attempt | fetch account ID when device is not provisioned | invalid parameter error for account id | id | + | Account UID Account retrieval attempt | fetch account UID when device 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 b71442f8a..69006438d 100644 --- a/cypress/TestCases/FireboltCertification/Device.feature +++ b/cypress/TestCases/FireboltCertification/Device.feature @@ -7,18 +7,24 @@ Feature: Device @sdk @transport Scenario Outline:Device. - Positive Scenario: - When '3rd party app' invokes the 'Firebolt' API to '' + Given we test the 'DEVICE' getters and setters '' + When '3rd party app' invokes the 'Firebolt' get API Then 'Firebolt' platform responds with '' + Examples: - | Scenario | API_Key | Validation_Key | Method | - | Validate Device id | fetch device id | expected device id | id | - | Validate Device distributor | fetch device distributor | expected device distributor | distributor | - | Validate Device platform | fetch device platform | expected device platform | platform | - | Validate Device uid | fetch device uid | expected device uid | uid | - | Validate Device type | fetch device type | expected device type | type | - | Validate Device model | fetch device model | expected device model | model | - | Validate Device sku | fetch device sku | expected device sku | sku | - | Validate Device make | fetch device make | expected device make | make | + | Scenario | Method | Validation_Key | + | Validate Device id | id | expected device id | + | Validate Device distributor | distributor | expected device distributor | + | Validate Device uid | uid | expected device uid | + | Validate Device type | type | expected device type | + | Validate Device model | model | expected device model | + | Validate Device sku | sku | expected device sku | + | Validate Device make | make | expected device make | + + @sdk @transport + Scenario: Device.platform - Positive Scenario: Validate device platform + When '3rd party app' invokes the 'Firebolt' API to 'fetch device platform' + Then 'Firebolt' platform responds with 'expected device platform' @sdk @transport Scenario: Device.name - Positive Scenario: Validate device name change @@ -32,7 +38,8 @@ Feature: Device @regression @sdk @transport Scenario Outline: Device. - Positive Scenario: - When '3rd party app' invokes the 'Firebolt' API to '' + Given we test the 'DEVICE' getters and setters '' to '{}' + When '3rd party app' invokes the 'Firebolt' get API Then 'Firebolt' platform responds with '' Examples: @@ -68,4 +75,3 @@ 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/Localization.feature b/cypress/TestCases/FireboltCertification/Localization.feature index 50c8161e1..d2da176ff 100644 --- a/cypress/TestCases/FireboltCertification/Localization.feature +++ b/cypress/TestCases/FireboltCertification/Localization.feature @@ -33,14 +33,14 @@ Feature: Localization Examples: | Scenario | API_Key | Validation_Key | - | with key and value as string | set localization removeAdditionalInfo with string | empty key/value for localization additionalInfo | + | with key and value as string | set localization removeAdditionalInfo with string | empty key value for localization additionalInfo | | with key and value as empty string | set localization removeAdditionalInfo with empty string | empty response for localization additionalInfo | @sdk @transport 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' - + @sdk @transport Scenario Outline: Positive Scenario: Validate interlinked methods - Given '3rd party app' registers for the '' event using the 'Firebolt' API diff --git a/cypress/TestCases/FireboltCertification/Manage/DeviceManage.feature b/cypress/TestCases/FireboltCertification/Manage/DeviceManage.feature index b1d7320fb..4b564dfe1 100644 --- a/cypress/TestCases/FireboltCertification/Manage/DeviceManage.feature +++ b/cypress/TestCases/FireboltCertification/Manage/DeviceManage.feature @@ -20,9 +20,9 @@ Feature: Device_Manage When 1st party app invokes the 'Firebolt' API to '' Then 'Firebolt' platform responds to '1st party app' with '' - Examples: + Examples: | Scenario | Key | MethodContent | - | set device provision with default params | provision device with default values | default values for device provision | + | set device provision with default params | provision device with default values | default value for device provision | | set device provision with distributor id | provision device with distributor id | distributor id for device provision | @sdk @transport diff --git a/cypress/fixtures/fireboltCalls/account.js b/cypress/fixtures/fireboltCalls/account.js new file mode 100644 index 000000000..e8d690a3e --- /dev/null +++ b/cypress/fixtures/fireboltCalls/account.js @@ -0,0 +1,138 @@ +/** + * 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 + */ +const errorContent = require('../objects/errorContentObjects.js'); +exports.ACCOUNT_VARIABLES = { + ACCOUNT: { + id: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'deviceContentValidation', + type: extractEnvValue('ACCOUNTID'), + description: 'Validation of the Account Id', + }, + ], + }, + ], + }, + uid: { + data: [ + { + type: 'regEx', + validations: [ + { + mode: 'regex', + type: '/^(?:.*d)(?:.*[a-zA-Z]).{2,}$/', + description: 'Validation of the Account uid', + }, + ], + }, + ], + }, + }, +}; + +exports.ACCOUNT_ID_UID = { + method: resolveAtRuntime('account.{{attribute}}'), + params: null, +}; + +exports.ACCOUNT_ID = { + method: 'account.id', + validationJsonPath: 'result', + content: this.ACCOUNT_VARIABLES.ACCOUNT.id, +}; + +exports.ACCOUNT_UID = { + method: 'account.uid', + validationJsonPath: 'result', + content: this.ACCOUNT_VARIABLES.ACCOUNT.uid, +}; + +exports.FETCH_ACCOUNT_ID_WHEN_DEVICE_IS_NOT_PROVISIONED = { + method: 'account.id', + params: {}, + expected: 'error', +}; + +exports.FETCH_ACCOUNT_UID_WHEN_DEVICE_IS_NOT_PROVISIONED = { + method: 'account.uid', + params: {}, + expected: 'error', +}; + +exports.INVALID_PARAMETER_ERROR_FOR_ACCOUNT_ID = { + method: 'account.id', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; + +exports.INVALID_PARAMETER_ERROR_FOR_ACCOUNT_UID = { + method: 'account.uid', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; + +// Dummy session token data +exports.PUSH_SESSION_TOKEN = { + method: 'manage_account.session', + params: { token: 'SW52Y==', expiresIn: 84000 }, +}; + +exports.GET_ADVERTISINGID_WITH_CUSTOM_ERROR = { + method: 'advertising.advertisingId', + params: { value: true }, + expected: 'error', +}; + +exports.SET_ACCOUNT_SESSION_WITH_INVALID_TOKEN = { + method: 'manage_account.session', + params: { token: 12345, expiresIn: 84000 }, + expected: 'error', +}; + +// Dummy session token data +exports.SET_ACCOUNT_SESSION_WITH_INVALID_EXPIRESIN = { + method: 'manage_account.session', + params: { token: 'SW52Y==', expiresIn: 'BJGHhjbdcJKSW' }, + expected: 'error', +}; + +// Dummy session token data +exports.SET_ACCOUNT_SESSION_WITH_INVALID_EXPIRESIN_VALUE = { + method: 'manage_account.session', + params: { token: 'SW52Y==', expiresIn: 0 }, + expected: 'error', +}; + +exports.SET_ACCOUNT_SESSION_WITHOUT_PARAMETERS = { + method: 'manage_account.session', + params: {}, + expected: 'error', +}; + +exports.INVALID_PARAMETERS_FOR_ACCOUNT_SESSION = { + method: 'manage_account.session', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; diff --git a/cypress/fixtures/fireboltCalls/account.json b/cypress/fixtures/fireboltCalls/account.json index 7247d10f9..5097d3cb9 100644 --- a/cypress/fixtures/fireboltCalls/account.json +++ b/cypress/fixtures/fireboltCalls/account.json @@ -1,73 +1,73 @@ { - "FETCH_ACCOUNT_ID":{ + "FETCH_ACCOUNT_ID": { "method": "account.id" }, - "FETCH_ACCOUNT_UID":{ + "FETCH_ACCOUNT_UID": { "method": "account.uid" }, - "GET_ACCOUNT_ID":{ + "GET_ACCOUNT_ID": { "method": "account.id", "expected": "error" }, "ACCOUNT_ID": { - "method": "account.id", - "validationJsonPath": "result", - "content": "ACCOUNT_ID" - }, + "method": "account.id", + "validationJsonPath": "result", + "content": "ACCOUNT_ID" + }, "ACCOUNT_UID": { - "method": "account.uid", - "validationJsonPath": "result", - "content": "ACCOUNT_UID" - }, + "method": "account.uid", + "validationJsonPath": "result", + "content": "ACCOUNT_UID" + }, "INVALID_PARAMETER_ERROR_FOR_ACCOUNT_ID": { - "method": "account.id", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS" - }, + "method": "account.id", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS" + }, "INVALID_PARAMETER_ERROR_FOR_ACCOUNT_UID": { - "method": "account.uid", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS" - }, + "method": "account.uid", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS" + }, "INVALID_REQUEST_ERROR_FOR_ACCOUNT_UID": { - "method": "account.uid", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "method": "account.uid", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true - }, - "PUSH_SESSION_TOKEN":{ + }, + "PUSH_SESSION_TOKEN": { "method": "manage_account.session", - "params": "ACCOUNT_SESSION" + "params": "ACCOUNT_SESSION" }, - "GET_ADVERTISINGID_WITH_CUSTOM_ERROR":{ + "GET_ADVERTISINGID_WITH_CUSTOM_ERROR": { "method": "advertising.advertisingId", - "params": "TRUE", - "expected": "error" + "params": "TRUE", + "expected": "error" }, - "SET_ACCOUNT_SESSION_WITH_INVALID_TOKEN":{ + "SET_ACCOUNT_SESSION_WITH_INVALID_TOKEN": { "method": "manage_account.session", - "params": "ACCOUNT_SESSION_INVALID_TOKEN", - "expected": "error" + "params": "ACCOUNT_SESSION_INVALID_TOKEN", + "expected": "error" }, - "INVALID_PARAMETERS_FOR_ACCOUNT_SESSION": { - "method": "account.session", - "validationJsonPath": "result", + "INVALID_PARAMETERS_FOR_ACCOUNT_SESSION": { + "method": "account.session", + "validationJsonPath": "result", "content": "INVALID_TYPE_PARAMS", "expectingError": true - }, - "SET_ACCOUNT_SESSION_WITH_INVALID_EXPIRESIN":{ + }, + "SET_ACCOUNT_SESSION_WITH_INVALID_EXPIRESIN": { "method": "manage_account.session", - "params": "ACCOUNT_SESSION_INVALID_EXPIRESIN", - "expected": "error" + "params": "ACCOUNT_SESSION_INVALID_EXPIRESIN", + "expected": "error" }, - "SET_ACCOUNT_SESSION_WITH_INVALID_EXPIRESIN_VALUE":{ + "SET_ACCOUNT_SESSION_WITH_INVALID_EXPIRESIN_VALUE": { "method": "manage_account.session", - "params": "ACCOUNT_EXPIRESIN_INVALID_VALUE", - "expected": "error" + "params": "ACCOUNT_EXPIRESIN_INVALID_VALUE", + "expected": "error" }, - "SET_ACCOUNT_SESSION_WITHOUT_PARAMETERS":{ + "SET_ACCOUNT_SESSION_WITHOUT_PARAMETERS": { "method": "manage_account.session", - "expected": "error" + "expected": "error" }, "FETCH_ACCOUNT_ID_WHEN_DEVICE_IS_NOT_PROVISIONED": { "method": "account.id", diff --git a/cypress/fixtures/fireboltCalls/advertising.js b/cypress/fixtures/fireboltCalls/advertising.js index 35975a435..e3aa3b707 100644 --- a/cypress/fixtures/fireboltCalls/advertising.js +++ b/cypress/fixtures/fireboltCalls/advertising.js @@ -1,3 +1,21 @@ +/** + * 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 + */ +const errorContent = require('../objects/errorContentObjects.js'); exports.ADVERTISING_RESET_IDENTIFIER = { method: 'manage_advertising.resetIdentifier', params: {}, @@ -49,13 +67,13 @@ exports.ADVERTISING_SKIP_RESTRICTION = { exports.ADVERTISING_SKIPRESTRICTION = { method: 'advertising.policy', params: {}, - validationJsonPath: 'result.skipRestriction', - setMethod: resolveAtRuntime('manage_advertising.setSkipRestriction'), + validationJsonPath: resolveAtRuntime('result.{{attribute}}'), + setMethod: resolveAtRuntime('manage_advertising.set{{attribute.uppercaseFirstChar}}'), setParams: resolveAtRuntime('value'), setValidationJsonPath: 'result', setContent: null, event: 'advertising.onPolicyChanged', - eventValidationJsonPath: 'eventResponse.skipRestriction', + eventValidationJsonPath: resolveAtRuntime('eventResponse.{{attribute}}'), content: { data: [ { @@ -93,3 +111,311 @@ exports.ADVERTISING_DEVICEATTRIBUTES = { ], }, }; + +exports.ADVERTISING_VARIABLES = { + ADVERTISING: { + ADVERTISINGID_ADOFF: { + data: [ + { + type: 'miscellaneous', + validations: [ + { + type: 'limitAdTrackingOFF', + description: + 'Validation of the Advertising AdvertisingId When LimitAdTracking OFF Format', + }, + ], + }, + ], + }, + ADVERTISINGID_ADON: { + data: [ + { + type: 'miscellaneous', + validations: [ + { + type: 'limitAdTrackingON', + description: + 'Validation of the Advertising AdvertisingId When LimitAdTracking ON Format', + }, + ], + }, + ], + }, + ADVERTISING_CONFIGURATION: { + data: [ + { + type: 'decode', + specialCase: 'base64', + validations: [ + { + format: 'TOKEN_REGEXP', + field: 'lmt', + mode: 'regex', + type: '^[0-9]+$', + description: 'Validation of the advertising.config privacyData Format', + }, + ], + }, + ], + }, + }, +}; + +exports.SET_SKIPRESTRICTION_AS_ADSUNWATCHED = { + method: 'manage_advertising.setSkipRestriction', + params: { value: 'adsUnwatched' }, +}; + +exports.GET_NO_COPPA = { + method: 'advertising.config', + params: { options: { environment: 'prod', authenticationEntity: 'MVPD' } }, +}; + +exports.GET_ADVERTISINGID = { + method: 'advertising.advertisingId', + params: {}, +}; + +exports.RESET_IDENTIFIER_FOR_ADVERTISING = { + method: 'manage_advertising.resetIdentifier', + params: {}, +}; + +exports.GET_APPBUNDLEID = { + method: 'advertising.appBundleId', + params: {}, +}; + +exports.ADVERTISING_APPBUNDLEID = { + method: 'advertising.appBundleId', + validationJsonPath: 'result', + content: '', +}; + +exports.GET_INITIALIZATION_PARAMETERS = { + method: 'parameters.initialization', + params: {}, +}; + +exports.ENABLE_LIMITADTRACKING = { + method: 'manage_privacy.setAllowAppContentAdTargeting', + params: { value: true }, +}; + +exports.DISABLE_LIMITADTRACKING = { + method: 'manage_privacy.setAllowAppContentAdTargeting', + params: { value: false }, +}; + +exports.LIMITADTRACKING_OFF_FOR_ADVERTISINGID = { + method: 'advertising.advertisingId', + validationJsonPath: 'result', + content: this.ADVERTISING_VARIABLES.ADVERTISING.ADVERTISINGID_ADOFF, +}; + +exports.LIMITADTRACKING_ON_FOR_ADVERTISINGID = { + method: 'advertising.advertisingId', + validationJsonPath: 'result', + content: this.ADVERTISING_VARIABLES.ADVERTISING.ADVERTISINGID_ADON, +}; + +exports.PARAMETERS_INITIALIZATION_ADVERTISINGID_AD_OFF = { + method: 'parameters.initialization', + validationJsonPath: 'result', + content: this.ADVERTISING_VARIABLES.ADVERTISING.ADVERTISINGID_ADOFF, +}; + +exports.PARAMETERS_INITIALIZATION_ADVERTISINGID_AD_ON = { + method: 'parameters.initialization', + validationJsonPath: 'result', + content: this.ADVERTISING_VARIABLES.ADVERTISING.ADVERTISINGID_ADON, +}; + +exports.GET_COPPA_AS_TRUE = { + method: 'advertising.config', + params: { options: { coppa: true, environment: 'prod', authenticationEntity: 'MVPD' } }, +}; +exports.GET_COPPA_AS_FALSE = { + method: 'advertising.config', + params: { options: { coppa: false, environment: 'prod', authenticationEntity: 'MVPD' } }, +}; +exports.GET_NO_COPPA_WITH_ENVIRONMENT_VALUE_TEST = { + method: 'advertising.config', + params: { options: { environment: 'test', authenticationEntity: 'MVPD' } }, +}; +exports.GET_COPPA_AS_TRUE_WITH_ENVIRONMENT_VALUE_TEST = { + method: 'advertising.config', + params: { options: { coppa: true, environment: 'test', authenticationEntity: 'MVPD' } }, +}; +exports.GET_COPPA_AS_FALSE_WITH_ENVIRONMENT_VALUE_TEST = { + method: 'advertising.config', + params: { options: { coppa: false, environment: 'test', authenticationEntity: 'MVPD' } }, +}; +exports.ADVERTISING_CONFIG_COPPA_AS_ZERO = { + method: 'advertising.config', + validationJsonPath: 'result.coppa', + content: 0, +}; +exports.ADVERTISING_CONFIG_COPPA_AS_ONE = { + method: 'advertising.config', + validationJsonPath: 'result.coppa', + content: 1, +}; + +exports.GET_ONLY_COPPA = { + method: 'advertising.config', + params: { options: { coppa: true } }, +}; +exports.GET_EMPTY_PARAMETER = { + method: 'advertising.config', + params: { options: {} }, +}; + +exports.ADVERTISING_CONFIG = { + method: 'advertising.config', + validationJsonPath: 'result', + content: this.ADVERTISING_VARIABLES.ADVERTISING.ADVERTISING_CONFIGURATION, +}; +exports.GET_CONFIG_WITH_EMPTY_PARAMETER = { + method: 'advertising.config', + params: {}, + expected: 'error', +}; +exports.GET_CONFIG_WITH_INVALID_COPPA = { + method: 'advertising.config', + params: { options: { coppa: 'true', environment: 'test', authenticationEntity: 'MVPD' } }, + expected: 'error', +}; +exports.GET_CONFIG_WITH_INVALID_AUTHENTICATIONENTITY = { + method: 'advertising.config', + params: { options: { environment: 'prod', authenticationEntity: 10 } }, + expected: 'error', +}; +exports.GET_CONFIG_WITH_INVALID_ENVIRONMENT_DATATYPE = { + method: 'advertising.config', + params: { options: { environment: true, authenticationEntity: 'MVPD' } }, + expected: 'error', +}; +exports.GET_CONFIG_WITH_INVALID_ENVIRONMENT = { + method: 'advertising.config', + params: { options: { environment: 'work', authenticationEntity: 'MVPD' } }, + expected: 'error', +}; +exports.GET_CONFIG_WITH_INTEGER_PARAMETER = { + method: 'advertising.config', + params: { options: { coppa: 123, environment: 123, authenticationEntity: 123 } }, + expected: 'error', +}; +exports.GET_ADVERTISINGID_WITHOUT_SCOPE = { + method: 'advertising.advertisingId', + params: { options: {} }, +}; +exports.GET_ADVERTISINGID_WITH_SCOPE_ID_AS_RANDOM_STRING = { + method: 'advertising.advertisingId', + params: { options: { scope: { type: 'browse', id: 'test' } } }, +}; +exports.GET_ADVERTISINGID_WITH_SCOPE_ID_AS_EMPTY_STRING = { + method: 'advertising.advertisingId', + params: { options: { scope: { type: 'browse', id: '' } } }, +}; +exports.GET_ADVERTISINGID_FOR_SCOPE_BROWSER = { + method: 'advertising.advertisingId', + params: { options: { scope: { type: 'browse', id: 'paidPlacement' } } }, +}; +exports.GET_ADVERTISINGID_FOR_SCOPE_CONTENT = { + method: 'advertising.advertisingId', + params: { options: { scope: { type: 'content', id: 'merlin:linear:station:123' } } }, +}; +exports.GET_ADVERTISINGID_WITH_INVALID_SCOPE_TYPE = { + method: 'advertising.advertisingId', + params: { options: { scope: { type: 'test', id: 'paidPlacement' } } }, + expected: 'error', +}; +exports.GET_ADVERTISINGID_WITHOUT_SCOPE_TYPE_AND_ID = { + method: 'advertising.advertisingId', + params: { options: { scope: {} } }, + expected: 'error', +}; +exports.GET_ADVERTISINGID_WITHOUT_SCOPE_ID = { + method: 'advertising.advertisingId', + params: { options: { scope: { type: 'test' } } }, + expected: 'error', +}; +exports.GET_ADVERTISINGID_WITHOUT_SCOPE_TYPE = { + method: 'advertising.advertisingId', + params: { options: { scope: { id: 'paidPlacement' } } }, + expected: 'error', +}; +exports.GET_ADVERTISINGID_WITH_INVALID_SCOPE = { + method: 'advertising.advertisingId', + params: { options: { scope: { id: 'paidPlacement' } } }, + expected: 'error', +}; +exports.GET_ADVERTISINGID_WITH_INVALID_TYPE = { + method: 'advertising.advertisingId', + params: { options: { scope: { type: 1234, id: 'paidPlacement' } } }, + expected: 'error', +}; +exports.GET_ADVERTISINGID_WITH_INVALID_ID = { + method: 'advertising.advertisingId', + params: { options: { scope: { type: 'browse', id: true } } }, + expected: 'error', +}; + +exports.INVALID_PARAMETER_FOR_ADVERTISING_ADVERTISINGID = { + method: 'advertising.advertisingId', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; + +exports.INVALID_PARAMETER_ERROR_ADVERTISING_CONFIG = { + method: 'advertising.config', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; + +exports.ADVERTISING_ONPOLICYCHANGED_EVENT = { + event: 'advertising.onPolicyChanged', + firstParty: false, +}; + +exports.SET_TRUE_FOR_ALLOWAPPCONTENTADTARGETING = { + method: 'manage_privacy.setAllowAppContentAdTargeting', + params: { value: true }, +}; +exports.ONADVERTISINGPOLICYCHANGED = { + event: 'advertising.onPolicyChanged', + validationJsonPath: 'eventResponse', + content: null, +}; +exports.ADVERTISING_ONPOLICYCHANGED = { + method: 'advertising.onPolicyChanged', + params: {}, +}; +exports.GET_ADVERTISING_POLICY = { + method: 'advertising.policy', + params: {}, +}; +exports.ADVERTISING_POLICY_LIMITADTRACKING_AS_TRUE = { + method: 'advertising.policy', + validationJsonPath: 'result.limitAdTracking', + content: true, +}; +exports.ADVERTISING_POLICY_LIMITADTRACKING_AS_FALSE = { + method: 'advertising.policy', + validationJsonPath: 'result.limitAdTracking', + content: false, +}; +exports.ONPOLICYCHANGED_FOR_ADVERTISING_LIMITADTRACKING_WITH_TRUE = { + event: 'advertising.onPolicyChanged', + validationJsonPath: 'eventResponse.limitAdTracking', + content: true, +}; +exports.ONPOLICYCHANGED_FOR_ADVERTISING_LIMITADTRACKING_WITH_FALSE = { + event: 'advertising.onPolicyChanged', + validationJsonPath: 'eventResponse.limitAdTracking', + content: false, +}; diff --git a/cypress/fixtures/fireboltCalls/advertising.json b/cypress/fixtures/fireboltCalls/advertising.json index a92a50b3d..0f81e43b8 100644 --- a/cypress/fixtures/fireboltCalls/advertising.json +++ b/cypress/fixtures/fireboltCalls/advertising.json @@ -1,343 +1,343 @@ { - "ADVERTISING_ONPOLICYCHANGED":{ + "ADVERTISING_ONPOLICYCHANGED": { "method": "advertising.onPolicyChanged" }, - "GET_ADVERTISING_POLICY":{ + "GET_ADVERTISING_POLICY": { "method": "advertising.policy" }, - "DISABLE_LIMITADTRACKING":{ + "DISABLE_LIMITADTRACKING": { "method": "manage_privacy.setAllowAppContentAdTargeting", "params": "FALSE" }, - "ENABLE_LIMITADTRACKING":{ + "ENABLE_LIMITADTRACKING": { "method": "manage_privacy.setAllowAppContentAdTargeting", "params": "TRUE" }, - "SET_SKIPRESTRICTION_AS_NONE":{ + "SET_SKIPRESTRICTION_AS_NONE": { "method": "manage_advertising.setSkipRestriction", "params": "NONE" }, - "SET_SKIPRESTRICTION_AS_ADSUNWATCHED":{ + "SET_SKIPRESTRICTION_AS_ADSUNWATCHED": { "method": "manage_advertising.setSkipRestriction", "params": "ADVERTISING_SKIPRESTRICTION_ADSUNWATCHED" }, - "SET_SKIPRESTRICTION_AS_ADSALL":{ + "SET_SKIPRESTRICTION_AS_ADSALL": { "method": "manage_advertising.setSkipRestriction", "params": "ADVERTISING_SKIPRESTRICTION_ADSALL" }, - "SET_SKIPRESTRICTION_AS_ALL":{ + "SET_SKIPRESTRICTION_AS_ALL": { "method": "manage_advertising.setSkipRestriction", "params": "ADVERTISING_SKIPRESTRICTION_ALL" }, - "GET_DEVICEATTRIBUTES":{ + "GET_DEVICEATTRIBUTES": { "method": "advertising.deviceAttributes" }, - "GET_APPBUNDLEID":{ + "GET_APPBUNDLEID": { "method": "advertising.appBundleId" }, - "GET_ADVERTISINGID":{ + "GET_ADVERTISINGID": { "method": "advertising.advertisingId" }, - "GET_INITIALIZATION_PARAMETERS":{ + "GET_INITIALIZATION_PARAMETERS": { "method": "parameters.initialization" }, - "GET_NO_COPPA":{ + "GET_NO_COPPA": { "method": "advertising.config", "params": "ADVERTISING_NO_COPPA" }, - "GET_COPPA_AS_TRUE":{ + "GET_COPPA_AS_TRUE": { "method": "advertising.config", "params": "ADVERTISING_COPPA_TRUE" }, - "GET_COPPA_AS_FALSE":{ + "GET_COPPA_AS_FALSE": { "method": "advertising.config", "params": "ADVERTISING_COPPA_FALSE" }, - "GET_NO_COPPA_WITH_ENVIRONMENT_VALUE_TEST":{ + "GET_NO_COPPA_WITH_ENVIRONMENT_VALUE_TEST": { "method": "advertising.config", "params": "ADVERTISING_NO_COPPA_ENVIRONMENT_TEST" }, - "GET_COPPA_AS_TRUE_WITH_ENVIRONMENT_VALUE_TEST":{ + "GET_COPPA_AS_TRUE_WITH_ENVIRONMENT_VALUE_TEST": { "method": "advertising.config", "params": "ADVERTISING_COPPA_TRUE_ENVIRONMENT_TEST" }, - "GET_COPPA_AS_FALSE_WITH_ENVIRONMENT_VALUE_TEST":{ + "GET_COPPA_AS_FALSE_WITH_ENVIRONMENT_VALUE_TEST": { "method": "advertising.config", "params": "ADVERTISING_COPPA_FALSE_ENVIRONMENT_TEST" }, - "GET_ONLY_COPPA":{ + "GET_ONLY_COPPA": { "method": "advertising.config", "params": "ADVERTISING_ONLY_COPPA" }, - "GET_EMPTY_PARAMETER":{ + "GET_EMPTY_PARAMETER": { "method": "advertising.config", "params": "ADVERTISING_EMPTY_PARAMS" }, - "GET_CONFIG_WITH_EMPTY_PARAMETER":{ + "GET_CONFIG_WITH_EMPTY_PARAMETER": { "method": "advertising.config", "expected": "error" }, - "GET_CONFIG_WITH_INVALID_COPPA":{ + "GET_CONFIG_WITH_INVALID_COPPA": { "method": "advertising.config", "params": "ADVERTISING_INVALID_CONFIG_COPPA", "expected": "error" }, - "GET_CONFIG_WITH_INVALID_AUTHENTICATIONENTITY":{ + "GET_CONFIG_WITH_INVALID_AUTHENTICATIONENTITY": { "method": "advertising.config", "params": "ADVERTISING_INVALID_CONFIG_AUTHENTICATIONENTITY", "expected": "error" }, - "GET_CONFIG_WITH_INVALID_ENVIRONMENT_DATATYPE":{ + "GET_CONFIG_WITH_INVALID_ENVIRONMENT_DATATYPE": { "method": "advertising.config", "params": "ADVERTISING_INVALID_CONFIG_ENVIRONMENT_DATATYPE", "expected": "error" }, - "GET_CONFIG_WITH_INVALID_ENVIRONMENT":{ + "GET_CONFIG_WITH_INVALID_ENVIRONMENT": { "method": "advertising.config", "params": "ADVERTISING_INVALID_CONFIG_ENVIRONMENT", "expected": "error" }, - "GET_CONFIG_WITH_INTEGER_PARAMETER":{ + "GET_CONFIG_WITH_INTEGER_PARAMETER": { "method": "advertising.config", "params": "ADVERTISING_INTEGER_PARAM", "expected": "error" }, - "SET_SKIPRESTRICTION_WITH_UNDEFINED_PARAMETER":{ + "SET_SKIPRESTRICTION_WITH_UNDEFINED_PARAMETER": { "method": "manage_advertising.setSkipRestriction" }, - "GET_ADVERTISINGID_FOR_SCOPE_BROWSER":{ + "GET_ADVERTISINGID_FOR_SCOPE_BROWSER": { "method": "advertising.advertisingId", "params": "ADVERTISING_ADVERTISINGID_SCOPE_BROWSER" }, - "GET_ADVERTISINGID_FOR_SCOPE_CONTENT":{ + "GET_ADVERTISINGID_FOR_SCOPE_CONTENT": { "method": "advertising.advertisingId", "params": "ADVERTISING_ADVERTISINGID_SCOPE_CONTENT" }, - "GET_ADVERTISINGID_WITH_INVALID_TYPE":{ + "GET_ADVERTISINGID_WITH_INVALID_TYPE": { "method": "advertising.advertisingId", "params": "ADVERTISING_ADVERTISINGID_INVALID_TYPE", "expected": "error" }, - "GET_ADVERTISINGID_WITH_INVALID_ID":{ + "GET_ADVERTISINGID_WITH_INVALID_ID": { "method": "advertising.advertisingId", "params": "ADVERTISING_ADVERTISINGID_INVALID_ID", "expected": "error" }, "ADVERTISING_POLICY_LIMITADTRACKING_AS_TRUE": { - "method": "advertising.policy", - "validationJsonPath": "result.limitAdTracking", - "content": "ADVERTISING_POLICY_TRUE" - }, + "method": "advertising.policy", + "validationJsonPath": "result.limitAdTracking", + "content": "ADVERTISING_POLICY_TRUE" + }, "ADVERTISING_POLICY_LIMITADTRACKING_AS_FALSE": { - "method": "advertising.policy", - "validationJsonPath": "result.limitAdTracking", - "content": "ADVERTISING_POLICY_FALSE" - }, + "method": "advertising.policy", + "validationJsonPath": "result.limitAdTracking", + "content": "ADVERTISING_POLICY_FALSE" + }, "ONPOLICYCHANGED_FOR_ADVERTISING_LIMITADTRACKING_WITH_TRUE": { - "event": "advertising.onPolicyChanged", - "validationJsonPath": "eventResponse.limitAdTracking", - "content": "ADVERTISING_POLICY_TRUE" - }, + "event": "advertising.onPolicyChanged", + "validationJsonPath": "eventResponse.limitAdTracking", + "content": "ADVERTISING_POLICY_TRUE" + }, "ONPOLICYCHANGED_FOR_ADVERTISING_LIMITADTRACKING_WITH_FALSE": { - "event": "advertising.onPolicyChanged", - "validationJsonPath": "eventResponse.limitAdTracking", - "content": "ADVERTISING_POLICY_FALSE" - }, + "event": "advertising.onPolicyChanged", + "validationJsonPath": "eventResponse.limitAdTracking", + "content": "ADVERTISING_POLICY_FALSE" + }, "ADVERTISING_POLICY_SKIPRESTRICTION_AS_NONE": { - "method": "advertising.policy", - "validationJsonPath": "result.skipRestriction", - "content": "ADVERTISING_POLICY_NONE" - }, + "method": "advertising.policy", + "validationJsonPath": "result.skipRestriction", + "content": "ADVERTISING_POLICY_NONE" + }, "ADVERTISING_POLICY_SKIPRESTRICTION_AS_ADSUNWATCHED": { - "method": "advertising.policy", - "validationJsonPath": "result.skipRestriction", - "content": "ADVERTISING_POLICY_ADSUNWATCHED" - }, + "method": "advertising.policy", + "validationJsonPath": "result.skipRestriction", + "content": "ADVERTISING_POLICY_ADSUNWATCHED" + }, "ADVERTISING_POLICY_SKIPRESTRICTION_AS_ADSALL": { - "method": "advertising.policy", - "validationJsonPath": "result.skipRestriction", - "content": "ADVERTISING_POLICY_ADSALL" - }, + "method": "advertising.policy", + "validationJsonPath": "result.skipRestriction", + "content": "ADVERTISING_POLICY_ADSALL" + }, "ADVERTISING_POLICY_SKIPRESTRICTION_AS_ALL": { - "method": "advertising.policy", - "validationJsonPath": "result.skipRestriction", - "content": "ADVERTISING_POLICY_ALL" - }, + "method": "advertising.policy", + "validationJsonPath": "result.skipRestriction", + "content": "ADVERTISING_POLICY_ALL" + }, "ONPOLICYCHANGED_FOR_ADVERTISING_SKIPRESTRICTION_WITH_NONE": { - "event": "advertising.onPolicyChanged", - "validationJsonPath": "eventResponse.skipRestriction", - "content": "ADVERTISING_POLICY_NONE" - }, + "event": "advertising.onPolicyChanged", + "validationJsonPath": "eventResponse.skipRestriction", + "content": "ADVERTISING_POLICY_NONE" + }, "ONPOLICYCHANGED_FOR_ADVERTISING_SKIPRESTRICTION_WITH_ADSUNWATCHED": { - "event": "advertising.onPolicyChanged", - "validationJsonPath": "eventResponse.skipRestriction", - "content": "ADVERTISING_POLICY_ADSUNWATCHED" - }, + "event": "advertising.onPolicyChanged", + "validationJsonPath": "eventResponse.skipRestriction", + "content": "ADVERTISING_POLICY_ADSUNWATCHED" + }, "ONPOLICYCHANGED_FOR_ADVERTISING_SKIPRESTRICTION_WITH_ADSALL": { - "event": "advertising.onPolicyChanged", - "validationJsonPath": "eventResponse.skipRestriction", - "content": "ADVERTISING_POLICY_ADSALL" - }, + "event": "advertising.onPolicyChanged", + "validationJsonPath": "eventResponse.skipRestriction", + "content": "ADVERTISING_POLICY_ADSALL" + }, "ONPOLICYCHANGED_FOR_ADVERTISING_SKIPRESTRICTION_WITH_ALL": { - "event": "advertising.onPolicyChanged", - "validationJsonPath": "eventResponse.skipRestriction", - "content": "ADVERTISING_POLICY_ALL" - }, + "event": "advertising.onPolicyChanged", + "validationJsonPath": "eventResponse.skipRestriction", + "content": "ADVERTISING_POLICY_ALL" + }, "ADVERTISING_DEVICE_ATTRIBUTES": { - "method": "advertising.deviceAttributes", - "validationJsonPath": "result", - "content": "ADVERTISING_DEVICEATTRIBUTES" - }, + "method": "advertising.deviceAttributes", + "validationJsonPath": "result", + "content": "ADVERTISING_DEVICEATTRIBUTES" + }, "ADVERTISING_APPBUNDLEID": { - "method": "advertising.appBundleId", - "validationJsonPath": "result", - "content": "ADVERTISING_APPBUNDLEID" - }, + "method": "advertising.appBundleId", + "validationJsonPath": "result", + "content": "ADVERTISING_APPBUNDLEID" + }, "ADVERTISING_CONFIG_COPPA_AS_ZERO": { - "method": "advertising.config", - "validationJsonPath": "result.coppa", - "content": "ADVERTISING_CONFIG_ZERO" - }, + "method": "advertising.config", + "validationJsonPath": "result.coppa", + "content": "ADVERTISING_CONFIG_ZERO" + }, "ADVERTISING_CONFIG_COPPA_AS_ONE": { - "method": "advertising.config", - "validationJsonPath": "result.coppa", - "content": "ADVERTISING_CONFIG_ONE" - }, + "method": "advertising.config", + "validationJsonPath": "result.coppa", + "content": "ADVERTISING_CONFIG_ONE" + }, "INVALID_PARAMETER_ERROR_ADVERTISING_CONFIG": { - "method": "advertising.config", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "method": "advertising.config", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true - }, + }, "ADVERTISING_SKIPRESTRICTION": { "method": "advertising.setSkipRestriction", - "validationJsonPath": "result", - "content": "ADVERTISING_SKIPRESTRICTION" + "validationJsonPath": "result", + "content": "ADVERTISING_SKIPRESTRICTION" }, "INVALID_PARAMETER_FOR_ADVERTISING_ADVERTISINGID": { - "method": "advertising.advertisingId", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "method": "advertising.advertisingId", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true - }, + }, "ADVERTISING_CONFIG": { - "method": "advertising.config", - "validationJsonPath": "result", - "content": "ADVERTISING_CONFIGURATION" - }, + "method": "advertising.config", + "validationJsonPath": "result", + "content": "ADVERTISING_CONFIGURATION" + }, "LIMITADTRACKING_OFF_FOR_ADVERTISINGID": { - "method": "advertising.advertisingId", - "validationJsonPath": "result", - "content": "ADVERTISING_ADVERTISINGID_ADOFF" - }, + "method": "advertising.advertisingId", + "validationJsonPath": "result", + "content": "ADVERTISING_ADVERTISINGID_ADOFF" + }, "LIMITADTRACKING_ON_FOR_ADVERTISINGID": { - "method": "advertising.advertisingId", - "validationJsonPath": "result", - "content": "ADVERTISING_ADVERTISINGID_ADON" + "method": "advertising.advertisingId", + "validationJsonPath": "result", + "content": "ADVERTISING_ADVERTISINGID_ADON" }, - "RESET_IDENTIFIER_FOR_ADVERTISING":{ + "RESET_IDENTIFIER_FOR_ADVERTISING": { "method": "manage_advertising.resetIdentifier" }, - "NULL_FOR_ADVERTISING_RESETIDENTIFIER":{ + "NULL_FOR_ADVERTISING_RESETIDENTIFIER": { "method": "advertising.resetIdentifier", - "validationJsonPath": "result", - "content": "NULL" + "validationJsonPath": "result", + "content": "NULL" }, - "ADVERTISING_ONSKIPRESTRICTIONCHANGED":{ + "ADVERTISING_ONSKIPRESTRICTIONCHANGED": { "method": "manage_advertising.onSkipRestrictionChanged" }, - "GET_ADVERTISING_SKIPRESTRICTION":{ + "GET_ADVERTISING_SKIPRESTRICTION": { "method": "manage_advertising.skipRestriction" }, - "NONE_FOR_SKIPRESTRICTION":{ + "NONE_FOR_SKIPRESTRICTION": { "method": "advertising.skipRestriction", - "validationJsonPath": "result", - "content": "ADVERTISING_POLICY_NONE" + "validationJsonPath": "result", + "content": "ADVERTISING_POLICY_NONE" }, - "ADSUNWATCHED_FOR_SKIPRESTRICTION":{ + "ADSUNWATCHED_FOR_SKIPRESTRICTION": { "method": "advertising.skipRestriction", - "validationJsonPath": "result", - "content": "ADVERTISING_POLICY_ADSUNWATCHED" + "validationJsonPath": "result", + "content": "ADVERTISING_POLICY_ADSUNWATCHED" }, - "ADSALL_FOR_SKIPRESTRICTION":{ + "ADSALL_FOR_SKIPRESTRICTION": { "method": "advertising.skipRestriction", - "validationJsonPath": "result", - "content": "ADVERTISING_POLICY_ADSALL" + "validationJsonPath": "result", + "content": "ADVERTISING_POLICY_ADSALL" }, - "ALL_FOR_SKIPRESTRICTION":{ + "ALL_FOR_SKIPRESTRICTION": { "method": "advertising.skipRestriction", - "validationJsonPath": "result", - "content": "ADVERTISING_POLICY_ALL" + "validationJsonPath": "result", + "content": "ADVERTISING_POLICY_ALL" }, - "ONSKIPRESTRICTIONCHANGED_WITH_NONE":{ + "ONSKIPRESTRICTIONCHANGED_WITH_NONE": { "event": "advertising.onSkipRestrictionChanged", - "validationJsonPath": "eventResponse", - "content": "ADVERTISING_POLICY_NONE" + "validationJsonPath": "eventResponse", + "content": "ADVERTISING_POLICY_NONE" }, - "ONSKIPRESTRICTIONCHANGED_WITH_ADSUNWATCHED":{ + "ONSKIPRESTRICTIONCHANGED_WITH_ADSUNWATCHED": { "event": "advertising.onSkipRestrictionChanged", - "validationJsonPath": "eventResponse", - "content": "ADVERTISING_POLICY_ADSUNWATCHED" + "validationJsonPath": "eventResponse", + "content": "ADVERTISING_POLICY_ADSUNWATCHED" }, - "ONSKIPRESTRICTIONCHANGED_WITH_ADSALL":{ + "ONSKIPRESTRICTIONCHANGED_WITH_ADSALL": { "event": "advertising.onSkipRestrictionChanged", - "validationJsonPath": "eventResponse", - "content": "ADVERTISING_POLICY_ADSALL" + "validationJsonPath": "eventResponse", + "content": "ADVERTISING_POLICY_ADSALL" }, - "ONSKIPRESTRICTIONCHANGED_WITH_ALL":{ + "ONSKIPRESTRICTIONCHANGED_WITH_ALL": { "event": "advertising.onSkipRestrictionChanged", - "validationJsonPath": "eventResponse", - "content": "ADVERTISING_POLICY_ALL" + "validationJsonPath": "eventResponse", + "content": "ADVERTISING_POLICY_ALL" }, - "SET_SKIPRESTRICTION_WITH_INTEGER":{ + "SET_SKIPRESTRICTION_WITH_INTEGER": { "method": "manage_advertising.setSkipRestriction", "params": "ADVERTISING_SKIPRESTRICTION_INTEGER_VALUE", "expected": "error" }, "INVALID_PARAMETERS_FOR_SKIPRESTRICTION": { - "method": "advertising.setSkipRestriction", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "method": "advertising.setSkipRestriction", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true - }, - "GET_ADVERTISINGID_WITHOUT_SCOPE":{ + }, + "GET_ADVERTISINGID_WITHOUT_SCOPE": { "method": "advertising.advertisingId", "params": "ADVERTISING_ADVERTISINGID_WITHOUT_SCOPE" }, - "GET_ADVERTISINGID_WITH_SCOPE_ID_AS_RANDOM_STRING":{ + "GET_ADVERTISINGID_WITH_SCOPE_ID_AS_RANDOM_STRING": { "method": "advertising.advertisingId", "params": "ADVERTISING_ADVERTISINGID_WITH_RANDOM_STRING_SCOPE_ID" }, - "GET_ADVERTISINGID_WITH_SCOPE_ID_AS_EMPTY_STRING":{ + "GET_ADVERTISINGID_WITH_SCOPE_ID_AS_EMPTY_STRING": { "method": "advertising.advertisingId", "params": "ADVERTISING_ADVERTISINGID_WITH_EMPTY_STRING_SCOPE_ID" }, - "GET_ADVERTISINGID_WITH_INVALID_SCOPE_TYPE":{ + "GET_ADVERTISINGID_WITH_INVALID_SCOPE_TYPE": { "method": "advertising.advertisingId", "params": "ADVERTISING_ADVERTISINGID_SCOPE_TYPE_INVALID_STRING", "expected": "error" }, - "GET_ADVERTISINGID_WITHOUT_SCOPE_TYPE_AND_ID":{ + "GET_ADVERTISINGID_WITHOUT_SCOPE_TYPE_AND_ID": { "method": "advertising.advertisingId", "params": "ADVERTISING_ADVERTISINGID_WITHOUT_SCOPE_TYPE_ID", "expected": "error" }, - "GET_ADVERTISINGID_WITHOUT_SCOPE_ID":{ + "GET_ADVERTISINGID_WITHOUT_SCOPE_ID": { "method": "advertising.advertisingId", "params": "ADVERTISING_ADVERTISINGID_WITHOUT_SCOPE_ID", "expected": "error" }, - "GET_ADVERTISINGID_WITHOUT_SCOPE_TYPE":{ + "GET_ADVERTISINGID_WITHOUT_SCOPE_TYPE": { "method": "advertising.advertisingId", "params": "ADVERTISING_ADVERTISINGID_WITHOUT_SCOPE_TYPE", "expected": "error" }, - "GET_ADVERTISINGID_WITH_INVALID_SCOPE":{ + "GET_ADVERTISINGID_WITH_INVALID_SCOPE": { "method": "advertising.advertisingId", "params": "ADVERTISING_ADVERTISINGID_WITHOUT_SCOPE_TYPE", "expected": "error" }, - "SET_TRUE_FOR_ALLOWAPPCONTENTADTARGETING":{ + "SET_TRUE_FOR_ALLOWAPPCONTENTADTARGETING": { "method": "manage_privacy.setAllowAppContentAdTargeting", "params": "TRUE" }, @@ -346,7 +346,7 @@ "validationJsonPath": "eventResponse", "content": "NULL" }, - "EXPECT_ERROR_FOR_ADVERTISING_POLICY":{ + "EXPECT_ERROR_FOR_ADVERTISING_POLICY": { "method": "advertising.policy", "expected": "error" }, diff --git a/cypress/fixtures/fireboltCalls/authentication.js b/cypress/fixtures/fireboltCalls/authentication.js new file mode 100644 index 000000000..f88211329 --- /dev/null +++ b/cypress/fixtures/fireboltCalls/authentication.js @@ -0,0 +1,199 @@ +/** + * 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 + */ +const errorContent = require('../objects/errorContentObjects.js'); +exports.AUTHENTICATION_VARIABLES = { + DEFAULTS: { + AUTHENTICATION: { + DECODE_JWT_AUTHENTICATION_TOKEN: { + data: [ + { + type: 'decode', + specialCase: 'jwt', + validations: [ + { + field: 'iat', + mode: 'regex', + format: 'TOKEN_JWT_REGEXP', + type: '^[0-9]+$', + description: 'Validation of the Authentication Token issueDate Format', + }, + ], + }, + { + type: 'decode', + specialCase: 'jwt', + validations: [ + { + field: 'partnerId', + mode: 'regex', + format: 'TOKEN_JWT_REGEXP', + type: '^[A-Za-z]*$', + description: 'Validation of the Authentication Token partner Format', + }, + ], + }, + ], + }, + DECODE_BASE64_AUTHENTICATION_TOKEN: { + data: [ + { + type: 'decode', + specialCase: 'base64', + validations: [ + { + field: 'issueDate', + mode: 'regex', + format: 'TOKEN_REGEXP', + type: '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])', + description: 'Validation of the Authentication Token issueDate Format', + }, + ], + }, + { + type: 'decode', + specialCase: 'base64', + validations: [ + { + field: 'notOnOrAfter', + mode: 'regex', + format: 'TOKEN_REGEXP', + type: '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])', + description: 'Validation of the Authentication Token notOnOrAfter Format', + }, + ], + }, + ], + }, + DECODE_BASE64_AUTHENTICATION_DEVICE_TOKEN: { + data: [ + { + type: 'decode', + specialCase: 'base64', + validations: [ + { + field: 'issueDate', + mode: 'regex', + format: 'TOKEN_REGEXP', + type: '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])', + description: 'Validation of the Authentication Token issueDate Format', + }, + ], + }, + ], + }, + }, + }, +}; + +exports.GET_THE_AUTHENTICATION_TOKEN_FOR_PLATFORM = { + method: 'authentication.token', + params: { type: 'platform' }, +}; + +exports.PLATFORM_AUTHENTICATION_TOKEN = { + method: 'authentication.token', + validationJsonPath: 'result', + content: this.AUTHENTICATION_VARIABLES.DEFAULTS.AUTHENTICATION.DECODE_JWT_AUTHENTICATION_TOKEN, +}; + +exports.GET_THE_AUTHENTICATION_TOKEN_FOR_DEVICE = { + method: 'authentication.token', + params: { type: 'device' }, +}; + +exports.DECODE_BASE64_AUTHENTICATION_TOKEN = { + method: 'authentication.token', + validationJsonPath: 'result', + content: this.AUTHENTICATION_VARIABLES.DEFAULTS.AUTHENTICATION.DECODE_BASE64_AUTHENTICATION_TOKEN, +}; + +exports.GET_THE_AUTHENTICATION_TOKEN_FOR_DISTRIBUTOR = { + method: 'authentication.token', + params: { type: 'distributor' }, +}; + +exports.GET_THE_AUTHENTICATION_TOKEN_FOR_DISTRIBUTOR_CIMA = { + method: 'authentication.token', + params: { type: 'distributor', options: { clientId: 'CIMA' } }, +}; + +exports.GET_THE_AUTHENTICATION_TOKEN_FOR_DISTRIBUTOR_OAT = { + method: 'authentication.token', + params: { type: 'distributor', options: { clientId: 'OAT' } }, +}; + +exports.FETCH_DEVICE_TOKEN = { + method: 'authentication.device', + params: {}, +}; + +exports.AUTHENTICATION_DEVICE = { + method: 'authentication.device', + validationJsonPath: 'result', + content: + this.AUTHENTICATION_VARIABLES.DEFAULTS.AUTHENTICATION.DECODE_BASE64_AUTHENTICATION_DEVICE_TOKEN, +}; + +exports.FETCH_SESSION_TOKEN = { + method: 'authentication.session', + params: {}, +}; + +exports.AUTHENTICATION_SESSION = { + method: 'authentication.session', + validationJsonPath: 'result', + content: + this.AUTHENTICATION_VARIABLES.DEFAULTS.AUTHENTICATION.DECODE_BASE64_AUTHENTICATION_DEVICE_TOKEN, +}; + +exports.FETCH_ROOT_TOKEN = { + method: 'authentication.root', + params: {}, +}; + +exports.AUTHENTICATION_ROOT = { + method: 'authentication.root', + validationJsonPath: 'result', + content: + this.AUTHENTICATION_VARIABLES.DEFAULTS.AUTHENTICATION.DECODE_BASE64_AUTHENTICATION_DEVICE_TOKEN, +}; + +exports.GET_TOKEN_WITH_PLATFORM1_PARAMETER = { + method: 'authentication.token', + params: { type: 'platform1' }, + expected: 'error', +}; + +exports.GET_TOKEN_WITH_TRUE_PARAMETER = { + method: 'authentication.token', + params: { value: true }, + expected: 'error', +}; + +exports.GET_TOKEN_WITH_INTEGER_PARAMETER = { + method: 'authentication.token', + params: { value: 123 }, + expected: 'error', +}; + +exports.INVALID_PARAMETER_ERROR_AUTHENTICATION_TOKEN = { + method: 'authentication.token', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; diff --git a/cypress/fixtures/fireboltCalls/authentication.json b/cypress/fixtures/fireboltCalls/authentication.json index 8d1700d81..29e1f606b 100644 --- a/cypress/fixtures/fireboltCalls/authentication.json +++ b/cypress/fixtures/fireboltCalls/authentication.json @@ -1,82 +1,82 @@ { - "GET_THE_AUTHENTICATION_TOKEN_FOR_PLATFORM":{ + "GET_THE_AUTHENTICATION_TOKEN_FOR_PLATFORM": { "method": "authentication.token", "params": "AUTHENTICATION_PLATFORM" }, - "GET_THE_AUTHENTICATION_TOKEN_FOR_DEVICE":{ + "GET_THE_AUTHENTICATION_TOKEN_FOR_DEVICE": { "method": "authentication.token", "params": "AUTHENTICATION_DEVICE" }, - "GET_THE_AUTHENTICATION_TOKEN_FOR_DISTRIBUTOR":{ + "GET_THE_AUTHENTICATION_TOKEN_FOR_DISTRIBUTOR": { "method": "authentication.token", "params": "AUTHENTICATION_DISTRIBUTOR" }, - "GET_THE_AUTHENTICATION_TOKEN_FOR_DISTRIBUTOR_CIMA":{ + "GET_THE_AUTHENTICATION_TOKEN_FOR_DISTRIBUTOR_CIMA": { "method": "authentication.token", "params": "AUTHENTICATION_DISTRIBUTOR_CIMA" }, - "GET_THE_AUTHENTICATION_TOKEN_FOR_DISTRIBUTOR_OAT":{ + "GET_THE_AUTHENTICATION_TOKEN_FOR_DISTRIBUTOR_OAT": { "method": "authentication.token", "params": "AUTHENTICATION_DISTRIBUTOR_OAT" }, - "FETCH_DEVICE_TOKEN":{ + "FETCH_DEVICE_TOKEN": { "method": "authentication.device" }, - "FETCH_SESSION_TOKEN":{ + "FETCH_SESSION_TOKEN": { "method": "authentication.session" }, - "FETCH_ROOT_TOKEN":{ + "FETCH_ROOT_TOKEN": { "method": "authentication.root" }, - "GET_TOKEN_WITH_PLATFORM1_PARAMETER":{ + "GET_TOKEN_WITH_PLATFORM1_PARAMETER": { "method": "authentication.token", "params": "AUTHENTICATION_PLATFORM1", "expected": "error" }, - "GET_TOKEN_WITH_TRUE_PARAMETER":{ + "GET_TOKEN_WITH_TRUE_PARAMETER": { "method": "authentication.token", "params": "TRUE", "expected": "error" }, - "GET_TOKEN_WITH_INTEGER_PARAMETER":{ + "GET_TOKEN_WITH_INTEGER_PARAMETER": { "method": "authentication.token", "params": "INTEGER123", "expected": "error" }, "PLATFORM_AUTHENTICATION_TOKEN": { - "method": "authentication.token", - "validationJsonPath": "result", - "content": "AUTHENTICATION_DECODE_JWT_AUTHENTICATION_TOKEN" - }, + "method": "authentication.token", + "validationJsonPath": "result", + "content": "AUTHENTICATION_DECODE_JWT_AUTHENTICATION_TOKEN" + }, "DECODE_BASE64_AUTHENTICATION_TOKEN": { - "method": "authentication.token", - "validationJsonPath": "result", - "content": "AUTHENTICATION_DECODE_BASE64_AUTHENTICATION_TOKEN" - }, + "method": "authentication.token", + "validationJsonPath": "result", + "content": "AUTHENTICATION_DECODE_BASE64_AUTHENTICATION_TOKEN" + }, "AUTHENTICATION_DEVICE": { - "method": "authentication.device", - "validationJsonPath": "result", - "content": "AUTHENTICATION_DECODE_BASE64_AUTHENTICATION_DEVICE_TOKEN" - }, + "method": "authentication.device", + "validationJsonPath": "result", + "content": "AUTHENTICATION_DECODE_BASE64_AUTHENTICATION_DEVICE_TOKEN" + }, "AUTHENTICATION_SESSION": { - "method": "authentication.session", - "validationJsonPath": "result", - "content": "AUTHENTICATION_DECODE_BASE64_AUTHENTICATION_SESSION_TOKEN" - }, + "method": "authentication.session", + "validationJsonPath": "result", + "content": "AUTHENTICATION_DECODE_BASE64_AUTHENTICATION_SESSION_TOKEN" + }, "AUTHENTICATION_ROOT": { - "method": "authentication.root", - "validationJsonPath": "result", - "content": "AUTHENTICATION_DECODE_BASE64_AUTHENTICATION_ROOT_TOKEN" - }, + "method": "authentication.root", + "validationJsonPath": "result", + "content": "AUTHENTICATION_DECODE_BASE64_AUTHENTICATION_ROOT_TOKEN" + }, "INVALID_PARAMETER_ERROR_AUTHENTICATION_TOKEN": { - "method": "authentication.token", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "method": "authentication.token", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true - }, - "EXPECT_ERROR_FOR_DEVICE_TOKEN":{ + }, + "EXPECT_ERROR_FOR_DEVICE_TOKEN": { "method": "authentication.device", - "expected": "error" + "expected": "error" }, "INVALID_REQUEST_FOR_AUTHENTICATION_DEVICE": { "method": "authentication.device", diff --git a/cypress/fixtures/fireboltCalls/device.js b/cypress/fixtures/fireboltCalls/device.js index 92f35c36b..22bce0234 100644 --- a/cypress/fixtures/fireboltCalls/device.js +++ b/cypress/fixtures/fireboltCalls/device.js @@ -1,3 +1,21 @@ +/** + * 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 + */ +const errorContent = require('../objects/errorContentObjects.js'); exports.DEVICE_NAME = { method: 'manage_device.name', params: {}, @@ -53,3 +71,581 @@ exports.DEVICE_NAME_CORE = { ], }, }; + +exports.DEVICE_VARIABLES = { + DEVICE: { + id: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'deviceContentValidation', + type: extractEnvValue('DEVICEID'), + description: 'Validation of the Device Id Format', + }, + ], + }, + ], + }, + distributor: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'deviceContentValidation', + type: extractEnvValue('DEVICE_DISTRIBUTOR'), + description: 'Validation of the Device Distributor Format', + }, + ], + }, + ], + }, + uid: { + data: [ + { + type: 'regEx', + validations: [ + { + mode: 'regex', + type: '/^(?:.*d)(?:.*[a-zA-Z]).{2,}$/', + description: 'Validation of the Device uid', + }, + ], + }, + ], + }, + type: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'deviceContentValidation', + type: extractEnvValue('DEVICE_TYPE'), + description: 'Validation of the Device Type Format', + }, + ], + }, + ], + }, + model: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'deviceContentValidation', + type: extractEnvValue('DEVICE_MODEL'), + description: 'Validation of the Device Model Format', + }, + ], + }, + ], + }, + sku: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'deviceContentValidation', + type: extractEnvValue('DEVICE_SKU'), + description: 'Validation of the Device SKU Format', + }, + ], + }, + ], + }, + make: { + data: [ + { + type: 'fixture', + validations: [ + { + mode: 'deviceContentValidation', + type: extractEnvValue('DEVICE_MAKE'), + description: 'Validation of the Device Make Format', + }, + ], + }, + ], + }, + hdcp: { + data: [ + { + type: 'miscellaneous', + validations: [ + { + mode: 'fixture', + type: 'HDCP', + description: 'Validation of the Device hdcp', + }, + ], + }, + ], + }, + hdr: { + data: [ + { + type: 'miscellaneous', + validations: [ + { + mode: 'fixture', + type: 'HDR', + description: 'Validation of the Device hdr', + }, + ], + }, + ], + }, + screenResolution: { + data: [ + { + type: 'miscellaneous', + validations: [ + { + mode: 'fixture', + type: [ + [1280, 720], + [1920, 1080], + [3840, 2160], + ], + description: 'Validation of the Device screenResolution', + }, + ], + }, + ], + }, + videoResolution: { + data: [ + { + type: 'miscellaneous', + validations: [ + { + mode: 'fixture', + type: extractEnvValue('CYPRESSENV-defaultTestData-deviceResolution'), + description: 'Validation of the Device videoResolution', + }, + ], + }, + ], + }, + audio: { + data: [ + { + type: 'miscellaneous', + validations: [ + { + mode: 'fixture', + type: 'AUDIO', + description: 'Validation of the Device audio', + }, + ], + }, + ], + }, + version: { + data: [ + { + type: 'schemaOnly', + }, + ], + }, + }, +}; + +exports.DEVICE = { + method: resolveAtRuntime('device.{{attribute}}'), + params: {}, +}; + +exports.EXPECTED_DEVICE_ID = { + method: 'device.id', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.id, +}; + +exports.EXPECTED_DEVICE_DISTRIBUTOR = { + method: 'device.distributor', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.distributor, +}; + +exports.EXPECTED_DEVICE_UID = { + method: 'device.uid', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.uid, +}; + +exports.EXPECTED_DEVICE_TYPE = { + method: 'device.type', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.type, +}; + +exports.EXPECTED_DEVICE_MODEL = { + method: 'device.model', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.model, +}; + +exports.EXPECTED_DEVICE_SKU = { + method: 'device.sku', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.sku, +}; + +exports.EXPECTED_DEVICE_MAKE = { + method: 'device.make', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.make, +}; + +exports.EXPECTED_DEVICE_VERSION = { + method: 'device.version', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.version, +}; + +exports.EXPECTED_DEVICE_HDCP = { + method: 'device.hdcp', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.hdcp, +}; + +exports.EXPECTED_DEVICE_HDR = { + method: 'device.hdr', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.hdr, +}; + +exports.EXPECTED_DEVICE_SCREENRESOLUTION = { + method: 'device.screenResolution', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.screenResolution, +}; + +exports.EXPECTED_DEVICE_VIDEORESOLUTION = { + method: 'device.videoResolution', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.videoResolution, +}; + +exports.EXPECTED_DEVICE_AUDIO = { + method: 'device.audio', + validationJsonPath: 'result', + content: this.DEVICE_VARIABLES.DEVICE.audio, +}; + +exports.STATIC_COMMON_VARIABLES = { + DEFAULT: { + NETWORK_WIFI_CONNECTED: { + state: 'connected', + type: 'wifi', + }, + NETWORK_WIFI_DISCONNECTED: { + state: 'connected', + type: 'ethernet', + }, + NETWORK_ETHERNET_CONNECTED: { + state: 'connected', + type: 'ethernet', + }, + NETWORK_ETHERNET_DISCONNECTED: { + state: 'connected', + type: 'wifi', + }, + NETWORK_HYBRID_CONNECTED: { + state: 'connected', + type: 'hybrid', + }, + NETWORK_HYBRID_DISCONNECTED: { + state: 'disconnected', + type: 'hybrid', + }, + NETWORK_WIFI_DISCONNECTED_EVENT: { + state: 'disconnected', + type: 'wifi', + }, + NETWORK_ETHERNET_DISCONNECTED_EVENT: { + state: 'disconnected', + type: 'ethernet', + }, + }, +}; + +exports.FETCH_DEVICE_PLATFORM = { + method: 'device.platform', + params: {}, +}; + +exports.EXPECTED_DEVICE_PLATFORM = { + method: 'device.platform', + validationJsonPath: 'result', + content: '', +}; + +exports.DEVICE_ONNAMECHANGED = { + method: 'device.onNameChanged', + params: {}, +}; + +exports.DEVICE_ONNAMECHANGED_EVENT = { + event: 'device.onNameChanged', + firstParty: false, +}; + +exports.SET_DEVICE_NAME_TO_KITCHEN = { + method: 'manage_device.setName', + params: { value: 'kitchen' }, +}; + +exports.ONDEVICENAMECHANGED = { + event: 'device.onNameChanged', + validationJsonPath: 'eventResponse', + content: null, +}; + +exports.DEVICE_ONNETWORKCHANGED = { + method: 'device.onNetworkChanged', + params: {}, +}; + +exports.FETCH_DEVICE_NETWORK = { + method: 'device.network', + params: {}, +}; + +exports.DEVICE_NETWORK_AS_WIFI_CONNECTED = { + method: 'device.network', + validationJsonPath: 'result', + content: this.STATIC_COMMON_VARIABLES.DEFAULT.NETWORK_WIFI_CONNECTED, +}; + +exports.DEVICE_NETWORK_AS_WIFI_DISCONNECTED = { + method: 'device.network', + validationJsonPath: 'result', + content: this.STATIC_COMMON_VARIABLES.DEFAULT.NETWORK_WIFI_DISCONNECTED, +}; + +exports.DEVICE_NETWORK_AS_ETHERNET_CONNECTED = { + method: 'device.network', + validationJsonPath: 'result', + content: this.STATIC_COMMON_VARIABLES.DEFAULT.NETWORK_ETHERNET_CONNECTED, +}; + +exports.DEVICE_NETWORK_AS_ETHERNET_DISCONNECTED = { + method: 'device.network', + validationJsonPath: 'result', + content: this.STATIC_COMMON_VARIABLES.DEFAULT.NETWORK_ETHERNET_DISCONNECTED, +}; + +exports.DEVICE_NETWORK_AS_HYBRID_CONNECTED = { + method: 'device.network', + validationJsonPath: 'result', + content: this.STATIC_COMMON_VARIABLES.DEFAULT.NETWORK_HYBRID_CONNECTED, +}; + +exports.DEVICE_NETWORK_AS_HYBRID_DISCONNECTED = { + method: 'device.network', + validationJsonPath: 'result', + content: this.STATIC_COMMON_VARIABLES.DEFAULT.NETWORK_HYBRID_DISCONNECTED, +}; + +exports.ONNETWORKCHANGED_WITH_WIFI_CONNECTED = { + event: 'device.onNetworkChanged', + validationJsonPath: 'result', + content: this.STATIC_COMMON_VARIABLES.DEFAULT.NETWORK_WIFI_CONNECTED, +}; + +exports.ONNETWORKCHANGED_WITH_WIFI_DISCONNECTED = { + event: 'device.onNetworkChanged', + validationJsonPath: 'result', + content: this.STATIC_COMMON_VARIABLES.DEFAULT.NETWORK_WIFI_DISCONNECTED, +}; + +exports.ONNETWORKCHANGED_WITH_ETHERNET_CONNECTED = { + event: 'device.onNetworkChanged', + validationJsonPath: 'result', + content: this.STATIC_COMMON_VARIABLES.DEFAULT.NETWORK_ETHERNET_CONNECTED, +}; + +exports.ONNETWORKCHANGED_WITH_ETHERNET_DISCONNECTED = { + event: 'device.onNetworkChanged', + validationJsonPath: 'result', + content: this.STATIC_COMMON_VARIABLES.DEFAULT.NETWORK_ETHERNET_DISCONNECTED, +}; + +exports.ONNETWORKCHANGED_WITH_HYBRID_CONNECTED = { + event: 'device.onNetworkChanged', + validationJsonPath: 'result', + content: this.STATIC_COMMON_VARIABLES.DEFAULT.NETWORK_HYBRID_CONNECTED, +}; + +exports.ONNETWORKCHANGED_WITH_HYBRID_DISCONNECTED = { + event: 'device.onNetworkChanged', + validationJsonPath: 'result', + content: this.STATIC_COMMON_VARIABLES.DEFAULT.NETWORK_HYBRID_DISCONNECTED, +}; + +exports.ONNETWORKCHANGED_EVENTS_WITH_WIFI_CONNECTED = { + method: 'device.onNetworkChanged', + params: { + result: { + state: 'connected', + type: 'wifi', + }, + }, +}; + +exports.ONNETWORKCHANGED_EVENTS_WITH_WIFI_DISCONNECTED = { + method: 'device.onNetworkChanged', + params: { + result: { + state: 'disconnected', + type: 'wifi', + }, + }, +}; + +exports.ONNETWORKCHANGED_EVENTS_WITH_ETHERNET_CONNECTED = { + method: 'device.onNetworkChanged', + params: { + result: { + state: 'connected', + type: 'ethernet', + }, + }, +}; + +exports.ONNETWORKCHANGED_EVENTS_WITH_ETHERNET_DISCONNECTED = { + method: 'device.onNetworkChanged', + params: { + result: { + state: 'disconnected', + type: 'ethernet', + }, + }, +}; + +exports.ONNETWORKCHANGED_EVENTS_WITH_HYBRID_CONNECTED = { + method: 'device.onNetworkChanged', + params: {}, + result: { + state: 'connected', + type: 'hybrid', + }, +}; + +exports.ONNETWORKCHANGED_EVENTS_WITH_HYBRID_DISCONNECTED = { + method: 'device.onNetworkChanged', + params: {}, + result: { + state: 'disconnected', + type: 'hybrid', + }, +}; + +exports.PROVISION_DEVICE_WITH_DEFAULT_VALUES = { + method: 'manage_device.provision', + params: { + accountId: '1234', + deviceId: '1234', + }, +}; + +exports.DEFAULT_VALUE_FOR_DEVICE_PROVISION = { + method: 'device.provision', + validationJsonPath: 'result', + content: null, +}; + +exports.PROVISION_DEVICE_WITH_DISTRIBUTOR_ID = { + method: 'manage_device.provision', + params: { + accountId: '1234', + deviceId: '1234', + distributorId: 'global_partner', + }, +}; + +exports.DISTRIBUTOR_ID_FOR_DEVICE_PROVISION = { + method: 'device.provision', + validationJsonPath: 'result', + content: extractEnvValue('DEVICE_DISTRIBUTOR'), +}; + +exports.GET_DEVICE_ID = { + method: 'device.id', + params: {}, +}; + +exports.GET_ACCOUNT_ID = { + method: 'account.id', + params: {}, +}; + +exports.EXPECTED_PROVISION_DEVICE_ID = { + method: 'device.id', + validationJsonPath: 'result', + content: '1234', +}; + +exports.EXPECTED_PROVISION_ACCOUNT_ID = { + method: 'account.id', + validationJsonPath: 'result', + content: '1234', +}; + +exports.FETCH_DEVICE_DISTRIBUTOR = { + method: 'device.distributor', + params: {}, +}; + +exports.INVALID_PARAMETERS_FOR_DEVICE_PROVISION = { + method: 'device.provision', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; + +exports.PROVISION_DEVICE_WITH_INTEGER = { + method: 'manage_device.provision', + params: { value: 123 }, + expected: 'error', +}; + +exports.PROVISION_DEVICE_WITH_BOOLEAN = { + method: 'manage_device.provision', + params: { value: true }, + expected: 'error', +}; + +exports.PROVISION_DEVICE_WITHOUT_DEVICEID = { + method: 'manage_device.provision', + params: { + accountId: '12345678910', + }, + expected: 'error', +}; + +exports.PROVISION_DEVICE_WITH_EMPTY_PARAMS = { + method: 'manage_device.provision', + params: {}, + expected: 'error', +}; + +exports.PROVISION_DEVICE_WITHOUT_ACCOUNTID = { + method: 'manage_device.provision', + params: { + deviceId: '1234', + }, + expected: 'error', +}; + +exports.SET_DEVICE_NAME_TO_LIVING_ROOM = { + method: 'manage_device.setName', + params: { value: 'Living Room' }, +}; diff --git a/cypress/fixtures/fireboltCalls/device.json b/cypress/fixtures/fireboltCalls/device.json index f69641d05..d6f7f6036 100644 --- a/cypress/fixtures/fireboltCalls/device.json +++ b/cypress/fixtures/fireboltCalls/device.json @@ -143,11 +143,11 @@ "validationJsonPath": "result", "content": "DEVICE_AUDIO" }, - "SET_DEVICE_NAME_TO_BEDROOM":{ + "SET_DEVICE_NAME_TO_BEDROOM": { "method": "manage_device.setName", - "params": "Bedroom" + "params": "Bedroom" }, - "GET_MANAGE_DEVICE_NAME":{ + "GET_MANAGE_DEVICE_NAME": { "method": "manage_device.name" }, "BEDROOM_FOR_DEVICE_NAME": { @@ -160,28 +160,28 @@ "validationJsonPath": "eventResponse", "content": "DEVICE_BEDROOM_NAME" }, - "PROVISION_DEVICE_WITH_DEFAULT_VALUES":{ + "PROVISION_DEVICE_WITH_DEFAULT_VALUES": { "method": "manage_device.provision", - "params": "DEVICE_PROVISION_DEFAULT_VALUES" + "params": "DEVICE_PROVISION_DEFAULT_VALUES" }, "DEFAULT_VALUES_FOR_DEVICE_PROVISION": { "method": "device.provision", "validationJsonPath": "result", "content": "DEVICE_PROVISION_DEFAULT_CONTENT" }, - "PROVISION_DEVICE_WITH_DISTRIBUTOR_ID":{ + "PROVISION_DEVICE_WITH_DISTRIBUTOR_ID": { "method": "manage_device.provision", - "params": "DEVICE_PROVISION_WITH_DISTRIBUTOR_ID" + "params": "DEVICE_PROVISION_WITH_DISTRIBUTOR_ID" }, "DISTRIBUTOR_ID_FOR_DEVICE_PROVISION": { "method": "device.provision", "validationJsonPath": "result", "content": "DEVICE_PROVISION_WITH_DISTRIBUTOR_ID_CONTENT" }, - "GET_DEVICE_ID":{ + "GET_DEVICE_ID": { "method": "device.id" }, - "GET_ACCOUNT_ID":{ + "GET_ACCOUNT_ID": { "method": "account.id" }, "EXPECTED_PROVISION_DEVICE_ID": { @@ -208,57 +208,57 @@ "validationJsonPath": "result", "content": "DEVICE_DISTRIBUTOR" }, - "SET_DEVICE_NAME_WITH_INTEGER":{ + "SET_DEVICE_NAME_WITH_INTEGER": { "method": "manage_device.setName", - "params": "INTEGER123", + "params": "INTEGER123", "expected": "error" }, - "SET_DEVICE_NAME_WITH_BOOLEAN":{ + "SET_DEVICE_NAME_WITH_BOOLEAN": { "method": "manage_device.setName", - "params": "TRUE", + "params": "TRUE", "expected": "error" }, - "INVALID_PARAMETERS_FOR_DEVICE":{ + "INVALID_PARAMETERS_FOR_DEVICE": { "method": "device.setName", "validationJsonPath": "result", "content": "INVALID_TYPE_PARAMS", "expectingError": true }, - "INVALID_REQUEST_FOR_DEVICE_DISTRIBUTOR":{ + "INVALID_REQUEST_FOR_DEVICE_DISTRIBUTOR": { "method": "device.distributor", "validationJsonPath": "result", "content": "INVALID_TYPE_PARAMS", "expectingError": true }, - "INVALID_PARAMETERS_FOR_DEVICE_PROVISION":{ + "INVALID_PARAMETERS_FOR_DEVICE_PROVISION": { "method": "device.provision", "validationJsonPath": "result", "content": "INVALID_TYPE_PARAMS", "expectingError": true }, - "PROVISION_DEVICE_WITH_INTEGER":{ + "PROVISION_DEVICE_WITH_INTEGER": { "method": "manage_device.provision", - "params": "INTEGER123", + "params": "INTEGER123", "expected": "error" }, - "PROVISION_DEVICE_WITH_BOOLEAN":{ + "PROVISION_DEVICE_WITH_BOOLEAN": { "method": "manage_device.provision", - "params": "TRUE", + "params": "TRUE", "expected": "error" }, - "PROVISION_DEVICE_WITHOUT_DEVICEID":{ + "PROVISION_DEVICE_WITHOUT_DEVICEID": { "method": "manage_device.provision", - "params": "DEVICE_PROVISION_WITHOUT_DEVICEID", + "params": "DEVICE_PROVISION_WITHOUT_DEVICEID", "expected": "error" }, - "PROVISION_DEVICE_WITH_EMPTY_PARAMS":{ + "PROVISION_DEVICE_WITH_EMPTY_PARAMS": { "method": "manage_device.provision", - "params": "DEVICE_PROVISION_EMPTY_PARAMS", + "params": "DEVICE_PROVISION_EMPTY_PARAMS", "expected": "error" }, - "PROVISION_DEVICE_WITHOUT_ACCOUNTID":{ + "PROVISION_DEVICE_WITHOUT_ACCOUNTID": { "method": "manage_device.provision", - "params": "DEVICE_PROVISION_WITHOUT_ACCOUNTID", + "params": "DEVICE_PROVISION_WITHOUT_ACCOUNTID", "expected": "error" }, "SET_DEVICE_NAME_WITHOUT_PARAMETERS": { diff --git a/cypress/fixtures/fireboltCalls/discovery.js b/cypress/fixtures/fireboltCalls/discovery.js index 8f8e2e328..32fc03f7b 100644 --- a/cypress/fixtures/fireboltCalls/discovery.js +++ b/cypress/fixtures/fireboltCalls/discovery.js @@ -1,3 +1,21 @@ +/** + * 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 + */ +const errorContent = require('../objects/errorContentObjects.js'); exports.DISCOVERY_RECOMMENDATIONS = { method: 'discovery.policy', params: {}, @@ -72,3 +90,864 @@ exports.DISCOVERY_CLEAR_CONTENTACCESS = { ], }, }; + +exports.DISCOVERY_COMMON_VARIABLES = { + DISCOVERY: { + SIGNIN_WITH_ENTITILEMENTS: { + entitlements: [ + { + entitlementId: 'test-entitlement-firecert-1', + startTime: '2025-01-01T00:00:00.000Z', + endTime: '2025-01-01T00:00:00.000Z', + }, + ], + }, + WATCHED_ONLY_ENTITY_ID: { + entityId: 'partner.com/entity/123', + }, + WATCHED_ENTITY_ID_PROGRESS: { + entityId: 'partner.com/entity/123', + progress: 0.95, + }, + WATCHED_ENTITY_ID_PROGRESS_STATUS: { + entityId: 'partner.com/entity/123', + progress: 0.95, + completed: true, + }, + WATCHED_ENTITY_ID_PROGRESS_STATUS_DATE: { + entityId: 'partner.com/entity/123', + progress: 0.95, + completed: true, + watchedOn: '2021-04-23T18:25:43.511Z', + }, + WATCHNEXT_ONLY_TITLE_IDENTIFIERS_ENTITYID: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + }, + }, + WATCHNEXT_ONLY_TITLE_IDENTIFIERS_ENTITYID_ASSETID: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + assetId: '123bjs13', + }, + }, + WATCHNEXT_ONLY_TITLE_IDENTIFIERS_ENTITYID_ASSETID_SESSIONID: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + assetId: '123bjs13', + seasonId: 'SE02', + }, + }, + WATCHNEXT_ONLY_TITLE_IDENTIFIERS_ENTITYID_ASSETID_SESSIONID_SERIESID: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + assetId: '123bjs13', + seasonId: 'SE02', + seriesId: 'GOT', + }, + }, + WATCHNEXT_ONLY_TITLE_IDENTIFIERS_ENTITYID_ASSETID_SESSIONID_SERIESID_APPCONTENTDATA: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + assetId: '123bjs13', + seasonId: 'SE02', + seriesId: 'GOT', + appContentData: 'HBOMAX', + }, + }, + WATCHNEXT_ONLY_TITLE_IDENTIFIERS_EXPIRES: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + }, + expires: '2021-04-23T18:25:43.511Z', + }, + WATCHNEXT_ONLY_TITLE_IDENTIFIERS_EXPIRES_IMAGES: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + }, + expires: '2021-04-23T18:25:43.511Z', + images: { + '3x4': { + 'en-US': 'https://i.ytimg.com/vi/4r7wHMg5Yjg/maxresdefault.jpg', + es: 'https://i.ytimg.com/vi/4r7wHMg5Yjg/maxresdefault.jpg', + }, + '16x9': { + en: 'https://i.ytimg.com/vi/4r7wHMg5Yjg/maxresdefault.jpg', + }, + }, + }, + ENTITLEMENTS: { + entitlements: [ + { + entitlementId: 'test-entitlement-firecert-1', + startTime: '2025-01-01T00:00:00.000Z', + endTime: '2025-01-01T00:00:00.000Z', + }, + ], + }, + ENTITLEMENTS_ENTITLEMENTID_ONLY: { + entitlements: [ + { + entitlementId: 'test-entitlement-firecert-1', + }, + ], + }, + WATCHED_INVALID_ENTITY_ID_NUMBER: { + entityId: 123, + }, + WATCHED_INVALID_PROGRESS: { + entityId: 'partner.com/entity/123', + progress: -0.95, + }, + WATCHED_INVALID_PROGRESS_STRING: { + entityId: 'partner.com/entity/123', + progress: '0.95', + }, + WATCHED_INVALID_COMPLETED: { + entityId: 'partner.com/entity/123', + progress: 0.95, + completed: 'invalid value', + }, + WATCHED_INVALID_WATCHEDON: { + entityId: 'partner.com/entity/123', + progress: 0.95, + completed: true, + watchedOn: 123, + }, + WATCHNEXT_ONLY_TITLE: { + title: 'A Cool Show', + }, + WATCHNEXT_INVALID_IDENTIFIERS: { + title: 'A Cool Show', + identifiers: 'entityId', + }, + WATCHNEXT_INVALID_IDENTIFIERS_ENTITYID: { + title: 'A Cool Show', + identifiers: { + entityId: true, + }, + }, + WATCHNEXT_INVALID_IDENTIFIERS_ASSETID: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + assetId: 21, + }, + }, + WATCHNEXT_INVALID_IDENTIFIERS_SESSIONID: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + assetId: '123bjs13', + seasonId: 4, + }, + }, + WATCHNEXT_INVALID_IDENTIFIERS_SERIESID: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + assetId: '123bjs13', + seasonId: 'SE02', + seriesId: false, + }, + }, + WATCHNEXT_INVALID_IDENTIFIERS_APPCONTENTDATA: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + assetId: '123bjs13', + seasonId: 'SE02', + seriesId: 'GOT', + appContentData: 10, + }, + }, + WATCHNEXT_INVALID_EXPIRES: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + }, + expires: 'True', + }, + WATCHNEXT_INVALID_EXPIRES_INTEGER: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + }, + expires: 123, + }, + WATCHNEXT_INVALID_IMAGES: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + }, + expires: '2021-04-23T18:25:43.511Z', + '3X4': 'INVALID image', + }, + WATCHNEXT_INVALID_IMAGE_INTEGER: { + title: 'A Cool Show', + identifiers: { + entityId: 'partner.com/entity/567', + }, + expires: '2021-04-23T18:25:43.511Z', + images: 123, + }, + INVALID_ENTITLEMENTS_ENTITLEMENTID: { + entitlements: [ + { + startTime: '2025-01-01T00:00:00.000Z', + endTime: '2025-01-01T00:00:00.000Z', + }, + ], + }, + INVALID_ENTITLEMENTS_INTEGER_PARAMS: { + entitlements: [ + { + entitlementId: 123, + startTime: 123, + endTime: 123, + }, + ], + }, + SIGNIN_INVALID_ENTITLEMENTS: { + entitlements: [ + { + startTime: '2025-01-01T00:00:00.000Z', + endTime: '2025-01-01T00:00:00.000Z', + }, + ], + }, + CONTENTACCESS_AVAILABILITIES_ONLY_TYPE_ID: { + ids: { + availabilities: [ + { + type: 'program-lineup', + id: 'chmap-lineup-a-firecert', + }, + ], + }, + }, + CONTENTACCESS_WITH_AVAILABILITIES_AND_ENTITLEMENTS: { + ids: { + availabilities: [ + { + type: 'channel-lineup', + id: 'chmap-lineup-a-firecert', + startTime: '2021-04-23T18:25:43.511Z', + endTime: '2021-04-23T18:25:43.511Z', + }, + { + type: 'channel-lineup', + id: 'chmap-lineup-a-firecert', + startTime: '2021-04-23T18:25:43.511Z', + endTime: '2021-04-23T18:25:43.511Z', + }, + ], + entitlements: [ + { + entitlementId: 'test-entitlement-firecert-1', + startTime: '2025-01-01T00:00:00.000Z', + endTime: '2025-01-01T00:00:00.000Z', + }, + ], + }, + }, + CONTENTACCESS_WITH_ONLY_ENTITLEMENTS: { + ids: { + entitlements: [ + { + entitlementId: 'test-entitlement-firecert-1', + startTime: '2025-01-01T00:00:00.000Z', + endTime: '2025-01-01T00:00:00.000Z', + }, + ], + }, + }, + CONTENTACCESS_AVAILABILITIES_AS_EMPTY: { + ids: { + availabilities: [], + }, + }, + CONTENTACCESS_ENTITLEMENTS_AS_EMPTY: { + ids: { + entitlements: [], + }, + }, + CONTENTACCESS_AVAILABILITIES_WITHOUT_TYPE: { + ids: { + availabilities: [ + { + id: 'partner.com/availability/123', + catalogId: 'app1', + startTime: '2021-04-23T18:25:43.511Z', + endTime: '2021-04-23T18:25:43.511Z', + }, + ], + }, + }, + CONTENTACCESS_AVAILABILITIES_WITHOUT_ID: { + ids: { + availabilities: [ + { + type: 'program-lineup', + catalogId: 'app1', + startTime: '2021-04-23T18:25:43.511Z', + endTime: '2021-04-23T18:25:43.511Z', + }, + ], + }, + }, + CONTENTACCESS_AVAILABILITIES_INVALID_TYPE_VALUE: { + ids: { + availabilities: [ + { + type: 'device-lineup', + id: 'partner.com/availability/123', + catalogId: 'app1', + startTime: '2021-04-23T18:25:43.511Z', + endTime: '2021-04-23T18:25:43.511Z', + }, + ], + }, + }, + CONTENTACCESS_AVAILABILITIES_INVALID_DATATYPE_TYPE: { + ids: { + availabilities: [ + { + type: false, + id: 'partner.com/availability/123', + catalogId: 'app1', + startTime: '2021-04-23T18:25:43.511Z', + endTime: '2021-04-23T18:25:43.511Z', + }, + ], + }, + }, + CONTENTACCESS_AVAILABILITIES_INVALID_DATATYPE_ID: { + ids: { + availabilities: [ + { + type: 'program-lineup', + id: false, + catalogId: 'app1', + startTime: '2021-04-23T18:25:43.511Z', + endTime: '2021-04-23T18:25:43.511Z', + }, + ], + }, + }, + CONTENTACCESS_AVAILABILITIES_INVALID_DATATYPE_CATALOG_ID: { + ids: { + availabilities: [ + { + type: 'program-lineup', + id: 'partner.com/availability/123', + catalogId: 123, + startTime: '2021-04-23T18:25:43.511Z', + endTime: '2021-04-23T18:25:43.511Z', + }, + ], + }, + }, + CONTENTACCESS_AVAILABILITIES_INVALID_DATATYPE_START_TIME: { + ids: { + availabilities: [ + { + type: 'program-lineup', + id: 'partner.com/availability/123', + catalogId: 'app1', + startTime: true, + endTime: '2021-04-23T18:25:43.511Z', + }, + ], + }, + }, + CONTENTACCESS_AVAILABILITIES_INVALID_DATATYPE_END_TIME: { + ids: { + availabilities: [ + { + type: 'program-lineup', + id: 'partner.com/availability/123', + catalogId: 'app1', + startTime: '2021-04-23T18:25:43.511Z', + endTime: false, + }, + ], + }, + }, + CONTENTACCESS_ENTITLEMENTS_INVALID_ENTITLEMENTID_TRUE: { + ids: { + entitlements: [ + { + entitlementId: true, + startTime: '2025-01-01T00:00:00.000Z', + endTime: '2025-01-01T00:00:00.000Z', + }, + ], + }, + }, + CONTENTACCESS_ENTITLEMENTS_INVALID_ENTITLEMENTID_INTEGER: { + ids: { + entitlements: [ + { + entitlementId: 123, + startTime: '2025-01-01T00:00:00.000Z', + endTime: '2025-01-01T00:00:00.000Z', + }, + ], + }, + }, + CONTENTACCESS_ENTITLEMENTS_INVALID_START_TIME: { + ids: { + entitlements: [ + { + entitlementId: '123', + startTime: '01022023', + }, + ], + }, + }, + CONTENTACCESS_ENTITLEMENTS_INVALID_END_TIME: { + ids: { + entitlements: [ + { + entitlementId: '123', + endTime: '01022023', + }, + ], + }, + }, + }, +}; +exports.DISCOVERY_ONSIGNIN = { + method: 'manage_discovery.onSignIn', + params: {}, +}; + +exports.NOTIFY_USER_HAS_SIGNED_IN_WITH_ENTITLEMENTS = { + method: 'discovery.signIn', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.SIGNIN_WITH_ENTITILEMENTS, +}; + +exports.NOTIFY_USER_HAS_SIGNED_IN_WITHOUT_ENTITLEMENTS = { + method: 'discovery.signIn', + params: {}, +}; + +exports.DISCOVERY_ONSIGNOUT = { + method: 'manage_discovery.onSignOut', + params: {}, +}; + +exports.NOTIFY_USER_HAS_SIGNED_OUT = { + method: 'discovery.signOut', + params: {}, +}; + +exports.SIGNIN_FOR_DISCOVERY = { + method: 'discovery.signIn', + validationJsonPath: 'result', + content: true, +}; + +exports.SIGNOUT_FOR_DISCOVERY = { + method: 'discovery.signOut', + validationJsonPath: 'result', + content: true, +}; + +exports.NOTIFY_WATCHED_CONTENT_WITH_ONLY_ENTITYID = { + method: 'discovery.watched', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHED_ONLY_ENTITY_ID, +}; + +exports.NOTIFY_WATCHED_CONTENT_WITH_ENTITYID_PROGRESS = { + method: 'discovery.watched', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHED_ENTITY_ID_PROGRESS, +}; + +exports.NOTIFY_WATCHED_CONTENT_WITH_ENTITYID_PROGRESS_STATUS = { + method: 'discovery.watched', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHED_ENTITY_ID_PROGRESS_STATUS, +}; + +exports.NOTIFY_WATCHED_CONTENT_WITH_ENTITYID_PROGRESS_STATUS_DATE = { + method: 'discovery.watched', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHED_ENTITY_ID_PROGRESS_STATUS_DATE, +}; + +exports.TRUE_FOR_WATCHED_CONTENT_IN_DISCOVERY = { + method: 'discovery.watched', + validationJsonPath: 'result', + content: true, +}; + +exports.SUGGEST_WATCHNEXT_TILE_WITH_ENTITYID = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_ONLY_TITLE_IDENTIFIERS_ENTITYID, +}; + +exports.SUGGEST_WATCHNEXT_TILE_WITH_ENTITYID_ASSETID = { + method: 'discovery.watchNext', + params: + this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_ONLY_TITLE_IDENTIFIERS_ENTITYID_ASSETID, +}; +exports.SUGGEST_WATCHNEXT_TILE_WITH_ENTITYID_ASSETID_SESSIONID = { + method: 'discovery.watchNext', + params: + this.DISCOVERY_COMMON_VARIABLES.DISCOVERY + .WATCHNEXT_ONLY_TITLE_IDENTIFIERS_ENTITYID_ASSETID_SESSIONID, +}; +exports.SUGGEST_WATCHNEXT_TILE_WITH_ENTITYID_ASSETID_SESSIONID_SERIESID = { + method: 'discovery.watchNext', + params: + this.DISCOVERY_COMMON_VARIABLES.DISCOVERY + .WATCHNEXT_ONLY_TITLE_IDENTIFIERS_ENTITYID_ASSETID_SESSIONID_SERIESID, +}; +exports.SUGGEST_WATCHNEXT_TILE_WITH_ENTITYID_ASSETID_SESSIONID_SERIESID_APPCONTENTDATA = { + method: 'discovery.watchNext', + params: + this.DISCOVERY_COMMON_VARIABLES.DISCOVERY + .WATCHNEXT_ONLY_TITLE_IDENTIFIERS_ENTITYID_ASSETID_SESSIONID_SERIESID_APPCONTENTDATA, +}; +exports.SUGGEST_WATCHNEXT_TILE_WITH_EXPIRES = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_ONLY_TITLE_IDENTIFIERS_EXPIRES, +}; +exports.SUGGEST_WATCHNEXT_TILE_WITH_EXPIRES_IMAGES = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_ONLY_TITLE_IDENTIFIERS_EXPIRES_IMAGES, +}; +exports.TRUE_FOR_WATCHNEXT_TILE_IN_DISCOVERY = { + method: 'discovery.watchNext', + validationJsonPath: 'result', + content: true, +}; + +exports.NOTIFY_ENTITLEMENTS = { + method: 'discovery.entitlements', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.ENTITLEMENTS, +}; +exports.NOTIFY_ENTITLEMENTS_WITH_ENTITLEMENTID_ONLY = { + method: 'discovery.entitlements', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.ENTITLEMENTS_ENTITLEMENTID_ONLY, +}; +exports.TRUE_FOR_ENTITLEMENTS_IN_DISCOVERY = { + method: 'discovery.entitlements', + validationJsonPath: 'result', + content: true, +}; + +exports.NOTIFY_WATCHED_CONTENT_WITH_EMPTY_PARAMETER = { + method: 'discovery.watched', + params: {}, + expected: 'error', +}; + +exports.NOTIFY_WATCHED_CONTENT_WITH_INVALID_ENTITYID_NUMBER = { + method: 'discovery.watched', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHED_INVALID_ENTITY_ID_NUMBER, + expected: 'error', +}; + +exports.NOTIFY_WATCHED_CONTENT_WITH_INVALID_PROGRESS = { + method: 'discovery.watched', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHED_INVALID_PROGRESS, + expected: 'error', +}; + +exports.NOTIFY_WATCHED_CONTENT_WITH_INVALID_PROGRESS_STRING = { + method: 'discovery.watched', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHED_INVALID_PROGRESS_STRING, + expected: 'error', +}; + +exports.NOTIFY_WATCHED_CONTENT_WITH_INVALID_COMPLETED = { + method: 'discovery.watched', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHED_INVALID_COMPLETED, + expected: 'error', +}; + +exports.NOTIFY_WATCHED_CONTENT_WITH_INVALID_WATCHEDON = { + method: 'discovery.watched', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHED_INVALID_WATCHEDON, + expected: 'error', +}; + +exports.INVALID_PARAMS_FOR_DISCOVERY_WATCHED = { + method: 'discovery.watched', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; + +exports.INVALID_PARAMS_FOR_DISCOVERY_WATCHNEXT = { + method: 'discovery.watchNext', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; + +exports.INVALID_PARAMS_FOR_DISCOVERY_ENTITLEMENTS = { + method: 'discovery.entitlements', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; + +exports.SUGGEST_WATCHNEXT_TILE_WITH_ONLY_TITLE = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_ONLY_TITLE, + expected: 'error', +}; + +exports.SUGGEST_WATCHNEXT_TILE_WITH_INVALID_IDENTIFIERS = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_INVALID_IDENTIFIERS, + expected: 'error', +}; + +exports.SUGGEST_WATCHNEXT_TILE_WITH_INVALID_EXPIRES = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_INVALID_EXPIRES, + expected: 'error', +}; +exports.SUGGEST_WATCHNEXT_TILE_WITH_INVALID_EXPIRES_INTEGER = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_INVALID_EXPIRES_INTEGER, + expected: 'error', +}; + +exports.SUGGEST_WATCHNEXT_TILE_WITH_INVALID_IMAGES = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_INVALID_IMAGES, + expected: 'error', +}; + +exports.SUGGEST_WATCHNEXT_TILE_WITH_INVALID_IMAGE_INTEGER = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_INVALID_IMAGE_INTEGER, + expected: 'error', +}; +exports.SUGGEST_WATCHNEXT_TILE_WITH_INVALID_IDENTIFIERS_ENTITYID = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_INVALID_IDENTIFIERS_ENTITYID, + expected: 'error', +}; + +exports.SUGGEST_WATCHNEXT_TILE_WITH_INVALID_IDENTIFIERS_ASSETID = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_INVALID_IDENTIFIERS_ASSETID, + expected: 'error', +}; + +exports.SUGGEST_WATCHNEXT_TILE_WITH_INVALID_IDENTIFIERS_SESSIONID = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_INVALID_IDENTIFIERS_SESSIONID, + expected: 'error', +}; + +exports.SUGGEST_WATCHNEXT_TILE_WITH_INVALID_IDENTIFIERS_SERIESID = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_INVALID_IDENTIFIERS_SERIESID, + expected: 'error', +}; + +exports.SUGGEST_WATCHNEXT_TILE_WITH_INVALID_IDENTIFIERS_APPCONTENTDATA = { + method: 'discovery.watchNext', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.WATCHNEXT_INVALID_IDENTIFIERS_APPCONTENTDATA, + expected: 'error', +}; + +exports.NOTIFY_ENTITLEMENTS_WITH_NO_ID = { + method: 'discovery.entitlements', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.INVALID_ENTITLEMENTS_ENTITLEMENTID, + expected: 'error', +}; + +exports.NOTIFY_ENTITLEMENTS_WITH_INTEGER_PARAMS = { + method: 'discovery.entitlements', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.INVALID_ENTITLEMENTS_INTEGER_PARAMS, + expected: 'error', +}; + +exports.NOTIFY_USER_HAS_SIGNEDIN_WITH_NO_ID = { + method: 'discovery.signIn', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.SIGNIN_INVALID_ENTITLEMENTS, + expected: 'error', +}; + +exports.NOTIFY_USER_HAS_SIGNEDIN_WITH_INTEGER_PARAMS = { + method: 'discovery.signIn', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.INVALID_ENTITLEMENTS_INTEGER_PARAMS, + expected: 'error', +}; + +exports.INVALID_PARAMS_FOR_DISCOVERY_SIGNIN = { + method: 'discovery.signIn', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; + +exports.NOTIFY_CONTENT_ACCESS_WITH_AVAILABILITIES_TYPE_AND_ID = { + method: 'discovery.contentAccess', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_AVAILABILITIES_ONLY_TYPE_ID, +}; + +exports.NOTIFY_CONTENT_ACCESS_WITH_AVAILABILITIES_AND_ENTITLEMENTS = { + method: 'discovery.contentAccess', + params: + this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_WITH_AVAILABILITIES_AND_ENTITLEMENTS, +}; +exports.NOTIFY_CONTENT_ACCESS_WITH_ONLY_ENTITLEMENTS = { + method: 'discovery.contentAccess', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_WITH_ONLY_ENTITLEMENTS, +}; +exports.NOTIFY_CONTENT_ACCESS_WITH_AVAILABILITIES_PARAM_EMPTY = { + method: 'discovery.contentAccess', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_AVAILABILITIES_AS_EMPTY, +}; +exports.NOTIFY_CONTENT_ACCESS_WITH_ENTITLEMENTS_PARAM_EMPTY = { + method: 'discovery.contentAccess', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_ENTITLEMENTS_AS_EMPTY, +}; + +exports.NULL_FOR_DISCOVERY_CONTENTACCESS = { + method: 'discovery.contentAccess', + validationJsonPath: 'result', + content: null, +}; + +exports.NOTIFY_CONTENT_ACCESS_WITHOUT_PARAMS = { + method: 'discovery.contentAccess', + params: {}, + expected: 'error', +}; + +exports.NOTIFY_CONTENT_ACCESS_WITHOUT_AVAILABILITIES_TYPE_VALUE = { + method: 'discovery.contentAccess', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_AVAILABILITIES_WITHOUT_TYPE, + expected: 'error', +}; + +exports.NOTIFY_CONTENT_ACCESS_WITHOUT_AVAILABILITIES_ID_VALUE = { + method: 'discovery.contentAccess', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_AVAILABILITIES_WITHOUT_ID, + expected: 'error', +}; + +exports.NOTIFY_CONTENT_ACCESS_WITH_INVALID_AVAILABILITIES_TYPE_VALUE = { + method: 'discovery.contentAccess', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_AVAILABILITIES_INVALID_TYPE_VALUE, + expected: 'error', +}; + +exports.NOTIFY_CONTENT_ACCESS_WITH_INVALID_AVAILABILITIES_TYPE = { + method: 'discovery.contentAccess', + params: + this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_AVAILABILITIES_INVALID_DATATYPE_TYPE, + expected: 'error', +}; + +exports.NOTIFY_CONTENT_ACCESS_WITH_INVALID_AVAILABILITIES_ID = { + method: 'discovery.contentAccess', + params: + this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_AVAILABILITIES_INVALID_DATATYPE_ID, + expected: 'error', +}; + +exports.NOTIFY_CONTENT_ACCESS_WITH_INVALID_AVAILABILITIES_CATALOG_ID = { + method: 'discovery.contentAccess', + params: + this.DISCOVERY_COMMON_VARIABLES.DISCOVERY + .CONTENTACCESS_AVAILABILITIES_INVALID_DATATYPE_CATALOG_ID, + expected: 'error', +}; + +exports.NOTIFY_CONTENT_ACCESS_WITH_INVALID_AVAILABILITIES_STARTTIME = { + method: 'discovery.contentAccess', + params: + this.DISCOVERY_COMMON_VARIABLES.DISCOVERY + .CONTENTACCESS_AVAILABILITIES_INVALID_DATATYPE_START_TIME, + expected: 'error', +}; + +exports.NOTIFY_CONTENT_ACCESS_WITH_INVALID_AVAILABILITIES_ENDTIME = { + method: 'discovery.contentAccess', + params: + this.DISCOVERY_COMMON_VARIABLES.DISCOVERY + .CONTENTACCESS_AVAILABILITIES_INVALID_DATATYPE_END_TIME, + expected: 'error', +}; + +exports.NOTIFY_CONTENT_ACCESS_WITH_INVALID_ENTITLEMENTS_BOOLEAN_ENTITLEMENTID = { + method: 'discovery.contentAccess', + params: + this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_ENTITLEMENTS_INVALID_ENTITLEMENTID_TRUE, + expected: 'error', +}; + +exports.NOTIFY_CONTENT_ACCESS_WITH_INVALID_ENTITLEMENTS_INTEGER_ENTITLEMENTID = { + method: 'discovery.contentAccess', + params: + this.DISCOVERY_COMMON_VARIABLES.DISCOVERY + .CONTENTACCESS_ENTITLEMENTS_INVALID_ENTITLEMENTID_INTEGER, + expected: 'error', +}; + +exports.NOTIFY_CONTENT_ACCESS_WITH_INVALID_ENTITLEMENTS_INVALID_STARTTIME = { + method: 'discovery.contentAccess', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_ENTITLEMENTS_INVALID_START_TIME, + expected: 'error', +}; + +exports.NOTIFY_CONTENT_ACCESS_WITH_INVALID_ENTITLEMENTS_INVALID_ENDTIME = { + method: 'discovery.contentAccess', + params: this.DISCOVERY_COMMON_VARIABLES.DISCOVERY.CONTENTACCESS_ENTITLEMENTS_INVALID_END_TIME, + expected: 'error', +}; + +exports.INVALID_PARAMETER_ERROR_FOR_DISCOVERY_CONTENTACCESS = { + method: 'discovery.contentAccess', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; + +exports.DISCOVERY_ONPOLICYCHANGED = { + method: 'discovery.onPolicyChanged', + params: {}, +}; + +exports.DISCOVERY_ONPOLICYCHANGED_EVENT = { + event: 'discovery.onPolicyChanged', + firstParty: false, +}; + +exports.SET_ALLOWPERSONALIZATION_TO_TRUE = { + method: 'manage_privacy.setAllowPersonalization', + params: { value: true }, +}; + +exports.ONDISCOVERYPOLICYCHANGED = { + event: 'discovery.onPolicyChanged', + validationJsonPath: 'eventResponse', + content: null, +}; + +exports.DISABLE_RECOMMENDATIONS = { + method: 'manage_privacy.setAllowPersonalization', + params: { value: false }, +}; + +exports.DISABLE_REMEMBER_WATCHED_PROGRAMS = { + method: 'manage_privacy.setAllowWatchHistory', + params: { value: false }, +}; diff --git a/cypress/fixtures/fireboltCalls/discovery.json b/cypress/fixtures/fireboltCalls/discovery.json index 59bf698b3..c416f1456 100644 --- a/cypress/fixtures/fireboltCalls/discovery.json +++ b/cypress/fixtures/fireboltCalls/discovery.json @@ -407,7 +407,7 @@ "params": "DISCOVERY_CONTENTACCESS_ENTITLEMENTS_INVALID_END_TIME", "expected": "error" }, - "DISCOVERY_ONSIGNIN":{ + "DISCOVERY_ONSIGNIN": { "method": "manage_discovery.onSignIn" }, "ONSIGNIN_FOR_DISCOVERY_WITH_APPID": { @@ -420,7 +420,7 @@ "validationJsonPath": "result", "content": "DISCOVERY_SIGNIN_TRUE" }, - "DISCOVERY_ONSIGNOUT":{ + "DISCOVERY_ONSIGNOUT": { "method": "manage_discovery.onSignOut" }, "ONSIGNOUT_FOR_DISCOVERY_WITH_APPID": { @@ -433,7 +433,7 @@ "validationJsonPath": "result", "content": "DISCOVERY_SIGNOUT_TRUE" }, - "SET_ALLOWPERSONALIZATION_TO_TRUE":{ + "SET_ALLOWPERSONALIZATION_TO_TRUE": { "method": "manage_privacy.setAllowPersonalization", "params": "TRUE" }, @@ -443,7 +443,7 @@ "content": "NULL", "expectingError": false }, - "GET_HOME_INTENT":{ + "GET_HOME_INTENT": { "method": "discovery.launch", "params": "DISCOVERY_HOME_INTENT" }, diff --git a/cypress/fixtures/fireboltCalls/dynamicVariables.js b/cypress/fixtures/fireboltCalls/dynamicVariables.js index 2fb616eea..7429e35b9 100644 --- a/cypress/fixtures/fireboltCalls/dynamicVariables.js +++ b/cypress/fixtures/fireboltCalls/dynamicVariables.js @@ -1,8 +1,29 @@ +/** + * 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 + */ +const accountVariables = require('./account'); +const deviceVariables = require('./device'); const accessibilityVariables = require('./accessibility'); const localizationVariables = require('./localization'); exports.DYNAMIC_FB_CALL_VARIABLES = { DEFAULTS: { + ...accountVariables.ACCOUNT_VARIABLES, + ...deviceVariables.DEVICE_VARIABLES, ...localizationVariables.LOCALIZATION_VARIABLES, }, ...accessibilityVariables.ACCESSIBILITY_VARIABLES, diff --git a/cypress/fixtures/fireboltCalls/localization.js b/cypress/fixtures/fireboltCalls/localization.js index 3971d4a3e..c8443b940 100644 --- a/cypress/fixtures/fireboltCalls/localization.js +++ b/cypress/fixtures/fireboltCalls/localization.js @@ -1,3 +1,21 @@ +/** + * 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 + */ +const errorContent = require('../objects/errorContentObjects.js'); exports.LOCALIZATION_MANAGE = { method: resolveAtRuntime('manage_localization.{{attribute}}'), params: null, @@ -113,3 +131,292 @@ exports.LOCALIZATION_VARIABLES = { timeZone: '[a-zA-Z&_.-]', }, }; + +exports.SET_LOCALIZATION_ADDADDITIONALINFO_WITH_KEY_AS_STRING_VALUE_AS_NULL = { + method: 'manage_localization.addAdditionalInfo', + params: { key: 'info', value: null }, + expected: 'error', +}; + +exports.SET_LOCALIZATION_ADDADDITIONALINFO_WITH_KEY_AS_NULL_VALUE_AS_STRING = { + method: 'manage_localization.addAdditionalInfo', + params: { key: null, value: 'value1' }, + expected: 'error', +}; + +exports.SET_LOCALIZATION_ADDADDITIONALINFO_WITH_KEY_AND_VALUE_AS_NULL = { + method: 'manage_localization.addAdditionalInfo', + params: { key: null, value: null }, + expected: 'error', +}; + +exports.SET_LOCALIZATION_ADDADDITIONALINFO_WITH_KEY_AND_VALUE_AS_INTEGER = { + method: 'manage_localization.addAdditionalInfo', + params: { key: 123, value: 123 }, + expected: 'error', +}; + +exports.SET_LOCALIZATION_ADDADDITIONALINFO_WITH_KEY_AND_VALUE_AS_OBJECT = { + method: 'manage_localization.addAdditionalInfo', + params: { key: {}, value: {} }, + expected: 'error', +}; + +exports.SET_LOCALIZATION_ADDADDITIONALINFO_WITH_EMPTY_OBJECT = { + method: 'manage_localization.addAdditionalInfo', + params: {}, + expected: 'error', +}; + +exports.INVALID_PARAMETERS_FOR_LOCALIZATION_ADDADDITIONALINFO = { + method: 'localization.addAdditionalInfo', + validationJsonPath: 'result', + content: errorContent.INVALID_TYPE_PARAMS, + expectingError: true, +}; + +exports.GET_LOCALIZATION_ADDITIONALINFO = { + method: 'localization.additionalInfo', + params: {}, +}; + +exports.EXPECTED_LOCALIZATION_ADDITIONALINFO = { + method: 'localization.additionalInfo', + validationJsonPath: 'result', + content: null, +}; + +exports.SET_LOCALIZATION_ADDADDITIONALINFO_WITH_STRING = { + method: 'manage_localization.addAdditionalInfo', + params: { key: 'defaultKey', value: 'defaultValue=' }, +}; + +exports.SET_LOCALIZATION_ADDADDITIONALINFO_WITH_EMPTY_STRING = { + method: 'manage_localization.addAdditionalInfo', + params: { key: '', value: '' }, +}; + +exports.SET_LOCALIZATION_REMOVEADDITIONALINFO_WITH_STRING = { + method: 'manage_localization.removeAdditionalInfo', + params: { key: 'defaultKey' }, +}; + +exports.SET_LOCALIZATION_REMOVEADDITIONALINFO_WITH_EMPTY_STRING = { + method: 'manage_localization.removeAdditionalInfo', + params: { key: '' }, +}; + +exports.STRING_FOR_LOCALIZATION_ADDITIONALINFO = { + method: 'localization.additionalInfo', + validationJsonPath: 'result', + content: { defaultKey: 'defaultValue=' }, +}; + +exports.EMPTY_STRING_FOR_LOCALIZATION_ADDITIONALINFO = { + method: 'localization.additionalInfo', + validationJsonPath: 'result', + content: { '': '', defaultKey: 'defaultValue=' }, +}; + +exports.EMPTY_KEY_VALUE_FOR_LOCALIZATION_ADDITIONALINFO = { + method: 'localization.additionalInfo', + validationJsonPath: 'result', + content: { '': '' }, +}; + +exports.EMPTY_RESPONSE_FOR_LOCALIZATION_ADDITIONALINFO = { + method: 'localization.additionalInfo', + validationJsonPath: 'result', + content: {}, +}; + +exports.GET_LOCALIZATION_LATLON = { + method: 'localization.latlon', + params: {}, +}; + +exports.EXPECTED_LOCALIZATION_LATLON = { + method: 'localization.latlon', + validationJsonPath: 'result', + content: '', +}; + +exports.LOCALIZATION_ONLOCALECHANGED = { + method: 'localization.onLocaleChanged', + params: {}, +}; + +exports.LOCALIZATION_ONLANGUAGECHANGED = { + method: 'localization.onLanguageChanged', + params: {}, +}; + +exports.LOCALIZATION_ONCOUNTRYCODECHANGED = { + method: 'localization.onCountryCodeChanged', + params: {}, +}; + +exports.SET_LOCALE_TO_ENUK = { + method: 'manage_localization.setLocale', + params: { value: 'en-UK' }, +}; + +exports.GET_LOCALIZATION_LOCALE = { + method: 'localization.locale', + params: {}, +}; +exports.GET_LOCALIZATION_LANGUAGE = { + method: 'localization.language', + params: {}, +}; +exports.GET_LOCALIZATION_COUNTRYCODE = { + method: 'localization.countryCode', + params: {}, +}; + +exports.SET_LOCALE_TO_ESUK = { + method: 'manage_localization.setLocale', + params: { value: 'es-UK' }, +}; + +exports.ENUK_FOR_LOCALIZATION_LOCALE = { + method: 'localization.locale', + validationJsonPath: 'result', + content: 'en-UK', +}; + +exports.ESUK_FOR_LOCALIZATION_LOCALE = { + method: 'localization.locale', + validationJsonPath: 'result', + content: 'es-UK', +}; + +exports.UK_FOR_LOCALIZATION_COUNTRYCODE = { + method: 'localization.countryCode', + validationJsonPath: 'result', + content: 'UK', +}; + +exports.ES_FOR_LOCALIZATION_LANGUAGE = { + method: 'localization.language', + validationJsonPath: 'result', + content: 'es', +}; + +exports.ONLOCALECHANGED_FOR_LOCALIZATION_WITH_ENUK = { + event: 'localization.onLocaleChanged', + validationJsonPath: 'eventResponse', + content: 'en-UK', +}; + +exports.ONLOCALECHANGED_FOR_LOCALIZATION_WITH_ESUK = { + event: 'localization.onLocaleChanged', + validationJsonPath: 'eventResponse', + content: 'es-UK', +}; + +exports.ONCOUNTRYCODECHANGED_FOR_LOCALIZATION_WITH_UK = { + event: 'localization.onCountryCodeChanged', + validationJsonPath: 'eventResponse', + content: 'UK', +}; + +exports.ONLANGUAGECHANGED_FOR_LOCALIZATION_WITH_ES = { + event: 'localization.onLanguageChanged', + validationJsonPath: 'eventResponse', + content: 'es', +}; + +exports.LOCALIZATION_ONLOCALITYCHANGED = { + method: 'localization.onLocalityChanged', + params: {}, +}; + +exports.LOCALIZATION_ONLOCALITYCHANGED_EVENT = { + event: 'localization.onLocalityChanged', + firstParty: false, +}; + +exports.LOCALIZATION_ONCOUNTRYCODECHANGED_EVENT = { + event: 'localization.onCountryCodeChanged', + firstParty: false, +}; + +exports.LOCALIZATION_ONLOCALECHANGED_EVENT = { + event: 'localization.onLocaleChanged', + firstParty: false, +}; + +exports.LOCALIZATION_ONLANGUAGECHANGED_EVENT = { + event: 'localization.onLanguageChanged', + firstParty: false, +}; + +exports.SET_LOCALITY_TO_WASHINGTON = { + method: 'manage_localization.setLocality', + params: { value: 'Washington' }, +}; + +exports.SET_COUNTRYCODE_TO_PH = { + method: 'manage_localization.setCountryCode', + params: { value: 'PH' }, +}; + +exports.SET_LOCALE_TO_ENUS = { + method: 'manage_localization.setLocale', + params: { value: 'en-US' }, +}; + +exports.SET_LANGUAGE_TO_EN = { + method: 'manage_localization.setLanguage', + params: { value: 'en' }, +}; + +exports.ONLOCALITYCHANGED = { + event: 'localization.onLocalityChanged', + validationJsonPath: 'eventResponse', + content: null, +}; + +exports.ONCOUNTRYCODECHANGED = { + event: 'localization.onCountryCodeChanged', + validationJsonPath: 'eventResponse', + content: null, +}; + +exports.ONLOCALECHANGED = { + event: 'localization.onLocaleChanged', + validationJsonPath: 'eventResponse', + content: null, +}; + +exports.ONLANGUAGECHANGED = { + event: 'localization.onLanguageChanged', + validationJsonPath: 'eventResponse', + content: null, +}; + +exports.SET_LOCALIZATION_LOCALITY_TO_PHILADELPHIA = { + method: 'manage_localization.setLocality', + params: { value: 'Philadelphia' }, +}; + +exports.SET_POSTALCODE_TO_19103 = { + method: 'manage_localization.setPostalCode', + params: { value: '19103' }, +}; + +exports.SET_COUNTRYCODE_TO_US = { + method: 'manage_localization.setCountryCode', + params: { value: 'US' }, +}; + +exports.SET_PREFERREDAUDIOLANGUAGES_TO_ENG_SPA = { + method: 'manage_localization.setPreferredAudioLanguages', + params: { value: ['eng', 'spa'] }, +}; + +exports.SET_LOCALIZATION_TIMEZONE_WITH_AMERICA_LOSANGELES = { + method: 'manage_localization.setTimeZone', + params: { value: 'America/Los_Angeles' }, +}; diff --git a/cypress/fixtures/fireboltCalls/localization.json b/cypress/fixtures/fireboltCalls/localization.json index 3d43e49c6..355d8a75e 100644 --- a/cypress/fixtures/fireboltCalls/localization.json +++ b/cypress/fixtures/fireboltCalls/localization.json @@ -14,16 +14,16 @@ "STRING_FOR_LOCALIZATION_ADDITIONALINFO": { "method": "localization.additionalInfo", "validationJsonPath": "result", - "content": "LOCALIZATION_ADD_ADDITIONALINFO_AS_STRING" + "content": "LOCALIZATION_ADD_ADDITIONALINFO_AS_STRING" }, "SET_LOCALIZATION_ADDADDITIONALINFO_WITH_EMPTY_STRING": { "method": "manage_localization.addAdditionalInfo", "params": "LOCALIZATION_ADD_ADDITIONALINFO_AS_EMPTY" }, "EMPTY_STRING_FOR_LOCALIZATION_ADDITIONALINFO": { - "method": "localization.additionalInfo", + "method": "localization.additionalInfo", "validationJsonPath": "result", - "content": "LOCALIZATION_ADD_ADDITIONALINFO_AS_EMPTY" + "content": "LOCALIZATION_ADD_ADDITIONALINFO_AS_EMPTY" }, "SET_LOCALIZATION_REMOVEADDITIONALINFO_WITH_STRING": { "method": "manage_localization.removeAdditionalInfo", @@ -34,14 +34,14 @@ "params": "LOCALIZATION_ADD_ADDITIONALINFO_KEY_AS_EMPTY_STRING" }, "EMPTY_KEY/VALUE_FOR_LOCALIZATION_ADDITIONALINFO": { - "method": "localization.additionalInfo", + "method": "localization.additionalInfo", "validationJsonPath": "result", - "content": "LOCALIZATION_REMOVE_ADDITIONALINFO_RESPONSE_AS_EMPTY_STRING" + "content": "LOCALIZATION_REMOVE_ADDITIONALINFO_RESPONSE_AS_EMPTY_STRING" }, "EMPTY_RESPONSE_FOR_LOCALIZATION_ADDITIONALINFO": { "method": "localization.additionalInfo", "validationJsonPath": "result", - "content": "LOCALIZATION_REMOVE_ADDITIONALINFO_EMPTY_RESPONSE" + "content": "LOCALIZATION_REMOVE_ADDITIONALINFO_EMPTY_RESPONSE" }, "SET_LOCALIZATION_ADDADDITIONALINFO_WITH_KEY_AS_STRING_VALUE_AS_NULL": { "method": "manage_localization.addAdditionalInfo", @@ -49,7 +49,7 @@ "expected": "error" }, "INVALID_PARAMETERS_FOR_LOCALIZATION_ADDADDITIONALINFO": { - "method": "localization.addAdditionalInfo", + "method": "localization.addAdditionalInfo", "validationJsonPath": "result", "content": "INVALID_TYPE_PARAMS", "expectingError": true @@ -83,7 +83,7 @@ "expected": "error" }, "INVALID_PARAMETERS_FOR_LOCALIZATION_REMOVEADDITIONALINFO": { - "method": "localization.removeAdditionalInfo", + "method": "localization.removeAdditionalInfo", "validationJsonPath": "result", "content": "INVALID_TYPE_PARAMS", "expectingError": true @@ -100,34 +100,33 @@ "method": "localization.countryCode" }, "PH_FOR_LOCALIZATION_COUNTRYCODE": { - "method": "localization.countryCode", + "method": "localization.countryCode", "validationJsonPath": "result", - "content": "LOCALIZATION_COUNTRYCODE_PH" + "content": "LOCALIZATION_COUNTRYCODE_PH" }, "GET_LOCALIZATION_LANGUAGE": { "method": "localization.language" }, "EXPECTED_LOCALIZATION_LANGUAGE": { - "method": "localization.language", + "method": "localization.language", "validationJsonPath": "result", - "content": "LOCALIZATION_LANGUAGE" + "content": "LOCALIZATION_LANGUAGE" }, "GET_LOCALIZATION_LOCALE": { "method": "localization.locale" }, "ENUS_FOR_LOCALIZATION_LOCALE": { - "method": "localization.locale", + "method": "localization.locale", "validationJsonPath": "result", "content": "LOCALIZATION_LOCALE" - }, "ENUK_FOR_LOCALIZATION_LOCALE": { - "method": "localization.locale", + "method": "localization.locale", "validationJsonPath": "result", "content": "LOCALIZATION_LOCALE_UK" }, "ESUK_FOR_LOCALIZATION_LOCALE": { - "method": "localization.locale", + "method": "localization.locale", "validationJsonPath": "result", "content": "LOCALIZATION_LOCALE_UK_ES" }, @@ -138,9 +137,9 @@ "method": "localization.latlon" }, "EXPECTED_LOCALIZATION_LATLON": { - "method": "localization.latlon", + "method": "localization.latlon", "validationJsonPath": "result", - "content": "LOCALIZATION_LATLON" + "content": "LOCALIZATION_LATLON" }, "LOCALIZATION_ONLOCALITYCHANGED": { "method": "localization.onLocalityChanged" @@ -161,14 +160,14 @@ "expected": "error" }, "WASHINGTON_FOR_LOCALIZATION_LOCALITY": { - "method": "localization.locality", + "method": "localization.locality", "validationJsonPath": "result", - "content": "LOCALIZATION_LOCALITY_WASHINGTON" + "content": "LOCALIZATION_LOCALITY_WASHINGTON" }, "ONLOCALITYCHANGED_FOR_LOCALIZATION_WITH_WASHINGTON": { - "event": "localization.onLocalityChanged", + "event": "localization.onLocalityChanged", "validationJsonPath": "eventResponse", - "content": "LOCALIZATION_LOCALITY_WASHINGTON" + "content": "LOCALIZATION_LOCALITY_WASHINGTON" }, "LOCALIZATION_ONCOUNTRYCODECHANGED": { "method": "localization.onCountryCodeChanged" @@ -219,74 +218,74 @@ "params": "LOCALIZATION_PREFERRED_AUDIO_LANGUAGES_VALUE_ENG_SPA" }, "SPA_ENG_FOR_LOCALIZATION_PREFERREDAUDIOLANGUAGES": { - "method": "localization.preferredAudioLanguages", + "method": "localization.preferredAudioLanguages", "validationJsonPath": "result", - "content": "LOCALIZATION_PREFERRED_AUDIO_LANGUAGES_SPA_ENG" + "content": "LOCALIZATION_PREFERRED_AUDIO_LANGUAGES_SPA_ENG" }, "ENG_SPA_FOR_LOCALIZATION_PREFERREDAUDIOLANGUAGES": { - "method": "localization.preferredAudioLanguages", + "method": "localization.preferredAudioLanguages", "validationJsonPath": "result", - "content": "LOCALIZATION_PREFERRED_AUDIO_LANGUAGES_ENG_SPA" + "content": "LOCALIZATION_PREFERRED_AUDIO_LANGUAGES_ENG_SPA" }, "ONPREFERREDAUDIOLANGUAGESCHANGED_FOR_LOCALIZATION_WITH_ENG_AND_SPA": { "event": "localization.onPreferredAudioLanguagesChanged", "validationJsonPath": "eventResponse", - "content": "LOCALIZATION_PREFERRED_AUDIO_LANGUAGES_ENG_SPA" + "content": "LOCALIZATION_PREFERRED_AUDIO_LANGUAGES_ENG_SPA" }, "ONPREFERREDAUDIOLANGUAGESCHANGED_FOR_LOCALIZATION_WITH_ENG_SPA": { - "event": "localization.onPreferredAudioLanguagesChanged", + "event": "localization.onPreferredAudioLanguagesChanged", "validationJsonPath": "eventResponse", - "content": "LOCALIZATION_PREFERRED_AUDIO_LANGUAGES_SPA_ENG" + "content": "LOCALIZATION_PREFERRED_AUDIO_LANGUAGES_SPA_ENG" }, "ONLANGUAGECHANGED_FOR_LOCALIZATION_WITH_ES": { "event": "localization.onLanguageChanged", "validationJsonPath": "eventResponse", - "content": "LOCALIZATION_LANGUAGE_ES" + "content": "LOCALIZATION_LANGUAGE_ES" }, "ES_FOR_LOCALIZATION_LANGUAGE": { "method": "localization.language", "validationJsonPath": "result", - "content": "LOCALIZATION_LANGUAGE_ES" + "content": "LOCALIZATION_LANGUAGE_ES" }, "EN_FOR_LOCALIZATION_LANGUAGE": { - "method": "localization.language", + "method": "localization.language", "validationJsonPath": "result", - "content": "LOCALIZATION_LANGUAGE_EN" + "content": "LOCALIZATION_LANGUAGE_EN" }, "ONLANGUAGECHANGED_FOR_LOCALIZATION_WITH_EN": { "event": "localization.onLanguageChanged", "validationJsonPath": "eventResponse", - "content": "LOCALIZATION_LANGUAGE_EN" + "content": "LOCALIZATION_LANGUAGE_EN" }, "ONLOCALECHANGED_FOR_LOCALIZATION_WITH_ENUS": { - "event": "localization.onLocaleChanged", + "event": "localization.onLocaleChanged", "validationJsonPath": "eventResponse", - "content": "LOCALIZATION_LOCALE" + "content": "LOCALIZATION_LOCALE" }, "ONLOCALECHANGED_FOR_LOCALIZATION_WITH_ENUK": { - "event": "localization.onLocaleChanged", + "event": "localization.onLocaleChanged", "validationJsonPath": "eventResponse", "content": "LOCALIZATION_LOCALE_UK" }, "ONLOCALECHANGED_FOR_LOCALIZATION_WITH_ESUK": { - "event": "localization.onLocaleChanged", + "event": "localization.onLocaleChanged", "validationJsonPath": "eventResponse", "content": "LOCALIZATION_LOCALE_UK_ES" }, "ONCOUNTRYCODECHANGED_FOR_LOCALIZATION_WITH_PH": { "event": "localization.onCountryCodeChanged", "validationJsonPath": "eventResponse", - "content": "LOCALIZATION_COUNTRYCODE_PH" + "content": "LOCALIZATION_COUNTRYCODE_PH" }, "ONCOUNTRYCODECHANGED_FOR_LOCALIZATION_WITH_UK": { "event": "localization.onCountryCodeChanged", "validationJsonPath": "eventResponse", - "content": "LOCALIZATION_COUNTRYCODE_UK" + "content": "LOCALIZATION_COUNTRYCODE_UK" }, "UK_FOR_LOCALIZATION_COUNTRYCODE": { - "method": "localization.countryCode", + "method": "localization.countryCode", "validationJsonPath": "result", - "content": "LOCALIZATION_COUNTRYCODE" + "content": "LOCALIZATION_COUNTRYCODE" }, "SET_POSTALCODE_TO_12345": { "method": "manage_localization.setPostalCode", @@ -315,9 +314,9 @@ "12345_FOR_LOCALIZATION_POSTALCODE": { "method": "localization.postalCode", "validationJsonPath": "result", - "content": "STRING_12345" + "content": "STRING_12345" }, - "EXPECTED_VALUE_FOR_LOCALIZATION_POSTALCODE":{ + "EXPECTED_VALUE_FOR_LOCALIZATION_POSTALCODE": { "method": "localization.postalCode", "validationJsonPath": "result", "content": "LOCALIZATION_POSTALCODE" @@ -325,22 +324,22 @@ "ONPOSTALCODECHANGED_FOR_LOCALIZATION_POSTALCODE_WITH_12345": { "event": "localization.onPostalCodeChanged", "validationJsonPath": "eventResponse", - "content": "STRING_12345" + "content": "STRING_12345" }, "ONPOSTALCODECHANGED_FOR_LOCALIZATION_WITH_123456": { "event": "localization.onPostalCodeChanged", "validationJsonPath": "eventResponse", - "content": "STRING123456" + "content": "STRING123456" }, "EXPECTED_LOCALIZATION_COUNTRYCODE": { - "method": "localization.countryCode", + "method": "localization.countryCode", "validationJsonPath": "result", - "content": "LOCALIZATION_COUNTRYCODE" + "content": "LOCALIZATION_COUNTRYCODE" }, "EXPECTED_LOCALIZATION_LOCALE": { - "method": "localization.locale", + "method": "localization.locale", "validationJsonPath": "result", - "content": "LOCALIZATION_LOCALE" + "content": "LOCALIZATION_LOCALE" }, "MANAGE_LOCALIZATION_ONLOCALITYCHANGED": { "method": "manage_localization.onLocalityChanged" @@ -373,7 +372,7 @@ "WASHINGTON_FOR_LOCALITY": { "method": "localization.locality", "validationJsonPath": "result", - "content": "LOCALIZATION_LOCALITY_WASHINGTON" + "content": "LOCALIZATION_LOCALITY_WASHINGTON" }, "INVALID_REQUEST_FOR_LOCALIZATION_LOCALITY": { "method": "localization.locality", @@ -384,7 +383,7 @@ "ONLOCALITYCHANGED_FOR_LOCALIZATION_LOCALITY_WITH_WASHINGTON": { "event": "localization.onLocalityChanged", "validationJsonPath": "eventResponse", - "content": "LOCALIZATION_LOCALITY_WASHINGTON" + "content": "LOCALIZATION_LOCALITY_WASHINGTON" }, "LOCALIZATION_ONPOSTALCODECHANGED": { "method": "localization.onPostalCodeChanged" @@ -399,7 +398,7 @@ "123456_FOR_POSTALCODE": { "method": "localization.postalCode", "validationJsonPath": "result", - "content": "STRING123456" + "content": "STRING123456" }, "LOCALIZATION_ONTIMEZONECHANGED": { "method": "manage_localization.onTimeZoneChanged" @@ -414,12 +413,12 @@ "AMERICA/NEWYORK_FOR_TIMEZONE": { "method": "localization.timeZone", "validationJsonPath": "result", - "content": "LOCALIZATION_TIMEZONE_AMERICA_NEWYORK" + "content": "LOCALIZATION_TIMEZONE_AMERICA_NEWYORK" }, "ONTIMEZONECHANGED_FOR_LOCALIZATION_WITH_AMERICA/NEWYORK": { "event": "localization.onTimeZoneChanged", "validationJsonPath": "eventResponse", - "content": "LOCALIZATION_TIMEZONE_AMERICA_NEWYORK" + "content": "LOCALIZATION_TIMEZONE_AMERICA_NEWYORK" }, "GET_PREFERREDAUDIOLANGUAGES": { "method": "manage_localization.preferredAudioLanguages" @@ -427,12 +426,12 @@ "SPA_ENG_FOR_PREFERREDAUDIOLANGUAGES": { "method": "localization.preferredAudioLanguages", "validationJsonPath": "result", - "content": "LOCALIZATION_PREFERREDAUDIOLANGUAGES" + "content": "LOCALIZATION_PREFERREDAUDIOLANGUAGES" }, "ONPREFERREDAUDIOLANGUAGESCHANGED_FOR_LOCALIZATION_WITH_SPA_ENG": { "event": "localization.onPreferredAudioLanguagesChanged", "validationJsonPath": "eventResponse", - "content": "LOCALIZATION_PREFERREDAUDIOLANGUAGES" + "content": "LOCALIZATION_PREFERREDAUDIOLANGUAGES" }, "SET_LOCALITY_WITH_INTEGER": { "method": "manage_localization.setLocality", @@ -441,8 +440,8 @@ }, "INVALID_PARAMETER_FOR_LOCALITY": { "method": "localization.setLocality", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true }, "SET_LOCALITY_WITH_BOOLEAN": { @@ -457,8 +456,8 @@ }, "INVALID_PARAMETER_FOR_LOCALE": { "method": "localization.setLocale", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true }, "SET_POSTALCODE_WITH_INTEGER": { @@ -468,14 +467,14 @@ }, "INVALID_PARAMETER_FOR_POSTALCODE": { "method": "localization.setPostalCode", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true }, "INVALID_REQUEST_FOR_POSTALCODE": { "method": "localization.postalCode", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true }, "SET_POSTALCODE_WITH_BOOLEAN": { @@ -490,8 +489,8 @@ }, "INVALID_PARAMETER_FOR_TIMEZONE": { "method": "localization.setTimeZone", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true }, "SET_TIMEZONE_WITH_BOOLEAN": { @@ -506,8 +505,8 @@ }, "INVALID_PARAMETER_FOR_COUNTRYCODE": { "method": "localization.setCountryCode", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true }, "SET_COUNTRYCODE_WITH_BOOLEAN": { @@ -522,8 +521,8 @@ }, "INVALID_PARAMETER_FOR_LANGUAGE": { "method": "localization.setLanguage", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true }, "SET_LANGUAGE_TO_TRUE": { @@ -548,14 +547,14 @@ }, "INVALID_PARAMETER_FOR_PREFERREDAUDIOLANGUAGES": { "method": "localization.setPreferredAudioLanguages", - "validationJsonPath": "result", - "content": "INVALID_TYPE_PARAMS", + "validationJsonPath": "result", + "content": "INVALID_TYPE_PARAMS", "expectingError": true }, "EXPECTED_LOCALIZATION_LOCALITY": { "method": "localization.setLocality", "validationJsonPath": "result", - "content": "LOCALIZATION_LOCALITY" + "content": "LOCALIZATION_LOCALITY" }, "EXPECTED_MANAGE_LOCALIZATION_COUNTRYCODE": { "method": "localization.setCountryCode", @@ -570,42 +569,42 @@ "EXPECTED_MANAGE_LOCALIZATION_LANGUAGE": { "method": "localization.setLanguage", "validationJsonPath": "result", - "content": "LOCALIZATION_LANGUAGE" + "content": "LOCALIZATION_LANGUAGE" }, "EXPECTED_LOCALIZATION_PREFERREDAUDIOLANGUAGES": { "method": "localization.setPreferredAudioLanguages", "validationJsonPath": "result", - "content": "LOCALIZATION_PREFERREDAUDIOLANGUAGES" + "content": "LOCALIZATION_PREFERREDAUDIOLANGUAGES" }, "EXPECTED_MANAGE_LOCALIZATION_LOCALE": { "method": "localization.setLocale", "validationJsonPath": "result", - "content": "LOCALIZATION_LOCALE" + "content": "LOCALIZATION_LOCALE" }, "EXPECTED_LOCALIZATION_TIMEZONE": { "method": "localization.setTimeZone", "validationJsonPath": "result", - "content": "LOCALIZATION_TIMEZONE" + "content": "LOCALIZATION_TIMEZONE" }, - "SET_LOCALITY_WITHOUT_PARAMS":{ + "SET_LOCALITY_WITHOUT_PARAMS": { "method": "manage_localization.setLocality" }, - "SET_POSTALCODE_WITHOUT_PARAMS":{ + "SET_POSTALCODE_WITHOUT_PARAMS": { "method": "manage_localization.setPostalCode" }, - "SET_COUNTRYCODE_WITHOUT_PARAMS":{ + "SET_COUNTRYCODE_WITHOUT_PARAMS": { "method": "manage_localization.setCountryCode" }, - "SET_LANGUAGE_WITHOUT_PARAMS":{ + "SET_LANGUAGE_WITHOUT_PARAMS": { "method": "manage_localization.setLanguage" }, - "SET_PREFERREDAUDIOLANGUAGES_WITHOUT_PARAMS":{ + "SET_PREFERREDAUDIOLANGUAGES_WITHOUT_PARAMS": { "method": "manage_localization.setPreferredAudioLanguages" }, - "SET_LOCALE_WITHOUT_PARAMS":{ + "SET_LOCALE_WITHOUT_PARAMS": { "method": "manage_localization.setLocale" }, - "SET_TIMEZONE_WITHOUT_PARAMS":{ + "SET_TIMEZONE_WITHOUT_PARAMS": { "method": "manage_localization.setTimeZone" }, "SET_LOCALIZATION_TIMEZONE_WITH_AMERICA_LOSANGELES": { @@ -615,22 +614,22 @@ "ONLOCALITYCHANGED": { "event": "localization.onLocalityChanged", "validationJsonPath": "eventResponse", - "content": "NULL" + "content": "NULL" }, "ONCOUNTRYCODECHANGED": { "event": "localization.onCountryCodeChanged", "validationJsonPath": "eventResponse", - "content": "NULL" + "content": "NULL" }, "ONLOCALECHANGED": { "event": "localization.onLocaleChanged", "validationJsonPath": "eventResponse", - "content": "NULL" + "content": "NULL" }, "ONLANGUAGECHANGED": { "event": "localization.onLanguageChanged", "validationJsonPath": "eventResponse", - "content": "NULL" + "content": "NULL" }, "EXPECT_ERROR_FOR_LOCALIZATION_LANGUAGE": { "method": "localization.language", @@ -653,21 +652,21 @@ "expectingError": true }, "NULL_FOR_LOCALIZATION_ADDADDITIONALINFO": { - "method": "localization.addAdditionalInfo", + "method": "localization.addAdditionalInfo", "validationJsonPath": "result", - "content": "NULL" + "content": "NULL" }, "NULL_FOR_LOCALIZATION_REMOVEADDITIONALINFO": { "method": "localization.removeAdditionalInfo", "validationJsonPath": "result", - "content": "NULL" + "content": "NULL" }, "EXPECTED_VALUE_FOR_LOCALIZATION_LOCALITY": { - "method": "localization.locality", + "method": "localization.locality", "validationJsonPath": "result", - "content": "LOCALIZATION_LOCALITY" + "content": "LOCALIZATION_LOCALITY" }, - "EXPECTED_LOCALIZATION_COUNTRYCODE_CHALLENGEERROR":{ + "EXPECTED_LOCALIZATION_COUNTRYCODE_CHALLENGEERROR": { "method": "localization.countryCode", "validationJsonPath": "result", "content": "INVALID_TYPE_PARAMS", diff --git a/cypress/fixtures/fireboltCalls/parameters.json b/cypress/fixtures/fireboltCalls/parameters.json index e74765dff..29b7b1029 100644 --- a/cypress/fixtures/fireboltCalls/parameters.json +++ b/cypress/fixtures/fireboltCalls/parameters.json @@ -244,7 +244,7 @@ "validationJsonPath": "result", "content": "ADVERTISING_ADVERTISINGID_ADON" }, - + "NULLINTENT_SOURCE_FOR_INITIALIZATION_PARAMETERS": { "method": "parameters.initialization", "context": "DISCOVERY_LAUNCH_NULL", diff --git a/cypress/fixtures/objects/errorContentObjects.js b/cypress/fixtures/objects/errorContentObjects.js new file mode 100644 index 000000000..fdd47f373 --- /dev/null +++ b/cypress/fixtures/objects/errorContentObjects.js @@ -0,0 +1,29 @@ +/** + * 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 + */ +exports.NOT_SUPPORTED = { + type: 'schemaOnly', +}; +exports.NOT_PERMITTED = { + type: 'schemaOnly', +}; +exports.NOT_AVAILABLE = { + type: 'schemaOnly', +}; +exports.INVALID_TYPE_PARAMS = { + type: 'schemaOnly', +}; diff --git a/cypress/support/cypress-support/src/utils.js b/cypress/support/cypress-support/src/utils.js index 1c3d2028c..fb415416b 100644 --- a/cypress/support/cypress-support/src/utils.js +++ b/cypress/support/cypress-support/src/utils.js @@ -904,6 +904,49 @@ function parseValue(str) { return str; } +/** + * @module utils + * @globalfunction extractEnvValue + * @description Extracts a value from environment variable or device data. + * @param {String} attribute - The value to extract from the environment variables or device data. + * @example + * extractEnvValue('DEVICEID') + * extractEnvValue('CYPRESSENV-defaultTestData-deviceResolution') + * @returns + * 1234 + * [[1280, 720], [1920, 1080], [3840, 2160]] + */ +global.extractEnvValue = function (attribute) { + // Get the device data from env variable + const deviceData = Cypress.env(CONSTANTS.DEVICE_DATA); + if (!deviceData) { + logger.info('deviceData environment variable is not found'); + } + + // If the attribute starts with 'CYPRESSENV', extract nested property from env variable. + if (/CYPRESSENV/.test(attribute)) { + const parts = attribute.split('-').slice(1); + let envValue; + + if (parts.length > 1) { + const objectName = parts[0]; + const propertyName = parts[1]; + envValue = Cypress.env(objectName) ? Cypress.env(objectName)[propertyName] : undefined; + } else { + const envKey = parts[0]; + envValue = Cypress.env(envKey); + } + + if (envValue !== undefined) { + attribute = envValue; + } else { + logger.info(`Cypress env variable '${attribute}' does not exist`); + } + } + // Return the extracted value from device data or environment variable + return deviceData?.[attribute] ?? attribute; +}; + /** * @module utils * @globalfunction resolveAtRuntime