From 88fcc332e4073b1c33c97d2a9cd81cb492f77481 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Thu, 2 Apr 2020 10:33:13 +0300 Subject: Improve clearSessionStorage timings Hopefully it will solve the flakiness of test named "upgrade vfmodule when upgraded already service, vnf and brother vfmodule" that fails on missing test_api value which is set by setTestApiParamToGR() Issue-ID: VID-647 Change-Id: I51ba95edf3a7535dec2715054f7f10564a7debe3 Signed-off-by: Ittay Stern --- .../cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts | 9 +++++---- .../cypress/support/application/application.session.actions.ts | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts b/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts index 027901f0f..ac36f6771 100644 --- a/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts +++ b/vid-webpack-master/cypress/integration/iFrames/viewEditUpgradeVfModule.e2e.ts @@ -134,10 +134,11 @@ describe('View Edit Page: Upgrade VFModule', function () { describe('More UI test', () => { beforeEach(() => { - cy.clearSessionStorage(); - cy.setTestApiParamToGR(); - cy.initVidMock(); - cy.login(); + cy.clearSessionStorage().then(() => { + cy.setTestApiParamToGR(); + cy.initVidMock(); + cy.login(); + }); }); afterEach(() => { diff --git a/vid-webpack-master/cypress/support/application/application.session.actions.ts b/vid-webpack-master/cypress/support/application/application.session.actions.ts index 9126ae1a4..99d5d867a 100644 --- a/vid-webpack-master/cypress/support/application/application.session.actions.ts +++ b/vid-webpack-master/cypress/support/application/application.session.actions.ts @@ -25,8 +25,8 @@ function getReduxState(): Chainable { }); } -function clearSessionStorage() : void { - cy.window().then((win) => { +function clearSessionStorage() : Cypress.Chainable { + return cy.window().then((win) => { win.sessionStorage.clear(); }); } -- cgit 1.2.3-korg