Skip to content

Commit

Permalink
fix: Move import data e2e test to global preference page
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed Oct 11, 2023
1 parent ca3a3f8 commit 58b2694
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion cypress/e2e/pages/import_export.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function clickOnImportBtn() {
}

export function clickOnImportBtnDataImportModal() {
cy.contains(dataImportModalStr).parent().contains('button', 'Import').click()
cy.contains('button', 'Import').click()
}

export function uploadFile(filePath) {
Expand All @@ -43,6 +43,10 @@ export function clickOnImportedSafe(safe) {
cy.contains(safe).click()
}

export function clickOnOpenSafeListSidebar() {
cy.contains('My Safe Accounts').click()
}

export function clickOnClosePushNotificationsBanner() {
cy.waitForSelector(() => {
return cy.get('h6').contains(enablePushNotificationsStr).siblings('.MuiButtonBase-root').click({ force: true })
Expand Down
9 changes: 4 additions & 5 deletions cypress/e2e/smoke/import_export_data.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@ import * as file from '../pages/import_export.pages'
import * as main from '../pages/main.page'
import * as constants from '../../support/constants'

// TODO: This is currently removed from the welcome page
describe.skip('Import Export Data', () => {
describe('Import Export Data', () => {
before(() => {
cy.clearLocalStorage()
cy.visit(constants.welcomeUrl)
cy.visit(constants.dataSettingsUrl)
main.acceptCookies()
file.verifyImportBtnIsVisible()
})

it('Uploads test file and access safe', () => {
const filePath = '../fixtures/data_import.json'
const safe = 'safe 1 goerli'

file.clickOnImportBtn()
file.uploadFile(filePath)
file.verifyImportModalData()
file.clickOnImportBtnDataImportModal()
cy.visit(constants.welcomeUrl)
file.clickOnOpenSafeListSidebar()
file.clickOnImportedSafe(safe)
file.clickOnClosePushNotificationsBanner()
})
Expand Down
1 change: 1 addition & 0 deletions cypress/support/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const requestPermissionsUrl = '/request-permissions'
export const getPermissionsUrl = '/get-permissions'
export const appSettingsUrl = '/settings/safe-apps'
export const setupUrl = '/settings/setup?safe='
export const dataSettingsUrl = '/settings/data'
export const invalidAppUrl = 'https://my-invalid-custom-app.com/manifest.json'
export const validAppUrlJson = 'https://my-valid-custom-app.com/manifest.json'
export const validAppUrl = 'https://my-valid-custom-app.com'
Expand Down

0 comments on commit 58b2694

Please sign in to comment.