-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: Add more multichain tests (#4522)
* Add more multichain tests
- Loading branch information
Showing
15 changed files
with
341 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import * as constants from '../../support/constants' | ||
import * as main from '../../e2e/pages/main.page' | ||
import * as owner from '../pages/owners.pages' | ||
import * as addressBook from '../pages/address_book.page' | ||
import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' | ||
import * as wallet from '../../support/utils/wallet.js' | ||
import * as createTx from '../pages/create_tx.pages.js' | ||
import * as navigation from '../pages/navigation.page' | ||
import { getEvents, events, checkDataLayerEvents } from '../../support/utils/gtag.js' | ||
|
||
let staticSafes = [] | ||
const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) | ||
const signer = walletCredentials.OWNER_4_PRIVATE_KEY | ||
const signer2 = walletCredentials.OWNER_1_PRIVATE_KEY | ||
|
||
describe('Happy path Add Owners tests', () => { | ||
before(async () => { | ||
staticSafes = await getSafes(CATEGORIES.static) | ||
}) | ||
|
||
beforeEach(() => { | ||
cy.visit(constants.setupUrl + staticSafes.SEP_STATIC_SAFE_4) | ||
cy.contains(owner.safeAccountNonceStr, { timeout: 10000 }) | ||
}) | ||
|
||
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), | ||
}, | ||
] | ||
function step1() { | ||
// Clean txs in the queue | ||
cy.visit(constants.transactionQueueUrl + staticSafes.SEP_STATIC_SAFE_24) | ||
wallet.connectSigner(signer2) | ||
cy.wait(5000) | ||
createTx.deleteAllTx() | ||
navigation.clickOnWalletExpandMoreIcon() | ||
navigation.clickOnDisconnectBtn() | ||
|
||
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) | ||
} | ||
|
||
function step2() { | ||
createTx.clickOnConfirmTransactionBtn() | ||
createTx.clickOnNoLaterOption() | ||
createTx.clickOnSignTransactionBtn() | ||
|
||
navigation.clickOnWalletExpandMoreIcon() | ||
navigation.clickOnDisconnectBtn() | ||
getEvents() | ||
checkDataLayerEvents(tx_confirmed) | ||
wallet.connectSigner(signer2) | ||
createTx.deleteTx() | ||
} | ||
|
||
step1() | ||
cy.get('body').then(($body) => { | ||
if ($body.find(`button:contains("${createTx.executeStr}")`).length > 0) { | ||
navigation.clickOnWalletExpandMoreIcon() | ||
navigation.clickOnDisconnectBtn() | ||
wallet.connectSigner(signer2) | ||
createTx.deleteTx() | ||
cy.wait(5000) | ||
step1() | ||
step2() | ||
} else { | ||
createTx.clickOnConfirmTransactionBtn() | ||
createTx.clickOnNoLaterOption() | ||
createTx.clickOnSignTransactionBtn() | ||
|
||
navigation.clickOnWalletExpandMoreIcon() | ||
navigation.clickOnDisconnectBtn() | ||
getEvents() | ||
checkDataLayerEvents(tx_confirmed) | ||
wallet.connectSigner(signer2) | ||
createTx.deleteTx() | ||
} | ||
}) | ||
}, | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import * as constants from '../../support/constants.js' | ||
import * as main from '../pages/main.page.js' | ||
import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' | ||
import * as wallet from '../../support/utils/wallet.js' | ||
import * as createwallet from '../pages/create_wallet.pages' | ||
import * as createtx from '../pages/create_tx.pages.js' | ||
import * as tx from '../pages/transactions.page.js' | ||
import * as owner from '../pages/owners.pages' | ||
import * as navigation from '../pages/navigation.page.js' | ||
|
||
let staticSafes = [] | ||
|
||
const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) | ||
const signer = walletCredentials.OWNER_4_PRIVATE_KEY | ||
|
||
describe('Happy path Multichain safe creation tests', { defaultCommandTimeout: 60000 }, () => { | ||
before(async () => { | ||
staticSafes = await getSafes(CATEGORIES.static) | ||
}) | ||
|
||
beforeEach(() => { | ||
cy.visit(constants.welcomeUrl + '?chain=sep') | ||
cy.wait(2000) | ||
wallet.connectSigner(signer) | ||
}) | ||
|
||
it('Verify that L2 safe created during multichain safe creation has 1.4.1 L2 contract after deployment', () => { | ||
createwallet.clickOnContinueWithWalletBtn() | ||
createwallet.clickOnCreateNewSafeBtn() | ||
createwallet.clickOnNetwrokRemoveIcon() | ||
createwallet.selectMultiNetwork(1, constants.networks.ethereum.toLowerCase()) | ||
createwallet.selectMultiNetwork(1, constants.networks.sepolia.toLowerCase()) | ||
createwallet.selectMultiNetwork(1, constants.networks.polygon.toLowerCase()) | ||
createwallet.clickOnNextBtn() | ||
createwallet.clickOnNextBtn() | ||
createwallet.clickOnReviewStepNextBtn() | ||
createwallet.clickOnLetsGoBtn() | ||
|
||
cy.url().then((currentUrl) => { | ||
const safe = `sep:${main.getSafeAddressFromUrl(currentUrl)}` | ||
cy.visit(constants.homeUrl + safe) | ||
createwallet.clickOnActivateAccountBtn(0) | ||
createwallet.selectRelayOption() | ||
createwallet.clickOnFinalActivateAccountBtn() | ||
createwallet.clickOnLetsGoBtn() | ||
cy.visit(constants.setupUrl + safe) | ||
main.verifyValuesExist(navigation.setupSection, [constants.safeContractVersions.v1_4_1_L2]) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import * as constants from '../../support/constants.js' | ||
import * as main from '../pages/main.page.js' | ||
import * as swaps from '../pages/swaps.pages.js' | ||
import * as tx from '../pages/transactions.page.js' | ||
import * as create_tx from '../pages/create_tx.pages.js' | ||
import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js' | ||
import * as owner from '../pages/owners.pages' | ||
import * as wallet from '../../support/utils/wallet.js' | ||
import * as swaps_data from '../../fixtures/swaps_data.json' | ||
import * as navigation from '../pages/navigation.page' | ||
import { getEvents, events, checkDataLayerEvents } from '../../support/utils/gtag.js' | ||
|
||
const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS')) | ||
const signer = walletCredentials.OWNER_4_PRIVATE_KEY | ||
const signer2 = walletCredentials.OWNER_3_WALLET_ADDRESS | ||
const signer3 = walletCredentials.OWNER_1_PRIVATE_KEY | ||
|
||
let staticSafes = [] | ||
|
||
let iframeSelector | ||
|
||
const swapOrder = swaps_data.type.orderDetails | ||
|
||
describe('Happy path Swaps tests', () => { | ||
before(async () => { | ||
staticSafes = await getSafes(CATEGORIES.static) | ||
}) | ||
|
||
beforeEach(() => { | ||
cy.visit(constants.swapUrl + staticSafes.SEP_STATIC_SAFE_1) | ||
main.waitForHistoryCallToComplete() | ||
wallet.connectSigner(signer) | ||
iframeSelector = `iframe[src*="${constants.swapWidget}"]` | ||
}) | ||
|
||
it( | ||
'Verify an order can be created, signed by second signer and deleted. GA tx_confirm, tx_created', | ||
{ defaultCommandTimeout: 30000 }, | ||
() => { | ||
const tx_created = [ | ||
{ | ||
eventLabel: events.txCreatedSwap.eventLabel, | ||
eventCategory: events.txCreatedSwap.category, | ||
eventType: events.txCreatedSwap.eventType, | ||
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_30.slice(6), | ||
}, | ||
] | ||
// Clean txs in the queue | ||
cy.visit(constants.transactionQueueUrl + staticSafes.SEP_STATIC_SAFE_30) | ||
cy.wait(5000) | ||
create_tx.deleteAllTx() | ||
|
||
cy.visit(constants.swapUrl + staticSafes.SEP_STATIC_SAFE_30) | ||
swaps.acceptLegalDisclaimer() | ||
cy.wait(4000) | ||
main.getIframeBody(iframeSelector).within(() => { | ||
swaps.clickOnSettingsBtn() | ||
swaps.setSlippage('0.30') | ||
swaps.setExpiry('2') | ||
swaps.clickOnSettingsBtn() | ||
swaps.selectInputCurrency(swaps.swapTokens.cow) | ||
swaps.setInputValue(200) | ||
swaps.selectOutputCurrency(swaps.swapTokens.dai) | ||
swaps.clickOnExceeFeeChkbox() | ||
swaps.clickOnSwapBtn() | ||
swaps.clickOnSwapBtn() | ||
}) | ||
create_tx.changeNonce(0) | ||
create_tx.clickOnSignTransactionBtn() | ||
create_tx.clickViewTransaction() | ||
navigation.clickOnWalletExpandMoreIcon() | ||
navigation.clickOnDisconnectBtn() | ||
wallet.connectSigner(signer3) | ||
|
||
cy.wait(5000) | ||
create_tx.verifyConfirmTransactionBtnIsVisible() | ||
create_tx.clickOnConfirmTransactionBtn() | ||
create_tx.clickOnNoLaterOption() | ||
|
||
create_tx.clickOnSignTransactionBtn() | ||
navigation.clickOnWalletExpandMoreIcon() | ||
navigation.clickOnDisconnectBtn() | ||
wallet.connectSigner(signer) | ||
create_tx.deleteTx() | ||
|
||
getEvents() | ||
checkDataLayerEvents(tx_created) | ||
checkDataLayerEvents(tx_confirmed) | ||
}, | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.