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..f7b1ef3 --- /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,146 @@ +{ + "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": 1198797, + "output": 29740, + "total": 1228537, + "cost": 1.0474819999999998, + "cached_input": 1058688 + }, + "sessions": { + "main_execution": { + "type": "root", + "input": 0, + "output": 0, + "total": 0, + "cost": 0.0, + "cached_input": 0, + "call_count": 0, + "start_time": 1777270456.222176, + "end_time": 1777270954.3198595, + "duration": 498.097683429718 + }, + "worker_supervisor_WF001": { + "type": "worker_supervisor", + "input": 2487, + "output": 114, + "total": 2601, + "cost": 0.005886, + "cached_input": 0, + "call_count": 2, + "start_time": 1777270456.451103, + "end_time": 1777270512.152961, + "duration": 55.701858043670654 + }, + "explore_worker_WF001_a1": { + "type": "auto_created", + "input": 45384, + "output": 1475, + "total": 46859, + "cost": 0.06627999999999999, + "cached_input": 24192, + "call_count": 4, + "start_time": 1777270477.1189117, + "end_time": null, + "duration": null + }, + "explore_synthesize_single_workflow": { + "type": "auto_created", + "input": 2556, + "output": 1389, + "total": 3945, + "cost": 0.016224000000000002, + "cached_input": 0, + "call_count": 1, + "start_time": 1777270528.0665004, + "end_time": null, + "duration": null + }, + "report_curation_WF001": { + "type": "auto_created", + "input": 5214, + "output": 202, + "total": 5416, + "cost": 0.012044, + "cached_input": 0, + "call_count": 1, + "start_time": 1777270533.2426696, + "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": 1777270533.7521224, + "end_time": 1777270954.3189528, + "duration": 420.5668303966522 + }, + "pom_gen_w01_mortgage_1": { + "type": "test_generation", + "input": 29525, + "output": 1197, + "total": 30722, + "cost": 0.033106, + "cached_input": 23680, + "call_count": 5, + "start_time": 1777270533.7539907, + "end_time": null, + "duration": null + }, + "test_gen_pom_w01_mortgage_1": { + "type": "test_generation", + "input": 37616, + "output": 1401, + "total": 39017, + "cost": 0.042471999999999996, + "cached_input": 29312, + "call_count": 5, + "start_time": 1777270543.406629, + "end_time": null, + "duration": null + }, + "code_repair_w01_mortgage_1_pom.noauth.spec.js": { + "type": "code_repair", + "input": 1076015, + "output": 23962, + "total": 1099977, + "cost": 0.8714699999999996, + "cached_input": 981504, + "call_count": 106, + "start_time": 1777270578.3038948, + "end_time": 1777270954.2823195, + "duration": 375.97842478752136 + } + }, + "provider": "azure_open_ai", + "model": "gpt-4.1", + "timestamp": "2026-04-27T06:22:34.320286", + "cache_statistics": { + "total_cached_tokens": 1058688, + "cache_hit_rate_percent": 88.3 + } + } +} \ 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..6430a0a --- /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,180 @@ +{ + "metadata_version": "1.0", + "created_at": "2026-04-27T06:14:16.217634", + "last_updated": "2026-04-27T06:22:34.322330", + "output_dir": "RoostGPT/ui-test/3c2d3a39-2cd8-4105-8a27-6053b2b60797/source/roostTest/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" + } + ], + "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 that users can initiate the mortgage workflow and handle workflow initiation failures gracefully.", + "feature_area": "Mortgage application and information portal", + "priority": "high", + "starting_hint": "", + "discovery_source": "user_scenario", + "source_file": "/var/tmp/Roost/RoostGPT/ui-test/3c2d3a39-2cd8-4105-8a27-6053b2b60797/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/3c2d3a39-2cd8-4105-8a27-6053b2b60797/temp_info/www.mortgage.leumi.co.il/extracted_data/execution_flow_WF001_mortgage_1.json", + "agent_workflow_completed": false, + "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 'בואו נתחיל' link to begin the process. After an initial attempt, the agent retried the workflow by re-navigating to the homepage and repeating the interaction with the same element. The workflow was interrupted by a hard blocker at the final step, preventing further progress." + ], + "agent_activity_error": [ + "At Step 5, the agent encountered a HARD BLOCKER that halted the workflow. Despite successful navigation and element interaction in previous steps, the agent was unable to proceed beyond the mortgage initiation page. No recovery actions were possible as the blocker was unrecoverable within the scenario context." + ], + "agent_activity_outcome": [ + "The agent was unable to achieve the final goal of completing the mortgage workflow due to a critical blocking issue encountered at the last step. The scenario intent was not fully realized." + ], + "agent_recommendation": "Investigate the nature of the hard blocker on the mortgage initiation page. Validate element accessibility and workflow continuity. If the issue is site-related, escalate to development for resolution. If environmental, review test setup and retry after remediation.", + "agent_completion_level": "partial", + "agent_steps_completed": 5, + "visited_urls": [ + "https://mortgage.leumi.co.il/minisite/mortgage", + "https://www.mortgage.leumi.co.il", + "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" + } + ], + "test_steps": [ + "Load homepage", + "Click the 'בואו נתחיל' (Let's Start) link to begin the mortgage workflow.", + "Return to the homepage to retry workflow initiation.", + "Click the 'בואו נתחיל' (Let's Start) link again to retry starting the mortgage workflow." + ], + "video_recording_path": "/var/tmp/Roost/RoostGPT/ui-test/3c2d3a39-2cd8-4105-8a27-6053b2b60797/temp_info/www.mortgage.leumi.co.il/extracted_data/recordings/WF001_a1/069eefeb-b432-7398-8000-f2da0cd3d87c.mp4" + } + ], + "explore_focus_areas": [], + "Imported_Test_Coverage": null, + "Token_Usage": { + "cumulative": { + "input_tokens": 1198797, + "output_tokens": 29740, + "cached_input_tokens": 0, + "total_tokens": 1228537, + "total_cost_usd": 1.047482 + }, + "runs": [ + { + "run_type": "generate", + "timestamp": "2026-04-27T06:22:34.320286", + "provider": "azure_open_ai", + "model": "gpt-4.1", + "input_tokens": 1198797, + "output_tokens": 29740, + "total_tokens": 1228537, + "cost_usd": 1.047482, + "sessions": { + "main_execution": { + "input": 0, + "output": 0, + "cost": 0.0 + }, + "worker_supervisor_WF001": { + "input": 2487, + "output": 114, + "cost": 0.005886 + }, + "explore_worker_WF001_a1": { + "input": 45384, + "output": 1475, + "cost": 0.06628 + }, + "explore_synthesize_single_workflow": { + "input": 2556, + "output": 1389, + "cost": 0.016224 + }, + "report_curation_WF001": { + "input": 5214, + "output": 202, + "cost": 0.012044 + }, + "post_explore_testgen": { + "input": 0, + "output": 0, + "cost": 0.0 + }, + "pom_gen_w01_mortgage_1": { + "input": 29525, + "output": 1197, + "cost": 0.033106 + }, + "test_gen_pom_w01_mortgage_1": { + "input": 37616, + "output": 1401, + "cost": 0.042472 + }, + "code_repair_w01_mortgage_1_pom.noauth.spec.js": { + "input": 1076015, + "output": 23962, + "cost": 0.87147 + } + } + } + ] + } +} \ 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..3a30c99 --- /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; + } + + /** + * Waits for navigation to a specific URL with explicit timeout. + * @param {string} url + * @param {number} timeoutMs + * @returns {Promise} + */ + async waitForUrl(url, timeoutMs = 60000) { + await this.page.waitForURL(url, { timeout: timeoutMs }); + } + + /** + * Navigates to a given URL with explicit timeout. + * @param {string} url + * @param {number} timeoutMs + * @returns {Promise} + */ + async goto(url, timeoutMs = 60000) { + await this.page.goto(url, { waitUntil: 'domcontentloaded', timeout: timeoutMs }); + } +} 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..994809a --- /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,45 @@ +import { BasePage } from './BasePage.js'; + +export class HomePage extends BasePage { + /** + * @param {import('playwright').Page} page + */ + constructor(page) { + super(page); + // Primary selector for 'בואו נתחיל' (Let's Start) link + // Use unique parent '[class*="Menu"]' for disambiguation + this.startWorkflowLink = this.page.locator('[class*="Menu"]').getByRole('link', { name: 'בואו נתחיל' }); + } + + /** + * Navigates to the homepage. + * @param {number} timeoutMs + * @returns {Promise} + */ + async gotoHomepage(timeoutMs = 60000) { + await this.page.goto('https://www.mortgage.leumi.co.il', { waitUntil: 'domcontentloaded', timeout: timeoutMs }); + return this; + } + + /** + * Clicks the 'בואו נתחיל' (Let's Start) link to begin the mortgage workflow. + * @param {number} timeoutMs + * @returns {Promise} + */ + async clickStartWorkflowLink(timeoutMs = 30000) { + await this.startWorkflowLink.waitFor({ state: 'visible', timeout: timeoutMs }); + await this.startWorkflowLink.click({ timeout: timeoutMs }); + return this; + } + + /** + * Clicks the 'בואו נתחיל' (Let's Start) link again to retry starting the mortgage workflow. + * @param {number} timeoutMs + * @returns {Promise} + */ + async clickStartWorkflowLinkRetry(timeoutMs = 30000) { + await this.startWorkflowLink.waitFor({ state: 'visible', timeout: timeoutMs }); + await this.startWorkflowLink.click({ timeout: timeoutMs }); + 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..0966570 --- /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,35 @@ +import 'dotenv/config'; +import { test, expect } from '@playwright/test'; +import { HomePage } from './pom/HomePage.js'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const BASE_URL = process.env.BASE_URL; +const BASE_HOST_URL = process.env.BASE_HOST_URL; +let stepTimeout30 = { timeout: 30000 }; + +// Scenario: Discovered Workflow: Mortgage Initiation -- Partial +test('Discovered Workflow: Mortgage Initiation -- Partial', { tag: ['@smoke'] }, async ({ page }) => { + const homePage = new HomePage(page); + + // Step 1: Navigate to homepage + await homePage.gotoHomepage(); + await expect(page).toHaveURL('https://www.mortgage.leumi.co.il'); + + // Step 2: Click the 'בואו נתחיל' link + await homePage.clickStartWorkflowLink(stepTimeout30.timeout); + // The expected URL after click is now the minisite mortgage page (with possible query params) + await expect(page).toHaveURL(/https:\/\/mortgage\.leumi\.co\.il\/minisite\/mortgage.*/); + + // Step 3: Navigate to homepage (retry) + await homePage.gotoHomepage(); + await expect(page).toHaveURL('https://www.mortgage.leumi.co.il'); + + // Step 4: Click the 'בואו נתחיל' link again (retry) + await homePage.clickStartWorkflowLinkRetry(stepTimeout30.timeout); + await expect(page).toHaveURL(/https:\/\/mortgage\.leumi\.co\.il\/minisite\/mortgage.*/); +}); + 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..11781bc --- /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,155 @@ +{ + "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 for starting a mortgage application", + "business_value": "Enables users to initiate the mortgage process online", + "user_persona": "Prospective homebuyer seeking a mortgage", + "frequency": "daily", + "complexity": "medium" + } + ], + "proposed_scenarios": [ + { + "scenario_name": "Discovered Workflow: Mortgage Initiation -- Partial", + "description": "Covers the initial steps of starting the mortgage workflow, up to the point where a hard blocker prevented further progress.", + "workflow_narrative": "A prospective homebuyer visits the Leumi Mortgage portal, attempts to begin the mortgage process by clicking the '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' (Let's Start) link, encounters an issue, retries the initiation, but is ultimately blocked from proceeding further.", + "playwright_implementation_guidance": [ + "Use waitForSelector to ensure the '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' link is visible before clicking.", + "Validate navigation by asserting the expected URL after each click.", + "Handle potential navigation retries gracefully if the workflow does not proceed as expected." + ], + "test_type": "partial_flow", + "priority": "high", + "business_goal": "Verify that users can initiate the mortgage workflow and handle workflow initiation failures gracefully.", + "user_story": "As a prospective homebuyer, I want to start the mortgage application process so that I can begin applying for a mortgage 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": [] + }, + { + "step_number": 2, + "action": "Click", + "component": "Link", + "description": "Click the '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' (Let's Start) link to begin the mortgage workflow.", + "expected_page_url": "https://www.mortgage.leumi.co.il/", + "verification_point": "Workflow initiation link clicked", + "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": "HomePage", + "page_url_pattern": "/" + }, + "method_context": { + "suggested_method_name": "clickStartWorkflowLink", + "action_type": "click" + } + }, + { + "step_number": 3, + "action": "Navigate to homepage (retry)", + "component": "Navigation", + "description": "Return to the homepage to retry workflow initiation.", + "expected_page_url": "https://www.mortgage.leumi.co.il", + "verification_point": "Page reloaded", + "business_impact": "Workflow recovery", + "selector": "page.goto('https://www.mortgage.leumi.co.il', { waitUntil: 'domcontentloaded' })", + "confidence": 100, + "based_on_interaction": true, + "all_selectors": [] + }, + { + "step_number": 4, + "action": "Click", + "component": "Link", + "description": "Click the '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' (Let's Start) link again to retry starting the mortgage workflow.", + "expected_page_url": "https://www.mortgage.leumi.co.il/", + "verification_point": "Workflow initiation link clicked (retry)", + "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": "HomePage", + "page_url_pattern": "/" + }, + "method_context": { + "suggested_method_name": "clickStartWorkflowLinkRetry", + "action_type": "click" + } + } + ], + "expected_results": [ + "User is able to reach the workflow initiation page", + "Workflow initiation can be retried if the first attempt fails" + ], + "edge_cases_to_test": [ + "Slow network conditions during navigation", + "Workflow initiation link not visible or clickable", + "Navigation failure or unexpected redirects" + ], + "data_requirements": [ + "Accessible homepage", + "Visible '\u05d1\u05d5\u05d0\u05d5 \u05e0\u05ea\u05d7\u05d9\u05dc' link" + ], + "prerequisites": [ + "Site accessible" + ] + } + ], + "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:15:28.066893", + "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..d8aed01 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..857a655 --- /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,71 @@ +# Scenario Summary: w01_mortgage_1 + +## Overview + +- **Workflow ID**: WF001 +- **Title**: Mortgage (1) +- **Goal**: Mortgage (1) +- **Feature Area**: 3c2d3a39-2cd8-4105-8a27-6053b2b60797 +- **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:15:28.066893 + +## User Journeys + +### 1. Primary Business Workflow +_Main user flow for starting a mortgage application_ + +- **Business Value**: Enables users to initiate the mortgage process online +- **User Persona**: Prospective homebuyer seeking a mortgage +- **Frequency**: daily +- **Complexity**: medium + +## Scenarios + +### 1. Discovered Workflow: Mortgage Initiation -- Partial +**Type**: partial_flow | **Priority**: high + +> Covers the initial steps of starting the mortgage workflow, up to the point where a hard blocker prevented further progress. + +**Business Goal**: Verify that users can initiate the mortgage workflow and handle workflow initiation failures gracefully. + +**User Story**: As a prospective homebuyer, I want to start the mortgage application process so that I can begin applying for a mortgage online. + +**Workflow Narrative**: +A prospective homebuyer visits the Leumi Mortgage portal, attempts to begin the mortgage process by clicking the 'בואו נתחיל' (Let's Start) link, encounters an issue, retries the initiation, but is ultimately blocked from proceeding further. + +#### Implementation Guidance: +- Use waitForSelector to ensure the 'בואו נתחיל' link is visible before clicking. +- Validate navigation by asserting the expected URL after each click. +- Handle potential navigation retries gracefully if the workflow does not proceed as expected. + +#### Detailed Steps: + +| # | Action | Component | Description | Verification | URL | +|---|--------|-----------|-------------|--------------|-----| +| 1 | Navigate to homepage | Navigation | Load homepage | Page loaded | https://www.mortgage.leumi.co.il | +| 2 | Click | Link | Click the 'בואו נתחיל' (Let's Start) link to begin the mortgage workflow. | Workflow initiation link clicked | https://www.mortgage.leumi.co.il/ | +| 3 | Navigate to homepage (retry) | Navigation | Return to the homepage to retry workflow initiation. | Page reloaded | https://www.mortgage.leumi.co.il | +| 4 | Click | Link | Click the 'בואו נתחיל' (Let's Start) link again to retry starting the mortgage workflow. | Workflow initiation link clicked (retry) | https://www.mortgage.leumi.co.il/ | + +#### Expected Results: +- User is able to reach the workflow initiation page +- Workflow initiation can be retried if the first attempt fails + +#### Edge Cases: +- Slow network conditions during navigation +- Workflow initiation link not visible or clickable +- Navigation failure or unexpected redirects + +#### Data Requirements: +- Accessible homepage +- Visible 'בואו נתחיל' link + +#### Prerequisites: +- Site accessible + +## Captured Selectors + +- **Total**: 4