forked from triggerdotdev/trigger.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe2e.spec.ts
More file actions
43 lines (33 loc) · 1.84 KB
/
e2e.spec.ts
File metadata and controls
43 lines (33 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { test, expect } from "@playwright/test";
test("Create an account", async ({ page }) => {
await page.goto("/login");
await page.getByRole("link", { name: "Continue with Email" }).click();
await page.getByPlaceholder("Email Address").type(`test_${Math.random()}@test.com`);
await page.getByRole("button", { name: "Send a magic link" }).click();
await expect(page.getByText("Welcome to Trigger.dev")).toBeVisible();
await page.getByLabel("Full name").type("John Doe");
await page.getByRole("button", { name: "Continue" }).click();
await page.getByLabel("Organization name").type("Test Org");
await page.getByLabel("Project name").type("Test Project");
await page.getByRole("button", { name: "Create" }).click();
await expect(
page.locator("h1").filter({ hasText: /^Choose a framework to get started/ })
).toBeVisible();
});
test("Verify jobs from the test nextjs project", async ({ page }) => {
await page.goto("/");
await page.getByRole("link", { name: "Continue with Email" }).click();
await page.getByPlaceholder("Email Address").type("test-user@test.com");
await page.getByRole("button", { name: "Send a magic link" }).click();
await page.getByRole("link", { name: "Projects" }).click();
await page.locator("a").filter({ hasText: "Test Project" }).click();
await page.getByRole("link", { name: "Environments & API Keys" }).click();
await expect(page.locator("h2").filter({ hasText: "Environments & API Keys" })).toBeVisible();
await expect(
page.locator("h3").filter({ hasText: "nextjs-test" })
// Set the timeout high to allow the cli to register jobs
).toBeVisible({ timeout: 15000 });
await page.getByRole("link", { name: "Jobs" }).click();
await expect(page.locator("h2").filter({ hasText: /^Jobs$/ })).toBeVisible();
await expect(page.getByRole("link", { name: /Test Job One/ })).toBeVisible();
});