Skip to content

Commit

Permalink
Addressed the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishk123 committed Jul 15, 2024
1 parent 2d2b501 commit 0e41b42
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 87 deletions.
40 changes: 20 additions & 20 deletions cypress/TestCases/FireboltCertification/Accessibility.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Feature: Accessibility

@Accessibility @coreSDK @sdk @transport
Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: <Scenario>
Given we test the 'CLOSEDCAPTIONS_SETTINGS' getters and setters '<Method>' to '<Value>'
Given we test the 'ACCESSIBILITY_CLOSEDCAPTIONS_SETTINGS' getters and setters '<Method>' to '<Value>'
When '3rd party app' registers for the 'Firebolt' event
When '3rd party app' invokes the 'Firebolt' get API
Given 1st party app invokes the 'Firebolt' API to set '<Method>' to '<Value>'
Expand Down Expand Up @@ -39,7 +39,7 @@ Feature: Accessibility
| Set fontEdgeColor-#FFFFFF | fontEdgeColor | #FFFFFF |
| Set backgroundColor-#7f7f7f | backgroundColor | #7f7f7 |
| Set fontOpacity-75 | fontOpacity | 75 |
| Set backgroundOpacity-75 | fontOpacity | 75 |
| Set backgroundOpacity-75 | backgroundOpacity | 75 |
| Set textAlign-left | textAlign | left |
| Set textAlign-center | textAlign | center |
| Set textAlign-right | textAlign | right |
Expand All @@ -51,8 +51,8 @@ Feature: Accessibility
| Set preferredLanguages | preferredLanguages | spa,eng |

@Accessibility @coreSDK @sdk @transport
Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: <Scenario> with 'null' params
Given we test the 'CLOSEDCAPTIONS_SETTINGS' getters and setters '<Method>' to '<Value>'
Scenario Outline: Accessibility.closedCaptionsSettings - Positive Scenario: <Method> with 'null' params
Given we test the 'ACCESSIBILITY_CLOSEDCAPTIONS_SETTINGS' getters and setters '<Method>' to 'null'
When '3rd party app' registers for the 'Firebolt' event
When '3rd party app' invokes the 'Firebolt' get API
Given 1st party app invokes the 'Firebolt' API to set '<Method>' to 'null'
Expand All @@ -62,23 +62,23 @@ Feature: Accessibility
And 'Firebolt' platform triggers '3rd party app' event

Examples:
| Scenario | Method |
| fontFamily | fontFamily |
| fontSize | fontSize |
| fontColor | fontColor |
| fontEdge | fontEdge |
| fontEdgeColor | fontEdgeColor |
| fontOpacity | fontOpacity |
| backgroundColor | backgroundColor |
| backgroundOpacity | backgroundOpacity |
| textAlign | textAlign |
| textAlignVertical | textAlignVertical |
| windowColor | windowColor |
| windowOpacity | windowOpacity |
| Method |
| fontFamily |
| fontSize |
| fontColor |
| fontEdge |
| fontEdgeColor |
| fontOpacity |
| backgroundColor |
| backgroundOpacity |
| textAlign |
| textAlignVertical |
| windowColor |
| windowOpacity |

@Accessibility @coreSDK @sdk @transport
Scenario Outline: Accessibility.voiceGuidanceSettings - Positive Scenario: <Scenario>
Given we test the 'VOICEGUIDANCE_SETTINGS' getters and setters '<Method>' to '<Value>'
Given we test the 'ACCESSIBILITY_VOICEGUIDANCE_SETTINGS' getters and setters '<Method>' to '<Value>'
When '3rd party app' registers for the 'Firebolt' event
When '3rd party app' invokes the 'Firebolt' get API
Given 1st party app invokes the 'Firebolt' API to set '<Method>' to '<Value>'
Expand Down Expand Up @@ -113,7 +113,7 @@ Feature: Accessibility

@Accessibility @coreSDK @sdk @transport
Scenario Outline: Accessibility.closedCaptions - Positive Scenario: <Scenario>
Given we test the 'CLOSEDCAPTIONS' getters and setters '<Method>' to '<Value>'
Given we test the 'ACCESSIBILITY_CLOSEDCAPTIONS' getters and setters '<Method>' to '<Value>'
When '3rd party app' registers for the 'Firebolt' event
Given 1st party app invokes the 'Firebolt' API to set '<Method>' to '<Value>'
And 'Firebolt' platform responds to '1st party app' set API
Expand All @@ -139,7 +139,7 @@ Feature: Accessibility

@Accessibility @coreSDK @sdk @transport
Scenario Outline: Accessibility.voiceGuidance - Positive Scenario: <Scenario>
Given we test the 'VOICEGUIDANCE' getters and setters '<Method>' to '<Value>'
Given we test the 'ACCESSIBILITY_VOICEGUIDANCE' getters and setters '<Method>' to '<Value>'
When '3rd party app' registers for the 'Firebolt' event
When '3rd party app' invokes the 'Firebolt' get API
Given 1st party app invokes the 'Firebolt' API to set '<Method>' to '<Value>'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ Feature: ClosedCaptions_Manage
| Set windowOpacity-50 | windowOpacity | 50 |

@ClosedCaptions @manageSDK
Scenario Outline: ClosedCaptions.<Method> - Positive Scenario: <Scenario>
Given we test the 'CLOSED_CAPTIONS_SETTINGS' getters and setters '<Method>' to '<Value>'
Scenario Outline: ClosedCaptions.<Method> - Positive Scenario: <Method>
Given we test the 'CLOSED_CAPTIONS_SETTINGS' getters and setters '<Method>' to 'null'
When '1st party app' registers for the 'Firebolt' event
And 1st party app invokes the 'Firebolt' API to set '<Method>' to 'null'
Then 'Firebolt' platform responds to '1st party app' set API
Expand All @@ -58,19 +58,19 @@ Feature: ClosedCaptions_Manage
And 'Firebolt' platform triggers '1st party app' event

Examples:
| Scenario | Method |
| fontFamily | fontFamily |
| fontSize | fontSize |
| fontColor | fontColor |
| fontEdge | fontEdge |
| fontEdgeColor | fontEdgeColor |
| fontOpacity | fontOpacity |
| backgroundColor | backgroundColor |
| backgroundOpacity | backgroundOpacity |
| textAlign | textAlign |
| textAlignVertical | ftextAlignVerticalontColor |
| windowColor | windowColor |
| windowOpacity | windowOpacity |
| Method |
| fontFamily |
| fontSize |
| fontColor |
| fontEdge |
| fontEdgeColor |
| fontOpacity |
| backgroundColor |
| backgroundOpacity |
| textAlign |
| textAlignVerticalontColor |
| windowColor |
| windowOpacity |

@ClosedCaptions @manageSDK
Scenario Outline: ClosedCaptions.<Method> - Negative Scenario: <Scenario> expecting error
Expand Down
8 changes: 4 additions & 4 deletions cypress/fixtures/fireboltCalls/accessibility.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exports.CLOSEDCAPTIONS_SETTINGS = {
exports.ACCESSIBILITY_CLOSEDCAPTIONS_SETTINGS = {
method: 'accessibility.closedCaptionsSettings',
params: null,
validationJsonPath: resolveAtRuntime(['result.{{attribute}}', 'result.styles.{{attribute}}']),
Expand Down Expand Up @@ -29,7 +29,7 @@ exports.CLOSEDCAPTIONS_SETTINGS = {
},
};

exports.VOICEGUIDANCE_SETTINGS = {
exports.ACCESSIBILITY_VOICEGUIDANCE_SETTINGS = {
method: 'accessibility.voiceGuidanceSettings',
params: null,
validationJsonPath: resolveAtRuntime(['result.{{attribute}}']),
Expand Down Expand Up @@ -85,7 +85,7 @@ exports.AUDIODESCRIPTIONS_SETTINGS = {
},
};

exports.CLOSEDCAPTIONS = {
exports.ACCESSIBILITY_CLOSEDCAPTIONS = {
method: 'accessibility.closedCaptions',
params: null,
validationJsonPath: resolveAtRuntime(['result.{{attribute}}', 'result.styles.{{attribute}}']),
Expand Down Expand Up @@ -116,7 +116,7 @@ exports.CLOSEDCAPTIONS = {
},
};

exports.VOICEGUIDANCE = {
exports.ACCESSIBILITY_VOICEGUIDANCE = {
method: 'accessibility.voiceGuidance',
params: null,
validationJsonPath: resolveAtRuntime(['result.{{attribute}}']),
Expand Down
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
47 changes: 1 addition & 46 deletions cypress/support/cypress-commands/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -1005,51 +1005,6 @@ Cypress.Commands.add('methodOrEventResponseValidation', (validationType, request
expectingError === true ? contentObject : CONSTANTS.EXCEPTION_ERROR_OBJECT;
cy.validateErrorObject(method, errorContent, validationType, context, appId, param);
} else {
if (validationType == CONSTANTS.EVENT) {
const eventName = methodOrEventObject.eventObjectId;
if (appId === UTILS.getEnvVariable(CONSTANTS.FIRST_PARTY_APPID)) {
const requestMap = {
method: CONSTANTS.REQUEST_OVERRIDE_CALLS.FETCH_EVENT_RESPONSE,
params: eventName,
};

cy.sendMessagetoPlatforms(requestMap).then((result) => {
cy.updateResponseForFCS(method, null, result, true).then((updatedResponse) => {
cy.saveEventResponse(
updatedResponse,
methodOrEventObject,
eventName,
eventExpected === 'triggers' ? true : false
);
});
});
} else {
const params = { event: eventName };
// Generating an intent message using the provided information to send it to a third-party app
const intentMessage = UTILS.createIntentMessage(CONSTANTS.TASK.GETEVENTRESPONSE, params);
const requestTopic = UTILS.getTopic(appId);
const responseTopic = UTILS.getTopic(appId, CONSTANTS.SUBSCRIBE);
cy.sendMessagetoApp(requestTopic, responseTopic, intentMessage).then((response) => {
response = JSON.parse(response);
if (
response &&
response.result &&
response.result.hasOwnProperty(CONSTANTS.EVENT_RESPONSE)
) {
response.result = response.result.eventResponse;
}
cy.updateResponseForFCS(method, null, response, true).then((updatedResponse) => {
cy.saveEventResponse(
updatedResponse,
methodOrEventObject,
eventName,
eventExpected === 'triggers' ? true : false
);
});
});
}
}

cy.then(() => {
if (validationType == CONSTANTS.EVENT) {
const eventName = methodOrEventObject.eventObjectId;
Expand Down Expand Up @@ -1119,7 +1074,7 @@ Cypress.Commands.add('methodOrEventResponseValidation', (validationType, request
? (validationJsonPath = validationPath)
: fireLog.assert(
false,
'Could not find the valid validation path from the validationJsonPath list'
`Could not find the valid validation path from the validationJsonPath list - ${validationJsonPath}`
);
}
switch (scenario) {
Expand Down
3 changes: 3 additions & 0 deletions cypress/support/cypress-support/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,9 @@ function parseValue(str) {
if (str.includes(',')) {
return str.split(',');
}
if (/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(str)) {
return str;
}
}

return str;
Expand Down

0 comments on commit 0e41b42

Please sign in to comment.