Move Playwright tests into tests/playwright

This commit is contained in:
Jonatan Heyman 2026-01-18 19:04:57 +01:00
parent d0e6aa0cd9
commit 72ea8e5e6a
34 changed files with 20 additions and 12 deletions

View File

@ -12,7 +12,7 @@ process.env["HEYNOTE_TESTS"] = "1"
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
testDir: './tests/playwright',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */

View File

@ -1,8 +1,8 @@
import { expect, test } from "@playwright/test"
import { EditorState } from "@codemirror/state"
import { heynoteLang } from "../src/editor/lang-heynote/heynote.js"
import { getBlocksFromSyntaxTree, getBlocksFromString } from "../src/editor/block/block-parsing.js"
import { heynoteLang } from "@/src/editor/lang-heynote/heynote.js"
import { getBlocksFromSyntaxTree, getBlocksFromString } from "@/src/editor/block/block-parsing.js"
test("parse blocks from both syntax tree and string contents", async ({page}) => {
const contents = `

View File

@ -1,8 +1,8 @@
import {expect, test} from "@playwright/test";
import {HeynotePage} from "./test-utils.js";
import { AUTO_SAVE_INTERVAL } from "../src/common/constants.js"
import { NoteFormat } from "../src/common/note-format.js"
import { AUTO_SAVE_INTERVAL } from "@/src/common/constants.js"
import { NoteFormat } from "@/src/common/note-format.js"
let heynotePage

View File

@ -1,8 +1,8 @@
import {expect, test} from "@playwright/test";
import {HeynotePage} from "./test-utils.js";
import { AUTO_SAVE_INTERVAL } from "../src/common/constants.js"
import { NoteFormat } from "../src/common/note-format.js"
import { AUTO_SAVE_INTERVAL } from "@/src/common/constants.js"
import { NoteFormat } from "@/src/common/note-format.js"
let heynotePage

View File

@ -0,0 +1,8 @@
const path = require('node:path')
const { app } = require('electron')
if (process.env.HEYNOTE_TEST_USER_DATA_DIR) {
app.setPath('userData', process.env.HEYNOTE_TEST_USER_DATA_DIR)
}
require(path.join(process.cwd(), 'dist-electron', 'main', 'index.js'))

View File

@ -1,6 +1,6 @@
import { test, expect } from "@playwright/test";
import { HeynotePage } from "./test-utils.js";
import { NoteFormat } from "../src/common/note-format.js";
import { NoteFormat } from "@/src/common/note-format.js";
import { formatDate, formatFullDate } from "@/src/common/format-date.js"
export const delimiterRegex = /\n∞∞∞[a-z]+(-a)?(?:;[^\\n]+)*\n/

View File

@ -1,8 +1,8 @@
import {expect, test} from "@playwright/test";
import {HeynotePage} from "./test-utils.js";
import { AUTO_SAVE_INTERVAL } from "../src/common/constants.js"
import { NoteFormat } from "../src/common/note-format.js"
import { AUTO_SAVE_INTERVAL } from "@/src/common/constants.js"
import { NoteFormat } from "@/src/common/note-format.js"
let heynotePage

View File

@ -1,6 +1,6 @@
import { test, expect } from "@playwright/test";
import { HeynotePage } from "./test-utils.js";
import { NoteFormat } from "../src/common/note-format.js";
import { NoteFormat } from "@/src/common/note-format.js";
let heynotePage

View File

@ -1,5 +1,5 @@
import { test, expect } from '@playwright/test';
import { NoteFormat } from '../src/common/note-format.js';
import { NoteFormat } from '@/src/common/note-format.js';
export function pageErrorGetter(page) {
let messages = [];