Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 1 | ///<reference path="../../../node_modules/cypress/types/index.d.ts"/> |
| 2 | /// <reference types="Cypress" /> |
| 3 | |
| 4 | import { JsonBuilder } from '../../support/jsonBuilders/jsonBuilder'; |
| 5 | import { AsyncInstantiationModel } from '../../support/jsonBuilders/models/asyncInstantiation.model'; |
| 6 | |
| 7 | describe('Instantiation status page', function () { |
| 8 | var jsonBuilderInstantiationBuilder : JsonBuilder<AsyncInstantiationModel> = new JsonBuilder<AsyncInstantiationModel>(); |
| 9 | beforeEach(() => { |
| 10 | cy.window().then((win) => { |
| 11 | win.sessionStorage.clear(); |
| 12 | cy.setReduxState(); |
| 13 | cy.preventErrorsOnLoading(); |
| 14 | cy.initAAIMock(); |
| 15 | cy.initVidMock(); |
| 16 | jsonBuilderInstantiationBuilder.basicMock('/cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json', |
| 17 | Cypress.config('baseUrl') + "/asyncInstantiation**"); |
| 18 | cy.login(); |
| 19 | }) |
| 20 | }); |
| 21 | |
| 22 | it('should disaplay the correct icons per status', function () { |
| 23 | cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json').then((res) => { |
| 24 | cy.openIframe('app/ui/#/instantiationStatus'); |
| 25 | for(let i = 0 ; i < res.length; i++){ |
| 26 | if(res[i].project){ |
| 27 | cy.getTableRowByIndex('instantiation-status', i).get('td#project span').contains(res[i].project); |
| 28 | } |
| 29 | if(res[i].userId){ |
| 30 | cy.getTableRowByIndex('instantiation-status', i).get('td#userId span').contains(res[i].userId); |
| 31 | } |
| 32 | if(res[i].tenantName){ |
| 33 | cy.getTableRowByIndex('instantiation-status', i).get('td#tenantName span').contains(res[i].tenantName); |
| 34 | } |
| 35 | if(res[i].serviceModelName){ |
| 36 | cy.getTableRowByIndex('instantiation-status', i).get('td#serviceModelName span').contains(res[i].serviceModelName); |
| 37 | } |
| 38 | if(res[i].serviceInstanceName){ |
| 39 | cy.getTableRowByIndex('instantiation-status', i).get('td#serviceInstanceName span').contains(res[i].serviceInstanceName); |
| 40 | } |
| 41 | if(res[i].serviceModelVersion){ |
| 42 | cy.getTableRowByIndex('instantiation-status', i).get('td#serviceModelVersion span').contains(res[i].serviceModelVersion); |
| 43 | } |
| 44 | if(res[i].subscriberName){ |
| 45 | cy.getTableRowByIndex('instantiation-status', i).get('td#subscriberName span').contains(res[i].subscriberName); |
| 46 | } |
| 47 | } |
| 48 | }); |
| 49 | }); |
| 50 | }); |