summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/integration/iFrames
diff options
context:
space:
mode:
authorSara Weiss <sara.weiss@intl.att.com>2019-10-23 11:29:33 +0300
committerSara Weiss <sara.weiss@intl.att.com>2019-10-24 12:53:21 +0300
commite21e919d4d726ed642ffa432877a665843b19d3a (patch)
tree46d2ca63f716ff49d54eabeed229c697c5c58fb3 /vid-webpack-master/cypress/integration/iFrames
parentf09e8d114804e4237e79f27ed492835ecb1b17b0 (diff)
change management cypress test
Issue-ID: VID-378 Signed-off-by: Sara Weiss <sara.weiss@intl.att.com> Change-Id: I60a996ebbd6a9f509ab44ae4f656d260d2cac547 Signed-off-by: Sara Weiss <sara.weiss@intl.att.com>
Diffstat (limited to 'vid-webpack-master/cypress/integration/iFrames')
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/changeManagement.e2e.ts93
1 files changed, 90 insertions, 3 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/changeManagement.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/changeManagement.e2e.ts
index b5a01be09..268c3b9a6 100644
--- a/vid-webpack-master/cypress/integration/iFrames/changeManagement.e2e.ts
+++ b/vid-webpack-master/cypress/integration/iFrames/changeManagement.e2e.ts
@@ -4,8 +4,10 @@ import {JsonBuilder} from "../../support/jsonBuilders/jsonBuilder";
import {AAISubDetailsModel} from "../../support/jsonBuilders/models/aaiSubDetails.model";
describe('Change management AKA VNF changes', function () {
- var jsonBuilderAAISubDetailsModel: JsonBuilder<AAISubDetailsModel> = new JsonBuilder<AAISubDetailsModel>();
+ let jsonBuilderAAISubDetailsModel: JsonBuilder<AAISubDetailsModel> = new JsonBuilder<AAISubDetailsModel>();
+ let jsonBuilderVnfData: JsonBuilder<any> = new JsonBuilder<any>();
+ let aaiGetVNFDataUrl = Cypress.config('baseUrl') + "/get_vnf_data_by_globalid_and_service_type/e433710f-9217-458d-a79d-1c7aff376d89/TYLER SILVIA";
//describe('Contact us', () => {
beforeEach(() => {
@@ -21,19 +23,104 @@ describe('Change management AKA VNF changes', function () {
"aai-sub-details")
});
+ cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/flags.json').then(() => {
+ cy.server()
+ .route({
+ method: 'GET',
+ delay: 0,
+ status: 200,
+ url: Cypress.config('baseUrl') + "/flags**",
+ response: {
+ "FLAG_FLASH_REDUCED_RESPONSE_CHANGEMG": true,
+ "FLAG_FLASH_CLOUD_REGION_AND_NF_ROLE_OPTIONAL_SEARCH": true,
+ "FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST": true
+ }
+ }).as('initFlags');
+ });
+
+ cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/get_vnf_data.json').then((res) => {
+ jsonBuilderVnfData.basicJson(
+ res,
+ aaiGetVNFDataUrl + '**',
+ 200,
+ 0,
+ "aai_get_vnf_data")
+ });
+
+ openNewVnfChangeModal();
+
});
afterEach(() => {
cy.screenshot();
});
- it(`verifying + VNF changes`, function () {
+ function openNewVnfChangeModal() {
cy.visit('/serviceModels.htm#/change-management');
cy.getElementByDataTestsId('create-new-change-management').click();
cy.getElementByDataTestsId('newChangeManagementForm');
+ }
+
+ function fillSubscriberAndServiceType() {
cy.selectDropdownOptionByText('subscriberName', 'SILVIA ROBBINS');
cy.selectDropdownOptionByText('serviceType', 'TYLER SILVIA');
+ }
+
+ function fillCloudRegion() {
+ cy.selectDropdownOptionByText('cloudRegion', 'AAIAIC25 (AIC)');
+ }
+
+ function fillNfRole() {
+ cy.getElementByDataTestsId('vnfType').type('vMobileDNS');
+ }
+
+ it(`nf role input and cloud region input and search vnfs button should be disabled without subscriber and serviceType`, function () {
+ cy.get('#searchVNF').should('be.disabled');
+ cy.getElementByDataTestsId('cloudRegion').should('be.disabled');
+ cy.getElementByDataTestsId('vnfType').should('be.disabled')
+ });
+
+ it(`search vnfs without nf role and cloud region`, function () {
+
+ fillSubscriberAndServiceType();
+
+ cy.get('#searchVNF').click();
+
+ cy.wait('@aai_get_vnf_data')
+ .its('url').should('equal', aaiGetVNFDataUrl)
+ });
+
+
+ it(`search vnfs by nf role and cloud region`, function () {
+
+ fillSubscriberAndServiceType();
+ fillNfRole();
+ fillCloudRegion();
+
+ cy.get('#searchVNF').click();
+
+ cy.wait('@aai_get_vnf_data')
+ .its('url').should('equal', aaiGetVNFDataUrl + "?cloudRegion=AAIAIC25&nfRole=vMobileDNS")
});
-});
+ it(`search vnfs by cloud region`, function () {
+
+ fillSubscriberAndServiceType();
+ fillCloudRegion();
+ cy.get('#searchVNF').click();
+
+ cy.wait('@aai_get_vnf_data')
+ .its('url').should('equal', aaiGetVNFDataUrl + "?cloudRegion=AAIAIC25")
+ });
+
+ it(`search vnfs by nf role`, function () {
+
+ fillSubscriberAndServiceType();
+ fillNfRole();
+ cy.get('#searchVNF').click();
+
+ cy.wait('@aai_get_vnf_data')
+ .its('url').should('equal', aaiGetVNFDataUrl + "?nfRole=vMobileDNS")
+ });
+});