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 | |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame^] | 20 | afterEach(() => { |
| 21 | cy.screenshot(); |
| 22 | }); |
| 23 | |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 24 | it('spinner should display after api call', function () { |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame^] | 25 | 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) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 27 | |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame^] | 28 | cy.readFile('/cypress/support/jsonBuilders/mocks/jsons/asyncInstantiation.json').then((res) => { |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 29 | |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame^] | 30 | 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) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 36 | |
Ittay Stern | 6f900cc | 2018-08-29 17:01:32 +0300 | [diff] [blame^] | 37 | cy.get('.sdc-loader') |
| 38 | .and('be.visible'); |
| 39 | |
| 40 | }); |
| 41 | } |
Sonsino, Ofir (os0695) | ff76b5e | 2018-07-10 15:57:37 +0300 | [diff] [blame] | 42 | }); |
| 43 | }); |
| 44 | }); |