Skip to content

Commit ab7d036

Browse files
committed
#3414 webpage: move common parts to a fixture
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent fe83833 commit ab7d036

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

webpage/tests/basic.spec.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// @ts-check
2-
import { test, expect } from "@playwright/test";
3-
import { getConfig } from "../config.js";
2+
import { test, expect } from "./fixtures.js";
43

54
// Test that all activities show
6-
test("basic", async ({ page }) => {
7-
const config = getConfig();
5+
test("frontpage", async ({ page, config }) => {
86
await page.goto(config.baseURL);
97
await expect(page.locator("title")).toContainText(/QOwnNotes/);
108
});

webpage/tests/fixtures.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// @ts-check
2+
import { test as base } from "@playwright/test";
3+
import { getConfig } from "../config.js";
4+
5+
export const test = base.extend({
6+
config: async ({}, use) => {
7+
const config = getConfig();
8+
await use(config);
9+
},
10+
});
11+
12+
export { expect } from "@playwright/test";

0 commit comments

Comments
 (0)