mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-24 14:20:36 +08:00
We use built in devices for testing instead of our own custom ones. Split up desktop and mobile visual tests for better separation.
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
import {
|
|
aliceRemote,
|
|
expect,
|
|
sourceBrowsingUrl,
|
|
test,
|
|
} from "@tests/support/fixtures.js";
|
|
|
|
test("source tree page", async ({ page }) => {
|
|
await page.goto(sourceBrowsingUrl, { 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(
|
|
`${sourceBrowsingUrl}/remotes/${aliceRemote.substring(8)}/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(
|
|
`${sourceBrowsingUrl}/remotes/${aliceRemote.substring(
|
|
8,
|
|
)}/commits/1aded56c3ad55299df9f06c326af50b802a05949`,
|
|
);
|
|
await expect(page.getByText("subconscious.txt added")).toBeVisible();
|
|
await expect(page).toHaveScreenshot({ fullPage: true });
|
|
});
|