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 | import { JsonBuilder } from '../../support/jsonBuilders/jsonBuilder'; |
| 4 | import { AsyncInstantiationModel } from '../../support/jsonBuilders/models/asyncInstantiation.model'; |
| 5 | |
| 6 | describe('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 | |
| 20 | it('spinner should display after api call', function () { |
| 21 | cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json').then((res) => { |
| 22 | |
| 23 | jsonBuilderInstantiationBuilder.basicJson(res, |
| 24 | Cypress.config('baseUrl') + "/asyncInstantiation**", |
| 25 | 200, |
| 26 | 2000, |
| 27 | "error 500 asyncInstantiation"); |
| 28 | cy.openIframe('app/ui/#/instantiationStatus'); |
| 29 | |
| 30 | cy.get('.spinner') |
| 31 | .and('be.visible'); |
| 32 | |
| 33 | }); |
| 34 | }); |
| 35 | }); |
| 36 | }); |