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

test: e2e tests added for psm UI #125

Merged
merged 7 commits into from
Mar 14, 2024

Conversation

frazarshad
Copy link
Contributor

This PR aims to add e2e tests to the repo using the @agoric/synpress library. CI/CD setup to run these tests will be handled in a future PR

How to run and verify tests:

  • first start the agoric chain using
docker run -d -p 26657:26657 -p 1317:1317 -p 9090:9090 ghcr.io/agoric/agoric-3-proposals:main
  • then start the dapp using
yarn dev
  • then start the tests using
yarn test:e2e

Note: Once the tests have been run a few times, you will need to recreate the docker container for the chain, since there will not be enough tokens to run the test again

@toliaqat toliaqat requested review from turadg and samsiegart March 14, 2024 16:51
Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might have suggestions later on the test writing style but I'd like to get this in now so we can get CI set up and see how the tests perform.

});

it('should swap tokens from IST to stable', () => {
let ISTbalance;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our style is camel case

Suggested change
let ISTbalance;
let istBalance;

@samsiegart samsiegart self-requested a review March 14, 2024 17:59
Copy link
Collaborator

@samsiegart samsiegart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we need to exclude tests/e2e from vitest, I think we can do this by modifying vitest.config.ts like https://vitest.dev/config/#exclude

@frazarshad
Copy link
Contributor Author

Looks like we need to exclude tests/e2e from vitest, I think we can do this by modifying vitest.config.ts like https://vitest.dev/config/#exclude

@samsiegart updated accordingly

vitest.config.ts Outdated
@@ -8,6 +8,10 @@ export default mergeConfig(
test: {
setupFiles: ['src/installSesLockdown.ts'],
environment: 'happy-dom',
exclude: [
...configDefaults.exclude,
'tests/e2e/**'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alternately we could consider tests to be the purview of vitest and have synpress run in /integration-tests or /e2e-tests. I advise this to simplify the configurations but I defer to whatever @samsiegart prefers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if our goal is to simply config then just a head up: changing this path will require updating the synpress.config.js file since it uses tests/e2e/** as its default path

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads up, I think we can consider separating the directories but not a blocker

@samsiegart samsiegart self-requested a review March 14, 2024 18:59
@samsiegart samsiegart merged commit fc1aa6b into Agoric:main Mar 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants