Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🐛 Fix screenshots package

Luke Vella38505c112002
diff --git a/packages/screenshots/capture/dashboard.spec.ts b/packages/screenshots/capture/dashboard.spec.ts
index fcba94ec9..8042d399c 100644
--- a/packages/screenshots/capture/dashboard.spec.ts
+++ b/packages/screenshots/capture/dashboard.spec.ts
@@ -1,9 +1,13 @@
import { test } from "@playwright/test";
-import { loginWithEmail } from "@rallly/test-helpers";
+import { deleteAllMessages, loginWithEmail } from "@rallly/test-helpers";
import { screenshotPath } from "./helpers";
+test.beforeAll(async () => {
+ await deleteAllMessages();
+});
+
test("dashboard", async ({ page }) => {
- await loginWithEmail(page, { email: "[email protected]" });
+ await loginWithEmail(page, { email: "[email protected]" });
await page.goto("/");
await page.waitForLoadState("networkidle");
await page.screenshot({ path: screenshotPath("dashboard"), fullPage: true });
diff --git a/packages/screenshots/capture/poll-admin.spec.ts b/packages/screenshots/capture/poll-admin.spec.ts
index 569abd7ab..d9d81c38f 100644
--- a/packages/screenshots/capture/poll-admin.spec.ts
+++ b/packages/screenshots/capture/poll-admin.spec.ts
@@ -1,12 +1,14 @@
import { test } from "@playwright/test";
import { prisma } from "@rallly/database";
-import { loginWithEmail } from "@rallly/test-helpers";
+import { deleteAllMessages, loginWithEmail } from "@rallly/test-helpers";
import dayjs from "dayjs";
import { screenshotPath } from "./helpers";
const pollId = "screenshot-poll";
test.beforeAll(async () => {
+ await deleteAllMessages();
+
const existingPoll = await prisma.poll.findUnique({
where: { id: pollId },
});
@@ -22,7 +24,7 @@ test.beforeAll(async () => {
description:
"Let's find a time to discuss our goals and priorities for the upcoming quarter.",
location: "Conference Room A",
- userId: "pro-user",
+ userId: "user-1",
spaceId: "space-2",
status: "open",
timeZone: "America/New_York",
@@ -101,7 +103,7 @@ test.afterAll(async () => {
});
test("poll admin", async ({ page }) => {
- await loginWithEmail(page, { email: "[email protected]" });
+ await loginWithEmail(page, { email: "[email protected]" });
await page.goto(`/poll/${pollId}`);
await page.waitForLoadState("networkidle");
await page.screenshot({
diff --git a/packages/screenshots/playwright.config.ts b/packages/screenshots/playwright.config.ts
index e89a4055a..c83ac7b5b 100644
--- a/packages/screenshots/playwright.config.ts
+++ b/packages/screenshots/playwright.config.ts
@@ -1,24 +1,24 @@
-import { defineConfig, devices } from "@playwright/test";
+import { defineConfig } from "@playwright/test";
import { config } from "dotenv";
-config({ path: "../../.env" });
+config({ path: "../../apps/web/.env" });
-const port = process.env.PORT || 3000;
-const baseURL = `http://localhost:${port}`;
+const PORT = 3100;
+const baseURL = `http://localhost:${PORT}`;
export default defineConfig({
testDir: "./capture",
outputDir: "./test-results",
- projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
+ projects: [{ name: "chromium" }],
use: {
viewport: { width: 1440, height: 900 },
baseURL,
},
webServer: {
- command: `HIDE_DEV_INDICATOR=true pnpm --filter @rallly/web exec next dev --port ${port}`,
- url: `${baseURL}/login`,
+ command: `NEXT_PUBLIC_BASE_URL=${baseURL} HIDE_DEV_INDICATOR=true pnpm --filter @rallly/web exec next dev --port ${PORT}`,
+ url: baseURL,
reuseExistingServer: true,
- timeout: 30000,
+ timeout: 120000,
},
retries: 0,
workers: 1,