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(ci): flakiness due to onboarding tour in add user test #6734

Merged
merged 2 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions datahub-web-react/src/app/onboarding/OnboardingTour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export const OnboardingTour = ({ stepIds }: Props) => {
setReshow(true);
setIsOpen(true);
}
if (e.metaKey && e.ctrlKey && e.key === 'h') {
aditya-radhakrishnan marked this conversation as resolved.
Show resolved Hide resolved
setReshow(false);
setIsOpen(false);
}
}
document.addEventListener('keydown', handleKeyDown);
}, []);
Expand Down
3 changes: 2 additions & 1 deletion smoke-test/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,5 @@ dmypy.json

# Pyre type checker
.pyre/
junit*
junit*
tests/cypress/onboarding.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
const tryToSignUp = () => {
cy.enterTextInTestId("email", "[email protected]")
cy.enterTextInTestId("name", "Example Name")
let number = Math.floor(Math.random() * 100000);
let name = `Example Name ${number}`;
cy.enterTextInTestId("email", `example${number}@example.com`)
cy.enterTextInTestId("name", name)
cy.enterTextInTestId("password", "Example password")
cy.enterTextInTestId("confirmPassword", "Example password")

cy.mouseover("#title").click()
cy.waitTextVisible("Other").click()

cy.get("[type=submit]").click()
return name;
};

describe("add_user", () => {
Expand All @@ -23,8 +26,10 @@ describe("add_user", () => {
const inviteLink = $elem.text();
cy.logout();
cy.visit(inviteLink);
tryToSignUp();
cy.waitTextVisible("Accepted invite!")
let name = tryToSignUp();
cy.waitTextVisible("Welcome to DataHub");
cy.hideOnboardingTour();
cy.waitTextVisible(name);
}).then(() => {
cy.logout();
cy.visit("/signup?invite_token=bad_token");
Expand Down
4 changes: 4 additions & 0 deletions smoke-test/tests/cypress/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ Cypress.Commands.add("clickOptionWithTestId", (id) => {
});
})

Cypress.Commands.add("hideOnboardingTour", () => {
aditya-radhakrishnan marked this conversation as resolved.
Show resolved Hide resolved
cy.get('body').type("{ctrl} {meta} h");
});

Cypress.Commands.add('addTermToDataset', (urn, dataset_name, term) => {
cy.goToDataset(urn, dataset_name);
cy.clickOptionWithText("Add Term");
Expand Down