Skip to content
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

Merged

Conversation

kkorchak
Copy link
Collaborator

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
image
This causes test to fail later.
This is how UI looks when this happens:
image
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.
image

Linear ticket: https://linear.app/acryl-data/issue/OBS-47/qa-fix-add-user-flaky-test

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the smoke_test Contains changes related to smoke tests label Jul 20, 2023
@@ -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);
Copy link
Collaborator

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?

Copy link
Collaborator Author

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...

Copy link
Collaborator Author

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) => {
Copy link
Collaborator

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

@jjoyce0510 jjoyce0510 merged commit 637a6ae into datahub-project:master Aug 2, 2023
31 checks passed
yoonhyejin pushed a commit that referenced this pull request Aug 24, 2023
Co-authored-by: John Joyce <john@acryl.io>
Co-authored-by: Aseem Bansal <asmbansal2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
smoke_test Contains changes related to smoke tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants