Skip to content

Commit

Permalink
Tests: Fix regression tests (#4507)
Browse files Browse the repository at this point in the history
* Update tests
  • Loading branch information
mike10ca authored Nov 8, 2024
1 parent b9b0567 commit 844e44e
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 15 deletions.
1 change: 1 addition & 0 deletions cypress/e2e/pages/batches.pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export function addToBatch(EOA, currentNonce, amount, verify = false) {
executeTransaction()
}
addToBatchButton()
cy.contains(transactionAddedToBatchStr).click().should('not.be.visible')
}

function fillTransactionData(EOA, amount) {
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/regression/add_owner.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ describe('Add Owners tests', () => {
wallet.connectSigner(signer2)
cy.wait(5000)
createTx.deleteAllTx()
navigation.clickOnWalletExpandMoreIcon()
navigation.clickOnDisconnectBtn()

cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_24)
wallet.connectSigner(signer2)
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/regression/batch_tx.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS'))
const signer = walletCredentials.OWNER_4_PRIVATE_KEY
const signer2 = walletCredentials.OWNER_3_PRIVATE_KEY

describe('Batch transaction tests', () => {
describe('Batch transaction tests', { defaultCommandTimeout: 30000 }, () => {
before(async () => {
staticSafes = await getSafes(CATEGORIES.static)
})
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/regression/multichain_networkswitch.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const signer = walletCredentials.OWNER_4_PRIVATE_KEY
// DO NOT use OWNER_2_PRIVATE_KEY for safe creation. Used for CF safes.
const signer2 = walletCredentials.OWNER_2_PRIVATE_KEY

describe('Multichain header network switch tests', { defaultCommandTimeout: 20000 }, () => {
describe('Multichain header network switch tests', { defaultCommandTimeout: 30000 }, () => {
before(async () => {
staticSafes = await getSafes(CATEGORIES.static)
})
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/regression/multichain_sidebar.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const signer = walletCredentials.OWNER_4_PRIVATE_KEY
// DO NOT use OWNER_2_PRIVATE_KEY for safe creation. Used for CF safes.
const signer2 = walletCredentials.OWNER_2_PRIVATE_KEY

describe('Multichain sidebar tests', () => {
describe('Multichain sidebar tests', { defaultCommandTimeout: 20000 }, () => {
before(async () => {
staticSafes = await getSafes(CATEGORIES.static)
})
Expand Down Expand Up @@ -119,7 +119,7 @@ describe('Multichain sidebar tests', () => {
it('Verify balance of the safe group', () => {
wallet.connectSigner(signer)
sideBar.openSidebar()
sideBar.checkSafeGroupBalance(0, '0.62')
sideBar.checkSafeGroupBalance(0, '0.64')
})

it('Verify address of the safe group', () => {
Expand Down
13 changes: 6 additions & 7 deletions cypress/e2e/regression/swaps.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,23 +168,23 @@ describe('Swaps tests', () => {
eventLabel: events.txCreatedSwap.eventLabel,
eventCategory: events.txCreatedSwap.category,
eventType: events.txCreatedSwap.eventType,
safeAddress: staticSafes.SEP_STATIC_SAFE_1.slice(6),
safeAddress: staticSafes.SEP_STATIC_SAFE_30.slice(6),
},
]
const tx_confirmed = [
{
eventLabel: events.txConfirmedSwap.eventLabel,
eventCategory: events.txConfirmedSwap.category,
eventType: events.txConfirmedSwap.eventType,
safeAddress: staticSafes.SEP_STATIC_SAFE_1.slice(6),
safeAddress: staticSafes.SEP_STATIC_SAFE_30.slice(6),
},
]
// Clean txs in the queue
cy.visit(constants.transactionQueueUrl + staticSafes.SEP_STATIC_SAFE_1)
cy.visit(constants.transactionQueueUrl + staticSafes.SEP_STATIC_SAFE_30)
cy.wait(5000)
create_tx.deleteAllTx()

cy.visit(constants.swapUrl + staticSafes.SEP_STATIC_SAFE_1)
cy.visit(constants.swapUrl + staticSafes.SEP_STATIC_SAFE_30)
swaps.acceptLegalDisclaimer()
cy.wait(4000)
main.getIframeBody(iframeSelector).within(() => {
Expand All @@ -193,14 +193,13 @@ describe('Swaps tests', () => {
swaps.setExpiry('2')
swaps.clickOnSettingsBtn()
swaps.selectInputCurrency(swaps.swapTokens.cow)
swaps.checkTokenBalance(staticSafes.SEP_STATIC_SAFE_1.substring(4), swaps.swapTokens.cow)
swaps.setInputValue(100)
swaps.setInputValue(200)
swaps.selectOutputCurrency(swaps.swapTokens.dai)
swaps.clickOnExceeFeeChkbox()
swaps.clickOnSwapBtn()
swaps.clickOnSwapBtn()
})
create_tx.changeNonce(24)
create_tx.changeNonce(0)
create_tx.clickOnSignTransactionBtn()
create_tx.clickViewTransaction()
navigation.clickOnWalletExpandMoreIcon()
Expand Down
3 changes: 1 addition & 2 deletions cypress/e2e/smoke/batch_tx.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const funds_second_tx = '0.002'
const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS'))
const signer = walletCredentials.OWNER_4_PRIVATE_KEY

describe('[SMOKE] Batch transaction tests', () => {
describe('[SMOKE] Batch transaction tests', { defaultCommandTimeout: 30000 }, () => {
before(async () => {
staticSafes = await getSafes(CATEGORIES.static)
})
Expand All @@ -32,7 +32,6 @@ describe('[SMOKE] Batch transaction tests', () => {
it('[SMOKE] Verify a transaction can be added to the batch', () => {
wallet.connectSigner(signer)
batch.addNewTransactionToBatch(constants.EOA, currentNonce, funds_first_tx)
cy.contains(batch.transactionAddedToBatchStr).should('be.visible')
batch.verifyBatchIconCount(1)
batch.clickOnBatchCounter()
batch.verifyAmountTransactionsInBatch(1)
Expand Down
3 changes: 2 additions & 1 deletion cypress/fixtures/safes/static.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"SEP_STATIC_SAFE_26": "sep:0x755428b02A458eD17fa93c86F6C3a2046F2c4C3C",
"SEP_STATIC_SAFE_27": "sep:0xC97FCf0B8890a5a7b1a1490d44Dc9EbE3cE04884",
"MATIC_STATIC_SAFE_28": "matic:0xC96ee38f5A73C8A70b565CB8EA938D2aF913ee3B",
"ZKSYNC_STATIC_SAFE_29": "zksync:0x950e07c80d7Bb754CcD84afE2b7751dc7Fd65D1f"
"ZKSYNC_STATIC_SAFE_29": "zksync:0x950e07c80d7Bb754CcD84afE2b7751dc7Fd65D1f",
"SEP_STATIC_SAFE_30": "sep:0x2687E6643E189c1245EA8419e5e427809136021F"
}
1 change: 1 addition & 0 deletions cypress/support/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const balanceNftsUrl = '/balances/nfts?safe='
export const transactionQueueUrl = '/transactions/queue?safe='
export const transactionsHistoryUrl = '/transactions/history?safe='
export const transactionsMessagesUrl = '/transactions/messages?safe='
export const transactionsQueued = 'transactions/queued'
export const transactionUrl = '/transactions/tx?safe='
export const openAppsUrl = '/apps/open?safe='
export const homeUrl = '/home?safe='
Expand Down
8 changes: 7 additions & 1 deletion cypress/support/utils/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ export function connectSigner(signer) {
function handlePkConnect() {
cy.get('body').then(($body) => {
if ($body.find(pkConnectBtn).length > 0) {
cy.get(pkInput).find('input').clear().type(signer, { log: false, force: true })
cy.get(pkInput)
.find('input')
.then(($input) => {
$input.val(signer)
cy.wrap($input).trigger('input').trigger('change')
})

cy.get(pkConnectBtn).click()
}
})
Expand Down

0 comments on commit 844e44e

Please sign in to comment.