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.
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
Additional watched account tests #396
Additional watched account tests #396
Changes from 9 commits
2815ed8
be4a8b9
3692fa9
419ad78
47a8097
5f0bdd3
fdf38a8
923d35c
cc7aa58
079eb95
0a9fd97
fa06d73
fd43632
2d4fa20
8836f5f
f154ce7
76f8de8
387bb48
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This is another annoying situation where this 500ms wait is needed before clicking the save button, without it the test will fail because the name in the header never updates. With this slight wait, it works every time.
I understand we never want to never use waits but this is another instance where I couldn't go further without one. Open to suggestions.
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.
Let's see what we can do here. It's weird that the input are so sensitive. Maybe we can wait until the text is visible in the input or something. I'll check.
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.
Need to spend time on this, sorry that I didn't get to it today, will check asap and report back.
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.
I learned something pretty 🤯 today with
cy.clock
andcy.tick
. The reason you had to wait, is because of the way we handle the storage of names. We don't store names on press, we debounce it. Without de-bouncing this field, it appeared unresponsive (I remember adding this). There's a debounce of 300ms hereMultix/packages/ui/src/components/AccountEditName.tsx
Lines 30 to 31 in 2d4fa20
Now thanks to
cy.clock
andtick
we can bend time.. and make things happen quicker 🤷https://docs.cypress.io/api/commands/tick
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.
@Lykhoyda I'll try to use this in the connect function instead of
waitUntil
. Because it is actually retrying stuff every 200ms, so it's not really elegantThere 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.
@Tbaut This is great! The explanation totally makes sense. Thank you for working this out, this is something I would have never considered but now we can look out for it in other scenarios! 🙏
(cc @juans-chainsafe - there's some good info in the comment above, we can look out for this in other frontend projects when encountering those scenarios where we think we need a
cy.wait
).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.
This is a very basic test atm, do we want to try and remove the target on the link so that the tab loads in the same window and then check that the subscan URL contains the correct address....or is that too much?
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.
I imagine that you meant to write this for the subscan test. I agree that it'd be better to actually test that the link is for the right address at least. I didn't research it but I guess it's possible. Removing the target sounds like hack though 🤷
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.
Updated: @Tbaut Juan has a nice solution for checking external links on another FE project. The same technique works well for us
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.
yup that's great, I figured there must have been some ways to stub this but didn't check 👍