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 <ittay.stern@att.com>
   describe('More UI test', () => {
 
     beforeEach(() => {
-      cy.clearSessionStorage();
-      cy.setTestApiParamToGR();
-      cy.initVidMock();
-      cy.login();
+      cy.clearSessionStorage().then(() => {
+        cy.setTestApiParamToGR();
+        cy.initVidMock();
+        cy.login();
+      });
     });
 
     afterEach(() => {
 
   });
 }
 
-function clearSessionStorage() : void {
-  cy.window().then((win) => {
+function clearSessionStorage() : Cypress.Chainable<any> {
+  return cy.window().then((win) => {
     win.sessionStorage.clear();
   });
 }