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 | |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame] | 21 | afterEach(() => { |
| 22 | cy.screenshot(); |
| 23 | }); |
| 24 | |
| 25 | it('error should display on api error', function () { |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 26 | // adding call with delay of 2000 sec |
| 27 | cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json').then((res) => { |
| 28 | jsonBuilderInstantiationBuilder.basicJson(res, Cypress.config('baseUrl') + "/asyncInstantiation**", 500,0, "error 500 asyncInstantiation"); |
| 29 | |
| 30 | cy.openIframe('app/ui/#/instantiationStatus'); |
| 31 | cy.get('div.title') |
| 32 | .contains('Server not available'); |
| 33 | |
| 34 | }); |
| 35 | }); |
| 36 | }); |
| 37 | }); |