diff --git a/generated_tests/testautomationpractice.blogspot.com/internal/.accessibility_state_automation_practice_form___complete_user_journey_pom.json b/generated_tests/testautomationpractice.blogspot.com/internal/.accessibility_state_automation_practice_form___complete_user_journey_pom.json new file mode 100644 index 0000000..594f2a6 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/internal/.accessibility_state_automation_practice_form___complete_user_journey_pom.json @@ -0,0 +1,1477 @@ +{ + "accessibility_tree": { + "role": "WebArea", + "name": "Automation Testing Practice", + "children": [ + { + "role": "heading", + "name": "Automation Testing Practice", + "level": 1 + }, + { + "role": "text", + "name": "For Selenium, Cypress & Playwright" + }, + { + "role": "link", + "name": "Home" + }, + { + "role": "link", + "name": "Udemy Courses" + }, + { + "role": "link", + "name": "Online Trainings" + }, + { + "role": "link", + "name": "Blog" + }, + { + "role": "link", + "name": "PlaywrightPractice" + }, + { + "role": "link", + "name": "GUI Elements" + }, + { + "role": "text", + "name": "Name:" + }, + { + "role": "textbox", + "name": "Enter Name", + "required": true, + "value": "Roostai" + }, + { + "role": "text", + "name": "Email:" + }, + { + "role": "textbox", + "name": "Enter EMail", + "value": "roostai@zb.io" + }, + { + "role": "text", + "name": "Phone:" + }, + { + "role": "textbox", + "name": "Enter Phone", + "value": "9999999999" + }, + { + "role": "text", + "name": "Address:" + }, + { + "role": "textbox", + "name": "Address:", + "multiline": true, + "value": "Bangalore , India" + }, + { + "role": "text", + "name": "Gender:" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "radio", + "name": "Male", + "checked": true + }, + { + "role": "radio", + "name": "Female", + "checked": false + }, + { + "role": "text", + "name": "Days:" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "checkbox", + "name": "Sunday", + "checked": false + }, + { + "role": "checkbox", + "name": "Monday", + "checked": true + }, + { + "role": "checkbox", + "name": "Tuesday", + "checked": true + }, + { + "role": "checkbox", + "name": "Wednesday", + "checked": true + }, + { + "role": "checkbox", + "name": "Thursday", + "checked": true + }, + { + "role": "checkbox", + "name": "Friday", + "checked": true + }, + { + "role": "checkbox", + "name": "Saturday", + "checked": false + }, + { + "role": "text", + "name": "Country:" + }, + { + "role": "combobox", + "name": "Country:", + "haspopup": "menu", + "children": [ + { + "role": "option", + "name": "United States" + }, + { + "role": "option", + "name": "Canada" + }, + { + "role": "option", + "name": "United Kingdom" + }, + { + "role": "option", + "name": "Germany" + }, + { + "role": "option", + "name": "France" + }, + { + "role": "option", + "name": "Australia" + }, + { + "role": "option", + "name": "Japan" + }, + { + "role": "option", + "name": "China" + }, + { + "role": "option", + "name": "Brazil" + }, + { + "role": "option", + "name": "India", + "selected": true + } + ], + "value": "India" + }, + { + "role": "text", + "name": "Colors:" + }, + { + "role": "listbox", + "name": "Colors:", + "multiselectable": true, + "orientation": "vertical", + "children": [ + { + "role": "option", + "name": "Red" + }, + { + "role": "option", + "name": "Blue" + }, + { + "role": "option", + "name": "Green" + }, + { + "role": "option", + "name": "Yellow", + "selected": true + }, + { + "role": "option", + "name": "Red" + }, + { + "role": "option", + "name": "White" + }, + { + "role": "option", + "name": "Green" + } + ] + }, + { + "role": "text", + "name": "Sorted List:" + }, + { + "role": "listbox", + "name": "Sorted List:", + "multiselectable": true, + "orientation": "vertical", + "children": [ + { + "role": "option", + "name": "Cat" + }, + { + "role": "option", + "name": "Cheetah" + }, + { + "role": "option", + "name": "Deer" + }, + { + "role": "option", + "name": "Dog", + "selected": true + }, + { + "role": "option", + "name": "Elephant" + }, + { + "role": "option", + "name": "Fox" + }, + { + "role": "option", + "name": "Giraffe" + }, + { + "role": "option", + "name": "Lion" + }, + { + "role": "option", + "name": "Rabbit" + }, + { + "role": "option", + "name": "Zebra" + } + ] + }, + { + "role": "text", + "name": "Date Picker 1 (mm/dd/yyyy): " + }, + { + "role": "textbox", + "name": "", + "value": "17/02/2026" + }, + { + "role": "text", + "name": "Date Picker 2 (dd/mm/yyyy) : " + }, + { + "role": "textbox", + "name": "", + "value": "01/01/2026" + }, + { + "role": "text", + "name": "Date Picker 3: (Select a Date Range)" + }, + { + "role": "Date", + "name": "", + "children": [ + { + "role": "spinbutton", + "name": "Month", + "valuetext": "", + "focused": true, + "valuemin": 1, + "valuemax": 12, + "value": 0 + }, + { + "role": "text", + "name": "/" + }, + { + "role": "spinbutton", + "name": "Day", + "valuetext": "", + "valuemin": 1, + "valuemax": 31, + "value": 0 + }, + { + "role": "text", + "name": "/" + }, + { + "role": "spinbutton", + "name": "Year", + "valuetext": "", + "valuemin": 1, + "valuemax": 275760, + "value": 0 + }, + { + "role": "button", + "name": "Show date picker", + "haspopup": "menu" + } + ] + }, + { + "role": "text", + "name": "to" + }, + { + "role": "Date", + "name": "", + "children": [ + { + "role": "spinbutton", + "name": "Month", + "valuetext": "", + "valuemin": 1, + "valuemax": 12, + "value": 0 + }, + { + "role": "text", + "name": "/" + }, + { + "role": "spinbutton", + "name": "Day", + "valuetext": "", + "valuemin": 1, + "valuemax": 31, + "value": 0 + }, + { + "role": "text", + "name": "/" + }, + { + "role": "spinbutton", + "name": "Year", + "valuetext": "", + "valuemin": 1, + "valuemax": 275760, + "value": 0 + }, + { + "role": "button", + "name": "Show date picker", + "haspopup": "menu" + } + ] + }, + { + "role": "button", + "name": "Submit" + }, + { + "role": "link", + "name": "Home" + }, + { + "role": "text", + "name": "Subscribe to: " + }, + { + "role": "link", + "name": "Comments (Atom)" + }, + { + "role": "heading", + "name": "Upload Files", + "level": 2 + }, + { + "role": "button", + "name": "Choose File", + "value": "No file chosen" + }, + { + "role": "button", + "name": "Upload Single File" + }, + { + "role": "button", + "name": "Choose Files", + "value": "No file chosen" + }, + { + "role": "button", + "name": "Upload Multiple Files" + }, + { + "role": "heading", + "name": "Static Web Table", + "level": 2 + }, + { + "role": "text", + "name": "BookName" + }, + { + "role": "text", + "name": "Author" + }, + { + "role": "text", + "name": "Subject" + }, + { + "role": "text", + "name": "Price" + }, + { + "role": "text", + "name": "Learn Selenium" + }, + { + "role": "text", + "name": "Amit" + }, + { + "role": "text", + "name": "Selenium" + }, + { + "role": "text", + "name": "300" + }, + { + "role": "text", + "name": "Learn Java" + }, + { + "role": "text", + "name": "Mukesh" + }, + { + "role": "text", + "name": "Java" + }, + { + "role": "text", + "name": "500" + }, + { + "role": "text", + "name": "Learn JS" + }, + { + "role": "text", + "name": "Animesh" + }, + { + "role": "text", + "name": "Javascript" + }, + { + "role": "text", + "name": "300" + }, + { + "role": "text", + "name": "Master In Selenium" + }, + { + "role": "text", + "name": "Mukesh" + }, + { + "role": "text", + "name": "Selenium" + }, + { + "role": "text", + "name": "3000" + }, + { + "role": "text", + "name": "Master In Java" + }, + { + "role": "text", + "name": "Amod" + }, + { + "role": "text", + "name": "JAVA" + }, + { + "role": "text", + "name": "2000" + }, + { + "role": "text", + "name": "Master In JS" + }, + { + "role": "text", + "name": "Amit" + }, + { + "role": "text", + "name": "Javascript" + }, + { + "role": "text", + "name": "1000" + }, + { + "role": "heading", + "name": "Dynamic Web Table", + "level": 2 + }, + { + "role": "text", + "name": "Name" + }, + { + "role": "text", + "name": "CPU (%)" + }, + { + "role": "text", + "name": "Memory (MB)" + }, + { + "role": "text", + "name": "Disk (MB/s)" + }, + { + "role": "text", + "name": "Network (Mbps)" + }, + { + "role": "text", + "name": "Internet Explorer" + }, + { + "role": "text", + "name": "1.0%" + }, + { + "role": "text", + "name": "34.4 MB" + }, + { + "role": "text", + "name": "0.18 MB/s" + }, + { + "role": "text", + "name": "2.4 Mbps" + }, + { + "role": "text", + "name": "Chrome" + }, + { + "role": "text", + "name": "6.0%" + }, + { + "role": "text", + "name": "70.5 MB" + }, + { + "role": "text", + "name": "0.14 MB/s" + }, + { + "role": "text", + "name": "8.8 Mbps" + }, + { + "role": "text", + "name": "System" + }, + { + "role": "text", + "name": "2.4%" + }, + { + "role": "text", + "name": "64.8 MB" + }, + { + "role": "text", + "name": "0.28 MB/s" + }, + { + "role": "text", + "name": "6.0 Mbps" + }, + { + "role": "text", + "name": "Firefox" + }, + { + "role": "text", + "name": "3.5%" + }, + { + "role": "text", + "name": "73.1 MB" + }, + { + "role": "text", + "name": "0.52 MB/s" + }, + { + "role": "text", + "name": "8.4 Mbps" + }, + { + "role": "text", + "name": "CPU load of Chrome process: " + }, + { + "role": "text", + "name": "6.0%" + }, + { + "role": "text", + "name": "Memory Size of Firefox process: " + }, + { + "role": "text", + "name": "73.1 MB" + }, + { + "role": "text", + "name": "Network speed of Chrome process: " + }, + { + "role": "text", + "name": "8.8 Mbps" + }, + { + "role": "text", + "name": "Disk space of Firefox process: " + }, + { + "role": "text", + "name": "0.52 MB/s" + }, + { + "role": "heading", + "name": "Pagination Web Table", + "level": 2 + }, + { + "role": "text", + "name": "ID" + }, + { + "role": "text", + "name": "Name" + }, + { + "role": "text", + "name": "Price" + }, + { + "role": "text", + "name": "Select" + }, + { + "role": "text", + "name": "1" + }, + { + "role": "text", + "name": "Smartphone" + }, + { + "role": "text", + "name": "$10.99" + }, + { + "role": "checkbox", + "name": "", + "checked": false + }, + { + "role": "text", + "name": "2" + }, + { + "role": "text", + "name": "Laptop" + }, + { + "role": "text", + "name": "$19.99" + }, + { + "role": "checkbox", + "name": "", + "checked": false + }, + { + "role": "text", + "name": "3" + }, + { + "role": "text", + "name": "Tablet" + }, + { + "role": "text", + "name": "$5.99" + }, + { + "role": "checkbox", + "name": "", + "checked": false + }, + { + "role": "text", + "name": "4" + }, + { + "role": "text", + "name": "Smartwatch" + }, + { + "role": "text", + "name": "$7.99" + }, + { + "role": "checkbox", + "name": "", + "checked": false + }, + { + "role": "text", + "name": "5" + }, + { + "role": "text", + "name": "Wireless Earbuds" + }, + { + "role": "text", + "name": "$8.99" + }, + { + "role": "checkbox", + "name": "", + "checked": false + }, + { + "role": "link", + "name": "1" + }, + { + "role": "link", + "name": "2" + }, + { + "role": "link", + "name": "3" + }, + { + "role": "link", + "name": "4" + }, + { + "role": "heading", + "name": "Tabs", + "level": 2 + }, + { + "role": "link", + "name": "" + }, + { + "role": "textbox", + "name": "" + }, + { + "role": "button", + "name": "Submit" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "heading", + "name": "Dynamic Button", + "level": 2 + }, + { + "role": "button", + "name": "START" + }, + { + "role": "heading", + "name": "Alerts & Popups", + "level": 2 + }, + { + "role": "button", + "name": "Simple Alert" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "button", + "name": "Confirmation Alert" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "button", + "name": "Prompt Alert" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "button", + "name": "New Tab" + }, + { + "role": "button", + "name": "Popup Windows" + }, + { + "role": "heading", + "name": "Mouse Hover", + "level": 2 + }, + { + "role": "text", + "name": "Move the mouse over the button to open the dropdown menu." + }, + { + "role": "button", + "name": "Point Me" + }, + { + "role": "heading", + "name": "Double Click", + "level": 2 + }, + { + "role": "text", + "name": "Field1: " + }, + { + "role": "textbox", + "name": "", + "value": "Hello World!" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "text", + "name": "Field2: " + }, + { + "role": "textbox", + "name": "" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "button", + "name": "Copy Text" + }, + { + "role": "text", + "name": "Double click on button, the text from Field1 will be copied into Field2." + }, + { + "role": "heading", + "name": "Drag and Drop", + "level": 2 + }, + { + "role": "text", + "name": "Drag me to my target" + }, + { + "role": "text", + "name": "Drop here" + }, + { + "role": "heading", + "name": "Slider", + "level": 2 + }, + { + "role": "text", + "name": "Price range:" + }, + { + "role": "textbox", + "name": "Price range:", + "readonly": true, + "value": "$75 - $300" + }, + { + "role": "generic", + "name": "" + }, + { + "role": "generic", + "name": "" + }, + { + "role": "heading", + "name": "SVG Elements", + "level": 2 + }, + { + "role": "heading", + "name": "Scrolling DropDown", + "level": 2 + }, + { + "role": "textbox", + "name": "Select an item" + }, + { + "role": "heading", + "name": "Labels And Links", + "level": 2 + }, + { + "role": "heading", + "name": "Mobile Labels", + "level": 4 + }, + { + "role": "text", + "name": "Samsung" + }, + { + "role": "text", + "name": "Real Me" + }, + { + "role": "text", + "name": "Moto" + }, + { + "role": "heading", + "name": "Laptop Links", + "level": 4 + }, + { + "role": "link", + "name": "Apple" + }, + { + "role": "link", + "name": "Lenovo" + }, + { + "role": "link", + "name": "Dell" + }, + { + "role": "heading", + "name": "Broken Links", + "level": 4 + }, + { + "role": "link", + "name": "Errorcode 400" + }, + { + "role": "link", + "name": "Errorcode 401" + }, + { + "role": "link", + "name": "Errorcode 403" + }, + { + "role": "link", + "name": "Errorcode 404" + }, + { + "role": "link", + "name": "Errorcode 408" + }, + { + "role": "link", + "name": "Errorcode 500" + }, + { + "role": "link", + "name": "Errorcode 502" + }, + { + "role": "link", + "name": "Errorcode 503" + }, + { + "role": "heading", + "name": "Visitors", + "level": 2 + }, + { + "role": "image", + "name": "A chart." + }, + { + "role": "text", + "name": "0" + }, + { + "role": "text", + "name": "39" + }, + { + "role": "text", + "name": "1" + }, + { + "role": "text", + "name": "64" + }, + { + "role": "text", + "name": "2" + }, + { + "role": "text", + "name": "74" + }, + { + "role": "text", + "name": "3" + }, + { + "role": "text", + "name": "74" + }, + { + "role": "text", + "name": "4" + }, + { + "role": "text", + "name": "87" + }, + { + "role": "text", + "name": "5" + }, + { + "role": "text", + "name": "100" + }, + { + "role": "text", + "name": "6" + }, + { + "role": "text", + "name": "55" + }, + { + "role": "text", + "name": "7" + }, + { + "role": "text", + "name": "42" + }, + { + "role": "text", + "name": "8" + }, + { + "role": "text", + "name": "77" + }, + { + "role": "text", + "name": "9" + }, + { + "role": "text", + "name": "82" + }, + { + "role": "text", + "name": "10" + }, + { + "role": "text", + "name": "94" + }, + { + "role": "text", + "name": "11" + }, + { + "role": "text", + "name": "85" + }, + { + "role": "text", + "name": "12" + }, + { + "role": "text", + "name": "64" + }, + { + "role": "text", + "name": "13" + }, + { + "role": "text", + "name": "49" + }, + { + "role": "text", + "name": "14" + }, + { + "role": "text", + "name": "56" + }, + { + "role": "text", + "name": "15" + }, + { + "role": "text", + "name": "96" + }, + { + "role": "text", + "name": "16" + }, + { + "role": "text", + "name": "71" + }, + { + "role": "text", + "name": "17" + }, + { + "role": "text", + "name": "85" + }, + { + "role": "text", + "name": "18" + }, + { + "role": "text", + "name": "80" + }, + { + "role": "text", + "name": "19" + }, + { + "role": "text", + "name": "60" + }, + { + "role": "text", + "name": "20" + }, + { + "role": "text", + "name": "45" + }, + { + "role": "text", + "name": "21" + }, + { + "role": "text", + "name": "40" + }, + { + "role": "text", + "name": "22" + }, + { + "role": "text", + "name": "69" + }, + { + "role": "text", + "name": "23" + }, + { + "role": "text", + "name": "75" + }, + { + "role": "text", + "name": "24" + }, + { + "role": "text", + "name": "84" + }, + { + "role": "text", + "name": "25" + }, + { + "role": "text", + "name": "99" + }, + { + "role": "text", + "name": "26" + }, + { + "role": "text", + "name": "84" + }, + { + "role": "text", + "name": "27" + }, + { + "role": "text", + "name": "47" + }, + { + "role": "text", + "name": "28" + }, + { + "role": "text", + "name": "45" + }, + { + "role": "text", + "name": "29" + }, + { + "role": "text", + "name": "48" + }, + { + "role": "text", + "name": "6,701,572" + }, + { + "role": "heading", + "name": "Form", + "level": 2 + }, + { + "role": "heading", + "name": "Section 1", + "level": 4 + }, + { + "role": "text", + "name": "This is a paragraph in Section 1." + }, + { + "role": "textbox", + "name": "" + }, + { + "role": "button", + "name": "Submit" + }, + { + "role": "heading", + "name": "Section 2", + "level": 4 + }, + { + "role": "text", + "name": "This is a paragraph in Section 2." + }, + { + "role": "textbox", + "name": "" + }, + { + "role": "button", + "name": "Submit" + }, + { + "role": "heading", + "name": "Section 3", + "level": 4 + }, + { + "role": "text", + "name": "This is a paragraph in Section 3." + }, + { + "role": "textbox", + "name": "" + }, + { + "role": "button", + "name": "Submit" + }, + { + "role": "heading", + "name": "Footer Links", + "level": 2 + }, + { + "role": "link", + "name": "Home" + }, + { + "role": "link", + "name": "Hidden Elements & AJAX" + }, + { + "role": "link", + "name": "Download Files" + }, + { + "role": "heading", + "name": "ShadowDOM", + "level": 2 + }, + { + "role": "text", + "name": "Mobiles" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "text", + "name": "Laptops" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "link", + "name": "Blog" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "textbox", + "name": "" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "checkbox", + "name": "", + "checked": false + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "button", + "name": "Choose File", + "value": "No file chosen" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "link", + "name": "Youtube" + }, + { + "role": "LineBreak", + "name": "\n" + }, + { + "role": "text", + "name": "Theme images by " + }, + { + "role": "link", + "name": "merrymoonmary" + }, + { + "role": "text", + "name": ". Powered by " + }, + { + "role": "link", + "name": "Blogger" + }, + { + "role": "text", + "name": "." + } + ] + }, + "url": "https://testautomationpractice.blogspot.com/" +} \ No newline at end of file diff --git a/generated_tests/testautomationpractice.blogspot.com/internal/ui_test_report.json b/generated_tests/testautomationpractice.blogspot.com/internal/ui_test_report.json new file mode 100644 index 0000000..7b4a026 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/internal/ui_test_report.json @@ -0,0 +1,117 @@ +{ + "login_scenario": "Skipped", + "workflow_completed": true, + "workflow_result": "PASS", + "workflow_error": "", + "login_agent_activity_summary": "Not available", + "user_scenario_agent_activity_summary": [ + "Agent navigated to the Automation Testing Practice homepage and systematically interacted with the GUI Elements section. The agent entered valid data into the Name, Email, Phone, and Address fields, selected 'Male' for Gender, checked all specified weekdays, and chose 'India' from the Country dropdown. The agent proceeded to select 'Yellow' from the Colors list and 'Dog' from the Sorted List. Date Picker fields were populated with the required dates and ranges. The agent then clicked the Submit button to submit the form. After submission, the agent attempted to capture visible confirmation messages but found none." + ], + "generated_files": { + "feature_files": [], + "json_files": [] + }, + "scenarios": {}, + "token_usage": { + "total": { + "input": 777484, + "output": 33080, + "total": 810564, + "cost": 1.0871279999999999, + "cached_input": 488320 + }, + "sessions": { + "main_execution": { + "type": "root", + "input": 0, + "output": 0, + "total": 0, + "cost": 0.0, + "cached_input": 0, + "call_count": 0, + "start_time": 1773663190.9903395, + "end_time": 1773664636.996747, + "duration": 1446.0064074993134 + }, + "extraction_agent": { + "type": "auto_created", + "input": 513045, + "output": 10686, + "total": 523731, + "cost": 0.652314, + "cached_input": 306176, + "call_count": 25, + "start_time": 1773663228.5369792, + "end_time": null, + "duration": null + }, + "scenario_llm": { + "type": "auto_created", + "input": 12003, + "output": 7174, + "total": 19177, + "cost": 0.081398, + "cached_input": 0, + "call_count": 1, + "start_time": 1773664247.4087706, + "end_time": null, + "duration": null + }, + "pom_gen_standalone_analyzer": { + "type": "test_generation", + "input": 50133, + "output": 3692, + "total": 53825, + "cost": 0.072202, + "cached_input": 38400, + "call_count": 4, + "start_time": 1773664247.4880528, + "end_time": null, + "duration": null + }, + "llm_call": { + "type": "auto_created", + "input": 15852, + "output": 1471, + "total": 17323, + "cost": 0.043472, + "cached_input": 0, + "call_count": 2, + "start_time": 1773664325.6359432, + "end_time": null, + "duration": null + }, + "test_gen_pom_automation_practice_form___complete_user_journey": { + "type": "test_generation", + "input": 50145, + "output": 1352, + "total": 51497, + "cost": 0.056962, + "cached_input": 36096, + "call_count": 4, + "start_time": 1773664331.6511939, + "end_time": null, + "duration": null + }, + "code_repair_automation_practice_form___complete_user_journey_pom.noauth.spec.js": { + "type": "code_repair", + "input": 136306, + "output": 8705, + "total": 145011, + "cost": 0.18078, + "cached_input": 107648, + "call_count": 8, + "start_time": 1773664441.3235667, + "end_time": 1773664636.9542391, + "duration": 195.63067245483398 + } + }, + "provider": "azure_open_ai", + "model": "gpt-4.1", + "timestamp": "2026-03-16T12:37:16.997195", + "cache_statistics": { + "total_cached_tokens": 488320, + "cache_hit_rate_percent": 62.8 + } + } +} \ No newline at end of file diff --git a/generated_tests/testautomationpractice.blogspot.com/playwright_tests/.roost/metadata.json b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/.roost/metadata.json new file mode 100644 index 0000000..b9bc165 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/.roost/metadata.json @@ -0,0 +1,82 @@ +{ + "metadata_version": "1.0", + "created_at": "2026-03-16T12:13:10.983404", + "last_updated": "2026-03-16T12:37:16.988024", + "pom_files": [ + { + "url": "https://testautomationpractice.blogspot.com/", + "file_name": "HomePage.js", + "file_path": "/var/tmp/Roost/RoostGPT/Ui-Analyse/725e717c-1847-4812-8615-237634162ab5/source/UI-Testing-ATID/generated_tests/testautomationpractice.blogspot.com/playwright_tests/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, + "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 + }, + "User_Scenarios_File": [ + { + "name": "testautomations user scenario.docx", + "path": "/var/tmp/Roost/RoostGPT/Ui-Analyse/725e717c-1847-4812-8615-237634162ab5/testautomations user scenario.docx", + "hash": "77dd1069b11b2f9a2340eba5c990219437554398b9ebfb40d9892bd3792aff96", + "agent_workflow_completed": true, + "agent_workflow_file_path": "/var/tmp/Roost/RoostGPT/Ui-Analyse/725e717c-1847-4812-8615-237634162ab5/temp_info/testautomationpractice.blogspot.com/extracted_data/interaction_data_f2ed8e7ad04d5db2d657f075803deb92ed3b994b35442cf1516f46b03ae769d0.json", + "agent_activity_summary": [ + "Agent navigated to the Automation Testing Practice homepage and systematically interacted with the GUI Elements section. The agent entered valid data into the Name, Email, Phone, and Address fields, selected 'Male' for Gender, checked all specified weekdays, and chose 'India' from the Country dropdown. The agent proceeded to select 'Yellow' from the Colors list and 'Dog' from the Sorted List. Date Picker fields were populated with the required dates and ranges. The agent then clicked the Submit button to submit the form. After submission, the agent attempted to capture visible confirmation messages but found none." + ], + "agent_activity_error": [ + "No blocking errors occurred during execution. The agent repeated input actions for Date Picker 1 multiple times (steps 14, 16, 19, 21, 22), which was redundant but did not prevent scenario completion. After submitting the form, the agent attempted to verify submission success by capturing visible messages (steps 23 and 24), but no confirmation message was found. Despite this, the agent completed all scenario steps as specified." + ], + "agent_activity_outcome": [ + "The agent successfully completed all actions required by the Original User Scenario, including form submission. However, no visible confirmation message appeared after submission, making it impossible to verify success via UI feedback. The workflow was executed as intended, but the absence of confirmation may indicate a limitation in the application or test environment." + ], + "agent_recommendation": "Review the application to ensure a visible confirmation message is displayed upon successful form submission. If confirmation is expected but absent, investigate potential UI or backend issues. Consider enhancing test scripts to verify submission via backend logs or other indirect means if UI feedback is unreliable.", + "agent_completion_level": "complete", + "agent_steps_completed": null, + "scenario_analysis_result_file_path": "/var/tmp/Roost/RoostGPT/Ui-Analyse/725e717c-1847-4812-8615-237634162ab5/temp_info/testautomationpractice.blogspot.com/extracted_data/user_scenario_f2ed8e7ad04d5db2d657f075803deb92ed3b994b35442cf1516f46b03ae769d0.json", + "scenario_name": "automation_practice_form_-_complete_user_journey", + "scenario_file_path": "scenarios/automation_practice_form_-_complete_user_journey.json", + "feature_file_path": "scenarios/features/Discovered_Workflow_Automation_Practice_Form_Compl.feature", + "feature_file_name": "Discovered_Workflow_Automation_Practice_Form_Compl.feature", + "test_generated": false, + "test_generation_error": null, + "test_name": "automation_practice_form___complete_user_journey_pom.noauth.spec.js", + "test_file_path": "pom_tests/automation_practice_form___complete_user_journey_pom.noauth.spec.js", + "test_execution_error": null, + "test_executed_success": true, + "pom_test_name": "automation_practice_form___complete_user_journey_pom.noauth.spec.js", + "pom_test_file_path": "pom_tests/automation_practice_form___complete_user_journey_pom.noauth.spec.js", + "pom_test_executed_success": true, + "pom_test_execution_error": null, + "pom_files": [ + { + "url": "https://testautomationpractice.blogspot.com/", + "file_name": "HomePage.js", + "file_path": "/var/tmp/Roost/RoostGPT/Ui-Analyse/725e717c-1847-4812-8615-237634162ab5/source/UI-Testing-ATID/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/pom/HomePage.js" + } + ] + } + ], + "Exploration_Scenarios": [] +} \ No newline at end of file diff --git a/generated_tests/testautomationpractice.blogspot.com/playwright_tests/README.md b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/README.md new file mode 100644 index 0000000..ff80463 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/README.md @@ -0,0 +1,77 @@ +# 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 + ├── scenarios/ + ├── scenarios_summary.md + ├── *.json (scenario files) + ├── features/ + │ ├── *.feature (feature 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 tests + 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 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/testautomationpractice.blogspot.com/playwright_tests/pom_tests/.env.template b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/.env.template new file mode 100644 index 0000000..7ed0d77 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/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://testautomationpractice.blogspot.com' +BASE_URL='https://testautomationpractice.blogspot.com' +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/testautomationpractice.blogspot.com/playwright_tests/pom_tests/automation_practice_form___complete_user_journey_pom.noauth.spec.js b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/automation_practice_form___complete_user_journey_pom.noauth.spec.js new file mode 100644 index 0000000..afad4d0 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/automation_practice_form___complete_user_journey_pom.noauth.spec.js @@ -0,0 +1,53 @@ +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); + +let stepTimeout30 = { timeout: 30000 }; +const BASE_URL = process.env.BASE_URL || process.env.BASE_HOST_URL || 'https://testautomationpractice.blogspot.com/'; + +test('Discovered Workflow: Automation Practice Form - Complete User Journey', async ({ page }) => { + const homePage = new HomePage(page); + await homePage.goto(); + + // Fill Name + await homePage.fillName('Roostai'); + // Fill Email + await homePage.fillEmail('roostai@zb.io'); + // Fill Phone + await homePage.fillPhone('9999999999'); + // Fill Address + await homePage.fillAddress('Bangalore , India'); + // Select Male gender + await homePage.selectMaleGender(); + // Check all weekdays + await homePage.checkMonday(); + await homePage.checkTuesday(); + await homePage.checkWednesday(); + await homePage.checkThursday(); + await homePage.checkFriday(); + // Select Country + await homePage.selectCountry('India'); + // Select Color + await homePage.selectColor('Yellow'); + // Select Sorted List + await homePage.selectSortedList('Dog'); + // Fill Date Picker 1 + await homePage.fillDatePicker1('17/02/2026'); + // Fill Date Picker 2 + await homePage.fillDatePicker2('01/01/2026'); + // Fill Date Picker 3 Start Date + await homePage.fillDatePicker3Start('10/01/2026'); + // Fill Date Picker 3 End Date + await homePage.fillDatePicker3End('10/03/2026'); + // Submit the form + await homePage.submitForm(); + + // There is no visible confirmation message, but we can check that the page did not navigate away or show errors + await expect(page).toHaveURL(BASE_URL); +}); + diff --git a/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/package-lock.json b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/package-lock.json new file mode 100644 index 0000000..bb57879 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/package-lock.json @@ -0,0 +1,93 @@ +{ + "name": "pom-playwright-tests", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "pom-playwright-tests", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "@playwright/test": "1.55.0", + "dotenv": "^16.4.5" + } + }, + "node_modules/@playwright/test": { + "version": "1.55.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.55.0.tgz", + "integrity": "sha512-04IXzPwHrW69XusN/SIdDdKZBzMfOT9UNT/YiJit/xpy2VuAoB8NHc8Aplb96zsWDddLnbkPL3TsmrS04ZU2xQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.55.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/dotenv": { + "version": "16.6.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.6.1.tgz", + "integrity": "sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/playwright": { + "version": "1.55.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.55.0.tgz", + "integrity": "sha512-sdCWStblvV1YU909Xqx0DhOjPZE4/5lJsIS84IfN9dAZfcl/CIZ5O8l3o0j7hPMjDvqoTF8ZUcc+i/GL5erstA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.55.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.55.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.55.0.tgz", + "integrity": "sha512-GvZs4vU3U5ro2nZpeiwyb0zuFaqb9sUiAJuyrWpcGouD8y9/HLgGbNRjIph7zU9D3hnPaisMl9zG9CgFi/biIg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + } + } +} diff --git a/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/package.json b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/package.json new file mode 100644 index 0000000..d116d90 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/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/testautomationpractice.blogspot.com/playwright_tests/pom_tests/playwright.config.js b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/playwright.config.js new file mode 100644 index 0000000..1b76d02 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/playwright.config.js @@ -0,0 +1,208 @@ + +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 + */ + +// Check if storage state file exists +const storageStatePath = path.join(__dirname, '.auth', 'storage-state.json'); +const storageStateExists = fs.existsSync(storageStatePath); + +/** + * 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 (!storageStateExists) { + return false; + } + + try { + const storageState = JSON.parse(fs.readFileSync(storageStatePath, 'utf-8')); + + // 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) { + 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', + viewport: null, + // 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', + viewport: null, + // Only set storage state if file exists + ...(storageStateExists ? { storageState: storageStatePath } : {}) + }, + }, + + // ========================================== + // UNAUTHENTICATED TESTS - Public pages (no login) + // ========================================== + { + name: 'chromium-noauth', + testMatch: /.*\.noauth\.spec\.js/, + use: { + browserName: 'chromium', + viewport: null, + // 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/testautomationpractice.blogspot.com/playwright_tests/pom_tests/pom/BasePage.js b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/pom/BasePage.js new file mode 100644 index 0000000..41a8f6d --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/pom/BasePage.js @@ -0,0 +1,21 @@ +// BasePage.js +// Common functionality for all pages + +export class BasePage { + /** + * @param {import('playwright').Page} page + */ + constructor(page) { + this.page = page; + } + + /** + * Waits for the page to load with DOMContentLoaded. + * @param {string} url + * @returns {Promise} + */ + async goto(url) { + await this.page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 }); + return this; + } +} diff --git a/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/pom/HomePage.js b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/pom/HomePage.js new file mode 100644 index 0000000..3931af0 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/pom/HomePage.js @@ -0,0 +1,325 @@ +// HomePage.js +// Page Object for https://testautomationpractice.blogspot.com/ (GUI Elements form) + +import { BasePage } from './BasePage.js'; + +export class HomePage extends BasePage { + /** + * @param {import('playwright').Page} page + */ + constructor(page) { + super(page); + // Name input + // Selectors: + // 1. page.getByRole('textbox', { name: 'Enter Name' }) + // 2. page.getByPlaceholder('Enter Name') + // 3. page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByPlaceholder('Enter Name') + // 4. page.locator('input.form-control') + // 5. page.locator('#name') + this.nameInput = this.page.getByRole('textbox', { name: 'Enter Name' }); + + // Email input + // Selectors: + // 1. page.getByRole('textbox', { name: 'Enter EMail' }) + // 2. page.getByPlaceholder('Enter EMail') + // 3. page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByPlaceholder('Enter EMail') + // 4. page.locator('input.form-control') + // 5. page.locator('#email') + this.emailInput = this.page.getByRole('textbox', { name: 'Enter EMail' }); + + // Phone input + // Selectors: + // 1. page.getByRole('textbox', { name: 'Enter Phone' }) + // 2. page.getByPlaceholder('Enter Phone') + // 3. page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByPlaceholder('Enter Phone') + // 4. page.locator('input.form-control') + // 5. page.locator('#phone') + this.phoneInput = this.page.getByRole('textbox', { name: 'Enter Phone' }); + + // Address textarea + // Selectors: + // 1. page.getByRole('textbox', { name: 'Address:' }) + // 2. page.getByRole('textbox', { name: /Address:/ }) + // 3. page.getByLabel('Address:') + // 4. page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByLabel('Address:') + // 5. page.getByLabel('Address:') + this.addressInput = this.page.getByRole('textbox', { name: 'Address:' }); + + // Gender radio button (Male) + // Selectors: + // 1. page.getByRole('radio', { name: 'Male', exact: true }) + // 2. page.getByRole('radio', { name: 'Male' }) + // 3. page.getByLabel('Male') + // 4. page.getByLabel('Male', { exact: true }) + // 5. page.getByLabel('Male') + this.maleRadio = this.page.getByRole('radio', { name: 'Male', exact: true }); + + // Weekday checkboxes + // Monday + // Selectors: + // 1. page.getByRole('checkbox', { name: 'Monday' }) + // 2. page.getByLabel('Monday') + // 3. page.getByLabel('Monday', { exact: true }) + this.mondayCheckbox = this.page.getByRole('checkbox', { name: 'Monday' }); + // Tuesday + this.tuesdayCheckbox = this.page.getByRole('checkbox', { name: 'Tuesday' }); + // Wednesday + this.wednesdayCheckbox = this.page.getByRole('checkbox', { name: 'Wednesday' }); + // Thursday + this.thursdayCheckbox = this.page.getByRole('checkbox', { name: 'Thursday' }); + // Friday + this.fridayCheckbox = this.page.getByRole('checkbox', { name: 'Friday' }); + + // Country dropdown + // Selectors: + // 1. page.getByLabel('Country:') + // 2. page.getByRole('combobox', { name: /Country:/ }) + // 3. page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByLabel('Country:') + this.countryDropdown = this.page.getByLabel('Country:'); + + // Colors dropdown + // Selectors: + // 1. page.getByLabel('Colors:') + // 2. page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByLabel('Colors:') + // 3. page.locator('select.form-control') + this.colorsDropdown = this.page.getByLabel('Colors:'); + + // Sorted List dropdown + // Selectors: + // 1. page.getByLabel('Sorted List:') + // 2. page.locator('select[name="animals"]') + // 3. page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByLabel('Sorted List:') + this.sortedListDropdown = this.page.getByLabel('Sorted List:'); + + // Date Picker 1 + // Selectors: + // 1. page.locator('#datepicker') + // 2. page.locator('xpath=html/body/div[4]/div[2]/div[2]/div[2]/div[2]/div[2]/div[2]/div/div[4]/div[1]/div/div/div[1]/div[1]/div/div/div/div/div[2]/p[1]/input') + this.datePicker1 = this.page.locator('#datepicker'); + + // Date Picker 2 + // Selectors: + // 1. page.locator('#txtDate') + // 2. page.locator('input[type="text"][name="SelectedDate"]') + // 3. page.locator('input[name="SelectedDate"]') + // 4. page.locator('xpath=html/body/div[4]/div[2]/div[2]/div[2]/div[2]/div[2]/div[2]/div/div[4]/div[1]/div/div/div[1]/div[1]/div/div/div/div/div[2]/p[2]/input') + this.datePicker2 = this.page.locator('#txtDate'); + + // Date Picker 3 Start Date + // Selectors: + // 1. page.getByPlaceholder('Start Date') + // 2. page.locator('input[type="date"]') + // 3. page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByPlaceholder('Start Date') + // 4. page.locator('#start-date') + this.datePicker3Start = this.page.getByPlaceholder('Start Date'); + + // Date Picker 3 End Date + // Selectors: + // 1. page.getByPlaceholder('End Date') + // 2. page.locator('input[type="date"]') + // 3. page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByPlaceholder('End Date') + // 4. page.locator('#end-date') + this.datePicker3End = this.page.getByPlaceholder('End Date'); + + // Submit button + // Selectors: + // 1. page.locator('#post-body-1307673142697428135').getByRole('button', { name: 'Submit' }) + // 2. page.getByRole('button', { name: 'Submit' }) + // 3. page.getByText('Submit') + // 4. page.locator('button.submit-btn') + this.submitBtn = this.page.locator('#post-body-1307673142697428135').getByRole('button', { name: 'Submit' }); + } + + /** + * Navigates to the homepage. + * @returns {Promise} + */ + async goto() { + await this.page.goto('https://testautomationpractice.blogspot.com/', { waitUntil: 'domcontentloaded', timeout: 60000 }); + return this; + } + + /** + * Fill the Name field. + * @param {string} name + * @returns {Promise} + */ + async fillName(name) { + await this.nameInput.fill(name, { timeout: 30000 }); + return this; + } + + /** + * Fill the Email field. + * @param {string} email + * @returns {Promise} + */ + async fillEmail(email) { + await this.emailInput.fill(email, { timeout: 30000 }); + return this; + } + + /** + * Fill the Phone field. + * @param {string} phone + * @returns {Promise} + */ + async fillPhone(phone) { + await this.phoneInput.fill(phone, { timeout: 30000 }); + return this; + } + + /** + * Fill the Address field. + * @param {string} address + * @returns {Promise} + */ + async fillAddress(address) { + await this.addressInput.fill(address, { timeout: 30000 }); + return this; + } + + /** + * Select Male gender radio button. + * @returns {Promise} + */ + async selectMaleGender() { + await this.maleRadio.check({ timeout: 30000 }); + return this; + } + + /** + * Check the Monday checkbox. + * @returns {Promise} + */ + async checkMonday() { + await this.mondayCheckbox.check({ timeout: 30000 }); + return this; + } + + /** + * Check the Tuesday checkbox. + * @returns {Promise} + */ + async checkTuesday() { + await this.tuesdayCheckbox.check({ timeout: 30000 }); + return this; + } + + /** + * Check the Wednesday checkbox. + * @returns {Promise} + */ + async checkWednesday() { + await this.wednesdayCheckbox.check({ timeout: 30000 }); + return this; + } + + /** + * Check the Thursday checkbox. + * @returns {Promise} + */ + async checkThursday() { + await this.thursdayCheckbox.check({ timeout: 30000 }); + return this; + } + + /** + * Check the Friday checkbox. + * @returns {Promise} + */ + async checkFriday() { + await this.fridayCheckbox.check({ timeout: 30000 }); + return this; + } + + /** + * Select a country from the dropdown. + * @param {string} country + * @returns {Promise} + */ + async selectCountry(country) { + await this.countryDropdown.selectOption({ label: country }, { timeout: 30000 }); + return this; + } + + /** + * Select a color from the Colors dropdown. + * @param {string} color + * @returns {Promise} + */ + async selectColor(color) { + await this.colorsDropdown.selectOption({ label: color }, { timeout: 30000 }); + return this; + } + + /** + * Select an animal from the Sorted List dropdown. + * @param {string} animal + * @returns {Promise} + */ + async selectSortedList(animal) { + await this.sortedListDropdown.selectOption({ label: animal }, { timeout: 30000 }); + return this; + } + + /** + * Fill Date Picker 1. + * @param {string} date + * @returns {Promise} + */ + async fillDatePicker1(date) { + await this.datePicker1.fill(date, { timeout: 30000 }); + return this; + } + + /** + * Fill Date Picker 2. + * @param {string} date + * @returns {Promise} + */ + async fillDatePicker2(date) { + // Remove readonly attribute before filling + await this.page.evaluate(() => { + const el = document.getElementById('txtDate'); + if (el) el.removeAttribute('readonly'); + }); + await this.datePicker2.fill(date, { timeout: 30000 }); + return this; + } + + /** + * Fill Date Picker 3 Start Date. + * @param {string} date (format: dd/mm/yyyy) + * @returns {Promise} + */ + async fillDatePicker3Start(date) { + // Convert dd/mm/yyyy to yyyy-mm-dd for input[type='date'] + const [dd, mm, yyyy] = date.split('/'); + const isoDate = `${yyyy}-${mm.padStart(2, '0')}-${dd.padStart(2, '0')}`; + await this.datePicker3Start.fill(isoDate, { timeout: 30000 }); + return this; + } + + /** + * Fill Date Picker 3 End Date. + * @param {string} date (format: dd/mm/yyyy) + * @returns {Promise} + */ + async fillDatePicker3End(date) { + // Convert dd/mm/yyyy to yyyy-mm-dd for input[type='date'] + const [dd, mm, yyyy] = date.split('/'); + const isoDate = `${yyyy}-${mm.padStart(2, '0')}-${dd.padStart(2, '0')}`; + await this.datePicker3End.fill(isoDate, { timeout: 30000 }); + return this; + } + + /** + * Click the Submit button to submit the form. + * @returns {Promise} + */ + async submitForm() { + await this.submitBtn.click({ timeout: 45000 }); + return this; + } +} diff --git a/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/test-results/.last-run.json b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/test-results/.last-run.json new file mode 100644 index 0000000..cbcc1fb --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/pom_tests/test-results/.last-run.json @@ -0,0 +1,4 @@ +{ + "status": "passed", + "failedTests": [] +} \ No newline at end of file diff --git a/generated_tests/testautomationpractice.blogspot.com/playwright_tests/scenarios/automation_practice_form_-_complete_user_journey.json b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/scenarios/automation_practice_form_-_complete_user_journey.json new file mode 100644 index 0000000..b9edc6b --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/scenarios/automation_practice_form_-_complete_user_journey.json @@ -0,0 +1,861 @@ +{ + "site_url": "https://testautomationpractice.blogspot.com/", + "site_type": "unknown", + "site_category": "general", + "test_name": "automation_practice_form_-_complete_user_journey", + "login_mechanisms": [ + "content_browsing", + "site_navigation" + ], + "user_journeys": [ + { + "workflow_type": "navigation_flow", + "path": [ + "homepage" + ], + "success_rate": "discovered_site_navigation", + "scenario_priority": "medium", + "description": "General website navigation and content discovery" + } + ], + "proposed_scenarios": [ + { + "scenario_name": "Discovered Workflow: Automation Practice Form - Complete User Journey", + "description": "Comprehensive test covering the full form fill and submission in the GUI Elements section of the Automation Testing Practice site.", + "workflow_narrative": "A user navigates to the Automation Testing Practice homepage, fills out all fields in the GUI Elements form with valid data, selects gender, checks all weekdays, chooses options from dropdowns and lists, enters dates, and submits the form. The scenario verifies that all fields accept input and the form can be submitted successfully.", + "playwright_implementation_guidance": [ + "Use page.goto for navigation and waitUntil: 'domcontentloaded'.", + "Use getByRole, getByLabel, or getByPlaceholder for stable selectors.", + "For checkboxes and radio buttons, use .check() or .click() as appropriate.", + "For dropdowns, use .selectOption() with the visible text.", + "For date pickers, use .fill() with the exact date string.", + "After submission, verify for absence of errors or visible confirmation if possible.", + "Add waits if dynamic content is detected, but the form is static in this case." + ], + "test_type": "e2e_business_workflow", + "priority": "critical", + "business_goal": "Verify users can complete the workflow of filling and submitting the Automation Testing Practice form.", + "user_story": "As a QA engineer or automation tester, I want to fill and submit the GUI Elements form so that I can validate the form's functionality and use it for automation practice.", + "detailed_steps": [ + { + "step_number": 1, + "action": "Navigate to homepage", + "component": "Navigation", + "description": "Load the Automation Testing Practice homepage.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Page loaded successfully.", + "business_impact": "Site accessibility", + "selector": "page.goto('https://testautomationpractice.blogspot.com/', { waitUntil: 'domcontentloaded' })", + "confidence": 100, + "based_on_interaction": true, + "all_selectors": [] + }, + { + "step_number": 2, + "action": "Input text", + "component": "GUI Elements - Name Field", + "description": "Fill the Name field with 'Roostai'.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Name field displays 'Roostai'.", + "business_impact": "Form data entry", + "selector": "page.getByRole('textbox', { name: 'Enter Name' })", + "all_selectors": [ + { + "selector": "page.getByRole('textbox', { name: 'Enter Name' })", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByPlaceholder('Enter Name')", + "strategy": "placeholder", + "confidence": 85, + "is_unique": true + }, + { + "selector": "page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByPlaceholder('Enter Name')", + "strategy": "heading_context_placeholder", + "confidence": 84, + "is_unique": true + }, + { + "selector": "page.locator('input.form-control')", + "strategy": "css_stable_class", + "confidence": 78, + "is_unique": false + }, + { + "selector": "page.locator('#name')", + "strategy": "id", + "confidence": 75, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 3, + "action": "Input text", + "component": "GUI Elements - Email Field", + "description": "Fill the Email field with 'roostai@zb.io'.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Email field displays 'roostai@zb.io'.", + "business_impact": "Form data entry", + "selector": "page.getByRole('textbox', { name: 'Enter EMail' })", + "all_selectors": [ + { + "selector": "page.getByRole('textbox', { name: 'Enter EMail' })", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByPlaceholder('Enter EMail')", + "strategy": "placeholder", + "confidence": 85, + "is_unique": true + }, + { + "selector": "page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByPlaceholder('Enter EMail')", + "strategy": "heading_context_placeholder", + "confidence": 84, + "is_unique": true + }, + { + "selector": "page.locator('input.form-control')", + "strategy": "css_stable_class", + "confidence": 78, + "is_unique": false + }, + { + "selector": "page.locator('#email')", + "strategy": "id", + "confidence": 75, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 4, + "action": "Input text", + "component": "GUI Elements - Phone Field", + "description": "Fill the Phone field with '9999999999'.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Phone field displays '9999999999'.", + "business_impact": "Form data entry", + "selector": "page.getByRole('textbox', { name: 'Enter Phone' })", + "all_selectors": [ + { + "selector": "page.getByRole('textbox', { name: 'Enter Phone' })", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByPlaceholder('Enter Phone')", + "strategy": "placeholder", + "confidence": 85, + "is_unique": true + }, + { + "selector": "page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByPlaceholder('Enter Phone')", + "strategy": "heading_context_placeholder", + "confidence": 84, + "is_unique": true + }, + { + "selector": "page.locator('input.form-control')", + "strategy": "css_stable_class", + "confidence": 78, + "is_unique": false + }, + { + "selector": "page.locator('#phone')", + "strategy": "id", + "confidence": 75, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 5, + "action": "Input text", + "component": "GUI Elements - Address", + "description": "Fill the Address field with 'Bangalore , India'.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Address field displays 'Bangalore , India'.", + "business_impact": "Form data entry", + "selector": "page.getByRole('textbox', { name: 'Address:' })", + "all_selectors": [ + { + "selector": "page.getByRole('textbox', { name: 'Address:' })", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByRole('textbox', { name: /Address:/ })", + "strategy": "role_name_regex", + "confidence": 95, + "is_unique": true + }, + { + "selector": "page.getByLabel('Address:')", + "strategy": "label_text", + "confidence": 93, + "is_unique": true + }, + { + "selector": "page.getByLabel('Address:')", + "strategy": "label", + "confidence": 90, + "is_unique": true + }, + { + "selector": "page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByLabel('Address:')", + "strategy": "heading_context_label", + "confidence": 83, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 6, + "action": "Click radio", + "component": "Gender - Male Radio Button", + "description": "Select the 'Male' gender radio button.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "'Male' radio button is selected.", + "business_impact": "Form data entry", + "selector": "page.getByRole('radio', { name: 'Male', exact: true })", + "all_selectors": [ + { + "selector": "page.getByRole('radio', { name: 'Male', exact: true })", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByRole('radio', { name: 'Male' })", + "strategy": "role_name", + "confidence": 95, + "is_unique": false + }, + { + "selector": "page.getByLabel('Male')", + "strategy": "label_text", + "confidence": 93, + "is_unique": false + }, + { + "selector": "page.getByLabel('Male', { exact: true })", + "strategy": "label_text_exact", + "confidence": 92, + "is_unique": true + }, + { + "selector": "page.getByLabel('Male')", + "strategy": "label", + "confidence": 90, + "is_unique": false + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 7, + "action": "Click checkbox", + "component": "GUI Elements - Days Checkbox", + "description": "Check the 'Monday' checkbox.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "'Monday' checkbox is checked.", + "business_impact": "Form data entry", + "selector": "page.getByRole('checkbox', { name: 'Monday' })", + "all_selectors": [ + { + "selector": "page.getByRole('checkbox', { name: 'Monday' })", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByRole('checkbox', { name: 'Monday' })", + "strategy": "role_name", + "confidence": 95, + "is_unique": true + }, + { + "selector": "page.getByLabel('Monday')", + "strategy": "label_text", + "confidence": 93, + "is_unique": true + }, + { + "selector": "page.getByLabel('Monday', { exact: true })", + "strategy": "label_text_exact", + "confidence": 92, + "is_unique": true + }, + { + "selector": "page.getByLabel('Monday')", + "strategy": "label", + "confidence": 90, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 8, + "action": "Click checkbox", + "component": "GUI Elements - Days - Tuesday", + "description": "Check the 'Tuesday' checkbox.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "'Tuesday' checkbox is checked.", + "business_impact": "Form data entry", + "selector": "page.getByRole('checkbox', { name: 'Tuesday' })", + "all_selectors": [ + { + "selector": "page.getByRole('checkbox', { name: 'Tuesday' })", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByRole('checkbox', { name: 'Tuesday' })", + "strategy": "role_name", + "confidence": 95, + "is_unique": true + }, + { + "selector": "page.getByLabel('Tuesday')", + "strategy": "label_text", + "confidence": 93, + "is_unique": true + }, + { + "selector": "page.getByLabel('Tuesday', { exact: true })", + "strategy": "label_text_exact", + "confidence": 92, + "is_unique": true + }, + { + "selector": "page.getByLabel('Tuesday')", + "strategy": "label", + "confidence": 90, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 9, + "action": "Click checkbox", + "component": "GUI Elements - Days - Wednesday", + "description": "Check the 'Wednesday' checkbox.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "'Wednesday' checkbox is checked.", + "business_impact": "Form data entry", + "selector": "page.getByRole('checkbox', { name: 'Wednesday' })", + "all_selectors": [ + { + "selector": "page.getByRole('checkbox', { name: 'Wednesday' })", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByRole('checkbox', { name: 'Wednesday' })", + "strategy": "role_name", + "confidence": 95, + "is_unique": true + }, + { + "selector": "page.getByLabel('Wednesday')", + "strategy": "label_text", + "confidence": 93, + "is_unique": true + }, + { + "selector": "page.getByLabel('Wednesday', { exact: true })", + "strategy": "label_text_exact", + "confidence": 92, + "is_unique": true + }, + { + "selector": "page.getByLabel('Wednesday')", + "strategy": "label", + "confidence": 90, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 10, + "action": "Click checkbox", + "component": "GUI Elements - Days - Thursday", + "description": "Check the 'Thursday' checkbox.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "'Thursday' checkbox is checked.", + "business_impact": "Form data entry", + "selector": "page.getByRole('checkbox', { name: 'Thursday' })", + "all_selectors": [ + { + "selector": "page.getByRole('checkbox', { name: 'Thursday' })", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByRole('checkbox', { name: 'Thursday' })", + "strategy": "role_name", + "confidence": 95, + "is_unique": true + }, + { + "selector": "page.getByLabel('Thursday')", + "strategy": "label_text", + "confidence": 93, + "is_unique": true + }, + { + "selector": "page.getByLabel('Thursday', { exact: true })", + "strategy": "label_text_exact", + "confidence": 92, + "is_unique": true + }, + { + "selector": "page.getByLabel('Thursday')", + "strategy": "label", + "confidence": 90, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 11, + "action": "Click checkbox", + "component": "GUI Elements - Days - Friday", + "description": "Check the 'Friday' checkbox.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "'Friday' checkbox is checked.", + "business_impact": "Form data entry", + "selector": "page.getByRole('checkbox', { name: 'Friday' })", + "all_selectors": [ + { + "selector": "page.getByRole('checkbox', { name: 'Friday' })", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByRole('checkbox', { name: 'Friday' })", + "strategy": "role_name", + "confidence": 95, + "is_unique": true + }, + { + "selector": "page.getByLabel('Friday')", + "strategy": "label_text", + "confidence": 93, + "is_unique": true + }, + { + "selector": "page.getByLabel('Friday', { exact: true })", + "strategy": "label_text_exact", + "confidence": 92, + "is_unique": true + }, + { + "selector": "page.getByLabel('Friday')", + "strategy": "label", + "confidence": 90, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 12, + "action": "Select dropdown", + "component": "Country Dropdown", + "description": "Select 'India' from the Country dropdown.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Country dropdown has 'India' selected.", + "business_impact": "Form data entry", + "selector": "page.getByLabel('Country:')", + "all_selectors": [ + { + "selector": "page.getByLabel('Country:')", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByRole('combobox', { name: /Country:/ })", + "strategy": "role_name_regex", + "confidence": 95, + "is_unique": true + }, + { + "selector": "page.getByLabel('Country:')", + "strategy": "label_text", + "confidence": 93, + "is_unique": true + }, + { + "selector": "page.getByLabel('Country:')", + "strategy": "label", + "confidence": 90, + "is_unique": true + }, + { + "selector": "page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByLabel('Country:')", + "strategy": "heading_context_label", + "confidence": 83, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 13, + "action": "Select dropdown", + "component": "Colors List", + "description": "Select 'Yellow' from the Colors list.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Colors list has 'Yellow' selected.", + "business_impact": "Form data entry", + "selector": "page.getByLabel('Colors:')", + "all_selectors": [ + { + "selector": "page.getByLabel('Colors:')", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByLabel('Colors:')", + "strategy": "label_text", + "confidence": 93, + "is_unique": true + }, + { + "selector": "page.getByLabel('Colors:')", + "strategy": "label", + "confidence": 90, + "is_unique": true + }, + { + "selector": "page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByLabel('Colors:')", + "strategy": "heading_context_label", + "confidence": 83, + "is_unique": true + }, + { + "selector": "page.locator('select.form-control')", + "strategy": "css_stable_class", + "confidence": 78, + "is_unique": false + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 14, + "action": "Select dropdown", + "component": "Sorted List Dropdown", + "description": "Select 'Dog' from the Sorted List dropdown.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Sorted List dropdown has 'Dog' selected.", + "business_impact": "Form data entry", + "selector": "page.getByLabel('Sorted List:')", + "all_selectors": [ + { + "selector": "page.getByLabel('Sorted List:')", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByLabel('Sorted List:')", + "strategy": "label_text", + "confidence": 93, + "is_unique": true + }, + { + "selector": "page.getByLabel('Sorted List:')", + "strategy": "label", + "confidence": 90, + "is_unique": true + }, + { + "selector": "page.locator('select[name=\"animals\"]')", + "strategy": "name_attribute", + "confidence": 87, + "is_unique": true + }, + { + "selector": "page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByLabel('Sorted List:')", + "strategy": "heading_context_label", + "confidence": 83, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 15, + "action": "Input text", + "component": "Date Picker 1", + "description": "Enter '17/02/2026' in Date Picker 1.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Date Picker 1 displays '17/02/2026'.", + "business_impact": "Form data entry", + "selector": "page.locator('#datepicker')", + "all_selectors": [ + { + "selector": "page.locator('#datepicker')", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.locator('#datepicker')", + "strategy": "id", + "confidence": 75, + "is_unique": true + }, + { + "selector": "page.locator('xpath=html/body/div[4]/div[2]/div[2]/div[2]/div[2]/div[2]/div[2]/div/div[4]/div[1]/div/div/div[1]/div[1]/div/div/div/div/div[2]/p[1]/input')", + "strategy": "xpath", + "confidence": 50, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 16, + "action": "Input text", + "component": "GUI Elements - Date Picker 2", + "description": "Enter '01/01/2026' in Date Picker 2.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Date Picker 2 displays '01/01/2026'.", + "business_impact": "Form data entry", + "selector": "page.locator('#txtDate')", + "all_selectors": [ + { + "selector": "page.locator('#txtDate')", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.locator('input[type=\"text\"][name=\"SelectedDate\"]')", + "strategy": "css_combined", + "confidence": 89, + "is_unique": true + }, + { + "selector": "page.locator('input[name=\"SelectedDate\"]')", + "strategy": "name_attribute", + "confidence": 87, + "is_unique": true + }, + { + "selector": "page.locator('#txtDate')", + "strategy": "id", + "confidence": 75, + "is_unique": true + }, + { + "selector": "page.locator('xpath=html/body/div[4]/div[2]/div[2]/div[2]/div[2]/div[2]/div[2]/div/div[4]/div[1]/div/div/div[1]/div[1]/div/div/div/div/div[2]/p[2]/input')", + "strategy": "xpath", + "confidence": 50, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 17, + "action": "Input text", + "component": "Date Picker 3 Start Date", + "description": "Enter '10/01/2026' in Date Picker 3 start date field.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Date Picker 3 start date displays '10/01/2026'.", + "business_impact": "Form data entry", + "selector": "page.getByPlaceholder('Start Date')", + "all_selectors": [ + { + "selector": "page.getByPlaceholder('Start Date')", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.locator('input[type=\"date\"]')", + "strategy": "input_type", + "confidence": 88, + "is_unique": false + }, + { + "selector": "page.getByPlaceholder('Start Date')", + "strategy": "placeholder", + "confidence": 85, + "is_unique": true + }, + { + "selector": "page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByPlaceholder('Start Date')", + "strategy": "heading_context_placeholder", + "confidence": 84, + "is_unique": true + }, + { + "selector": "page.locator('#start-date')", + "strategy": "id", + "confidence": 75, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 18, + "action": "Input text", + "component": "GUI Elements - Date Picker 3 End Date", + "description": "Enter '10/03/2026' in Date Picker 3 end date field.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Date Picker 3 end date displays '10/03/2026'.", + "business_impact": "Form data entry", + "selector": "page.getByPlaceholder('End Date')", + "all_selectors": [ + { + "selector": "page.getByPlaceholder('End Date')", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.locator('input[type=\"date\"]')", + "strategy": "input_type", + "confidence": 88, + "is_unique": false + }, + { + "selector": "page.getByPlaceholder('End Date')", + "strategy": "placeholder", + "confidence": 85, + "is_unique": true + }, + { + "selector": "page.getByRole('heading', { name: 'GUI Elements' }).locator('..').getByPlaceholder('End Date')", + "strategy": "heading_context_placeholder", + "confidence": 84, + "is_unique": true + }, + { + "selector": "page.locator('#end-date')", + "strategy": "id", + "confidence": 75, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + }, + { + "step_number": 19, + "action": "Click button", + "component": "GUI Elements Submit Button", + "description": "Click the 'Submit' button to submit the form.", + "expected_page_url": "https://testautomationpractice.blogspot.com/", + "verification_point": "Form is submitted (no visible confirmation message, but no errors).", + "business_impact": "Form submission", + "selector": "page.locator('#post-body-1307673142697428135').getByRole('button', { name: 'Submit' })", + "all_selectors": [ + { + "selector": "page.locator('#post-body-1307673142697428135').getByRole('button', { name: 'Submit' })", + "strategy": "roost_primary", + "confidence": 99, + "is_unique": true + }, + { + "selector": "page.getByRole('button', { name: 'Submit' })", + "strategy": "role_name", + "confidence": 85, + "is_unique": false + }, + { + "selector": "page.locator('#post-body-1307673142697428135').getByRole('button', { name: 'Submit' })", + "strategy": "parent_id_role", + "confidence": 82, + "is_unique": true + }, + { + "selector": "page.getByText('Submit')", + "strategy": "text", + "confidence": 78, + "is_unique": false + }, + { + "selector": "page.locator('button.submit-btn')", + "strategy": "css_stable_class", + "confidence": 78, + "is_unique": true + } + ], + "confidence": 99, + "based_on_interaction": true + } + ], + "expected_results": [ + "User completes the form workflow successfully.", + "All fields accept input and selections as expected.", + "Form submits without errors.", + "No visible confirmation message appears after submission (per execution flow)." + ], + "edge_cases_to_test": [ + "Slow network conditions during form fill and submission.", + "User interrupts flow (e.g., navigates away before submitting)." + ], + "data_requirements": [ + "Valid Name, Email, Phone, and Address values as per execution flow.", + "Selectable options for Gender, Days, Country, Colors, Sorted List.", + "Date fields accept the provided date strings." + ], + "prerequisites": [ + "Automation Testing Practice site is accessible at https://testautomationpractice.blogspot.com/" + ], + "auth_required": false, + "starting_url": null + } + ], + "login_completion_state": "successful", + "analysis_timestamp": "2026-03-16T12:30:47.454421", + "confidence_score": 0.5, + "auth_required": false, + "starting_url": null +} \ No newline at end of file diff --git a/generated_tests/testautomationpractice.blogspot.com/playwright_tests/scenarios/features/Discovered_Workflow_Automation_Practice_Form_Compl.feature b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/scenarios/features/Discovered_Workflow_Automation_Practice_Form_Compl.feature new file mode 100644 index 0000000..1d621c4 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/scenarios/features/Discovered_Workflow_Automation_Practice_Form_Compl.feature @@ -0,0 +1,87 @@ +@e2e @gui-elements @critical @form @homepage +Feature: Complete Automation Practice Form Workflow - GUI Elements Section + + In order to ensure the Automation Testing Practice website's GUI Elements form functions correctly + As a QA automation engineer + I want to verify that every field in the form can be filled with valid data and the form can be submitted successfully from the homepage + + Background: + Given I am on the homepage 'https://testautomationpractice.blogspot.com/' + Then the page should load successfully + And the "GUI Elements" section should be visible on the page + + Scenario: Submit the GUI Elements form with valid inputs for every field and verify successful submission + # Name Field + When I fill in the 'Enter Name' field with 'Roostai' + Then the 'Enter Name' field should display 'Roostai' + + # Email Field + When I fill in the 'Enter EMail' field with 'roostai@zb.io' + Then the 'Enter EMail' field should display 'roostai@zb.io' + + # Phone Field + When I fill in the 'Enter Phone' field with '9999999999' + Then the 'Enter Phone' field should display '9999999999' + + # Address Field + When I fill in the 'Address:' field with 'Bangalore , India' + Then the 'Address:' field should display 'Bangalore , India' + + # Gender Radio Button (Male) + When I select the 'Male' option from the Gender radio buttons + Then the 'Male' gender radio button should be selected + + # Checkbox - Monday + When I check the 'Monday' checkbox in the Days section + Then the 'Monday' checkbox should be checked + + # Checkbox - Tuesday + When I check the 'Tuesday' checkbox in the Days section + Then the 'Tuesday' checkbox should be checked + + # Checkbox - Wednesday + When I check the 'Wednesday' checkbox in the Days section + Then the 'Wednesday' checkbox should be checked + + # Checkbox - Thursday + When I check the 'Thursday' checkbox in the Days section + Then the 'Thursday' checkbox should be checked + + # Checkbox - Friday + When I check the 'Friday' checkbox in the Days section + Then the 'Friday' checkbox should be checked + + # Country Dropdown + When I select 'India' from the 'Country:' dropdown + Then the 'Country:' dropdown should have 'India' selected + + # Colors List + When I select 'Yellow' from the 'Colors:' list + Then the 'Colors:' list should have 'Yellow' selected + + # Sorted List Dropdown + When I select 'Dog' from the 'Sorted List:' dropdown + Then the 'Sorted List:' dropdown should have 'Dog' selected + + # Date Picker 1 + When I enter '17/02/2026' into the first date picker field labeled 'Datepicker' + Then the first date picker field should display '17/02/2026' + + # Date Picker 2 + When I enter '01/01/2026' into the second date picker field labeled 'SelectedDate' + Then the second date picker field should display '01/01/2026' + + # Date Picker 3 - Start Date + When I enter '10/01/2026' into the 'Start Date' field in Date Picker 3 + Then the 'Start Date' field should display '10/01/2026' + + # Date Picker 3 - End Date + When I enter '10/03/2026' into the 'End Date' field in Date Picker 3 + Then the 'End Date' field should display '10/03/2026' + + # Submit Button + When I click the 'Submit' button in the GUI Elements section + Then the page should remain at 'https://testautomationpractice.blogspot.com/' + And the form should submit without errors + And there should be no visible error messages after submitting the form + And there should be no visible confirmation message after form submission \ No newline at end of file diff --git a/generated_tests/testautomationpractice.blogspot.com/playwright_tests/scenarios/scenarios_summary.md b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/scenarios/scenarios_summary.md new file mode 100644 index 0000000..86a39e3 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/scenarios/scenarios_summary.md @@ -0,0 +1,49 @@ +# Generated Test Scenarios Summary + +## Overview + +- **Total Scenarios**: 1 +- **Application Base URL**: https://testautomationpractice.blogspot.com/ +- **Generated On**: 2026-03-16 12:32:05 + +## Scenarios + +### 1. Discovered Workflow: Automation Practice Form - Complete User Journey +_Comprehensive test covering the full form fill and submission in the GUI Elements section of the Automation Testing Practice site._ + +**Complexity**: High | **Priority**: High | **Risk Level**: High +**Tags**: form-submission, e2e, navigation, data-entry, radio-buttons, checkboxes, dropdowns, date-pickers, regression +**Est. Execution Time**: 95 seconds | **Flakiness Potential**: Low + +**Type**: e2e_business_workflow +**Pages Involved:** +- https://testautomationpractice.blogspot.com/ + +#### Steps: +- Navigate to the Automation Testing Practice homepage. +- Fill the Name field with 'Roostai'. +- Fill the Email field with 'roostai@zb.io'. +- Fill the Phone field with '9999999999'. +- Fill the Address field with 'Bangalore , India'. +- Select the 'Male' gender radio button. +- Check the 'Monday' checkbox. +- Check the 'Tuesday' checkbox. +- Check the 'Wednesday' checkbox. +- Check the 'Thursday' checkbox. +- Check the 'Friday' checkbox. +- Select 'India' from the Country dropdown. +- Select 'Yellow' from the Colors list. +- Select 'Dog' from the Sorted List dropdown. +- Enter '17/02/2026' in Date Picker 1. +- Enter '01/01/2026' in Date Picker 2. +- Enter '10/01/2026' in Date Picker 3 start date field. +- Enter '10/03/2026' in Date Picker 3 end date field. +- Click the 'Submit' button to submit the form. + +#### Expected Results: +- User completes the form workflow successfully. +- All fields accept input and selections as expected. +- Form submits without errors. +- No visible confirmation message appears after submission (per execution flow). + +--- \ No newline at end of file diff --git a/generated_tests/testautomationpractice.blogspot.com/playwright_tests/tests/package.json b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/tests/package.json new file mode 100644 index 0000000..a58a8b8 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/tests/package.json @@ -0,0 +1,24 @@ + + { + "name": "production-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/testautomationpractice.blogspot.com/playwright_tests/tests/playwright.config.js b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/tests/playwright.config.js new file mode 100644 index 0000000..1b76d02 --- /dev/null +++ b/generated_tests/testautomationpractice.blogspot.com/playwright_tests/tests/playwright.config.js @@ -0,0 +1,208 @@ + +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 + */ + +// Check if storage state file exists +const storageStatePath = path.join(__dirname, '.auth', 'storage-state.json'); +const storageStateExists = fs.existsSync(storageStatePath); + +/** + * 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 (!storageStateExists) { + return false; + } + + try { + const storageState = JSON.parse(fs.readFileSync(storageStatePath, 'utf-8')); + + // 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) { + 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', + viewport: null, + // 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', + viewport: null, + // Only set storage state if file exists + ...(storageStateExists ? { storageState: storageStatePath } : {}) + }, + }, + + // ========================================== + // UNAUTHENTICATED TESTS - Public pages (no login) + // ========================================== + { + name: 'chromium-noauth', + testMatch: /.*\.noauth\.spec\.js/, + use: { + browserName: 'chromium', + viewport: null, + // 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 }, + // }, + ], +});