mirror of
https://github.com/luxfi/safe-wallet.git
synced 2026-10-30 15:19:21 +00:00
* tests(e2e): update hidden tokens tests * tests(e2e): default tokens set up for nested safes tests * tests(e2e): update swap tokens tests * tests(e2e): update notifications and proposers tests * tests(e2e): new main function and small fixes * tests(e2e): add ls set up for nested safe creation tests * tests(e2e): fixComments * tests(e2e): fix for smoke test with image * tests(e2e): remove logo check * tests(e2e): fixe for the image * tests(e2e): update verifySummaryByName function * tests(e2e): update verifyTokenSymbol function to more general solution * tests(e2e): remove Perl from new endpoints test * tests(e2e): removed unused test and update hidentoken function * tests(e2e): update create tx functions and fix create_tx_2 test * tests(e2e): update selector for the logos * tests(e2e): update number of button and list of pages
58 lines
1.9 KiB
JavaScript
58 lines
1.9 KiB
JavaScript
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 assets from '../pages/assets.pages.js'
|
|
import { getSafes, CATEGORIES } from '../../support/safes/safesHandler.js'
|
|
import * as wallet from '../../support/utils/wallet.js'
|
|
import * as ls from '../../support/localstorage_data.js'
|
|
|
|
let staticSafes = []
|
|
const walletCredentials = JSON.parse(Cypress.env('CYPRESS_WALLET_CREDENTIALS'))
|
|
const signer = walletCredentials.OWNER_4_PRIVATE_KEY
|
|
|
|
let iframeSelector = `iframe[src*="${constants.swapWidget}"]`
|
|
|
|
describe('Swaps token tests', () => {
|
|
before(async () => {
|
|
staticSafes = await getSafes(CATEGORIES.static)
|
|
})
|
|
|
|
beforeEach(() => {
|
|
cy.visit(constants.BALANCE_URL + staticSafes.SEP_STATIC_SAFE_1)
|
|
assets.toggleShowAllTokens(true)
|
|
assets.toggleHideDust(false)
|
|
})
|
|
|
|
// Added to prod
|
|
it(
|
|
'Verify that clicking the swap from assets tab, autofills that token automatically in the form',
|
|
{ defaultCommandTimeout: 30000 },
|
|
() => {
|
|
wallet.connectSigner(signer)
|
|
swaps.clickOnAssetSwapBtn(0)
|
|
swaps.acceptLegalDisclaimer()
|
|
cy.wait(2000)
|
|
main.getIframeBody(iframeSelector).within(() => {
|
|
swaps.verifySelectedInputCurrancy(swaps.swapTokens.eth)
|
|
})
|
|
},
|
|
)
|
|
|
|
it('Verify swap button are displayed in assets table and dashboard', () => {
|
|
assets.toggleShowAllTokens(true)
|
|
assets.toggleHideDust(false)
|
|
swaps.verifyAssetsPageSwapButtonsCount(4)
|
|
|
|
cy.window().then((window) => {
|
|
window.localStorage.setItem(
|
|
constants.localStorageKeys.SAFE_v2__settings,
|
|
JSON.stringify(ls.safeSettings.slimitSettings),
|
|
)
|
|
})
|
|
|
|
cy.visit(constants.homeUrl + staticSafes.SEP_STATIC_SAFE_1)
|
|
swaps.verifyDashboardPageSwapButtonsCount(4)
|
|
main.verifyElementsCount(swaps.dashboardSwapBtn, 1)
|
|
})
|
|
})
|