diff --git a/cypress/e2e/specs/ethereum/connect-wallet.e2e-spec.cy.ts b/cypress/e2e/specs/ethereum/connect-wallet.e2e-spec.cy.ts deleted file mode 100644 index 71fd1b0464..0000000000 --- a/cypress/e2e/specs/ethereum/connect-wallet.e2e-spec.cy.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { tag } from '../../pages/swap-page.po.cy' -import { homePage, network, wallet } from '../../selectors/selectors.cy' - -const chainList = [ - 'BNB', - 'Polygon', - 'Avalanche', - 'Arbitrum', - 'Optimism', - 'BitTorrent', - 'Oasis', - 'Fantom', - 'Cronos', - 'Velas', - 'Aurora', -] - -describe('Metamask Extension tests', () => { - beforeEach(() => { - cy.visit('/') - cy.clickButton(homePage.skipTutorial) - cy.get(wallet.btnConnectWallet).should('be.visible').click() - cy.connectWallet() - }) - - it('Redirects to swap page when a user has already connected a wallet', { tags: tag.regression }, () => { - cy.acceptMetamaskAccess() - cy.get(wallet.statusConnected, { timeout: 10000 }).should('be.visible') - cy.url().should('include', '/swap') - }) - - it.skip('Should approve permission to switch network', { tags: tag.regression }, () => { - cy.get(wallet.statusConnected, { timeout: 10000 }).should('be.visible') - chainList.forEach(element => { - cy.clickButton(network.btnSelectNetwork) - cy.get(network.btnNetwork).contains(element).click({ force: true }) - cy.allowMetamaskToAddAndSwitchNetwork().then(approved => { - expect(approved).to.be.true - }) - cy.url().should('include', '/swap/' + element.toLowerCase()) - }) - }) -}) diff --git a/cypress/e2e/specs/ethereum/intercept.e2e-spec.cy.ts b/cypress/e2e/specs/ethereum/intercept.e2e-spec.cy.ts deleted file mode 100644 index a0918db908..0000000000 --- a/cypress/e2e/specs/ethereum/intercept.e2e-spec.cy.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { tag } from '../../pages/swap-page.po.cy' -import { homePage, menu, network } from '../../selectors/selectors.cy' - -const mainPage = 'swap/ethereum' -describe('Intercept', { tags: tag.regression }, () => { - beforeEach(() => { - cy.visit('/') - cy.url().should('include', mainPage) - cy.clickButton(homePage.skipTutorial) - }) - describe('Swap', { tags: tag.smoke }, () => { - it('Should get route successfully', () => { - cy.intercept('GET', '**/routes?**').as('get-route') - cy.wait('@get-route', { timeout: 20000 }).its('response.statusCode').should('be.oneOf', [200, 404, 408]) - }) - }) - - describe('Pools', () => { - it('Should get pool, farm list successfully', () => { - cy.intercept('GET', '**/farm-pools?**').as('get-farm-list') - cy.intercept('GET', '**/pools?**').as('get-pool-list') - cy.intercept('GET', '**/block?**').as('get-block') - cy.get(menu.earnMenu).click({ force: true }) - cy.get(menu.poolMenu).click({ force: true }) - cy.wait('@get-farm-list', { timeout: 5000 }).its('response.statusCode').should('equal', 200) - cy.wait('@get-pool-list', { timeout: 5000 }).its('response.statusCode').should('equal', 200) - cy.wait('@get-block', { timeout: 5000 }).its('response.statusCode').should('equal', 200) - }) - }) - - describe('My Pools', () => { - it('Should get farm list successfully', () => { - cy.intercept('GET', '**/farm-pools?**').as('get-farm-list') - cy.get(menu.earnMenu).click({ force: true }) - cy.get(menu.myPoolMenu).click({ force: true }) - cy.wait('@get-farm-list', { timeout: 5000 }).its('response.statusCode').should('equal', 200) - }) - }) - - describe('Farms', () => { - it('Should get pool, farm list successfully', () => { - cy.intercept('GET', '**/farm-pools?**').as('get-farm-list') - cy.intercept('GET', '**/pools?**').as('get-pool-list') - cy.intercept('GET', '**/block?**').as('get-block') - cy.get(menu.earnMenu).click({ force: true }) - cy.get(menu.farmMenu).click({ force: true }) - cy.get('[data-testid=farm-block]') - .should(_ => {}) - .then($list => { - if ($list.length) { - cy.wait('@get-pool-list', { timeout: 5000 }).its('response.statusCode').should('equal', 200) - } - cy.wait('@get-farm-list', { timeout: 5000 }).its('response.statusCode').should('equal', 200) - cy.wait('@get-block', { timeout: 5000 }).its('response.statusCode').should('equal', 200) - }) - }) - }) -}) diff --git a/cypress/e2e/specs/ethereum/swap-page.e2e-spec.cy.ts b/cypress/e2e/specs/ethereum/swap-page.e2e-spec.cy.ts deleted file mode 100644 index bbb3cf8b19..0000000000 --- a/cypress/e2e/specs/ethereum/swap-page.e2e-spec.cy.ts +++ /dev/null @@ -1,195 +0,0 @@ -import { homePage, tab, token } from '../../selectors/selectors.cy' - -const mainPage = 'swap/ethereum' -const tokenSymbol = ['BAND', 'DAI', 'USDT', 'USDC'] -const unListedToken = ['KNNC', 'KCCN'] - -const unWhiteListedToken = { - SCOOBY: { - name: 'SCOOBY', - address: '0xAd497eE6a70aCcC3Cbb5eB874e60d87593B86F2F', - }, - UNIBOT: { - name: 'UNIBOT', - address: '0x25127685dc35d4dc96c7feac7370749d004c5040', - }, - BGB: { - name: 'BGB', - address: '0x19de6b897ed14a376dda0fe53a5420d2ac828a28', - }, -} - -describe('Token Catalog', () => { - beforeEach(() => { - cy.visit('/') - cy.url().should('include', mainPage) - cy.clickButton(homePage.skipTutorial) - }) - describe('Select token in favorite tokens list', () => { - it('Should be selected tokenIn in favorite tokens list successfully', { tags: 'regression' }, () => { - cy.clickButton(token.tokenIn) - cy.selectTokenInFavoriteTokensList(token.favoriteToken, tokenSymbol[1]) - cy.verifySelectedToken(token.tokenIn, tokenSymbol[1]) - cy.verifyURL(tokenSymbol[1], '') - }) - - it('Should be selected tokenOut in favorite tokens list successfully', { tags: 'regression' }, () => { - cy.clickButton(token.tokenOut) - cy.selectTokenInFavoriteTokensList(token.favoriteToken, tokenSymbol[1]) - cy.verifySelectedToken(token.tokenOut, tokenSymbol[1]) - cy.verifyURL('', tokenSymbol[1]) - }) - }) - - describe('Remove/add token with favorite tokens list', () => { - it('Should be removed tokenIn from favorite tokens list', { tags: 'regression' }, () => { - cy.clickButton(token.tokenIn) - cy.verifyValueInList(token.favoriteToken, [tokenSymbol[3]], true) - cy.removeTokenInFavoriteTokensList(tokenSymbol[3]) - cy.wait(2000) - cy.verifyValueInList(token.favoriteToken, [tokenSymbol[3]], false) - cy.input(token.inputToken, tokenSymbol[3]) - cy.verifyIcon('false') - }) - - it('Should be added tokenIn to favorite tokens list', { tags: 'regression' }, () => { - cy.clickButton(token.tokenIn) - cy.addTokenToFavoriteTokensList(tokenSymbol[0]) - cy.verifyIcon('true') - cy.verifyValueInList(token.favoriteToken, [tokenSymbol[0]], true) - }) - - it('Should be removed tokenOut from favorite tokens list', { tags: 'regression' }, () => { - cy.clickButton(token.tokenOut) - cy.verifyValueInList(token.favoriteToken, [tokenSymbol[2]], true) - cy.removeTokenInFavoriteTokensList(tokenSymbol[2]) - cy.wait(2000) - cy.verifyValueInList(token.favoriteToken, [tokenSymbol[2]], false) - cy.input(token.inputToken, tokenSymbol[2]) - cy.verifyIcon('false') - }) - - it('Should be added tokenOut to favorite tokens list', { tags: 'regression' }, () => { - cy.clickButton(token.tokenOut) - cy.addTokenToFavoriteTokensList(tokenSymbol[0]) - cy.verifyIcon('true') - cy.verifyValueInList(token.favoriteToken, [tokenSymbol[0]], true) - }) - }) - - describe('Select token by symbol', () => { - it('Should be selected tokenIn by symbol successfully', { tags: 'regression' }, () => { - cy.clickButton(token.tokenIn) - cy.selectTokenBySymbol(token.inputToken, tokenSymbol[0]) - cy.verifySelectedToken(token.tokenIn, tokenSymbol[0]) - cy.verifyURL(tokenSymbol[0], '') - }) - - it('Should be selected tokenOut by symbol successfully', { tags: 'regression' }, () => { - cy.clickButton(token.tokenOut) - cy.selectTokenBySymbol(token.inputToken, tokenSymbol[1]) - cy.verifySelectedToken(token.tokenOut, tokenSymbol[1]) - cy.verifyURL('', tokenSymbol[1]) - }) - - it('Should be unselected tokenIn not exist in whitelist', { tags: 'regression' }, () => { - cy.clickButton(token.tokenIn) - cy.input(token.inputToken, unListedToken[0]) - cy.verifyNoResultFound() - }) - - it('Should be unselected tokenOut not exist in whitelist', { tags: 'regression' }, () => { - cy.clickButton(token.tokenOut) - cy.input(token.inputToken, unListedToken[1]) - cy.verifyNoResultFound() - }) - }) - - describe('Import token', () => { - it('Should be imported tokenIn successfully', { tags: 'regression' }, () => { - cy.importNewTokenByAddress(token.tokenIn, unWhiteListedToken.SCOOBY.address) - cy.verifySelectedToken(token.tokenIn, unWhiteListedToken.SCOOBY.name) - cy.clickButton(token.tokenIn) - cy.clickButton(tab.import) - cy.verifyValueInList(token.rowInWhiteList, [unWhiteListedToken.SCOOBY.name], true) - }) - - it('Should be imported tokenOut successfully', { tags: 'regression' }, () => { - cy.importNewTokenByAddress(token.tokenOut, unWhiteListedToken.UNIBOT.address) - cy.verifySelectedToken(token.tokenOut, unWhiteListedToken.UNIBOT.name) - cy.clickButton(token.tokenOut) - cy.clickButton(tab.import) - cy.verifyValueInList(token.rowInWhiteList, [unWhiteListedToken.UNIBOT.name], true) - }) - }) - - describe('Delete token', () => { - it('Should be deleted the imported tokenIn successfully', { tags: 'regression' }, () => { - cy.importNewTokenByAddress(token.tokenIn, unWhiteListedToken.SCOOBY.address) - cy.clickButton(token.tokenIn) - cy.clickButton(tab.import) - cy.verifyValueInList(token.rowInWhiteList, [unWhiteListedToken.SCOOBY.name], true) - cy.deleteImportedToken(unWhiteListedToken.SCOOBY.address) - cy.verifyNoResultFound() - }) - - it('Should be deleted the imported tokenOut successfully', { tags: 'regression' }, () => { - cy.importNewTokenByAddress(token.tokenOut, unWhiteListedToken.SCOOBY.address) - cy.clickButton(token.tokenOut) - cy.clickButton(tab.import) - cy.verifyValueInList(token.rowInWhiteList, [unWhiteListedToken.SCOOBY.name], true) - cy.deleteImportedToken(unWhiteListedToken.SCOOBY.address) - cy.verifyNoResultFound() - }) - - it('Should be cleared all the imported tokenIn successfully', { tags: 'regression' }, () => { - cy.importNewTokenByAddress(token.tokenIn, unWhiteListedToken.SCOOBY.address) - cy.importNewTokenByAddress(token.tokenIn, unWhiteListedToken.BGB.address) - cy.importNewTokenByAddress(token.tokenIn, unWhiteListedToken.UNIBOT.address) - cy.clickButton(token.tokenIn) - cy.clickButton(tab.import) - cy.verifyValueInList( - token.rowInWhiteList, - [unWhiteListedToken.SCOOBY.name, unWhiteListedToken.BGB.name, unWhiteListedToken.UNIBOT.name], - true, - ) - cy.clearAllImportedTokens() - cy.verifyNoResultFound() - }) - - it('Should be cleared all the imported tokenOut successfully', { tags: 'regression' }, () => { - cy.importNewTokenByAddress(token.tokenOut, unWhiteListedToken.SCOOBY.address) - cy.importNewTokenByAddress(token.tokenOut, unWhiteListedToken.BGB.address) - cy.importNewTokenByAddress(token.tokenOut, unWhiteListedToken.UNIBOT.address) - cy.clickButton(token.tokenOut) - cy.clickButton(tab.import) - cy.verifyValueInList( - token.rowInWhiteList, - [unWhiteListedToken.SCOOBY.name, unWhiteListedToken.BGB.name, unWhiteListedToken.UNIBOT.name], - true, - ) - cy.clearAllImportedTokens() - cy.verifyNoResultFound() - }) - }) - - describe('E2E Token Catalog', () => { - it('Should be selected tokenIn and tokenOut to swap', { tags: ['smoke', 'regression'] }, () => { - //select tokenIn - cy.clickButton(token.tokenIn) - cy.selectTokenInFavoriteTokensList(token.favoriteToken, tokenSymbol[1]) - cy.verifySelectedToken(token.tokenIn, tokenSymbol[1]) - //select tokenOut - cy.importNewTokenByAddress(token.tokenOut, unWhiteListedToken.SCOOBY.address) - cy.verifySelectedToken(token.tokenOut, unWhiteListedToken.SCOOBY.name) - cy.verifyURL(tokenSymbol[1], unWhiteListedToken.SCOOBY.name) - //delete imported tokenOut - cy.clickButton(token.tokenOut) - cy.clickButton(tab.import) - cy.verifyValueInList(token.rowInWhiteList, [unWhiteListedToken.SCOOBY.name], true) - cy.deleteImportedToken(unWhiteListedToken.SCOOBY.address) - cy.verifyNoResultFound() - cy.get(token.tokenOut).should('include.text', 'Select a token') - }) - }) -})