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('Error message popup', function () { |
| 8 | describe('show error on status 500', () => { |
| 9 | var jsonBuilderInstantiationBuilder : JsonBuilder<AsyncInstantiationModel> = new JsonBuilder<AsyncInstantiationModel>(); |
| 10 | beforeEach(() => { |
| 11 | cy.window().then((win) => { |
| 12 | win.sessionStorage.clear(); |
| 13 | cy.setReduxState(); |
| 14 | cy.preventErrorsOnLoading(); |
| 15 | cy.initAAIMock(); |
| 16 | cy.initVidMock(); |
| 17 | cy.login(); |
| 18 | }) |
| 19 | }); |
| 20 | |
| 21 | it('spinner should display after api call', function () { |
| 22 | // adding call with delay of 2000 sec |
| 23 | cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json').then((res) => { |
| 24 | jsonBuilderInstantiationBuilder.basicJson(res, Cypress.config('baseUrl') + "/asyncInstantiation**", 500,0, "error 500 asyncInstantiation"); |
| 25 | |
| 26 | cy.openIframe('app/ui/#/instantiationStatus'); |
| 27 | cy.get('div.title') |
| 28 | .contains('Server not available'); |
| 29 | |
| 30 | }); |
| 31 | }); |
| 32 | }); |
| 33 | }); |