Quick navigation
The DataX dapp frontend has two ways of testing: manually, or automated testing. Our automated test suites all execute E2E tests using puppeteer, dappeteer, jest, and react-testing library.
Checkout dappeteer: https://github.com/ChainSafe/dappeteer/blob/master/docs/API.md
You can use the TestProtocol.md file to complete standard tests that check the limits of the application, best applied to the latest staging or test deployment.
If you feel another test would be beneficial to add to the protocol, bring it up to the team to discuss implementation.
These tests use a REAL MM account whose credentials are shared between multiple people, if you log into this account outside of chromium ensure you log out and do not send actual assets to this account.
REACT_APP_T_ACCT_SEED = "private key"
REACT_APP_T_ACCT_PASS = "password"
Reach out to development-internal to request these credentials if you need them.
A few things to keep in mind regarding both suites:
Both tests suites are currently only on the rinkeby network, but the UI tests suite does not execute transactions.
There are two rare but reoccuring unsolved issues with the test suites:
The UI test suite was designed to only test the user interface as a boiler plate test sutie to ensure state and flow is working properly upon any bug fix or enhancement. These tests can be ran all together or seperatly.
The UI test suite requires access to another account. These two enviorment variables are needed to run this suite:
- REACT_APP_T_ACCT2_PK = "privateKey"
- REACT_APP_TESTS_NETWORK="rinkeby"
You can get the private key from logging into the test account or asking the team in dev-internal channel.
yarn run test-ui
will run all of the test files in the UI test suite consecutively in this order: Navigation, cookies, disclaimer, lp, stake, trade, unstake.yarn run test-<fileName>
will run the file name you provide, you can check the package.json or the files themselves for the name. (E.G. uiNav.test.ts --> test-uiNav)A few other things to keep in mind:
The scripts intentially omit an option to test them all at once. This is because the transactions are all real, the suits take a few minutes each, and require human supervision. Review the process to ensure there are sufficient balances, gas, etc., for each transaction.
You may need to run one suite before the other to ensure you have proper balances. (Consider, if you run stakex before tradex there might not be enough ocean for tradex tests becuase of the max stake test.)
yarn test-rinkeby-tradex
yarn test-rinkeby-stakex
yarn test-rinkeby-unstake
You can run any specific test by
yarn test-rinkeby-<suite> -t <test>
Close Future Implementation:
<<<<<<< HEAD
Refer to the Test-API.md file located in the tests directory to view the functions available and quickly write new tests with minimal boilerplate.
Test priority (High value features)
Boilerplate | Making Trade | Staking | Unstaking | LP |
---|---|---|---|---|
- Connecting to provider |
- OCEAN to DT |
- Stake ocean in Pool |
Unstake ocean from pool | - Pool Import |
=======
9ba7a374dfe5eb4cf336207df9348fae4b18c60b
Contributing To Test Suites
Refer to the Test-API.md file located in the tests directory to view the functions available and quickly write new tests with minimal boilerplate.
Test priority (High value features)
Boilerplate | Making Trade | Staking | Unstaking | LP |
---|---|---|---|---|
- Connecting to provider |
- OCEAN to DT |
- Stake ocean in Pool |
Unstake ocean from pool | - Pool Import |
Datapolis is currently hosted on vercel through a team account for Datapolis. To gain access to this account contact your superior, or the lead developer.
Vercel is integrated with GitHub so that any changes to main, or any other branch, will trigger redeployments respectively.
The instructions below are provided for any migrations to new teams in vercel, or if setting up Datapolis from scratch in vercel ever becomes necessary.
yarn build
locally to ensure there are no build errors CI
to false
so the deployment wont fail. Never push to main before testing your fix or feature.
Keep in mind: If your new changes include changes to datax.js, the version will need to be bumped in datax.js before doing so. Deployment of Datapolis needs to be dependant on the version of datax.js that is currently available on NPM.
If your new changes include a new envrionment variable, ensure you add this before you deploy, so it is readily available when the new deployment is live.
25ab2b8 (Update readme) 9ba7a374dfe5eb4cf336207df9348fae4b18c60b