blob: 8e78067e1f3f8c1006df11cb95bce9dde5141316 [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
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});