Skip to content

Commit

Permalink
Update test method
Browse files Browse the repository at this point in the history
  • Loading branch information
mike10ca committed Nov 15, 2023
1 parent 2e26bf0 commit 9ee5192
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 7 additions & 1 deletion cypress/e2e/pages/safeapps.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 1 addition & 3 deletions cypress/e2e/safe-apps/browser_permissions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
})
})

0 comments on commit 9ee5192

Please sign in to comment.