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 repo #88

Merged
merged 4 commits into from
Mar 22, 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: one of the assertions in the tests depends on a default value in the agoric chain. once the tests have been run once, the value is changed and running the tests a second time fails that assertion. to run the tests more than once, the old chain will have to deleted and then recreated

});

it('should have value of 1000 on psm inter', () => {
cy.origin('https://psm.inter.trade', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if it's good to depend on the live UI here since a service disruption could impede workflows. Although, even when using a local build of PSM and connecting to a local chain, the app will make a request to https://wallet.agoric.app/network-config. Maybe it's enough to just check that the history item shows up with the new value, below the check for 'Change Accepted', instead of looking at the PSM app.

cc @turadg

Copy link
Member

Choose a reason for hiding this comment

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

Good point, @samsiegart . Could the e2e tests intercept https://wallet.agoric.app/network-config to provide a local result?

I don't see this as a blocking concern for having these tests in CI, but it should be addressed before required green to merge. (I.e. adding it to branch protection)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good. I'll remove the check from the external PSM URL

Copy link
Contributor

@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.

The workflow is failing because it uses an old version of node incompatible with synpress. We should try updating https://github.com/Agoric/dapp-econ-gov/blob/main/.github/workflows/test.yml#L18 to version 18.

@samsiegart samsiegart enabled auto-merge (squash) March 22, 2024 17:42
Copy link
Contributor

@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.

LGTM!

@samsiegart samsiegart merged commit 9f74116 into Agoric:main Mar 22, 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