diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/internal/ui_test_report.json b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/internal/ui_test_report.json new file mode 100644 index 0000000..887cf09 --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/internal/ui_test_report.json @@ -0,0 +1,158 @@ +{ + "login_scenario": "Skipped", + "workflow_completed": false, + "workflow_result": "FAIL", + "workflow_error": "", + "login_agent_activity_summary": "Not available", + "user_scenario_agent_activity_summary": "Not available", + "generated_files": { + "feature_files": [], + "json_files": [] + }, + "scenarios": { + "w01_mortgage_1": { + "test_name": "w01_mortgage_1", + "description": "Scenario run is working", + "testFilePath": "", + "extracted_data": "www.mortgage.leumi.co.il/extracted_data/captured_ui_data.json" + } + }, + "token_usage": { + "total": { + "input": 1004188, + "output": 25096, + "total": 1029284, + "cost": 0.8991279999999998, + "cached_input": 873344 + }, + "sessions": { + "main_execution": { + "type": "root", + "input": 0, + "output": 0, + "total": 0, + "cost": 0.0, + "cached_input": 0, + "call_count": 0, + "start_time": 1777272984.4516163, + "end_time": 1777273545.479732, + "duration": 561.0281157493591 + }, + "worker_supervisor_WF001": { + "type": "worker_supervisor", + "input": 4282, + "output": 324, + "total": 4606, + "cost": 0.0077, + "cached_input": 2304, + "call_count": 3, + "start_time": 1777272984.6681669, + "end_time": 1777273080.1189423, + "duration": 95.45077538490295 + }, + "explore_worker_WF001_a1": { + "type": "auto_created", + "input": 45314, + "output": 1379, + "total": 46693, + "cost": 0.065372, + "cached_input": 24192, + "call_count": 4, + "start_time": 1777273007.227826, + "end_time": null, + "duration": null + }, + "explore_worker_WF001_a2": { + "type": "auto_created", + "input": 36658, + "output": 1197, + "total": 37855, + "cost": 0.051019999999999996, + "cached_input": 21248, + "call_count": 4, + "start_time": 1777273054.768088, + "end_time": null, + "duration": null + }, + "explore_synthesize_single_workflow": { + "type": "auto_created", + "input": 2532, + "output": 1877, + "total": 4409, + "cost": 0.02008, + "cached_input": 0, + "call_count": 1, + "start_time": 1777273093.3811412, + "end_time": null, + "duration": null + }, + "report_curation_WF001": { + "type": "auto_created", + "input": 5290, + "output": 203, + "total": 5493, + "cost": 0.012204000000000001, + "cached_input": 0, + "call_count": 1, + "start_time": 1777273097.996647, + "end_time": null, + "duration": null + }, + "post_explore_testgen": { + "type": "root", + "input": 0, + "output": 0, + "total": 0, + "cost": 0.0, + "cached_input": 0, + "call_count": 0, + "start_time": 1777273098.4219942, + "end_time": 1777273545.4790082, + "duration": 447.0570139884949 + }, + "pom_gen_w01_mortgage_1": { + "type": "test_generation", + "input": 46513, + "output": 1573, + "total": 48086, + "cost": 0.045514000000000006, + "cached_input": 40064, + "call_count": 7, + "start_time": 1777273098.4241147, + "end_time": null, + "duration": null + }, + "test_gen_pom_w01_mortgage_1": { + "type": "test_generation", + "input": 56074, + "output": 1439, + "total": 57513, + "cost": 0.050316, + "cached_input": 48896, + "call_count": 7, + "start_time": 1777273112.0834987, + "end_time": null, + "duration": null + }, + "code_repair_w01_mortgage_1_pom.noauth.spec.js": { + "type": "code_repair", + "input": 807525, + "output": 17104, + "total": 824629, + "cost": 0.6469219999999999, + "cached_input": 736640, + "call_count": 75, + "start_time": 1777273152.3123813, + "end_time": 1777273545.4450586, + "duration": 393.13267731666565 + } + }, + "provider": "azure_open_ai", + "model": "gpt-4.1", + "timestamp": "2026-04-27T07:05:45.480090", + "cache_statistics": { + "total_cached_tokens": 873344, + "cache_hit_rate_percent": 87.0 + } + } +} \ No newline at end of file diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/.roost/metadata.json b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/.roost/metadata.json new file mode 100644 index 0000000..efee251 --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/.roost/metadata.json @@ -0,0 +1,207 @@ +{ + "metadata_version": "1.0", + "created_at": "2026-04-27T06:56:24.447919", + "last_updated": "2026-04-27T07:05:45.481947", + "output_dir": "RoostGPT/ui-test_leumi/be2bf4ce-8e7c-4d7f-a31b-ceb4abbe131f/source/UI-Testing-ATID/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests", + "site_url": "https://www.mortgage.leumi.co.il", + "pom_files": [ + { + "url": "", + "file_name": "HomePage.js", + "file_path": "pom_tests/pom/HomePage.js" + }, + { + "url": "", + "file_name": "MortgageStartPage.js", + "file_path": "pom_tests/pom/MortgageStartPage.js" + }, + { + "url": "", + "file_name": "MortgageWorkflowPage.js", + "file_path": "pom_tests/pom/MortgageWorkflowPage.js" + } + ], + "Login_File": { + "name": null, + "path": null, + "hash": null, + "agent_workflow_completed": false, + "agent_workflow_file_path": null, + "agent_interaction_file_path": null, + "agent_activity_summary": null, + "agent_activity_error": null, + "agent_activity_outcome": null, + "agent_recommendation": null, + "agent_completion_level": null, + "agent_steps_completed": null, + "execution_flow_file_path": null, + "systematic_selectors_file_path": null, + "scenario_name": null, + "scenario_file_path": null, + "test_generated": false, + "test_generation_error": null, + "test_file_path": null, + "test_executed_success": null, + "test_execution_error": null, + "pom_test_name": null, + "pom_test_file_path": null, + "pom_test_executed_success": null, + "pom_test_execution_error": null, + "pom_files": null + }, + "Workflows": [ + { + "workflow_id": "WF001", + "title": "Primary Business Workflow", + "goal": "Verify users can reliably initiate the mortgage workflow from the homepage", + "feature_area": "Mortgage application and information portal", + "priority": "high", + "starting_hint": "", + "discovery_source": "user_scenario", + "source_file": "/var/tmp/Roost/RoostGPT/ui-test_leumi/be2bf4ce-8e7c-4d7f-a31b-ceb4abbe131f/mortgage (1).txt", + "source_file_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "worker_completed": true, + "worker_result": "success", + "linked_scenario_name": "w01_mortgage_1", + "error": null, + "scenario_name": "w01_mortgage_1", + "scenario_file_path": "generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/scenarios/WF001_mortgage_1.json", + "scenario_summary_file_path": "generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/scenarios/summaries/WF001_mortgage_1.md", + "report_pdf_file_path": "generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/scenarios/reports/WF001_mortgage_1.pdf", + "feature_file_path": null, + "feature_file_name": null, + "agent_workflow_file_path": "/var/tmp/Roost/RoostGPT/ui-test_leumi/be2bf4ce-8e7c-4d7f-a31b-ceb4abbe131f/temp_info/www.mortgage.leumi.co.il/extracted_data/execution_flow_WF001_mortgage_1.json", + "agent_workflow_completed": true, + "scenario_analysis_result_file_path": null, + "agent_activity_summary": [ + "Agent initiated the mortgage workflow by navigating to https://www.mortgage.leumi.co.il. The agent successfully identified and interacted with the 'בואו נתחיל' (Let's Start) button twice, ensuring stable selector capture and workflow initiation. After each click, the agent was redirected to https://mortgage.leumi.co.il/minisite/mortgage. The agent performed a fresh navigation to the starting page to validate content loading and repeated the workflow initiation. The scenario concluded with the agent documenting the completed steps and reporting a hard blocker as per QA instructions." + ], + "agent_activity_error": [ + "During execution, the agent encountered a workflow loop: after clicking 'בואו נתחיל', the agent was redirected to the mortgage minisite but returned to the starting page for a fresh attempt. This detour did not prevent progress, as the agent successfully repeated the workflow initiation. No unrecoverable errors occurred; all actions were completed as intended." + ], + "agent_activity_outcome": [ + "The agent achieved the scenario goal by successfully initiating the mortgage workflow and interacting with the required elements. All critical steps were completed, and the workflow was properly documented." + ], + "agent_recommendation": "Review the workflow for potential loop or redirection issues that may impact user experience. Ensure that subsequent steps beyond the initial workflow initiation are accessible and stable for end-to-end testing.", + "agent_completion_level": "complete", + "agent_steps_completed": 5, + "visited_urls": [ + "https://www.mortgage.leumi.co.il/", + "https://mortgage.leumi.co.il/minisite/mortgage", + "https://www.mortgage.leumi.co.il" + ], + "execution_flow_file_path": null, + "test_generated": true, + "test_generation_error": null, + "test_name": "w01_mortgage_1", + "test_file_path": "generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/w01_mortgage_1_pom.noauth.spec.js", + "test_executed_success": true, + "test_execution_error": null, + "pom_test_name": "w01_mortgage_1_pom.noauth.spec.js", + "pom_test_file_path": "generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/w01_mortgage_1_pom.noauth.spec.js", + "pom_test_executed_success": true, + "pom_test_execution_error": null, + "pom_files": [ + { + "url": "", + "file_name": "HomePage.js", + "file_path": "pom_tests/pom/HomePage.js" + }, + { + "url": "", + "file_name": "MortgageStartPage.js", + "file_path": "pom_tests/pom/MortgageStartPage.js" + }, + { + "url": "", + "file_name": "MortgageWorkflowPage.js", + "file_path": "pom_tests/pom/MortgageWorkflowPage.js" + } + ], + "test_steps": [ + "Load homepage", + "Click the 'בואו נתחיל' (Let's Start) button to initiate mortgage workflow", + "Navigate to mortgage workflow page after button click", + "Return to homepage for fresh start", + "Repeat click on 'בואו נתחיל' (Let's Start) button to confirm selector stability", + "Navigate to mortgage workflow page after repeated button click" + ], + "video_recording_path": "/var/tmp/Roost/RoostGPT/ui-test_leumi/be2bf4ce-8e7c-4d7f-a31b-ceb4abbe131f/temp_info/www.mortgage.leumi.co.il/extracted_data/recordings/WF001_a2/069ef08d-1794-7653-8000-d387a8a87ae4.mp4" + } + ], + "explore_focus_areas": [], + "Imported_Test_Coverage": null, + "Token_Usage": { + "cumulative": { + "input_tokens": 1004188, + "output_tokens": 25096, + "cached_input_tokens": 0, + "total_tokens": 1029284, + "total_cost_usd": 0.899128 + }, + "runs": [ + { + "run_type": "generate", + "timestamp": "2026-04-27T07:05:45.480090", + "provider": "azure_open_ai", + "model": "gpt-4.1", + "input_tokens": 1004188, + "output_tokens": 25096, + "total_tokens": 1029284, + "cost_usd": 0.899128, + "sessions": { + "main_execution": { + "input": 0, + "output": 0, + "cost": 0.0 + }, + "worker_supervisor_WF001": { + "input": 4282, + "output": 324, + "cost": 0.0077 + }, + "explore_worker_WF001_a1": { + "input": 45314, + "output": 1379, + "cost": 0.065372 + }, + "explore_worker_WF001_a2": { + "input": 36658, + "output": 1197, + "cost": 0.05102 + }, + "explore_synthesize_single_workflow": { + "input": 2532, + "output": 1877, + "cost": 0.02008 + }, + "report_curation_WF001": { + "input": 5290, + "output": 203, + "cost": 0.012204 + }, + "post_explore_testgen": { + "input": 0, + "output": 0, + "cost": 0.0 + }, + "pom_gen_w01_mortgage_1": { + "input": 46513, + "output": 1573, + "cost": 0.045514 + }, + "test_gen_pom_w01_mortgage_1": { + "input": 56074, + "output": 1439, + "cost": 0.050316 + }, + "code_repair_w01_mortgage_1_pom.noauth.spec.js": { + "input": 807525, + "output": 17104, + "cost": 0.646922 + } + } + } + ] + } +} \ No newline at end of file diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/README.md b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/README.md new file mode 100644 index 0000000..697d7b2 --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/README.md @@ -0,0 +1,84 @@ +# Playwright Test Suite + +## RoostGpt Generated playwright test + +This project contains Playwright-based automated tests located in the `playwright_tests` directory. + +## 📁 Directory Structure + +```bash + playwright_tests/ + ├── README.md + ├── pom_tests/ + │ ├── pom/ + │ │ └── *.js (pom pages) + │ ├── *_pom.spec.js (pom test files) + │ ├── package.json + │ └── playwright.config.js + ├── scenarios/ + │ ├── reports/ + │ │ └── *.pdf (summary with images) + │ ├── summaries/ + │ │ └── *.md (text only summary) + │ └── *.json (scenario files) + └── tests/ + ├── package.json + ├── playwright.config.js + ├── .env.template + ├── *.spec.js (test files) + └── test_summary.md +``` + +## 🧩 Prerequisites + +Make sure you have the following installed: + +- [Node.js](https://nodejs.org/) (version 18 or higher recommended) +- npm (comes with Node.js) + +## 📦 Setup + +1. Navigate to the Playwright tests directory: + +2. Install dependencies: + + ```bash + cd pom_tests or tests # depending on test type generated + cp .env.template .env + npm install + ``` + +3. Edit the `.env` file to set any required environment variables. +## 🚀 Running Tests + +To execute all Playwright tests: + +```bash +npx playwright test # You can provide --headed flag to run tests in headed mode +``` + +You can also run a specific test file: + +```bash +npx playwright test example.spec.js +``` + +> Replace `example.spec.js` with the actual test file you want to run. + +## 📂 Test Reports + +After the tests run, Playwright will generate a report. To view the report: + +```bash +npx playwright show-report +``` + +## ⚙️ Configuration + +Test configuration is defined in `playwright.config.js`. + +You can modify settings like test directory, timeout etc., in this file. + +## 📘 More Info + +For detailed Playwright documentation, visit: [https://playwright.dev](https://playwright.dev) diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/.env.template b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/.env.template new file mode 100644 index 0000000..e51ad55 --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/.env.template @@ -0,0 +1,13 @@ +# Environment Configuration Template +# This file contains safe placeholder values for version control +# Actual credentials will be injected at runtime from your source env file + +# Application Configuration +BASE_HOST_URL='https://www.mortgage.leumi.co.il' +BASE_URL='https://www.mortgage.leumi.co.il' +CI='' +COOKIE_GRACE_PERIOD_MINUTES='' + +# Authentication & Credentials (POPULATED AT RUNTIME) +# These values are automatically loaded during test execution +# DO NOT enter real credentials here \ No newline at end of file diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/package.json b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/package.json new file mode 100644 index 0000000..d116d90 --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/package.json @@ -0,0 +1,24 @@ + + { + "name": "pom-playwright-tests", + "version": "1.0.0", + "type": "module", + "description": "A robust suite of end-to-end tests using Playwright.", + "scripts": { + "test": "npx playwright test", + "test:headed": "npx playwright test --headed", + "report": "npx playwright show-report" + }, + "keywords": [ + "playwright", + "testing", + "e2e", + "automation" + ], + "author": "", + "license": "ISC", + "devDependencies": { + "@playwright/test": "1.55.0", + "dotenv": "^16.4.5" + } + } diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/playwright.config.js b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/playwright.config.js new file mode 100644 index 0000000..efb0541 --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/playwright.config.js @@ -0,0 +1,217 @@ + +import { defineConfig } from "@playwright/test"; + +import * as fs from "fs"; +import * as path from "path"; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +/** + * @see https://playwright.dev/docs/test-configuration + * + * This configuration automatically reuses authentication session with smart cookie validation: + * 1. Checks if storage state exists AND cookies are still valid + * 2. If cookies expired → login test runs first to regenerate fresh cookies + * 3. If cookies valid → authenticated tests run directly (no login needed!) + * 4. Login tests always run with fresh browser + */ + +// Storage state file path +const storageStatePath = path.join(__dirname, '.auth', 'storage-state.json'); + +/** + * Validates if authentication cookies in storage state are still valid + * + * Smart validation that only checks auth-critical cookies (not analytics/tracking): + * - Configurable via AUTH_COOKIE_NAMES env var (comma-separated patterns) + * - Default patterns: session, auth, token, sid, JSESSIONID, etc. + * - Grace period: Triggers re-login N minutes before expiration (COOKIE_GRACE_PERIOD_MINUTES) + * - Ignores non-auth cookies to prevent unnecessary re-logins + * + * @returns {boolean} true if auth cookies are valid, false if expired/missing + */ +function isStorageStateValid() { + if (!fs.existsSync(storageStatePath)) { + return false; + } + + try { + const rawData = fs.readFileSync(storageStatePath, 'utf-8'); + if (!rawData.trim()) throw new Error('File is empty'); + + const storageState = JSON.parse(rawData); + + // Check if cookies array exists + if (!storageState.cookies || !Array.isArray(storageState.cookies)) { + return false; + } + + // Configure authentication cookie patterns + // Override via AUTH_COOKIE_NAMES environment variable (comma-separated) + const authCookiePatterns = (process.env.AUTH_COOKIE_NAMES || + 'session,auth,token,sid,oauth,JSESSIONID,connect.sid,access_token,refresh_token,jwt,bearer,_session').split(','); + + // Configure grace period (minutes before expiration to trigger re-login) + const gracePeriodMinutes = parseInt(process.env.COOKIE_GRACE_PERIOD_MINUTES || '1'); + const gracePeriodSeconds = gracePeriodMinutes * 60; + const now = Date.now() / 1000; // Convert to seconds + + // Filter to only auth-critical cookies + const authCookies = storageState.cookies.filter((cookie) => + authCookiePatterns.some((pattern) => + cookie.name.toLowerCase().includes(pattern.toLowerCase()) + ) + ); + + if (authCookies.length === 0) { + return false; + } + + // Check auth cookies for expiration (with grace period) + // @ts-ignore - Cookie type from storage state + const expiredAuthCookies = authCookies.filter((cookie) => + cookie.expires && + cookie.expires !== -1 && + cookie.expires < (now + gracePeriodSeconds) + ); + + if (expiredAuthCookies.length > 0) { + return false; + } + + return true; + } catch (error) { + // If the file is corrupted or empty, delete it so Playwright treats it as missing + try { + if (fs.existsSync(storageStatePath)) { + fs.unlinkSync(storageStatePath); + } + } catch (e) {} + return false; + } +} + +// Validate storage state (exists + cookies not expired) +const storageStateValid = isStorageStateValid(); + +export default defineConfig({ + testDir: ".", + fullyParallel: false, + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + workers: 1, + reporter: "html", + globalTimeout: 600000, + timeout: 120000, + + use: { + locale: "en-US", + trace: "on-first-retry", + screenshot: "only-on-failure", + viewport: null, // Use actual browser window size + launchOptions: { + args: [ + "--start-maximized", + "--disable-blink-features=AutomationControlled", + "--disable-dev-shm-usage", + "--no-sandbox", + ], + }, + // Do NOT set storageState here globally + // Each project will specify its own storage state needs + }, + + projects: [ + // ========================================== + // LOGIN TEST - Always runs with fresh browser + // ========================================== + { + name: 'login-test', + + testMatch: /login_analysis.*\.spec\.js/, + use: { + browserName: 'chromium', + // No storageState - fresh browser for login + }, + }, + + // ========================================== + // AUTHENTICATED TESTS - Need login (use storage state) + // ========================================== + { + name: 'chromium-authenticated', + + testMatch: /.*\.auth\.spec\.js/, + // Smart dependency: Only depend on login if storage state is invalid + dependencies: storageStateValid ? [] : ['login-test'], + use: { + browserName: 'chromium', + // Always set storage state for authenticated tests + storageState: storageStatePath + }, + }, + + // ========================================== + // UNAUTHENTICATED TESTS - Public pages (no login) + // ========================================== + { + name: 'chromium-noauth', + + testMatch: /.*\.noauth\.spec\.js/, + use: { + browserName: 'chromium', + // No storageState - fresh browser for public pages + }, + }, + + // // ========================================== + // // FIREFOX BROWSER + // // ========================================== + // { + // name: 'firefox-authenticated', + // testMatch: /.*\.auth\.spec\.js/, + // use: { + // browserName: 'firefox', + // viewport: null, + // storageState: '.auth/storage-state.json', + // }, + // dependencies: ['setup'], + // }, + // { + // name: 'firefox-noauth', + // testMatch: /.*\.noauth\.spec\.js/, + // use: { browserName: 'firefox', viewport: null }, + // }, + // { + // name: 'firefox-login-tests', + // testMatch: /login.*\.spec\.js/, + // use: { browserName: 'firefox', viewport: null }, + // }, + + // // ========================================== + // // WEBKIT (Safari) BROWSER + // // ========================================== + // { + // name: 'webkit-authenticated', + // testMatch: /.*\.auth\.spec\.js/, + // use: { + // browserName: 'webkit', + // viewport: null, + // storageState: '.auth/storage-state.json', + // }, + // dependencies: ['setup'], + // }, + // { + // name: 'webkit-noauth', + // testMatch: /.*\.noauth\.spec\.js/, + // use: { browserName: 'webkit', viewport: null }, + // }, + // { + // name: 'webkit-login-tests', + // testMatch: /login.*\.spec\.js/, + // use: { browserName: 'webkit', viewport: null }, + // }, + ], +}); diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/pom/BasePage.js b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/pom/BasePage.js new file mode 100644 index 0000000..90cd875 --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/pom/BasePage.js @@ -0,0 +1,28 @@ +export class BasePage { + /** + * @param {import('playwright').Page} page + */ + constructor(page) { + this.page = page; + } + + /** + * Wait for navigation to a specific URL with timeout (default 60s) + * @param {string} url + * @param {number} [timeout=60000] + */ + async waitForUrl(url, timeout = 60000) { + await this.page.waitForURL(url, { timeout }); + return this; + } + + /** + * Wait for element to be visible + * @param {import('playwright').Locator} locator + * @param {number} [timeout=30000] + */ + async waitForVisible(locator, timeout = 30000) { + await locator.waitFor({ state: 'visible', timeout }); + return this; + } +} diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/pom/HomePage.js b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/pom/HomePage.js new file mode 100644 index 0000000..c4baa01 --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/pom/HomePage.js @@ -0,0 +1,12 @@ +import { BasePage } from './BasePage.js'; + +export class HomePage extends BasePage { + /** + * Navigate to homepage + * @returns {Promise} + */ + async navigateToHomepage() { + await this.page.goto('https://www.mortgage.leumi.co.il', { waitUntil: 'domcontentloaded', timeout: 60000 }); + return this; + } +} diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/pom/MortgageStartPage.js b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/pom/MortgageStartPage.js new file mode 100644 index 0000000..2cdcc7e --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/pom/MortgageStartPage.js @@ -0,0 +1,31 @@ +import { BasePage } from './BasePage.js'; +import { MortgageWorkflowPage } from './MortgageWorkflowPage.js'; + +export class MortgageStartPage extends BasePage { + /** + * Selector for 'בואו נתחיל' (Let's Start) button + * Primary: page.getByRole('link', { name: 'בואו נתחיל' }) + * Alternate 1: page.getByRole('link', { name: /בואו נתחיל/ }) + * Alternate 2: page.locator('[class*="Menu"]').getByRole('link', { name: 'בואו נתחיל' }) + */ + constructor(page) { + super(page); + // Use alternate selector marked as unique in scenario JSON + this.startBtn = page.locator('[class*="Menu"]').getByRole('link', { name: 'בואו נתחיל' }); + // Alternate selectors: + // this.startBtnAlt1 = page.getByRole('link', { name: /בואו נתחיל/ }); + // this.startBtnAlt2 = page.getByRole('link', { name: 'בואו נתחיל' }); + } + + /** + * Click the 'בואו נתחיל' button to initiate mortgage workflow + * @returns {Promise} + */ + async clickStartButton() { + await this.startBtn.waitFor({ state: 'visible', timeout: 30000 }); + await this.startBtn.click({ timeout: 30000 }); + // Navigation is expected after click, so wait for workflow page URL (allow query params) + await this.page.waitForURL(/https:\/\/mortgage\.leumi\.co\.il\/minisite\/mortgage.*/, { timeout: 60000 }); + return new MortgageWorkflowPage(this.page); + } +} diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/pom/MortgageWorkflowPage.js b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/pom/MortgageWorkflowPage.js new file mode 100644 index 0000000..60f870d --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/pom/MortgageWorkflowPage.js @@ -0,0 +1,12 @@ +import { BasePage } from './BasePage.js'; + +export class MortgageWorkflowPage extends BasePage { + /** + * Navigate to mortgage workflow page + * @returns {Promise} + */ + async navigateToWorkflow() { + await this.page.goto('https://mortgage.leumi.co.il/minisite/mortgage', { waitUntil: 'domcontentloaded', timeout: 60000 }); + return this; + } +} diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/w01_mortgage_1_pom.noauth.spec.js b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/w01_mortgage_1_pom.noauth.spec.js new file mode 100644 index 0000000..0f40b92 --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/pom_tests/w01_mortgage_1_pom.noauth.spec.js @@ -0,0 +1,39 @@ +import 'dotenv/config'; +import { test, expect } from '@playwright/test'; +import { HomePage } from './pom/HomePage.js'; +import { MortgageStartPage } from './pom/MortgageStartPage.js'; +import { MortgageWorkflowPage } from './pom/MortgageWorkflowPage.js'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +let stepTimeout30 = { timeout: 30000 }; + +const BASE_URL = process.env.BASE_URL; +const BASE_HOST_URL = process.env.BASE_HOST_URL; + +// Regex for workflow page URL to allow query params +const WORKFLOW_URL_REGEX = /https:\/\/mortgage\.leumi\.co\.il\/minisite\/mortgage.*/; + +test('Discovered Workflow: e2e_business_workflow - Complete User Journey', { tag: ['@smoke'] }, async ({ page }) => { + // Step 1: Navigate to homepage + const homePage = new HomePage(page); + await homePage.navigateToHomepage(); + await expect(page).toHaveURL('https://www.mortgage.leumi.co.il', stepTimeout30); + + // Step 2: Click the 'בואו נתחיל' button to initiate mortgage workflow + const mortgageStartPage = new MortgageStartPage(page); + await mortgageStartPage.clickStartButton(); + await expect(page).toHaveURL(WORKFLOW_URL_REGEX, stepTimeout30); + + // Step 4: Return to homepage for fresh start + await homePage.navigateToHomepage(); + await expect(page).toHaveURL('https://www.mortgage.leumi.co.il', stepTimeout30); + + // Step 5: Repeat click on 'בואו נתחיל' button to confirm selector stability + await mortgageStartPage.clickStartButton(); + await expect(page).toHaveURL(WORKFLOW_URL_REGEX, stepTimeout30); +}); + diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/scenarios/WF001_mortgage_1.json b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/scenarios/WF001_mortgage_1.json new file mode 100644 index 0000000..dda6cdd --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/scenarios/WF001_mortgage_1.json @@ -0,0 +1,219 @@ +{ + "site_type": "service", + "site_category": "Mortgage application and information portal", + "confidence_score": 0.95, + "user_journeys": [ + { + "journey_name": "Primary Business Workflow", + "description": "Main user flow", + "business_value": "Enable users to start the mortgage application process", + "user_persona": "Prospective homebuyers seeking mortgage information", + "frequency": "daily", + "complexity": "low" + } + ], + "proposed_scenarios": [ + { + "scenario_name": "Discovered Workflow: e2e_business_workflow - Complete User Journey", + "description": "Comprehensive test covering the initiation of the mortgage workflow", + "workflow_narrative": "A prospective homebuyer navigates to the Leumi mortgage homepage and initiates the mortgage workflow by clicking the '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' (Let's Start) button. The agent confirmed selector stability by repeating the workflow initiation, ensuring accessibility and reliability.", + "playwright_implementation_guidance": [ + "Use waitForSelector to ensure the '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' button is visible before clicking.", + "Validate navigation by checking the resulting URL after each click.", + "Repeat the workflow initiation to confirm selector stability." + ], + "test_type": "e2e_business_workflow", + "priority": "high", + "business_goal": "Verify users can reliably initiate the mortgage workflow from the homepage", + "user_story": "As a prospective homebuyer, I want to start the mortgage workflow so that I can begin my mortgage application process online.", + "detailed_steps": [ + { + "step_number": 1, + "action": "Navigate to homepage", + "component": "Navigation", + "description": "Load homepage", + "expected_page_url": "https://www.mortgage.leumi.co.il", + "verification_point": "Page loaded", + "business_impact": "Site accessibility", + "selector": "page.goto('https://www.mortgage.leumi.co.il', { waitUntil: 'domcontentloaded' })", + "confidence": 100, + "based_on_interaction": true, + "all_selectors": [], + "web_component_parent": null, + "page_context": { + "suggested_page_class": "HomePage", + "page_url_pattern": "/" + }, + "method_context": { + "suggested_method_name": "navigateToHomepage", + "action_type": "navigate" + } + }, + { + "step_number": 2, + "action": "Click", + "component": "Workflow Initiation Button", + "description": "Click the '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' (Let's Start) button to initiate mortgage workflow", + "expected_page_url": "https://www.mortgage.leumi.co.il/", + "verification_point": "Button click triggers navigation", + "business_impact": "Workflow progress", + "selector": "page.getByRole('link', { name: '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' })", + "all_selectors": [ + { + "selector": "page.getByRole('link', { name: /\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc/ })", + "strategy": "role_name_regex", + "confidence": 95, + "is_unique": false + }, + { + "selector": "page.locator('[class*=\"Menu\"]').getByRole('link', { name: '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' })", + "strategy": "portal_role_name", + "confidence": 92, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true, + "web_component_parent": null, + "page_context": { + "suggested_page_class": "MortgageStartPage", + "page_url_pattern": "/" + }, + "method_context": { + "suggested_method_name": "clickStartButton", + "action_type": "click" + } + }, + { + "step_number": 3, + "action": "Navigate", + "component": "Navigation", + "description": "Navigate to mortgage workflow page after button click", + "expected_page_url": "https://mortgage.leumi.co.il/minisite/mortgage", + "verification_point": "Mortgage workflow page loaded", + "business_impact": "User enters mortgage workflow", + "selector": "page.goto('https://mortgage.leumi.co.il/minisite/mortgage', { waitUntil: 'domcontentloaded' })", + "all_selectors": [], + "confidence": 100, + "based_on_interaction": true, + "web_component_parent": null, + "page_context": { + "suggested_page_class": "MortgageWorkflowPage", + "page_url_pattern": "/minisite/mortgage" + }, + "method_context": { + "suggested_method_name": "navigateToWorkflow", + "action_type": "navigate" + } + }, + { + "step_number": 4, + "action": "Navigate", + "component": "Navigation", + "description": "Return to homepage for fresh start", + "expected_page_url": "https://www.mortgage.leumi.co.il", + "verification_point": "Homepage loaded again", + "business_impact": "Workflow restart for selector stability", + "selector": "page.goto('https://www.mortgage.leumi.co.il', { waitUntil: 'domcontentloaded' })", + "all_selectors": [], + "confidence": 100, + "based_on_interaction": true, + "web_component_parent": null, + "page_context": { + "suggested_page_class": "HomePage", + "page_url_pattern": "/" + }, + "method_context": { + "suggested_method_name": "navigateToHomepage", + "action_type": "navigate" + } + }, + { + "step_number": 5, + "action": "Click", + "component": "Workflow Initiation Button", + "description": "Repeat click on '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' (Let's Start) button to confirm selector stability", + "expected_page_url": "https://www.mortgage.leumi.co.il/", + "verification_point": "Button click triggers navigation again", + "business_impact": "Workflow progress and selector reliability", + "selector": "page.getByRole('link', { name: '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' })", + "all_selectors": [ + { + "selector": "page.getByRole('link', { name: /\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc/ })", + "strategy": "role_name_regex", + "confidence": 95, + "is_unique": false + }, + { + "selector": "page.locator('[class*=\"Menu\"]').getByRole('link', { name: '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' })", + "strategy": "portal_role_name", + "confidence": 92, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true, + "web_component_parent": null, + "page_context": { + "suggested_page_class": "MortgageStartPage", + "page_url_pattern": "/" + }, + "method_context": { + "suggested_method_name": "clickStartButton", + "action_type": "click" + } + }, + { + "step_number": 6, + "action": "Navigate", + "component": "Navigation", + "description": "Navigate to mortgage workflow page after repeated button click", + "expected_page_url": "https://mortgage.leumi.co.il/minisite/mortgage", + "verification_point": "Mortgage workflow page loaded again", + "business_impact": "User re-enters mortgage workflow", + "selector": "page.goto('https://mortgage.leumi.co.il/minisite/mortgage', { waitUntil: 'domcontentloaded' })", + "all_selectors": [], + "confidence": 100, + "based_on_interaction": true, + "web_component_parent": null, + "page_context": { + "suggested_page_class": "MortgageWorkflowPage", + "page_url_pattern": "/minisite/mortgage" + }, + "method_context": { + "suggested_method_name": "navigateToWorkflow", + "action_type": "navigate" + } + } + ], + "expected_results": [ + "User completes workflow initiation twice", + "No errors encountered", + "Selector stability confirmed" + ], + "edge_cases_to_test": [ + "Slow network conditions", + "User interrupts workflow and restarts", + "Button not visible due to layout changes" + ], + "data_requirements": [ + "Test accounts not required for initiation", + "Valid homepage access" + ], + "prerequisites": [ + "Site accessible", + "Homepage loads successfully" + ] + } + ], + "site_url": "https://www.mortgage.leumi.co.il", + "test_name": "w01_mortgage_1", + "login_mechanisms": [ + "general_interaction" + ], + "login_completion_state": "successful", + "analysis_timestamp": "2026-04-27T06:58:13.381825", + "auth_required": false, + "starting_url": null, + "workflow_id": "WF001" +} \ No newline at end of file diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/scenarios/reports/WF001_mortgage_1.pdf b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/scenarios/reports/WF001_mortgage_1.pdf new file mode 100644 index 0000000..c55398c Binary files /dev/null and b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/scenarios/reports/WF001_mortgage_1.pdf differ diff --git a/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/scenarios/summaries/WF001_mortgage_1.md b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/scenarios/summaries/WF001_mortgage_1.md new file mode 100644 index 0000000..4f1208c --- /dev/null +++ b/generated_tests/www.mortgage.leumi.co.il/playwright_tests/www.mortgage.leumi.co.il/playwright_tests/scenarios/summaries/WF001_mortgage_1.md @@ -0,0 +1,75 @@ +# Scenario Summary: w01_mortgage_1 + +## Overview + +- **Workflow ID**: WF001 +- **Title**: Mortgage (1) +- **Goal**: Mortgage (1) +- **Feature Area**: be2bf4ce-8e7c-4d7f-a31b-ceb4abbe131f +- **Site URL**: https://www.mortgage.leumi.co.il +- **Site Type**: service — Mortgage application and information portal +- **Confidence Score**: 0.95 +- **Auth Required**: False +- **Generated On**: 2026-04-27T06:58:13.381825 + +## User Journeys + +### 1. Primary Business Workflow +_Main user flow_ + +- **Business Value**: Enable users to start the mortgage application process +- **User Persona**: Prospective homebuyers seeking mortgage information +- **Frequency**: daily +- **Complexity**: low + +## Scenarios + +### 1. Discovered Workflow: e2e_business_workflow - Complete User Journey +**Type**: e2e_business_workflow | **Priority**: high + +> Comprehensive test covering the initiation of the mortgage workflow + +**Business Goal**: Verify users can reliably initiate the mortgage workflow from the homepage + +**User Story**: As a prospective homebuyer, I want to start the mortgage workflow so that I can begin my mortgage application process online. + +**Workflow Narrative**: +A prospective homebuyer navigates to the Leumi mortgage homepage and initiates the mortgage workflow by clicking the 'בואו נתחיל' (Let's Start) button. The agent confirmed selector stability by repeating the workflow initiation, ensuring accessibility and reliability. + +#### Implementation Guidance: +- Use waitForSelector to ensure the 'בואו נתחיל' button is visible before clicking. +- Validate navigation by checking the resulting URL after each click. +- Repeat the workflow initiation to confirm selector stability. + +#### Detailed Steps: + +| # | Action | Component | Description | Verification | URL | +|---|--------|-----------|-------------|--------------|-----| +| 1 | Navigate to homepage | Navigation | Load homepage | Page loaded | https://www.mortgage.leumi.co.il | +| 2 | Click | Workflow Initiation Button | Click the 'בואו נתחיל' (Let's Start) button to initiate mortgage workflow | Button click triggers navigation | https://www.mortgage.leumi.co.il/ | +| 3 | Navigate | Navigation | Navigate to mortgage workflow page after button click | Mortgage workflow page loaded | https://mortgage.leumi.co.il/minisite/mortgage | +| 4 | Navigate | Navigation | Return to homepage for fresh start | Homepage loaded again | https://www.mortgage.leumi.co.il | +| 5 | Click | Workflow Initiation Button | Repeat click on 'בואו נתחיל' (Let's Start) button to confirm selector stability | Button click triggers navigation again | https://www.mortgage.leumi.co.il/ | +| 6 | Navigate | Navigation | Navigate to mortgage workflow page after repeated button click | Mortgage workflow page loaded again | https://mortgage.leumi.co.il/minisite/mortgage | + +#### Expected Results: +- User completes workflow initiation twice +- No errors encountered +- Selector stability confirmed + +#### Edge Cases: +- Slow network conditions +- User interrupts workflow and restarts +- Button not visible due to layout changes + +#### Data Requirements: +- Test accounts not required for initiation +- Valid homepage access + +#### Prerequisites: +- Site accessible +- Homepage loads successfully + +## Captured Selectors + +- **Total**: 4