diff options
Diffstat (limited to 'vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardRecreate.steps.ts')
-rw-r--r-- | vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardRecreate.steps.ts | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardRecreate.steps.ts b/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardRecreate.steps.ts new file mode 100644 index 000000000..16f418bc9 --- /dev/null +++ b/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardRecreate.steps.ts @@ -0,0 +1,52 @@ +declare namespace Cypress { + interface Chainable { + loadDrawingBoardWithRecreateMode: typeof loadDrawingBoardWithRecreateMode , + loadDrawingBoardWithRecreateModeNetwork: typeof loadDrawingBoardWithRecreateModeNetwork, + loadDrawingBoardWithRecreateModeInternal: typeof loadDrawingBoardWithRecreateModeInternal + } +} + +function loadDrawingBoardWithRecreateMode(templateWithVnfSetup : any) { + cy.loadDrawingBoardWithRecreateModeInternal( + '../../' + templateWithVnfSetup.instanceTemplateFile, + templateWithVnfSetup.serviceModelId, + templateWithVnfSetup.serviceModelFile); +} + +function loadDrawingBoardWithRecreateModeNetwork(templateWithNetworkSetup : any) { + cy.loadDrawingBoardWithRecreateModeInternal( + '../../' + templateWithNetworkSetup.instanceTemplateFile, + templateWithNetworkSetup.serviceModelId, + templateWithNetworkSetup.serviceModelFile); +} + +function loadDrawingBoardWithRecreateModeInternal(instanceTemplate: string, serviceModelIdToLoad: any, serviceModel: string) { + const templateUuid = "46390edd-7100-46b2-9f18-419bd24fb60b"; + + const drawingBoardAction = `RECREATE`; + const templateTopologyEndpoint = "templateTopology"; + cy.route(`**/rest/models/services/${serviceModelIdToLoad}`, + 'fixture:' + serviceModel) + .as('serviceModel'); + + cy.route(`**/instantiationTemplates/${templateTopologyEndpoint}/${templateUuid}`, + 'fixture:' + instanceTemplate) + .as('templateTopology'); + + // When... + + cy.openIframe(`app/ui/#/servicePlanning/${drawingBoardAction}` + + `?jobId=${templateUuid}` + + `&serviceModelId=${serviceModelIdToLoad}`); + + cy.wait('@serviceModel'); + cy.wait('@templateTopology'); +} + + + + + +Cypress.Commands.add('loadDrawingBoardWithRecreateMode', loadDrawingBoardWithRecreateMode); +Cypress.Commands.add('loadDrawingBoardWithRecreateModeNetwork', loadDrawingBoardWithRecreateModeNetwork); +Cypress.Commands.add('loadDrawingBoardWithRecreateModeInternal', loadDrawingBoardWithRecreateModeInternal); |