From 19bfe44c206000e5f71b53c1642f19886be7ad5f Mon Sep 17 00:00:00 2001 From: Sara Weiss Date: Tue, 17 Dec 2019 13:20:29 +0200 Subject: Templates: Test deployment of a Cypress *edited* without changes template Issue-ID: VID-724 Signed-off-by: Sara Weiss Change-Id: If70e4cb35d6a0feb0972da3f212b8a87892004cd --- .../iFrames/instantiation-templates.e2e.ts | 35 ++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts') diff --git a/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts index f9fe68b20..01a0be0c7 100644 --- a/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts +++ b/vid-webpack-master/cypress/integration/iFrames/instantiation-templates.e2e.ts @@ -29,7 +29,7 @@ describe('Drawing Board: Instantiation Templates', function () { assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd(); }); - it('Given a stored template - when "edit" vnf and vfmodules are opened - then template’s details are visible as expected', ()=> { + it('Given a stored template - when "edit" vnf and vfmodules are opened - then template’s details are visible as expected and deploy without changes', () => { loadDrawingBoardWithRecreateMode(); @@ -60,8 +60,6 @@ describe('Drawing Board: Instantiation Templates', function () { .getElementByDataTestsId("sdncPreLoad").should('have.value', 'on') .getElementByDataTestsId("cancelButton").click(); - - assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd(); }); @@ -81,6 +79,25 @@ describe('Drawing Board: Instantiation Templates', function () { }); + it('Given a stored template - edit service vnf and vfmodule without changes - deploy request should be without changes', function () { + + loadDrawingBoardWithRecreateMode(); + + //open - set edit service + cy.openServiceContextMenu() + .getElementByDataTestsId("context-menu-header-edit-item").click() + .getElementByDataTestsId('form-set').click(); + + //open - set edit vnf + editNode("node-21ae311e-432f-4c54-b855-446d0b8ded72-vProbe_NC_VNF 0") + .getElementByDataTestsId('form-set').click(); + + //open - set edit vf + editNode("node-c5b26cc1-a66f-4b69-aa23-6abc7c647c88-vprobe_nc_vnf0..VprobeNcVnf..FE_base_module..module-0") + .getElementByDataTestsId('form-set').click(); + + assertThatBodyFromDeployRequestEqualsToFile(); + }); }); }); @@ -127,6 +144,18 @@ function assertThatBodyFromDeployRequestEqualsToTemplateFromBackEnd() { }); } + +function assertThatBodyFromDeployRequestEqualsToFile() { + cy.getDrawingBoardDeployBtn().click(); + cy.wait('@expectedPostAsyncInstantiation').then(xhr => { + + cy.readFile('../vid-automation/src/test/resources/asyncInstantiation/templates__instance_from_template__set_without_modify1.json').then((expectedResult) => { + cy.deepCompare(xhr.request.body, expectedResult); + }); + + }); +} + //We use this function because the deployService() on drawing-board-header.component class // changes rollbackOnFailure value from string type to boolean. function convertRollbackOnFailureValueFromStringToBoolean(expectedResult: any) { -- cgit 1.2.3-korg