Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FCS] Setter/Getter Code Refactoring #147

Merged
merged 19 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
284 changes: 141 additions & 143 deletions cypress/TestCases/FireboltCertification/Accessibility.feature

Large diffs are not rendered by default.

Large diffs are not rendered by default.

145 changes: 145 additions & 0 deletions cypress/fixtures/fireboltCalls/accessibility.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
exports.ACCESSIBILITY_CLOSEDCAPTIONS_SETTINGS = {
method: 'accessibility.closedCaptionsSettings',
params: null,
validationJsonPath: resolveAtRuntime(['result.{{attribute}}', 'result.styles.{{attribute}}']),
setMethod: resolveAtRuntime('manage_closedcaptions.set{{attribute.uppercaseFirstChar}}'),
setParams: resolveAtRuntime('value'),
setValidationJsonPath: 'result',
setContent: null,
event: 'accessibility.onClosedCaptionsSettingsChanged',
eventValidationJsonPath: resolveAtRuntime([
'eventResponse.{{attribute}}',
'eventResponse.styles.{{attribute}}',
]),
content: {
data: [
{
type: 'fixture',
validations: [
{
mode: 'staticContentValidation',
type: resolveAtRuntime('value'),
description: resolveAtRuntime(
'Validating that accessibility.closedCaptionSettings {{attribute}} is {{value}}'
),
},
],
},
],
},
};

exports.ACCESSIBILITY_VOICEGUIDANCE_SETTINGS = {
method: 'accessibility.voiceGuidanceSettings',
params: null,
validationJsonPath: resolveAtRuntime(['result.{{attribute}}']),
setMethod: resolveAtRuntime('manage_voiceguidance.set{{attribute.uppercaseFirstChar}}'),
setParams: resolveAtRuntime('value'),
setValidationJsonPath: 'result',
setContent: null,
event: 'accessibility.onVoiceGuidanceSettingsChanged',
eventValidationJsonPath: resolveAtRuntime(['eventResponse.{{attribute}}']),
content: {
data: [
{
type: 'fixture',
validations: [
{
mode: 'staticContentValidation',
type: resolveAtRuntime('value'),
description: resolveAtRuntime(
'Validating that accessibility.voiceGuidanceSettings {{attribute}} is {{value}}'
),
},
],
},
],
},
};

exports.AUDIODESCRIPTIONS_SETTINGS = {
method: 'accessibility.audioDescriptionSettings',
params: null,
validationJsonPath: resolveAtRuntime(['result.{{attribute}}']),
setMethod: resolveAtRuntime('manage_audiodescriptions.set{{attribute.uppercaseFirstChar}}'),
setParams: resolveAtRuntime('value'),
setValidationJsonPath: 'result',
setContent: null,
event: 'accessibility.onAudioDescriptionSettingsChanged',
eventValidationJsonPath: resolveAtRuntime(['eventResponse.{{attribute}}']),
content: {
data: [
{
type: 'fixture',
validations: [
{
mode: 'staticContentValidation',
type: resolveAtRuntime('value'),
description: resolveAtRuntime(
'Validating that accessibility.audioDescriptionSettings {{attribute}} is {{value}}'
),
},
],
},
],
},
};

exports.ACCESSIBILITY_CLOSEDCAPTIONS = {
method: 'accessibility.closedCaptions',
params: null,
validationJsonPath: resolveAtRuntime(['result.{{attribute}}', 'result.styles.{{attribute}}']),
setMethod: resolveAtRuntime('manage_closedcaptions.set{{attribute.uppercaseFirstChar}}'),
setParams: resolveAtRuntime('value'),
setValidationJsonPath: 'result',
setContent: null,
event: 'accessibility.onClosedCaptionsSettingsChanged',
eventValidationJsonPath: resolveAtRuntime([
'eventResponse.{{attribute}}',
'eventResponse.styles.{{attribute}}',
]),
content: {
data: [
{
type: 'fixture',
validations: [
{
mode: 'staticContentValidation',
type: resolveAtRuntime('value'),
description: resolveAtRuntime(
'Validating that accessibility.closedCaptions {{attribute}} is {{value}}'
),
},
],
},
],
},
};

exports.ACCESSIBILITY_VOICEGUIDANCE = {
method: 'accessibility.voiceGuidance',
params: null,
validationJsonPath: resolveAtRuntime(['result.{{attribute}}']),
setMethod: resolveAtRuntime('manage_voiceguidance.set{{attribute.uppercaseFirstChar}}'),
setParams: resolveAtRuntime('value'),
setValidationJsonPath: 'result',
setContent: null,
event: 'accessibility.onVoiceGuidanceSettingsChanged',
eventValidationJsonPath: resolveAtRuntime(['eventResponse.{{attribute}}']),
content: {
data: [
{
type: 'fixture',
validations: [
{
mode: 'staticContentValidation',
type: resolveAtRuntime('value'),
description: resolveAtRuntime(
'Validating that accessibility.voiceGuidance {{attribute}} is {{value}}'
),
},
],
},
],
},
};
27 changes: 27 additions & 0 deletions cypress/fixtures/fireboltCalls/closedcaptions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
exports.CLOSED_CAPTIONS_SETTINGS = {
method: resolveAtRuntime('manage_closedcaptions.{{attribute}}'),
params: null,
validationJsonPath: 'result',
setMethod: resolveAtRuntime('manage_closedcaptions.set{{attribute.uppercaseFirstChar}}'),
setParams: resolveAtRuntime('value'),
setValidationJsonPath: 'result',
setContent: null,
event: resolveAtRuntime('manage_closedcaptions.on{{attribute.uppercaseFirstChar}}Changed'),
eventValidationJsonPath: 'eventResponse',
content: {
data: [
{
type: 'fixture',
validations: [
{
mode: 'staticContentValidation',
type: resolveAtRuntime('value'),
description: resolveAtRuntime(
'Validating that manage_closedcaptions.on{{event.uppercaseFirstChar}} {{attribute}} is {{value}}'
),
},
],
},
],
},
};
6 changes: 4 additions & 2 deletions cypress/support/appObjectConfigs.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ class eventObject {
// Function to update the event response in event object.
setEventResponseData(response) {
if (
(response.eventSchemaResult && response.eventResponse != null) ||
response.hasOwnProperty(CONSTANTS.EVENT_RESPONSE)
(response && response.eventResponse && response.eventResponse[this.eventObjectId] != null) ||
(response &&
response.eventResponse != null &&
!response.eventResponse.hasOwnProperty(this.eventObjectId))
) {
this.eventResponse = response.eventResponse;
this.eventSchemaResult = response.eventSchemaResult;
Expand Down
7 changes: 5 additions & 2 deletions cypress/support/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = {
ALPHANUMERIC: 'alphanumeric',
API_NAME: 'apiName',
API_VERSION: 'apiVersion',
APP: 'App',
APP_HISTORY_EMPTY: 'App history is empty',
APP_ID: 'appId',
APP_LIFECYCLE_HISTORY: 'appLifeCycleHistory',
Expand Down Expand Up @@ -96,6 +97,7 @@ module.exports = {
ERROR: 'error',
ERROR_CONTENT_JSON_PATH: 'objects/errorObjects/errorContent.json',
ERROR_CONTENT_OBJECTS_PATH: 'cypress/fixtures/objects/errorObjects/errorContent.json',
ERROR_CONTENT_VALIDATIONJSON: 'errorContentValidationJson',
ERROR_EXPECTED: 'Expected response.error not to be null',
ERROR_EXPECTED_DEFINED: 'Expected response.error to be defined',
ERROR_EXPECTED_NULL: 'Expected response.error to be null',
Expand Down Expand Up @@ -297,8 +299,7 @@ module.exports = {
PARAMS: 'Params',
PASS: 'PASS',
PASSWORD: 'password',
PLATFORM_INVALID_RESPONSE_LOG:
'Platform returned response in invalid format, which could lead to failures in validations. Response must be an object',
PLATFORM: 'Platform',
PLATFORM_NOT_SUPPORT_LOG: 'Platform does not support method',
PLATFORM_NOT_TRIGGER_EVENT: 'Platform MUST not trigger event ',
PLATFORM_TRIGGER_EVENT: 'Platform MUST trigger event ',
Expand Down Expand Up @@ -331,6 +332,8 @@ module.exports = {
},
PERFORMANCE_METRICS: 'performanceMetrics',
RESPONSE: 'Response: ',
RESPONSE_INVALID_RESPONSE_LOG:
'Platform or App returned response in invalid format, which could lead to failures in validations. Response must be in JSON RPC format',
RESPONSE_NOT_FOUND: 'No_Response',
RESPONSE_STATUS: {
OK: 'OK',
Expand Down
Loading
Loading