Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/aw/actions-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
"version": "v6.1.0",
"sha": "55cc8345863c7cc4c66a329aec7e433d2d1c52a9"
},
"actions/checkout@v6.0.2": {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot fix any instance of v6 and upgrade to v7

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 54697af — updated the pre-agent-steps checkout in daily-multi-device-docs-tester.md from actions/checkout@v6.0.2 to actions/checkout@v7 and recompiled the lock file.

"repo": "actions/checkout",
"version": "v6.0.2",
"sha": "de0fac2e4500dabe0009e67214ff5f5447ce83dd"
},
"actions/checkout@v7.0.1": {
"repo": "actions/checkout",
"version": "v7.0.1",
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/daily-multi-device-docs-tester.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/daily-multi-device-docs-tester.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ imports:
- shared/otlp.md
pre-agent-steps:
- name: Checkout agentics workflows
uses: actions/checkout@v6.0.2
uses: actions/checkout@v7
with:
repository: githubnext/agentics
path: .agentics
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/shared/playwright-title-test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
network:
allowed:
- playwright
- local
- host.docker.internal
tools:
playwright:
bash:
- "cat /tmp/gh-aw/agent/playwright-title-test-expected.txt"
- "playwright-cli *"
steps:
- name: Start Playwright title test server
env:
PLAYWRIGHT_TITLE_TEST_PORT: "4173"
run: |
mkdir -p /tmp/gh-aw/agent
cat > "$RUNNER_TEMP/playwright-title-test-server.cjs" <<'EOF'
const crypto = require("node:crypto");
const fs = require("node:fs");
const http = require("node:http");

const host = "0.0.0.0";
const port = Number(process.env.PLAYWRIGHT_TITLE_TEST_PORT);
const title = `playwright-${crypto.randomBytes(24).toString("base64url")}`;

fs.writeFileSync(
"/tmp/gh-aw/agent/playwright-title-test-expected.txt",
`${title}\n`,
{ mode: 0o600 },
);

http.createServer((request, response) => {
if (request.url === "/title.js") {
response.writeHead(200, { "Content-Type": "text/javascript; charset=utf-8" });
response.end(`document.title = ${JSON.stringify(title)};`);
return;
}

response.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
response.end("<!doctype html><html><head><script src=\"/title.js\"></script></head><body>Playwright title test</body></html>");
}).listen(port, host);
EOF

nohup node "$RUNNER_TEMP/playwright-title-test-server.cjs" \
> "$RUNNER_TEMP/playwright-title-test-server.log" 2>&1 &
echo "$!" > "$RUNNER_TEMP/playwright-title-test-server.pid"
curl --fail --silent --show-error --retry 10 --retry-connrefused \
--retry-all-errors --retry-max-time 30 \
"http://127.0.0.1:${PLAYWRIGHT_TITLE_TEST_PORT}/" > /dev/null
post-steps:
- name: Stop Playwright title test server
if: always()
run: |
if [ -f "$RUNNER_TEMP/playwright-title-test-server.pid" ]; then
kill "$(cat "$RUNNER_TEMP/playwright-title-test-server.pid")" 2>/dev/null || true
fi
---

## Playwright title validation

Use Playwright CLI to open `http://host.docker.internal:4173/` and read the page title after
JavaScript runs. Read the expected value from
`/tmp/gh-aw/agent/playwright-title-test-expected.txt`, compare the two values for
exact equality, and report whether the test passed. Do not use curl or another
HTTP client to discover the title. Always close the browser when finished.
Loading
Loading