mirror of
https://github.com/heyman/heynote.git
synced 2026-02-06 11:27:25 +00:00
Move Playwright tests into tests/playwright
This commit is contained in:
parent
d0e6aa0cd9
commit
72ea8e5e6a
@ -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. */
|
||||
|
||||
@ -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 = `
|
||||
@ -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
|
||||
@ -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
|
||||
8
tests/playwright/electron-runner.cjs
Normal file
8
tests/playwright/electron-runner.cjs
Normal 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'))
|
||||
@ -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/
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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 = [];
|
||||
Loading…
Reference in New Issue
Block a user