Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Update import export tests #4551

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions cypress/e2e/pages/sidebar.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const currencySection = '[data-testid="currency-section"]'
const missingSignatureInfo = '[data-testid="missing-signature-info"]'
const queuedTxInfo = '[data-testid="queued-tx-info"]'
const showMoreBtn = '[data-testid="show-more-btn" ]'
const importBtn = '[data-testid="import-btn"]'
export const importBtn = '[data-testid="import-btn"]'
export const pendingActivationIcon = '[data-testid="pending-activation-icon"]'
const safeItemMenuIcon = '[data-testid="MoreVertIcon"]'
const multichainItemSummary = '[data-testid="multichain-item-summary"]'
Expand Down Expand Up @@ -105,8 +105,6 @@ export function getImportBtn() {
return cy.get(importBtn).scrollIntoView().should('be.visible')
}
export function clickOnSidebarImportBtn() {
cy.get(sidebarSafeContainer).find(sideSafeListItem).last().scrollIntoView()

getImportBtn().click()
modal.verifyModalTitle(modal.modalTitiles.dataImport)
file.verifyValidImportInputExists()
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/smoke/import_export_data.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js'

let staticSafes = []

describe('[SMOKE] Import Export Data tests', () => {
describe('[SMOKE] Import Export Data tests', { defaultCommandTimeout: 20000 }, () => {
before(async () => {
staticSafes = await getSafes(CATEGORIES.static)
})
Expand Down
11 changes: 1 addition & 10 deletions cypress/e2e/smoke/import_export_data_2.cy.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import 'cypress-file-upload'
import * as file from '../pages/import_export.pages.js'
import * as main from '../pages/main.page.js'
import * as constants from '../../support/constants.js'
import * as sidebar from '../pages/sidebar.pages.js'
import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js'
import * as wallet from '../../support/utils/wallet.js'

let staticSafes = []

Expand All @@ -15,10 +13,7 @@ const invalidJsonPath_3 = 'cypress/fixtures/test-empty-batch.json'

const appNames = ['Transaction Builder']

const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS'))
const signer = walletCredentials.OWNER_4_PRIVATE_KEY

describe('[SMOKE] Import Export Data tests 2', () => {
describe('[SMOKE] Import Export Data tests 2', { defaultCommandTimeout: 20000 }, () => {
before(async () => {
staticSafes = await getSafes(CATEGORIES.static)
})
Expand All @@ -28,13 +23,11 @@ describe('[SMOKE] Import Export Data tests 2', () => {
})

it('[SMOKE] Verify that the Sidebar Import button opens an import modal', () => {
wallet.connectSigner(signer)
sidebar.openSidebar()
sidebar.clickOnSidebarImportBtn()
})

it('[SMOKE] Verify that correctly formatted json file can be uploaded and shows data', () => {
wallet.connectSigner(signer)
sidebar.openSidebar()
sidebar.clickOnSidebarImportBtn()
file.dragAndDropFile(validJsonPath)
Expand All @@ -48,7 +41,6 @@ describe('[SMOKE] Import Export Data tests 2', () => {
})

it('[SMOKE] Verify that only json files can be imported', () => {
wallet.connectSigner(signer)
sidebar.openSidebar()
sidebar.clickOnSidebarImportBtn()
file.dragAndDropFile(invalidJsonPath)
Expand All @@ -63,7 +55,6 @@ describe('[SMOKE] Import Export Data tests 2', () => {
})

it('[SMOKE] Verify that json files with wrong information are rejected', () => {
wallet.connectSigner(signer)
sidebar.openSidebar()
sidebar.clickOnSidebarImportBtn()
file.dragAndDropFile(invalidJsonPath_3)
Expand Down
Loading