blob: 438e7bc3a44fa4bebfc62e55ab51b83ab7ad9658 [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" />
3import { JsonBuilder } from '../../support/jsonBuilders/jsonBuilder';
4import { AsyncInstantiationModel } from '../../support/jsonBuilders/models/asyncInstantiation.model';
5
6describe('Spinner', function () {
7 describe('spinner', () => {
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 cy.login();
17 })
18 });
19
Ittay Stern6f900cc2018-08-29 17:01:32 +030020 afterEach(() => {
21 cy.screenshot();
22 });
23
Sonsino, Ofir (os0695)ff76b5e2018-07-10 15:57:37 +030024 it('spinner should display after api call', function () {
Ittay Stern6f900cc2018-08-29 17:01:32 +030025 const timeBomb:Date = new Date(2018,6,10,0,0,0); //month 6 is July
26 if (new Date(Date.now()) > timeBomb) {
Sonsino, Ofir (os0695)ff76b5e2018-07-10 15:57:37 +030027
Ittay Stern6f900cc2018-08-29 17:01:32 +030028 cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json').then((res) => {
Sonsino, Ofir (os0695)ff76b5e2018-07-10 15:57:37 +030029
Ittay Stern6f900cc2018-08-29 17:01:32 +030030 jsonBuilderInstantiationBuilder.basicJson(res,
31 Cypress.config('baseUrl') + "/asyncInstantiation**",
32 200,
33 4000,
34 "error 500 asyncInstantiation");
35 cy.openIframe('app/ui/#/instantiationStatus');
Sonsino, Ofir (os0695)ff76b5e2018-07-10 15:57:37 +030036
Ittay Stern6f900cc2018-08-29 17:01:32 +030037 cy.get('.sdc-loader')
38 .and('be.visible');
39
40 });
41 }
Sonsino, Ofir (os0695)ff76b5e2018-07-10 15:57:37 +030042 });
43 });
44});