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: Automation tests updates #4335

Merged
merged 3 commits into from
Oct 8, 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: 2 additions & 2 deletions cypress/e2e/happypath/sendfunds_relay.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import SafeApiKit from '@safe-global/api-kit'
import { createSigners } from '../../support/api/utils_ether'
import { createSafes } from '../../support/api/utils_protocolkit'
import { contracts, abi_qtrust, abi_nft_pc2 } from '../../support/api/contracts'
import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js'
import * as wallet from '../../support/utils/wallet.js'
import * as fundSafes from '../../fixtures/safes/funds.json'

const transferAmount = '1'

Expand Down Expand Up @@ -55,7 +55,7 @@ describe('Send funds with relay happy path tests', { defaultCommandTimeout: 3000
ls.cookies.acceptedTokenListOnboarding,
)
})
safesData = await getSafes(CATEGORIES.funds)
safesData = fundSafes
apiKit = new SafeApiKit({
chainId: BigInt(1),
txServiceUrl: constants.stagingTxServiceUrl,
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/pages/assets.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ export function checkHiddenTokenBtnCounter(value) {
}

export function verifyEachRowHasCheckbox(state) {
const tokens = [currencyTestTokenB, currencyTestTokenA]
main.verifyTextVisibility(tokens)
cy.get(tokenListTable).within(() => {
cy.get('tbody').within(() => {
cy.get('tr').each(($row) => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/pages/main.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function clickOnSideMenuItem(item) {

export function waitForHistoryCallToComplete() {
cy.intercept('GET', constants.transactionHistoryEndpoint).as('History')
cy.wait('@History')
cy.wait('@History', { timeout: 20000 })
}

export const fetchSafeData = (safeAddress) => {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/pages/safeapps.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const acceptBtnStr = /accept/i
const clearAllBtnStr = /clear all/i
const allowAllPermissions = /allow all/i
export const enterAddressStr = /enter address or ens name/i
export const addTransactionStr = /add transaction/i
export const addTransactionStr = /add new transaction/i
export const createBatchStr = /create batch/i
export const sendBatchStr = /send batch/i
export const transactionDetailsStr = /transaction details/i
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/prodhealthcheck/add_owner.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ describe('[PROD] Add Owners tests', () => {

beforeEach(() => {
cy.visit(constants.prodbaseUrl + constants.setupUrl + staticSafes.SEP_STATIC_SAFE_4)
cy.clearLocalStorage()
main.acceptCookies()
cy.contains(owner.safeAccountNonceStr, { timeout: 10000 })
})

Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/prodhealthcheck/create_tx.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ describe.skip('[PROD] Create transactions tests', () => {
})

beforeEach(() => {
cy.clearLocalStorage()
cy.visit(constants.prodbaseUrl + constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_6)
main.acceptCookies()
wallet.connectSigner(signer)
createtx.clickOnNewtransactionBtn()
createtx.clickOnSendTokensBtn()
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/prodhealthcheck/load_safe.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ describe('[PROD] Load Safe tests', () => {
})

beforeEach(() => {
cy.clearLocalStorage()
cy.visit(constants.prodbaseUrl + constants.loadNewSafeSepoliaUrl)
main.acceptCookies()
cy.wait(2000)
})

Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/prodhealthcheck/messages_onchain.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ describe('[PROD] Onchain Messages tests', () => {
})

beforeEach(() => {
cy.clearLocalStorage()
cy.visit(constants.prodbaseUrl + constants.transactionsHistoryUrl + staticSafes.SEP_STATIC_SAFE_10)
main.acceptCookies()
})

// TODO: Added to prod
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/prodhealthcheck/nfts.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ describe.skip('[PROD] NFTs tests', () => {
})

beforeEach(() => {
cy.clearLocalStorage()
cy.visit(constants.prodbaseUrl + constants.balanceNftsUrl + staticSafes.SEP_STATIC_SAFE_2)
main.acceptCookies()
wallet.connectSigner(signer)
nfts.waitForNftItems(2)
})
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/prodhealthcheck/remove_owner.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ describe('[PROD] Remove Owners tests', () => {
beforeEach(() => {
cy.visit(constants.prodbaseUrl + constants.setupUrl + staticSafes.SEP_STATIC_SAFE_13)
main.waitForHistoryCallToComplete()
cy.clearLocalStorage()
main.acceptCookies()
cy.contains(owner.safeAccountNonceStr, { timeout: 10000 })
})

Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/prodhealthcheck/sidebar.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ describe('[PROD] Sidebar tests', () => {

beforeEach(() => {
cy.visit(constants.prodbaseUrl + constants.homeUrl + staticSafes.SEP_STATIC_SAFE_9)
cy.clearLocalStorage()
main.acceptCookies()
})

// TODO: Added to prod
Expand Down
9 changes: 0 additions & 9 deletions cypress/e2e/prodhealthcheck/sidebar_3.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ describe.skip('[PROD] Sidebar tests 3', () => {
staticSafes = await getSafes(CATEGORIES.static)
})

beforeEach(() => {
cy.clearLocalStorage()
})

// TODO: Added to prod
it('Verify the "My accounts" counter at the top is counting all safes the user owns', () => {
cy.visit(constants.prodbaseUrl + constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_9)
main.acceptCookies()
cy.intercept('GET', constants.safeListEndpoint, {
11155111: [sideBar.sideBarSafes.safe1, sideBar.sideBarSafes.safe2],
})
Expand All @@ -36,16 +31,13 @@ describe.skip('[PROD] Sidebar tests 3', () => {
// TODO: Added to prod
it('Verify pending signature is displayed in sidebar for unsigned tx', () => {
cy.visit(constants.prodbaseUrl + constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_7)
main.acceptCookies()
wallet.connectSigner(signer)
cy.intercept('GET', constants.safeListEndpoint, {
11155111: [sideBar.sideBarSafesPendingActions.safe1],
})
sideBar.openSidebar()
sideBar.verifyTxToConfirmDoesNotExist()

cy.get('body').click()

owner.clickOnWalletExpandMoreIcon()
navigation.clickOnDisconnectBtn()
cy.intercept('GET', constants.safeListEndpoint, {
Expand All @@ -60,7 +52,6 @@ describe.skip('[PROD] Sidebar tests 3', () => {
// TODO: Added to prod
it('Verify balance exists in a tx in sidebar', () => {
cy.visit(constants.prodbaseUrl + constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_7)
main.acceptCookies()
wallet.connectSigner(signer)
owner.clickOnWalletExpandMoreIcon()
navigation.clickOnDisconnectBtn()
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/prodhealthcheck/spending_limits.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ describe('[PROD] Spending limits tests', () => {

beforeEach(() => {
cy.visit(constants.prodbaseUrl + constants.setupUrl + staticSafes.SEP_STATIC_SAFE_8)
cy.clearLocalStorage()
main.acceptCookies()
cy.get(spendinglimit.spendingLimitsSection).should('be.visible')
})

Expand Down
7 changes: 0 additions & 7 deletions cypress/e2e/prodhealthcheck/swaps_history_2.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,11 @@ describe('[PROD] Swaps history tests 2', () => {
staticSafes = await getSafes(CATEGORIES.static)
})

beforeEach(() => {
cy.clearLocalStorage()
})

// TODO: Added to prod
it('Verify swap buy operation with 2 actions: approve & swap', { defaultCommandTimeout: 30000 }, () => {
cy.visit(
constants.prodbaseUrl + constants.transactionUrl + staticSafes.SEP_STATIC_SAFE_1 + swaps.swapTxs.buy2actions,
)
main.acceptCookies()

const eq = swaps.createRegex(swapsHistory.oneGNOFull, 'COW')
const atMost = swaps.createRegex(swapsHistory.forAtMostCow, 'COW')

Expand Down Expand Up @@ -52,7 +46,6 @@ describe('[PROD] Swaps history tests 2', () => {
staticSafes.SEP_STATIC_SAFE_1 +
swaps.swapTxs.safeAppSwapOrder,
)
main.acceptCookies()
main.verifyValuesDoNotExist('div', [
swapsHistory.actionApproveG,
swapsHistory.actionDepositG,
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/prodhealthcheck/swaps_tokens.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ describe('[PROD] Swaps token tests', () => {
})

beforeEach(() => {
cy.clearLocalStorage()
cy.visit(constants.prodbaseUrl + constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_1)
main.acceptCookies()
})

// TODO: Added to prod
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/prodhealthcheck/tokens.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ describe('[PROD] Prod tokens tests', () => {
})
beforeEach(() => {
cy.visit(constants.prodbaseUrl + constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_2)
cy.clearLocalStorage()
main.acceptCookies()
})

// TODO: Added to prod
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/prodhealthcheck/tx_history.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ describe('[PROD] Tx history tests 1', () => {
})

beforeEach(() => {
cy.clearLocalStorage()
cy.intercept(
'GET',
`**${constants.stagingCGWChains}${constants.networkKeys.sepolia}/${
Expand All @@ -34,7 +33,6 @@ describe('[PROD] Tx history tests 1', () => {

cy.visit(constants.prodbaseUrl + constants.transactionsHistoryUrl + staticSafes.SEP_STATIC_SAFE_7)
cy.wait('@allTransactions')
main.acceptCookies()
})

// TODO: Added to prod
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/prodhealthcheck/tx_history_2.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ describe('[PROD] Tx history tests 2', () => {
})

beforeEach(() => {
cy.clearLocalStorage()
cy.intercept(
'GET',
`**${constants.stagingCGWChains}${constants.networkKeys.sepolia}/${
Expand All @@ -36,7 +35,6 @@ describe('[PROD] Tx history tests 2', () => {
).as('allTransactions')

cy.visit(constants.prodbaseUrl + constants.transactionsHistoryUrl + staticSafes.SEP_STATIC_SAFE_7)
main.acceptCookies()
})

it('Verify number of transactions is correct', () => {
Expand Down
68 changes: 35 additions & 33 deletions cypress/e2e/regression/add_owner.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ describe('Add Owners tests', () => {

beforeEach(() => {
cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_4)
cy.clearLocalStorage()
main.acceptCookies()
cy.contains(owner.safeAccountNonceStr, { timeout: 10000 })
})

Expand Down Expand Up @@ -65,40 +63,44 @@ describe('Add Owners tests', () => {
owner.verifyConfirmTransactionWindowDisplayed()
})

it('Verify creation, confirmation and deletion of Add owner tx. GA tx_confirm', () => {
const tx_confirmed = [
{
eventLabel: events.txConfirmedAddOwner.eventLabel,
eventCategory: events.txConfirmedAddOwner.category,
eventType: events.txConfirmedAddOwner.eventType,
safeAddress: staticSafes.SEP_STATIC_SAFE_24.slice(6),
},
]
cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_24)
wallet.connectSigner(signer2)
owner.waitForConnectionStatus()
owner.openAddOwnerWindow()
owner.typeOwnerAddress(constants.SEPOLIA_OWNER_2)
createTx.changeNonce(1)
owner.clickOnNextBtn()
createTx.clickOnSignTransactionBtn()
createTx.clickViewTransaction()
it(
'Verify creation, confirmation and deletion of Add owner tx. GA tx_confirm',
{ defaultCommandTimeout: 30000 },
() => {
const tx_confirmed = [
{
eventLabel: events.txConfirmedAddOwner.eventLabel,
eventCategory: events.txConfirmedAddOwner.category,
eventType: events.txConfirmedAddOwner.eventType,
safeAddress: staticSafes.SEP_STATIC_SAFE_24.slice(6),
},
]
cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_24)
wallet.connectSigner(signer2)
owner.waitForConnectionStatus()
owner.openAddOwnerWindow()
owner.typeOwnerAddress(constants.SEPOLIA_OWNER_2)
createTx.changeNonce(1)
owner.clickOnNextBtn()
createTx.clickOnSignTransactionBtn()
createTx.clickViewTransaction()

navigation.clickOnWalletExpandMoreIcon()
navigation.clickOnDisconnectBtn()
wallet.connectSigner(signer)
navigation.clickOnWalletExpandMoreIcon()
navigation.clickOnDisconnectBtn()
wallet.connectSigner(signer)

createTx.clickOnConfirmTransactionBtn()
createTx.clickOnNoLaterOption()
createTx.clickOnSignTransactionBtn()
createTx.clickOnConfirmTransactionBtn()
createTx.clickOnNoLaterOption()
createTx.clickOnSignTransactionBtn()

navigation.clickOnWalletExpandMoreIcon()
navigation.clickOnDisconnectBtn()
wallet.connectSigner(signer2)
navigation.clickOnWalletExpandMoreIcon()
navigation.clickOnDisconnectBtn()
wallet.connectSigner(signer2)

createTx.deleteTx()
createTx.deleteTx()

getEvents()
checkDataLayerEvents(tx_confirmed)
})
getEvents()
checkDataLayerEvents(tx_confirmed)
},
)
})
2 changes: 0 additions & 2 deletions cypress/e2e/regression/address_book.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ describe('Address book tests', () => {

beforeEach(() => {
cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_4)
cy.clearLocalStorage()
main.acceptCookies()
})

it('Verify owners name can be edited', () => {
Expand Down
3 changes: 0 additions & 3 deletions cypress/e2e/regression/address_book_2.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ describe('Address book tests - 2', () => {

beforeEach(() => {
cy.visit(constants.addressBookUrl + staticSafes.SEP_STATIC_SAFE_4)
cy.clearLocalStorage()
cy.wait(1000)
main.acceptCookies()
})

it('Verify Name and Address columns sorting works', () => {
Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/regression/balances_pagination.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ const ASSETS_LENGTH = 8

describe('Balance pagination tests', () => {
before(() => {
cy.clearLocalStorage()
cy.visit(constants.BALANCE_URL + constants.SEPOLIA_TEST_SAFE_6)
main.acceptCookies()
assets.selectTokenList(assets.tokenListOptions.allTokens)
})

Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/regression/batch_tx.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ describe('Batch transaction tests', () => {
})

beforeEach(() => {
cy.clearLocalStorage()
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_2)
wallet.connectSigner(signer)
owner.waitForConnectionStatus()
main.acceptCookies()
})

it('Verify the Add batch button is present in a transaction form', () => {
Expand Down
4 changes: 0 additions & 4 deletions cypress/e2e/regression/bulk_execution.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ describe('Bulk execution', () => {
})
})

beforeEach(() => {
cy.clearLocalStorage()
})

it('Verify that Bulk Execution is available for a few fully signed txs located one by one', () => {
cy.visit(constants.transactionQueueUrl + fundsSafes.SEP_FUNDS_SAFE_14)
main.acceptCookies()
Expand Down
6 changes: 0 additions & 6 deletions cypress/e2e/regression/create_safe_cf.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ describe('CF Safe regression tests', () => {
})

beforeEach(() => {
cy.clearLocalStorage()
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_0)
main.acceptCookies()
})

it('Verify Add native assets and Create tx modals can be opened', () => {
Expand Down Expand Up @@ -124,10 +122,6 @@ describe('CF Safe regression tests', () => {
it('Verify "Custom transaction" takes to the tx builder app ', () => {
const iframeSelector = `iframe[id="iframe-${constants.TX_Builder_url}"]`
main.addToLocalStorage(constants.localStorageKeys.SAFE_v2__undeployedSafes, ls.undeployedSafe.safe1)
main.addToLocalStorage(
constants.localStorageKeys.SAFE_v2__SafeApps__infoModal,
ls.appPermissions(constants.safeTestAppurl).infoModalAccepted,
)
cy.reload()
wallet.connectSigner(signer)
owner.waitForConnectionStatus()
Expand Down
Loading
Loading