feat: Update UI of signup / login pages (#16710)

* update UI of signup, login pages

* remove disabled state from google sign-in

* Put isGoogleLoginEnabled to its place + fix displaySignupForm default value

* Rename Signup flow test -> Email Signup flow test

* add data-testid to continue with email button

* completely decouble formMethods values from google sign in

* fix

* refactor

* add signup page test

* revert yarn.lock

* fix e2e test

* add saml in signup

* add saml in signin

* revert

* remove space
This commit is contained in:
Benny Joo authored and GitHub committed 2024-09-24 02:27:57 +09:00
1 parent 0eabe7f28b
commit b879aeef09
6 files changed
+330 -230

No files matched your search

@@ -296,6 +296,8 @@ test.describe("Organization", () => {
await test.step("Signing up with the previous username of the migrated user - shouldn't be allowed", async () => {
await page.goto("/signup");
await expect(page.locator('[data-testid="continue-with-email-button"]')).toBeVisible();
await page.locator('[data-testid="continue-with-email-button"]').click();
await expect(page.locator("text=Create your account")).toBeVisible();
const usernameInput = page.locator('input[name="username"]');
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+35 -3
View File
@@ -10,7 +10,27 @@ import { expectInvitationEmailToBeReceived } from "./team/expects";
test.describe.configure({ mode: "parallel" });
test.describe("Signup Flow Test", async () => {
test.describe("Signup Main Page Test", async () => {
test.beforeEach(async ({ features }) => {
features.reset();
});
test("Continue with email button must exist / work", async ({ page }) => {
await page.goto("/signup");
await expect(page.locator('[data-testid="continue-with-email-button"]')).toBeVisible();
await page.locator('[data-testid="continue-with-email-button"]').click();
await expect(page.locator("text=Create your account")).toBeVisible();
});
test("Continue with google button must exist / work", async ({ page }) => {
await page.goto("/signup");
await expect(page.locator('[data-testid="continue-with-google-button"]')).toBeVisible();
await page.locator('[data-testid="continue-with-google-button"]').click();
await page.waitForURL("/auth/sso/google");
});
});
test.describe("Email Signup Flow Test", async () => {
test.beforeEach(async ({ features }) => {
features.reset(); // This resets to the inital state not an empt yarray
});
@@ -25,6 +45,8 @@ test.describe("Signup Flow Test", async () => {
});
await page.goto("/signup");
await expect(page.locator('[data-testid="continue-with-email-button"]')).toBeVisible();
await page.locator('[data-testid="continue-with-email-button"]').click();
await expect(page.locator("text=Create your account")).toBeVisible();
const alertMessage = "Username or email is already taken";
@@ -52,7 +74,8 @@ test.describe("Signup Flow Test", async () => {
});
await page.goto("/signup");
await expect(page.locator('[data-testid="continue-with-email-button"]')).toBeVisible();
await page.locator('[data-testid="continue-with-email-button"]').click();
await expect(page.locator("text=Create your account")).toBeVisible();
const alertMessage = "Username or email is already taken";
@@ -84,6 +107,8 @@ test.describe("Signup Flow Test", async () => {
// Signup with premium username name
await page.goto("/signup");
await expect(page.locator('[data-testid="continue-with-email-button"]')).toBeVisible();
await page.locator('[data-testid="continue-with-email-button"]').click();
await expect(page.locator("text=Create your account")).toBeVisible();
// Fill form
@@ -112,6 +137,8 @@ test.describe("Signup Flow Test", async () => {
});
await page.goto("/signup");
await expect(page.locator('[data-testid="continue-with-email-button"]')).toBeVisible();
await page.locator('[data-testid="continue-with-email-button"]').click();
await expect(page.locator("text=Create your account")).toBeVisible();
// Fill form
@@ -131,6 +158,8 @@ test.describe("Signup Flow Test", async () => {
test("Signup fields prefilled with query params", async ({ page, users }) => {
const signupUrlWithParams = "/signup?username=rick-jones&email=rick-jones%40example.com";
await page.goto(signupUrlWithParams);
await expect(page.locator('[data-testid="continue-with-email-button"]')).toBeVisible();
await page.locator('[data-testid="continue-with-email-button"]').click();
await expect(page.locator("text=Create your account")).toBeVisible();
// Fill form
@@ -212,6 +241,8 @@ test.describe("Signup Flow Test", async () => {
});
await page.goto("/signup");
await expect(page.locator('[data-testid="continue-with-email-button"]')).toBeVisible();
await page.locator('[data-testid="continue-with-email-button"]').click();
await expect(page.locator("text=Create your account")).toBeVisible();
// Fill form
@@ -283,7 +314,8 @@ test.describe("Signup Flow Test", async () => {
const url = new URL(newPage.url());
expect(url.pathname).toBe("/signup");
await expect(page.locator('[data-testid="continue-with-email-button"]')).toBeVisible();
await page.locator('[data-testid="continue-with-email-button"]').click();
// Check required fields
await newPage.locator("input[name=password]").fill(`P4ssw0rd!`);
await newPage.locator("button[type=submit]").click();