Skip to content

Commit

Permalink
Update failed test
Browse files Browse the repository at this point in the history
  • Loading branch information
ltthienn committed Nov 21, 2023
1 parent 6294302 commit aed749e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
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
20 changes: 10 additions & 10 deletions cypress/e2e/specs/intercept.e2e.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Intercept', { tags: TAG.regression }, () => {
SwapPage.open(DEFAULT_URL)
})

afterEach(() => {
beforeEach(() => {
cy.reload()
})
describe('Swap', () => {
Expand Down Expand Up @@ -46,21 +46,13 @@ describe('Intercept', { tags: TAG.regression }, () => {
})
})

describe('My Pools', () => {
it('Should get farm list successfully', () => {
cy.intercept('GET', '**/farm-pools?**').as('get-farm-list')
SwapPage.goToMyPoolsPage()
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')
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 All @@ -69,4 +61,12 @@ describe('Intercept', { tags: TAG.regression }, () => {
})
})
})

describe('My Pools', () => {
it('Should get farm list successfully', () => {
cy.intercept('GET', '**/farm-pools?**').as('get-farm-list')
SwapPage.goToMyPoolsPage()
cy.wait('@get-farm-list', { timeout: 5000 }).its('response.statusCode').should('equal', 200)
})
})
})
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

0 comments on commit aed749e

Please sign in to comment.