mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 03:40:37 +08:00
Fix flaky visual tests
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
@@ -14,6 +14,7 @@ public/twemoji/*.svg
|
||||
# Integration Tests
|
||||
tests/tmp/**/*
|
||||
tests/artifacts/**/*
|
||||
tests/visual/snapshots/**/*
|
||||
|
||||
# Mac OS
|
||||
.DS_Store
|
||||
|
||||
@@ -13,7 +13,7 @@ test("navigation from commit list", async ({ page }) => {
|
||||
});
|
||||
|
||||
test("relative timestamps", async ({ page }) => {
|
||||
page.addInitScript(() => {
|
||||
await page.addInitScript(() => {
|
||||
window.initializeTestStubs = () => {
|
||||
window.e2eTestStubs.FakeTimers.install({
|
||||
now: new Date("November 24 2022 12:00:00").valueOf(),
|
||||
|
||||
@@ -98,7 +98,7 @@ test("verified badge", async ({ page }) => {
|
||||
});
|
||||
|
||||
test("relative timestamps", async ({ page }) => {
|
||||
page.addInitScript(() => {
|
||||
await page.addInitScript(() => {
|
||||
window.initializeTestStubs = () => {
|
||||
window.e2eTestStubs.FakeTimers.install({
|
||||
now: new Date("November 24 2022 12:00:00").valueOf(),
|
||||
|
||||
@@ -6,6 +6,6 @@ test.use({
|
||||
|
||||
test("landing page", async ({ page }) => {
|
||||
await page.addInitScript(appConfigWithFixture);
|
||||
await page.goto("/");
|
||||
await page.goto("/", { waitUntil: "networkidle" });
|
||||
await expect(page).toHaveScreenshot();
|
||||
});
|
||||
|
||||
@@ -1,18 +1,40 @@
|
||||
import { test, expect, projectFixtureUrl } from "@tests/support/fixtures.js";
|
||||
|
||||
test("source tree page", async ({ page }) => {
|
||||
await page.goto(projectFixtureUrl);
|
||||
await page.goto(projectFixtureUrl, { waitUntil: "networkidle" });
|
||||
await expect(page).toHaveScreenshot();
|
||||
});
|
||||
|
||||
test("commits page", async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
window.initializeTestStubs = () => {
|
||||
window.e2eTestStubs.FakeTimers.install({
|
||||
now: new Date("November 24 2022 12:00:00").valueOf(),
|
||||
shouldClearNativeTimers: true,
|
||||
shouldAdvanceTime: false,
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
await page.goto(
|
||||
`${projectFixtureUrl}/remotes/hyn1mjueopwzrmb18c3zmgg8ei8qunn5wpg76ouymytfqkfxqx7bun/history`,
|
||||
{ waitUntil: "networkidle" },
|
||||
);
|
||||
|
||||
await expect(page).toHaveScreenshot({ fullPage: true });
|
||||
});
|
||||
|
||||
test("commit page", async ({ page }) => {
|
||||
await page.addInitScript(() => {
|
||||
window.initializeTestStubs = () => {
|
||||
window.e2eTestStubs.FakeTimers.install({
|
||||
now: new Date("November 24 2022 12:00:00").valueOf(),
|
||||
shouldClearNativeTimers: true,
|
||||
shouldAdvanceTime: false,
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
await page.goto(
|
||||
`${projectFixtureUrl}/remotes/hyn1mjueopwzrmb18c3zmgg8ei8qunn5wpg76ouymytfqkfxqx7bun/commits/d6318f7f3d9c15b8ac6dd52267c53220d00f0982`,
|
||||
);
|
||||
@@ -20,6 +42,8 @@ test("commit page", async ({ page }) => {
|
||||
});
|
||||
|
||||
test("markdown rendering", async ({ page }) => {
|
||||
await page.goto(`${projectFixtureUrl}/tree/main/markdown/cheatsheet.md`);
|
||||
await page.goto(`${projectFixtureUrl}/tree/main/markdown/cheatsheet.md`, {
|
||||
waitUntil: "networkidle",
|
||||
});
|
||||
await expect(page).toHaveScreenshot({ fullPage: true });
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { test, expect } from "@tests/support/fixtures.js";
|
||||
|
||||
test("seed page", async ({ page }) => {
|
||||
await page.goto("/seeds/radicle.local");
|
||||
await page.goto("/seeds/radicle.local", { waitUntil: "networkidle" });
|
||||
await expect(page).toHaveScreenshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user