@xn-intenton-z2a/agentic-lib 7.1.78 → 7.1.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,6 +12,8 @@ name: agentic-lib-test
|
|
|
12
12
|
run-name: "agentic-lib-test [${{ github.ref_name }}]"
|
|
13
13
|
|
|
14
14
|
on:
|
|
15
|
+
schedule:
|
|
16
|
+
- cron: "10 * * * *"
|
|
15
17
|
#@dist push:
|
|
16
18
|
#@dist branches: [main]
|
|
17
19
|
#@dist pull_request:
|
|
@@ -19,6 +21,9 @@ on:
|
|
|
19
21
|
workflow_call:
|
|
20
22
|
workflow_dispatch:
|
|
21
23
|
|
|
24
|
+
permissions:
|
|
25
|
+
contents: write
|
|
26
|
+
|
|
22
27
|
jobs:
|
|
23
28
|
test:
|
|
24
29
|
runs-on: ubuntu-latest
|
|
@@ -45,3 +50,42 @@ jobs:
|
|
|
45
50
|
|
|
46
51
|
- name: Run tests
|
|
47
52
|
run: ${{ steps.config.outputs.test-command }}
|
|
53
|
+
|
|
54
|
+
behaviour:
|
|
55
|
+
if: github.repository != 'xn-intenton-z2a/agentic-lib'
|
|
56
|
+
runs-on: ubuntu-latest
|
|
57
|
+
container: mcr.microsoft.com/playwright:v1.58.2-noble
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v6
|
|
60
|
+
|
|
61
|
+
- name: Install dependencies
|
|
62
|
+
run: npm ci
|
|
63
|
+
|
|
64
|
+
- name: Build website
|
|
65
|
+
run: npm run build:web
|
|
66
|
+
|
|
67
|
+
- name: Run behaviour tests
|
|
68
|
+
run: npm run test:behaviour
|
|
69
|
+
env:
|
|
70
|
+
HOME: /root
|
|
71
|
+
|
|
72
|
+
- name: Push screenshot on main
|
|
73
|
+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
|
|
74
|
+
run: |
|
|
75
|
+
git config user.name "github-actions[bot]"
|
|
76
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
77
|
+
git add SCREENSHOT_INDEX.png
|
|
78
|
+
git diff --cached --quiet && echo "No screenshot changes" && exit 0
|
|
79
|
+
git commit -m "test: update SCREENSHOT_INDEX.png [skip ci]"
|
|
80
|
+
for attempt in 1 2 3; do
|
|
81
|
+
git push origin HEAD:main && break
|
|
82
|
+
echo "Push failed (attempt $attempt) — pulling and retrying"
|
|
83
|
+
git pull --rebase origin main || {
|
|
84
|
+
echo "Rebase conflict — aborting rebase and retrying"
|
|
85
|
+
git rebase --abort 2>/dev/null || true
|
|
86
|
+
}
|
|
87
|
+
sleep $((attempt * 2))
|
|
88
|
+
if [ "$attempt" -eq 3 ]; then
|
|
89
|
+
echo "::warning::Failed to push screenshot after 3 attempts"
|
|
90
|
+
fi
|
|
91
|
+
done
|
package/bin/agentic-lib.js
CHANGED
|
@@ -952,6 +952,8 @@ function initPurge(seedsDir, missionName, initTimestamp) {
|
|
|
952
952
|
"zero-main.test.js": "tests/unit/main.test.js",
|
|
953
953
|
"zero-index.html": "src/web/index.html",
|
|
954
954
|
"zero-web.test.js": "tests/unit/web.test.js",
|
|
955
|
+
"zero-behaviour.test.js": "tests/behaviour/homepage.test.js",
|
|
956
|
+
"zero-playwright.config.js": "playwright.config.js",
|
|
955
957
|
"zero-SOURCES.md": "SOURCES.md",
|
|
956
958
|
"zero-package.json": "package.json",
|
|
957
959
|
"zero-README.md": "README.md",
|
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Copyright (C) 2025-2026 Polycode Limited
|
|
3
|
+
import { test, expect } from "@playwright/test";
|
|
4
|
+
|
|
5
|
+
test("homepage returns 200 and renders", async ({ page }) => {
|
|
6
|
+
const response = await page.goto("/");
|
|
7
|
+
expect(response.status()).toBe(200);
|
|
8
|
+
|
|
9
|
+
await expect(page.locator("#lib-name")).toBeVisible();
|
|
10
|
+
await expect(page.locator("#lib-version")).toBeVisible();
|
|
11
|
+
await expect(page.locator("#demo-output")).toBeVisible();
|
|
12
|
+
|
|
13
|
+
await page.screenshot({ path: "SCREENSHOT_INDEX.png", fullPage: true });
|
|
14
|
+
});
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"build:web": "mkdir -p docs && touch docs/.nojekyll && cp -r src/web/* docs/ 2>/dev/null || true && node --input-type=commonjs -p \"var p=require('./package.json');['name','version','description'].map(function(k){return 'export const '+k+' = '+JSON.stringify(p[k])+';'}).join('\\n')\" > docs/lib-meta.js",
|
|
10
10
|
"test": "vitest --run tests/unit/*.test.js",
|
|
11
11
|
"test:unit": "vitest --run --coverage tests/unit/*.test.js",
|
|
12
|
+
"test:behaviour": "npx playwright test --config playwright.config.js",
|
|
12
13
|
"start": "npm run build:web && npx serve docs",
|
|
13
14
|
"start:cli": "node src/lib/main.js"
|
|
14
15
|
},
|
|
@@ -16,9 +17,10 @@
|
|
|
16
17
|
"author": "",
|
|
17
18
|
"license": "MIT",
|
|
18
19
|
"dependencies": {
|
|
19
|
-
"@xn-intenton-z2a/agentic-lib": "^7.1.
|
|
20
|
+
"@xn-intenton-z2a/agentic-lib": "^7.1.79"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
23
|
+
"@playwright/test": "^1.58.0",
|
|
22
24
|
"@vitest/coverage-v8": "^4.0.18",
|
|
23
25
|
"vitest": "^4.0.18"
|
|
24
26
|
},
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// Copyright (C) 2025-2026 Polycode Limited
|
|
3
|
+
import { defineConfig } from "@playwright/test";
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
testDir: "tests/behaviour",
|
|
7
|
+
timeout: 30000,
|
|
8
|
+
use: {
|
|
9
|
+
baseURL: "http://localhost:3000",
|
|
10
|
+
},
|
|
11
|
+
webServer: {
|
|
12
|
+
command: "npx serve docs -l 3000",
|
|
13
|
+
port: 3000,
|
|
14
|
+
reuseExistingServer: true,
|
|
15
|
+
},
|
|
16
|
+
projects: [
|
|
17
|
+
{ name: "chromium", use: { browserName: "chromium" } },
|
|
18
|
+
],
|
|
19
|
+
});
|