From 32dbf8017aeab06041992064feaf70953ef86e19 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Tue, 29 Oct 2019 12:58:49 +0200 Subject: Introduce cy.clearSessionStorage Issue-ID: VID-647 Change-Id: I51471f736577599c1ace8e330a4db089deccc8ca Signed-off-by: Ittay Stern --- .../cypress/support/application/application.session.actions.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'vid-webpack-master/cypress/support') 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 42d4d6766..c054b2640 100644 --- a/vid-webpack-master/cypress/support/application/application.session.actions.ts +++ b/vid-webpack-master/cypress/support/application/application.session.actions.ts @@ -2,6 +2,7 @@ declare namespace Cypress { interface Chainable { setReduxState : typeof setReduxState; getReduxState : typeof getReduxState; + clearSessionStorage: typeof clearSessionStorage; setTestApiParamToGR: typeof setTestApiParamToGR; setTestApiParamToVNF: typeof setTestApiParamToVNF; buildReduxStateWithServiceRespone: typeof buildReduxStateWithServiceRespone; @@ -25,6 +26,12 @@ function getReduxState(): Chainable { }); } +function clearSessionStorage() : void { + cy.window().then((win) => { + win.sessionStorage.clear(); + }); +} + function setTestApiParamToGR() : void { cy.window().then((win) => { win.sessionStorage.setItem('msoRequestParametersTestApiValue', 'GR_API'); @@ -72,6 +79,7 @@ function buildReduxStateWithServiceRespone(res: any, serviceId:string, isEcompGe Cypress.Commands.add('setReduxState', setReduxState); Cypress.Commands.add('getReduxState', getReduxState); +Cypress.Commands.add('clearSessionStorage', clearSessionStorage); Cypress.Commands.add('setTestApiParamToGR', setTestApiParamToGR); Cypress.Commands.add('setTestApiParamToVNF',setTestApiParamToVNF); Cypress.Commands.add('buildReduxStateWithServiceRespone', buildReduxStateWithServiceRespone); -- cgit 1.2.3-korg