-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix flaky add_user smoke test #8471
Fix flaky add_user smoke test #8471
Conversation
@@ -20,7 +20,7 @@ describe("add_user", () => { | |||
cy.visit("/settings/identities/users"); | |||
cy.waitTextVisible("Invite Users"); | |||
|
|||
cy.clickOptionWithText("Invite Users") | |||
cy.clickOptionWithText("Invite Users").wait(1000); |
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.
Any chance we should wait until the URL matches a particular REGEX?
Or is it re-generating a token so we cannot use a regex match 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.
yeah, it re-generating a token every time, maybe we can check for length of token in REGEX...
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.
Tested this REGEX locally and it works.
"/signup?invite_token=\w{32}/"
|
||
cy.waitTextVisible(/signup\?invite_token=\w+/).then(($elem) => { | ||
cy.waitTextVisible(/signup\?invite_token=\w{32}/).then(($elem) => { |
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.
nice!! thanks for adding the regex matching. this is much better
Co-authored-by: John Joyce <john@acryl.io> Co-authored-by: Aseem Bansal <asmbansal2@gmail.com>
The main source of add_user being flaky is the behavior of 'Share Invite Link' modal on settings/identities/users.
Sometimes it takes some time to present actual token id on UI while token url is already present.
So Cypress verifies that URL present and goes forward causing it to copy corrupted URL of token
This causes test to fail later.
This is how UI looks when this happens:
The solution for this would be to wait for 1000ms after 'Share Invite Link' is open to make sure that full invite link is present.
Linear ticket: https://linear.app/acryl-data/issue/OBS-47/qa-fix-add-user-flaky-test
Checklist