diff options
author | Eylon Malin <eylon.malin@intl.att.com> | 2019-12-11 16:57:38 +0200 |
---|---|---|
committer | Eylon Malin <eylon.malin@intl.att.com> | 2019-12-12 10:00:19 +0200 |
commit | ff1510595b81a33893028c43990af60d87a586fe (patch) | |
tree | 9875c4fc5946ee73f0c5d52c55d4c757044d4b33 /vid-webpack-master | |
parent | f06c7ce17569c67ff4e70b1a95964d843fccd45a (diff) |
cypress test - default max instances of VNFs is unlimited
Issue-ID: VID-726
Change-Id: I1e5dd9997a4ab38944a56cce8dd94b24ae0320dd
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-webpack-master')
-rw-r--r-- | vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/drawingBoard.e2e.ts index a9aa00b2c..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 () { @@ -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(true).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(); }); }); @@ -239,6 +244,7 @@ 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; @@ -252,6 +258,15 @@ describe('Drawing board', function () { 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', () => { |