-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'safe-global:dev' into dev
- Loading branch information
Showing
32 changed files
with
548 additions
and
219 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,65 @@ | ||
name: Full Regression on demand tests | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 4 * * 1-5' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
e2e: | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 40 | ||
name: Cypress Full Regression on demand tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
containers: [1, 2, 3, 4, 5] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: ./.github/workflows/cypress | ||
with: | ||
secrets: ${{ toJSON(secrets) }} | ||
spec: | | ||
cypress/e2e/happypath_2/*.cy.js | ||
cypress/e2e/regression/*.cy.js | ||
cypress/e2e/safe-apps/*.cy.js | ||
cypress/e2e/smoke/*.cy.js | ||
group: 'Full Regression on demand tests' | ||
tag: 'full_regression' | ||
|
||
- name: Python setup | ||
if: always() | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install junitparser | ||
if: always() | ||
run: | | ||
pip install junitparser | ||
- name: Merge JUnit reports for TestRail | ||
if: always() | ||
run: | | ||
junitparser merge --suite-name "Root Suite" --glob "reports/junit-*" "reports/junit-report.xml" | ||
- name: TestRail CLI upload results | ||
if: always() | ||
run: | | ||
pip install trcli | ||
if ! trcli -y \ | ||
-h https://gno.testrail.io/ \ | ||
--project "Safe- Web App" \ | ||
--username ${{ secrets.TESTRAIL_USERNAME }} \ | ||
--password ${{ secrets.TESTRAIL_PASSWORD }} \ | ||
parse_junit \ | ||
--title "Full Regression Automated Tests, branch: ${GITHUB_REF_NAME}" \ | ||
--run-description ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \ | ||
-f "reports/junit-report.xml"; then | ||
echo -e "\e[41;32mTestRail upload failed. Pipeline will continue, please check the upload process.\e[0m" | ||
fi |
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.