1 describe('Drawing Board: Instantiation Templates', function () {
3 describe('Load Page and Deploy', () => {
6 cy.clearSessionStorage();
7 cy.setTestApiParamToVNF();
9 cy.initDrawingBoardUserPermission();
12 mockAsyncBulkResponse();
19 it(`Given a stored template - when click "deploy" - then a coherent request should be sent upon deploy`, function () {
20 const serviceModelId = '6cfeeb18-c2b0-49df-987a-da47493c8e38';
21 const templateUuid = "46390edd-7100-46b2-9f18-419bd24fb60b";
23 const drawingBoardAction = `RECREATE`;
24 const templateTopologyEndpoint = "bulkForRetry"; // will be: "templateTopology"
28 cy.route(`**/rest/models/services/${serviceModelId}`,
29 'fixture:../support/jsonBuilders/mocks/jsons/instantiationTemplates/templates__service_model.json')
32 cy.route(`**/asyncInstantiation/${templateTopologyEndpoint}/${templateUuid}`,
33 'fixture:../support/jsonBuilders/mocks/jsons/instantiationTemplates/templates__instance_template.json')
34 .as('templateTopology');
38 cy.openIframe(`app/ui/#/servicePlanning/${drawingBoardAction}` +
39 `?jobId=${templateUuid}` +
40 `&serviceModelId=${serviceModelId}`);
42 cy.wait('@serviceModel');
43 cy.wait('@templateTopology');
45 cy.getDrawingBoardDeployBtn().click();
49 cy.wait('@expectedPostAsyncInstantiation').then(xhr => {
50 // cy.readFile('cypress/support/jsonBuilders/mocks/jsons/instantiationTemplates/templates__instance_template.json').then((expectedResult) => {
51 // cy.deepCompare(xhr.request.body, expectedResult);
60 function mockAsyncBulkResponse() {
62 url: Cypress.config('baseUrl') + '/asyncInstantiation/bulk',
66 }).as("expectedPostAsyncInstantiation");