Skip to content

Commit

Permalink
Tests: E2e Assets - Adding the token test file (#3077)
Browse files Browse the repository at this point in the history
* remove balances file, add tokens file

* remove 'only' from test

* Send button disabled verification

* solving clonflict with test safes

* fix balances test

* Change safe in token test

* adding verifyOwner method

* renaming method
  • Loading branch information
francovenica authored Feb 1, 2024
1 parent 81713cb commit 16cd21a
Show file tree
Hide file tree
Showing 8 changed files with 228 additions and 343 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as main from '../pages/main.page'
import * as main from './main.page'

let etherscanLink = 'a[aria-label="View on sepolia.etherscan.io"]'
let etherscanLinkSepolia = 'a[aria-label="View on sepolia.etherscan.io"]'
export const balanceSingleRow = '[aria-labelledby="tableTitle"] > tbody tr'
const currencyDropdown = '[id="currency"]'
Expand Down Expand Up @@ -109,6 +108,10 @@ export function showSendBtn(index) {
})
}

export function VerifySendButtonIsDisabled() {
cy.get('button').contains(sendBtnStr).should('be.disabled')
}

export function verifyTableRows(assetsLength) {
cy.get(balanceSingleRow).should('have.length', assetsLength)
}
Expand Down Expand Up @@ -207,14 +210,14 @@ export function verityTokenAltImageIsVisible(currency, alttext) {
})
}

export function verifyAssetNameHasExplorerLink(currency, columnName, sepolia = false) {
if (sepolia) etherscanLink = etherscanLinkSepolia
export function verifyAssetNameHasExplorerLink(currency, columnName) {
etherscanLinkSepolia
cy.get(tokenListTable)
.contains(currency)
.parents('tr')
.find('td')
.eq(columnName)
.find(etherscanLink)
.find(etherscanLinkSepolia)
.should('be.visible')
}

Expand All @@ -225,7 +228,7 @@ export function verifyAssetExplorerLinkNotAvailable(currency, columnName) {
.find('td')
.eq(columnName)
.within(() => {
cy.get(etherscanLink).should('not.exist')
cy.get(etherscanLinkSepolia).should('not.exist')
})
}

Expand Down
5 changes: 5 additions & 0 deletions cypress/e2e/pages/main.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as constants from '../../support/constants'

const acceptSelection = 'Save settings'
const executeStr = 'Execute'
const connectedOwnerBlock = '[data-testid="open-account-center"]'
export const modalDialogCloseBtn = '[data-testid="modal-dialog-close-btn"]'

export function clickOnExecuteBtn() {
Expand Down Expand Up @@ -41,6 +42,10 @@ export function acceptCookies(index = 0) {
})
}

export function verifyOwnerConnected(prefix = 'sep:') {
cy.get(connectedOwnerBlock).should('contain', prefix)
}

export function verifyHomeSafeUrl(safe) {
cy.location('href', { timeout: 10000 }).should('include', constants.homeUrl + safe)
}
Expand Down
185 changes: 0 additions & 185 deletions cypress/e2e/regression/assets.cy.js

This file was deleted.

125 changes: 0 additions & 125 deletions cypress/e2e/regression/balances.cy.js

This file was deleted.

Loading

0 comments on commit 16cd21a

Please sign in to comment.