blob: 69021132c359179b550d6800ae9b04995ed26b85 [file] [log] [blame]
Sonsino, Ofir (os0695)ff76b5e2018-07-10 15:57:37 +03001///<reference path="../../../node_modules/cypress/types/index.d.ts"/>
2/// <reference types="Cypress" />
3
4import { JsonBuilder } from '../../support/jsonBuilders/jsonBuilder';
5import { AsyncInstantiationModel } from '../../support/jsonBuilders/models/asyncInstantiation.model';
6
7describe('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 Stern6f900cc2018-08-29 17:01:32 +030021 afterEach(() => {
22 cy.screenshot();
23 });
24
25 it('error should display on api error', function () {
Sonsino, Ofir (os0695)ff76b5e2018-07-10 15:57:37 +030026 // 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});