Skip to content

Conversation

gribnoysup
Copy link
Collaborator

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-library waitFor so that we can retry a few times to hopefully reduce the flake here

Comment on lines 179 to 186
try {
expect(await acceptTOSToggle.getAttribute('aria-checked')).to.eq(
'true'
);
return true;
} catch {
return false;
}
Copy link
Collaborator

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?

Suggested change
try {
expect(await acceptTOSToggle.getAttribute('aria-checked')).to.eq(
'true'
);
return true;
} catch {
return false;
}
return await acceptTOSToggle.getAttribute('aria-checked')) === 'true';

Copy link
Collaborator Author

@gribnoysup gribnoysup Nov 16, 2023

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And pushed again

Copy link
Collaborator

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?

Copy link
Collaborator Author

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

@gribnoysup gribnoysup merged commit 149e77a into main Nov 16, 2023
@gribnoysup gribnoysup deleted the try-to-fix-e2e-flake branch November 16, 2023 15:32
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.

2 participants