mirror of
https://github.com/luxfi/safe-wallet.git
synced 2026-10-30 15:19:21 +00:00
* fix(e2e): add and update tests for the actions panel task * fix(e2e): update test according to latest requirements * fix(e2e): fix failing regression tests * fix(e2e): fix formatting issue * fix(e2e): recovery tests refactoring and fix bot comment * fix(e2e): fix the bot comment about data test id * fix(e2e): remove id duplication and skip 1.1.1 check
99 lines
4.1 KiB
JavaScript
99 lines
4.1 KiB
JavaScript
import * as constants from '../../support/constants'
|
|
import * as dashboard from '../pages/dashboard.pages'
|
|
import * as createTx from '../pages/create_tx.pages'
|
|
import * as main from '../pages/main.page.js'
|
|
import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js'
|
|
|
|
let staticSafes = []
|
|
|
|
const txData = ['Send', '-0.00002 ETH', '1/1']
|
|
const txaddOwner = ['addOwnerWithThreshold', '1/2']
|
|
const txMultiSendCall3 = ['Batch', '3 actions', '1/2']
|
|
const txMultiSendCall2 = ['Batch', '2 actions', '1/2']
|
|
|
|
describe('Dashboard tests', { defaultCommandTimeout: 60000 }, () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
// intercept must be set up before visit so it catches the parallel queue request
|
|
beforeEach(() => {
|
|
cy.intercept('GET', constants.queuedEndpoint).as('getQueuedTransactions')
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_2)
|
|
cy.wait('@getQueuedTransactions')
|
|
cy.get(dashboard.pendingTxWidget).should('be.visible')
|
|
})
|
|
|
|
it('Verify clicking on View All button directs to list of all queued txs', () => {
|
|
dashboard.clickOnViewAllBtn()
|
|
createTx.verifyNumberOfTransactions(2)
|
|
})
|
|
|
|
it('Verify clicking on any tx takes the user to Transactions > Queue tab', () => {
|
|
dashboard.clickOnTxByIndex(0)
|
|
dashboard.verifySingleTxItem(txData)
|
|
})
|
|
|
|
it('Verify there is empty tx string and image when there are no tx queued', () => {
|
|
cy.intercept('GET', constants.queuedEndpoint).as('getQueuedTransactions')
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_14)
|
|
cy.wait('@getQueuedTransactions')
|
|
dashboard.verifyEmptyTxSection()
|
|
})
|
|
|
|
it('[SMOKE] Verify that the last created tx in conflicting tx is showed in the widget', () => {
|
|
cy.get(dashboard.pendingTxWidget, { timeout: 30000 }).should('be.visible')
|
|
main.verifyElementsCount(dashboard.pendingTxItem, 1)
|
|
dashboard.verifyDataInPendingTx(txData)
|
|
})
|
|
|
|
it('[SMOKE] Verify that tx are displayed correctly in Pending tx section', () => {
|
|
cy.intercept('GET', constants.queuedEndpoint).as('getQueuedTransactions')
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_12)
|
|
cy.wait('@getQueuedTransactions')
|
|
dashboard.verifyTxItemInPendingTx(txMultiSendCall3)
|
|
dashboard.verifyTxItemInPendingTx(txaddOwner)
|
|
dashboard.verifyTxItemInPendingTx(txMultiSendCall2)
|
|
})
|
|
|
|
it('Verify that action required panel shows message count and expands when toggled', () => {
|
|
cy.visit(constants.homeUrl + staticSafes.MATIC_STATIC_SAFE_31)
|
|
dashboard.verifyActionRequiredPanelCount(1)
|
|
dashboard.expandActionRequiredPanel()
|
|
})
|
|
|
|
// Mastercopy warnings (Action Required panel) — see specs/002-cypress-banner-actioncard-migration
|
|
//we need 1.1.1 test save - deployment tbd
|
|
it.skip('Verify that outdated official mastercopy shows Info card with Update CTA and opens upgrade flow', () => {
|
|
cy.visit(constants.homeUrl + staticSafes.ETH_STATIC_SAFE_OUTDATED_MASTERCOPY)
|
|
|
|
dashboard.verifyActionRequiredCard({
|
|
messages: [dashboard.outdatedOfficialTitlePrefix, dashboard.outdatedOfficialContent],
|
|
actionTestId: dashboard.mastercopyActions.update,
|
|
})
|
|
dashboard.clickActionInPanel(dashboard.mastercopyActions.update)
|
|
dashboard.verifyMigrateSafeFlowOpened()
|
|
})
|
|
|
|
it('Verify that aligable for migration mastercopy shows Warning card with unsupported copy and Migrate CTA', () => {
|
|
cy.visit(constants.homeUrl + staticSafes.MATIC_STATIC_SAFE_31)
|
|
|
|
dashboard.verifyActionRequiredCard({
|
|
messages: [dashboard.unsupportedMastercopyTitle, dashboard.unsupportedMigratableContent],
|
|
actionTestId: dashboard.mastercopyActions.migrate,
|
|
})
|
|
dashboard.clickActionInPanel(dashboard.mastercopyActions.migrate)
|
|
dashboard.verifyMigrateSafeFlowOpened()
|
|
})
|
|
|
|
it('Verify that unsupported not migration shows Warning card with Get CLI CTA opening CLI docs in new tab', () => {
|
|
cy.visit(constants.homeUrl + staticSafes.MATIC_STATIC_SAFE_32)
|
|
|
|
dashboard.verifyActionRequiredCard({
|
|
messages: [dashboard.unsupportedMastercopyTitle, dashboard.unsupportedCliContent],
|
|
actionTestId: dashboard.mastercopyActions.getCli,
|
|
})
|
|
dashboard.verifyGetCliLinkInPanel()
|
|
})
|
|
})
|