Skip to content

Commit

Permalink
update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ltthienn committed Aug 1, 2023
1 parent dcd7cf3 commit 8d51d70
Show file tree
Hide file tree
Showing 14 changed files with 372 additions and 729 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
run: |+
#!/bin/bash
yarn preview &
yarn test-e2e
yarn test-e2e -e grepTags=smoke,NETWORK=Ethereum
env:
DISPLAY: :0.0

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
network: ['Ethereum', 'Arbitrum','Optimism', 'Avalanche', 'BNB']
steps:
- name: Trigger Code Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -42,7 +45,7 @@ jobs:
- name: Run Cypress Test
run: |+
#!/bin/bash
yarn test-schedule
yarn test-schedule -e grepTags=regression,NETWORK=${{ matrix.network }}
env:
DISPLAY: :0.0

Expand Down
8 changes: 6 additions & 2 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,16 @@ export default defineConfig({
chromeWebSecurity: true,
viewportWidth: 1920,
viewportHeight: 1080,
env: {
grepFilterSpecs:true,
grepOmitFiltered:true
},
e2e: {
setupNodeEvents(on, config) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
require('@cypress/grep/src/plugin')(config)
synpressPlugins(on, config)
},
// specPattern: 'cypress/e2e/**/avalanche/*.e2e-spec.cy.ts',
specPattern: 'cypress/e2e/specs/swap-page.e2e-spec.cy.ts',
specPattern: 'cypress/e2e/specs/*.e2e.cy.ts',
},
})
93 changes: 72 additions & 21 deletions cypress/e2e/pages/swap-page.po.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function getText(selector: string, callback: any) {
}

export function getTokenList(selector: string, callback: any) {
let arr: string[] = []
const arr: string[] = []
const listToken = cy.get(selector)
listToken
.each(item => {
Expand All @@ -22,24 +22,32 @@ export function getTokenList(selector: string, callback: any) {
})
}

export const TOKEN_SYMBOLS = {
'Ethereum': ['BAND', 'DAI', 'USDT', 'USDC'],
'Arbitrum': ['ANGLE', 'DAI', 'USDT', 'USDC.e'],
'Optimism': ['BOB', 'DAI', 'USDT', 'USDC'],
'Avalanche': ['AAVE.e', 'sAVAX', 'USDT.e', 'USDC.e'],
'BNB': ['RICE', 'DAI', 'USDT', 'USDC']
}

export const UNWHITE_LIST_TOKENS = {
"bnb":
[
{
name: 'TUSD',
address: '0x40af3827f39d0eacbf4a168f8d4ee67c121d11c9',
},
{
name: 'ARA',
address: '0x5542958fa9bd89c96cb86d1a6cb7a3e644a3d46e',
},
"Ethereum":
[
{
name: 'SCOOBY',
address: '0xAd497eE6a70aCcC3Cbb5eB874e60d87593B86F2F',
},
{
name: 'UNIBOT',
address: '0x25127685dc35d4dc96c7feac7370749d004c5040',
},
{
name: 'BGB',
address: '0x19de6b897ed14a376dda0fe53a5420d2ac828a28',
},
],
"Arbitrum": [
{
name: 'FLASH',
address: '0xc3111096b3b46873393055dea14036ea603cfa95',
}
],
"arbitrum": [
{
name: 'OHM',
address: '0xf0cb2dc0db5e6c66b9a70ac27b06b878da017028',
},
Expand All @@ -51,7 +59,50 @@ export const UNWHITE_LIST_TOKENS = {
name: 'Y2K',
address: '0x65c936f008bc34fe819bce9fa5afd9dc2d49977f',
},
]

}

],
"Optimism":
[
{
name: 'CHI',
address: '0xca0e54b636db823847b29f506bffee743f57729d',
},
{
name: 'ACX',
address: '0xFf733b2A3557a7ed6697007ab5D11B79FdD1b76B',
},
{
name: 'PSP',
address: '0xd3594e879b358f430e20f82bea61e83562d49d48',
},
],
"Avalanche":
[
{
name: 'RADIO',
address: '0x02bfd11499847003de5f0f5aa081c43854d48815',
},
{
name: 'EUROC',
address: '0xc891eb4cbdeff6e073e859e987815ed1505c2acd',
},
{
name: 'MELD',
address: '0x333000333b26ee30214b4af6419d9ab07a450400',
},
],
"BNB":
[
{
name: 'TUSD',
address: '0x40af3827f39d0eacbf4a168f8d4ee67c121d11c9',
},
{
name: 'ARA',
address: '0x5542958fa9bd89c96cb86d1a6cb7a3e644a3d46e',
},
{
name: 'FLASH',
address: '0xc3111096b3b46873393055dea14036ea603cfa95',
}
],
}
58 changes: 0 additions & 58 deletions cypress/e2e/specs/arbitrum/intercept.e2e-spec.cy.ts

This file was deleted.

Loading

0 comments on commit 8d51d70

Please sign in to comment.