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/auditInfo.modal.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/auditInfo.modal.e2e.ts')
-rw-r--r-- | vid-webpack-master/cypress/integration/iFrames/auditInfo.modal.e2e.ts | 74 |
1 files changed, 61 insertions, 13 deletions
diff --git a/vid-webpack-master/cypress/integration/iFrames/auditInfo.modal.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/auditInfo.modal.e2e.ts index c915d48e9..f0db2c9e1 100644 --- a/vid-webpack-master/cypress/integration/iFrames/auditInfo.modal.e2e.ts +++ b/vid-webpack-master/cypress/integration/iFrames/auditInfo.modal.e2e.ts @@ -1,10 +1,13 @@ ///<reference path="../../../node_modules/cypress/types/index.d.ts"/> -import { JsonBuilder } from '../../support/jsonBuilders/jsonBuilder'; -import { AsyncInstantiationModel } from '../../support/jsonBuilders/models/asyncInstantiation.model'; +import {JsonBuilder} from '../../support/jsonBuilders/jsonBuilder'; +import {AsyncInstantiationModel} from '../../support/jsonBuilders/models/asyncInstantiation.model'; +import * as _ from 'lodash'; +import {ServiceModel} from "../../support/jsonBuilders/models/service.model"; describe('Audit information modal', function () { describe('basic UI tests', () => { - var jsonBuilderInstantiationBuilder : JsonBuilder<AsyncInstantiationModel> = new JsonBuilder<AsyncInstantiationModel>(); + var jsonBuilderInstantiationBuilder: JsonBuilder<AsyncInstantiationModel> = new JsonBuilder<AsyncInstantiationModel>(); + var jsonBuilderAndMock: JsonBuilder<ServiceModel> = new JsonBuilder<ServiceModel>(); beforeEach(() => { cy.window().then((win) => { win.sessionStorage.clear(); @@ -14,24 +17,69 @@ describe('Audit information modal', function () { Cypress.config('baseUrl') + "/asyncInstantiation**"); cy.initAAIMock(); cy.initVidMock(); + cy.initAsyncInstantiation(); cy.login(); }) }); + afterEach(() => { + cy.screenshot(); + }); + it(`should display 2 tables with information's`, function () { + cy.initAuditInfoMSOALaCarte(); + cy.openIframe('app/ui/#/instantiationStatus'); + cy.get('.instantiation-status-data tbody tr').each(function (row, index) { + cy.get('.icon-menu').eq(index).click({force: true}).then(()=>{ + cy.getElementByDataTestsId('context-menu-audit-info').click({force:true}).then(()=>{ + cy.get('#service-model-name').should('contain', row.find('#serviceModelName').text().trim()) + .getElementByDataTestsId('model-item-value-userId').should('contain', row.find('#userId').text().trim()) + .get('#service-instantiation-audit-info-vid').should('be.visible') + .get('#service-instantiation-audit-info-vid').find('#vidJobStatus').should('be.visible') + .get('#service-instantiation-audit-info-mso').should('be.visible') + .get('#service-instantiation-audit-info-mso').find('#msoJobStatus').should('be.visible') + .get('#cancelButton').click({force:true}); + }) + }); + }); + }); + + it("shouldn't show instance name in mso table on macro service", function () { + cy.openIframe('app/ui/#/instantiationStatus'); + cy.get('.icon-menu').eq(0).click({force:true}).then(() => { + cy.getElementByDataTestsId('context-menu-audit-info').click({force:true}).then(() => { + cy.get('#service-instantiation-audit-info-mso thead tr th#instanceName').should("not.be.visible") + .get('#service-instantiation-audit-info-mso tbody tr td.msoInstanceName').should("not.be.visible"); + }) + }) + }); + it('should show instance name in mso table on a la carte service', function () { + cy.readFile('../vid-automation/src/test/resources/a-la-carte/auditInfoMSOALaCarte.json').then((res) => { + cy.initAuditInfoMSOALaCarte(res); cy.openIframe('app/ui/#/instantiationStatus'); - cy.get('.instantiation-status-data tbody tr').each(function (row, index) { - cy.get('.icon-menu').eq(index).click() - .get('.audit-icon').click() - .get('#service-model-name').should('contain', row.find('#serviceModelName').text().trim()) - .getElementByDataTestsId('model-item-value-userId').should('contain', row.find('#userId').text().trim()) - .get('#service-instantiation-audit-info-vid').should('be.visible') - .get('#service-instantiation-audit-info-vid').find('#vidJobStatus').should('be.visible') - .get('#service-instantiation-audit-info-mso').should('be.visible') - .get('#service-instantiation-audit-info-mso').find('#msoJobStatus').should('be.visible') - .get('#cancelButton').click(); + cy.get('.icon-menu').eq(7).click({force:true}).then(() => { + cy.getElementByDataTestsId('context-menu-audit-info').click({force:true}).then(() => { + cy.get('#service-instantiation-audit-info-mso thead tr th#instanceName').should("be.visible") + .get('#service-instantiation-audit-info-mso tbody tr').each(function (row, index) { + assert.equal(row.find('.request-id').text().trim(), res[index]['requestId']); + assert.equal(row.find('.msoInstanceName').text().trim(), 'service: ' + res[index]['instanceName']); + assert.equal(row.find('#msoJobStatus').text().trim(), _.capitalize(res[index]['jobStatus'])); + assert.equal(row.find('#msoAdditionalInfo span').text().trim(), res[index]['additionalInfo']); + }); + }); + }) + }) + }); + + it('glossary should be visible', function () { + cy.openIframe('app/ui/#/instantiationStatus'); + cy.get('.icon-menu').eq(7).click().then(() => { + cy.getElementByDataTestsId('context-menu-audit-info').click().then(() => { + cy.get('#glossary_link').should('be.visible'); }); + }) }); + }); }); |