-
Notifications
You must be signed in to change notification settings - Fork 393
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
Create E2E tests for verified/unverified tokens #3472
Merged
Merged
Changes from 29 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
fdf09c6
Create E2E tests for verified/unverified tokens
michalinacienciala 19cebd0
Merge remote-tracking branch 'origin/main' into trust-tokens-e2e
michalinacienciala 2ce0f5c
Uncomment temporarily turned off test steps
michalinacienciala db5302a
Merge remote-tracking branch 'origin/main' into trust-tokens-e2e
michalinacienciala 1b6d888
Switch test to use account that we control
michalinacienciala bdf5b87
Merge remote-tracking branch 'origin/main' into trust-tokens-e2e
michalinacienciala 1debde9
Adjust the code after the merge
michalinacienciala b1d8382
Improve comments
michalinacienciala c0f9193
Refactor code asserting asset's balance
michalinacienciala 3f0a378
Uncomment temporarily disabled assertions
michalinacienciala bf682cc
Merge `assertAssetDetailsPage()` with `verifyAssetActivityScreen()`
michalinacienciala 1a75c5d
Remove obsolete comment
michalinacienciala 06208b6
Improve comments
michalinacienciala 7511aa4
Update names of the JSON-related variables and secrets
michalinacienciala f37e61b
Wait 1s before switching to Polygon network
michalinacienciala a07be0a
Merge remote-tracking branch 'origin/main' into trust-tokens-e2e
michalinacienciala 22a9b91
Give dev fork builds the -fork suffix
michalinacienciala 4ef9622
Increase waiting time before switching network
michalinacienciala 5debafc
Uncomment previously failing code
michalinacienciala cbd2990
Remove empty line
michalinacienciala b16c9a0
Merge remote-tracking branch 'origin/main' into trust-tokens-e2e
michalinacienciala 5ad6ca6
Rename `verify...` functions to `assert...`
michalinacienciala 833cbf4
Update dApp connection banner assertion
michalinacienciala 0fa759f
Merge remote-tracking branch 'origin/main' into trust-tokens-e2e
michalinacienciala 95db29f
Extract the name and address of the testing account to a helper file
michalinacienciala b4a61d2
Explain usage of ElementHandle in `closeAccountsPopup()`
michalinacienciala 4e740df
Remove obsolete steps in `addAddressToAccount()`
michalinacienciala e9d7951
Remove obsolete comment
michalinacienciala 89019b4
Improve comments
michalinacienciala c562952
Refactor function closing Accounts slide up
michalinacienciala 1cf604e
Move the `closeAccountsSlideUp()` steps under `addAddressToAccount()`
michalinacienciala c21299e
Remove obsolete timeout
michalinacienciala 1265763
Support assets with the same name in `assertVerifiedAssetOnWalletPage`
michalinacienciala 5f45f7f
Refactor onboarding with JSON
michalinacienciala bd19521
Access account-specific data in e2e tests using interface
michalinacienciala 6bfbd18
Merge remote-tracking branch 'origin/main' into trust-tokens-e2e
michalinacienciala 0013d2a
Merge branch 'main' into trust-tokens-e2e
hyphenized File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use a variable for
testertesting.eth
string as well? Also other strings likeEthereum
etc - so we can avoid typos or other easy bugsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean this comment for line 115 (and other similar)? If so, I've applied that in 95db29f.
and
I feel a bit torn about this...
The good side of moving commonly used labels to some external place is what you said and also possibility to apply changes to the labels quickly, without having to modify them in many places.
But there are also some cons, mainly in cases where we also have the same labels abstracted in the app's code (as this is the case for network names and base assets labels stored in
network.ts
). What I mean is that having similar implementation in tests and in tested code may lead to introducing same bug in both places and not catching it by the tests.Another issue is that in tests we sometimes want to use RegExp, sometimes string, sometimes value with all letters capitalized, sometimes only with the first letter captalized etc, depending on the context. We'll either need a separate variable for each different version of the label we use or we'll need to use some method that modifies given variable into the formatting we need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not saying definitely NO to this idea though. The pros may outweigh the cons...
What would be the best way to approach this? Having all the constant values used by the E2E tests stored in one helper file? Or storing them in files they are related to (something like what we have currently, where names of testing accounts are in the onboarding helper)? The first solution seems more universal to me, but I'm curious if there some good practice I should follow here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both are great points, I'm not entirely onboard with abstracting simple names as it reduces readability on written test cases, which should remain as simple as possible and, are also unlikely to change unless there are changes in the implementation.
Still, I don't think there's much harm if it's a simple string that's repeated multiple times and it's a simple change. Considering that does not seem to be the case here given the multiple variants, I'd keep the hardcoded strings.