diff options
Diffstat (limited to 'vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts')
-rw-r--r-- | vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts | 86 |
1 files changed, 53 insertions, 33 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts index e379f7835..133dbe72a 100644 --- a/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts +++ b/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts @@ -17,6 +17,22 @@ describe('Drawing board', function () { cy.screenshot(); }); + function addSameVnfMultipleTimes() { + cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'); + const vnfNodeName = 'node-2017-488_PASQUALE-vPE 0'; + cy.drawingBoardPressAddButtonByElementName(vnfNodeName).get('i').should('have.class', 'fa-plus-circle'); + cy.drawingBoardPressAddButtonByElementName(vnfNodeName).click({force: true}); + cy.fillVnfPopup(true).then(() => { + cy.drawingBoardPressAddButtonByElementName(vnfNodeName).click({force: true}); + cy.fillVnfPopup().then(() => { + cy.drawingBoardPressAddButtonByElementName(vnfNodeName).click({force: true}); + cy.fillVnfPopup().then(() => { + cy.drawingBoardNumberOfExistingElementsShouldContains(3); + }); + }); + }); + } + describe('duplicate', () => { it('delete vf module reduce the number of vf modules ', function () { @@ -25,7 +41,7 @@ describe('Drawing board', function () { cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'); cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').get('i').should('have.class', 'fa-plus-circle'); cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').click({force: true}); - cy.fillVnfPopup().then(() => { + cy.fillVnfPopup(true).then(() => { cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').click({force: true}); cy.fillVnfPopup().then(() => { cy.drawingBoardNumberOfExistingElementsShouldContains(2); @@ -40,18 +56,7 @@ describe('Drawing board', function () { it('create new vf module update the number of vf modules ', () => { cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((res) => { cy.setReduxState(<any>res); - cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'); - cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').get('i').should('have.class', 'fa-plus-circle'); - cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').click({force: true}); - cy.fillVnfPopup().then(() => { - cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').click({force: true}); - cy.fillVnfPopup().then(() => { - cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').click({force: true}); - cy.fillVnfPopup().then(() => { - cy.drawingBoardNumberOfExistingElementsShouldContains(3); - }); - }); - }); + addSameVnfMultipleTimes(); }); }); @@ -61,7 +66,7 @@ describe('Drawing board', function () { cy.openIframe('app/ui/#/servicePlanning?serviceModelId=2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'); cy.drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').get('i').should('have.class', 'fa-plus-circle') .drawingBoardPressAddButtonByElementName('node-2017-488_PASQUALE-vPE 0').click({force: true}); - cy.fillVnfPopup().then(() => { + cy.fillVnfPopup(true).then(() => { cy.drawingBoardTreeOpenContextMenuByElementDataTestId('node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_PASQUALE-vPE 0') .drawingBoardTreeClickOnContextMenuOptionByName('Duplicate') .get('.quantity-select option').should('have.length', 9) @@ -238,6 +243,32 @@ describe('Drawing board', function () { }); + describe('default max instances value', () => { + + it('when there is no maxCountInstances for vfModule, it can be added unlimited times', () => { + let reduxState = getReduxWithVNFS(false); + (<any> reduxState.global.flags)['FLAG_2002_UNLIMITED_MAX'] = true; + cy.setReduxState(<any>reduxState); + cy.openIframe('app/ui/#/servicePlanning?serviceModelId=6e59c5de-f052-46fa-aa7e-2fca9d674c44'); + const vfModuleName = 'vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2'; + const vnfName = "VF_vGeraldine 0"; + cy.addMacroVfModule(vnfName, vfModuleName, 'module-1'); + cy.addMacroVfModule(vnfName, vfModuleName, 'module-2'); + cy.addMacroVfModule(vnfName, vfModuleName, 'module-3'); + cy.getElementByDataTestsId('node-d6557200-ecf2-4641-8094-5393ae3aae60-VF_vGeraldine 0').click(); + cy.getElementByDataTestsId('node-41708296-e443-4c71-953f-d9a010f059e1-vf_vgeraldine0..VfVgeraldine..vflorence_gpb..module-2').should('have.length', 3); + }); + + it('when there is no max_instances for VNF, it can be added multiple times ', () => { + cy.readFile('cypress/support/jsonBuilders/mocks/jsons/emptyServiceRedux.json').then((reduxState) => { + reduxState.global['flags'] = { 'FLAG_2002_UNLIMITED_MAX' : true }; + delete reduxState.service.serviceHierarchy['2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd'].vnfs['2017-488_PASQUALE-vPE 0'].properties.max_instances; + cy.setReduxState(<any>reduxState); + addSameVnfMultipleTimes(); + }); + }); + }); + describe('multiple tests', () => { it('remove vfModule with missing data should update deploy button status', () => { let res = getReduxWithVFModuleMissingData(); @@ -325,7 +356,7 @@ describe('Drawing board', function () { cy.selectDropdownOptionByText('lcpRegion', 'hvf6'); cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-testalexandria'); cy.selectDropdownOptionByText('lineOfBusiness', 'ONAP'); - cy.selectDropdownOptionByText('platform', 'platform'); + cy.selectPlatformValue('platform'); cy.genericFormSubmitForm(); cy.getElementByDataTestsId('node-afacccf6-397d-45d6-b5ae-94c39734b168-2017-388_PASQUALE-vPE 0').contains('<Automatically Assigned>'); @@ -345,8 +376,9 @@ describe('Drawing board', function () { cy.selectDropdownOptionByText('productFamily', 'ERICA'); cy.selectDropdownOptionByText('lcpRegion', 'hvf6'); cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-testalexandria'); - cy.selectDropdownOptionByText('lineOfBusiness', 'ONAP'); - cy.selectDropdownOptionByText('platform', 'platform'); + cy.selectDropdownOptionByText('lineOfBusiness', 'ONAP') + cy.selectPlatformValue('platform'); + cy.genericFormSubmitForm(); cy.getElementByDataTestsId('node-69e09f68-8b63-4cc9-b9ff-860960b5db09-2017-488_PASQUALE-vPE 0').contains(vnfModelName); @@ -577,14 +609,13 @@ describe('Drawing board', function () { "flags": { "FLAG_SHOW_ASSIGNMENTS": true, "FLAG_SHOW_VERIFY_SERVICE": false, - "EMPTY_DRAWING_BOARD_TEST": false, "FLAG_ADD_MSO_TESTAPI_FIELD": true, "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false, "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true, "FLAG_SERVICE_MODEL_CACHE": true, - "CREATE_INSTANCE_TEST": false, - "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false, - "FLAG_1906_COMPONENT_INFO" : false + "FLAG_1906_COMPONENT_INFO" : false, + "FLAG_2002_VNF_PLATFORM_MULTI_SELECT" : false, + "FLAG_2002_UNLIMITED_MAX" : true }, "type": "[FLAGS] Update" }, @@ -2211,9 +2242,6 @@ describe('Drawing board', function () { "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true, "FLAG_SHOW_VERIFY_SERVICE": false, "FLAG_SERVICE_MODEL_CACHE": true, - "CREATE_INSTANCE_TEST": false, - "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": true, - "EMPTY_DRAWING_BOARD_TEST": false, "FLAG_ADD_MSO_TESTAPI_FIELD": true }, "type": "[FLAGS] Update" @@ -3864,9 +3892,6 @@ describe('Drawing board', function () { "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true, "FLAG_SHOW_VERIFY_SERVICE": false, "FLAG_SERVICE_MODEL_CACHE": true, - "CREATE_INSTANCE_TEST": false, - "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": true, - "EMPTY_DRAWING_BOARD_TEST": false, "FLAG_ADD_MSO_TESTAPI_FIELD": true }, "type": "[FLAGS] Update" @@ -5603,7 +5628,6 @@ describe('Drawing board', function () { "name": null, "type": "UPDATE_DRAWING_BOARD_STATUS", "flags": { - "CREATE_INSTANCE_TEST": false, "EMPTY_DRAWING_BOARD_TEST": false, "FLAG_NETWORK_TO_ASYNC_INSTANTIATION": false, "FLAG_ADD_MSO_TESTAPI_FIELD": true, @@ -5611,7 +5635,6 @@ describe('Drawing board', function () { "FLAG_SHOW_ASSIGNMENTS": true, "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true, "FLAG_DEFAULT_VNF": true, - "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": true, "FLAG_A_LA_CARTE_AUDIT_INFO": true, "FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST": true, "FLAG_PRESENT_PROVIDER_NETWORKS_ASSOCIATIONS": true, @@ -6293,7 +6316,7 @@ describe('Drawing board', function () { } } - function getReduxWithVNFS(isEcompGeneratedNaming: boolean) { + function getReduxWithVNFS(isEcompGeneratedNaming: boolean){ return { "global": { "name": null, @@ -6303,9 +6326,6 @@ describe('Drawing board', function () { "FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS": true, "FLAG_SHOW_VERIFY_SERVICE": false, "FLAG_SERVICE_MODEL_CACHE": true, - "CREATE_INSTANCE_TEST": false, - "FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD": false, - "EMPTY_DRAWING_BOARD_TEST": false, "FLAG_ADD_MSO_TESTAPI_FIELD": true, "FLAG_SUPPLEMENTARY_FILE": true }, |