shiplightai 0.1.85 → 0.1.86
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 +13 -13
- package/dist/cjs/fixture.cjs +1 -8
- package/dist/cjs/index.cjs +3 -3
- package/dist/cjs/reporter.cjs +23 -23
- package/dist/cli.js +96 -69
- package/dist/debugger-pw.js +12 -12
- package/dist/fixture.js +1 -8
- package/dist/index.js +3 -3
- package/dist/reporter.js +23 -23
- package/package.json +1 -1
package/dist/reporter.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import*as S from"fs";import*as v from"path";var L=(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?L(i.statements,a,r):i.type==="IF_ELSE"?(r[a]={description:"IF "+(i.condition?.expression||""),action_entity:void 0},i.then&&L(i.then,`${a}.then`,r),i.else&&L(i.else,`${a}.else`,r)):i.type==="WHILE_LOOP"&&(r[a]={description:"WHILE "+(i.condition?.expression||""),action_entity:void 0},i.body&&L(i.body,`${a}.body`,r))})};function H(e){if(!e?.statements||!Array.isArray(e.statements))return{};let t={};return L(e.statements,"main",t),e.teardown&&Array.isArray(e.teardown)&&L(e.teardown,"teardown",t),t}import{v4 as Pt}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 Ct,parse as Le,parseAllDocuments as Ft,parseDocument as Ne,Document as Wt,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(Le(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(d=>{if(!d.name)throw new Error('Each test in a suite must have a "name" field');if(!Array.isArray(d.statements)||d.statements.length===0)throw new Error(`Suite test "${d.name}" must have a non-empty "statements" array`);let p={name:d.name,statements:M(d.statements)};return Array.isArray(d.teardown)&&d.teardown.length>0&&(p.teardown=M(d.teardown)),d.skip!==void 0&&(p.skip=d.skip),typeof d.timeout=="number"&&(p.timeout=d.timeout),d.fail!==void 0&&(p.fail=d.fail),d.only===!0&&(p.only=!0),d.slow===!0&&(p.slow=!0),p})};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[u,b]of Object.entries(e))Re.has(u)||(n[u]=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 d={action_description:r,action_data:{action_name:t,kwargs:Object.keys(n).length>0?n:{}}};i&&(d.locator=i),o&&(d.xpath=o);let p={uid:P(),type:"ACTION",description:r,action_entity:d};return a&&(p.use_pure_vision=!0),p}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 p=i.items?.[0];p?.key&&p.key.commentBefore&&(t.comment=p.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 Ut,stringify as Kt}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 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 uo}from"yaml";import X from"node:path";import{createHash as qe}from"crypto";import{parse as Ze,stringify as _e}from"yaml";import{readFileSync as Qe,existsSync as et}from"fs";import{resolve as q,dirname as tt}from"path";import{parse as me,stringify as rt}from"yaml";var ye=5e3;function Ye(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function Xe(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=Ye(e),r=e.locator;if(typeof r=="string"&&r.trim())return r=r.trim(),r.endsWith("first()")?`${t}.${r}`:`${t}.${r}.first()`;let i=Xe(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
|
-
`),
|
|
1
|
+
import*as S from"fs";import*as v from"path";var L=(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?L(i.statements,a,r):i.type==="IF_ELSE"?(r[a]={description:"IF "+(i.condition?.expression||""),action_entity:void 0},i.then&&L(i.then,`${a}.then`,r),i.else&&L(i.else,`${a}.else`,r)):i.type==="WHILE_LOOP"&&(r[a]={description:"WHILE "+(i.condition?.expression||""),action_entity:void 0},i.body&&L(i.body,`${a}.body`,r))})};function H(e){if(!e?.statements||!Array.isArray(e.statements))return{};let t={};return L(e.statements,"main",t),e.teardown&&Array.isArray(e.teardown)&&L(e.teardown,"teardown",t),t}import{v4 as Pt}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 Ct,parse as Le,parseAllDocuments as Ft,parseDocument as Ne,Document as Wt,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(Le(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 Ut,stringify as Kt}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 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 uo}from"yaml";import X from"node:path";import{createHash as qe}from"crypto";import{parse as Ze,stringify as _e}from"yaml";import{readFileSync as Qe,existsSync as et}from"fs";import{resolve as q,dirname as tt}from"path";import{parse as me,stringify as rt}from"yaml";var ye=5e3;function Ye(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function Xe(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=Ye(e),r=e.locator;if(typeof r=="string"&&r.trim())return r=r.trim(),r.endsWith("first()")?`${t}.${r}`:`${t}.${r}.first()`;let i=Xe(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
|
+
`),u=JSON.stringify(o);return["{ const _t = Date.now(); try {",...n.map(d=>` ${d}`),` console.log(\`[VERIFY:JS] \u2713 \${((Date.now()-_t)/1000).toFixed(1)}s: ${u}\`);`,"} 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: ${u}\`);`,` await agent.assert(page, ${u}, ${JSON.stringify(t||"")});`,"} }"]}return i?r.code.split(`
|
|
3
3
|
`):o?[`await agent.assert(page, ${JSON.stringify(o)}, ${JSON.stringify(t||"")});`]:["// Skipping verify: missing statement or code"]});f("ai_assert",$.get("verify"));f("assert",$.get("verify"));f("ai_action",(e,t)=>{let r=e.action_data?.kwargs?.statement;if(!r)return["// Skipping ai_action: missing statement"];let i=JSON.stringify(r),o=e.action_data?.kwargs?.use_pure_vision;return[`await agent.execute(page, ${i}, '${t||""}', ${o});`]});f("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"]});f("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 o=JSON.stringify(r),a=JSON.stringify(i);return[`await agent.extract(page, ${o}, ${a}, '${t||""}');`]});f("ai_wait_until",(e,t)=>{let r=e.action_data?.kwargs?.condition,i=e.action_data?.kwargs?.timeout_seconds||60;return r?[`await agent.waitUntilCondition(page, ${JSON.stringify(r)}, ${i}, '${t||""}');`]:["// Skipping ai_wait_until: missing condition"]});f("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)} } },`,"});"]});f("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 o of i)r.push(` ${o}`);return r.push("}"),r});f("function",(e,t,r)=>{let i=e.action_data?.kwargs||{},o=i.functionName;if(o&&o.includes("#")){let[n,
|
|
5
|
-
`):["// Skipping js_action: missing code"]});function fe(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"],o=["undefined","null","true","false"],a=r.map(n=>i.includes(n)||o.includes(n)||/^-?\d+(\.\d+)?$/.test(n)?n:n.startsWith("$")?`agent.agentServices.readVariable('${n.substring(1)}')`:`"${n}"`);return`await ${t}(${a.join(", ")})`}var ge=5;function we(e,t,r){let i={expandingPaths:new Set([q(t)]),depth:0,referencedPaths:new Set,basePath:r},o={...e};Array.isArray(o.statements)&&(o.statements=I(o.statements,t,i)),Array.isArray(o.teardown)&&(o.teardown=I(o.teardown,t,i));for(let a of["beforeAll","afterAll","beforeEach","afterEach"])Array.isArray(o[a])&&(o[a]=I(o[a],t,i));return{doc:o,referencedTemplatePaths:Array.from(i.referencedPaths)}}function I(e,t,r){let i=[];for(let o of e)if(it(o)){let a=ot(o,t,r);i.push(a)}else i.push(nt(o,t,r));return i}function it(e){return typeof e=="object"&&e!==null&&typeof e.template=="string"}function ot(e,t,r){if(r.depth>=ge)throw new Error(`Template expansion exceeded maximum depth of ${ge}. Check for deeply nested or circular template references.`);let i=q(tt(t),e.template),o=!et(i)&&r.basePath?q(r.basePath,e.template):i;if(r.expandingPaths.has(o))throw new Error(`Circular template reference detected: ${o} is already being expanded. Stack: ${Array.from(r.expandingPaths).join(" \u2192 ")} \u2192 ${o}`);r.referencedPaths.add(o);let a;try{a=Qe(o,"utf-8")}catch(m){throw new Error(`Failed to read template file: ${o} (referenced from ${t}): ${m.message}`)}let n=me(a);if(!n||typeof n!="object")throw new Error(`Invalid template file: ${o} \u2014 expected a YAML object`);let
|
|
6
|
-
`);return e.codeStartLine!=null&&e.codeLine!=null?`<div class="step-code"><pre class="code-block">${t.map((o,a)=>{let n=e.codeStartLine+a,
|
|
7
|
-
<details class="step-details step step-${e.status}"${
|
|
4
|
+
`);for(let o of i)r.push(` ${o}`);return r.push("}"),r});f("function",(e,t,r)=>{let i=e.action_data?.kwargs||{},o=i.functionName;if(o&&o.includes("#")){let[n,u]=o.split("#");if(n&&u){let d=n.replace(/\.(ts|js|mjs)$/,"");if(X.isAbsolute(n))return[`throw new Error(${JSON.stringify(`Absolute paths are not supported in call: references. Use a path relative to the project root (got: "${n}")`)})`];if(!d.startsWith(".")&&r?.projectRoot&&r?.yamlDir){let c=X.resolve(r.projectRoot,d),l=X.relative(r.yamlDir,c).replace(/\\/g,"/");d=l.startsWith("..")?l:"./"+l}let p=`import { ${u} } from '${d}';`;r?.imports?.add(p);let b={...i,functionName:u},w=fe(b);return w?[w.endsWith(";")?w:`${w};`]:["// Skipping function: invalid export pattern"]}}let a=fe(i);return a?[a.endsWith(";")?a:`${a};`]:["// Skipping function: missing functionName"]});f("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)} } },`,"});"]});f("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(o=>` ${o},`),"});"]});f("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} } },`,"});"]);f("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} } },`,"});"]);f("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} } },`,"});"]});f("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},`),"});"]});f("done",()=>["// Done - no action needed"]);function Z(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(o=>` ${o},`),"});"]}f("click_by_coordinates",e=>Z("click_by_coordinates",e));f("right_click_by_coordinates",e=>Z("right_click_by_coordinates",e));f("double_click_by_coordinates",e=>Z("double_click_by_coordinates",e));f("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(o=>` ${o},`),"});"]});f("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},`),"});"]});f("extract_email_content",e=>{let t=e.action_data?.kwargs||{};return['await agent.execAction("extract_email_content", page, {',` action_data: { kwargs: ${JSON.stringify(t)} },`,"});"]});f("js_action",e=>{let t=e.action_data?.kwargs?.code;return t?t.split(`
|
|
5
|
+
`):["// Skipping js_action: missing code"]});function fe(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"],o=["undefined","null","true","false"],a=r.map(n=>i.includes(n)||o.includes(n)||/^-?\d+(\.\d+)?$/.test(n)?n:n.startsWith("$")?`agent.agentServices.readVariable('${n.substring(1)}')`:`"${n}"`);return`await ${t}(${a.join(", ")})`}var ge=5;function we(e,t,r){let i={expandingPaths:new Set([q(t)]),depth:0,referencedPaths:new Set,basePath:r},o={...e};Array.isArray(o.statements)&&(o.statements=I(o.statements,t,i)),Array.isArray(o.teardown)&&(o.teardown=I(o.teardown,t,i));for(let a of["beforeAll","afterAll","beforeEach","afterEach"])Array.isArray(o[a])&&(o[a]=I(o[a],t,i));return{doc:o,referencedTemplatePaths:Array.from(i.referencedPaths)}}function I(e,t,r){let i=[];for(let o of e)if(it(o)){let a=ot(o,t,r);i.push(a)}else i.push(nt(o,t,r));return i}function it(e){return typeof e=="object"&&e!==null&&typeof e.template=="string"}function ot(e,t,r){if(r.depth>=ge)throw new Error(`Template expansion exceeded maximum depth of ${ge}. Check for deeply nested or circular template references.`);let i=q(tt(t),e.template),o=!et(i)&&r.basePath?q(r.basePath,e.template):i;if(r.expandingPaths.has(o))throw new Error(`Circular template reference detected: ${o} is already being expanded. Stack: ${Array.from(r.expandingPaths).join(" \u2192 ")} \u2192 ${o}`);r.referencedPaths.add(o);let a;try{a=Qe(o,"utf-8")}catch(m){throw new Error(`Failed to read template file: ${o} (referenced from ${t}): ${m.message}`)}let n=me(a);if(!n||typeof n!="object")throw new Error(`Invalid template file: ${o} \u2014 expected a YAML object`);let u=n.params||[],d=e.params||{};for(let m of u)if(!(m in d))throw new Error(`Template ${e.template} requires param "${m}" but it was not provided. Required params: [${u.join(", ")}]`);let p=n.statements;if(!Array.isArray(p))throw new Error(`Template ${e.template} must have a "statements" array`);if(Object.keys(d).length>0){let h=rt(p);for(let[x,g]of Object.entries(d))h=h.split(`<<${x}>>`).join(String(g));p=me(h)}let b={expandingPaths:new Set([...r.expandingPaths,o]),depth:r.depth+1,referencedPaths:r.referencedPaths},w=I(p,o,b),l={STEP:n.name||e.template.replace(/\.yaml$/,"").split("/").pop()||e.template,template_path:e.template,statements:w};return Object.keys(d).length>0&&(l.template_params=d),l}function nt(e,t,r){if(typeof e!="object"||e===null)return e;let i={...e};return Array.isArray(i.statements)&&(i.statements=I(i.statements,t,r)),Array.isArray(i.THEN)&&(i.THEN=I(i.THEN,t,r)),Array.isArray(i.ELSE)&&(i.ELSE=I(i.ELSE,t,r)),Array.isArray(i.DO)&&(i.DO=I(i.DO,t,r)),i}var ve=class extends Error{constructor(e){super(e),this.name="YamlValidationError"}};function xe(e,t,r){let i=Ze(e),o=i?.name,a=i?.tags,n=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 ve('YAML file cannot have both "suite" and top-level "goal"/"statements". Use either suite format or single-test format.');return st(i,o,a,n,t,r)}return at(i,o,a,n,t,r)}function at(e,t,r,i,o,a){let n=e?.beforeEach,u=e?.afterEach,d=Se(e?.parameters),p=e?.timeout,b=e?.skip,w=e?.fail,c=e?.only,l=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 ve(`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(o&&e&&typeof e=="object"){let g=we(e,o,a);e=g.doc,m=g.referencedTemplatePaths}let h=_e(e),x=N(h);return o&&(R(x.statements??[],o,"main"),x.teardown&&R(x.teardown,o,"teardown")),{testFlow:x,name:t,tags:r,use:i,beforeEach:n,afterEach:u,parameters:d,timeout:p,skip:b,fail:w,only:c,slow:l,referencedTemplatePaths:m}}function st(e,t,r,i,o,a){let n=e.suite;if(!Array.isArray(n.tests)||n.tests.length===0)throw new Error('Suite must have a non-empty "tests" array.');let u=n.beforeAll,d=n.afterAll,p=n.beforeEach,b=n.afterEach,w=[],c=n.tests.map(h=>{if(!h.name)throw new Error('Each test in a suite must have a "name" field.');if(!Array.isArray(h.statements)||h.statements.length===0)throw new Error(`Suite test "${h.name}" must have a non-empty "statements" array.`);let x={goal:h.name,statements:h.statements};h.teardown&&(x.teardown=h.teardown);let g=[],_=x;if(o&&typeof x=="object"){let O=we(x,o,a);_=O.doc,g=O.referencedTemplatePaths,w.push(...g)}let y=_e(_),T=N(y),A=Se(h.parameters);return{testFlow:T,name:h.name,tags:Array.isArray(h.tags)?h.tags:void 0,parameters:A,timeout:h.timeout,skip:h.skip,fail:h.fail,only:h.only,slow:h.slow}}),l=n.base_url,m=l?{...i,baseURL:l}:i;return{suite:{beforeAll:u,afterAll:d,beforeEach:p,afterEach:b,tests:c},name:t,tags:r,use:m,referencedTemplatePaths:w}}function Se(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 R(e,t,r){for(let i=0;i<e.length;i++){let o=e[i],a=`${r}.${i}`,n=o.description||"";if(o.uid=ct(t,a,n),o.type===D.STEP)R(o.statements,t,a);else if(o.type===D.IF_ELSE){let u=o;R(u.then,t,`${a}.then`),u.else&&R(u.else,t,`${a}.else`)}else o.type===D.WHILE_LOOP&&R(o.body,t,`${a}.body`)}}function ct(e,t,r){let i=qe("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 ke 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 lt(e){return`passed after ${e||"?"} ${e===1?"retry":"retries"}`}function pt(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 ut(e){return`<span class="badge badge-${e}">${e}</span>`}function dt(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((o,a)=>{let n=e.codeStartLine+a,u=n===e.codeLine,d=String(n).padStart(4);return`<span class="code-line${u?" code-line-active":""}">${d} \u2502 ${k(o)}</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 ht(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 o="";e.screenshot&&(o=`<img src="${k(e.screenshot)}" alt="Step screenshot" class="step-screenshot" />`);let a=e.screenshot?"":dt(e),n="";e.error&&(n=`<div class="step-error"><pre>${k(e.error)}</pre></div>`);let u="";e.message&&!e.error&&(u=`<div class="step-message">${k(e.message)}</div>`);let d=e.status==="failure"?" open":"";return`
|
|
7
|
+
<details class="step-details step step-${e.status}"${d}>
|
|
8
8
|
<summary class="step-header">
|
|
9
9
|
${r}
|
|
10
10
|
<span class="step-id">${k(e.stepId)}</span>
|
|
@@ -15,7 +15,7 @@ import*as S from"fs";import*as v from"path";var L=(e,t,r)=>{e.forEach((i,o)=>{le
|
|
|
15
15
|
${o}
|
|
16
16
|
${a}
|
|
17
17
|
<div class="step-description-full">${k(e.description)}</div>
|
|
18
|
-
${
|
|
18
|
+
${u}
|
|
19
19
|
${n}
|
|
20
20
|
</div>
|
|
21
21
|
</details>`}return`
|
|
@@ -37,15 +37,15 @@ import*as S from"fs";import*as v from"path";var L=(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(n=>n.screenshot).map(n=>({src:n.screenshot,stepId:n.stepId,description:n.description,status:n.status,message:n.message||n.error||""}));if(a.length>0){let n=k(JSON.stringify(a)),
|
|
41
|
-
<div class="screenshot-thumb" onclick="openGalleryAt(this, ${
|
|
42
|
-
<img src="${k(
|
|
43
|
-
<span class="thumb-label">${k(
|
|
40
|
+
</details>`);let a=r.filter(n=>n.screenshot).map(n=>({src:n.screenshot,stepId:n.stepId,description:n.description,status:n.status,message:n.message||n.error||""}));if(a.length>0){let n=k(JSON.stringify(a)),u=a.map((d,p)=>`
|
|
41
|
+
<div class="screenshot-thumb" onclick="openGalleryAt(this, ${p})" data-gallery="${n}">
|
|
42
|
+
<img src="${k(d.src)}" alt="${k(d.stepId)}" />
|
|
43
|
+
<span class="thumb-label">${k(d.stepId)}</span>
|
|
44
44
|
</div>`).join("");o.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">${u}</div>
|
|
49
49
|
</div>
|
|
50
50
|
</details>`)}if(t){let n=k(t);o.push(`
|
|
51
51
|
<details class="artifact-section">
|
|
@@ -59,14 +59,14 @@ import*as S from"fs";import*as v from"path";var L=(e,t,r)=>{e.forEach((i,o)=>{le
|
|
|
59
59
|
<p class="trace-hint"><a href="${k(t)}" class="attachment-link" download>Download trace.zip</a></p>
|
|
60
60
|
</div>
|
|
61
61
|
</details>`)}return o.length===0?"":`<div class="test-artifacts">${o.join("")}</div>`}function Te(e,t,r,i,o){let a=e.map(ht).join(`
|
|
62
|
-
`),n="";t&&!e.some(
|
|
62
|
+
`),n="";t&&!e.some(d=>d.error)&&(n=`<div class="test-error"><pre>${k(t)}</pre></div>`);let u=ft(r,i,e,o);return`
|
|
63
63
|
${n}
|
|
64
64
|
<div class="steps-list">
|
|
65
65
|
${a||'<div class="no-steps">No YAML step details available</div>'}
|
|
66
66
|
</div>
|
|
67
|
-
${
|
|
67
|
+
${u}`}function mt(e,t){let r=e.flaky?"flaky":e.status,i=j(r),o;if(e.attempts&&e.attempts.length>1){let a=`tabs-${t}`,u=e.attempts.length-1,d=e.attempts.map((c,l)=>{let m=l===u,h=c.status==="passed"?"passed":"failed",x=`Attempt ${c.attemptNumber}`;return`<button class="attempt-tab ${m?"active":""} attempt-tab-${h}"
|
|
68
68
|
onclick="switchAttemptTab('${a}', ${l})"
|
|
69
|
-
data-tab-index="${l}">${j(h)} ${x} <span class="attempt-tab-badge badge-${h}">${c.status}</span></button>`}).join(""),
|
|
69
|
+
data-tab-index="${l}">${j(h)} ${x} <span class="attempt-tab-badge badge-${h}">${c.status}</span></button>`}).join(""),p=e.attempts.map((c,l)=>{let m=l===u,h=Te(c.steps,c.error,c.videoPath,c.tracePath,`${t}-attempt-${l}`);return`<div class="attempt-panel ${m?"active":""}" data-panel-index="${l}">
|
|
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>
|
|
@@ -75,8 +75,8 @@ import*as S from"fs";import*as v from"path";var L=(e,t,r)=>{e.forEach((i,o)=>{le
|
|
|
75
75
|
</div>`}).join(""),b=e.flaky?`Flaky — ${lt(e.retries)}`:`Retried — ${pt(e.retries,e.status)}`;o=`
|
|
76
76
|
<div class="${e.flaky?"flaky-note":"retried-note"}">${b}</div>
|
|
77
77
|
<div class="attempt-tabs" id="${a}">
|
|
78
|
-
<div class="attempt-tab-bar">${
|
|
79
|
-
${
|
|
78
|
+
<div class="attempt-tab-bar">${d}</div>
|
|
79
|
+
${p}
|
|
80
80
|
</div>`}else o=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}">
|
|
@@ -89,7 +89,7 @@ import*as S from"fs";import*as v from"path";var L=(e,t,r)=>{e.forEach((i,o)=>{le
|
|
|
89
89
|
<div class="test-body">
|
|
90
90
|
${o}
|
|
91
91
|
</div>
|
|
92
|
-
</details>`}function Ae(e,t){return!e||!t||ke.isAbsolute(e)?e:ke.join(t,e)}function gt(e,t){return t?{...e,tracePath:Ae(e.tracePath,t),attempts:e.attempts?.map(r=>({...r,tracePath:Ae(r.tracePath,t)}))}:e}function $e(e){let t=e.tests.filter(
|
|
92
|
+
</details>`}function Ae(e,t){return!e||!t||ke.isAbsolute(e)?e:ke.join(t,e)}function gt(e,t){return t?{...e,tracePath:Ae(e.tracePath,t),attempts:e.attempts?.map(r=>({...r,tracePath:Ae(r.tracePath,t)}))}:e}function $e(e){let t=e.tests.filter(p=>p.flaky).length,r=e.tests.filter(p=>!p.flaky&&p.retries!=null&&p.retries>0).length,i=e.tests.filter(p=>p.status==="passed"&&!p.flaky).length,o=e.tests.filter(p=>p.status==="failed"||p.status==="timedOut").length,a=e.tests.filter(p=>p.status==="skipped").length,n=e.tests.length,d=e.tests.map(p=>gt(p,e.outputDir)).map((p,b)=>mt(p,b)).join(`
|
|
93
93
|
`);return`<!DOCTYPE html>
|
|
94
94
|
<html lang="en">
|
|
95
95
|
<head>
|
|
@@ -753,7 +753,7 @@ import*as S from"fs";import*as v from"path";var L=(e,t,r)=>{e.forEach((i,o)=>{le
|
|
|
753
753
|
</div>
|
|
754
754
|
</div>`:""}
|
|
755
755
|
<div class="test-list">
|
|
756
|
-
${
|
|
756
|
+
${d}
|
|
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 S from"fs";import*as v from"path";var L=(e,t,r)=>{e.forEach((i,o)=>{le
|
|
|
883
883
|
});
|
|
884
884
|
</script>
|
|
885
885
|
</body>
|
|
886
|
-
</html>`}var Ee="0.1.
|
|
887
|
-
Shiplight report written to: ${
|
|
886
|
+
</html>`}var Ee="0.1.86",Me=Ee!=="dev"?Ee:void 0;var Ao=3600*1e3,$o=10080*60*1e3;var yt={before:0,main:1,teardown:2,after:3};function Pe(e){let t=e.split(".")[0];return yt[t]??1}function Oe(e){return e.split(".").map(t=>{let r=Number(t);return Number.isNaN(r)?0:r})}function bt(e){return[...e].sort(([t],[r])=>{let i=Pe(t),o=Pe(r);if(i!==o)return i-o;let a=Oe(t),n=Oe(r);for(let u=0;u<Math.max(a.length,n.length);u++){let d=a[u]??-1,p=n[u]??-1;if(d!==p)return d-p}return 0})}function _t(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 wt(e,t){let r=e.toLowerCase();return r.includes("before")?"before":r.includes("after")?"after":t}function Q(e,t="main",r,i,o){r===void 0&&(r=!_t(e).has("test.step")),o||(o=new Map);let a=[];for(let n of e){if(n.category==="fixture"||n.category==="test.attach")continue;if(n.category==="hook"){let d=wt(n.title,t);a.push(...Q(n.steps,d,r,i,o));continue}if(n.category==="test.step"||r&&(n.category==="expect"||n.category==="pw:api")){let d=o.get(t)??0;o.set(t,d+1);let p=`${t}.${d}`,b={stepId:p,description:n.title,status:n.error?"failure":n.duration===-1?"skipped":"success",duration:n.duration>=0?n.duration:void 0};n.error&&(b.error=n.error.message??n.error.stack),i&&n.location&&i.set(p,n.location),a.push(b),n.steps.length>0&&a.push(...Q(n.steps,p,r,i,o))}}return a}function vt(e,t){let r=v.isAbsolute(e)?e:v.join(process.cwd(),e),i=v.join(r,"latest");try{if(S.lstatSync(i).isSymbolicLink())S.unlinkSync(i);else{console.warn("[report] 'latest' exists and is not a symlink; skipping update");return}}catch{}try{process.platform==="win32"?S.symlinkSync(v.join(r,t),i,"junction"):S.symlinkSync(t,i,"dir")}catch(o){console.warn(`[report] Could not create 'latest' symlink: ${o instanceof Error?o.message:String(o)}`)}}var ee=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 p of this.collected){let b=p.test.titlePath().join(" > "),w=r.get(b);w||(w=[],r.set(b,w)),w.push(p)}let i=[];for(let[,p]of r.entries()){let b=p[0].test.location.file,w=[],c,l,m;for(let _=0;_<p.length;_++){let{test:y,result:T}=p[_],A=await this.buildReportTest(y,T,b);c=A,l||(l=A.startTime),m=A.endTime,w.push({attemptNumber:_+1,status:T.status,duration:T.duration,steps:A.steps,error:A.error,videoPath:A.videoPath,tracePath:A.tracePath})}let h=w[w.length-1],{test:x}=p[p.length-1],g={title:x.title,baseTitle:c?.baseTitle,file:v.relative(process.cwd(),b),status:h.status,duration:h.duration,steps:h.steps,error:h.error,videoPath:h.videoPath,tracePath:h.tracePath,actionStepsMap:c?.actionStepsMap,tags:c?.tags,baseUrl:c?.baseUrl,skip:c?.skip,slow:c?.slow,timeout:c?.timeout,parameterSetName:c?.parameterSetName,startTime:l,endTime:m,suiteName:c?.suiteName};w.length>1&&(g.retries=w.length-1,g.attempts=w,w.some(y=>y.status==="failed"||y.status==="timedOut")&&h.status==="passed"&&(g.flaky=!0)),i.push(g)}let o={tests:i,totalDuration:t.duration,timestamp:new Date().toISOString(),shiplightVersion:Me},a=v.isAbsolute(this.outputFolder)?this.outputFolder:v.join(process.cwd(),this.outputFolder);S.mkdirSync(a,{recursive:!0});let n=v.join(a,"screenshots");for(let p=0;p<o.tests.length;p++){let b=o.tests[p],w=b.attempts&&b.attempts.length>0,c=[{obj:b,prefix:w?`test-${p}-attempt-0`:`test-${p}`,screenshotSubDir:`test-${p}`}];if(b.attempts)for(let l=0;l<b.attempts.length;l++)c.push({obj:b.attempts[l],prefix:`test-${p}-attempt-${l+1}`,screenshotSubDir:`test-${p}/attempt-${l}`});for(let{obj:l,prefix:m,screenshotSubDir:h}of c){let x=v.join(n,h),g=!1;for(let _ of l.steps)if(_.screenshot&&v.isAbsolute(_.screenshot))try{g||(S.mkdirSync(x,{recursive:!0}),g=!0);let y=`${_.stepId.replace(/\./g,"-")}.png`;S.copyFileSync(_.screenshot,v.join(x,y)),_.screenshot=`screenshots/${h}/${y}`}catch(y){console.warn(`[reporter] Failed to copy screenshot for ${_.stepId}:`,y)}if(l.videoPath&&v.isAbsolute(l.videoPath)){let _=v.extname(l.videoPath)||".webm",y=`${m}-video${_}`;try{S.copyFileSync(l.videoPath,v.join(a,y)),l.videoPath=y}catch{l.videoPath=void 0}}if(l.tracePath&&v.isAbsolute(l.tracePath)){let _=v.extname(l.tracePath)||".zip",y=`${m}-trace${_}`;try{S.copyFileSync(l.tracePath,v.join(a,y)),l.tracePath=y}catch{l.tracePath=void 0}}}}let u=v.join(a,"report-data.json");S.writeFileSync(u,JSON.stringify(o,null,2),"utf-8");let d=v.join(a,"index.html");if(S.writeFileSync(d,$e({...o,outputDir:a}),"utf-8"),console.log(`
|
|
887
|
+
Shiplight report written to: ${d}`),this.latestSymlinkDir&&vt(this.latestSymlinkDir,v.basename(a)),this.openMode==="always"||this.openMode==="on-failure"&&t.status!=="passed")try{let p=(await import("open")).default;await p(d)}catch{}}printsToStdio(){return!1}async buildReportTest(t,r,i){let o={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&&(o.error=r.errors.map(c=>c.message||c.stack||String(c)).join(`
|
|
888
888
|
|
|
889
|
-
`)),r.stdout.length>0&&(o.stdout=r.stdout.map(c=>typeof c=="string"?c:c.toString()).join("")),r.stderr.length>0&&(o.stderr=r.stderr.map(c=>typeof c=="string"?c:c.toString()).join(""));for(let c of r.attachments)c.name==="video"&&c.path&&(o.videoPath=c.path),c.name==="trace"&&c.path&&(o.tracePath=c.path);let a=r.attachments.find(c=>c.name==="shiplight-results"),n=null;if(a)try{if(a.body)n=JSON.parse(a.body.toString("utf-8"));else if(a.path){let c=S.readFileSync(a.path,"utf-8");n=JSON.parse(c)}}catch{}let
|
|
889
|
+
`)),r.stdout.length>0&&(o.stdout=r.stdout.map(c=>typeof c=="string"?c:c.toString()).join("")),r.stderr.length>0&&(o.stderr=r.stderr.map(c=>typeof c=="string"?c:c.toString()).join(""));for(let c of r.attachments)c.name==="video"&&c.path&&(o.videoPath=c.path),c.name==="trace"&&c.path&&(o.tracePath=c.path);let a=r.attachments.find(c=>c.name==="shiplight-results"),n=null;if(a)try{if(a.body)n=JSON.parse(a.body.toString("utf-8"));else if(a.path){let c=S.readFileSync(a.path,"utf-8");n=JSON.parse(c)}}catch{}let u=i.replace(/\.yaml\.spec\.ts$/,".test.yaml"),d={},p=t.title.match(/^(.*)\s+\[([^\]]+)\]$/),b=p?p[1]:t.title,w=p?p[2]:void 0;if(w&&(o.parameterSetName=w),S.existsSync(u))try{let c=S.readFileSync(u,"utf-8"),l=xe(c,u,this.config.rootDir);if(l.suite){let m=l.suite.tests.find(h=>h.name===b);m&&(d=H(m.testFlow),m.tags?.length&&(o.tags=m.tags),m.skip!==void 0&&(o.skip=m.skip),m.slow&&(o.slow=m.slow),m.timeout!==void 0&&(o.timeout=m.timeout),o.baseTitle=m.name||m.testFlow?.goal),o.suiteName=l.name,l.tags?.length&&(o.suiteTags=l.tags),l.use?.baseURL&&(o.baseUrl=l.use.baseURL)}else l.testFlow&&(d=H(l.testFlow),o.baseTitle=l.name||l.testFlow?.goal,l.tags?.length&&(o.tags=l.tags),l.use?.baseURL&&(o.baseUrl=l.use.baseURL))}catch{}if(n||Object.keys(d).length>0){let c=new Set([...Object.keys(d),...Object.keys(n||{})]),l=Array.from(c).map(h=>[h,null]),m=bt(l);for(let[h]of m){let x=d[h],g=n?.[h],_=x?.description;if(!_||_==="Action"||_==="Draft"){let T=x?.action_entity;_=T?.action_description||T?.action_data?.kwargs?.description||g?.description||h}let y={stepId:h,description:_,status:g?.status||"pending",duration:g?.duration};if(g?.message){let T=typeof g.message=="string"?g.message:JSON.stringify(g.message,null,2);g.status==="failure"?y.error=T:y.message=T}if(g?.screenshot){let T=g.screenshot,A=a?.path?v.dirname(a.path):"",O=v.isAbsolute(T)?T:v.join(A,T);S.existsSync(O)&&(y.screenshot=O)}g?.code&&(y.code=g.code),g?.type&&(y.type=g.type),g?.startTime&&(y.startTime=g.startTime),g?.autoHealed&&(y.autoHealed=g.autoHealed),g?.healedAction&&(y.healedAction=g.healedAction),g?.dismissedModalActions?.length&&(y.dismissedModalActions=g.dismissedModalActions),g?.contextBefore&&(y.contextBefore=g.contextBefore),g?.contextAfter&&(y.contextAfter=g.contextAfter),o.steps.push(y)}}if(n===null&&Object.keys(d).length===0&&!i.endsWith(".yaml.spec.ts")){let c=new Map;if(o.steps=Q(r.steps,"main",void 0,c),o.steps.length>0){let l=new Map;o.actionStepsMap=Object.fromEntries(o.steps.map(m=>{let h=c.get(m.stepId),x;if(h?.file){if(!l.has(h.file))try{l.set(h.file,S.readFileSync(h.file,"utf-8").split(`
|
|
890
890
|
`))}catch{l.set(h.file,[])}let _=l.get(h.file);x=_[h.line-1]?.trim();let y=h.line-2,T=h.line,A=[],O=h.line;y>=0&&(A.push(_[y]??""),O=h.line-1),A.push(_[h.line-1]??""),T<_.length&&A.push(_[T]??""),m.code=A.join(`
|
|
891
|
-
`),m.codeStartLine=O,m.codeLine=h.line}let g={description:m.description,...x&&{action_entity:{action_description:m.description,action_data:{action_name:"js_code",args:[],kwargs:{code:x}}}}};return[m.stepId,g]}))}}return Object.keys(
|
|
891
|
+
`),m.codeStartLine=O,m.codeLine=h.line}let g={description:m.description,...x&&{action_entity:{action_description:m.description,action_data:{action_name:"js_code",args:[],kwargs:{code:x}}}}};return[m.stepId,g]}))}}return Object.keys(d).length>0?o.actionStepsMap=d:n&&o.steps.length>0&&(o.actionStepsMap=Object.fromEntries(o.steps.map(c=>{let l=n[c.stepId],m=l?.type,h={description:c.description,...m&&{action_entity:{action_description:c.description,action_data:{action_name:m==="step"?"js_code":m,args:[],kwargs:m==="step"?{code:l?.code??c.description}:{statement:c.description}}}}};return[c.stepId,h]}))),o}},xt=ee;export{xt as default};
|