From 0071b7626e2d194702db39e3e2a0630340b7442d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 4 Nov 2025 06:35:19 +0000 Subject: [PATCH] Fix screenshot paths consistency and simplify CHECKLIST script syntax Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com> --- .github/agents/CHECKLIST.md | 26 +++++++++++++------------- .github/agents/code-change-agent.md | 4 ++-- .github/agents/screenshot-guide.md | 3 ++- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/agents/CHECKLIST.md b/.github/agents/CHECKLIST.md index 7e0fae0b75..0b61f590b2 100644 --- a/.github/agents/CHECKLIST.md +++ b/.github/agents/CHECKLIST.md @@ -53,19 +53,19 @@ npx playwright install chromium # 2. Create directory mkdir -p /tmp/pr-screenshots -# 3. Use this template (save as /tmp/capture.js) -cat > /tmp/capture.js << 'EOF' -const { chromium } = require('playwright'); -(async () => { - const browser = await chromium.launch(); - const page = await browser.newPage(); - await page.setViewportSize({ width: 1920, height: 1080 }); - await page.goto('http://localhost/console'); // Appwrite console URL (adjust path as needed) - await page.waitForLoadState('networkidle'); - await page.screenshot({ path: '/tmp/pr-screenshots/screenshot.png', fullPage: true }); - await browser.close(); -})(); -EOF +# 3. Create a simple script (save as /tmp/capture.js): +# Copy the example below, modify the URL, and save to /tmp/capture.js: +# +# const { chromium } = require('playwright'); +# (async () => { +# const browser = await chromium.launch(); +# const page = await browser.newPage(); +# await page.setViewportSize({ width: 1920, height: 1080 }); +# await page.goto('http://localhost/console'); // Adjust URL as needed +# await page.waitForLoadState('networkidle'); +# await page.screenshot({ path: '/tmp/pr-screenshots/screenshot.png', fullPage: true }); +# await browser.close(); +# })(); # 4. Run it node /tmp/capture.js diff --git a/.github/agents/code-change-agent.md b/.github/agents/code-change-agent.md index 5bae31634b..4184d00758 100644 --- a/.github/agents/code-change-agent.md +++ b/.github/agents/code-change-agent.md @@ -52,7 +52,7 @@ Take screenshots in the following scenarios: // Take screenshot await page.screenshot({ - path: 'screenshot-before.png', + path: '/tmp/pr-screenshots/screenshot-before.png', fullPage: true }); @@ -76,7 +76,7 @@ Take screenshots in the following scenarios: test('capture UI changes', async ({ page }) => { // Appwrite console runs on http://localhost by default await page.goto('http://localhost/console'); - await expect(page).toHaveScreenshot('ui-state.png'); + await expect(page).toHaveScreenshot('/tmp/pr-screenshots/ui-state.png'); }); ``` diff --git a/.github/agents/screenshot-guide.md b/.github/agents/screenshot-guide.md index 01e114ca8b..aed50a5a31 100644 --- a/.github/agents/screenshot-guide.md +++ b/.github/agents/screenshot-guide.md @@ -142,7 +142,8 @@ Drag and drop images into a PR comment or paste from clipboard. ### Option 3: Use GitHub CLI ```bash -gh pr comment PR_NUMBER --body "📸 Screenshots attached" -F /tmp/pr-screenshots/screenshot.png +# Upload screenshots by dragging files into the PR comment box in the web UI +# Or use the GitHub API to attach images ``` ## Pro Tips