fix/onboarding-no-more-flaky-tests (#4254)

* Change expects to don't wait for plain text

* Fix change password test flakiness

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
pull/4322/head
alannnc 2022-09-09 02:54:10 -06:00 committed by GitHub
parent 1c46370572
commit b0de653166
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 11 deletions

View File

@ -18,6 +18,8 @@ test.describe("Change Password Test", () => {
await page.fill('[name="new_password"]', `${pro.username}1111`);
await page.press('[name="new_password"]', "Enter");
await expect(page.locator(`text=Your password has been successfully changed.`)).toBeVisible();
const toast = await page.waitForSelector("div[class*='data-testid-toast-success']");
await expect(toast).toBeTruthy();
});
});

View File

@ -7,14 +7,12 @@ test.describe.configure({ mode: "parallel" });
test.describe("Onboarding", () => {
test.describe("Onboarding v2", () => {
// TODO: @alannc temp disabled due to flakiness
/* test("test onboarding v2 new user first step", async ({ page, users }) => {
test("test onboarding v2 new user first step", async ({ page, users }) => {
const user = await users.create({ plan: UserPlan.TRIAL, completedOnboarding: false, name: "new user" });
await user.login();
await page.goto("/getting-started");
// First step
const usernameInput = await page.locator("input[name=username]");
await usernameInput.fill("new user onboarding");
@ -33,7 +31,7 @@ test.describe("Onboarding", () => {
const userComplete = await user.self();
expect(userComplete.name).toBe("new user 2");
}); */
});
test("test onboarding v2 new user second step", async ({ page, users }) => {
const user = await users.create({ plan: UserPlan.TRIAL, completedOnboarding: false, name: "new user" });
@ -41,7 +39,6 @@ test.describe("Onboarding", () => {
await page.goto("/getting-started/connected-calendar");
// Second step
const nextButtonCalendar = await page.locator("button[data-testid=save-calendar-button]");
const isDisabled = await nextButtonCalendar.isDisabled();
await expect(isDisabled).toBe(true);
@ -90,8 +87,7 @@ test.describe("Onboarding", () => {
});
test.describe("Onboarding v2 required field test", () => {
// TODO: @alannc temp disabled due to flakiness
/* test("test onboarding v2 new user first step required fields", async ({ page, users }) => {
test("test onboarding v2 new user first step required fields", async ({ page, users }) => {
const user = await users.create({
plan: UserPlan.TRIAL,
completedOnboarding: false,
@ -107,8 +103,8 @@ test.describe("Onboarding", () => {
await nextButtonUserProfile.click();
const requiredName = await page.locator("data-testid=required");
await expect(requiredName).toHaveText(/required/i);
}); */
await expect(requiredName).toBeVisible();
});
test("test onboarding v2 new user fourth step required fields", async ({ page, users }) => {
const user = await users.create({
@ -125,7 +121,7 @@ test.describe("Onboarding", () => {
await finishButton.click();
const requiredBio = await page.locator("data-testid=required");
await expect(requiredBio).toHaveText(/required/i);
await expect(requiredBio).toBeVisible();
});
});