summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts')
-rw-r--r--vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts37
1 files changed, 32 insertions, 5 deletions
diff --git a/vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts b/vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts
index 115173632..b9c051e54 100644
--- a/vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts
+++ b/vid-webpack-master/cypress/support/steps/genericForm/genericFormAction.steps.ts
@@ -1,20 +1,42 @@
declare namespace Cypress {
interface Chainable {
genericFormSubmitForm: typeof genericFormSubmitForm
+ selectMultiselectValue: typeof selectMultiselectValue
selectPlatformValue: typeof selectPlatformValue
+ selectLobValue: typeof selectLobValue
+ checkMultiSelectValue: typeof checkMultiSelectValue
checkPlatformValue: typeof checkPlatformValue
+ checkLobValue: typeof checkLobValue
+
}
}
-function selectPlatformValue(selectOption: string) {
- cy.getElementByDataTestsId("multi-selectPlatform").get('.c-btn').click({force: true});
- cy.getElementByDataTestsId(`multi-selectPlatform-${selectOption}`).click();
- cy.getElementByDataTestsId("multi-selectPlatform").get('.c-btn').click({force: true});
+function selectMultiselectValue(dataTestsId: string , selectOptionId: string) {
+ cy.getElementByDataTestsId(dataTestsId).find('.c-btn').eq(0).click({force: true})
+ cy.getElementByDataTestsId(selectOptionId).click();
+ cy.getElementByDataTestsId(dataTestsId).find('.c-btn').eq(0).click({force: true})
+}
+
+function selectPlatformValue(selectOptionId: string) {
+ selectMultiselectValue("multi-selectPlatform", "multi-selectPlatform-" + selectOptionId)
+}
+
+function selectLobValue(selectOptionId: string) {
+ selectMultiselectValue("multi-lineOfBusiness", "multi-lineOfBusiness-" + selectOptionId)
+
}
function checkPlatformValue(value: string){
- return cy.getElementByDataTestsId("multi-selectPlatform").should("contain", value)
+ return checkMultiSelectValue("multi-selectPlatform", value)
+}
+
+function checkLobValue(value: string){
+ return checkMultiSelectValue("multi-lineOfBusiness", value)
+}
+
+function checkMultiSelectValue(dataTestsId: string, value: string) {
+ return cy.getElementByDataTestsId(dataTestsId).should("contain", value)
}
function genericFormSubmitForm(): Chainable<any> {
@@ -23,5 +45,10 @@ function genericFormSubmitForm(): Chainable<any> {
Cypress.Commands.add('genericFormSubmitForm', genericFormSubmitForm);
+Cypress.Commands.add('selectMultiselectValue', selectMultiselectValue);
Cypress.Commands.add('selectPlatformValue', selectPlatformValue);
+Cypress.Commands.add('selectLobValue', selectLobValue);
+Cypress.Commands.add('checkMultiSelectValue', checkMultiSelectValue);
Cypress.Commands.add('checkPlatformValue', checkPlatformValue);
+Cypress.Commands.add('checkLobValue', checkLobValue);
+