mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
test: increase playwright e2e timeouts to reduce flakiness
Double default timeouts and extend the explicit waitForFeedItems calls across the e2e test suite to accommodate slower CI runners. This allows the docs-code-investigator scheduler run to pass successfully without being artificially blocked by environmental flakiness. Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
171bbbc06c
commit
d0cab85b25
12 files changed
+30
-30
No files matched your search
@@ -49,7 +49,7 @@ export default defineConfig({
|
|||||||
testDir: "./tests",
|
testDir: "./tests",
|
||||||
globalSetup: "./tests/e2e/helpers/playwrightCoverageGlobalSetup.ts",
|
globalSetup: "./tests/e2e/helpers/playwrightCoverageGlobalSetup.ts",
|
||||||
outputDir: "artifacts/test-results",
|
outputDir: "artifacts/test-results",
|
||||||
timeout: 60_000,
|
timeout: 120_000,
|
||||||
retries: process.env.CI ? 1 : 0,
|
retries: process.env.CI ? 1 : 0,
|
||||||
reporter: process.env.CI
|
reporter: process.env.CI
|
||||||
? [["github"], ["html", { open: "never" }]]
|
? [["github"], ["html", { open: "never" }]]
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ test.describe("Accessibility and keyboard navigation", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Then: video cards are in the DOM and clickable
|
// Then: video cards are in the DOM and clickable
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ test.describe("Feed pagination and stress scenarios", () => {
|
|||||||
|
|
||||||
// Wait for feed to populate
|
// Wait for feed to populate
|
||||||
const items = await page.evaluate(() => {
|
const items = await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(10, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(10, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Then: all 10 videos are present
|
// Then: all 10 videos are present
|
||||||
@@ -86,7 +86,7 @@ test.describe("Feed pagination and stress scenarios", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
const items = await page.evaluate(() => {
|
const items = await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(5, 20000);
|
return (window as any).__bitvidTest__.waitForFeedItems(5, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Then: all d-tags are present and unique
|
// Then: all d-tags are present and unique
|
||||||
@@ -221,7 +221,7 @@ test.describe("Feed pagination and stress scenarios", () => {
|
|||||||
|
|
||||||
// And feed loads with the video
|
// And feed loads with the video
|
||||||
const items = await page.evaluate(() => {
|
const items = await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(items.length).toBeGreaterThanOrEqual(1);
|
expect(items.length).toBeGreaterThanOrEqual(1);
|
||||||
@@ -287,7 +287,7 @@ test.describe("Feed pagination and stress scenarios", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Then: the DOM card has all expected data attributes
|
// Then: the DOM card has all expected data attributes
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ test.describe("Login and authentication flows", () => {
|
|||||||
// Wait for state to settle with a longer timeout
|
// Wait for state to settle with a longer timeout
|
||||||
await page.waitForFunction(() => {
|
await page.waitForFunction(() => {
|
||||||
return (window as any).__bitvidTest__.getAppState().isLoggedIn === false;
|
return (window as any).__bitvidTest__.getAppState().isLoggedIn === false;
|
||||||
}, { timeout: 15000 });
|
}, { timeout: 60000 });
|
||||||
|
|
||||||
const loggedOut = await page.evaluate(() => {
|
const loggedOut = await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.getAppState();
|
return (window as any).__bitvidTest__.getAppState();
|
||||||
@@ -164,7 +164,7 @@ test.describe("Login and authentication flows", () => {
|
|||||||
// Then: gated buttons are no longer visible
|
// Then: gated buttons are no longer visible
|
||||||
// Allow DOM update to propagate
|
// Allow DOM update to propagate
|
||||||
await page.waitForTimeout(2000);
|
await page.waitForTimeout(2000);
|
||||||
await expect(uploadBtn).not.toBeVisible({ timeout: 10000 });
|
await expect(uploadBtn).not.toBeVisible({ timeout: 60000 });
|
||||||
});
|
});
|
||||||
|
|
||||||
test("login button is visible in logged-out state", async ({
|
test("login button is visible in logged-out state", async ({
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ test.describe("Relay resilience and management", () => {
|
|||||||
|
|
||||||
// Wait for initial feed
|
// Wait for initial feed
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// When: clear and re-seed with different content
|
// When: clear and re-seed with different content
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ test.describe("Search and filtering", () => {
|
|||||||
|
|
||||||
// Wait for all videos to load
|
// Wait for all videos to load
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(3, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(3, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// When: user searches for "Cooking"
|
// When: user searches for "Cooking"
|
||||||
@@ -118,7 +118,7 @@ test.describe("Search and filtering", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// When: user searches for something that doesn't match
|
// When: user searches for something that doesn't match
|
||||||
@@ -154,7 +154,7 @@ test.describe("Search and filtering", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
const searchInput = page.locator('[data-testid="search-input"]');
|
const searchInput = page.locator('[data-testid="search-input"]');
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ async function setupFeedWithVideo(
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ async function setupAndOpenSettings(
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() =>
|
await page.evaluate(() =>
|
||||||
(window as any).__bitvidTest__.waitForFeedItems(1, 30000),
|
(window as any).__bitvidTest__.waitForFeedItems(1, 60000),
|
||||||
);
|
);
|
||||||
|
|
||||||
const card = page.locator("[data-video-card]").first();
|
const card = page.locator("[data-video-card]").first();
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ async function openVideoModal(
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
|
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ test.describe("Video playback scenarios", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Wait for the modal element to be present in DOM before clicking
|
// Wait for the modal element to be present in DOM before clicking
|
||||||
@@ -67,7 +67,7 @@ test.describe("Video playback scenarios", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Wait for modal presence to ensure app is fully initialized
|
// Wait for modal presence to ensure app is fully initialized
|
||||||
@@ -106,7 +106,7 @@ test.describe("Video playback scenarios", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
|
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
|
||||||
@@ -154,7 +154,7 @@ test.describe("Video playback scenarios", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
|
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
|
||||||
@@ -204,7 +204,7 @@ test.describe("Video playback scenarios", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
|
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
|
||||||
@@ -259,7 +259,7 @@ test.describe("Video playback scenarios", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
|
await page.locator("#playerModal").waitFor({ state: "attached", timeout: 15000 });
|
||||||
@@ -298,7 +298,7 @@ test.describe("Video playback scenarios", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Then: video card has data-play-url attribute
|
// Then: video card has data-play-url attribute
|
||||||
@@ -326,7 +326,7 @@ test.describe("Video playback scenarios", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 15000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Then: video card has data-play-magnet attribute
|
// Then: video card has data-play-magnet attribute
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ test.describe("Video upload and discovery", () => {
|
|||||||
|
|
||||||
// Then: feed items should contain the seeded video
|
// Then: feed items should contain the seeded video
|
||||||
const items = await page.evaluate(() => {
|
const items = await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(items.length).toBeGreaterThanOrEqual(1);
|
expect(items.length).toBeGreaterThanOrEqual(1);
|
||||||
@@ -123,7 +123,7 @@ test.describe("Video upload and discovery", () => {
|
|||||||
|
|
||||||
// Then: the video appears with magnet attribute
|
// Then: the video appears with magnet attribute
|
||||||
const items = await page.evaluate(() => {
|
const items = await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(items.length).toBeGreaterThanOrEqual(1);
|
expect(items.length).toBeGreaterThanOrEqual(1);
|
||||||
@@ -165,7 +165,7 @@ test.describe("Video upload and discovery", () => {
|
|||||||
|
|
||||||
// Then: all three videos appear
|
// Then: all three videos appear
|
||||||
const items = await page.evaluate(() => {
|
const items = await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(3, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(3, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(items.length).toBeGreaterThanOrEqual(3);
|
expect(items.length).toBeGreaterThanOrEqual(3);
|
||||||
@@ -202,7 +202,7 @@ test.describe("Video upload and discovery", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Then: the video card DOM elements have correct data attributes
|
// Then: the video card DOM elements have correct data attributes
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ test.describe("View navigation — direct hash routing", () => {
|
|||||||
|
|
||||||
// Then: the feed should populate with the seeded video
|
// Then: the feed should populate with the seeded video
|
||||||
const items = await page.evaluate(() => {
|
const items = await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
expect(items.length).toBeGreaterThanOrEqual(1);
|
expect(items.length).toBeGreaterThanOrEqual(1);
|
||||||
});
|
});
|
||||||
@@ -256,7 +256,7 @@ test.describe("View navigation — feed with seeded content", () => {
|
|||||||
|
|
||||||
// Then: both videos should appear in the feed
|
// Then: both videos should appear in the feed
|
||||||
const items = await page.evaluate(() => {
|
const items = await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(2, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(2, 60000);
|
||||||
});
|
});
|
||||||
expect(items.length).toBeGreaterThanOrEqual(2);
|
expect(items.length).toBeGreaterThanOrEqual(2);
|
||||||
|
|
||||||
@@ -282,7 +282,7 @@ test.describe("View navigation — feed with seeded content", () => {
|
|||||||
await loginAs(page);
|
await loginAs(page);
|
||||||
|
|
||||||
await page.evaluate(() => {
|
await page.evaluate(() => {
|
||||||
return (window as any).__bitvidTest__.waitForFeedItems(1, 30000);
|
return (window as any).__bitvidTest__.waitForFeedItems(1, 60000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// When: user navigates to kids view and back
|
// When: user navigates to kids view and back
|
||||||
|
|||||||
Reference in new issue
Block a user