shiplightai 0.1.90 → 0.1.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/debugger-pw.cjs +57 -55
- package/dist/cjs/fixture.cjs +135 -133
- package/dist/cjs/index.cjs +85 -83
- package/dist/cjs/reporter.cjs +42 -42
- package/dist/cli.js +89 -89
- package/dist/debugger-pw.js +56 -54
- package/dist/fixture.js +135 -133
- package/dist/index.js +110 -108
- package/dist/reporter.js +42 -42
- package/dist/static-embedded/assets/{index-CMdPZNG2.js → index-CzL8SI3t.js} +2 -2
- package/dist/static-embedded/assets/{index-Bcj9zYt-.js → index-Dm1PmCd3.js} +34 -7
- package/dist/static-embedded/index.html +1 -1
- package/package.json +3 -3
package/dist/reporter.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import*as x from"fs";import*as v from"path";var I=(e,t,r)=>{e.forEach((i,o)=>{let a=`${t}.${o}`;i.type==="DRAFT"?r[a]={description:i.description||"Draft",action_entity:void 0}:i.type==="ACTION"?r[a]={description:i.description||"Action",action_entity:i.action_entity,locator:i.locator}:i.type==="STEP"&&i.statements?I(i.statements,a,r):i.type==="IF_ELSE"?(r[a]={description:"IF "+(i.condition?.expression||""),action_entity:void 0},i.then&&I(i.then,`${a}.then`,r),i.else&&I(i.else,`${a}.else`,r)):i.type==="WHILE_LOOP"&&(r[a]={description:"WHILE "+(i.condition?.expression||""),action_entity:void 0},i.body&&I(i.body,`${a}.body`,r))})};function H(e){if(!e?.statements||!Array.isArray(e.statements))return{};let t={};return I(e.statements,"main",t),e.teardown&&Array.isArray(e.teardown)&&I(e.teardown,"teardown",t),t}import{v4 as Ot}from"uuid";import{z as s}from"zod";var te=s.enum(["JS_CODE","AI_MODE"]),z=s.object({type:te,expression:s.string()}),re=s.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),F=s.object({uid:s.string(),type:re,comment:s.string().optional()}),ie=s.object({action_data:s.object({action_name:s.string(),kwargs:s.record(s.any()).optional(),args:s.array(s.any()).optional()}),action_description:s.string().optional(),url:s.string().optional(),xpath:s.string().nullable().optional(),locator:s.string().nullable().optional(),css_selector:s.string().nullable().optional(),unique_selector:s.string().nullable().optional(),element_index:s.number().nullable().optional(),frame_path:s.array(s.any()).optional(),artifacts:s.record(s.any()).optional(),feedback:s.string().optional(),original_browser_use_action:s.any().optional()}).passthrough(),oe=F.extend({type:s.literal("DRAFT"),description:s.string()}),ne=F.extend({type:s.literal("ACTION"),description:s.string(),action_entity:ie.optional(),locator:s.string().optional(),use_pure_vision:s.boolean().optional()}),E=s.lazy(()=>s.union([oe,ne,F.extend({type:s.literal("STEP"),description:s.string().optional().default(""),statements:s.array(E),reference_id:s.number().optional(),template_path:s.string().optional(),template_params:s.record(s.string()).optional()}),F.extend({type:s.literal("IF_ELSE"),description:s.string().optional(),condition:z,then:s.array(E),else:s.array(E).optional()}),F.extend({type:s.literal("WHILE_LOOP"),description:s.string().optional(),condition:z,body:s.array(E),timeout_ms:s.number().optional()})])),ae=s.object({name:s.string(),statements:s.array(E),teardown:s.array(E).optional(),skip:s.union([s.boolean(),s.string()]).optional(),timeout:s.number().optional(),fail:s.union([s.boolean(),s.string()]).optional(),only:s.boolean().optional(),slow:s.boolean().optional()}),U=s.object({tests:s.array(ae).min(1),beforeAll:s.array(E).optional(),afterAll:s.array(E).optional(),beforeEach:s.array(E).optional(),afterEach:s.array(E).optional()}),J=s.object({comment:s.string().optional(),version:s.string().optional(),goal:s.string().optional(),url:s.string().optional(),baseURL:s.string().optional(),final_feedback:s.string().optional(),completed:s.boolean().optional(),success:s.boolean().optional(),statements:s.array(E).optional(),teardown:s.array(E).optional(),last_modified_at:s.string().optional(),testGroup:U.optional()}).refine(e=>e.testGroup!==void 0?e.goal===void 0&&(e.statements===void 0||e.statements.length===0):e.goal!==void 0,{message:"TestFlow must have either goal/statements (single test) or testGroup (suite), not both"});import{stringify as Ft,parse as Ie,parseAllDocuments as Wt,parseDocument as Ne,Document as Bt,isMap as K,isSeq as W}from"yaml";import{v4 as P}from"uuid";function Y(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Y);let t=e,r=Object.keys(t);if(r.length===1){let o=r[0];if(o.startsWith("{ ")&&o.endsWith(" }")&&t[o]===null)return`{{${o.slice(2,-2)}}}`}let i={};for(let[o,a]of Object.entries(t))i[o]=Y(a);return i}var se=1024*1024;function N(e){if(e.length>se)throw new Error(`YAML input too large (${e.length} bytes, max ${se})`);let t=Y(Ie(e));if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object at root level");if(t.suite)return De(t);let r={version:"1.3.0",goal:t.goal,url:t.url,baseURL:t.base_url,statements:M(t.statements??[])};t.final_feedback&&(r.final_feedback=t.final_feedback),t.teardown&&Array.isArray(t.teardown)&&(r.teardown=M(t.teardown));let i=J.safeParse(r);if(!i.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(i.error.errors)}`);let o=i.data;return pe(e,o),o}function De(e){let t=e.suite;if(!t||typeof t!="object")throw new Error("Invalid suite: expected an object");let r=t.tests;if(!Array.isArray(r)||r.length===0)throw new Error('Suite must have a non-empty "tests" array');let o={tests:r.map(u=>{if(!u.name)throw new Error('Each test in a suite must have a "name" field');if(!Array.isArray(u.statements)||u.statements.length===0)throw new Error(`Suite test "${u.name}" must have a non-empty "statements" array`);let d={name:u.name,statements:M(u.statements)};return Array.isArray(u.teardown)&&u.teardown.length>0&&(d.teardown=M(u.teardown)),u.skip!==void 0&&(d.skip=u.skip),typeof u.timeout=="number"&&(d.timeout=u.timeout),u.fail!==void 0&&(d.fail=u.fail),u.only===!0&&(d.only=!0),u.slow===!0&&(d.slow=!0),d})};Array.isArray(t.beforeAll)&&t.beforeAll.length>0&&(o.beforeAll=M(t.beforeAll)),Array.isArray(t.afterAll)&&t.afterAll.length>0&&(o.afterAll=M(t.afterAll)),Array.isArray(t.beforeEach)&&t.beforeEach.length>0&&(o.beforeEach=M(t.beforeEach)),Array.isArray(t.afterEach)&&t.afterEach.length>0&&(o.afterEach=M(t.afterEach));let a=U.safeParse(o);if(!a.success)throw new Error(`Invalid TestGroup: ${JSON.stringify(a.error.errors)}`);return{version:"1.3.0",baseURL:t.base_url||void 0,testGroup:a.data}}function M(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map(Ce)}function Ce(e){if(typeof e=="string")throw new Error(`Plain string statements are not supported. Use an object with a "desc" key instead. Example: { "desc": "${e}" }`);if(typeof e!="object"||e===null)throw new Error(`Invalid statement: expected object, got ${typeof e}`);let t=e;if("IF"in t)return Fe(t);if("WHILE"in t)return We(t);if("STEP"in t)return Be(t);if("VERIFY"in t){let r=t.VERIFY,i={statement:typeof r=="string"?r:String(r)};return typeof t.js=="string"&&(i.code=t.js),{uid:P(),type:"ACTION",description:String(r),action_entity:{action_description:String(r),action_data:{action_name:"verify",kwargs:i}}}}if("URL"in t){let r=t.URL,i=t.new_tab===!0?!0:void 0,o=typeof t.timeout_seconds=="number"?t.timeout_seconds:void 0,a={url:typeof r=="string"?r:String(r)};return i&&(a.new_tab=!0),o!==void 0&&(a.timeout_seconds=o),{uid:P(),type:"ACTION",description:`Navigate to ${r}`,action_entity:{action_description:`Navigate to ${r}`,action_data:{action_name:"go_to_url",kwargs:a}}}}if("WAIT_UNTIL"in t){let r=t.WAIT_UNTIL,i=typeof t.timeout_seconds=="number"?t.timeout_seconds:60;return{uid:P(),type:"ACTION",description:`Wait until: ${r}`,action_entity:{action_description:`Wait until: ${r}`,action_data:{action_name:"ai_wait_until",kwargs:{condition:typeof r=="string"?r:String(r),timeout_seconds:i}}}}}if("WAIT"in t){let r=t.WAIT,i=typeof t.seconds=="number"?t.seconds:3;return{uid:P(),type:"ACTION",description:typeof r=="string"?r:`Wait ${i}s`,action_entity:{action_description:typeof r=="string"?r:`Wait ${i}s`,action_data:{action_name:"wait",kwargs:{seconds:i}}}}}if("CODE"in t){let r=t.CODE;if(r==null)throw new Error('CODE statement has no code. Use "CODE: |" followed by indented code on the next line.');let i=typeof t.description=="string"?t.description:"Code block";return{uid:P(),type:"ACTION",description:i,action_entity:{action_description:i,action_data:{action_name:"js_code",kwargs:{code:typeof r=="string"?r:String(r)}}}}}if("js"in t&&!("VERIFY"in t)&&!("action"in t)){if("intent"in t||"desc"in t)throw new Error("A `js:` statement uses `description:`, not `intent:`. Raw JS does not self-heal \u2014 use `description: + js:` for code, or express it as a structured action (`intent:` + `action:`/`locator:`) to keep self-healing.");let r=typeof t.description=="string"&&t.description.trim()!==""?t.description:"Code block",i=t.js;return{uid:P(),type:"ACTION",description:r,action_entity:{action_description:r,action_data:{action_name:"js_code",kwargs:{code:typeof i=="string"?i:String(i)}}}}}if("call"in t&&typeof t.call=="string"){let{call:r,...i}=t;return ce({...i,action:"function",functionName:r})}if("action"in t)return ce(t);if("intent"in t&&typeof t.intent=="string"||"desc"in t&&typeof t.desc=="string")return{uid:P(),type:"DRAFT",description:typeof t.intent=="string"?t.intent:t.desc};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(t)}`)}function le(e){if(typeof e!="string")throw new Error(`Condition must be a string, got ${typeof e}`);return e.startsWith("js:")?{type:"JS_CODE",expression:e.slice(3)}:{type:"AI_MODE",expression:e}}function Fe(e){let t=le(e.IF),r=e.THEN;if(!Array.isArray(r))throw new Error("IF_ELSE requires a THEN array");let i={uid:P(),type:"IF_ELSE",condition:t,then:M(r)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(i.else=M(e.ELSE)),i}function We(e){let t=le(e.WHILE),r=e.DO;if(!Array.isArray(r))throw new Error("WHILE_LOOP requires a DO array");let i={uid:P(),type:"WHILE_LOOP",condition:t,body:M(r)};return typeof e.timeout_ms=="number"&&(i.timeout_ms=e.timeout_ms),i}function Be(e){let t=typeof e.STEP=="string"?e.STEP:"";if(!Array.isArray(e.statements))throw new Error("STEP requires a statements array");let r={uid:P(),type:"STEP",description:t,statements:M(e.statements)};if(typeof e.reference_id=="number"&&(r.reference_id=e.reference_id),typeof e.template_path=="string"&&(r.template_path=e.template_path),e.template_params&&typeof e.template_params=="object"&&!Array.isArray(e.template_params)){let i=e.template_params,o={};for(let[a,n]of Object.entries(i))o[a]=String(n);r.template_params=o}return r}var Re=new Set(["action","intent","desc","locator","xpath","use_pure_vision"]);function ce(e){let t=typeof e.action=="string"?e.action:String(e.action),r=typeof e.intent=="string"?e.intent:typeof e.desc=="string"?e.desc:"",i=typeof e.locator=="string"?e.locator:void 0,o=typeof e.xpath=="string"?e.xpath:void 0,a=typeof e.use_pure_vision=="boolean"?e.use_pure_vision:void 0,n={};for(let[p,b]of Object.entries(e))Re.has(p)||(n[p]=b);t==="verify"&&typeof n.js=="string"&&(n.code=n.js,delete n.js),(t==="ai_action"||t==="ai_step")&&(n.statement===void 0&&(n.statement=r),a&&(n.use_pure_vision=!0));let u={action_description:r,action_data:{action_name:t,kwargs:Object.keys(n).length>0?n:{}}};i&&(u.locator=i),o&&(u.xpath=o);let d={uid:P(),type:"ACTION",description:r,action_entity:u};return a&&(d.use_pure_vision=!0),d}function pe(e,t){let r;try{r=Ne(e)}catch{return}let i=r.contents;if(!i||!K(i))return;if(r.commentBefore)t.comment=r.commentBefore;else{let d=i.items?.[0];d?.key&&d.key.commentBefore&&(t.comment=d.key.commentBefore)}let o=i,a=o.get("statements",!0);W(a)&&t.statements&&B(a,t.statements);let n=o.get("teardown",!0);W(n)&&t.teardown&&B(n,t.teardown)}function B(e,t){e.commentBefore&&t.length>0&&(t[0].comment=e.commentBefore);for(let r=0;r<Math.min(e.items.length,t.length);r++){let i=e.items[r];i.commentBefore&&!(r===0&&e.commentBefore)&&(t[r].comment=i.commentBefore);let o=t[r];if(o.type==="STEP"&&K(i)){let a=i.get("statements",!0);W(a)&&B(a,o.statements)}else if(o.type==="IF_ELSE"&&K(i)){let a=i.get("THEN",!0);W(a)&&B(a,o.then);let n=i.get("ELSE",!0);W(n)&&o.else&&B(n,o.else)}else if(o.type==="WHILE_LOOP"&&K(i)){let a=i.get("DO",!0);W(a)&&B(a,o.body)}}}import{parse as Kt,stringify as jt}from"yaml";var D=(e=>(e.DRAFT="DRAFT",e.STEP="STEP",e.ACTION="ACTION",e.IF_ELSE="IF_ELSE",e.WHILE_LOOP="WHILE_LOOP",e))(D||{});var He=Object.freeze(["anthropic:claude-sonnet-5","google:gemini-3.1-pro-preview"]);var ue=112;var Ke=1080-ue;var de={"Blackberry PlayBook":{name:"Blackberry PlayBook",userAgent:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/26.0 Safari/536.2+",screen:{width:600,height:1024},viewport:{width:600,height:1024},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"BlackBerry Z30":{name:"BlackBerry Z30",userAgent:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/26.0 Mobile Safari/537.10+",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note 3":{name:"Galaxy Note 3",userAgent:"Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note II":{name:"Galaxy Note II",userAgent:"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S III":{name:"Galaxy S III",userAgent:"Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S5":{name:"Galaxy S5",userAgent:"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S8":{name:"Galaxy S8",userAgent:"Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:740},viewport:{width:360,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S9+":{name:"Galaxy S9+",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:320,height:658},viewport:{width:320,height:658},deviceScaleFactor:4.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S24":{name:"Galaxy S24",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-S921U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:780},viewport:{width:360,height:780},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy A55":{name:"Galaxy A55",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-A556B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:480,height:1040},viewport:{width:480,height:1040},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S4":{name:"Galaxy Tab S4",userAgent:"Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:712,height:1138},viewport:{width:712,height:1138},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S9":{name:"Galaxy Tab S9",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-X710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:640,height:1024},viewport:{width:640,height:1024},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"iPad (gen 5)":{name:"iPad (gen 5)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 6)":{name:"iPad (gen 6)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 7)":{name:"iPad (gen 7)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:810,height:1080},viewport:{width:810,height:1080},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 11)":{name:"iPad (gen 11)",userAgent:"Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/604.1",screen:{width:656,height:944},viewport:{width:656,height:944},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Mini":{name:"iPad Mini",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Pro 11":{name:"iPad Pro 11",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:834,height:1194},viewport:{width:834,height:1194},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6":{name:"iPhone 6",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6 Plus":{name:"iPhone 6 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7":{name:"iPhone 7",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7 Plus":{name:"iPhone 7 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8":{name:"iPhone 8",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8 Plus":{name:"iPhone 8 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE":{name:"iPhone SE",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/14E304 Safari/602.1",screen:{width:320,height:568},viewport:{width:320,height:568},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE (3rd gen)":{name:"iPhone SE (3rd gen)",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/602.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone X":{name:"iPhone X",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:812},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone XR":{name:"iPhone XR",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:896},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11":{name:"iPhone 11",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro":{name:"iPhone 11 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:635},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro Max":{name:"iPhone 11 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12":{name:"iPhone 12",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro":{name:"iPhone 12 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro Max":{name:"iPhone 12 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Mini":{name:"iPhone 12 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13":{name:"iPhone 13",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro":{name:"iPhone 13 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro Max":{name:"iPhone 13 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Mini":{name:"iPhone 13 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14":{name:"iPhone 14",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Plus":{name:"iPhone 14 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro":{name:"iPhone 14 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:660},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro Max":{name:"iPhone 14 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15":{name:"iPhone 15",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Plus":{name:"iPhone 15 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro":{name:"iPhone 15 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro Max":{name:"iPhone 15 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Kindle Fire HDX":{name:"Kindle Fire HDX",userAgent:"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"LG Optimus L70":{name:"LG Optimus L70",userAgent:"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:1.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 550":{name:"Microsoft Lumia 550",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 950":{name:"Microsoft Lumia 950",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:4,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 10":{name:"Nexus 10",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 4":{name:"Nexus 4",userAgent:"Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5":{name:"Nexus 5",userAgent:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5X":{name:"Nexus 5X",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6":{name:"Nexus 6",userAgent:"Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6P":{name:"Nexus 6P",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 7":{name:"Nexus 7",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:600,height:960},viewport:{width:600,height:960},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia Lumia 520":{name:"Nokia Lumia 520",userAgent:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",screen:{width:320,height:533},viewport:{width:320,height:533},deviceScaleFactor:1.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia N9":{name:"Nokia N9",userAgent:"Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",screen:{width:480,height:854},viewport:{width:480,height:854},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Pixel 2":{name:"Pixel 2",userAgent:"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:731},viewport:{width:411,height:731},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 2 XL":{name:"Pixel 2 XL",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:823},viewport:{width:411,height:823},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 3":{name:"Pixel 3",userAgent:"Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:786},viewport:{width:393,height:786},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4":{name:"Pixel 4",userAgent:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:353,height:745},viewport:{width:353,height:745},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4a (5G)":{name:"Pixel 4a (5G)",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:892},viewport:{width:412,height:765},deviceScaleFactor:2.63,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 5":{name:"Pixel 5",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:851},viewport:{width:393,height:727},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 7":{name:"Pixel 7",userAgent:"Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:915},viewport:{width:412,height:839},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Moto G4":{name:"Moto G4",userAgent:"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Desktop Chrome HiDPI":{name:"Desktop Chrome HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge HiDPI":{name:"Desktop Edge HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Firefox HiDPI":{name:"Desktop Firefox HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"},"Desktop Safari":{name:"Desktop Safari",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"webkit"},"Desktop Chrome":{name:"Desktop Chrome",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome Medium Resolution":{name:"Desktop Chrome Medium Resolution",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome (Branded)":{name:"Desktop Chrome (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Chrome Medium Resolution (Branded)":{name:"Desktop Chrome Medium Resolution (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Edge":{name:"Desktop Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge (Branded)":{name:"Desktop Edge (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Edge Medium Resolution (Branded)":{name:"Desktop Edge Medium Resolution (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Firefox":{name:"Desktop Firefox",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"}};var he={desktop:["Desktop Chrome","Desktop Chrome Medium Resolution","Desktop Chrome (Branded)","Desktop Chrome Medium Resolution (Branded)","Desktop Edge (Branded)","Desktop Edge Medium Resolution (Branded)","Desktop Safari"],mobile:["iPhone 15 Pro Max","iPhone 15 Pro","iPhone 15 Plus","iPhone 15","iPhone 14 Pro Max","iPhone 14 Pro","iPhone 14 Plus","iPhone 14","iPhone 13 Pro Max","iPhone 13 Pro","iPhone 13","iPhone 13 Mini","iPhone 12 Pro Max","iPhone 12 Pro","iPhone 12","iPhone 12 Mini","iPhone 11 Pro Max","iPhone 11 Pro","iPhone 11","iPhone XR","iPhone X","iPhone SE (3rd gen)","iPhone SE","iPhone 8 Plus","iPhone 8","iPhone 7 Plus","iPhone 7","iPhone 6 Plus","iPhone 6","Galaxy S24","Galaxy A55","Galaxy S9+","Galaxy S8","Galaxy S5","Galaxy Note 3","Galaxy Note II","Galaxy S III","Pixel 7","Pixel 5","Pixel 4a (5G)","Pixel 4","Pixel 3","Pixel 2 XL","Pixel 2","Nexus 6P","Nexus 6","Nexus 5X","Nexus 5","Nexus 4","Moto G4","LG Optimus L70","Microsoft Lumia 950","Microsoft Lumia 550","Nokia Lumia 520","Nokia N9","BlackBerry Z30"]},G=(e,t=!1)=>{let r=["chromium"];return t&&r.push("webkit"),he[e].map(i=>de[i]).filter(i=>i.defaultBrowserType&&r.includes(i.defaultBrowserType))};var je={desktop:{label:"Desktop",type:"desktop",devices:G("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:G("mobile")}},Ve={desktop:{label:"Desktop",type:"desktop",devices:G("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:G("mobile",!0)}};import{stringify as fo}from"yaml";import X from"node:path";import{createHash as Ze}from"crypto";import{parse as Qe,stringify as _e}from"yaml";import{readFileSync as et,existsSync as tt}from"fs";import{resolve as q,dirname as rt}from"path";import{parse as me,stringify as it}from"yaml";var ye=5e3;function Xe(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function qe(e){let t=e.xpath;return typeof t=="string"&&t.trim()?!t.startsWith("xpath=")&&!t.startsWith("/")&&!t.startsWith("//")?`xpath=//${t}`:t.startsWith("xpath=")?t:`xpath=${t}`:null}function be(e){let t=Xe(e),r=e.locator;if(typeof r=="string"&&r.trim())return r=r.trim(),r.endsWith("first()")?`${t}.${r}`:`${t}.${r}.first()`;let i=qe(e);if(i){let o=JSON.stringify(i);return`${t}.locator(${o}).first()`}return null}var $=new Map;function f(e,t){$.set(e,t)}function C(e,t,r=[]){let i=[...r];return t.locator?i.push(`locator: ${JSON.stringify(t.locator)}`):t.xpath&&i.push(`xpath: ${JSON.stringify(t.xpath)}`),t.frame_path&&t.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(t.frame_path)}`),i.length===0?[`await agent.execAction("${e}", page, {});`]:[`await agent.execAction("${e}", page, {`,...i.map(o=>` ${o},`),"});"]}f("click",e=>{let t=be(e);if(!t)return['await agent.execAction("click", page, {});'];let r=e.action_data?.kwargs?.timeout_ms??ye;return[`await ${t}.click({ timeout: ${r} });`]});f("click_element",$.get("click"));f("click_element_by_index",$.get("click"));f("double_click",e=>C("double_click",e));f("double_click_on_element",$.get("double_click"));f("right_click",e=>C("right_click",e));f("right_click_on_element",$.get("right_click"));f("hover",e=>C("hover",e));f("hover_element_by_index",$.get("hover"));f("input_text",e=>{let t=e.action_data?.kwargs?.text??e.action_data?.kwargs?.value??"";return C("input_text",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});f("fill",$.get("input_text"));f("clear_input",e=>C("clear_input",e));f("press",e=>{let t=e.action_data?.kwargs?.keys;return[`await page.keyboard.press(${JSON.stringify(t)});`]});f("send_keys",$.get("press"));f("send_keys_on_element",e=>{let t=be(e),r=e.action_data?.kwargs?.keys||"";if(!t)return['await agent.execAction("send_keys_on_element", page, {',` action_data: { kwargs: { keys: ${JSON.stringify(r)} } },`,"});"];let i=e.action_data?.kwargs?.timeout_ms??ye;return[`await ${t}.press(${JSON.stringify(r)}, { timeout: ${i} });`]});f("select_dropdown_option",e=>{let t=e.action_data?.kwargs?.text||e.action_data?.kwargs?.option||"";return C("select_dropdown_option",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});f("scroll",e=>{let t=e.action_data?.kwargs?.down??!0;return[`await page.evaluate('window.scrollBy(0, window.innerHeight * ${(e.action_data?.kwargs?.num_pages??1)*(t?1:-1)})');`]});f("scroll_down",$.get("scroll"));f("scroll_up",$.get("scroll"));f("scroll_element",$.get("scroll"));f("scroll_to_text",e=>{let t=e.action_data?.kwargs?.text||"";return[`await page.getByText(${JSON.stringify(t)}, { exact: false }).first().scrollIntoViewIfNeeded();`]});f("scroll_on_element",e=>C("scroll_on_element",e,[`action_data: { kwargs: ${JSON.stringify(e.action_data?.kwargs||{})} }`]));f("go_to_url",e=>{let t=e.action_data?.kwargs?.url||"";return e.action_data?.kwargs?.new_tab===!0?['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)}, new_tab: true } },`,"});"]:['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)} } },`,"});"]});f("open_tab",$.get("go_to_url"));f("go_back",()=>['await agent.execAction("go_back", page, {});']);f("reload_page",()=>['await agent.execAction("reload_page", page, {});']);f("wait",e=>[`await page.waitForTimeout(${(e.action_data?.kwargs?.seconds||1)*1e3});`]);f("wait_for_page_ready",()=>["await page.waitForLoadState('domcontentloaded');"]);f("verify",(e,t)=>{let r=e.action_data?.kwargs,i=typeof r?.code=="string",o=i?r?.statement||e.action_description:e.action_description||r?.statement;if(i&&o){let n=r.code.split(`
|
|
2
|
-
`),
|
|
3
|
-
`):
|
|
4
|
-
`);for(let
|
|
5
|
-
`):["// Skipping js_action: missing code"]});function
|
|
6
|
-
`);return e.codeStartLine!=null&&e.codeLine!=null?`<div class="step-code"><pre class="code-block">${t.map((
|
|
7
|
-
<details class="step-details step step-${e.status}"${
|
|
1
|
+
import*as x from"fs";import*as v from"path";var I=(e,t,r)=>{e.forEach((i,n)=>{let a=`${t}.${n}`;i.type==="DRAFT"?r[a]={description:i.description||"Draft",action_entity:void 0}:i.type==="ACTION"?r[a]={description:i.description||"Action",action_entity:i.action_entity,locator:i.locator}:i.type==="STEP"&&i.statements?I(i.statements,a,r):i.type==="IF_ELSE"?(r[a]={description:"IF "+(i.condition?.expression||""),action_entity:void 0},i.then&&I(i.then,`${a}.then`,r),i.else&&I(i.else,`${a}.else`,r)):i.type==="WHILE_LOOP"&&(r[a]={description:"WHILE "+(i.condition?.expression||""),action_entity:void 0},i.body&&I(i.body,`${a}.body`,r))})};function U(e){if(!e?.statements||!Array.isArray(e.statements))return{};let t={};return I(e.statements,"main",t),e.teardown&&Array.isArray(e.teardown)&&I(e.teardown,"teardown",t),t}import{z as s}from"zod";var ie=s.enum(["JS_CODE","AI_MODE"]),z=s.object({type:ie,expression:s.string()}),ne=s.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),F=s.object({uid:s.string(),type:ne,comment:s.string().optional()}),oe=s.object({action_data:s.object({action_name:s.string(),kwargs:s.record(s.any()).optional(),args:s.array(s.any()).optional()}),action_description:s.string().optional(),url:s.string().optional(),xpath:s.string().nullable().optional(),locator:s.string().nullable().optional(),css_selector:s.string().nullable().optional(),unique_selector:s.string().nullable().optional(),element_index:s.number().nullable().optional(),frame_path:s.array(s.any()).optional(),artifacts:s.record(s.any()).optional(),feedback:s.string().optional(),original_browser_use_action:s.any().optional()}).passthrough(),ae=F.extend({type:s.literal("DRAFT"),description:s.string()}),se=F.extend({type:s.literal("ACTION"),description:s.string(),action_entity:oe.optional(),locator:s.string().optional(),use_pure_vision:s.boolean().optional()}),E=s.lazy(()=>s.union([ae,se,F.extend({type:s.literal("STEP"),description:s.string().optional().default(""),statements:s.array(E),reference_id:s.number().optional(),template_path:s.string().optional(),template_params:s.record(s.string()).optional()}),F.extend({type:s.literal("IF_ELSE"),description:s.string().optional(),condition:z,then:s.array(E),else:s.array(E).optional()}),F.extend({type:s.literal("WHILE_LOOP"),description:s.string().optional(),condition:z,body:s.array(E),timeout_ms:s.number().optional()})])),ce=s.object({name:s.string(),statements:s.array(E),teardown:s.array(E).optional(),skip:s.union([s.boolean(),s.string()]).optional(),timeout:s.number().optional(),fail:s.union([s.boolean(),s.string()]).optional(),only:s.boolean().optional(),slow:s.boolean().optional()}),H=s.object({tests:s.array(ce).min(1),beforeAll:s.array(E).optional(),afterAll:s.array(E).optional(),beforeEach:s.array(E).optional(),afterEach:s.array(E).optional()}),J=s.object({comment:s.string().optional(),version:s.string().optional(),goal:s.string().optional(),url:s.string().optional(),baseURL:s.string().optional(),final_feedback:s.string().optional(),completed:s.boolean().optional(),success:s.boolean().optional(),statements:s.array(E).optional(),teardown:s.array(E).optional(),last_modified_at:s.string().optional(),testGroup:H.optional()}).refine(e=>e.testGroup!==void 0?e.goal===void 0&&(e.statements===void 0||e.statements.length===0):e.goal!==void 0,{message:"TestFlow must have either goal/statements (single test) or testGroup (suite), not both"});import{stringify as Ut,parse as Fe,parseAllDocuments as Ht,parseDocument as We,Document as Kt,isMap as K,isSeq as W}from"yaml";import{v4 as P}from"uuid";function Y(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Y);let t=e,r=Object.keys(t);if(r.length===1){let n=r[0];if(n.startsWith("{ ")&&n.endsWith(" }")&&t[n]===null)return`{{${n.slice(2,-2)}}}`}let i={};for(let[n,a]of Object.entries(t))i[n]=Y(a);return i}var le=1024*1024;function N(e){if(e.length>le)throw new Error(`YAML input too large (${e.length} bytes, max ${le})`);let t=Y(Fe(e));if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object at root level");if(t.suite)return Re(t);let r={version:"1.3.0",goal:t.goal,url:t.url,baseURL:t.base_url,statements:M(t.statements??[])};t.final_feedback&&(r.final_feedback=t.final_feedback),t.teardown&&Array.isArray(t.teardown)&&(r.teardown=M(t.teardown));let i=J.safeParse(r);if(!i.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(i.error.errors)}`);let n=i.data;return ue(e,n),n}function Re(e){let t=e.suite;if(!t||typeof t!="object")throw new Error("Invalid suite: expected an object");let r=t.tests;if(!Array.isArray(r)||r.length===0)throw new Error('Suite must have a non-empty "tests" array');let n={tests:r.map(l=>{if(!l.name)throw new Error('Each test in a suite must have a "name" field');if(!Array.isArray(l.statements)||l.statements.length===0)throw new Error(`Suite test "${l.name}" must have a non-empty "statements" array`);let p={name:l.name,statements:M(l.statements)};return Array.isArray(l.teardown)&&l.teardown.length>0&&(p.teardown=M(l.teardown)),l.skip!==void 0&&(p.skip=l.skip),typeof l.timeout=="number"&&(p.timeout=l.timeout),l.fail!==void 0&&(p.fail=l.fail),l.only===!0&&(p.only=!0),l.slow===!0&&(p.slow=!0),p})};Array.isArray(t.beforeAll)&&t.beforeAll.length>0&&(n.beforeAll=M(t.beforeAll)),Array.isArray(t.afterAll)&&t.afterAll.length>0&&(n.afterAll=M(t.afterAll)),Array.isArray(t.beforeEach)&&t.beforeEach.length>0&&(n.beforeEach=M(t.beforeEach)),Array.isArray(t.afterEach)&&t.afterEach.length>0&&(n.afterEach=M(t.afterEach));let a=H.safeParse(n);if(!a.success)throw new Error(`Invalid TestGroup: ${JSON.stringify(a.error.errors)}`);return{version:"1.3.0",baseURL:t.base_url||void 0,testGroup:a.data}}function M(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map(Be)}function Be(e){if(typeof e=="string")throw new Error(`Plain string statements are not supported. Use an object with a "desc" key instead. Example: { "desc": "${e}" }`);if(typeof e!="object"||e===null)throw new Error(`Invalid statement: expected object, got ${typeof e}`);let t=e;if("IF"in t)return Ge(t);if("WHILE"in t)return Ue(t);if("STEP"in t)return He(t);if("VERIFY"in t){let r=t.VERIFY,i={statement:typeof r=="string"?r:String(r)};return typeof t.js=="string"&&(i.code=t.js),{uid:P(),type:"ACTION",description:String(r),action_entity:{action_description:String(r),action_data:{action_name:"verify",kwargs:i}}}}if("URL"in t){let r=t.URL,i=t.new_tab===!0?!0:void 0,n=typeof t.timeout_seconds=="number"?t.timeout_seconds:void 0,a={url:typeof r=="string"?r:String(r)};return i&&(a.new_tab=!0),n!==void 0&&(a.timeout_seconds=n),{uid:P(),type:"ACTION",description:`Navigate to ${r}`,action_entity:{action_description:`Navigate to ${r}`,action_data:{action_name:"go_to_url",kwargs:a}}}}if("WAIT_UNTIL"in t){let r=X(typeof t.WAIT_UNTIL=="string"?t.WAIT_UNTIL:String(t.WAIT_UNTIL)),i=typeof t.timeout_seconds=="number"?t.timeout_seconds:60;return{uid:P(),type:"ACTION",description:`Wait until: ${r.expression}`,action_entity:{action_description:`Wait until: ${r.expression}`,action_data:{action_name:"ai_wait_until",kwargs:{condition:r.expression,condition_type:r.type,timeout_seconds:i}}}}}if("WAIT"in t){let r=t.WAIT,i=typeof t.seconds=="number"?t.seconds:3;return{uid:P(),type:"ACTION",description:typeof r=="string"?r:`Wait ${i}s`,action_entity:{action_description:typeof r=="string"?r:`Wait ${i}s`,action_data:{action_name:"wait",kwargs:{seconds:i}}}}}if("CODE"in t){let r=t.CODE;if(r==null)throw new Error('CODE statement has no code. Use "CODE: |" followed by indented code on the next line.');let i=typeof t.description=="string"?t.description:"Code block";return{uid:P(),type:"ACTION",description:i,action_entity:{action_description:i,action_data:{action_name:"js_code",kwargs:{code:typeof r=="string"?r:String(r)}}}}}if("js"in t&&!("VERIFY"in t)&&!("action"in t)){if("intent"in t||"desc"in t)throw new Error("A `js:` statement uses `description:`, not `intent:`. Raw JS does not self-heal \u2014 use `description: + js:` for code, or express it as a structured action (`intent:` + `action:`/`locator:`) to keep self-healing.");let r=typeof t.description=="string"&&t.description.trim()!==""?t.description:"Code block",i=t.js;return{uid:P(),type:"ACTION",description:r,action_entity:{action_description:r,action_data:{action_name:"js_code",kwargs:{code:typeof i=="string"?i:String(i)}}}}}if("call"in t&&typeof t.call=="string"){let{call:r,...i}=t;return pe({...i,action:"function",functionName:r})}if("action"in t)return pe(t);if("intent"in t&&typeof t.intent=="string"||"desc"in t&&typeof t.desc=="string")return{uid:P(),type:"DRAFT",description:typeof t.intent=="string"?t.intent:t.desc};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(t)}`)}function X(e){if(typeof e!="string")throw new Error(`Condition must be a string, got ${typeof e}`);return e.startsWith("js:")?{type:"JS_CODE",expression:e.slice(3)}:{type:"AI_MODE",expression:e}}function Ge(e){let t=X(e.IF),r=e.THEN;if(!Array.isArray(r))throw new Error("IF_ELSE requires a THEN array");let i={uid:P(),type:"IF_ELSE",condition:t,then:M(r)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(i.else=M(e.ELSE)),i}function Ue(e){let t=X(e.WHILE),r=e.DO;if(!Array.isArray(r))throw new Error("WHILE_LOOP requires a DO array");let i={uid:P(),type:"WHILE_LOOP",condition:t,body:M(r)};return typeof e.timeout_ms=="number"&&(i.timeout_ms=e.timeout_ms),i}function He(e){let t=typeof e.STEP=="string"?e.STEP:"";if(!Array.isArray(e.statements))throw new Error("STEP requires a statements array");let r={uid:P(),type:"STEP",description:t,statements:M(e.statements)};if(typeof e.reference_id=="number"&&(r.reference_id=e.reference_id),typeof e.template_path=="string"&&(r.template_path=e.template_path),e.template_params&&typeof e.template_params=="object"&&!Array.isArray(e.template_params)){let i=e.template_params,n={};for(let[a,o]of Object.entries(i))n[a]=String(o);r.template_params=n}return r}var Ke=new Set(["action","intent","desc","locator","xpath","use_pure_vision"]);function pe(e){let t=typeof e.action=="string"?e.action:String(e.action),r=typeof e.intent=="string"?e.intent:typeof e.desc=="string"?e.desc:"",i=typeof e.locator=="string"?e.locator:void 0,n=typeof e.xpath=="string"?e.xpath:void 0,a=typeof e.use_pure_vision=="boolean"?e.use_pure_vision:void 0,o={};for(let[u,y]of Object.entries(e))Ke.has(u)||(o[u]=y);t==="verify"&&typeof o.js=="string"&&(o.code=o.js,delete o.js),(t==="ai_action"||t==="ai_step")&&(o.statement===void 0&&(o.statement=r),a&&(o.use_pure_vision=!0));let l={action_description:r,action_data:{action_name:t,kwargs:Object.keys(o).length>0?o:{}}};i&&(l.locator=i),n&&(l.xpath=n);let p={uid:P(),type:"ACTION",description:r,action_entity:l};return a&&(p.use_pure_vision=!0),p}function ue(e,t){let r;try{r=We(e)}catch{return}let i=r.contents;if(!i||!K(i))return;if(r.commentBefore)t.comment=r.commentBefore;else{let p=i.items?.[0];p?.key&&p.key.commentBefore&&(t.comment=p.key.commentBefore)}let n=i,a=n.get("statements",!0);W(a)&&t.statements&&R(a,t.statements);let o=n.get("teardown",!0);W(o)&&t.teardown&&R(o,t.teardown)}function R(e,t){e.commentBefore&&t.length>0&&(t[0].comment=e.commentBefore);for(let r=0;r<Math.min(e.items.length,t.length);r++){let i=e.items[r];i.commentBefore&&!(r===0&&e.commentBefore)&&(t[r].comment=i.commentBefore);let n=t[r];if(n.type==="STEP"&&K(i)){let a=i.get("statements",!0);W(a)&&R(a,n.statements)}else if(n.type==="IF_ELSE"&&K(i)){let a=i.get("THEN",!0);W(a)&&R(a,n.then);let o=i.get("ELSE",!0);W(o)&&n.else&&R(o,n.else)}else if(n.type==="WHILE_LOOP"&&K(i)){let a=i.get("DO",!0);W(a)&&R(a,n.body)}}}import{v4 as Qt}from"uuid";import{parse as ir,stringify as nr}from"yaml";var D=(e=>(e.DRAFT="DRAFT",e.STEP="STEP",e.ACTION="ACTION",e.IF_ELSE="IF_ELSE",e.WHILE_LOOP="WHILE_LOOP",e))(D||{});var de=112;var Ye=1080-de;var fe={"Blackberry PlayBook":{name:"Blackberry PlayBook",userAgent:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/26.0 Safari/536.2+",screen:{width:600,height:1024},viewport:{width:600,height:1024},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"BlackBerry Z30":{name:"BlackBerry Z30",userAgent:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/26.0 Mobile Safari/537.10+",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note 3":{name:"Galaxy Note 3",userAgent:"Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note II":{name:"Galaxy Note II",userAgent:"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S III":{name:"Galaxy S III",userAgent:"Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S5":{name:"Galaxy S5",userAgent:"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S8":{name:"Galaxy S8",userAgent:"Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:740},viewport:{width:360,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S9+":{name:"Galaxy S9+",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:320,height:658},viewport:{width:320,height:658},deviceScaleFactor:4.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S24":{name:"Galaxy S24",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-S921U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:780},viewport:{width:360,height:780},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy A55":{name:"Galaxy A55",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-A556B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:480,height:1040},viewport:{width:480,height:1040},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S4":{name:"Galaxy Tab S4",userAgent:"Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:712,height:1138},viewport:{width:712,height:1138},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S9":{name:"Galaxy Tab S9",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-X710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:640,height:1024},viewport:{width:640,height:1024},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"iPad (gen 5)":{name:"iPad (gen 5)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 6)":{name:"iPad (gen 6)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 7)":{name:"iPad (gen 7)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:810,height:1080},viewport:{width:810,height:1080},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 11)":{name:"iPad (gen 11)",userAgent:"Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/604.1",screen:{width:656,height:944},viewport:{width:656,height:944},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Mini":{name:"iPad Mini",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Pro 11":{name:"iPad Pro 11",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:834,height:1194},viewport:{width:834,height:1194},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6":{name:"iPhone 6",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6 Plus":{name:"iPhone 6 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7":{name:"iPhone 7",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7 Plus":{name:"iPhone 7 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8":{name:"iPhone 8",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8 Plus":{name:"iPhone 8 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE":{name:"iPhone SE",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/14E304 Safari/602.1",screen:{width:320,height:568},viewport:{width:320,height:568},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE (3rd gen)":{name:"iPhone SE (3rd gen)",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/602.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone X":{name:"iPhone X",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:812},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone XR":{name:"iPhone XR",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:896},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11":{name:"iPhone 11",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro":{name:"iPhone 11 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:635},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro Max":{name:"iPhone 11 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12":{name:"iPhone 12",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro":{name:"iPhone 12 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro Max":{name:"iPhone 12 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Mini":{name:"iPhone 12 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13":{name:"iPhone 13",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro":{name:"iPhone 13 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro Max":{name:"iPhone 13 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Mini":{name:"iPhone 13 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14":{name:"iPhone 14",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Plus":{name:"iPhone 14 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro":{name:"iPhone 14 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:660},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro Max":{name:"iPhone 14 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15":{name:"iPhone 15",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Plus":{name:"iPhone 15 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro":{name:"iPhone 15 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro Max":{name:"iPhone 15 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Kindle Fire HDX":{name:"Kindle Fire HDX",userAgent:"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"LG Optimus L70":{name:"LG Optimus L70",userAgent:"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:1.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 550":{name:"Microsoft Lumia 550",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 950":{name:"Microsoft Lumia 950",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:4,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 10":{name:"Nexus 10",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 4":{name:"Nexus 4",userAgent:"Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5":{name:"Nexus 5",userAgent:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5X":{name:"Nexus 5X",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6":{name:"Nexus 6",userAgent:"Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6P":{name:"Nexus 6P",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 7":{name:"Nexus 7",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:600,height:960},viewport:{width:600,height:960},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia Lumia 520":{name:"Nokia Lumia 520",userAgent:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",screen:{width:320,height:533},viewport:{width:320,height:533},deviceScaleFactor:1.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia N9":{name:"Nokia N9",userAgent:"Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",screen:{width:480,height:854},viewport:{width:480,height:854},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Pixel 2":{name:"Pixel 2",userAgent:"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:731},viewport:{width:411,height:731},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 2 XL":{name:"Pixel 2 XL",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:823},viewport:{width:411,height:823},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 3":{name:"Pixel 3",userAgent:"Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:786},viewport:{width:393,height:786},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4":{name:"Pixel 4",userAgent:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:353,height:745},viewport:{width:353,height:745},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4a (5G)":{name:"Pixel 4a (5G)",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:892},viewport:{width:412,height:765},deviceScaleFactor:2.63,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 5":{name:"Pixel 5",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:851},viewport:{width:393,height:727},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 7":{name:"Pixel 7",userAgent:"Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:915},viewport:{width:412,height:839},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Moto G4":{name:"Moto G4",userAgent:"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Desktop Chrome HiDPI":{name:"Desktop Chrome HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge HiDPI":{name:"Desktop Edge HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Firefox HiDPI":{name:"Desktop Firefox HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"},"Desktop Safari":{name:"Desktop Safari",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"webkit"},"Desktop Chrome":{name:"Desktop Chrome",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome Medium Resolution":{name:"Desktop Chrome Medium Resolution",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome (Branded)":{name:"Desktop Chrome (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Chrome Medium Resolution (Branded)":{name:"Desktop Chrome Medium Resolution (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Edge":{name:"Desktop Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge (Branded)":{name:"Desktop Edge (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Edge Medium Resolution (Branded)":{name:"Desktop Edge Medium Resolution (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Firefox":{name:"Desktop Firefox",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"}};var he={desktop:["Desktop Chrome","Desktop Chrome Medium Resolution","Desktop Chrome (Branded)","Desktop Chrome Medium Resolution (Branded)","Desktop Edge (Branded)","Desktop Edge Medium Resolution (Branded)","Desktop Safari"],mobile:["iPhone 15 Pro Max","iPhone 15 Pro","iPhone 15 Plus","iPhone 15","iPhone 14 Pro Max","iPhone 14 Pro","iPhone 14 Plus","iPhone 14","iPhone 13 Pro Max","iPhone 13 Pro","iPhone 13","iPhone 13 Mini","iPhone 12 Pro Max","iPhone 12 Pro","iPhone 12","iPhone 12 Mini","iPhone 11 Pro Max","iPhone 11 Pro","iPhone 11","iPhone XR","iPhone X","iPhone SE (3rd gen)","iPhone SE","iPhone 8 Plus","iPhone 8","iPhone 7 Plus","iPhone 7","iPhone 6 Plus","iPhone 6","Galaxy S24","Galaxy A55","Galaxy S9+","Galaxy S8","Galaxy S5","Galaxy Note 3","Galaxy Note II","Galaxy S III","Pixel 7","Pixel 5","Pixel 4a (5G)","Pixel 4","Pixel 3","Pixel 2 XL","Pixel 2","Nexus 6P","Nexus 6","Nexus 5X","Nexus 5","Nexus 4","Moto G4","LG Optimus L70","Microsoft Lumia 950","Microsoft Lumia 550","Nokia Lumia 520","Nokia N9","BlackBerry Z30"]},G=(e,t=!1)=>{let r=["chromium"];return t&&r.push("webkit"),he[e].map(i=>fe[i]).filter(i=>i.defaultBrowserType&&r.includes(i.defaultBrowserType))};var Xe={desktop:{label:"Desktop",type:"desktop",devices:G("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:G("mobile")}},qe={desktop:{label:"Desktop",type:"desktop",devices:G("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:G("mobile",!0)}};var Ze=Object.freeze(["anthropic:claude-sonnet-5","google:gemini-3.1-pro-preview"]);import{stringify as kn}from"yaml";import q from"node:path";import{createHash as it}from"crypto";import{parse as nt,stringify as we}from"yaml";import{readFileSync as ot,existsSync as at}from"fs";import{resolve as Z,dirname as st}from"path";import{parse as ge,stringify as ct}from"yaml";var be=5e3;function tt(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function rt(e){let t=e.xpath;return typeof t=="string"&&t.trim()?!t.startsWith("xpath=")&&!t.startsWith("/")&&!t.startsWith("//")?`xpath=//${t}`:t.startsWith("xpath=")?t:`xpath=${t}`:null}function _e(e){let t=tt(e),r=e.locator;if(typeof r=="string"&&r.trim())return r=r.trim(),r.endsWith("first()")?`${t}.${r}`:`${t}.${r}.first()`;let i=rt(e);if(i){let n=JSON.stringify(i);return`${t}.locator(${n}).first()`}return null}var $=new Map;function h(e,t){$.set(e,t)}function C(e,t,r=[]){let i=[...r];return t.locator?i.push(`locator: ${JSON.stringify(t.locator)}`):t.xpath&&i.push(`xpath: ${JSON.stringify(t.xpath)}`),t.frame_path&&t.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(t.frame_path)}`),i.length===0?[`await agent.execAction("${e}", page, {});`]:[`await agent.execAction("${e}", page, {`,...i.map(n=>` ${n},`),"});"]}h("click",e=>{let t=_e(e);if(!t)return['await agent.execAction("click", page, {});'];let r=e.action_data?.kwargs?.timeout_ms??be;return[`await ${t}.click({ timeout: ${r} });`]});h("click_element",$.get("click"));h("click_element_by_index",$.get("click"));h("double_click",e=>C("double_click",e));h("double_click_on_element",$.get("double_click"));h("right_click",e=>C("right_click",e));h("right_click_on_element",$.get("right_click"));h("hover",e=>C("hover",e));h("hover_element_by_index",$.get("hover"));h("input_text",e=>{let t=e.action_data?.kwargs?.text??e.action_data?.kwargs?.value??"";return C("input_text",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});h("fill",$.get("input_text"));h("clear_input",e=>C("clear_input",e));h("press",e=>{let t=e.action_data?.kwargs?.keys;return[`await page.keyboard.press(${JSON.stringify(t)});`]});h("send_keys",$.get("press"));h("send_keys_on_element",e=>{let t=_e(e),r=e.action_data?.kwargs?.keys||"";if(!t)return['await agent.execAction("send_keys_on_element", page, {',` action_data: { kwargs: { keys: ${JSON.stringify(r)} } },`,"});"];let i=e.action_data?.kwargs?.timeout_ms??be;return[`await ${t}.press(${JSON.stringify(r)}, { timeout: ${i} });`]});h("select_dropdown_option",e=>{let t=e.action_data?.kwargs?.text||e.action_data?.kwargs?.option||"";return C("select_dropdown_option",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});h("scroll",e=>{let t=e.action_data?.kwargs?.down??!0;return[`await page.evaluate('window.scrollBy(0, window.innerHeight * ${(e.action_data?.kwargs?.num_pages??1)*(t?1:-1)})');`]});h("scroll_down",$.get("scroll"));h("scroll_up",$.get("scroll"));h("scroll_element",$.get("scroll"));h("scroll_to_text",e=>{let t=e.action_data?.kwargs?.text||"";return[`await page.getByText(${JSON.stringify(t)}, { exact: false }).first().scrollIntoViewIfNeeded();`]});h("scroll_on_element",e=>C("scroll_on_element",e,[`action_data: { kwargs: ${JSON.stringify(e.action_data?.kwargs||{})} }`]));h("go_to_url",e=>{let t=e.action_data?.kwargs?.url||"";return e.action_data?.kwargs?.new_tab===!0?['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)}, new_tab: true } },`,"});"]:['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)} } },`,"});"]});h("open_tab",$.get("go_to_url"));h("go_back",()=>['await agent.execAction("go_back", page, {});']);h("reload_page",()=>['await agent.execAction("reload_page", page, {});']);h("wait",e=>[`await page.waitForTimeout(${(e.action_data?.kwargs?.seconds||1)*1e3});`]);h("wait_for_page_ready",()=>["await page.waitForLoadState('domcontentloaded');"]);h("verify",(e,t)=>{let r=e.action_data?.kwargs,i=typeof r?.code=="string",n=i?r?.statement||e.action_description:e.action_description||r?.statement;if(i&&n){let o=r.code.split(`
|
|
2
|
+
`),l=JSON.stringify(n);return["{ const _t = Date.now(); try {",...o.map(p=>` ${p}`),` console.log(\`[VERIFY:JS] \u2713 \${((Date.now()-_t)/1000).toFixed(1)}s: ${l}\`);`,"} catch (_e) {",` console.log(\`[VERIFY:JS\u2192AI] JS failed \${((Date.now()-_t)/1000).toFixed(1)}s: (\${_e instanceof Error ? _e.message : String(_e)}), falling back to AI: ${l}\`);`,` await agent.assert(page, ${l}, ${JSON.stringify(t||"")});`,"} }"]}return i?r.code.split(`
|
|
3
|
+
`):n?[`await agent.assert(page, ${JSON.stringify(n)}, ${JSON.stringify(t||"")});`]:["// Skipping verify: missing statement or code"]});h("ai_assert",$.get("verify"));h("assert",$.get("verify"));h("ai_action",(e,t)=>{let r=e.action_data?.kwargs?.statement;if(!r)return["// Skipping ai_action: missing statement"];let i=JSON.stringify(r),n=e.action_data?.kwargs?.use_pure_vision;return[`await agent.execute(page, ${i}, '${t||""}', ${n});`]});h("ai_step",(e,t)=>{let r=e.action_data?.kwargs?.statement;return r?[`await agent.run(page, ${JSON.stringify(r)}, '${t||""}');`]:["// Skipping ai_step: missing statement"]});h("ai_extract",(e,t)=>{let r=e.action_data?.kwargs?.element_description,i=e.action_data?.kwargs?.variable_name;if(!r||!i)return["// Skipping ai_extract: missing element_description or variable_name"];let n=JSON.stringify(r),a=JSON.stringify(i);return[`await agent.extract(page, ${n}, ${a}, '${t||""}');`]});h("ai_wait_until",(e,t)=>{let r=e.action_data?.kwargs?.condition,i=e.action_data?.kwargs?.timeout_seconds||60;return r?e.action_data?.kwargs?.condition_type==="JS_CODE"?[`await agent.waitForJs(page, async () => (${r}), ${i}, '${t||""}');`]:[`await agent.waitUntilCondition(page, ${JSON.stringify(r)}, ${i}, '${t||""}');`]:["// Skipping ai_wait_until: missing condition"]});h("save_variable",e=>{let t=e.action_data?.kwargs?.name||"",r=e.action_data?.kwargs?.value;return['await agent.execAction("save_variable", page, {',` action_data: { kwargs: { name: ${JSON.stringify(t)}, value: ${JSON.stringify(r)} } },`,"});"]});h("js_code",e=>{let t=e.action_data?.kwargs?.code;if(!t)return["// Skipping js_code: missing code"];let r=["{"],i=t.split(`
|
|
4
|
+
`);for(let n of i)r.push(` ${n}`);return r.push("}"),r});h("function",(e,t,r)=>{let i=e.action_data?.kwargs||{},n=i.functionName;if(n&&n.includes("#")){let[o,l]=n.split("#");if(o&&l){let p=o.replace(/\.(ts|js|mjs)$/,"");if(q.isAbsolute(o))return[`throw new Error(${JSON.stringify(`Absolute paths are not supported in call: references. Use a path relative to the project root (got: "${o}")`)})`];if(!p.startsWith(".")&&r?.projectRoot&&r?.yamlDir){let c=q.resolve(r.projectRoot,p),d=q.relative(r.yamlDir,c).replace(/\\/g,"/");p=d.startsWith("..")?d:"./"+d}let u=`import { ${l} } from '${p}';`;r?.imports?.add(u);let y={...i,functionName:l},b=me(y);return b?[b.endsWith(";")?b:`${b};`]:["// Skipping function: invalid export pattern"]}}let a=me(i);return a?[a.endsWith(";")?a:`${a};`]:["// Skipping function: missing functionName"]});h("generate_2fa_code",e=>{let t=e.action_data?.kwargs?.otp_secret_key||"";return['await agent.execAction("generate_2fa_code", page, {',` action_data: { kwargs: { otp_secret_key: ${JSON.stringify(t)} } },`,"});"]});h("upload_file",e=>{let t=e.action_data?.kwargs||{},r=[],i={};return t.paths?i.paths=t.paths:t.path&&(i.path=t.path),t.use_file_input&&(i.use_file_input=!0),r.push(`action_data: { kwargs: ${JSON.stringify(i)} }`),e.locator?r.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&r.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&r.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("upload_file", page, {',...r.map(n=>` ${n},`),"});"]});h("wait_for_download_complete",e=>['await agent.execAction("wait_for_download_complete", page, {',` action_data: { kwargs: { timeout_seconds: ${e.action_data?.kwargs?.timeout_seconds||10} } },`,"});"]);h("switch_tab",e=>['await agent.execAction("switch_tab", page, {',` action_data: { kwargs: { page_id: ${e.action_data?.kwargs?.page_id??e.action_data?.kwargs?.tab_index??0} } },`,"});"]);h("close_tab",e=>{let t=e.action_data?.kwargs?.page_id;return t=t??e.action_data?.kwargs?.index,['await agent.execAction("close_tab", page, {',` action_data: { kwargs: { page_id: ${t} } },`,"});"]});h("set_date_for_native_date_picker",e=>{let t=e.action_data?.kwargs?.date??"",r=[];return r.push(`action_data: { kwargs: { date: ${JSON.stringify(t)} } }`),e.locator?r.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&r.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&r.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("set_date_for_native_date_picker", page, {',...r.map(i=>` ${i},`),"});"]});h("done",()=>["// Done - no action needed"]);function Q(e,t){let r=t.action_data?.kwargs||{},i=[];return typeof r.relative_x=="number"&&typeof r.relative_y=="number"?(i.push(`action_data: { kwargs: { relative_x: ${r.relative_x}, relative_y: ${r.relative_y} } }`),t.locator?i.push(`locator: ${JSON.stringify(t.locator)}`):t.xpath&&i.push(`xpath: ${JSON.stringify(t.xpath)}`),t.frame_path&&t.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(t.frame_path)}`)):typeof r.x=="number"&&typeof r.y=="number"&&i.push(`action_data: { kwargs: { x: ${r.x}, y: ${r.y} } }`),[`await agent.execAction("${e}", page, {`,...i.map(n=>` ${n},`),"});"]}h("click_by_coordinates",e=>Q("click_by_coordinates",e));h("right_click_by_coordinates",e=>Q("right_click_by_coordinates",e));h("double_click_by_coordinates",e=>Q("double_click_by_coordinates",e));h("drag_drop",e=>{let t=e.action_data?.kwargs||{},r={};typeof t.relative_x=="number"&&(r.relative_x=t.relative_x),typeof t.relative_y=="number"&&(r.relative_y=t.relative_y),typeof t.delta_x=="number"&&(r.delta_x=t.delta_x),typeof t.delta_y=="number"&&(r.delta_y=t.delta_y),typeof t.coord_source_x=="number"&&(r.coord_source_x=t.coord_source_x),typeof t.coord_source_y=="number"&&(r.coord_source_y=t.coord_source_y),typeof t.coord_target_x=="number"&&(r.coord_target_x=t.coord_target_x),typeof t.coord_target_y=="number"&&(r.coord_target_y=t.coord_target_y);let i=[`action_data: { kwargs: ${JSON.stringify(r)} }`];return e.locator?i.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&i.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("drag_drop", page, {',...i.map(n=>` ${n},`),"});"]});h("get_dropdown_options",e=>{let t=[];return e.xpath&&t.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&t.push(`frame_path: ${JSON.stringify(e.frame_path)}`),t.length===0?['await agent.execAction("get_dropdown_options", page, {});']:['await agent.execAction("get_dropdown_options", page, {',...t.map(r=>` ${r},`),"});"]});h("extract_email_content",e=>{let t=e.action_data?.kwargs||{};return['await agent.execAction("extract_email_content", page, {',` action_data: { kwargs: ${JSON.stringify(t)} },`,"});"]});h("js_action",e=>{let t=e.action_data?.kwargs?.code;return t?t.split(`
|
|
5
|
+
`):["// Skipping js_action: missing code"]});function me(e){let t=e.functionName;if(!t)return null;let r=Array.isArray(e.args)?e.args.map(String):Array.isArray(e.parameterValues)?e.parameterValues.map(String):[];if(r.length===0)return`await ${t}()`;let i=["page","testContext","request","agent"],n=["undefined","null","true","false"],a=r.map(o=>i.includes(o)||n.includes(o)||/^-?\d+(\.\d+)?$/.test(o)?o:o.startsWith("$")?`agent.agentServices.readVariable('${o.substring(1)}')`:`"${o}"`);return`await ${t}(${a.join(", ")})`}var ye=5;function ve(e,t,r){let i={expandingPaths:new Set([Z(t)]),depth:0,referencedPaths:new Set,basePath:r},n={...e};Array.isArray(n.statements)&&(n.statements=L(n.statements,t,i)),Array.isArray(n.teardown)&&(n.teardown=L(n.teardown,t,i));for(let a of["beforeAll","afterAll","beforeEach","afterEach"])Array.isArray(n[a])&&(n[a]=L(n[a],t,i));return{doc:n,referencedTemplatePaths:Array.from(i.referencedPaths)}}function L(e,t,r){let i=[];for(let n of e)if(lt(n)){let a=pt(n,t,r);i.push(a)}else i.push(ut(n,t,r));return i}function lt(e){return typeof e=="object"&&e!==null&&typeof e.template=="string"}function pt(e,t,r){if(r.depth>=ye)throw new Error(`Template expansion exceeded maximum depth of ${ye}. Check for deeply nested or circular template references.`);let i=Z(st(t),e.template),n=!at(i)&&r.basePath?Z(r.basePath,e.template):i;if(r.expandingPaths.has(n))throw new Error(`Circular template reference detected: ${n} is already being expanded. Stack: ${Array.from(r.expandingPaths).join(" \u2192 ")} \u2192 ${n}`);r.referencedPaths.add(n);let a;try{a=ot(n,"utf-8")}catch(m){throw new Error(`Failed to read template file: ${n} (referenced from ${t}): ${m.message}`)}let o=ge(a);if(!o||typeof o!="object")throw new Error(`Invalid template file: ${n} \u2014 expected a YAML object`);let l=o.params||[],p=e.params||{};for(let m of l)if(!(m in p))throw new Error(`Template ${e.template} requires param "${m}" but it was not provided. Required params: [${l.join(", ")}]`);let u=o.statements;if(!Array.isArray(u))throw new Error(`Template ${e.template} must have a "statements" array`);if(Object.keys(p).length>0){let f=ct(u);for(let[S,g]of Object.entries(p))f=f.split(`<<${S}>>`).join(String(g));u=ge(f)}let y={expandingPaths:new Set([...r.expandingPaths,n]),depth:r.depth+1,referencedPaths:r.referencedPaths},b=L(u,n,y),d={STEP:o.name||e.template.replace(/\.yaml$/,"").split("/").pop()||e.template,template_path:e.template,statements:b};return Object.keys(p).length>0&&(d.template_params=p),d}function ut(e,t,r){if(typeof e!="object"||e===null)return e;let i={...e};return Array.isArray(i.statements)&&(i.statements=L(i.statements,t,r)),Array.isArray(i.THEN)&&(i.THEN=L(i.THEN,t,r)),Array.isArray(i.ELSE)&&(i.ELSE=L(i.ELSE,t,r)),Array.isArray(i.DO)&&(i.DO=L(i.DO,t,r)),i}var Se=class extends Error{constructor(e){super(e),this.name="YamlValidationError"}};function xe(e,t,r){let i=nt(e),n=i?.name,a=i?.tags,o=i?.use;if(i&&(i.name!==void 0||i.tags!==void 0||i.use!==void 0)&&(delete i.name,delete i.tags,delete i.use),i?.suite){if(i.goal||i.statements)throw new Se('YAML file cannot have both "suite" and top-level "goal"/"statements". Use either suite format or single-test format.');return ft(i,n,a,o,t,r)}return dt(i,n,a,o,t,r)}function dt(e,t,r,i,n,a){let o=e?.beforeEach,l=e?.afterEach,p=ke(e?.parameters),u=e?.timeout,y=e?.skip,b=e?.fail,c=e?.only,d=e?.slow;if(e&&(delete e.beforeEach,delete e.afterEach,delete e.parameters,delete e.timeout,delete e.skip,delete e.fail,delete e.only,delete e.slow),e?.url)throw new Se(`The "url" field is not supported in local YAML tests. Use "base_url: ${e.url}" and add "- URL: /" as the first statement instead.`);e&&!e.goal&&t&&(e.goal=t);let m=[];if(n&&e&&typeof e=="object"){let g=ve(e,n,a);e=g.doc,m=g.referencedTemplatePaths}let f=we(e),S=N(f);return n&&(B(S.statements??[],n,"main"),S.teardown&&B(S.teardown,n,"teardown")),{testFlow:S,name:t,tags:r,use:i,beforeEach:o,afterEach:l,parameters:p,timeout:u,skip:y,fail:b,only:c,slow:d,referencedTemplatePaths:m}}function ft(e,t,r,i,n,a){let o=e.suite;if(!Array.isArray(o.tests)||o.tests.length===0)throw new Error('Suite must have a non-empty "tests" array.');let l=o.beforeAll,p=o.afterAll,u=o.beforeEach,y=o.afterEach,b=[],c=o.tests.map(f=>{if(!f.name)throw new Error('Each test in a suite must have a "name" field.');if(!Array.isArray(f.statements)||f.statements.length===0)throw new Error(`Suite test "${f.name}" must have a non-empty "statements" array.`);let S={goal:f.name,statements:f.statements};f.teardown&&(S.teardown=f.teardown);let g=[],w=S;if(n&&typeof S=="object"){let O=ve(S,n,a);w=O.doc,g=O.referencedTemplatePaths,b.push(...g)}let _=we(w),A=N(_),T=ke(f.parameters);return{testFlow:A,name:f.name,tags:Array.isArray(f.tags)?f.tags:void 0,parameters:T,timeout:f.timeout,skip:f.skip,fail:f.fail,only:f.only,slow:f.slow}}),d=o.base_url,m=d?{...i,baseURL:d}:i;return{suite:{beforeAll:l,afterAll:p,beforeEach:u,afterEach:y,tests:c},name:t,tags:r,use:m,referencedTemplatePaths:b}}function ke(e){if(!(!Array.isArray(e)||e.length===0))return e.map((t,r)=>{if(!t.name)throw new Error(`Parameter set at index ${r} must have a "name" field.`);if(!t.values||typeof t.values!="object")throw new Error(`Parameter set "${t.name}" must have a "values" object.`);return{name:t.name,values:t.values}})}function B(e,t,r){for(let i=0;i<e.length;i++){let n=e[i],a=`${r}.${i}`,o=n.description||"";if(n.uid=ht(t,a,o),n.type===D.STEP)B(n.statements,t,a);else if(n.type===D.IF_ELSE){let l=n;B(l.then,t,`${a}.then`),l.else&&B(l.else,t,`${a}.else`)}else n.type===D.WHILE_LOOP&&B(n.body,t,`${a}.body`)}}function ht(e,t,r){let i=it("sha256").update(`${e}:${t}:${r}`).digest("hex");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20,32)}`}import Ae from"node:path";function k(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function V(e){if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;let t=Math.floor(e/6e4),r=(e%6e4/1e3).toFixed(0);return`${t}m ${r}s`}function mt(e){return`passed after ${e||"?"} ${e===1?"retry":"retries"}`}function gt(e,t){let r=e||"?",i=e===1?"retry":"retries";return t==="passed"?`passed after ${r} ${i}`:`failed after ${r} ${i}`}function j(e){switch(e){case"passed":case"success":return'<span class="status-icon passed">✔</span>';case"flaky":return'<span class="status-icon flaky">↻</span>';case"failed":case"failure":case"timedOut":return'<span class="status-icon failed">✘</span>';case"skipped":return'<span class="status-icon skipped">─</span>';case"interrupted":return'<span class="status-icon failed">⚠</span>';default:return'<span class="status-icon pending">○</span>'}}function yt(e){return`<span class="badge badge-${e}">${e}</span>`}function bt(e){if(!e.code)return"";let t=e.code.split(`
|
|
6
|
+
`);return e.codeStartLine!=null&&e.codeLine!=null?`<div class="step-code"><pre class="code-block">${t.map((n,a)=>{let o=e.codeStartLine+a,l=o===e.codeLine,p=String(o).padStart(4);return`<span class="code-line${l?" code-line-active":""}">${p} \u2502 ${k(n)}</span>`}).join("")}</pre></div>`:`<div class="step-code"><pre class="code-block">${t.map(i=>`<span class="code-line code-line-body">${k(i)}</span>`).join("")}</pre></div>`}function _t(e){let t=e.duration!=null?`<span class="step-duration">${V(e.duration)}</span>`:"",r=j(e.status);if(e.screenshot||e.message||e.error||e.code){let n="";e.screenshot&&(n=`<img src="${k(e.screenshot)}" alt="Step screenshot" class="step-screenshot" />`);let a=e.screenshot?"":bt(e),o="";e.error&&(o=`<div class="step-error"><pre>${k(e.error)}</pre></div>`);let l="";e.message&&!e.error&&(l=`<div class="step-message">${k(e.message)}</div>`);let p=e.status==="failure"?" open":"";return`
|
|
7
|
+
<details class="step-details step step-${e.status}"${p}>
|
|
8
8
|
<summary class="step-header">
|
|
9
9
|
${r}
|
|
10
10
|
<span class="step-id">${k(e.stepId)}</span>
|
|
@@ -12,11 +12,11 @@ import*as x from"fs";import*as v from"path";var I=(e,t,r)=>{e.forEach((i,o)=>{le
|
|
|
12
12
|
${t}
|
|
13
13
|
</summary>
|
|
14
14
|
<div class="step-expanded">
|
|
15
|
-
${
|
|
15
|
+
${n}
|
|
16
16
|
${a}
|
|
17
17
|
<div class="step-description-full">${k(e.description)}</div>
|
|
18
|
-
${
|
|
19
|
-
${
|
|
18
|
+
${l}
|
|
19
|
+
${o}
|
|
20
20
|
</div>
|
|
21
21
|
</details>`}return`
|
|
22
22
|
<div class="step step-${e.status}">
|
|
@@ -26,7 +26,7 @@ import*as x from"fs";import*as v from"path";var I=(e,t,r)=>{e.forEach((i,o)=>{le
|
|
|
26
26
|
<span class="step-description">${k(e.description)}</span>
|
|
27
27
|
${t}
|
|
28
28
|
</div>
|
|
29
|
-
</div>`}function
|
|
29
|
+
</div>`}function wt(e,t,r,i){let n=[];e&&n.push(`
|
|
30
30
|
<details class="artifact-section">
|
|
31
31
|
<summary class="artifact-summary">Video</summary>
|
|
32
32
|
<div class="artifact-content">
|
|
@@ -37,59 +37,59 @@ import*as x from"fs";import*as v from"path";var I=(e,t,r)=>{e.forEach((i,o)=>{le
|
|
|
37
37
|
<button class="enlarge-btn" onclick="openVideoOverlay(this)" title="Enlarge">⛶</button>
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
40
|
-
</details>`);let a=r.filter(
|
|
41
|
-
<div class="screenshot-thumb" onclick="openGalleryAt(this, ${
|
|
42
|
-
<img src="${k(
|
|
43
|
-
<span class="thumb-label">${k(
|
|
44
|
-
</div>`).join("");
|
|
40
|
+
</details>`);let a=r.filter(o=>o.screenshot).map(o=>({src:o.screenshot,stepId:o.stepId,description:o.description,status:o.status,message:o.message||o.error||""}));if(a.length>0){let o=k(JSON.stringify(a)),l=a.map((p,u)=>`
|
|
41
|
+
<div class="screenshot-thumb" onclick="openGalleryAt(this, ${u})" data-gallery="${o}">
|
|
42
|
+
<img src="${k(p.src)}" alt="${k(p.stepId)}" />
|
|
43
|
+
<span class="thumb-label">${k(p.stepId)}</span>
|
|
44
|
+
</div>`).join("");n.push(`
|
|
45
45
|
<details class="artifact-section">
|
|
46
46
|
<summary class="artifact-summary">Screenshots (${a.length})</summary>
|
|
47
47
|
<div class="artifact-content">
|
|
48
|
-
<div class="screenshot-grid">${
|
|
48
|
+
<div class="screenshot-grid">${l}</div>
|
|
49
49
|
</div>
|
|
50
|
-
</details>`)}if(t){let
|
|
50
|
+
</details>`)}if(t){let o=k(t);n.push(`
|
|
51
51
|
<details class="artifact-section">
|
|
52
52
|
<summary class="artifact-summary">Trace</summary>
|
|
53
53
|
<div class="artifact-content">
|
|
54
54
|
<div class="trace-actions">
|
|
55
|
-
<code class="trace-command" id="trace-cmd-${i}">npx playwright show-trace ${
|
|
55
|
+
<code class="trace-command" id="trace-cmd-${i}">npx playwright show-trace ${o}</code>
|
|
56
56
|
<button class="copy-btn" onclick="copyTraceCmd('${i}')" title="Copy command">Copy</button>
|
|
57
57
|
</div>
|
|
58
58
|
<p class="trace-hint">Run this command in your terminal to open the interactive Trace Viewer</p>
|
|
59
59
|
<p class="trace-hint"><a href="${k(t)}" class="attachment-link" download>Download trace.zip</a></p>
|
|
60
60
|
</div>
|
|
61
|
-
</details>`)}return
|
|
62
|
-
`),
|
|
63
|
-
${
|
|
61
|
+
</details>`)}return n.length===0?"":`<div class="test-artifacts">${n.join("")}</div>`}function Te(e,t,r,i,n){let a=e.map(_t).join(`
|
|
62
|
+
`),o="";t&&!e.some(p=>p.error)&&(o=`<div class="test-error"><pre>${k(t)}</pre></div>`);let l=wt(r,i,e,n);return`
|
|
63
|
+
${o}
|
|
64
64
|
<div class="steps-list">
|
|
65
65
|
${a||'<div class="no-steps">No YAML step details available</div>'}
|
|
66
66
|
</div>
|
|
67
|
-
${
|
|
68
|
-
onclick="switchAttemptTab('${a}', ${
|
|
69
|
-
data-tab-index="${
|
|
67
|
+
${l}`}function vt(e,t){let r=e.flaky?"flaky":e.status,i=j(r),n;if(e.attempts&&e.attempts.length>1){let a=`tabs-${t}`,l=e.attempts.length-1,p=e.attempts.map((c,d)=>{let m=d===l,f=c.status==="passed"?"passed":"failed",S=`Attempt ${c.attemptNumber}`;return`<button class="attempt-tab ${m?"active":""} attempt-tab-${f}"
|
|
68
|
+
onclick="switchAttemptTab('${a}', ${d})"
|
|
69
|
+
data-tab-index="${d}">${j(f)} ${S} <span class="attempt-tab-badge badge-${f}">${c.status}</span></button>`}).join(""),u=e.attempts.map((c,d)=>{let m=d===l,f=Te(c.steps,c.error,c.videoPath,c.tracePath,`${t}-attempt-${d}`);return`<div class="attempt-panel ${m?"active":""}" data-panel-index="${d}">
|
|
70
70
|
<div class="attempt-meta">
|
|
71
71
|
${j(c.status==="passed"?"passed":"failed")}
|
|
72
72
|
<span class="attempt-meta-text">Attempt ${c.attemptNumber} — ${c.status} in ${V(c.duration)}</span>
|
|
73
73
|
</div>
|
|
74
|
-
${
|
|
75
|
-
</div>`}).join(""),
|
|
76
|
-
<div class="${e.flaky?"flaky-note":"retried-note"}">${
|
|
74
|
+
${f}
|
|
75
|
+
</div>`}).join(""),y=e.flaky?`Flaky — ${mt(e.retries)}`:`Retried — ${gt(e.retries,e.status)}`;n=`
|
|
76
|
+
<div class="${e.flaky?"flaky-note":"retried-note"}">${y}</div>
|
|
77
77
|
<div class="attempt-tabs" id="${a}">
|
|
78
|
-
<div class="attempt-tab-bar">${
|
|
79
|
-
${
|
|
80
|
-
</div>`}else
|
|
78
|
+
<div class="attempt-tab-bar">${p}</div>
|
|
79
|
+
${u}
|
|
80
|
+
</div>`}else n=Te(e.steps,e.error,e.videoPath,e.tracePath,String(t));return`
|
|
81
81
|
<details class="test-details" ${e.status==="failed"||e.status==="timedOut"?"open":""}>
|
|
82
82
|
<summary class="test-summary test-${r}">
|
|
83
83
|
${i}
|
|
84
84
|
<span class="test-title">${k(e.title)}</span>
|
|
85
85
|
<span class="test-file">${k(e.file)}</span>
|
|
86
|
-
${
|
|
86
|
+
${yt(r)}
|
|
87
87
|
<span class="test-duration">${V(e.duration)}</span>
|
|
88
88
|
</summary>
|
|
89
89
|
<div class="test-body">
|
|
90
|
-
${
|
|
90
|
+
${n}
|
|
91
91
|
</div>
|
|
92
|
-
</details>`}function
|
|
92
|
+
</details>`}function $e(e,t){return!e||!t||Ae.isAbsolute(e)?e:Ae.join(t,e)}function St(e,t){return t?{...e,tracePath:$e(e.tracePath,t),attempts:e.attempts?.map(r=>({...r,tracePath:$e(r.tracePath,t)}))}:e}function Ee(e){let t=e.tests.filter(u=>u.flaky).length,r=e.tests.filter(u=>!u.flaky&&u.retries!=null&&u.retries>0).length,i=e.tests.filter(u=>u.status==="passed"&&!u.flaky).length,n=e.tests.filter(u=>u.status==="failed"||u.status==="timedOut").length,a=e.tests.filter(u=>u.status==="skipped").length,o=e.tests.length,p=e.tests.map(u=>St(u,e.outputDir)).map((u,y)=>vt(u,y)).join(`
|
|
93
93
|
`);return`<!DOCTYPE html>
|
|
94
94
|
<html lang="en">
|
|
95
95
|
<head>
|
|
@@ -733,11 +733,11 @@ import*as x from"fs";import*as v from"path";var I=(e,t,r)=>{e.forEach((i,o)=>{le
|
|
|
733
733
|
<div class="header">
|
|
734
734
|
<h1>Shiplight Test Report</h1>
|
|
735
735
|
<div class="summary">
|
|
736
|
-
<span class="summary-stat">${
|
|
736
|
+
<span class="summary-stat">${o} test${o!==1?"s":""}</span>
|
|
737
737
|
${i>0?`<span class="summary-stat passed">${i} passed</span>`:""}
|
|
738
738
|
${t>0?`<span class="summary-stat flaky">${t} flaky</span>`:""}
|
|
739
739
|
${r>0?`<span class="summary-stat retried">${r} retried</span>`:""}
|
|
740
|
-
${
|
|
740
|
+
${n>0?`<span class="summary-stat failed">${n} failed</span>`:""}
|
|
741
741
|
${a>0?`<span class="summary-stat skipped">${a} skipped</span>`:""}
|
|
742
742
|
<span class="summary-stat">${V(e.totalDuration)}</span>
|
|
743
743
|
${e.timestamp?`<span class="summary-stat" style="margin-left:auto;color:var(--color-text-secondary)">${new Date(e.timestamp).toLocaleString()}</span>`:""}
|
|
@@ -753,7 +753,7 @@ import*as x from"fs";import*as v from"path";var I=(e,t,r)=>{e.forEach((i,o)=>{le
|
|
|
753
753
|
</div>
|
|
754
754
|
</div>`:""}
|
|
755
755
|
<div class="test-list">
|
|
756
|
-
${
|
|
756
|
+
${p}
|
|
757
757
|
</div>
|
|
758
758
|
<div class="footer">
|
|
759
759
|
Generated by Shiplight Reporter${e.shiplightVersion?` \xB7 shiplightai v${k(e.shiplightVersion)}`:""}
|
|
@@ -883,9 +883,9 @@ import*as x from"fs";import*as v from"path";var I=(e,t,r)=>{e.forEach((i,o)=>{le
|
|
|
883
883
|
});
|
|
884
884
|
</script>
|
|
885
885
|
</body>
|
|
886
|
-
</html>`}
|
|
887
|
-
Shiplight report written to: ${
|
|
886
|
+
</html>`}import*as Oe from"fs";import*as ee from"path";import{globSync as Tt}from"glob";function xt(e){let t=e.toLowerCase();return t.includes("claude")||t.includes("anthropic")?"anthropic":t.includes("gemini")||t.includes("google")?"gemini":t.startsWith("gpt")||t.startsWith("o1")||t.startsWith("o3")||t.startsWith("o4")||t.includes("openai")?"openai":"unknown"}function kt(e){switch(e.actionType){case"execute":case"run":return"action";case"generate":return"draft";case"assert":return"verify_ai";case"evaluate":return e.conditionKind==="while"?"evaluate_while":e.conditionKind==="wait_until"?"evaluate_wait_until":"evaluate_if";default:return null}}function Me(e,t){let r=e[t];return typeof r=="number"?r:0}function At(e,t,r,i){return`${e}\0${t}\0${r}\0${i}`}function Pe(e,t={}){let r=t.routing??"proxy",i=t.providerOf??xt,n=new Map;for(let o of e??[]){let l=kt(o);if(l)for(let p of o.tokenUsages??[]){let u=p.model??"unknown",y=i(u),b=At(l,y,u,r),c=n.get(b);c||(c={operation:l,provider:y,model:u,routing:r,calls:0,input_tokens:0,output_tokens:0,thinking_tokens:0,cache_read_tokens:0},n.set(b,c)),c.calls+=1,c.input_tokens+=p.prompt_tokens||0,c.output_tokens+=p.completion_tokens||0,c.thinking_tokens+=Me(p,"thinking_tokens"),c.cache_read_tokens+=Me(p,"cache_read_tokens")}}return{by_operation:Array.from(n.values()).sort((o,l)=>o.operation!==l.operation?o.operation.localeCompare(l.operation):o.provider!==l.provider?o.provider.localeCompare(l.provider):o.model.localeCompare(l.model))}}function $t(){let e=process.env.SHIPLIGHT_USAGE_ROUTING;return e==="proxy"||e==="byok"||e==="custom_endpoint"?e:"proxy"}function Le(e){let t=ee.join(e,"test-results"),r;try{r=Tt("**/ai-actions.json",{cwd:t})}catch{return}if(r.length===0)return;let i=[];for(let a of r)try{let o=JSON.parse(Oe.readFileSync(ee.join(t,a),"utf-8"));Array.isArray(o)&&i.push(...o)}catch{}if(i.length===0)return;let n=Pe(i,{routing:$t()});return n.by_operation.length>0?n:void 0}var Ie="0.1.91",Ne=Ie!=="dev"?Ie:void 0;var Un=3600*1e3,Hn=10080*60*1e3;var Et={before:0,main:1,teardown:2,after:3};function De(e){let t=e.split(".")[0];return Et[t]??1}function Ce(e){return e.split(".").map(t=>{let r=Number(t);return Number.isNaN(r)?0:r})}function Mt(e){return[...e].sort(([t],[r])=>{let i=De(t),n=De(r);if(i!==n)return i-n;let a=Ce(t),o=Ce(r);for(let l=0;l<Math.max(a.length,o.length);l++){let p=a[l]??-1,u=o[l]??-1;if(p!==u)return p-u}return 0})}function Pt(e){let t=new Set;for(let r of e)if(t.add(r.category),r.category==="hook")for(let i of r.steps)t.add(i.category);return t}function Ot(e,t){let r=e.toLowerCase();return r.includes("before")?"before":r.includes("after")?"after":t}function te(e,t="main",r,i,n){r===void 0&&(r=!Pt(e).has("test.step")),n||(n=new Map);let a=[];for(let o of e){if(o.category==="fixture"||o.category==="test.attach")continue;if(o.category==="hook"){let p=Ot(o.title,t);a.push(...te(o.steps,p,r,i,n));continue}if(o.category==="test.step"||r&&(o.category==="expect"||o.category==="pw:api")){let p=n.get(t)??0;n.set(t,p+1);let u=`${t}.${p}`,y={stepId:u,description:o.title,status:o.error?"failure":o.duration===-1?"skipped":"success",duration:o.duration>=0?o.duration:void 0};o.error&&(y.error=o.error.message??o.error.stack),i&&o.location&&i.set(u,o.location),a.push(y),o.steps.length>0&&a.push(...te(o.steps,u,r,i,n))}}return a}function Lt(e,t){let r=v.isAbsolute(e)?e:v.join(process.cwd(),e),i=v.join(r,"latest");try{if(x.lstatSync(i).isSymbolicLink())x.unlinkSync(i);else{console.warn("[report] 'latest' exists and is not a symlink; skipping update");return}}catch{}try{process.platform==="win32"?x.symlinkSync(v.join(r,t),i,"junction"):x.symlinkSync(t,i,"dir")}catch(n){console.warn(`[report] Could not create 'latest' symlink: ${n instanceof Error?n.message:String(n)}`)}}var re=class{outputFolder;openMode;latestSymlinkDir;collected=[];config;runStartTime;constructor(t={}){this.outputFolder=t.outputFolder||"shiplight-report",this.openMode=t.open||"on-failure",this.latestSymlinkDir=t.latestSymlinkDir}onBegin(t,r){this.config=t,this.runStartTime=new Date().toISOString()}onTestEnd(t,r){this.collected.push({test:t,result:r})}async onEnd(t){if(this.collected.length===0)return;let r=new Map;for(let u of this.collected){let y=u.test.titlePath().join(" > "),b=r.get(y);b||(b=[],r.set(y,b)),b.push(u)}let i=[];for(let[,u]of r.entries()){let y=u[0].test.location.file,b=[],c,d,m;for(let w=0;w<u.length;w++){let{test:_,result:A}=u[w],T=await this.buildReportTest(_,A,y);c=T,d||(d=T.startTime),m=T.endTime,b.push({attemptNumber:w+1,status:A.status,duration:A.duration,steps:T.steps,error:T.error,videoPath:T.videoPath,tracePath:T.tracePath})}let f=b[b.length-1],{test:S}=u[u.length-1],g={title:S.title,baseTitle:c?.baseTitle,file:v.relative(process.cwd(),y),status:f.status,duration:f.duration,steps:f.steps,error:f.error,videoPath:f.videoPath,tracePath:f.tracePath,actionStepsMap:c?.actionStepsMap,tags:c?.tags,baseUrl:c?.baseUrl,skip:c?.skip,slow:c?.slow,timeout:c?.timeout,parameterSetName:c?.parameterSetName,startTime:d,endTime:m,suiteName:c?.suiteName};b.length>1&&(g.retries=b.length-1,g.attempts=b,b.some(_=>_.status==="failed"||_.status==="timedOut")&&f.status==="passed"&&(g.flaky=!0)),i.push(g)}let n={tests:i,totalDuration:t.duration,timestamp:new Date().toISOString(),shiplightVersion:Ne,usageSummary:Le(process.cwd())},a=v.isAbsolute(this.outputFolder)?this.outputFolder:v.join(process.cwd(),this.outputFolder);x.mkdirSync(a,{recursive:!0});let o=v.join(a,"screenshots");for(let u=0;u<n.tests.length;u++){let y=n.tests[u],b=y.attempts&&y.attempts.length>0,c=[{obj:y,prefix:b?`test-${u}-attempt-0`:`test-${u}`,screenshotSubDir:`test-${u}`}];if(y.attempts)for(let d=0;d<y.attempts.length;d++)c.push({obj:y.attempts[d],prefix:`test-${u}-attempt-${d+1}`,screenshotSubDir:`test-${u}/attempt-${d}`});for(let{obj:d,prefix:m,screenshotSubDir:f}of c){let S=v.join(o,f),g=!1;for(let w of d.steps)if(w.screenshot&&v.isAbsolute(w.screenshot))try{g||(x.mkdirSync(S,{recursive:!0}),g=!0);let _=`${w.stepId.replace(/\./g,"-")}.png`;x.copyFileSync(w.screenshot,v.join(S,_)),w.screenshot=`screenshots/${f}/${_}`}catch(_){console.warn(`[reporter] Failed to copy screenshot for ${w.stepId}:`,_)}if(d.videoPath&&v.isAbsolute(d.videoPath)){let w=v.extname(d.videoPath)||".webm",_=`${m}-video${w}`;try{x.copyFileSync(d.videoPath,v.join(a,_)),d.videoPath=_}catch{d.videoPath=void 0}}if(d.tracePath&&v.isAbsolute(d.tracePath)){let w=v.extname(d.tracePath)||".zip",_=`${m}-trace${w}`;try{x.copyFileSync(d.tracePath,v.join(a,_)),d.tracePath=_}catch{d.tracePath=void 0}}}}let l=v.join(a,"report-data.json");x.writeFileSync(l,JSON.stringify(n,null,2),"utf-8");let p=v.join(a,"index.html");if(x.writeFileSync(p,Ee({...n,outputDir:a}),"utf-8"),console.log(`
|
|
887
|
+
Shiplight report written to: ${p}`),this.latestSymlinkDir&&Lt(this.latestSymlinkDir,v.basename(a)),this.openMode==="always"||this.openMode==="on-failure"&&t.status!=="passed")try{let u=(await import("open")).default;await u(p)}catch{}}printsToStdio(){return!1}async buildReportTest(t,r,i){let n={title:t.title,file:v.relative(process.cwd(),i),status:r.status,duration:r.duration,steps:[],startTime:new Date(r.startTime).toISOString(),endTime:new Date(r.startTime.getTime()+r.duration).toISOString()};r.errors.length>0&&(n.error=r.errors.map(c=>c.message||c.stack||String(c)).join(`
|
|
888
888
|
|
|
889
|
-
`)),r.stdout.length>0&&(
|
|
890
|
-
`))}catch{
|
|
891
|
-
`),m.codeStartLine=O,m.codeLine=
|
|
889
|
+
`)),r.stdout.length>0&&(n.stdout=r.stdout.map(c=>typeof c=="string"?c:c.toString()).join("")),r.stderr.length>0&&(n.stderr=r.stderr.map(c=>typeof c=="string"?c:c.toString()).join(""));for(let c of r.attachments)c.name==="video"&&c.path&&(n.videoPath=c.path),c.name==="trace"&&c.path&&(n.tracePath=c.path);let a=r.attachments.find(c=>c.name==="shiplight-results"),o=null;if(a)try{if(a.body)o=JSON.parse(a.body.toString("utf-8"));else if(a.path){let c=x.readFileSync(a.path,"utf-8");o=JSON.parse(c)}}catch{}let l=i.replace(/\.yaml\.spec\.ts$/,".test.yaml"),p={},u=t.title.match(/^(.*)\s+\[([^\]]+)\]$/),y=u?u[1]:t.title,b=u?u[2]:void 0;if(b&&(n.parameterSetName=b),x.existsSync(l))try{let c=x.readFileSync(l,"utf-8"),d=xe(c,l,this.config.rootDir);if(d.suite){let m=d.suite.tests.find(f=>f.name===y);m&&(p=U(m.testFlow),m.tags?.length&&(n.tags=m.tags),m.skip!==void 0&&(n.skip=m.skip),m.slow&&(n.slow=m.slow),m.timeout!==void 0&&(n.timeout=m.timeout),n.baseTitle=m.name||m.testFlow?.goal),n.suiteName=d.name,d.tags?.length&&(n.suiteTags=d.tags),d.use?.baseURL&&(n.baseUrl=d.use.baseURL)}else d.testFlow&&(p=U(d.testFlow),n.baseTitle=d.name||d.testFlow?.goal,d.tags?.length&&(n.tags=d.tags),d.use?.baseURL&&(n.baseUrl=d.use.baseURL))}catch{}if(o||Object.keys(p).length>0){let c=new Set([...Object.keys(p),...Object.keys(o||{})]),d=Array.from(c).map(f=>[f,null]),m=Mt(d);for(let[f]of m){let S=p[f],g=o?.[f],w=S?.description;if(!w||w==="Action"||w==="Draft"){let A=S?.action_entity;w=A?.action_description||A?.action_data?.kwargs?.description||g?.description||f}let _={stepId:f,description:w,status:g?.status||"pending",duration:g?.duration};if(g?.message){let A=typeof g.message=="string"?g.message:JSON.stringify(g.message,null,2);g.status==="failure"?_.error=A:_.message=A}if(g?.screenshot){let A=g.screenshot,T=a?.path?v.dirname(a.path):"",O=v.isAbsolute(A)?A:v.join(T,A);x.existsSync(O)&&(_.screenshot=O)}g?.code&&(_.code=g.code),g?.type&&(_.type=g.type),g?.startTime&&(_.startTime=g.startTime),g?.autoHealed&&(_.autoHealed=g.autoHealed),g?.healedAction&&(_.healedAction=g.healedAction),g?.dismissedModalActions?.length&&(_.dismissedModalActions=g.dismissedModalActions),g?.contextBefore&&(_.contextBefore=g.contextBefore),g?.contextAfter&&(_.contextAfter=g.contextAfter),n.steps.push(_)}}if(o===null&&Object.keys(p).length===0&&!i.endsWith(".yaml.spec.ts")){let c=new Map;if(n.steps=te(r.steps,"main",void 0,c),n.steps.length>0){let d=new Map;n.actionStepsMap=Object.fromEntries(n.steps.map(m=>{let f=c.get(m.stepId),S;if(f?.file){if(!d.has(f.file))try{d.set(f.file,x.readFileSync(f.file,"utf-8").split(`
|
|
890
|
+
`))}catch{d.set(f.file,[])}let w=d.get(f.file);S=w[f.line-1]?.trim();let _=f.line-2,A=f.line,T=[],O=f.line;_>=0&&(T.push(w[_]??""),O=f.line-1),T.push(w[f.line-1]??""),A<w.length&&T.push(w[A]??""),m.code=T.join(`
|
|
891
|
+
`),m.codeStartLine=O,m.codeLine=f.line}let g={description:m.description,...S&&{action_entity:{action_description:m.description,action_data:{action_name:"js_code",args:[],kwargs:{code:S}}}}};return[m.stepId,g]}))}}return Object.keys(p).length>0?n.actionStepsMap=p:o&&n.steps.length>0&&(n.actionStepsMap=Object.fromEntries(n.steps.map(c=>{let d=o[c.stepId],m=d?.type,f={description:c.description,...m&&{action_entity:{action_description:c.description,action_data:{action_name:m==="step"?"js_code":m,args:[],kwargs:m==="step"?{code:d?.code??c.description}:{statement:c.description}}}}};return[c.stepId,f]}))),n}},It=re;export{It as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as reactExports, W as We } from "./index-
|
|
1
|
+
import { r as reactExports, W as We } from "./index-Dm1PmCd3.js";
|
|
2
2
|
function _defineProperty$1(obj, key, value) {
|
|
3
3
|
if (key in obj) {
|
|
4
4
|
Object.defineProperty(obj, key, {
|
|
@@ -649,4 +649,4 @@ export {
|
|
|
649
649
|
loader,
|
|
650
650
|
Le as useMonaco
|
|
651
651
|
};
|
|
652
|
-
//# sourceMappingURL=index-
|
|
652
|
+
//# sourceMappingURL=index-CzL8SI3t.js.map
|