-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Centrifuge App: e2e test setup (#1688)
* Setup and run first synpress test * Remove redundancy * Add sample env file * Remove env from run command * Clean up config * Fix linting * Move from centrifuge-app to tests * Attempt to run test in docker on CI * Move to workflow folder * Fix order * Add working dir * Set working dir * Attempt to set title * Add env variables * Remove duplicates * Convert config to js * Update script * Add module type * Simple CI attempt * Switch to npm * Switch to npm * Stop execution of big docker container * downgrade version * Overwrite install command * Use command instead of start * Check pwd * Check pwd * Check pwd * Set project directory * More attempts * Actually set working directory * Command * Update how env variables are passed * Add project ID for cypress cloud * Try to set env variables * Try to set env variables * Move env variables * Try again * Add base url * Remove docker * Remove remaining docker stuff * Add key to record to cypress cloud * Start app before running tests * Move tests back * Set working dir * Remove build step * Run local host * Run tests on bundled local server * Add yarn/node setup * Remove extra install * Fix wait on for node 18 * Fix wait on for node 18 take 2 * Build and run preview separate * Point base url to correct port * Add & in preview so it doesn't shut down * Try again * Set working dir * Download build instead of running build * Use main branch artifact * Allow failure * Add back install command & run on firefox * Add spec * Remove linux deps and fluxbox * Add linux and fluxbox back * Set bsae url in workflow * Add env vars to env section * Add more secrets * Move start command from package to workflow * Create env file in action * Run test when PR review is requested * Fix typings for cy commands * Add invest flow test (transfers, whitelisting, investing) * Fix path to eslint file * Run test on single spec * Add close epoch test * Add redeem tests and refactor * Increase gas limit * Fix linting * Test trigger * Add id * Fix types * Run only when PR is closed * Fix build * Fix linting --------- Co-authored-by: Guillermo Perez <gpmayorga@users.noreply.github.com>
- Loading branch information
1 parent
ef135ab
commit 8f3e788
Showing
25 changed files
with
7,388 additions
and
5,386 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Synpress tests | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: [main] | ||
|
||
jobs: | ||
cypress-run: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: read | ||
id-token: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install linux deps | ||
run: | | ||
sudo apt-get install --no-install-recommends -y \ | ||
fluxbox \ | ||
xvfb | ||
- name: Run xvfb and fluxbox | ||
run: | | ||
Xvfb :0 -screen 0 1024x768x24 -listen tcp -ac & | ||
fluxbox & | ||
env: | ||
DISPLAY: :0.0 | ||
- uses: iamsauravsharma/create-dotenv@v2.0.1 | ||
with: | ||
# input-prefix: '' # Optional (default: '') | ||
file-path: 'centrifuge-app/.env' # Optional (default : '.env') | ||
# output-prefix: 'OUTPUT_' # Optional (default: '') | ||
env: # env available for only this steps | ||
CYPRESS_PRIVATE_KEY: ${{secrets.CYPRESS_PRIVATE_KEY}} | ||
PRIVATE_KEY: ${{secrets.CYPRESS_PRIVATE_KEY}} | ||
NETWORK_NAME: centrifuge | ||
RPC_URL: https://fullnode.development.cntrfg.com | ||
CHAIN_ID: 2000 | ||
SYMBOL: DEVEL | ||
IS_TESTNET: true | ||
DEBUG: true | ||
- name: Synpress run | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
working-directory: centrifuge-app | ||
install-command: yarn | ||
command: yarn run e2e:run:ci | ||
browser: chrome | ||
config-file: synpress.config.ts | ||
ci-build-id: '${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }}' | ||
env: | ||
# pass the Cypress Cloud record key as an environment variable | ||
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} | ||
CYPRESS_PRIVATE_KEY: ${{ secrets.CYPRESS_PRIVATE_KEY }} | ||
PRIVATE_KEY: ${{ secrets.CYPRESS_PRIVATE_KEY }} | ||
CYPRESS_BASE_URL: https://app-dev.k-f.dev | ||
DISPLAY: :0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Copy to .env (for synpress/e2e testing config ONLY) | ||
PRIVATE_KEY= | ||
NETWORK_NAME=centrifuge | ||
RPC_URL=https://fullnode.development.cntrfg.com | ||
CHAIN_ID=2000 | ||
SYMBOL=DEVEL | ||
IS_TESTNET=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const synpress = require('@synthetixio/synpress/plugins/index.js') | ||
const { defineConfig } = require('cypress') | ||
|
||
export default defineConfig({ | ||
projectId: 'cwss36', // cypress cloud | ||
userAgent: 'synpress', | ||
retries: { | ||
runMode: 0, | ||
openMode: 0, | ||
}, | ||
|
||
screenshotsFolder: 'tests/e2e/screenshots', | ||
videosFolder: 'tests/e2e/videos', | ||
video: true, | ||
chromeWebSecurity: true, | ||
viewportWidth: 1366, | ||
viewportHeight: 850, | ||
|
||
env: { | ||
coverage: false, | ||
}, | ||
defaultCommandTimeout: 10000, | ||
pageLoadTimeout: 10000, | ||
requestTimeout: 10000, | ||
|
||
e2e: { | ||
baseUrl: 'http://localhost:3000', | ||
setupNodeEvents(on, config) { | ||
return synpress(on, config) | ||
}, | ||
pageLoadTimeout: 30000, | ||
supportFile: 'tests/e2e/support/e2e.ts', | ||
specPattern: 'tests/e2e/specs/**/*.cy.ts', | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "E2E Pool", | ||
"poolId": "3515519799", | ||
"poolCurrency": "USDT", | ||
"investAmount": "2", | ||
"poolAdmin": "0x70fC4d9C87E9e9B0751A5680b1Dd654517f02309", | ||
"tranches": [ | ||
{ | ||
"name": "Junior", | ||
"symbol": "E2EJUN", | ||
"id": "0xec6528e5b1a899fed47777b19963b1a6" | ||
}, | ||
{ | ||
"name": "Senior", | ||
"symbol": "E2ESEN", | ||
"id": "0xc18e73516eda0e038c50f6ab075b74ec" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
describe('E2E test health check', () => { | ||
it('Connects a wallet', () => { | ||
cy.visit('/pools', { failOnStatusCode: false }) | ||
cy.connectWallet({ init: true }) | ||
}) | ||
}) |
Oops, something went wrong.