shiplightai 0.1.36 → 0.1.38
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 +4619 -13
- package/dist/cjs/fixture.cjs +83 -83
- package/dist/cjs/index.cjs +127 -127
- package/dist/cjs/reporter.cjs +22 -22
- package/dist/cli.js +78 -89
- package/dist/debugger-pw.d.ts +22 -11
- package/dist/debugger-pw.js +4623 -5
- package/dist/fixture.js +4775 -1
- package/dist/index.js +4713 -4
- package/dist/reporter.js +66 -62
- package/dist/static/assets/{index-DnzBfLIt.js → index-C8nWHK_h.js} +186 -186
- package/dist/static/assets/{index-CBiy04GU.js → index-postIiDJ.js} +2 -2
- package/dist/static/index.html +1 -1
- package/package.json +2 -4
- package/dist/agentHelpers-YPJ5MC66.js +0 -3
- package/dist/agentLogin-UROAQE2B.js +0 -3
- package/dist/chunk-CSINHOOD.js +0 -3
- package/dist/chunk-CYYG6ENT.js +0 -37
- package/dist/chunk-DUXKECDI.js +0 -58
- package/dist/chunk-FPNAM4ZH.js +0 -3
- package/dist/chunk-G7KWIGKV.js +0 -11
- package/dist/chunk-GBWDXF5V.js +0 -3998
- package/dist/chunk-GSIC3VVD.js +0 -196
- package/dist/chunk-NVQUBIDY.js +0 -183
- package/dist/chunk-PTSNTQWC.js +0 -18
- package/dist/chunk-SGXLY5OU.js +0 -33
- package/dist/chunk-T2JTBHI7.js +0 -3
- package/dist/chunk-T3H4NEVX.js +0 -16
- package/dist/chunk-YU3XZJIJ.js +0 -3
- package/dist/chunk-ZCXQXXY6.js +0 -61
- package/dist/chunk-ZI57Y3IM.js +0 -5
- package/dist/copilot-7JTVJQXP.js +0 -5
- package/dist/dist-HCR36MMH.js +0 -3
- package/dist/dist-HN2P3FRX.js +0 -14
- package/dist/dist-KCCHXIDD.js +0 -3
- package/dist/handler-MFCBIUIL.js +0 -3
- package/dist/intRunner-QEWXFBHB.js +0 -9
- package/dist/multipart-parser-KQFLHJKK.js +0 -4
- package/dist/src-CXU6MEQY.js +0 -5
- package/dist/task-2SW3VSRI.js +0 -192
- package/dist/testFlow-CMH7ZZR3.js +0 -3
- package/dist/token-HZZUEE35.js +0 -3
- package/dist/token-util-7HVAYCG2.js +0 -3
package/dist/cjs/reporter.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";var Ae=Object.create;var W=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var Me=Object.getPrototypeOf,Ee=Object.prototype.hasOwnProperty;var Oe=(e,t)=>{for(var r in t)W(e,r,{get:t[r],enumerable:!0})},X=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $e(t))!Ee.call(e,o)&&o!==r&&W(e,o,{get:()=>t[o],enumerable:!(i=Pe(t,o))||i.enumerable});return e};var z=(e,t,r)=>(r=e!=null?Ae(Me(e)):{},X(t||!e||!e.__esModule?W(r,"default",{value:e,enumerable:!0}):r,e)),Ie=e=>X(W({},"__esModule",{value:!0}),e);var ut={};Oe(ut,{default:()=>ke});module.exports=Ie(ut);var k=z(require("fs"),1),y=z(require("path"),1);var E=(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}:i.type==="STEP"&&i.statements?E(i.statements,a,r):i.type==="IF_ELSE"?(r[a]={description:"IF "+(i.condition?.expression||""),action_entity:void 0},i.then&&E(i.then,`${a}.then`,r),i.else&&E(i.else,`${a}.else`,r)):i.type==="WHILE_LOOP"&&(r[a]={description:"WHILE "+(i.condition?.expression||""),action_entity:void 0},i.body&&E(i.body,`${a}.body`,r))})};function B(e){if(!e?.statements||!Array.isArray(e.statements))return{};let t={};return E(e.statements,"main",t),e.teardown&&Array.isArray(e.teardown)&&E(e.teardown,"teardown",t),t}var n=require("zod"),q=n.z.enum(["JS_CODE","AI_MODE"]),U=n.z.object({type:q,expression:n.z.string()}),Z=n.z.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),L=n.z.object({uid:n.z.string(),type:Z}),Q=n.z.object({action_data:n.z.object({action_name:n.z.string(),kwargs:n.z.record(n.z.any()).optional(),args:n.z.array(n.z.any()).optional()}),action_description:n.z.string().optional(),url:n.z.string().optional(),xpath:n.z.string().nullable().optional(),locator:n.z.string().nullable().optional(),css_selector:n.z.string().nullable().optional(),unique_selector:n.z.string().nullable().optional(),element_index:n.z.number().nullable().optional(),frame_path:n.z.array(n.z.any()).optional(),artifacts:n.z.record(n.z.any()).optional(),feedback:n.z.string().optional(),original_browser_use_action:n.z.any().optional()}).passthrough(),ee=L.extend({type:n.z.literal("DRAFT"),description:n.z.string()}),te=L.extend({type:n.z.literal("ACTION"),description:n.z.string(),action_entity:Q.optional(),locator:n.z.string().optional(),use_pure_vision:n.z.boolean().optional()}),A=n.z.lazy(()=>n.z.union([ee,te,L.extend({type:n.z.literal("STEP"),description:n.z.string().optional().default(""),statements:n.z.array(A),reference_id:n.z.number().optional()}),L.extend({type:n.z.literal("IF_ELSE"),description:n.z.string().optional(),condition:U,then:n.z.array(A),else:n.z.array(A).optional()}),L.extend({type:n.z.literal("WHILE_LOOP"),description:n.z.string().optional(),condition:U,body:n.z.array(A),timeout_ms:n.z.number().optional()})])),re=n.z.object({name:n.z.string(),statements:n.z.array(A),teardown:n.z.array(A).optional(),skip:n.z.union([n.z.boolean(),n.z.string()]).optional(),timeout:n.z.number().optional(),fail:n.z.union([n.z.boolean(),n.z.string()]).optional(),only:n.z.boolean().optional(),slow:n.z.boolean().optional()}),G=n.z.object({tests:n.z.array(re).min(1),beforeAll:n.z.array(A).optional(),afterAll:n.z.array(A).optional(),beforeEach:n.z.array(A).optional(),afterEach:n.z.array(A).optional()}),V=n.z.object({version:n.z.string().optional(),goal:n.z.string().optional(),url:n.z.string().optional(),baseURL:n.z.string().optional(),final_feedback:n.z.string().optional(),completed:n.z.boolean().optional(),success:n.z.boolean().optional(),statements:n.z.array(A).optional(),teardown:n.z.array(A).optional(),last_modified_at:n.z.string().optional(),testGroup:G.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"});var K=require("yaml"),P=require("uuid");function j(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(j);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]=j(a);return i}var ie=1024*1024;function O(e){if(e.length>ie)throw new Error(`YAML input too large (${e.length} bytes, max ${ie})`);let t=j((0,K.parse)(e));if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object at root level");if(t.suite)return Le(t);let r={version:"1.3.0",goal:t.goal,url:t.url,baseURL:t.base_url,statements:$(t.statements??[])};t.final_feedback&&(r.final_feedback=t.final_feedback),t.teardown&&Array.isArray(t.teardown)&&(r.teardown=$(t.teardown));let i=V.safeParse(r);if(!i.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(i.error.errors)}`);return i.data}function Le(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(s=>{if(!s.name)throw new Error('Each test in a suite must have a "name" field');if(!Array.isArray(s.statements)||s.statements.length===0)throw new Error(`Suite test "${s.name}" must have a non-empty "statements" array`);let u={name:s.name,statements:$(s.statements)};return Array.isArray(s.teardown)&&s.teardown.length>0&&(u.teardown=$(s.teardown)),s.skip!==void 0&&(u.skip=s.skip),typeof s.timeout=="number"&&(u.timeout=s.timeout),s.fail!==void 0&&(u.fail=s.fail),s.only===!0&&(u.only=!0),s.slow===!0&&(u.slow=!0),u})};Array.isArray(t.beforeAll)&&t.beforeAll.length>0&&(o.beforeAll=$(t.beforeAll)),Array.isArray(t.afterAll)&&t.afterAll.length>0&&(o.afterAll=$(t.afterAll)),Array.isArray(t.beforeEach)&&t.beforeEach.length>0&&(o.beforeEach=$(t.beforeEach)),Array.isArray(t.afterEach)&&t.afterEach.length>0&&(o.afterEach=$(t.afterEach));let a=G.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 $(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map(Ne)}function Ne(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 De(t);if("WHILE"in t)return Ce(t);if("STEP"in t)return Fe(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:(0,P.v4)(),type:"ACTION",description:`Verify: ${r}`,action_entity:{action_description:`Verify: ${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:(0,P.v4)(),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:(0,P.v4)(),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:(0,P.v4)(),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;return{uid:(0,P.v4)(),type:"ACTION",description:"Code block",action_entity:{action_description:"Code block",action_data:{action_name:"js_code",kwargs:{code:typeof r=="string"?r:String(r)}}}}}if("js"in t&&("intent"in t||"desc"in t)&&!("VERIFY"in t)){let r=t.js,i=typeof t.intent=="string"?t.intent:typeof t.desc=="string"?t.desc:"";return{uid:(0,P.v4)(),type:"ACTION",description:i,action_entity:{action_description:i,action_data:{action_name:"js_action",kwargs:{code:typeof r=="string"?r:String(r)}}}}}if("call"in t&&typeof t.call=="string"){let{call:r,...i}=t;return oe({...i,action:"function",functionName:r})}if("action"in t)return oe(t);if("intent"in t&&typeof t.intent=="string"||"desc"in t&&typeof t.desc=="string")return{uid:(0,P.v4)(),type:"DRAFT",description:typeof t.intent=="string"?t.intent:t.desc};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(t)}`)}function ae(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 De(e){let t=ae(e.IF),r=e.THEN;if(!Array.isArray(r))throw new Error("IF_ELSE requires a THEN array");let i={uid:(0,P.v4)(),type:"IF_ELSE",condition:t,then:$(r)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(i.else=$(e.ELSE)),i}function Ce(e){let t=ae(e.WHILE),r=e.DO;if(!Array.isArray(r))throw new Error("WHILE_LOOP requires a DO array");let i={uid:(0,P.v4)(),type:"WHILE_LOOP",condition:t,body:$(r)};return typeof e.timeout_ms=="number"&&(i.timeout_ms=e.timeout_ms),i}function Fe(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:(0,P.v4)(),type:"STEP",description:t,statements:$(e.statements)};return typeof e.reference_id=="number"&&(r.reference_id=e.reference_id),r}var We=new Set(["action","intent","desc","locator","xpath","use_pure_vision"]);function oe(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,c={};for(let[l,p]of Object.entries(e))We.has(l)||(c[l]=p);let s={action_description:r,action_data:{action_name:t,kwargs:Object.keys(c).length>0?c:{}}};i&&(s.locator=i),o&&(s.xpath=o);let u={uid:(0,P.v4)(),type:"ACTION",description:r,action_entity:s};return a&&(u.use_pure_vision=!0),u}var ne=require("yaml");var se=112;var He=1080-se;var le={"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 ce={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"]},N=(e,t=!1)=>{let r=["chromium"];return t&&r.push("webkit"),ce[e].map(i=>le[i]).filter(i=>i.defaultBrowserType&&r.includes(i.defaultBrowserType))};var Re={desktop:{label:"Desktop",type:"desktop",devices:N("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:N("mobile")}},ze={desktop:{label:"Desktop",type:"desktop",devices:N("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:N("mobile",!0)}};var Xe=require("yaml");var C=require("yaml");var fe=require("fs"),F=require("path"),D=require("yaml");var pe=5e3;function qe(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function Ze(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 he(e){let t=qe(e),r=e.locator;if(typeof r=="string"&&r.trim())return r=r.trim(),r.endsWith("first()")?`${t}.${r}`:`${t}.${r}.first()`;let i=Ze(e);if(i){let o=JSON.stringify(i);return`${t}.locator(${o}).first()`}return null}var T=new Map;function d(e,t){T.set(e,t)}function I(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},`),"});"]}d("click",e=>{let t=he(e);if(!t)return['await agent.execAction("click", page, {});'];let r=e.action_data?.kwargs?.timeout_ms??pe;return[`await ${t}.click({ timeout: ${r} });`]});d("click_element",T.get("click"));d("click_element_by_index",T.get("click"));d("double_click",e=>I("double_click",e));d("double_click_on_element",T.get("double_click"));d("right_click",e=>I("right_click",e));d("right_click_on_element",T.get("right_click"));d("hover",e=>I("hover",e));d("hover_element_by_index",T.get("hover"));d("input_text",e=>{let t=e.action_data?.kwargs?.text??e.action_data?.kwargs?.value??"";return I("input_text",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});d("fill",T.get("input_text"));d("clear_input",e=>I("clear_input",e));d("press",e=>{let t=e.action_data?.kwargs?.keys;return[`await page.keyboard.press(${JSON.stringify(t)});`]});d("send_keys",T.get("press"));d("send_keys_on_element",e=>{let t=he(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??pe;return[`await ${t}.press(${JSON.stringify(r)}, { timeout: ${i} });`]});d("select_dropdown_option",e=>{let t=e.action_data?.kwargs?.text||e.action_data?.kwargs?.option||"";return I("select_dropdown_option",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});d("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)})');`]});d("scroll_down",T.get("scroll"));d("scroll_up",T.get("scroll"));d("scroll_element",T.get("scroll"));d("scroll_to_text",e=>{let t=e.action_data?.kwargs?.text||"";return[`await page.getByText(${JSON.stringify(t)}, { exact: false }).first().scrollIntoViewIfNeeded();`]});d("scroll_on_element",e=>I("scroll_on_element",e,[`action_data: { kwargs: ${JSON.stringify(e.action_data?.kwargs||{})} }`]));d("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)} } },`,"});"]});d("open_tab",T.get("go_to_url"));d("go_back",()=>['await agent.execAction("go_back", page, {});']);d("reload_page",()=>['await agent.execAction("reload_page", page, {});']);d("wait",e=>[`await page.waitForTimeout(${(e.action_data?.kwargs?.seconds||1)*1e3});`]);d("wait_for_page_ready",()=>["await page.waitForLoadState('domcontentloaded');"]);d("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 c=r.code.split(`
|
|
1
|
+
"use strict";var Ae=Object.create;var F=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var Me=Object.getPrototypeOf,Ee=Object.prototype.hasOwnProperty;var Oe=(e,t)=>{for(var r in t)F(e,r,{get:t[r],enumerable:!0})},X=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $e(t))!Ee.call(e,o)&&o!==r&&F(e,o,{get:()=>t[o],enumerable:!(i=Pe(t,o))||i.enumerable});return e};var z=(e,t,r)=>(r=e!=null?Ae(Me(e)):{},X(t||!e||!e.__esModule?F(r,"default",{value:e,enumerable:!0}):r,e)),Ie=e=>X(F({},"__esModule",{value:!0}),e);var ct={};Oe(ct,{default:()=>ke});module.exports=Ie(ct);var k=z(require("fs"),1),y=z(require("path"),1);var E=(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}:i.type==="STEP"&&i.statements?E(i.statements,a,r):i.type==="IF_ELSE"?(r[a]={description:"IF "+(i.condition?.expression||""),action_entity:void 0},i.then&&E(i.then,`${a}.then`,r),i.else&&E(i.else,`${a}.else`,r)):i.type==="WHILE_LOOP"&&(r[a]={description:"WHILE "+(i.condition?.expression||""),action_entity:void 0},i.body&&E(i.body,`${a}.body`,r))})};function B(e){if(!e?.statements||!Array.isArray(e.statements))return{};let t={};return E(e.statements,"main",t),e.teardown&&Array.isArray(e.teardown)&&E(e.teardown,"teardown",t),t}var n=require("zod"),q=n.z.enum(["JS_CODE","AI_MODE"]),U=n.z.object({type:q,expression:n.z.string()}),Z=n.z.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),L=n.z.object({uid:n.z.string(),type:Z}),Q=n.z.object({action_data:n.z.object({action_name:n.z.string(),kwargs:n.z.record(n.z.any()).optional(),args:n.z.array(n.z.any()).optional()}),action_description:n.z.string().optional(),url:n.z.string().optional(),xpath:n.z.string().nullable().optional(),locator:n.z.string().nullable().optional(),css_selector:n.z.string().nullable().optional(),unique_selector:n.z.string().nullable().optional(),element_index:n.z.number().nullable().optional(),frame_path:n.z.array(n.z.any()).optional(),artifacts:n.z.record(n.z.any()).optional(),feedback:n.z.string().optional(),original_browser_use_action:n.z.any().optional()}).passthrough(),ee=L.extend({type:n.z.literal("DRAFT"),description:n.z.string()}),te=L.extend({type:n.z.literal("ACTION"),description:n.z.string(),action_entity:Q.optional(),locator:n.z.string().optional(),use_pure_vision:n.z.boolean().optional()}),A=n.z.lazy(()=>n.z.union([ee,te,L.extend({type:n.z.literal("STEP"),description:n.z.string().optional().default(""),statements:n.z.array(A),reference_id:n.z.number().optional()}),L.extend({type:n.z.literal("IF_ELSE"),description:n.z.string().optional(),condition:U,then:n.z.array(A),else:n.z.array(A).optional()}),L.extend({type:n.z.literal("WHILE_LOOP"),description:n.z.string().optional(),condition:U,body:n.z.array(A),timeout_ms:n.z.number().optional()})])),re=n.z.object({name:n.z.string(),statements:n.z.array(A),teardown:n.z.array(A).optional(),skip:n.z.union([n.z.boolean(),n.z.string()]).optional(),timeout:n.z.number().optional(),fail:n.z.union([n.z.boolean(),n.z.string()]).optional(),only:n.z.boolean().optional(),slow:n.z.boolean().optional()}),G=n.z.object({tests:n.z.array(re).min(1),beforeAll:n.z.array(A).optional(),afterAll:n.z.array(A).optional(),beforeEach:n.z.array(A).optional(),afterEach:n.z.array(A).optional()}),V=n.z.object({version:n.z.string().optional(),goal:n.z.string().optional(),url:n.z.string().optional(),baseURL:n.z.string().optional(),final_feedback:n.z.string().optional(),completed:n.z.boolean().optional(),success:n.z.boolean().optional(),statements:n.z.array(A).optional(),teardown:n.z.array(A).optional(),last_modified_at:n.z.string().optional(),testGroup:G.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"});var K=require("yaml"),P=require("uuid");function j(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(j);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]=j(a);return i}var ie=1024*1024;function O(e){if(e.length>ie)throw new Error(`YAML input too large (${e.length} bytes, max ${ie})`);let t=j((0,K.parse)(e));if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object at root level");if(t.suite)return Le(t);let r={version:"1.3.0",goal:t.goal,url:t.url,baseURL:t.base_url,statements:$(t.statements??[])};t.final_feedback&&(r.final_feedback=t.final_feedback),t.teardown&&Array.isArray(t.teardown)&&(r.teardown=$(t.teardown));let i=V.safeParse(r);if(!i.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(i.error.errors)}`);return i.data}function Le(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(s=>{if(!s.name)throw new Error('Each test in a suite must have a "name" field');if(!Array.isArray(s.statements)||s.statements.length===0)throw new Error(`Suite test "${s.name}" must have a non-empty "statements" array`);let u={name:s.name,statements:$(s.statements)};return Array.isArray(s.teardown)&&s.teardown.length>0&&(u.teardown=$(s.teardown)),s.skip!==void 0&&(u.skip=s.skip),typeof s.timeout=="number"&&(u.timeout=s.timeout),s.fail!==void 0&&(u.fail=s.fail),s.only===!0&&(u.only=!0),s.slow===!0&&(u.slow=!0),u})};Array.isArray(t.beforeAll)&&t.beforeAll.length>0&&(o.beforeAll=$(t.beforeAll)),Array.isArray(t.afterAll)&&t.afterAll.length>0&&(o.afterAll=$(t.afterAll)),Array.isArray(t.beforeEach)&&t.beforeEach.length>0&&(o.beforeEach=$(t.beforeEach)),Array.isArray(t.afterEach)&&t.afterEach.length>0&&(o.afterEach=$(t.afterEach));let a=G.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 $(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map(Ne)}function Ne(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 De(t);if("WHILE"in t)return Ce(t);if("STEP"in t)return We(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:(0,P.v4)(),type:"ACTION",description:`Verify: ${r}`,action_entity:{action_description:`Verify: ${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:(0,P.v4)(),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:(0,P.v4)(),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:(0,P.v4)(),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;return{uid:(0,P.v4)(),type:"ACTION",description:"Code block",action_entity:{action_description:"Code block",action_data:{action_name:"js_code",kwargs:{code:typeof r=="string"?r:String(r)}}}}}if("js"in t&&("intent"in t||"desc"in t)&&!("VERIFY"in t)){let r=t.js,i=typeof t.intent=="string"?t.intent:typeof t.desc=="string"?t.desc:"";return{uid:(0,P.v4)(),type:"ACTION",description:i,action_entity:{action_description:i,action_data:{action_name:"js_action",kwargs:{code:typeof r=="string"?r:String(r)}}}}}if("call"in t&&typeof t.call=="string"){let{call:r,...i}=t;return oe({...i,action:"function",functionName:r})}if("action"in t)return oe(t);if("intent"in t&&typeof t.intent=="string"||"desc"in t&&typeof t.desc=="string")return{uid:(0,P.v4)(),type:"DRAFT",description:typeof t.intent=="string"?t.intent:t.desc};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(t)}`)}function ae(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 De(e){let t=ae(e.IF),r=e.THEN;if(!Array.isArray(r))throw new Error("IF_ELSE requires a THEN array");let i={uid:(0,P.v4)(),type:"IF_ELSE",condition:t,then:$(r)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(i.else=$(e.ELSE)),i}function Ce(e){let t=ae(e.WHILE),r=e.DO;if(!Array.isArray(r))throw new Error("WHILE_LOOP requires a DO array");let i={uid:(0,P.v4)(),type:"WHILE_LOOP",condition:t,body:$(r)};return typeof e.timeout_ms=="number"&&(i.timeout_ms=e.timeout_ms),i}function We(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:(0,P.v4)(),type:"STEP",description:t,statements:$(e.statements)};return typeof e.reference_id=="number"&&(r.reference_id=e.reference_id),r}var Fe=new Set(["action","intent","desc","locator","xpath","use_pure_vision"]);function oe(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,c={};for(let[l,p]of Object.entries(e))Fe.has(l)||(c[l]=p);let s={action_description:r,action_data:{action_name:t,kwargs:Object.keys(c).length>0?c:{}}};i&&(s.locator=i),o&&(s.xpath=o);let u={uid:(0,P.v4)(),type:"ACTION",description:r,action_entity:s};return a&&(u.use_pure_vision=!0),u}var ne=require("yaml");var se=112;var He=1080-se;var le={"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 ce={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"]},N=(e,t=!1)=>{let r=["chromium"];return t&&r.push("webkit"),ce[e].map(i=>le[i]).filter(i=>i.defaultBrowserType&&r.includes(i.defaultBrowserType))};var Re={desktop:{label:"Desktop",type:"desktop",devices:N("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:N("mobile")}},ze={desktop:{label:"Desktop",type:"desktop",devices:N("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:N("mobile",!0)}};var Ye=require("yaml");var C=require("yaml");var fe=require("fs"),W=require("path"),D=require("yaml");var pe=5e3;function Xe(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function qe(e){let t=e.xpath;return typeof t=="string"&&t.trim()?!t.startsWith("xpath=")&&!t.startsWith("/")&&!t.startsWith("//")?`xpath=//${t}`:t.startsWith("xpath=")?t:`xpath=${t}`:null}function he(e){let t=Xe(e),r=e.locator;if(typeof r=="string"&&r.trim())return r=r.trim(),r.endsWith("first()")?`${t}.${r}`:`${t}.${r}.first()`;let i=qe(e);if(i){let o=JSON.stringify(i);return`${t}.locator(${o}).first()`}return null}var T=new Map;function d(e,t){T.set(e,t)}function I(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},`),"});"]}d("click",e=>{let t=he(e);if(!t)return['await agent.execAction("click", page, {});'];let r=e.action_data?.kwargs?.timeout_ms??pe;return[`await ${t}.click({ timeout: ${r} });`]});d("click_element",T.get("click"));d("click_element_by_index",T.get("click"));d("double_click",e=>I("double_click",e));d("double_click_on_element",T.get("double_click"));d("right_click",e=>I("right_click",e));d("right_click_on_element",T.get("right_click"));d("hover",e=>I("hover",e));d("hover_element_by_index",T.get("hover"));d("input_text",e=>{let t=e.action_data?.kwargs?.text??e.action_data?.kwargs?.value??"";return I("input_text",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});d("fill",T.get("input_text"));d("clear_input",e=>I("clear_input",e));d("press",e=>{let t=e.action_data?.kwargs?.keys;return[`await page.keyboard.press(${JSON.stringify(t)});`]});d("send_keys",T.get("press"));d("send_keys_on_element",e=>{let t=he(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??pe;return[`await ${t}.press(${JSON.stringify(r)}, { timeout: ${i} });`]});d("select_dropdown_option",e=>{let t=e.action_data?.kwargs?.text||e.action_data?.kwargs?.option||"";return I("select_dropdown_option",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});d("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)})');`]});d("scroll_down",T.get("scroll"));d("scroll_up",T.get("scroll"));d("scroll_element",T.get("scroll"));d("scroll_to_text",e=>{let t=e.action_data?.kwargs?.text||"";return[`await page.getByText(${JSON.stringify(t)}, { exact: false }).first().scrollIntoViewIfNeeded();`]});d("scroll_on_element",e=>I("scroll_on_element",e,[`action_data: { kwargs: ${JSON.stringify(e.action_data?.kwargs||{})} }`]));d("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)} } },`,"});"]});d("open_tab",T.get("go_to_url"));d("go_back",()=>['await agent.execAction("go_back", page, {});']);d("reload_page",()=>['await agent.execAction("reload_page", page, {});']);d("wait",e=>[`await page.waitForTimeout(${(e.action_data?.kwargs?.seconds||1)*1e3});`]);d("wait_for_page_ready",()=>["await page.waitForLoadState('domcontentloaded');"]);d("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 c=r.code.split(`
|
|
2
2
|
`),s=JSON.stringify(o);return["{ const _t = Date.now(); try {",...c.map(u=>` ${u}`),` console.log(\`[VERIFY:JS] \u2713 \${((Date.now()-_t)/1000).toFixed(1)}s: ${s}\`);`,"} 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: ${s}\`);`,` await agent.assert(page, ${s}, ${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"]});d("ai_assert",T.get("verify"));d("assert",T.get("verify"));d("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});`]});d("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"]});d("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||""}');`]});d("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"]});d("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)} } },`,"});"]});d("js_code",e=>{let t=e.action_data?.kwargs?.code;if(!t)return["// Skipping js_code: missing code"];let r=["{"],i=t.split(`
|
|
4
4
|
`);for(let o of i)r.push(` ${o}`);return r.push("}"),r});d("function",(e,t,r)=>{let i=e.action_data?.kwargs||{},o=i.functionName;if(o&&o.includes("#")){let[c,s]=o.split("#");if(c&&s){let u=c.replace(/\.(ts|js|mjs)$/,""),l=`import { ${s} } from '${u}';`;r?.imports?.add(l);let p={...i,functionName:s},h=ue(p);return h?[h.endsWith(";")?h:`${h};`]:["// Skipping function: invalid export pattern"]}}let a=ue(i);return a?[a.endsWith(";")?a:`${a};`]:["// Skipping function: missing functionName"]});d("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)} } },`,"});"]});d("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},`),"});"]});d("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} } },`,"});"]);d("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} } },`,"});"]);d("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} } },`,"});"]});d("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},`),"});"]});d("done",()=>["// Done - no action needed"]);d("js_action",e=>{let t=e.action_data?.kwargs?.code;return t?t.split(`
|
|
5
|
-
`):["// Skipping js_action: missing code"]});function ue(e){let t=e.functionName;if(!t)return null;let r=Array.isArray(e.args)?e.args.map(String):[];if(r.length===0)return`await ${t}()`;let i=["page","testContext","request","agent"],o=["undefined","null","true","false"],a=r.map(c=>i.includes(c)||o.includes(c)||/^-?\d+(\.\d+)?$/.test(c)?c:c.startsWith("$")?`agent.agentServices.readVariable('${c.substring(1)}')`:`"${c}"`);return`await ${t}(${a.join(", ")})`}var de=5;function me(e,t){let r={expandingPaths:new Set([(0,
|
|
5
|
+
`):["// Skipping js_action: missing code"]});function ue(e){let t=e.functionName;if(!t)return null;let r=Array.isArray(e.args)?e.args.map(String):[];if(r.length===0)return`await ${t}()`;let i=["page","testContext","request","agent"],o=["undefined","null","true","false"],a=r.map(c=>i.includes(c)||o.includes(c)||/^-?\d+(\.\d+)?$/.test(c)?c:c.startsWith("$")?`agent.agentServices.readVariable('${c.substring(1)}')`:`"${c}"`);return`await ${t}(${a.join(", ")})`}var de=5;function me(e,t){let r={expandingPaths:new Set([(0,W.resolve)(t)]),depth:0,referencedPaths:new Set},i={...e};Array.isArray(i.statements)&&(i.statements=M(i.statements,t,r)),Array.isArray(i.teardown)&&(i.teardown=M(i.teardown,t,r));for(let o of["beforeAll","afterAll","beforeEach","afterEach"])Array.isArray(i[o])&&(i[o]=M(i[o],t,r));return{doc:i,referencedTemplatePaths:Array.from(r.referencedPaths)}}function M(e,t,r){let i=[];for(let o of e)if(Ze(o)){let a=Qe(o,t,r);i.push(...a)}else i.push(et(o,t,r));return i}function Ze(e){return typeof e=="object"&&e!==null&&typeof e.template=="string"}function Qe(e,t,r){if(r.depth>=de)throw new Error(`Template expansion exceeded maximum depth of ${de}. Check for deeply nested or circular template references.`);let i=(0,W.resolve)((0,W.dirname)(t),e.template);if(r.expandingPaths.has(i))throw new Error(`Circular template reference detected: ${i} is already being expanded. Stack: ${Array.from(r.expandingPaths).join(" \u2192 ")} \u2192 ${i}`);r.referencedPaths.add(i);let o;try{o=(0,fe.readFileSync)(i,"utf-8")}catch(p){throw new Error(`Failed to read template file: ${i} (referenced from ${t}): ${p.message}`)}let a=(0,D.parse)(o);if(!a||typeof a!="object")throw new Error(`Invalid template file: ${i} \u2014 expected a YAML object`);let c=a.params||[],s=e.params||{};for(let p of c)if(!(p in s))throw new Error(`Template ${e.template} requires param "${p}" but it was not provided. Required params: [${c.join(", ")}]`);let u=a.statements;if(!Array.isArray(u))throw new Error(`Template ${e.template} must have a "statements" array`);if(Object.keys(s).length>0){let h=(0,D.stringify)(u);for(let[g,m]of Object.entries(s))h=h.split(`<<${g}>>`).join(String(m));u=(0,D.parse)(h)}let l={expandingPaths:new Set([...r.expandingPaths,i]),depth:r.depth+1,referencedPaths:r.referencedPaths};return M(u,i,l)}function et(e,t,r){if(typeof e!="object"||e===null)return e;let i={...e};return Array.isArray(i.statements)&&(i.statements=M(i.statements,t,r)),Array.isArray(i.THEN)&&(i.THEN=M(i.THEN,t,r)),Array.isArray(i.ELSE)&&(i.ELSE=M(i.ELSE,t,r)),Array.isArray(i.DO)&&(i.DO=M(i.DO,t,r)),i}var ge=class extends Error{constructor(e){super(e),this.name="YamlValidationError"}};function ye(e,t){let r=(0,C.parse)(e),i=r?.name,o=r?.tags,a=r?.use;if(r&&(r.name!==void 0||r.tags!==void 0||r.use!==void 0)&&(delete r.name,delete r.tags,delete r.use),r?.suite){if(r.goal||r.statements)throw new ge('YAML file cannot have both "suite" and top-level "goal"/"statements". Use either suite format or single-test format.');return rt(r,i,o,a,t)}return tt(r,i,o,a,t)}function tt(e,t,r,i,o){let a=e?.beforeEach,c=e?.afterEach,s=be(e?.parameters),u=e?.timeout,l=e?.skip,p=e?.fail,h=e?.only,g=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 ge(`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 b=me(e,o);e=b.doc,m=b.referencedTemplatePaths}let f=(0,C.stringify)(e);return{testFlow:O(f),name:t,tags:r,use:i,beforeEach:a,afterEach:c,parameters:s,timeout:u,skip:l,fail:p,only:h,slow:g,referencedTemplatePaths:m}}function rt(e,t,r,i,o){let a=e.suite;if(!Array.isArray(a.tests)||a.tests.length===0)throw new Error('Suite must have a non-empty "tests" array.');let c=a.beforeAll,s=a.afterAll,u=a.beforeEach,l=a.afterEach,p=[],h=a.tests.map(f=>{if(!f.name)throw new Error('Each test in a suite must have a "name" field.');if(!Array.isArray(f.statements)||f.statements.length===0)throw new Error(`Suite test "${f.name}" must have a non-empty "statements" array.`);let x={goal:f.name,statements:f.statements};f.teardown&&(x.teardown=f.teardown);let b=[],_=x;if(o&&typeof x=="object"){let Y=me(x,o);_=Y.doc,b=Y.referencedTemplatePaths,p.push(...b)}let v=(0,C.stringify)(_),w=O(v),Te=be(f.parameters);return{testFlow:w,name:f.name,parameters:Te,timeout:f.timeout,skip:f.skip,fail:f.fail,only:f.only,slow:f.slow}}),g=a.base_url,m=g?{...i,baseURL:g}:i;return{suite:{beforeAll:c,afterAll:s,beforeEach:u,afterEach:l,tests:h},name:t,tags:r,use:m,referencedTemplatePaths:p}}function be(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 S(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function R(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 we(e){return`passed after ${e||"?"} ${e===1?"retry":"retries"}`}function H(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 it(e){return`<span class="badge badge-${e}">${e}</span>`}function ot(e){let t=e.duration!=null?`<span class="step-duration">${R(e.duration)}</span>`:"",r=H(e.status);if(e.screenshot||e.message||e.error){let o="";e.screenshot&&(o=`<img src="${S(e.screenshot)}" alt="Step screenshot" class="step-screenshot" />`);let a="";e.error&&(a=`<div class="step-error"><pre>${S(e.error)}</pre></div>`);let c="";e.message&&!e.error&&(c=`<div class="step-message">${S(e.message)}</div>`);let s=e.status==="failure"?" open":"";return`
|
|
6
6
|
<details class="step-details step step-${e.status}"${s}>
|
|
7
7
|
<summary class="step-header">
|
|
8
8
|
${r}
|
|
9
|
-
<span class="step-id">${
|
|
10
|
-
<span class="step-description-collapsed">${
|
|
9
|
+
<span class="step-id">${S(e.stepId)}</span>
|
|
10
|
+
<span class="step-description-collapsed">${S(e.description)}</span>
|
|
11
11
|
${t}
|
|
12
12
|
</summary>
|
|
13
13
|
<div class="step-expanded">
|
|
14
14
|
${o}
|
|
15
|
-
<div class="step-description-full">${
|
|
15
|
+
<div class="step-description-full">${S(e.description)}</div>
|
|
16
16
|
${c}
|
|
17
17
|
${a}
|
|
18
18
|
</div>
|
|
@@ -20,32 +20,32 @@
|
|
|
20
20
|
<div class="step step-${e.status}">
|
|
21
21
|
<div class="step-header">
|
|
22
22
|
${r}
|
|
23
|
-
<span class="step-id">${
|
|
24
|
-
<span class="step-description">${
|
|
23
|
+
<span class="step-id">${S(e.stepId)}</span>
|
|
24
|
+
<span class="step-description">${S(e.description)}</span>
|
|
25
25
|
${t}
|
|
26
26
|
</div>
|
|
27
|
-
</div>`}function
|
|
27
|
+
</div>`}function at(e,t,r,i){let o=[];e&&o.push(`
|
|
28
28
|
<details class="artifact-section">
|
|
29
29
|
<summary class="artifact-summary">Video</summary>
|
|
30
30
|
<div class="artifact-content">
|
|
31
31
|
<div class="video-container">
|
|
32
32
|
<video controls preload="metadata" class="artifact-video">
|
|
33
|
-
<source src="${
|
|
33
|
+
<source src="${S(e)}" type="video/webm" />
|
|
34
34
|
</video>
|
|
35
35
|
<button class="enlarge-btn" onclick="openVideoOverlay(this)" title="Enlarge">⛶</button>
|
|
36
36
|
</div>
|
|
37
37
|
</div>
|
|
38
|
-
</details>`);let a=r.filter(c=>c.screenshot).map(c=>({src:c.screenshot,stepId:c.stepId,description:c.description,status:c.status,message:c.message||c.error||""}));if(a.length>0){let c=
|
|
38
|
+
</details>`);let a=r.filter(c=>c.screenshot).map(c=>({src:c.screenshot,stepId:c.stepId,description:c.description,status:c.status,message:c.message||c.error||""}));if(a.length>0){let c=S(JSON.stringify(a)),s=a.map((u,l)=>`
|
|
39
39
|
<div class="screenshot-thumb" onclick="openGalleryAt(this, ${l})" data-gallery="${c}">
|
|
40
|
-
<img src="${
|
|
41
|
-
<span class="thumb-label">${
|
|
40
|
+
<img src="${S(u.src)}" alt="${S(u.stepId)}" />
|
|
41
|
+
<span class="thumb-label">${S(u.stepId)}</span>
|
|
42
42
|
</div>`).join("");o.push(`
|
|
43
43
|
<details class="artifact-section">
|
|
44
44
|
<summary class="artifact-summary">Screenshots (${a.length})</summary>
|
|
45
45
|
<div class="artifact-content">
|
|
46
46
|
<div class="screenshot-grid">${s}</div>
|
|
47
47
|
</div>
|
|
48
|
-
</details>`)}if(t){let c=
|
|
48
|
+
</details>`)}if(t){let c=S(t);o.push(`
|
|
49
49
|
<details class="artifact-section">
|
|
50
50
|
<summary class="artifact-summary">Trace</summary>
|
|
51
51
|
<div class="artifact-content">
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
<p class="trace-hint">Run this command in your terminal to open the interactive Trace Viewer</p>
|
|
57
57
|
<p class="trace-hint"><a href="${c}" class="attachment-link" download>Download trace.zip</a></p>
|
|
58
58
|
</div>
|
|
59
|
-
</details>`)}return o.length===0?"":`<div class="test-artifacts">${o.join("")}</div>`}function ve(e,t,r,i,o){let a=e.map(
|
|
60
|
-
`),c="";t&&!e.some(u=>u.error)&&(c=`<div class="test-error"><pre>${
|
|
59
|
+
</details>`)}return o.length===0?"":`<div class="test-artifacts">${o.join("")}</div>`}function ve(e,t,r,i,o){let a=e.map(ot).join(`
|
|
60
|
+
`),c="";t&&!e.some(u=>u.error)&&(c=`<div class="test-error"><pre>${S(t)}</pre></div>`);let s=at(r,i,e,o);return`
|
|
61
61
|
${c}
|
|
62
62
|
<div class="steps-list">
|
|
63
63
|
${a||'<div class="no-steps">No YAML step details available</div>'}
|
|
64
64
|
</div>
|
|
65
|
-
${s}`}function
|
|
65
|
+
${s}`}function nt(e,t){let r=e.flaky?"flaky":e.status,i=H(r),o;if(e.flaky&&e.attempts&&e.attempts.length>1){let a=`tabs-${t}`,c=e.attempts.length,s=e.attempts.map((l,p)=>{let h=p===c-1,g=l.status==="passed"?"passed":"failed",m=`Attempt ${l.attemptNumber}`;return`<button class="attempt-tab ${h?"active":""} attempt-tab-${g}"
|
|
66
66
|
onclick="switchAttemptTab('${a}', ${p})"
|
|
67
67
|
data-tab-index="${p}">${H(g)} ${m} <span class="attempt-tab-badge badge-${g}">${l.status}</span></button>`}).join(""),u=e.attempts.map((l,p)=>{let h=p===c-1,g=ve(l.steps,l.error,l.videoPath,l.tracePath,`${t}-attempt-${p}`);return`<div class="attempt-panel ${h?"active":""}" data-panel-index="${p}">
|
|
68
68
|
<div class="attempt-meta">
|
|
@@ -81,15 +81,15 @@
|
|
|
81
81
|
<details class="test-details" ${e.status==="failed"||e.status==="timedOut"?"open":""}>
|
|
82
82
|
<summary class="test-summary test-${r}">
|
|
83
83
|
${i}
|
|
84
|
-
<span class="test-title">${
|
|
85
|
-
<span class="test-file">${
|
|
86
|
-
${
|
|
84
|
+
<span class="test-title">${S(e.title)}</span>
|
|
85
|
+
<span class="test-file">${S(e.file)}</span>
|
|
86
|
+
${it(r)}
|
|
87
87
|
<span class="test-duration">${R(e.duration)}</span>
|
|
88
88
|
</summary>
|
|
89
89
|
<div class="test-body">
|
|
90
90
|
${o}
|
|
91
91
|
</div>
|
|
92
|
-
</details>`}function _e(e){let t=e.tests.filter(s=>s.flaky).length,r=e.tests.filter(s=>s.status==="passed"&&!s.flaky).length,i=e.tests.filter(s=>s.status==="failed"||s.status==="timedOut").length,o=e.tests.filter(s=>s.status==="skipped").length,a=e.tests.length,c=e.tests.map((s,u)=>
|
|
92
|
+
</details>`}function _e(e){let t=e.tests.filter(s=>s.flaky).length,r=e.tests.filter(s=>s.status==="passed"&&!s.flaky).length,i=e.tests.filter(s=>s.status==="failed"||s.status==="timedOut").length,o=e.tests.filter(s=>s.status==="skipped").length,a=e.tests.length,c=e.tests.map((s,u)=>nt(s,u)).join(`
|
|
93
93
|
`);return`<!DOCTYPE html>
|
|
94
94
|
<html lang="en">
|
|
95
95
|
<head>
|
|
@@ -830,7 +830,7 @@
|
|
|
830
830
|
});
|
|
831
831
|
</script>
|
|
832
832
|
</body>
|
|
833
|
-
</html>`}var
|
|
833
|
+
</html>`}var st={before:0,main:1,teardown:2,after:3};function Se(e){let t=e.split(".")[0];return st[t]??1}function xe(e){return e.split(".").map(t=>{let r=Number(t);return Number.isNaN(r)?0:r})}function lt(e){return[...e].sort(([t],[r])=>{let i=Se(t),o=Se(r);if(i!==o)return i-o;let a=xe(t),c=xe(r);for(let s=0;s<Math.max(a.length,c.length);s++){let u=a[s]??-1,l=c[s]??-1;if(u!==l)return u-l}return 0})}var J=class{outputFolder;openMode;collected=[];config;constructor(t={}){this.outputFolder=t.outputFolder||"shiplight-report",this.openMode=t.open||"on-failure"}onBegin(t,r){this.config=t}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 l of this.collected){let p=l.test.titlePath().join(" > "),h=r.get(p);h||(h=[],r.set(p,h)),h.push(l)}let i=[];for(let[,l]of r.entries()){let p=l[0].test.location.file,h=[];for(let b=0;b<l.length;b++){let{test:_,result:v}=l[b],w=await this.buildReportTest(_,v,p);h.push({attemptNumber:b+1,status:v.status,duration:v.duration,steps:w.steps,error:w.error,videoPath:w.videoPath,tracePath:w.tracePath})}let g=h[h.length-1],{test:m}=l[l.length-1],f={title:m.title,file:y.relative(process.cwd(),p),status:g.status,duration:g.duration,steps:g.steps,error:g.error,videoPath:g.videoPath,tracePath:g.tracePath},x=h.some(b=>b.status==="failed"||b.status==="timedOut");h.length>1&&x&&g.status==="passed"&&(f.flaky=!0,f.retries=h.length-1,f.attempts=h),i.push(f)}let o={tests:i,totalDuration:t.duration,timestamp:new Date().toISOString()},a=y.isAbsolute(this.outputFolder)?this.outputFolder:y.join(process.cwd(),this.outputFolder);k.mkdirSync(a,{recursive:!0});let c=y.join(a,"screenshots");for(let l=0;l<o.tests.length;l++){let p=o.tests[l],h=p.attempts&&p.attempts.length>0,g=[{obj:p,prefix:h?`test-${l}-attempt-0`:`test-${l}`,screenshotSubDir:`test-${l}`}];if(p.attempts)for(let m=0;m<p.attempts.length;m++)g.push({obj:p.attempts[m],prefix:`test-${l}-attempt-${m+1}`,screenshotSubDir:`test-${l}/attempt-${m}`});for(let{obj:m,prefix:f,screenshotSubDir:x}of g){let b=y.join(c,x),_=!1;for(let v of m.steps)if(v.screenshot&&y.isAbsolute(v.screenshot))try{_||(k.mkdirSync(b,{recursive:!0}),_=!0);let w=`${v.stepId.replace(/\./g,"-")}.png`;k.copyFileSync(v.screenshot,y.join(b,w)),v.screenshot=`screenshots/${x}/${w}`}catch(w){console.warn(`[reporter] Failed to copy screenshot for ${v.stepId}:`,w)}if(m.videoPath&&y.isAbsolute(m.videoPath)){let v=y.extname(m.videoPath)||".webm",w=`${f}-video${v}`;try{k.copyFileSync(m.videoPath,y.join(a,w)),m.videoPath=w}catch{m.videoPath=void 0}}if(m.tracePath&&y.isAbsolute(m.tracePath)){let v=y.extname(m.tracePath)||".zip",w=`${f}-trace${v}`;try{k.copyFileSync(m.tracePath,y.join(a,w)),m.tracePath=w}catch{m.tracePath=void 0}}}}let s=y.join(a,"report-data.json");k.writeFileSync(s,JSON.stringify(o,null,2),"utf-8");let u=y.join(a,"index.html");if(k.writeFileSync(u,_e(o),"utf-8"),console.log(`
|
|
834
834
|
Shiplight report written to: ${u}`),this.openMode==="always"||this.openMode==="on-failure"&&t.status!=="passed")try{let l=(await import("open")).default;await l(u)}catch{}}printsToStdio(){return!1}async buildReportTest(t,r,i){let o={title:t.title,file:y.relative(process.cwd(),i),status:r.status,duration:r.duration,steps:[]};r.errors.length>0&&(o.error=r.errors.map(l=>l.message||l.stack||String(l)).join(`
|
|
835
835
|
|
|
836
|
-
`));for(let l of r.attachments)l.name==="video"&&l.path&&(o.videoPath=l.path),l.name==="trace"&&l.path&&(o.tracePath=l.path);let a=r.attachments.find(l=>l.name==="shiplight-results"),c=null;if(a)try{if(a.body)c=JSON.parse(a.body.toString("utf-8"));else if(a.path){let l=k.readFileSync(a.path,"utf-8");c=JSON.parse(l)}}catch{}let s=i.replace(/\.yaml\.spec\.ts$/,".test.yaml"),u={};if(k.existsSync(s))try{let l=k.readFileSync(s,"utf-8"),p=ye(l,s);if(p.suite){let h=p.suite.tests.find(g=>g.name===t.title);h&&(u=B(h.testFlow))}else p.testFlow&&(u=B(p.testFlow))}catch{}if(c||Object.keys(u).length>0){let l=new Set([...Object.keys(u),...Object.keys(c||{})]),p=Array.from(l).map(g=>[g,null]),h=
|
|
836
|
+
`));for(let l of r.attachments)l.name==="video"&&l.path&&(o.videoPath=l.path),l.name==="trace"&&l.path&&(o.tracePath=l.path);let a=r.attachments.find(l=>l.name==="shiplight-results"),c=null;if(a)try{if(a.body)c=JSON.parse(a.body.toString("utf-8"));else if(a.path){let l=k.readFileSync(a.path,"utf-8");c=JSON.parse(l)}}catch{}let s=i.replace(/\.yaml\.spec\.ts$/,".test.yaml"),u={};if(k.existsSync(s))try{let l=k.readFileSync(s,"utf-8"),p=ye(l,s);if(p.suite){let h=p.suite.tests.find(g=>g.name===t.title);h&&(u=B(h.testFlow))}else p.testFlow&&(u=B(p.testFlow))}catch{}if(c||Object.keys(u).length>0){let l=new Set([...Object.keys(u),...Object.keys(c||{})]),p=Array.from(l).map(g=>[g,null]),h=lt(p);for(let[g]of h){let m=u[g],f=c?.[g],x=m?.description;if(!x||x==="Action"||x==="Draft"){let _=m?.action_entity;x=_?.action_description||_?.action_data?.kwargs?.description||f?.description||g}let b={stepId:g,description:x,status:f?.status||"pending",duration:f?.duration};if(f?.message){let _=typeof f.message=="string"?f.message:JSON.stringify(f.message,null,2);f.status==="failure"?b.error=_:b.message=_}if(f?.screenshot){let _=f.screenshot,v=a?.path?y.dirname(a.path):"",w=y.isAbsolute(_)?_:y.join(v,_);k.existsSync(w)&&(b.screenshot=w)}o.steps.push(b)}}return o}},ke=J;
|