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
10 changes: 10 additions & 0 deletions .github/workflows/comment-run-enhanced-flow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ jobs:
enhanced-flow-ci-run.log
enhanced-flow-log.txt
changed-files-*.txt
changed-files-screenshots.txt
token_usage_summary.txt
AutoSnap/enhanced-flow-log.txt
AutoSnap/token_usage_summary.txt
Expand Down Expand Up @@ -177,6 +178,15 @@ jobs:
set -e
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Prefer explicit list if available
if [ -f changed-files-screenshots.txt ]; then
echo "Using changed-files-screenshots.txt for staging..."
sed -e 's/\r$//' changed-files-screenshots.txt | while IFS= read -r f; do
if [ -n "$f" ] && [ -f "$f" ]; then
git add -- "$f"
fi
done
fi
# Stage images from common output locations
if [ -d AutoSnap/screenshots ]; then
find AutoSnap/screenshots -type f \
Expand Down
13 changes: 13 additions & 0 deletions AutoSnap/tracewrightt/src/screenshot_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { Page } from '@playwright/test';
export async function forceScreenshotWithRetries(cmd: string, page: Page, aiUtils?: any): Promise<void> {
const MAX_RETRIES = 1;
let lastError: Error | null = null;
const fs = require('fs');
const path = require('path');

// Extract the screenshot path from the command string for logging and fallback use.
const pathMatch = cmd.match(/path:\s*['"]([^'"]+)['"]/);
Expand Down Expand Up @@ -99,6 +101,17 @@ export async function forceScreenshotWithRetries(cmd: string, page: Page, aiUtil

// If the command succeeds, we log it and update markdown immediately
console.log(`✅ Success on attempt ${attempt}! Screenshot saved to ${screenshotPath}`);

// Append repo-relative screenshot path to a changed files list for CI commit step
try {
const repoRoot = process.cwd();
const relative = path.relative(repoRoot, String(screenshotPath)).replace(/\\/g, '/');
const listPath = path.join(repoRoot, 'changed-files-screenshots.txt');
fs.appendFileSync(listPath, `${relative}\n`, { encoding: 'utf8' });
console.log(`📝 Appended screenshot to list: ${relative}`);
} catch (appendErr) {
console.warn('⚠️ Could not append screenshot path to list:', appendErr);
}

// Update markdown file path immediately after successful screenshot
if (aiUtils && aiUtils.updateSingleImagePath) {
Expand Down
1 change: 1 addition & 0 deletions docs/6-Image-Viewer/4_MoreOptionsToolbarMenu_autosnap.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ seen below).

Allows you to open the current image in a separate window.


![mo7](./img_as/mo7_E.png)

**Fullscreen Mode (Toggle Button)**
Expand Down