diff options
author | Ittay Stern <ittay.stern@att.com> | 2018-08-29 17:01:32 +0300 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2019-02-18 18:35:30 +0200 |
commit | 6f900cc45d7dd7f97430812b86b5c1d1693c8ae3 (patch) | |
tree | 936005c364dc5a7264d6304d4777c3d83494db22 /vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts | |
parent | 67d99f816cc583643c35193197594cf78d8ce60a (diff) |
merge from ecomp a88f0072 - Modern UI
Issue-ID: VID-378
Change-Id: Ibcb23dd27f550cf32ce2fe0239f0f496ae014ff6
Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts')
-rw-r--r-- | vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts new file mode 100644 index 000000000..1e80ee77e --- /dev/null +++ b/vid-webpack-master/cypress/integration/iFrames/browse-sdc.e2e.ts @@ -0,0 +1,102 @@ +///<reference path="../../../node_modules/cypress/types/index.d.ts"/> +/// <reference types="Cypress" /> +import {JsonBuilder} from '../../support/jsonBuilders/jsonBuilder'; +import {ServiceModel} from '../../support/jsonBuilders/models/service.model'; + +describe('Browse SDC', function () { + var jsonBuilderAndMock : JsonBuilder<ServiceModel> = new JsonBuilder<ServiceModel>(); + + + beforeEach(() => { + cy.window().then((win) => { + win.sessionStorage.clear(); + cy.preventErrorsOnLoading(); + cy.initAAIMock(); + cy.initVidMock(); + cy.initZones(); + cy.login(); + cy.visit("welcome.htm") + }); + }); + + afterEach(() => { + cy.screenshot(); + }); + + it(`browse sdc open macro with network and then macro for new flow`, function () { + // const MACRO_WITH_CONFIGURATION_ID: string = 'ee6d61be-4841-4f98-8f23-5de9da846ca7'; + const MACRO_WITH_NETWORK_ID: string = "bd8ffd14-da36-4f62-813c-6716ba9f4354"; + const MACRO_FOR_NEW_FLOW_ID: string = '74fa72dd-012b-49c3-800d-06b12bcaf1a0'; + const CANCEL_BUTTON = "cancelButton"; + + cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/bug616888/list-services.json').then((res) => { + jsonBuilderAndMock.basicJson(res, + Cypress.config('baseUrl') + '/rest/models/services?distributionStatus=DISTRIBUTED', + 200, + 0, + 'list_services'); + }); + + cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/bug616888/service-with-configuration.json').then((res) => { + jsonBuilderAndMock.basicJson(res, + Cypress.config('baseUrl') + '/rest/models/services/' + MACRO_WITH_NETWORK_ID, + 200, + 0, + 'MACRO_WITH_CONFIGURATION'); + }); + + cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/bug616888/Dror_service1806_Macro1.json').then((res) => { + jsonBuilderAndMock.basicJson(res, + Cypress.config('baseUrl') + '/rest/models/services/' + MACRO_FOR_NEW_FLOW_ID, + 200, + 0, + 'MACRO_FOR_NEW_FLOW'); + }); + + cy.get('span').contains('Browse ASDC Service Models').click({force: true}); + cy.wait("@list_services").then(() => { + cy.getElementByDataTestsId('deploy-' + MACRO_WITH_NETWORK_ID).click({force: true}) + .getElementByDataTestsId(CANCEL_BUTTON).click({force: true}); + cy.getElementByDataTestsId('deploy-' + MACRO_FOR_NEW_FLOW_ID).click({force: true}); + cy.get("iframe"); + }); + + cy.visit("welcome.htm"); //relaod page to not break the following tests + + }); + + it(`browse sdc of service without instantiationType open aLaCarte popup`, function () { + const VERY_OLD_SERVICE_UUID: string = "09c476c7-91ae-44b8-a731-04d8d8fa3695"; + const TEST_MOCKS_PATH="/cypress/support/jsonBuilders/mocks/jsons/bug_aLaCarteServiceWrongPopup/"; + + const CANCEL_BUTTON = "cancelButton"; + + cy.readFile(TEST_MOCKS_PATH+'list-services.json').then((res) => { + jsonBuilderAndMock.basicJson(res, + Cypress.config('baseUrl') + '/rest/models/services?distributionStatus=DISTRIBUTED', + 200, + 0, + 'list_services'); + }); + + cy.readFile(TEST_MOCKS_PATH+'serviceWithoutInstantiationType.json').then((res) => { + jsonBuilderAndMock.basicJson(res, + Cypress.config('baseUrl') + '/rest/models/services/' + VERY_OLD_SERVICE_UUID, + 200, + 0, + 'MACRO_WITH_CONFIGURATION'); + }); + + cy.get('span').contains('Browse ASDC Service Models').click({force: true}); + cy.wait("@list_services").then(() => { + cy.getElementByDataTestsId('deploy-' + VERY_OLD_SERVICE_UUID).click({force: true}) + .getElementByDataTestsId('create-modal-title').contains("Create Service Instance -- a la carte"); + }); + + cy.visit("welcome.htm"); //relaod page to not break the following tests + + }); + + + +}); |