diff options
Diffstat (limited to 'vid-webpack-master/cypress/support')
4 files changed, 42 insertions, 11 deletions
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json index 148f6b4d5..7c778c86b 100644 --- a/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json +++ b/vid-webpack-master/cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json @@ -25,5 +25,6 @@ "FLAG_2004_CREATE_ANOTHER_INSTANCE_FROM_TEMPLATE": true, "FLAG_2006_VFM_SDNC_PRELOAD_FILES" : true, "FLAG_2006_VFMODULE_TAKES_TENANT_AND_REGION_FROM_VNF": true, - "FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT" :true + "FLAG_2006_NETWORK_PLATFORM_MULTI_SELECT" :true, + "FLAG_2006_NETWORK_LOB_MULTI_SELECT" : true } diff --git a/vid-webpack-master/cypress/support/steps/fill.network.step.ts b/vid-webpack-master/cypress/support/steps/fill.network.step.ts index 4ca1796f1..0fa7f6b32 100644 --- a/vid-webpack-master/cypress/support/steps/fill.network.step.ts +++ b/vid-webpack-master/cypress/support/steps/fill.network.step.ts @@ -5,14 +5,17 @@ declare namespace Cypress { } } -function fillNetworkPopup(shouldSelectAdditionalPlatform: boolean = false): Cypress.Chainable<any> { +function fillNetworkPopup(shouldSelectAdditionalPlatform: boolean = false, shouldSelectAdditionalLob: boolean = false): Cypress.Chainable<any> { cy.selectDropdownOptionByText('productFamily', 'Emanuel'); cy.selectDropdownOptionByText('lcpRegion', 'hvf6'); cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-STTest2'); - cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1'); - cy.selectPlatformValue('xxx1'); + cy.selectLobValue("zzz1"); + cy.selectPlatformValue(`xxx1`); if(shouldSelectAdditionalPlatform){ - cy.selectPlatformValue('platform'); + cy.selectPlatformValue(`platform`); + } + if(shouldSelectAdditionalLob){ + cy.selectLobValue("ONAP"); } return cy.getElementByDataTestsId('form-set').click({force : true}).then((done)=>{ return done; diff --git a/vid-webpack-master/cypress/support/steps/fill.vnf.popup.step.ts b/vid-webpack-master/cypress/support/steps/fill.vnf.popup.step.ts index 29166f67d..7c82cf802 100644 --- a/vid-webpack-master/cypress/support/steps/fill.vnf.popup.step.ts +++ b/vid-webpack-master/cypress/support/steps/fill.vnf.popup.step.ts @@ -12,7 +12,7 @@ function FillVnfPopup(): Chainable<any> { cy.selectDropdownOptionByText('lcpRegion', 'hvf6'); cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-STTest2'); cy.selectDropdownOptionByText('lineOfBusiness', 'zzz1'); - cy.selectPlatformValue('xxx1'); + cy.selectPlatformValue(`xxx1`); return cy.getElementByDataTestsId('form-set').click({force : true}).then((done)=>{ return done; }); 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); + |