Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

Added E2Es for signup (#390)

FrankenDeba1c35e8577d04
diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml
index 5ffc2db5ef..2de8189859 100644
--- a/.github/workflows/prettier.yml
+++ b/.github/workflows/prettier.yml
@@ -13,9 +13,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- with:
- # Make sure the actual branch is checked out when running on pull requests
- ref: ${{ github.head_ref }}
- uses: actions/setup-node@v3
with:
node-version: 18
@@ -25,5 +22,6 @@ jobs:
- name: Prettify code
uses: creyD/[email protected]
with:
- prettier_options: --write ./src *.{ts,js} --ignore-path .gitignore
- commit_message: "Applied prettier formatting"
+ dry: ${{ github.event.pull_request.head.repo.full_name != 'langfuse/langfuse' }}
+ prettier_options: ${{ github.event.pull_request.head.repo.full_name != 'langfuse/langfuse' && '--check' || '--write' }} ./src *.{ts,js} --ignore-path .gitignore
+ commit_message: "Applied prettier formatting" # only applies to langfuse/langfuse and not to forks
diff --git a/src/__e2e__/auth.spec.ts b/src/__e2e__/auth.spec.ts
index d796e086cd..b26a53622d 100644
--- a/src/__e2e__/auth.spec.ts
+++ b/src/__e2e__/auth.spec.ts
@@ -25,3 +25,34 @@ test("should redirect to home if signed in", async ({ page }) => {
page.url(),
);
});
+
+test("Successfully sign up & able to go to homepage", async ({ page }) => {
+ await page.goto("auth/sign-up");
+ await page.fill('input[name="name"]', "demo lang");
+ await page.fill('input[name="email"]', randomEmailAddress());
+ await page.fill('input[type="password"]', "password2");
+ await page.click('button[type="submit"]');
+ await page.waitForTimeout(2000);
+ // see get started page
+ await expect(page).toHaveURL("/?getStarted=1");
+});
+
+test("Signup validation", async ({ page }) => {
+ await page.goto("auth/sign-up");
+ await page.fill('input[name="email"]', "notanemail");
+ await page.fill('input[type="password"]', "pass3");
+ await page.click('button[type="submit"]');
+ await page.waitForTimeout(2000);
+ await expect(page.getByText("Invalid email")).toBeVisible();
+ await expect(
+ page.getByText("Password must be at least 8 characters long"),
+ ).toBeVisible();
+ await page.click('button[type="submit"]');
+ await page.waitForTimeout(2000);
+ // don't see get started page
+ await expect(page).not.toHaveURL("/?getStarted=1");
+});
+
+// random email address to be used in tests
+const randomEmailAddress = () =>
+ Math.random().toString(36).substring(2, 11) + "@example.com";