Skip to content

Commit

Permalink
fix: e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
iamacook committed Sep 25, 2023
1 parent 1cb4116 commit 7b85e74
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cypress/e2e/pages/import_export.pages.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { format } from 'date-fns'
const path = require('path')

const enablePushNotificationsStr = 'Enable push notifications'
const addressBookBtnStr = 'Address book'
const dataImportModalStr = 'Data import'
const appsBtnStr = 'Apps'
const bookmarkedAppsBtnStr = 'Bookmarked apps'
const settingsBtnStr = 'Settings'
const appearenceTabStr = 'Appearance'
const showMoreTabsBtn = '[data-testid="KeyboardArrowRightIcon"]'
const dataTabStr = 'Data'
const tab = 'div[role="tablist"] a'
export const prependChainPrefixStr = 'Prepend chain prefix to addresses'
Expand Down Expand Up @@ -41,6 +43,12 @@ export function clickOnImportedSafe(safe) {
cy.contains(safe).click()
}

export function clickOnClosePushNotificationsBanner() {
cy.waitForSelector(() => {
return cy.get('h6').contains(enablePushNotificationsStr).siblings('.MuiButtonBase-root').click({ force: true })
})
}

export function clickOnAddressBookBtn() {
cy.contains(addressBookBtnStr).click()
}
Expand Down Expand Up @@ -82,6 +90,13 @@ export function clickOnAppearenceBtn() {
cy.contains(tab, appearenceTabStr).click()
}

export function clickOnShowMoreTabsBtn() {
cy.get(showMoreTabsBtn).click()
}

export function verifDataTabBtnIsVisible() {
cy.contains(tab, dataTabStr).should('be.visible')
}
export function clickOnDataTab() {
cy.contains(tab, dataTabStr).click()
}
Expand Down
3 changes: 3 additions & 0 deletions cypress/e2e/smoke/import_export_data.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('Import Export Data', () => {
file.verifyImportModalData()
file.clickOnImportBtnDataImportModal()
file.clickOnImportedSafe(safe)
file.clickOnClosePushNotificationsBanner()
})

it("Verify safe's address book imported data", () => {
Expand All @@ -45,6 +46,8 @@ describe('Import Export Data', () => {
})

it('Verifies data for export in Data tab', () => {
file.clickOnShowMoreTabsBtn()
file.verifDataTabBtnIsVisible()
file.clickOnDataTab()
file.verifyImportModalData()
file.verifyFileDownload()
Expand Down

0 comments on commit 7b85e74

Please sign in to comment.