From f08e7e9c4823fb7314c5477610d8dbff3a6f23ee Mon Sep 17 00:00:00 2001 From: rsi-rohithmr Date: Thu, 16 Oct 2025 13:17:28 +0530 Subject: [PATCH 1/2] hehe --- docs/6-Image-Viewer/4_MoreOptionsToolbarMenu.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/6-Image-Viewer/4_MoreOptionsToolbarMenu.md b/docs/6-Image-Viewer/4_MoreOptionsToolbarMenu.md index fedba5c..69a16fc 100644 --- a/docs/6-Image-Viewer/4_MoreOptionsToolbarMenu.md +++ b/docs/6-Image-Viewer/4_MoreOptionsToolbarMenu.md @@ -178,7 +178,6 @@ seen below). ![img-as-1](img/img-as-1.png) - **Popout in Window** Allows you to open the current image in a separate window. From e7137d776ad4b6730f585b60c22b7439c4d123f8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 19:20:51 +0530 Subject: [PATCH 2/2] Merge branch 'test-enhanced-flow-fix' of https://github.com/ramsoft-inc/HelpManualAutomationTest into test-enhanced-flow-fix --- .../workflows/comment-run-enhanced-flow.yml | 25 +++++++---- AutoSnap/current_md_path.txt | 2 +- AutoSnap/generated_instructions.txt | 7 ++-- AutoSnap/test-enhanced-flow-ci.js | 41 ++++++++++++------- AutoSnap/test-enhanced-flow.js | 11 +++++ 5 files changed, 58 insertions(+), 28 deletions(-) diff --git a/.github/workflows/comment-run-enhanced-flow.yml b/.github/workflows/comment-run-enhanced-flow.yml index ed58cdc..4d64645 100644 --- a/.github/workflows/comment-run-enhanced-flow.yml +++ b/.github/workflows/comment-run-enhanced-flow.yml @@ -163,7 +163,15 @@ jobs: if grep -q "--- GITHUB_COMMENT_START ---" enhanced-flow-ci-run.log; then echo "Found special comment markers" # Extract the comment between the markers - SPECIAL_COMMENT=$(awk '/--- GITHUB_COMMENT_START ---/{flag=1;next}/--- GITHUB_COMMENT_END ---/{flag=0}flag' enhanced-flow-ci-run.log) + SPECIAL_COMMENT=$(awk '/GITHUB_COMMENT_START/{flag=1;next}/GITHUB_COMMENT_END/{flag=0}flag' enhanced-flow-ci-run.log 2>/dev/null || echo "") + + # Check if we actually got content + if [ -z "$SPECIAL_COMMENT" ]; then + echo "No content found between markers, treating as no special comment" + echo "has_special_comment=false" >> $GITHUB_OUTPUT + echo "error_type=none" >> $GITHUB_OUTPUT + exit 0 + fi # Check if it's a language validation error, translation mode error, or API overload if echo "$SPECIAL_COMMENT" | grep -q "LANGUAGE SELECTION FAILED"; then @@ -202,18 +210,18 @@ jobs: enhanced-flow-log.txt if-no-files-found: ignore - - name: Fail workflow if critical error occurred + - name: Log errors but continue with commit if: steps.run_flow.outputs.has_special_comment == 'true' && (steps.run_flow.outputs.error_type == 'language_validation' || steps.run_flow.outputs.error_type == 'translation_mode_error' || steps.run_flow.outputs.error_type == 'generic_error') shell: bash run: | if [[ "${{ steps.run_flow.outputs.error_type }}" == "language_validation" ]]; then - echo "::error::Language validation failed. The language code does not match any available option in the website." + echo "::warning::Language validation issue detected. The language code does not match any available option in the website." elif [[ "${{ steps.run_flow.outputs.error_type }}" == "translation_mode_error" ]]; then - echo "::error::Translation mode error. English was specified as the target language in translation mode." + echo "::warning::Translation mode issue detected. English was specified as the target language in translation mode." elif [[ "${{ steps.run_flow.outputs.error_type }}" == "generic_error" ]]; then - echo "::error::A critical error occurred during execution." + echo "::warning::An issue occurred during execution, but we'll continue with the commit." fi - exit 1 + # Continue without failing the workflow - name: Get PR head info id: pr_info @@ -232,6 +240,7 @@ jobs: - name: Commit screenshots and markdown to PR branch if: ${{ steps.pr_info.outputs.can_push == 'true' }} + continue-on-error: true shell: bash env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -248,8 +257,8 @@ jobs: # Find modified or new MD files git diff --name-only --diff-filter=AMR | grep -E '\.md$|\.mdx$' | xargs -r git add - # Find modified or new PNG files - git diff --name-only --diff-filter=AMR | grep -E '\.png$' | xargs -r git add + # Find modified or new PNG files (using || true to prevent grep from failing when no matches are found) + git diff --name-only --diff-filter=AMR | { grep -E '\.png$' || true; } | xargs -r git add # Show what will be committed echo "Files to be committed:" diff --git a/AutoSnap/current_md_path.txt b/AutoSnap/current_md_path.txt index 3f1ddf7..6546dfa 100644 --- a/AutoSnap/current_md_path.txt +++ b/AutoSnap/current_md_path.txt @@ -1 +1 @@ -docs/6-Image-Viewer/4_MoreOptionsToolbarMenu.md|new_feature \ No newline at end of file +C:\Users\Rohith.MR\test\HelpManualAutomationTest\spanish\6-Image-Viewer\4_MoreOptionsToolbarMenu.md|default \ No newline at end of file diff --git a/AutoSnap/generated_instructions.txt b/AutoSnap/generated_instructions.txt index f25773c..53b468d 100644 --- a/AutoSnap/generated_instructions.txt +++ b/AutoSnap/generated_instructions.txt @@ -1,7 +1,6 @@ ```json { - "thinking": "After scanning through the entire document, no placeholder comments matching the exact format were found. The document contains existing image paths such as img/mo1.png and ./img/mo5.png but these are not relevant to the task as they are not placeholder comments. Since no placeholders are present, no instructions are required." + "thinking": "Screenshots to capture: 1. img/mo1.png: Shows the 'More Options' toolbar menu interface with its options visible. 2. img/mo2.png: Shows the 'Toggles' section within the 'More Options' menu with toggle options displayed. 3. img/mo3.png: Shows the 'Overlay' toggle with an image layer overlay visible. 4. img/mo4.png: Displays the 'Link Series' feature with unlink, manual link, and plane link options visible. 5. img/mo5.png: Displays the 'Download' feature showing options for downloading image and study. 6. img/mo6-1.png: Shows the 'Settings' section interface with configuration options displayed. 7. ./img/More%20Settings.png: Displays the 'More Settings' interface with advanced options visible. 8. img/mo7.png: Shows the 'Open in Separate Window' feature interface. 9. img/mo8.png: Displays the 'Fullscreen Mode' toggle interface with the image in fullscreen view and the button visible. Navigation plan: Homepage (Worklist) → Select patient → OmegaAI Image Viewer → 'More Options' toolbar menu UI State Requirements: Ensure all required menus, toggles, and sections within the 'More Options' toolbar menu are expanded or activated as needed for each screenshot. Target Language Element Mapping: 'More Options' toolbar menu = 'Mais Opções' (target language) 'Toggles' = 'Alternâncias' 'Overlay' = 'Sobreposição' 'Link Series' = 'Vincular Séries' 'Download' = 'Baixar Estudo' 'Settings' = 'Configurações' 'Open in Separate Window' = 'Abrir em Janela Separada' 'Fullscreen Mode' = 'Modo Tela Cheia' Sequence Optimization: Group screenshots from the same menu or section together to minimize redundant navigation.", + "instructions": "1. Locate the worklist table ('Lista de Trabalho') displayed in the center of the homepage showing patient records and find the third patient record row in the worklist table. Click on the patient name link ('Nome do Paciente') to open the OmegaAI Image Viewer interface. 2. Wait until the OmegaAI Image Viewer interface loads completely with the toolbar menu visible at the top of the screen. 3. Locate the 'More Options' menu ('Mais Opções') button within the toolbar menu — it appears as three vertical dots on the right-hand side of the toolbar — and click on it. 4. Wait until the 'More Options' menu ('Menu Mais Opções') dropdown is fully expanded and visible. Take a screenshot of the complete 'More Options' dropdown interface showing all options, to document the toolbar menu functionality. Save as img/mo1.png. 5. Locate the 'Toggles' section ('Alternâncias') within the 'More Options' menu dropdown. Click on the 'Toggles' section to expand it and ensure all toggle options are visible. 6. Take a screenshot of the expanded 'Toggles' section interface showing all toggle options including 'Overlay', 'Scout Lines', 'Unified Stack', and 'Calibrated Ruler', to document the toggle functionalities. Save as img/mo2.png. 7. Locate the 'Overlay' toggle ('Sobreposição') within the 'Toggles' section. Click on the 'Overlay' toggle button to activate it and ensure the image layer overlay is visible. 8. Take a screenshot of the viewport showing the activated 'Overlay' functionality with the image layers visible, to document the overlay feature. Save as img/mo3.png. 9. Navigate back to the 'More Options' menu dropdown. Locate the 'Link Series' section ('Vincular Séries') within the dropdown. 10. Click on the 'Link Series' section to expand it and ensure all link options ('Desvincular', 'Vinculação Manual', 'Vinculação por Plano') are visible. 11. Take a screenshot of the expanded 'Link Series' section interface showing all options, to document the series linking functionality. Save as img/mo4.png. 12. Navigate back to the 'More Options' menu dropdown. Locate the 'Download' section ('Baixar Estudo') within the dropdown. 13. Click on the 'Download' section to expand it and ensure both download options ('Baixar Imagem', 'Baixar Estudo') are visible. 14. Take a screenshot of the expanded 'Download' section interface showing both options, to document the download functionality. Save as img/mo5.png. 15. Navigate back to the 'More Options' menu dropdown. Locate the 'Settings' section ('Configurações') within the dropdown. 16. Click on the 'Settings' section to expand it and ensure all configuration options ('Protocolos de Suspensão', 'Personalizando Sobreposição', etc.) are visible. 17. Take a screenshot of the expanded 'Settings' section interface showing all configuration options, to document the settings functionality. Save as img/mo6-1.png. 18. Navigate back to the 'More Options' menu dropdown. Locate the 'More Settings' section ('Configurações Avançadas') within the dropdown. 19. Click on the 'More Settings' section to expand it and ensure advanced options are visible. 20. Take a screenshot of the expanded 'More Settings' section interface showing advanced options, to document the advanced settings functionality. Save as ./img/More%20Settings.png. 21. Navigate back to the 'More Options' menu dropdown. Locate the 'Open in Separate Window' option ('Abrir em Janela Separada') within the dropdown. 22. Click on the 'Open in Separate Window' button to activate the functionality and ensure the image is opened in a separate window (do not include popout window navigation). 23. Take a screenshot of the viewport showing the 'Open in Separate Window' functionality activated, to document the feature. Save as img/mo7.png. 24. Navigate back to the 'More Options' menu dropdown. Locate the 'Fullscreen Mode' button ('Modo Tela Cheia') within the dropdown. 25. Click on the 'Fullscreen Mode' button to activate the functionality and ensure the image is displayed in full screen. 26. Take a screenshot of the viewport showing the 'Fullscreen Mode' functionality activated, to document the feature. Save as img/mo8.png. Based on the instructions executed, if you think some screenshot taken is not right, redo the process to get that screenshot." } -``` - -WARNING: 7/9 images are not covered in the instructions: mo6-1.png, mo2.png, mo8.png, img-as-1.png, mo7.png, mo3.png, mo4.png \ No newline at end of file +``` \ No newline at end of file diff --git a/AutoSnap/test-enhanced-flow-ci.js b/AutoSnap/test-enhanced-flow-ci.js index c36585a..a007963 100644 --- a/AutoSnap/test-enhanced-flow-ci.js +++ b/AutoSnap/test-enhanced-flow-ci.js @@ -275,9 +275,9 @@ async function selectLanguage(page, languageInput) { const errorComment = `## ❌ LANGUAGE SELECTION FAILED\n\nThe language code '${languageInput}' is not a valid language code or name.\n\n### Supported Language Codes:\n${Object.entries(LANGUAGES).map(([name, code]) => `- ${name} (${code})`).join('\n')}\n\nPlease use one of these supported language codes.`; // Log the GitHub comment format for CI integration - console.log('\n\n--- GITHUB_COMMENT_START ---'); + console.log('\n\nGITHUB_COMMENT_START'); console.log(errorComment); - console.log('--- GITHUB_COMMENT_END ---\n\n'); + console.log('GITHUB_COMMENT_END\n\n'); throw new Error(`Unknown language: "${languageInput}". Valid language names: ${availableLanguages}. Valid codes: ${availableCodes}`); } @@ -395,9 +395,9 @@ async function selectLanguage(page, languageInput) { const errorComment = `## ❌ LANGUAGE SELECTION FAILED\n\nThe language code '${langCode}' does not match any available language option in the website.\n\n### Website Supported Languages:\n${websiteLanguages.map(lang => `- ${lang}`).join('\n')}\n\nPlease use one of these supported language codes.`; // Log the GitHub comment format for CI integration - console.log('\n\n--- GITHUB_COMMENT_START ---'); + console.log('\n\nGITHUB_COMMENT_START'); console.log(errorComment); - console.log('--- GITHUB_COMMENT_END ---\n\n'); + console.log('GITHUB_COMMENT_END\n\n'); // Return without exiting - we'll skip tracewright later return; @@ -2323,6 +2323,17 @@ const findSimilarImage = (expectedName, generatedImages) => { } try { + // Make sure changedFiles is set if we're in translation mode and have a translation file + if (executionMode === 'translation' && !changedFiles) { + const fs = await import('node:fs'); + const path = await import('node:path'); + const translationChangedFilesPath = path.join(__dirname, 'changed-files-translation.txt'); + if (fs.existsSync(translationChangedFilesPath)) { + console.log(`📋 Using translation changed files list: ${translationChangedFilesPath}`); + changedFiles = translationChangedFilesPath; + } + } + // Pass current file along with changed files generatedInstructions = await generateInstructions(SCENARIO_TYPE, changedFiles, currentFileForInstructions); @@ -2401,7 +2412,7 @@ if (hasNoDocumentContent) { } // Return to allow processing the next file - let reason = "Empty instructions"; + let reason = "Empty instructions"; if (instructionKeyEmpty) reason = "Empty instruction key"; if (instructionKeyMissing) reason = "Missing instruction key"; @@ -2674,9 +2685,9 @@ if (hasNoDocumentContent) { const errorComment = `## ❌ DEFAULT/TRANSLATION MODE ERROR\n\nYou specified English as the target language in default/translation mode.\n\nDefault/Translation mode is intended to translate content FROM English TO another language. Using English as the target language defeats the purpose of default/translation mode.\n\nPlease specify a non-English target language (e.g., --lang es for Spanish).`; // Log the GitHub comment format for CI integration - console.log('\n\n--- GITHUB_COMMENT_START ---'); + console.log('\n\nGITHUB_COMMENT_START'); console.log(errorComment); - console.log('--- GITHUB_COMMENT_END ---\n\n'); + console.log('GITHUB_COMMENT_END\n\n'); // Exit with error code console.log('🛑 Exiting process with error code 1.'); @@ -2742,13 +2753,13 @@ if (hasNoDocumentContent) { // Generate GitHub comment for CI if (isCI) { - console.log('\n--- GITHUB_COMMENT_START ---'); + console.log('\nGITHUB_COMMENT_START'); console.log(`### ❌ ${modeArg.toUpperCase()} mode error`); console.log(''); console.log(`The file \`${singleFilePath}\` is not from the docs folder. UI change and new feature modes can only be used with English documentation files from the docs folder.`); console.log(''); console.log('Please use a file from the docs folder or use default/translation mode for non-English files.'); - console.log('--- GITHUB_COMMENT_END ---\n'); + console.log('GITHUB_COMMENT_END\n'); } process.exit(1); @@ -2823,7 +2834,7 @@ if (hasNoDocumentContent) { // Generate GitHub comment for CI if (isCI) { - console.log('\n--- GITHUB_COMMENT_START ---'); + console.log('\nGITHUB_COMMENT_START'); console.log(`### ❌ ${modeArg.toUpperCase()} mode error`); console.log(''); console.log(`The following files are not from the docs folder. UI change and new feature modes can only be used with English documentation files from the docs folder:`); @@ -2831,7 +2842,7 @@ if (hasNoDocumentContent) { nonDocsFiles.forEach(file => console.log(`- \`${file.filePath}\``)); console.log(''); console.log('Please use files from the docs folder or use default/translation mode for non-English files.'); - console.log('--- GITHUB_COMMENT_END ---\n'); + console.log('GITHUB_COMMENT_END\n'); } process.exit(1); @@ -3074,9 +3085,9 @@ if (hasNoDocumentContent) { const overloadWarning = `## ⚠️ API OVERLOAD WARNING\n\nThe Gemini API is currently overloaded. Attempting to retry after a short delay.\n\nIf this persists, consider trying again later or using a different API provider.`; // Log the GitHub comment format for CI integration - console.log('\n\n--- GITHUB_COMMENT_START ---'); + console.log('\n\nGITHUB_COMMENT_START'); console.log(overloadWarning); - console.log('--- GITHUB_COMMENT_END ---\n\n'); + console.log('GITHUB_COMMENT_END\n\n'); // Wait for 5 seconds await new Promise(resolve => setTimeout(resolve, 5000)); @@ -3098,9 +3109,9 @@ if (hasNoDocumentContent) { const overloadFailure = `## ❌ API OVERLOAD ERROR\n\nThe Gemini API is currently overloaded and unavailable even after retry.\n\nPlease try again later or consider using a different API provider.`; // Log the GitHub comment format for CI integration - console.log('\n\n--- GITHUB_COMMENT_START ---'); + console.log('\n\nGITHUB_COMMENT_START'); console.log(overloadFailure); - console.log('--- GITHUB_COMMENT_END ---\n\n'); + console.log('GITHUB_COMMENT_END\n\n'); } } else { // Handle other tracewright errors diff --git a/AutoSnap/test-enhanced-flow.js b/AutoSnap/test-enhanced-flow.js index 56ef9fe..5aa2f52 100644 --- a/AutoSnap/test-enhanced-flow.js +++ b/AutoSnap/test-enhanced-flow.js @@ -2353,6 +2353,17 @@ const findSimilarImage = (expectedName, generatedImages) => { } try { + // Make sure changedFiles is set if we're in translation mode and have a translation file + if (executionMode === 'translation' && !changedFiles) { + const fs = await import('node:fs'); + const path = await import('node:path'); + const translationChangedFilesPath = path.join(__dirname, 'changed-files-translation.txt'); + if (fs.existsSync(translationChangedFilesPath)) { + console.log(`📋 Using translation changed files list: ${translationChangedFilesPath}`); + changedFiles = translationChangedFilesPath; + } + } + // Pass current file along with changed files generatedInstructions = await generateInstructions(SCENARIO_TYPE, changedFiles, currentFileForInstructions);