diff --git a/cypress/e2e/pages/safeapps.pages.js b/cypress/e2e/pages/safeapps.pages.js index ad96d0ed0c..f349d2034e 100644 --- a/cypress/e2e/pages/safeapps.pages.js +++ b/cypress/e2e/pages/safeapps.pages.js @@ -210,7 +210,13 @@ function verifyDisclaimerIsVisible() { export function clickOnContinueBtn() { cy.get(appModal).should('exist') - cy.findByRole('button', { name: continueBtnStr }).click().wait(1000) + return cy.findByRole('button', { name: continueBtnStr }).click().wait(1000) +} + +export function checkLocalStorage() { + clickOnContinueBtn().should(() => { + expect(window.localStorage.getItem(constants.BROWSER_PERMISSIONS_KEY)).to.eq(localStorageItem) + }) } export function verifyCameraCheckBoxExists() { diff --git a/cypress/e2e/safe-apps/browser_permissions.cy.js b/cypress/e2e/safe-apps/browser_permissions.cy.js index 59cbceffed..97f816dc75 100644 --- a/cypress/e2e/safe-apps/browser_permissions.cy.js +++ b/cypress/e2e/safe-apps/browser_permissions.cy.js @@ -30,8 +30,6 @@ describe('Browser permissions tests', () => { safeapps.verifyWarningDefaultAppMsgIsDisplayed() safeapps.verifyCameraCheckBoxExists() safeapps.clickOnContinueBtn() - safeapps.clickOnContinueBtn().should(() => { - expect(window.localStorage.getItem(constants.BROWSER_PERMISSIONS_KEY)).to.eq(safeapps.localStorageItem) - }) + safeapps.checkLocalStorage() }) })