-
Notifications
You must be signed in to change notification settings - Fork 234
chore(e2e): wait for toggle to be checked with retries #5124
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
Conversation
f0595b0
to
0b47403
Compare
try { | ||
expect(await acceptTOSToggle.getAttribute('aria-checked')).to.eq( | ||
'true' | ||
); | ||
return true; | ||
} catch { | ||
return false; | ||
} |
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 the same, right?
try { | |
expect(await acceptTOSToggle.getAttribute('aria-checked')).to.eq( | |
'true' | |
); | |
return true; | |
} catch { | |
return false; | |
} | |
return await acceptTOSToggle.getAttribute('aria-checked')) === 'true'; |
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 wanted to keep the assertion to make it clear that we are not just waiting for something, but asserting it. Don't have a strong preference though, will update (waitUntil
will loose the assertion error anyway, no way to propagate it)
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.
And pushed again
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.
Yeah, I understand, but I also get why (almost?) all of our other waitUntil
usage is using the return-a-boolean-directly approach, might be worth keeping it consistent?
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.
Totally, will keep it consistent
0b47403
to
324181f
Compare
Based on the screenshot in CI this "should allow to accept TOS when signed in" test fails because we check just a moment too early, you can kinda see the toggle being mid-switch animation. I'm adding a
waitFor
method similar to testing-librarywaitFor
so that we can retry a few times to hopefully reduce the flake here