diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 045fa47..c0ce1ac 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -16,7 +16,7 @@ jobs: - name: Install dependencies run: | apt-get update - apt-get install -y jq xdg-utils + apt-get install -y jq xdg-utils xvfb curled=$(curl -L https://github.com/obsidianmd/obsidian-releases/raw/refs/heads/master/desktop-releases.json | jq .latestVersion | sed s/\"//g) curl -Lo obsidian.deb "https://github.com/obsidianmd/obsidian-releases/releases/download/v$curled/obsidian_${curled}_amd64.deb" corepack enable @@ -26,9 +26,8 @@ jobs: dpkg -i ../../obsidian.deb - name: compile and test! run: | - cd packages/test-project yarn workspace obsidian-testing-framework run tsc - yarn playwright test + yarn workspace obsidian-sample-plugin run test - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} with: diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index 93ecc5e..65bb430 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/packages/obsidian-testing-framework/package.json b/packages/obsidian-testing-framework/package.json index 7da5ea5..f083f1e 100644 --- a/packages/obsidian-testing-framework/package.json +++ b/packages/obsidian-testing-framework/package.json @@ -6,9 +6,9 @@ "@codemirror/state": "^6.0.1", "@codemirror/view": "^6.0.1", "asar": "^3.2.0", + "electron": "^33.0.2", "playwright": "^1.48.1", "tmp": "^0.2.3", - "electron": "^33.0.2", "typescript": "^5.6.3" }, "version": "", diff --git a/packages/test-project/package.json b/packages/test-project/package.json index 1f62e21..d70dc99 100644 --- a/packages/test-project/package.json +++ b/packages/test-project/package.json @@ -7,7 +7,8 @@ "scripts": { "dev": "node esbuild.config.mjs", "build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production", - "version": "node version-bump.mjs && git add manifest.json versions.json" + "version": "node version-bump.mjs && git add manifest.json versions.json", + "test": "xvfb-maybe playright test" }, "keywords": [], "author": "", @@ -26,7 +27,8 @@ "playwright": "^1.48.1", "tslib": "2.4.0", "typescript": "4.7.4", - "vitest": "^2.1.3" + "vitest": "^2.1.3", + "xvfb-maybe": "^0.2.1" }, "type": "module" } diff --git a/yarn.lock b/yarn.lock index bc19f8c..4edc161 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1234,6 +1234,15 @@ __metadata: languageName: node linkType: hard +"debug@npm:^2.2.0": + version: 2.6.9 + resolution: "debug@npm:2.6.9" + dependencies: + ms: "npm:2.0.0" + checksum: 10c0/121908fb839f7801180b69a7e218a40b5a0b718813b886b7d6bdb82001b931c938e2941d1e4450f33a1b1df1da653f5f7a0440c197f29fbf8a6e9d45ff6ef589 + languageName: node + linkType: hard + "decompress-response@npm:^6.0.0": version: 6.0.0 resolution: "decompress-response@npm:6.0.0" @@ -2351,6 +2360,13 @@ __metadata: languageName: node linkType: hard +"ms@npm:2.0.0": + version: 2.0.0 + resolution: "ms@npm:2.0.0" + checksum: 10c0/f8fda810b39fd7255bbdc451c46286e549794fcc700dc9cd1d25658bbc4dc2563a5de6fe7c60f798a16a60c6ceb53f033cb353f493f0cf63e5199b702943159d + languageName: node + linkType: hard + "ms@npm:^2.1.3": version: 2.1.3 resolution: "ms@npm:2.1.3" @@ -2435,6 +2451,7 @@ __metadata: tslib: "npm:2.4.0" typescript: "npm:4.7.4" vitest: "npm:^2.1.3" + xvfb-maybe: "npm:^0.2.1" languageName: unknown linkType: soft @@ -3261,6 +3278,17 @@ __metadata: languageName: node linkType: hard +"which@npm:^1.2.4": + version: 1.3.1 + resolution: "which@npm:1.3.1" + dependencies: + isexe: "npm:^2.0.0" + bin: + which: ./bin/which + checksum: 10c0/e945a8b6bbf6821aaaef7f6e0c309d4b615ef35699576d5489b4261da9539f70393c6b2ce700ee4321c18f914ebe5644bc4631b15466ffbaad37d83151f6af59 + languageName: node + linkType: hard + "which@npm:^2.0.1": version: 2.0.2 resolution: "which@npm:2.0.2" @@ -3324,6 +3352,18 @@ __metadata: languageName: node linkType: hard +"xvfb-maybe@npm:^0.2.1": + version: 0.2.1 + resolution: "xvfb-maybe@npm:0.2.1" + dependencies: + debug: "npm:^2.2.0" + which: "npm:^1.2.4" + bin: + xvfb-maybe: ./src/xvfb-maybe.js + checksum: 10c0/ade3f7ef7ab465607484f8d78214bb4db806dcda1b54f0eded504c696eea65586f0a1be43c1e922cf1d4aecef019015ca0cd69c72d24f83685f776b5ee4d7bca + languageName: node + linkType: hard + "yallist@npm:^4.0.0": version: 4.0.0 resolution: "yallist@npm:4.0.0"