summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/integration/iFrames
diff options
context:
space:
mode:
authorEinat Vinouze <einat.vinouze@intl.att.com>2020-04-06 09:16:40 +0300
committerEinat Vinouze <einat.vinouze@intl.att.com>2020-04-06 15:25:15 +0300
commitf6204c8b0f9b4f778419c16400b8a431f5797beb (patch)
tree9a28e46f631b204d9c8179c1c406580e2c921400 /vid-webpack-master/cypress/integration/iFrames
parentdf22976883c366960aa3e5003fc3002425ab7c98 (diff)
Add another VNF to the new view/edit screen - Integration test
Issue-ID: VID-803 Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com> Change-Id: I9e2a58863855353b75edab44129c96b319511dde Signed-off-by: Einat Vinouze <einat.vinouze@intl.att.com>
Diffstat (limited to 'vid-webpack-master/cypress/integration/iFrames')
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/viewEditAddNewInstace.e2e.ts (renamed from vid-webpack-master/cypress/integration/iFrames/viewEditNetwork.e2e.ts)46
1 files changed, 44 insertions, 2 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/viewEditNetwork.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/viewEditAddNewInstace.e2e.ts
index 084680acd..d4fea70fe 100644
--- a/vid-webpack-master/cypress/integration/iFrames/viewEditNetwork.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/viewEditAddNewInstace.e2e.ts
@@ -12,7 +12,7 @@ let jsonBuilderAaiServiceInstances: JsonBuilder<AaiServiceInstancesModel> = new
let jsonBuilderAAISubViewEditModel: JsonBuilder<AAISubViewEditModel> = new JsonBuilder<AAISubViewEditModel>();
-describe('View Edit page: Add network', () =>{
+describe('View Edit page: Add a second instance', () =>{
beforeEach(() => {
cy.clearSessionStorage();
cy.initGetAAISubDetails();
@@ -33,7 +33,6 @@ describe('View Edit page: Add network', () =>{
const subscriberId = 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb';
const serviceModelId = 'f93e72e1-77fc-4f54-b207-298d766d0886';
const serviceInstanceId = 'ce2821fc-3b28-4759-9613-1e514d7563c0';
- const serviceInvariantUuid = "8c364754-4c76-4abc-b8f3-88da5f67d588";
cy.initDrawingBoardUserPermission();
cy.route(`**/rest/models/services/${serviceModelId}`,
@@ -71,6 +70,49 @@ describe('View Edit page: Add network', () =>{
});
+ it(`Add new VNF to service with one existing VNF `, () =>{
+ const serviceType = 'Mobility';
+ const subscriberId = 'a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb';
+ const serviceModelId = '82255513-e19f-46e5-bdfb-957c6bf57b82';
+ const serviceInstanceId = 'e6cc1c4f-05f7-49bc-8e86-ac2eb92baaaa';
+
+ cy.initDrawingBoardUserPermission();
+ cy.route(`**/rest/models/services/${serviceModelId}`,
+ 'fixture:../support/jsonBuilders/mocks/jsons/add_vnf/add_vnf_model.json')
+ .as('serviceModelAddVnf');
+
+ cy.route(`**/aai_get_service_instance_topology/${subscriberId}/${serviceType}/${serviceInstanceId}`,
+ 'fixture:../support/jsonBuilders/mocks/jsons/add_vnf/add_vnf_instance.json')
+ .as('serviceInstanceAddVnf');
+
+ cy.openIframe(`app/ui/#/servicePlanning/EDIT?serviceModelId=${serviceModelId}&subscriberId=${subscriberId}&serviceType=${serviceType}&serviceInstanceId=${serviceInstanceId}`);
+
+ cy.getElementByDataTestsId('node-iperf_vnf_2002_by5924 0-add-btn').click({force: true}).then(() => {
+
+ cy.fillVnfPopup();
+ });
+
+ mockAsyncBulkResponse();
+ // click update
+ cy.getElementByDataTestsId('deployBtn').should('have.text', 'UPDATE').click();
+
+ cy.getReduxState().then((state) => {
+
+ const vnfs = state.service.serviceInstance['82255513-e19f-46e5-bdfb-957c6bf57b82'].vnfs;
+ cy.wait('@expectedPostAsyncInstantiation').then(xhr => {
+ cy.readFile('../vid-app-common/src/test/resources/payload_jsons/vnf/one_vnf_exists_add_another_vnf_expected_bulk.json').then((expectedResult) => {
+
+ //set randomized trackById into bulk expected file
+ expectedResult.vnfs['iperf_vnf_2002_by5924 0'].trackById = vnfs['iperf_vnf_2002_by5924 0'].trackById;
+
+ cy.deepCompare(xhr.request.body, expectedResult);
+ });
+ });
+ });
+
+ });
+
+
function mockAsyncBulkResponse() {
cy.server().route({
url: Cypress.config('baseUrl') + '/asyncInstantiation/bulk',