-
Notifications
You must be signed in to change notification settings - Fork 20
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
Conversation
multisigPage.editNamesMenuOption().click() | ||
editNamesModal.body().should('be.visible') | ||
editNamesModal.inputEditPureName().type(`{selectall}{del}${`Edited Name Test`}`) | ||
cy.wait(500) |
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
and cy.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 here
Multix/packages/ui/src/components/AccountEditName.tsx
Lines 30 to 31 in 2d4fa20
const debouncedNameChange = useMemo(() => debounce(onNameChange, 300), [onNameChange]) | |
Now thanks to cy.clock
and tick
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 elegant
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).
@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
).
topMenuItems.homeButton().click() | ||
multisigPage.optionsMenuButton().click() | ||
multisigPage.subscanMenuOption().should('be.visible') | ||
}) |
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 👍
multisigPage.editNamesMenuOption().click() | ||
editNamesModal.body().should('be.visible') | ||
editNamesModal.inputEditPureName().type(`{selectall}{del}${`Edited Name Test`}`) | ||
cy.wait(500) |
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.
topMenuItems.homeButton().click() | ||
multisigPage.optionsMenuButton().click() | ||
multisigPage.subscanMenuOption().should('be.visible') | ||
}) |
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.
Wow that's amazing, and that's already a lot covered!
@asnaith you didn't share with us the mnemonic of this accounts. Any way you can do it, or didn't you use a new account for this? |
@Tbaut Yeah I had the signatories in this file but your question made me check...and when I did I realized one of the mnemonics needed updating as it was incorrect, now all is correct in this pr: #409 |
related to #378
New tests for
Also removed some unnecessary double quotes in the locators on the page objects