From d50f96bf6dc183b49c2a5d4e7d729066ac129527 Mon Sep 17 00:00:00 2001 From: ikram Date: Wed, 15 Jul 2020 17:45:37 -0400 Subject: Add Pause Functionality from Inside VF Module's Edit Dialog Issue-ID: VID-858 Allow user to choose adding (and removing) Pause points from within the Edit Dialog of the VF Module. Currently, the support of adding is only from the vertical ellipsis menu. Also, there is currently no option of removing the pause point. This functionality will allow this to happen as well since inside the Edit dialog, the option is a checkbox which can now unchecked. Note: removing the pause point from within the vertical ellipse after being added will be covered in a separate user story. However, the desired functionality can still be reached using this commit as describe above. Signed-off-by: ikram Change-Id: Icaf5e93bde67938836c42fc417edc278e9335e75 --- .../pauseInstantiationOnVfModulePopup.e2e.ts | 60 ++++++++++++++++++++++ .../shared.controllers.service.spec.ts | 15 ++++++ 2 files changed, 75 insertions(+) create mode 100644 vid-webpack-master/cypress/integration/iFrames/pauseInstantiationOnVfModulePopup.e2e.ts (limited to 'vid-webpack-master') diff --git a/vid-webpack-master/cypress/integration/iFrames/pauseInstantiationOnVfModulePopup.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/pauseInstantiationOnVfModulePopup.e2e.ts new file mode 100644 index 000000000..088e6874d --- /dev/null +++ b/vid-webpack-master/cypress/integration/iFrames/pauseInstantiationOnVfModulePopup.e2e.ts @@ -0,0 +1,60 @@ +describe('Create Instance Page : Pause after instantiation from vfModule Popup window', ()=> { + + beforeEach( () => { + cy.clearSessionStorage(); + cy.setTestApiParamToGR(); + cy.initVidMock(); + cy.permissionVidMock(); + cy.login(); + }); + + afterEach( () =>{ + cy.screenshot(); + }); + + it('Pause after Instantiation : Create a vf module and and Pause from vfModule popup', () => { + cy.readFile('cypress/support/jsonBuilders/mocks/jsons/flags.cypress.json').then((flags) => { + cy.server() + .route({ + method: 'GET', + delay: 0, + status: 200, + url: Cypress.config('baseUrl') + "/flags**", + response: flags + }).as('initFlags'); + }); + + cy.readFile('cypress/support/jsonBuilders/mocks/jsons/reduxModelOneVnfAndTwoVfmodulesInstanceOneVnf.json').then((reduxState) => { + + cy.setReduxState(reduxState); + cy.openIframe('app/ui/#/servicePlanning?serviceModelId=f3862254-8df2-4a0a-8137-0a9fe985860c'); + const vnfName = "vOCG_1804_VF 0"; + let vfModulesNames: Array = [ + 'vocg_1804_vf0..Vocg1804Vf..base_ocg..module-0', + 'vocg_1804_vf0..Vocg1804Vf..ocgapp_004..module-11' + ]; + const uuidAndVfModuleNames: Array = [ + '815db6e5-bdfd-4cb6-9575-82c36df8747a-vocg_1804_vf0..Vocg1804Vf..base_ocg..module-0', + 'da10c7fe-cf81-441c-9694-4e9ddf2054d8-vocg_1804_vf0..Vocg1804Vf..ocgapp_004..module-11' + ]; + + addALaCarteVfModuleEcompGeneratedNamingTrue(vnfName, vfModulesNames[0], uuidAndVfModuleNames[0]); + + }); + + }); + + function addALaCarteVfModuleEcompGeneratedNamingTrue(vnfName: string, vfModulesName: string, uuidAndVfModuleName: string): Chainable { + return cy.getElementByDataTestsId('node-' + vnfName).click({force: true}).then(() => { + cy.getElementByDataTestsId('node-' + vfModulesName + '-add-btn').click({force: true}).then(() => { + cy.getElementByDataTestsId('node-' + uuidAndVfModuleName + '-menu-btn') + .click({force: true}).then(() => { + cy.getElementByDataTestsId('context-menu-edit').click().then(() => { + cy.getElementByDataTestsId('pauseInstantiation').click(); + cy.getElementByDataTestsId('form-set').click(); + }) + }) + }) + }) + } +}) diff --git a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.spec.ts b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.spec.ts index 6ee318644..0a3e2623b 100644 --- a/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.spec.ts +++ b/vid-webpack-master/src/app/shared/components/genericForm/formControlsServices/sharedControlles/shared.controllers.service.spec.ts @@ -111,6 +111,19 @@ describe('Shared Controllers Service', () => { expect (sdncPreload.value).toBe(expected); }); + each( + [ + [' checked', true, true], + [' not checked', false, false ] + ] + ). + test('pause-instantiation checkbox', (description: string) => { + const instance = null; + const pauseInstantiation: FormControlModel = service.getPauseInstantiation(instance); + expect (pauseInstantiation.displayName).toEqual('Pause upon Completion'); + expect(pauseInstantiation.dataTestId).toEqual('pauseInstantiation'); + }); + test('getlegacyRegion with AAIAIC25 - isVisible true', () => { const instance = {lcpCloudRegionId : 'AAIAIC25'}; const legacyRegionControl: FormControlModel = service.getLegacyRegion(instance); @@ -134,6 +147,8 @@ describe('Shared Controllers Service', () => { expect(control.dataTestId).toEqual('multi-selectPlatform'); expect(control.limitSelection).toEqual(1000); }); + + }); class MockAppStore { -- cgit 1.2.3-korg