aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/integration/iFrames/softDeleteAndResume.e2e.ts
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2018-08-29 17:01:32 +0300
committerIttay Stern <ittay.stern@att.com>2019-02-18 18:35:30 +0200
commit6f900cc45d7dd7f97430812b86b5c1d1693c8ae3 (patch)
tree936005c364dc5a7264d6304d4777c3d83494db22 /vid-webpack-master/cypress/integration/iFrames/softDeleteAndResume.e2e.ts
parent67d99f816cc583643c35193197594cf78d8ce60a (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/softDeleteAndResume.e2e.ts')
-rw-r--r--vid-webpack-master/cypress/integration/iFrames/softDeleteAndResume.e2e.ts241
1 files changed, 241 insertions, 0 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/softDeleteAndResume.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/softDeleteAndResume.e2e.ts
new file mode 100644
index 000000000..53e5e13be
--- /dev/null
+++ b/vid-webpack-master/cypress/integration/iFrames/softDeleteAndResume.e2e.ts
@@ -0,0 +1,241 @@
+///<reference path="../../../node_modules/cypress/types/index.d.ts"/>
+import {JsonBuilder} from '../../support/jsonBuilders/jsonBuilder';
+import {PnfModel} from '../../support/jsonBuilders/models/pnf.model';
+import {ServiceModel} from '../../support/jsonBuilders/models/service.model';
+import {AaiServiceInstancesModel} from '../../support/jsonBuilders/models/serviceInstances.model';
+import {AAISubDetailsModel} from '../../support/jsonBuilders/models/aaiSubDetails.model';
+import {AAISubViewEditModel} from '../../support/jsonBuilders/models/aaiSubViewEdit.model';
+
+describe('Soft delete tests', function () {
+ describe('basic UI tests', () => {
+
+ var jsonBuilderAAIService: JsonBuilder<ServiceModel> = new JsonBuilder<ServiceModel>();
+ var jsonBuilderAAISubViewEditModel: JsonBuilder<AAISubViewEditModel> = new JsonBuilder<AAISubViewEditModel>();
+ var jsonBuilderAAISubDetailsModel: JsonBuilder<AAISubDetailsModel> = new JsonBuilder<AAISubDetailsModel>();
+ var jsonBuilderAaiServiceInstances: JsonBuilder<AaiServiceInstancesModel> = new JsonBuilder<AaiServiceInstancesModel>();
+ beforeEach(() => {
+ cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/basicService.json').then((res) => {
+ jsonBuilderAAIService.basicJson(
+ res,
+ Cypress.config('baseUrl') + "/rest/models/services/6e59c5de-f052-46fa-aa7e-2fca9d674c44",
+ 200, 0,
+ "service-complexService",
+ changeServiceModel)
+ });
+
+
+ cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubViewEditForServiceWithSomeVFModule.json').then((res) => {
+ jsonBuilderAAISubViewEditModel.basicJson(
+ res,
+ Cypress.config('baseUrl') + "/aai_sub_viewedit/**/**/**/3f93c7cb-2fd0-4557-9514-e189b7b04f9d",
+ 200,
+ 0,
+ "aai-sub-view-edit")
+ });
+
+ cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiSubDetails.json').then((res) => {
+ jsonBuilderAAISubDetailsModel.basicJson(
+ res,
+ Cypress.config('baseUrl') + "/aai_sub_details/**",
+ 200,
+ 0,
+ "aai-sub-details")
+ });
+
+ cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiServiceInstances.json').then((res) => {
+ jsonBuilderAaiServiceInstances.basicJson(
+ res,
+ Cypress.config('baseUrl') + "/search_service_instances**",
+ 200,
+ 0,
+ "aai-get-service-instances")
+ });
+
+ cy.initVidMock();
+
+ cy.initTenants();
+
+ cy.login();
+ });
+
+ afterEach(() => {
+ cy.screenshot();
+ });
+
+ it(`Soft delete button will be display also if base module is true`, function () {
+ cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=USP%20VOICE&serviceType=VIRTUAL%20USP&serviceInstanceId=3f93c7cb-2fd0-4557-9514-e189b7b04f9d&aaiModelVersionId=6e59c5de-f052-46fa-aa7e-2fca9d674c44&isPermitted=true');
+ cy.wait('@service-complexService');
+ checkSoftDeleteAndDeletePopup('aa', 'vfModuleTreeNode-pendingactivation', true, true);
+ });
+
+ it(`Soft delete button not display in assigned orch status`, function () {
+ cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=USP%20VOICE&serviceType=VIRTUAL%20USP&serviceInstanceId=3f93c7cb-2fd0-4557-9514-e189b7b04f9d&aaiModelVersionId=6e59c5de-f052-46fa-aa7e-2fca9d674c44&isPermitted=true');
+ cy.wait('@service-complexService');
+ checkSoftDeleteAndDeletePopup('gg', 'vfModuleTreeNode-assigned', false, true);
+ });
+
+ it(`Resume button display in orch status - pendingactivation, assigned - feature FLAG_VF_MODULE_RESUME_STATUS_CREATE - is OFF`, function () {
+
+ cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/flags.json').then((res) => {
+ cy.server()
+ .route({
+ method: 'GET',
+ delay : 0,
+ status : 200,
+ url : Cypress.config('baseUrl') + "/flags**",
+ response : {
+ "FLAG_1810_CR_SOFT_DELETE_ALACARTE_VF_MODULE": true,
+ "FLAG_VF_MODULE_RESUME_STATUS_CREATE": false
+ }
+ }).as('initFlags');
+ });
+
+ cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=USP%20VOICE&serviceType=VIRTUAL%20USP&serviceInstanceId=3f93c7cb-2fd0-4557-9514-e189b7b04f9d&aaiModelVersionId=6e59c5de-f052-46fa-aa7e-2fca9d674c44&isPermitted=true');
+ cy.wait('@service-complexService');
+
+ checkResumeAndPopup('aa', 'vfModuleTreeNode-pendingactivation');
+ checkResumeAndPopup('gg', 'vfModuleTreeNode-assigned');
+
+ cy.get('.vfModuleTreeNode-created')
+ .getElementByDataTestsId('resumeVFModuleButton-ABC').should('not.be.visible');
+ cy.get('.vfModuleTreeNode-pending-delete')
+ .getElementByDataTestsId('resumeVFModuleButton-my_vfModule').should('not.be.visible');
+
+ });
+
+ it(`Resume button display in orch status - pendingactivation, assigned, created - feature FLAG_VF_MODULE_RESUME_STATUS_CREATE - is ON`, function () {
+
+ cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=USP%20VOICE&serviceType=VIRTUAL%20USP&serviceInstanceId=3f93c7cb-2fd0-4557-9514-e189b7b04f9d&aaiModelVersionId=6e59c5de-f052-46fa-aa7e-2fca9d674c44&isPermitted=true');
+ cy.wait('@service-complexService');
+
+ checkResumeAndPopup('aa', 'vfModuleTreeNode-pendingactivation');
+ checkResumeAndPopup('gg', 'vfModuleTreeNode-assigned');
+ checkResumeAndPopup('ABC', 'vfModuleTreeNode-created');
+
+ cy.get('.vfModuleTreeNode-pending-delete')
+ .getElementByDataTestsId('resumeVFModuleButton-my_vfModule').should('not.be.visible');
+
+ });
+
+ it(`Delete popup with not homing data from AAI`, function () {
+ cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=USP%20VOICE&serviceType=VIRTUAL%20USP&serviceInstanceId=3f93c7cb-2fd0-4557-9514-e189b7b04f9d&aaiModelVersionId=6e59c5de-f052-46fa-aa7e-2fca9d674c44&isPermitted=true');
+ cy.wait('@service-complexService');
+ checkSoftDeleteAndDeletePopup('gg', 'vfModuleTreeNode-assigned', false, true);
+ cy.selectDropdownOptionByText('lcpRegion', 'JANET25');
+ cy.getElementByDataTestsId('confirmResumeDeleteButton').should('have.attr', 'disabled');
+ cy.typeToInput("lcpRegionText", "just another region");
+ cy.getElementByDataTestsId('confirmResumeDeleteButton').should('have.attr', 'disabled');
+ cy.selectDropdownOptionByText('tenant', 'USP-SIP-IC-24335-T-01');
+ cy.getElementByDataTestsId('confirmResumeDeleteButton').should('not.have.attr', 'disabled');
+ cy.selectDropdownOptionByText('lcpRegion', 'hvf6');
+ cy.getElementByDataTestsId('confirmResumeDeleteButton').should('have.attr', 'disabled');
+ cy.selectDropdownOptionByText('tenant', 'AIN Web Tool-15-D-testalexandria');
+ cy.getElementByDataTestsId('confirmResumeDeleteButton').should('not.have.attr', 'disabled');
+ cy.getElementByDataTestsId('cancel').click({force: true})
+ cy.getElementByDataTestsId('confirmResumeDeleteButton').should('not.be.visible');
+ });
+
+ it(`Soft delete button display with partial homing data from AAI`, function () {
+
+ cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/aaiGetHomingData.json').then((res) => {
+ jsonBuilderAaiServiceInstances.basicJson(
+ res,
+ Cypress.config('baseUrl') + "/aai_get_homing_by_vfmodule/c015cc0f-0f37-4488-aabf-53795fd93cd3/a231a99c-7e75-4d6d-a0fb-5c7d26f30f77",
+ 200,
+ 0,
+ "aai-get-homing-data")
+ });
+
+
+ cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=USP%20VOICE&serviceType=VIRTUAL%20USP&serviceInstanceId=3f93c7cb-2fd0-4557-9514-e189b7b04f9d&aaiModelVersionId=6e59c5de-f052-46fa-aa7e-2fca9d674c44&isPermitted=true');
+ cy.wait('@service-complexService');
+ checkSoftDeleteAndDeletePopup('my_vfModule', 'vfModuleTreeNode-pending-delete', true, true);
+ cy.getElementByDataTestsId('lcpRegionText').should('be.visible');
+ cy.getElementByDataTestsId('lcpRegion').contains('JANET25');
+ cy.getElementByDataTestsId('tenant').contains('USP-SIP-IC-24335-T-01');
+ });
+
+ it(`Soft delete button display with with homing data from AAI`, function () {
+
+ cy.readFile('../vid-automation/src/test/resources/viewEdit/aaiHomingDataResponse.json').then((res) => {
+ jsonBuilderAaiServiceInstances.basicJson(
+ res,
+ Cypress.config('baseUrl') + "/aai_get_homing_by_vfmodule/0846287b-65bf-45a6-88f6-6a1af4149fac/a9b70ac0-5917-4203-a308-0e6920e6d09b",
+ 200,
+ 0,
+ "aai-get-homing-data")
+ });
+
+ cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=USP%20VOICE&serviceType=VIRTUAL%20USP&serviceInstanceId=3f93c7cb-2fd0-4557-9514-e189b7b04f9d&aaiModelVersionId=6e59c5de-f052-46fa-aa7e-2fca9d674c44&isPermitted=true');
+ cy.wait('@service-complexService');
+ checkSoftDeleteAndDeletePopup('vf_module2', 'vfModuleTreeNode-pendingcreate', true, false);
+ });
+
+ it(`Soft delete and Delete - Mega region is JANET25 - not 'olson3', 'olson5a'`, function () {
+ cy.visit('/serviceModels.htm#/instantiate?subscriberId=e433710f-9217-458d-a79d-1c7aff376d89&subscriberName=USP%20VOICE&serviceType=VIRTUAL%20USP&serviceInstanceId=3f93c7cb-2fd0-4557-9514-e189b7b04f9d&aaiModelVersionId=6e59c5de-f052-46fa-aa7e-2fca9d674c44&isPermitted=true');
+ cy.wait('@service-complexService');
+ //Delete
+ checkSoftDeleteAndDeletePopup('gg', 'vfModuleTreeNode-assigned', false, true);
+ checkLegacyRegion();
+ cy.getElementByDataTestsId('cancel').click();
+ //Soft delete
+ checkSoftDeleteAndDeletePopup('aa', 'vfModuleTreeNode-pendingactivation', true, true);
+ checkLegacyRegion();
+ cy.getElementByDataTestsId('cancel').click();
+ //Resume
+ cy.get('div').find('.vfModuleTreeNode-pendingactivation')
+ .getElementByDataTestsId('resumeVFModuleButton-aa').click().then(()=> {
+ checkLegacyRegion();
+ });
+ });
+
+ function checkLegacyRegion() {
+ checkIsLegacyRegionTextIsDisplay('JANET25', true);
+ checkIsLegacyRegionTextIsDisplay('olson3', false);
+ checkIsLegacyRegionTextIsDisplay('olson5a', false);
+ checkIsLegacyRegionTextIsDisplay('hvf6', false);
+ }
+
+ function checkIsLegacyRegionTextIsDisplay(lcpRegionName: string, isVisible: boolean) {
+ const isVisibleText = isVisible ? 'be.visible' : 'not.be.visible';
+ cy.selectDropdownOptionByText('lcpRegion', lcpRegionName);
+ cy.getElementByDataTestsId('lcpRegionText').should(isVisibleText);
+
+ }
+
+ function checkResumeAndPopup(vfModuleName:string, vfModuleClassName:string) {
+ cy.get('div').find('.' + vfModuleClassName)
+ .getElementByDataTestsId('resumeVFModuleButton-' + vfModuleName).click().then(()=> {
+ cy.getElementByDataTestsId('confirmResumeDeleteButton').should('be.visible')
+ .getElementByDataTestsId('softDeleteButton').should('not.be.visible')
+ .getElementByDataTestsId('lcpRegion').should('be.visible')
+ .getElementByDataTestsId('tenant').should('be.visible')
+ .getElementByDataTestsId('modalTitle').contains('Instantiate')
+ .getElementByDataTestsId('confirmResumeDeleteButton').contains('Instantiate')
+ .getElementByDataTestsId('cancel').click();
+ });
+ }
+
+ function checkSoftDeleteAndDeletePopup(vfModuleName:string, vfModuleClassName:string, softDeleteEnable:boolean, isNoHomingData:boolean) {
+ const visibleString = 'be.visible';
+ const NOT = 'not.';
+ const softDeleteVisibleString = (softDeleteEnable) ? visibleString : NOT + visibleString;
+ const isNoHomingDataVisibleString = (isNoHomingData) ? visibleString : NOT + visibleString;
+ cy.get('div').find('.' + vfModuleClassName)
+ .getElementByDataTestsId('deleteVFModuleButton-' + vfModuleName).click({force: true}).then(()=> {
+ cy.getElementByDataTestsId('confirmResumeDeleteButton').should('be.visible')
+ .getElementByDataTestsId('softDeleteButton').should(softDeleteVisibleString)
+ .getElementByDataTestsId('lcpRegion').should(isNoHomingDataVisibleString)
+ .getElementByDataTestsId('tenant').should(isNoHomingDataVisibleString);
+ });
+ }
+ });
+
+
+
+ function changeServiceModel(serviceModel: ServiceModel) {
+ serviceModel.service.uuid = "6e59c5de-f052-46fa-aa7e-2fca9d674c44";
+ return serviceModel;
+ }
+});
+