Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E - Update failed tests #2396

Merged
merged 10 commits into from
Nov 22, 2023
1 change: 1 addition & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,6 @@ export default defineConfig({
})
},
specPattern: 'cypress/e2e/specs/*.e2e.cy.ts',
excludeSpecPattern: '*/*/**/zap.e2e.cy.ts',
},
})
10 changes: 5 additions & 5 deletions cypress/e2e/selectors/constants.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export enum TAG {
}

export const TOKEN_SYMBOLS = {
Ethereum: ['BAND', 'wstETH', 'USDT', 'USDC', '1INCH'],
Arbitrum: ['ANGLE', 'ARB', 'USDT', 'USDC.e', 'BOB'],
Optimism: ['BOND', 'wstETH', 'USDT', 'USDC', 'BOB'],
Avalanche: ['AAVE.e', 'sAVAX', 'USDT.e', 'USDC.e', 'BUSD.e'],
BNB: ['RICE', 'BUSD', 'USDT', 'USDC', 'BOB'],
Ethereum: ['BAND', 'wstETH', 'USDT', 'AAVE', '1INCH'],
Arbitrum: ['ANGLE', 'ARB', 'USDT', 'ANGLE', 'BOB'],
Optimism: ['BOND', 'WETH', 'USDT', 'AAVE', 'BOB'],
Avalanche: ['AAVE.e', 'sAVAX', 'USDT.e', 'ANGLE', 'BUSD.e'],
BNB: ['RICE', 'BUSD', 'USDT', 'AAVE', 'BOB'],
}

export const NETWORK_LIST = [
Expand Down
10 changes: 5 additions & 5 deletions cypress/e2e/specs/intercept.e2e.cy.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/* eslint-disable @typescript-eslint/no-empty-function */
import { FarmPage } from "../pages/farm-page.po.cy";
import { SwapPage, TokenCatalog } from "../pages/swap-page.po.cy"
import { DEFAULT_URL, TAG, } from "../selectors/constants.cy"
import { HeaderLocators } from "../selectors/selectors.cy"
const tokenCatalog = new TokenCatalog()
const farm = new FarmPage()

describe('Intercept', { tags: TAG.regression }, () => {
before(() => {
beforeEach(() => {
SwapPage.open(DEFAULT_URL)
})

afterEach(() => {
cy.reload()
cy.clearCookies();
cy.clearLocalStorage();
})

describe('Swap', () => {
it('Should get route successfully', () => {
cy.intercept('GET', '**/routes?**').as('get-route')
Expand Down Expand Up @@ -60,7 +60,7 @@ describe('Intercept', { tags: TAG.regression }, () => {
cy.intercept('GET', '**/pools?**').as('get-pool-list')
SwapPage.goToFarmPage()
cy.get('[data-testid=farm-block]')
.should(_ => {})
.should(_ => { })
.then($list => {
if ($list.length) {
cy.wait('@get-pool-list', { timeout: 5000 }).its('response.statusCode').should('equal', 200)
Expand Down
15 changes: 7 additions & 8 deletions cypress/e2e/specs/swap-page.e2e.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,18 @@ describe(`Token Catalog on ${NETWORK}`, { tags: TAG.regression }, () => {

it('Should be selected tokenOut in favorite tokens list successfully', () => {
SwapPage.selectTokenOut().getFavoriteTokens(arr => {
tokenCatalog.selectFavoriteToken(arr[2])
tokenCatalog.selectFavoriteToken(arr[0])
SwapPage.getCurrentTokenOut(text => {
expect(text).to.equal(arr[2])
expect(text).to.equal(arr[0])
})
})
})
})

describe('Remove/add token with favorite tokens list', () => {
afterEach(() => {
tokenCatalog.closePopup()
})
it('Should be removed tokenIn from favorite tokens list', () => {
SwapPage.selectTokenIn().getFavoriteTokens(arr => {
tokenCatalog.removeFavoriteToken(arr[1])
Expand All @@ -54,15 +57,13 @@ describe(`Token Catalog on ${NETWORK}`, { tags: TAG.regression }, () => {
expect(list).not.to.include.members([arr[1]])
})
})
tokenCatalog.closePopup()
})

it('Should be added tokenIn to favorite tokens list', () => {
SwapPage.selectTokenIn().addFavoriteToken([tokenSymbols[0]])
tokenCatalog.getFavoriteTokens(list => {
expect(list).to.include.members([tokenSymbols[0]])
})
tokenCatalog.closePopup()
})

it('Should be removed tokenOut from favorite tokens list', () => {
Expand All @@ -73,15 +74,13 @@ describe(`Token Catalog on ${NETWORK}`, { tags: TAG.regression }, () => {
expect(list).not.to.include.members([arr[2]])
})
})
tokenCatalog.closePopup()
})

it('Should be added tokenOut to favorite tokens list', () => {
SwapPage.selectTokenOut().addFavoriteToken([tokenSymbols[0]])
SwapPage.selectTokenOut().addFavoriteToken([tokenSymbols[4]])
tokenCatalog.getFavoriteTokens(list => {
expect(list).to.include.members([tokenSymbols[0]])
expect(list).to.include.members([tokenSymbols[4]])
})
tokenCatalog.closePopup()
})
})

Expand Down
Loading