@taqwright/lime-cli 0.34.0 → 0.35.0

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/README.md CHANGED
@@ -520,8 +520,9 @@ lime-cli scenarios import # dry run of docs/e2e-flows.csv
520
520
  lime-cli scenarios import --sync --yes # apply; retire flows the file no longer lists
521
521
  ```
522
522
 
523
- `import` reads the plan by its column names (`id, flow, covers, feature, persona, steps,
524
- expected, platforms`), always shows LIME's dry run first, and changes the board only with
523
+ `import` reads the plan by its column names (`id, flow, covers, feature, persona, runs_after,
524
+ steps, expected, platforms`; `runs_after` lists the ids of the flows a flow starts after, which
525
+ the board draws as arrows), always shows LIME's dry run first, and changes the board only with
525
526
  `--yes`. A flow keeps its card across imports by its id. `--sync` retires flows the file no
526
527
  longer lists (hidden, history kept, back if the id returns) and refuses to retire more than a
527
528
  third of the plan unless `--force`. To keep the board in step with the repo, run it on every
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var O=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var At=O((ih,ri)=>{ri.exports={name:"@taqwright/lime-cli",version:"0.34.0",description:"Thin CLI client for the LIME server \u2014 fire a natural-language QA Agent goal against a connected device and write back a taqwright spec.",license:"SEE LICENSE IN LICENSE",author:"Taqwright",homepage:"https://www.taqwright.ai",bugs:{url:"https://www.taqwright.ai/contact"},keywords:["appium","mobile-testing","e2e","qa","test-automation","taqwright","lime","cli"],bin:{"lime-cli":"dist/index.js"},main:"dist/index.js",files:["dist"],publishConfig:{access:"public"},scripts:{"lime-cli":"node src/index.js",start:"node src/index.js",test:"node --test test/*.test.js",bundle:"esbuild src/index.js --bundle --platform=node --target=node18 --minify --outfile=dist/index.js",prepack:"npm run bundle",prepublishOnly:"npm test"},engines:{node:">=18"},devDependencies:{esbuild:"^0.28.1"}}});var he=O((ah,bn)=>{"use strict";var oi="https://www.taqwright.ai",ii=[1e3,2e3,4e3,8e3,15e3,3e4,45e3],ai=4;bn.exports={POLL_INTERVAL_MS:1e3,POLL_TIMEOUT_MS:18e5,POLL_RETRY_DELAYS_MS:ii,BOOT_POLL_INTERVAL_MS:5e3,BOOT_TIMEOUT_MS:3e5,CONNECT_POLL_INTERVAL_MS:2e3,CONNECT_TIMEOUT_MS:3e5,DEFAULT_SERVER:oi,HTTP_TIMEOUT_MS:3e5,MAX_RESPONSE_BYTES:52428800,EXIT_LOST_CONTACT:ai}});var Se=O((ch,Tn)=>{"use strict";var{URL:ci}=require("url"),{HTTP_TIMEOUT_MS:Sn,MAX_RESPONSE_BYTES:En}=he(),{version:li}=At();function vn(e){let t=String(e||"").replace(/^\[|\]$/g,"").toLowerCase();return t==="localhost"||t==="127.0.0.1"||t==="::1"||t.endsWith(".localhost")}var ui=["just a moment","attention required! | cloudflare","checking your browser","/cdn-cgi/challenge-platform","cf-error-details","cf-browser-verification","_incapsula_resource"];function kn(e,t){if(!t||typeof t!="string")return null;let n=t.slice(0,4e3).toLowerCase();return ui.some(s=>n.includes(s))?`the LIME server is behind a bot challenge that blocked this request (HTTP ${e}). The request never reached LIME \u2014 it was stopped at the edge, so your token and arguments are probably fine. CI runners use datacenter IPs, which Cloudflare's Bot Fight Mode challenges by default; it cannot be excepted with a WAF skip rule, so the server's operator has to turn it off or move to Super Bot Fight Mode (which supports skip rules) for the /api/ paths.`:null}var It=class{constructor(t,n){this.server=t,this.token=n,this.update=null}_url(t){return/^https?:\/\//i.test(t)?t:`${this.server}${t}`}json(t,n,s,r={}){let o=s?JSON.stringify(s):null,i={...r};return o&&(i["Content-Type"]="application/json",i["Content-Length"]=Buffer.byteLength(o)),this._send(t,this._url(n),i,o)}raw(t,n,s,r={}){let o={...r,"Content-Type":"application/octet-stream","Content-Length":s.length};return this._send(t,this._url(n),o,s)}_send(t,n,s,r){let o=new ci(n);if(o.protocol==="http:"&&!vn(o.hostname))return Promise.reject(new Error(`refusing to send your LIME_CI_TOKEN over cleartext http to ${o.hostname} \u2014 use https (http is allowed only for localhost).`));let i=o.protocol==="https:"?require("https"):require("http"),a={method:t,hostname:o.hostname,port:o.port||(o.protocol==="https:"?443:80),path:o.pathname+(o.search||""),headers:{...s,Authorization:`Bearer ${this.token}`,Origin:`${o.protocol}//${o.host}`,"X-Lime-Cli-Version":li}};return new Promise((c,u)=>{let l=i.request(a,d=>{let p=d.headers["x-lime-cli-update"];p&&(this.update={status:String(p),latest:d.headers["x-lime-cli-latest"]||null});let h="",m=0;d.setEncoding("utf8"),d.on("data",g=>{if(m+=Buffer.byteLength(g),m>En){l.destroy(new Error(`Server response exceeded ${En} bytes`));return}h+=g}),d.on("end",()=>{let g;try{g=h?JSON.parse(h):{}}catch{let b=kn(d.statusCode,h),y=new Error(b||`Server returned non-JSON (${d.statusCode}): ${h.substring(0,200)}`);return y.status=d.statusCode,b?y.edgeBlock=!0:/^\s*error code:\s*\d{3,4}\s*$/i.test(h)&&(y.edgeError=!0),u(y)}c({status:d.statusCode,body:g})})});l.setTimeout(Sn,()=>{let d=new Error(`request timed out after ${Sn/1e3}s`);d.code="ETIMEDOUT",l.destroy(d)}),l.on("error",u),r&&l.write(r),l.end()})}};function di(e,t){if(!e.body||!e.body.success)throw new Error(`${t} \u2014 ${e.body&&e.body.error||"unknown"}`);return e.body}var pi=new Set(["ECONNRESET","ECONNREFUSED","ECONNABORTED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH","ENETDOWN"]),hi=new Set([502,503,504,520,521,522,523,524]);function fi(e){return!e||e.edgeBlock?!1:e.edgeError||e.code&&pi.has(e.code)?!0:hi.has(e.status)}Tn.exports={isLoopbackHost:vn,HttpClient:It,expectSuccess:di,describeEdgeBlock:kn,isTransientNetworkError:fi}});var le=O((lh,An)=>{"use strict";var mi=require("fs"),gi=require("path"),jt="lime.json";function $n(e){let t;try{t=mi.readFileSync(gi.join(e,jt),"utf8")}catch{return{pageObjects:!0,declared:!1}}let n;try{n=JSON.parse(t)}catch(s){return{pageObjects:!0,declared:!1,error:`${jt} could not be read (${s.message}); using the defaults`}}return{pageObjects:!(n&&n.pageObjects===!1),declared:!0,...n&&typeof n.project=="string"&&n.project.trim()?{project:n.project.trim()}:{},...n&&n.locatorHelpers&&typeof n.locatorHelpers=="object"?{locatorHelpers:n.locatorHelpers}:{},...n&&typeof n.testCasePlan=="string"&&n.testCasePlan.trim()?{testCasePlan:n.testCasePlan.trim()}:{},...n&&typeof n.testCaseId=="string"&&n.testCaseId.trim()?{testCaseId:n.testCaseId.trim()}:{}}}function wi(e,t){return e&&e.project!==void 0?e.project:$n(t).project}An.exports={readProjectSettings:$n,projectDefault:wi,PROJECT_SETTINGS_FILE:jt}});var jn=O((uh,In)=>{"use strict";var _t="npm install -g @taqwright/lime-cli@latest",yi=/^\d+\.\d+\.\d+([-.+][0-9A-Za-z.-]{1,20})?$/;function bi({status:e,current:t,latest:n,env:s=process.env}){return s.LIME_NO_UPDATE_NOTICE==="1"?null:e==="required"?`lime-cli: ${t} is no longer supported by this server. Run: ${_t}`:e==="available"&&typeof n=="string"&&yi.test(n)?`lime-cli: update available: ${t} \u2192 ${n}. Run: ${_t}`:null}In.exports={formatUpdateNotice:bi,INSTALL_COMMAND:_t}});var Ee=O((dh,_n)=>{"use strict";var Si={browserstack:{label:"BrowserStack",envUsername:"BROWSERSTACK_USERNAME",envAccessKey:"BROWSERSTACK_ACCESS_KEY",hubHost:"hub.browserstack.com"},lambdatest:{label:"LambdaTest",envUsername:"LT_USERNAME",envAccessKey:"LT_ACCESS_KEY",hubHost:"mobile-hub.lambdatest.com"}};function Ei({provider:e,platform:t,device:n,os:s,appUrl:r,username:o,accessKey:i,capabilities:a}){let c={connectionMode:"cloud",cloudProvider:e||"browserstack",cloudUsername:o,cloudAccessKey:i,platform:t,deviceName:n,deviceOsVersion:s,cloudAppUrl:r,automationName:t==="ios"?"XCUITest":"UiAutomator2"};return a&&(c.cloudCapabilities=a),c}_n.exports={CLOUD_PROVIDERS:Si,buildCloudSettingsPayload:Ei}});var ie=O((ph,xn)=>{"use strict";var Qe=require("fs"),Ot=require("path"),On=["taqwright","webdriverio-js","appium-java-junit5","appium-java-cucumber","appium-python-pytest","appium-ruby-rspec","appium-csharp-nunit"],vi={taqwright:"deterministic","webdriverio-js":"gemini","appium-java-junit5":"gemini","appium-java-cucumber":"gemini","appium-python-pytest":"gemini","appium-ruby-rspec":"gemini","appium-csharp-nunit":"gemini"},ue={taqwright:"taqwright (native)","webdriverio-js":"WebdriverIO (JavaScript)","appium-java-junit5":"Appium Java (JUnit 5)","appium-java-cucumber":"Appium Java (Cucumber)","appium-python-pytest":"Appium Python (pytest)","appium-ruby-rspec":"Appium Ruby (RSpec)","appium-csharp-nunit":"Appium C# (NUnit)"},ki=5*1024*1024,et={exists:e=>Qe.existsSync(e),readText:e=>{try{return Qe.statSync(e).size>ki?null:Qe.readFileSync(e,"utf8")}catch{return null}},list:e=>{try{return Qe.readdirSync(e)}catch{return[]}}};function Ti(e,t){let n=e.readText(Ot.join(t,"package.json"));if(!n)return{};try{let s=JSON.parse(n);return{...s.dependencies||{},...s.devDependencies||{}}}catch{return{}}}var $i=new Set(["node_modules","dist","build","target","bin","obj","vendor","out","coverage"]);function Ai(e,t){let n=new Set([""]),s=[];try{s=e.list(t)}catch{s=[]}for(let r of s)r.startsWith(".")||$i.has(r)||n.add(r);return[...n]}function Ii(e,t,n){let s=n?Ot.join(t,n):t,r=d=>Ot.join(s,d),o=d=>n?`${n}/${d}`:d,i=[],a=Ti(e,s),c=[];try{c=e.list(s)}catch{c=[]}(a["@taqwright/taqwright"]||a.taqwright||e.exists(r("taqwright.config.ts"))||e.exists(r("taqwright.config.js")))&&i.push({id:"taqwright",label:ue.taqwright,reason:"taqwright dependency/config found",manifest:o("package.json")});let u=c.some(d=>/^wdio\.conf\.(js|ts|mjs|cjs)$/.test(d));(a.webdriverio||a["@wdio/cli"]||u)&&i.push({id:"webdriverio-js",label:ue["webdriverio-js"],reason:u?"wdio.conf.* found":"webdriverio dependency found",manifest:o("package.json")});for(let d of["pom.xml","build.gradle","build.gradle.kts"]){let p=e.readText(r(d));if(p&&/io\.appium|java-client/.test(p)){let h=/io\.cucumber/.test(p),m=h?"appium-java-cucumber":"appium-java-junit5";i.push({id:m,label:ue[m],reason:h?`io.appium:java-client and io.cucumber in ${o(d)}`:`io.appium:java-client in ${o(d)}`,manifest:o(d)});break}}for(let d of["requirements.txt","pyproject.toml"]){let p=e.readText(r(d));if(p&&/appium-python-client/i.test(p)){i.push({id:"appium-python-pytest",label:ue["appium-python-pytest"],reason:`Appium-Python-Client in ${o(d)}`,manifest:o(d)});break}}let l=e.readText(r("Gemfile"));l&&/appium_lib(_core)?/.test(l)&&i.push({id:"appium-ruby-rspec",label:ue["appium-ruby-rspec"],reason:"appium_lib in Gemfile",manifest:o("Gemfile")});for(let d of c){if(!/\.csproj$/i.test(d))continue;let p=e.readText(r(d));if(p&&/Appium\.WebDriver/i.test(p)){i.push({id:"appium-csharp-nunit",label:ue["appium-csharp-nunit"],reason:`Appium.WebDriver in ${o(d)}`,manifest:o(d)});break}}return i}function Rn(e,t=et){let n=new Map;for(let s of Ai(t,e))for(let r of Ii(t,e,s))n.has(r.id)||n.set(r.id,r);return[...n.values()]}function Nn(e,t=et){let n=Rn(e,t);return n.some(s=>s.id==="taqwright")||n.push({id:"taqwright",label:ue.taqwright,reason:"default output"}),n}function Cn(e){let{requested:t,configured:n,remembered:s,offeredIds:r,detectedRealIds:o,taqwrightDetected:i,javaSignal:a}=e,c=u=>!!u&&r.includes(u);return c(t)?t:c(n)?n:c(s)&&(o.includes(s)||s==="taqwright"&&i)?s:o.length?o[0]:i?"taqwright":a?"appium-java-junit5":"taqwright"}function ji(e,t=et){let n=Nn(e,t);return Cn({offeredIds:On,detectedRealIds:n.filter(s=>s.id!=="taqwright").map(s=>s.id),taqwrightDetected:n.some(s=>s.id==="taqwright"&&!/default output/.test(s.reason)),javaSignal:!1})}xn.exports={detectRepoFramework:ji,FRAMEWORK_IDS:On,FRAMEWORK_ENGINES:vi,FRAMEWORK_LABELS:ue,nodeFs:et,detectFrameworks:Rn,rankFrameworks:Nn,pickDefaultFramework:Cn}});var tt=O((hh,Un)=>{"use strict";var De=require("path"),{nodeFs:_i}=ie(),Pn={taqwright:"tests","webdriverio-js":"test/specs","appium-java-junit5":"src/test/java","appium-java-cucumber":"src/test/resources/features","appium-python-pytest":"tests","appium-ruby-rspec":"spec","appium-csharp-nunit":"Tests"},Oi="tests",Ri={taqwright:".spec.ts","webdriverio-js":".spec.ts","appium-java-junit5":".java","appium-java-cucumber":".feature","appium-python-pytest":".py","appium-ruby-rspec":"_spec.rb","appium-csharp-nunit":".cs"},Ni=new Set(["appium-python-pytest","appium-ruby-rspec","appium-java-cucumber"]);function Rt(e){return Pn[e]||Oi}function Nt(e){let t=(e||"").split(/[^A-Za-z0-9]+/).filter(Boolean);return t.length?t.map(n=>/^[A-Z0-9]+$/.test(n)?n[0]+n.slice(1).toLowerCase():n[0].toUpperCase()+n.slice(1)).join(""):""}function Ct(e){return(e||"").replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").split(/[^A-Za-z0-9]+/).filter(Boolean).join("_").toLowerCase()}function Ci(e){return Ct(e).split("_").filter(Boolean).join("-")}var xi=6,Li=new Set(["and","or","the","a","an","to","of","in","on","at","as","with","for","then","into","from","by","that","is"]),Pi=/@|\d{6,}/;function Mi(e){let t=String(e||"").trim().split(/\s+/).filter(Boolean).filter(n=>!Pi.test(n)).slice(0,xi);for(;t.length>1&&Li.has(t[t.length-1].toLowerCase());)t.pop();return Nt(t.join(" "))||"RecordedTest"}function Di(e){let t=String(e||"").trim();return t?/[A-Za-z]/.test(t)?t.length>80?"Keep the name under 80 characters.":/[/\\]/.test(t)?"Use the destination field for the folder.":null:"Use at least one letter.":"Enter a test name."}function qi(e){if(e==null||e==="")return null;let t=String(e);return t!==t.trim()?"must not have leading or trailing spaces.":t.length>120?"is longer than any key LIME mints (120 characters).":/^[a-z0-9][a-z0-9._/:-]*$/.test(t)?t.includes("..")?'must not contain "..".':null:"is not a scenario key \u2014 expected lower-case letters, digits and . _ - / : only."}function Mn(e,t){let n;return Ni.has(e)?n=Ct(t):n=Nt(t),`${n}${Ri[e]||""}`}function qe(e){return String(e||"").split(/[/\\]+/).filter(t=>t&&t!=="."&&t!=="..").join("/")}function Ui(e){if(e==null)return null;let t=String(e);return t.trim()===""?null:/^([A-Za-z]:)?[/\\]/.test(t)?"must be a path inside the project, not an absolute path.":t.split(/[/\\]+/).includes("..")?'must not contain ".." \u2014 the test belongs inside the project.':null}function xt(e){let t=qe(e).split("/");return t.pop(),t.join("/")}function Dn(e){let t=/(?:^|\/)src\/(?:test|main)\/java\/(.+)$/.exec(qe(e));return t&&t[1].split("/").filter(Boolean).join(".")||void 0}function Fi(e){let t=qe(e),n=t.search(/\/src\/(?:test|main)\/java(?:\/|$)/);return n>0?t.slice(0,n):""}function Bi(e){let t=new Map;for(let s of e){let r=xt(s);t.set(r,(t.get(r)||0)+1)}if(!t.size)return null;let n=[...t.entries()].sort((s,r)=>r[1]-s[1]||s[0].localeCompare(r[0]));return{dir:n[0][0],count:n[0][1]}}var qn={taqwright:{segment:"tests",file:/\.spec\.(ts|js)$/},"webdriverio-js":{segment:"test/specs",file:/\.(ts|js)$/},"appium-java-junit5":{segment:"src/test/java",file:/\.java$/},"appium-java-cucumber":{segment:"",file:/\.feature$/},"appium-python-pytest":{segment:"tests",file:/^(test_.+|.+_test)\.py$/},"appium-ruby-rspec":{segment:"spec",file:/_spec\.rb$/},"appium-csharp-nunit":{segment:"",file:/Tests\.cs$/}},Hi=/@(?:org\.junit(?:\.jupiter\.api)?\.)?(?:Test|ParameterizedTest|RepeatedTest|TestFactory|TestTemplate)\b/,Ki=/^(?:Test\w*|\w*(?:Test|Tests|TestCase))\.java$/;function Wi(e,t,n){let s=n.readText?n.readText(e):null;return typeof s=="string"?Hi.test(s):Ki.test(t)}var Vi=new Set(["node_modules","dist","build","target","bin","obj","vendor","out","coverage",".git"]),Gi=2e4;function Yi(e,t,n=_i){let s=qn[t];if(!s)return[];let r=[],o=Gi,i=a=>{if(o<=0)return;let c=a?De.join(e,a):e,u=[];try{u=n.list(c)}catch{return}for(let l of u){if(o--<=0)return;if(l.startsWith(".")||Vi.has(l))continue;let d=a?`${a}/${l}`:l;if(n.isDir?n.isDir(De.join(e,d)):n.list(De.join(e,d)).length>0){i(d);continue}s.file.test(l)&&(s.segment&&!`/${xt(d)}/`.includes(`/${s.segment}/`)||t==="appium-java-junit5"&&!Wi(De.join(e,d),l,n)||r.push(d))}};return i(""),r.sort()}var Ln=["TestCase","Tests","Test","IT"];function Ji(e,t,n){if(e!=="appium-java-junit5"||!t||(t=t[0].toUpperCase()+t.slice(1),/^Test[A-Z0-9_]/.test(t)||Ln.some(o=>t.endsWith(o))))return t;let s=new Map;for(let o of n||[]){let i=De.posix.basename(String(o)).replace(/\.java$/,""),a=Ln.find(c=>i.endsWith(c));a&&s.set(a,(s.get(a)||0)+1)}let r=[...s.entries()].sort((o,i)=>i[1]-o[1]||(o[0]==="Test"?-1:i[0]==="Test"?1:0));return t+(r.length?r[0][0]:"Test")}function zi(e){let{framework:t,testName:n}=e,s=Mn(t,n),r=(a,c,u=0)=>{let l=qe(a),d=t==="appium-java-junit5"?Dn(l):void 0;return{dir:l,fileName:s,...d?{packageName:d}:{},source:c,neighbourCount:u}};if(e.remembered!=null)return r(e.remembered,"remembered");let o=Bi(e.existingTests||[]);if(o&&o.dir)return r(o.dir,"existing",o.count);let i=e.detection&&e.detection.manifest?xt(e.detection.manifest):"";return i?r(`${i}/${Rt(t)}`,"module"):r(Rt(t),"convention")}Un.exports={CONVENTIONAL_DIRS:Pn,TEST_PATTERNS:qn,conventionalDir:Rt,pascalCase:Nt,snakeCase:Ct,kebabCase:Ci,testNameFromGoal:Mi,validateTestName:Di,validateDest:Ui,validateScenarioKey:qi,fileNameFor:Mn,normalizeDir:qe,javaPackageOf:Dn,moduleRootOf:Fi,findExistingTests:Yi,resolveExportTarget:zi,conventionalTestName:Ji}});var Lt=O((fh,Hn)=>{"use strict";var{CLOUD_PROVIDERS:nt}=Ee(),{validateScenarioKey:Xi}=tt();function Zi(e){let t=Object.create(null);for(let n=0;n<e.length;n++){let s=e[n];if(!s.startsWith("--"))continue;let r=s.slice(2),o=e[n+1];o===void 0||o.startsWith("--")?t[r]=!0:(t[r]=o,n++)}return t}var Bn=["export","adapt","verify","check","check-locators","check-pom","disconnect","report","doctor","init","pr","hooks","scenarios"];function Qi(e){let t=Array.isArray(e)?e:[],n=[];for(let s=0;s<t.length;s+=1){let r=String(t[s]==null?"":t[s]);!r||r.startsWith("-")||(s>0?String(t[s-1]||""):"").startsWith("--")||n.push(r)}return n}function ea(e){let t=e[0];return t&&Bn.includes(t)?{command:t,rest:e.slice(1)}:{command:"run",rest:e}}function ta(e="taqwright"){return e==="json"?"recorded-steps.json":"RecordedTest.spec.ts"}function na(e,t=process.env){let n=[],s=!!e["list-devices"],r=!!e["keep-session"],o=!!e["no-boot"],i=e["lime-dir"]===!0?".lime":typeof e["lime-dir"]=="string"&&e["lime-dir"].trim()?e["lime-dir"].trim():void 0,a=e.format?String(e.format).toLowerCase():"taqwright";if(["taqwright","json"].includes(a)||n.push(`--format must be taqwright or json (got "${e.format}")`),s)return{errors:n,listDevices:s,keepSession:r,noBoot:o,format:a,limeDir:i};(!e.goal||typeof e.goal!="string"||!e.goal.trim())&&n.push("--goal is required");let c;e.project!==void 0&&(typeof e.project!="string"||!e.project.trim()?n.push("--project requires a project name"):c=e.project.trim());let u;if(e.scenario!==void 0){let w=typeof e.scenario=="string"?e.scenario.trim():"",S=w?Xi(w):"requires a scenario key";S?n.push(`--scenario ${S}`):u=w}for(let w of["gemini-key","qwen-key"])e[w]!==void 0&&n.push(`--${w} is no longer supported: runs use the AI key provisioned for your LIME account`);if(e["max-steps"]!==void 0){let w=Number(e["max-steps"]);(!Number.isFinite(w)||w<1||w>200)&&n.push("--max-steps must be a number between 1 and 200")}let l;e.platform&&(l=String(e.platform).toLowerCase(),["android","ios"].includes(l)||n.push(`--platform must be android or ios (got "${e.platform}")`));let d=!!e.cloud,p=typeof e.os=="string"?e.os:void 0,h=typeof e["app-url"]=="string"?e["app-url"]:void 0,m=typeof e.app=="string"?e.app:void 0,g=typeof e.caps=="string"&&e.caps.trim()?e.caps.trim():void 0,f,b,y;if(d&&(f=e.cloud===!0?"browserstack":String(e.cloud).toLowerCase(),nt[f]||n.push(`--cloud must be ${Object.keys(nt).join(" or ")} (got "${e.cloud}")`)),d){(!e.device||typeof e.device!="string")&&n.push('--cloud requires --device (the cloud device name, e.g. "Google Pixel 8")'),l||n.push("--cloud requires --platform (android or ios)"),p||n.push("--cloud requires --os (the device OS version, e.g. 14.0)"),m?n.push("--app is not supported for cloud runs. Upload the build to your provider \u2014 LambdaTest: POST https://manual-api.lambdatest.com/app/upload/realDevice (-F appFile=@<file>), BrowserStack: POST https://api-cloud.browserstack.com/app-automate/upload (-F file=@<file>) \u2014 then pass the returned id with --app-url. (--app is still supported for local runs, where it clean-reinstalls on the agent device.)"):h||n.push("--cloud requires --app-url <bs://\u2026 | lt://\u2026> (the id from your provider\u2019s app upload API)"),e["app-url"]!==void 0&&(typeof e["app-url"]!="string"||!e["app-url"].trim())&&n.push("--app-url requires a bs:// or lt:// app id"),h&&nt[f]&&(f==="browserstack"&&h.startsWith("lt://")?n.push(`--app-url "${h}" is a LambdaTest app id, but the provider is browserstack`):f==="lambdatest"&&h.startsWith("bs://")&&n.push(`--app-url "${h}" is a BrowserStack app id, but the provider is lambdatest`)),e["cloud-username"]!==void 0&&(typeof e["cloud-username"]!="string"||!e["cloud-username"].trim())&&n.push("--cloud-username requires a value"),e["cloud-access-key"]!==void 0&&(typeof e["cloud-access-key"]!="string"||!e["cloud-access-key"].trim())&&n.push("--cloud-access-key requires a value"),e.caps!==void 0&&(typeof e.caps!="string"||!e.caps.trim())&&n.push("--caps requires a path to a JSON file");let w=nt[f];w&&(b=typeof e["cloud-username"]=="string"&&e["cloud-username"].trim()||t[w.envUsername]||void 0,y=typeof e["cloud-access-key"]=="string"&&e["cloud-access-key"].trim()||t[w.envAccessKey]||void 0,b||n.push(`cloud runs require a username \u2014 pass --cloud-username or set ${w.envUsername} (credentials are never read from your LIME account for CLI runs)`),y||n.push(`cloud runs require an access key \u2014 pass --cloud-access-key or set ${w.envAccessKey}`))}else e.app!==void 0&&(typeof e.app!="string"||!e.app.trim()?n.push("--app requires a path to an APK"):e.device?l&&l!=="android"&&n.push("--app is Android only"):n.push("--app requires --device (lime-cli must connect to a device to reinstall the app)")),e["app-url"]!==void 0&&n.push("--app-url requires --cloud"),e.os!==void 0&&n.push("--os requires --cloud"),e["cloud-username"]!==void 0&&n.push("--cloud-username requires --cloud"),e["cloud-access-key"]!==void 0&&n.push("--cloud-access-key requires --cloud"),e.caps!==void 0&&n.push("--caps requires --cloud");return{errors:n,listDevices:s,keepSession:r,noBoot:o,limeDir:i,device:e.device,platform:l,projectName:c,scenarioKey:u,app:m,cloud:d,cloudProvider:f,cloudUsername:b,cloudAccessKey:y,os:p,appUrl:h,capsPath:g,format:a}}var Fn=["browserstack","lambdatest","appium"];function sa(e){let t=[],n=[];for(let[s,r]of Object.entries(e||{}))!r||typeof r!="object"||Array.isArray(r)?t.push(`--caps block "${s}" must be a JSON object, e.g. { "${s}": { "someCap": true } }`):Fn.includes(s)||n.push(`--caps block "${s}" is not one of ${Fn.join("/")} \u2014 it will be ignored (typo?)`);return{errors:t,warnings:n}}Hn.exports={parseArgs:Zi,parseCommand:ea,positionalPaths:Qi,validateArgs:na,extToFilename:ta,validateCapsObject:sa,COMMANDS:Bn}});var Mt=O((mh,Xn)=>{"use strict";var ra=".lime/ADAPT.md",Ue=".lime/recorded-steps.json",oa=".lime/VERIFY.md",Kn=".lime/verify-target.json",Wn="docs/app-flows",rt="LIME_VERIFY_RESULT";function Pt(e){let t=(e||"").trim().toLowerCase();return t?t.includes("android")?"android":t.includes("ios")||t.includes("iphone")||t.includes("ipad")?"ios":"":""}function ia(e){let{frameworkLabel:t,framework:n,testName:s,destination:r,goal:o,recordedPlatform:i,hasAppDocs:a,scenarioKey:c,flatSpecs:u,cucumber:l,fileName:d,locatorHelpers:p,otherRecording:h}=e,m=(n||"").toLowerCase()==="appium-java-cucumber",g=Pt(i),f=g==="android"?"iOS":g==="ios"?"Android":"",b=(n||"").toLowerCase()==="taqwright"||String(t||"").toLowerCase()==="taqwright",y=['## Visual verification steps (verb "VISUAL_VERIFY")','- A recorded step with `verb: "VISUAL_VERIFY"` is an Applitools Eyes VISUAL CHECKPOINT; its name'," is `visual.name` (or `target`). It performs a real baseline comparison. Do NOT replace it with"," `mobile.screenshot()` + `testInfo.attach(...)`, a `toBeVisible(...)` assertion, or any other"," stand-in, and never drop it.",b?"- Render each one, at that point in the flow (spec-level, NOT a page-object method):":"- Render it with the project's configured visual-testing SDK, using the checkpoint name. If the",b?" `await eyes.check('<name>', Target.image(await mobile.screenshot()));`":" project has no visual-testing tool configured, capture a screenshot named `<name>` as the",b?" When ANY step is VISUAL_VERIFY, wrap the test body in the Eyes lifecycle:":" checkpoint and note it in the summary. Never silently drop the checkpoint.",b?" - import: `import { Eyes, Target } from '@applitools/eyes-images';`":null,b?` - at the start: \`const eyes = new Eyes(); eyes.setApiKey(process.env.APPLITOOLS_API_KEY || ''); await eyes.open('<app>', '${s}');\``:null,b?" - wrap the flow in `try { ... } finally { await eyes.close(false); }` (close(false) reports a mismatch without failing the run).":null,b?" Do NOT use `mobile.visuallyVerify(...)`: that API was removed. Use the Eyes SDK above.":null],w=b?["## The taqwright API \u2014 use ONLY what is listed here","- DO NOT INVENT A METHOD. If the thing you want is not on this page, use the closest"," one that is and say so in your summary. A method that does not exist fails at"," runtime on a real device, minutes into a billed session.","- The test fixture is `mobile`, NOT `page`: `test('...', async ({ mobile }) => { ... })`."," There is no `page` fixture.","- `rawDriver` (the underlying WebdriverIO client) is a SEPARATE FIXTURE, destructured"," beside `mobile`: `async ({ mobile, rawDriver }) => { ... }`. There is no"," `mobile.rawDriver` \u2014 it does not compile. You almost never need it: reach for it only"," when nothing on this page can express the step.","- Import from '@taqwright/taqwright': `test`, `expect`, and the types `Mobile` and `Locator`.","","### Finding elements (all on `mobile`, all return a Locator)"," getByText, getByLabel, getById, getByTestId, getByPlaceholder, getByRole, getByType,"," getByXpath, getByCss, getByUiSelector (Android only), getByPredicate (iOS only),"," getByClassChain (iOS only)","- `getByLabel(x)` is the ACCESSIBILITY ID / content-desc lookup. There is no"," `getByAccessibilityId`.","- `getByPlaceholder(x)` is the Android `hint` attribute (`//*[@hint='x']`) and the iOS"," placeholderValue. UiAutomator's UiSelector has no `.hint()` method \u2014 do not write one.","- `getById` is a resource-id on Android and an accessibility id on iOS.","","### Acting on a Locator"," click, tap, doubleClick, doubleTap, longPress, fill, clear, sendKeyStrokes,"," pressSequentially, press, focus, blur, check, uncheck, selectOption, scrollIntoView,"," swipeUp, swipeDown, swipeLeft, swipeRight, dragTo, pinchIn, pinchOut, waitFor,"," getText, getValue, getAttribute, count, first, last, nth, filter, all","","### Asserting"," await expect(locator).toBeVisible() \u2014 and toBeHidden, toBeAttached, toBeEnabled,"," toBeDisabled, toBeChecked, toBeEditable, toBeEmpty, toBeFocused, toBeInViewport,"," toHaveText, toContainText, toHaveValue, toHaveAttribute, toHaveCount","","### Device-level actions (on `mobile`)"," launchApp, terminateApp, activateApp, installApp, uninstallApp, goBack, press,"," pressButton, hideKeyboard, isKeyboardShown, waitForTimeout, getScreenSize, screenshot,"," gesture, swipe, scroll, scrollIntoView, dragAndDrop, tap({x,y}), click({x,y})","","#### A step that acts on no element has exactly one call"," These verbs carry no locator. Do not choose between plausible methods \u2014 each row"," below is the whole answer, and it is what LIME's own generator emits:"," DISMISS_KEYBOARD await mobile.hideKeyboard();"," BACK await mobile.goBack();"," HOME await mobile.pressButton('HOME');"," PRESS_ENTER await mobile.pressButton('ENTER');"," WAIT await mobile.waitForTimeout(<ms>);"," OPEN_APP await mobile.activateApp('<package or bundle id>');","- A keyboard is dismissed by `hideKeyboard()`, NOT by pressing a hardware button."," `mobile.pressButton('back')` is wrong twice over: wrong method, and the argument"," is an enum whose values are UPPERCASE.","- `pressButton` takes one of 'HOME' | 'BACK' | 'POWER' | 'VOLUME_UP' | 'VOLUME_DOWN' | 'ENTER'."," Any other string does not compile.","","#### After typing, close the keyboard before asserting what is on screen","- A field keeps focus after the step that typed into it, so the keyboard is still up"," when the next check runs \u2014 and what is behind it is often left out of the"," accessibility tree (Flutter does this), so `toBeVisible()` fails on a screen that is"," right. Whenever a step types (`fill`, `pressSequentially`, `sendKeyStrokes`) and a"," LATER step asserts on the screen, close the keyboard in between \u2014 even where the"," recording has no DISMISS_KEYBOARD step.","- Guard it: on Android `hideKeyboard()` throws when no keyboard is up, and whether one"," is depends on the handset. The guard touches the device, so it is a method on the"," screen's page object and the spec calls that \u2014 `lime-cli check-pom` rejects any"," `mobile.` call in a spec:"," async dismissKeyboard() {"," if (await this.mobile.isKeyboardShown()) await this.mobile.hideKeyboard();"," }","- Do not scroll the content out from under the keyboard instead. A swipe that starts"," low on the screen lands ON the keyboard: it types a letter and scrolls nothing.","","#### Gestures take a DIRECTION, never coordinates"," swipe(direction, opts?) scroll(direction?, opts?) scrollIntoView(locator, opts?)","- `direction` is one of 'up' | 'down' | 'left' | 'right'. It is the FIRST argument and"," it is a string. There is no coordinate form \u2014 never `swipe({ start, end, duration })`,"," which passes an object where the direction goes. Geometry lives in `opts`, and its"," points are `from`/`to`, never `start`/`end`: { from, to, duration?, distance? }.","- A recorded gesture step carries `gesture: { direction, fromYPct, toYPct, xPct }` \u2014"," PERCENTAGES of the screen, not pixels. They go in the options object as fractions"," (divide by 100), and the direction still leads:"," await mobile.scroll('down', { from: { x: 0.37, y: 0.93 }, to: { x: 0.37, y: 0.28 } });"," Because they are fractions there is no screen size to look up, which is the only"," reason anyone reaches for the raw driver here. Do not.","- A `SCROLL_TO` step names the element the scroll was for, and `scrollIntoView` is a"," method ON THAT ELEMENT. So it goes through the page object like every other element"," access \u2014 the locator already lives there, and routing it through `mobile` reaches the"," device from a spec, which `lime-cli check-pom` rejects:"," await homePage.logoutButton.scrollIntoView();"," await homePage.logoutButton.click();"," It is the built-in scroll-until-visible: it loops until the element is there, and does"," nothing when it already is. Cheaper and shorter than the raw-device form, which is why"," there was never a reason to write one.","- That step may carry `scroll: { bottomMargin }`, meaning the element was recorded"," hard against the bottom edge. The key is named for the option, so pass it straight"," through \u2014 do not convert it, and do not compute one of your own:"," await homePage.logoutButton.scrollIntoView({ bottomMargin: 0.2 });"," When the step has no `scroll` block, pass nothing: omit the options argument"," entirely rather than inventing a value. Absent means the element was comfortably"," in view and needs no nudge.","","## Values the run took from a variable","- A recorded step whose `valueRef` is `{ kind: 'env' }` \u2014 or whose value still reads"," `${NAME}` \u2014 is a VARIABLE, not text. Render it as `process.env.NAME ?? ''`.","- NEVER inline the value, and never invent a plausible one. These are routinely"," credentials: writing them into the spec puts them in the repository's history, which"," is exactly what the placeholder exists to prevent. The recording carries the"," template, never the secret \u2014 so if you find yourself typing an email or a password,"," you are guessing, and the answer is an env read.",`- The \`variables\` manifest in ${Ue} names every one the test needs.`,""]:[],S=b&&c?["## Declare which LIME scenario this test implements","- This run was started from a card on the LIME Scenarios board. The test MUST carry that"," card's id as a Playwright annotation, or the results reported for it register a NEW"," scenario instead of updating the one somebody planned:","","```ts","test('<the test title>', {",` annotation: [{ type: 'taqwright-scenario', description: '${c}' }],`,"}, async ({ mobile }) => {","```","","- Copy the id EXACTLY as written above. It is an opaque key, not a name: do not re-slug it,"," re-case it, translate it or tidy it, and do not derive one from the test title.","- Do NOT remove, rename or move the annotation, and do not put it on a `describe` block \u2014"," the reporter reads it per test.","- It is the ONLY thing in this brief that may be copied verbatim into the test as an id.",""]:[],E=l||{},v=Array.isArray(E.stepPhrases)?E.stepPhrases:[],T=Array.isArray(E.featureFiles)?E.featureFiles:[],$=`${r?`${r}/`:""}${d||"new_flow.feature"}`,R=m?["## Cucumber: a scenario, its steps, and page objects","This project is Cucumber. The test you write is a SCENARIO, and it is made of three layers,",'each with one job. "The test body" in the rules below means the scenario AND its step',"definitions: neither touches the device; page objects do.","","### 1. The scenario, in a `.feature` file","- Business language only: no locators, taps, coordinates or credentials. It reads like the"," scenarios already in the project, in their tense and voice.",T.length?`- Features that already exist:
2
+ "use strict";var O=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}};var At=O((ih,ri)=>{ri.exports={name:"@taqwright/lime-cli",version:"0.35.0",description:"Thin CLI client for the LIME server \u2014 fire a natural-language QA Agent goal against a connected device and write back a taqwright spec.",license:"SEE LICENSE IN LICENSE",author:"Taqwright",homepage:"https://www.taqwright.ai",bugs:{url:"https://www.taqwright.ai/contact"},keywords:["appium","mobile-testing","e2e","qa","test-automation","taqwright","lime","cli"],bin:{"lime-cli":"dist/index.js"},main:"dist/index.js",files:["dist"],publishConfig:{access:"public"},scripts:{"lime-cli":"node src/index.js",start:"node src/index.js",test:"node --test test/*.test.js",bundle:"esbuild src/index.js --bundle --platform=node --target=node18 --minify --outfile=dist/index.js",prepack:"npm run bundle",prepublishOnly:"npm test"},engines:{node:">=18"},devDependencies:{esbuild:"^0.28.1"}}});var he=O((ah,bn)=>{"use strict";var oi="https://www.taqwright.ai",ii=[1e3,2e3,4e3,8e3,15e3,3e4,45e3],ai=4;bn.exports={POLL_INTERVAL_MS:1e3,POLL_TIMEOUT_MS:18e5,POLL_RETRY_DELAYS_MS:ii,BOOT_POLL_INTERVAL_MS:5e3,BOOT_TIMEOUT_MS:3e5,CONNECT_POLL_INTERVAL_MS:2e3,CONNECT_TIMEOUT_MS:3e5,DEFAULT_SERVER:oi,HTTP_TIMEOUT_MS:3e5,MAX_RESPONSE_BYTES:52428800,EXIT_LOST_CONTACT:ai}});var Se=O((ch,Tn)=>{"use strict";var{URL:ci}=require("url"),{HTTP_TIMEOUT_MS:Sn,MAX_RESPONSE_BYTES:En}=he(),{version:li}=At();function vn(e){let t=String(e||"").replace(/^\[|\]$/g,"").toLowerCase();return t==="localhost"||t==="127.0.0.1"||t==="::1"||t.endsWith(".localhost")}var ui=["just a moment","attention required! | cloudflare","checking your browser","/cdn-cgi/challenge-platform","cf-error-details","cf-browser-verification","_incapsula_resource"];function kn(e,t){if(!t||typeof t!="string")return null;let n=t.slice(0,4e3).toLowerCase();return ui.some(s=>n.includes(s))?`the LIME server is behind a bot challenge that blocked this request (HTTP ${e}). The request never reached LIME \u2014 it was stopped at the edge, so your token and arguments are probably fine. CI runners use datacenter IPs, which Cloudflare's Bot Fight Mode challenges by default; it cannot be excepted with a WAF skip rule, so the server's operator has to turn it off or move to Super Bot Fight Mode (which supports skip rules) for the /api/ paths.`:null}var It=class{constructor(t,n){this.server=t,this.token=n,this.update=null}_url(t){return/^https?:\/\//i.test(t)?t:`${this.server}${t}`}json(t,n,s,r={}){let o=s?JSON.stringify(s):null,i={...r};return o&&(i["Content-Type"]="application/json",i["Content-Length"]=Buffer.byteLength(o)),this._send(t,this._url(n),i,o)}raw(t,n,s,r={}){let o={...r,"Content-Type":"application/octet-stream","Content-Length":s.length};return this._send(t,this._url(n),o,s)}_send(t,n,s,r){let o=new ci(n);if(o.protocol==="http:"&&!vn(o.hostname))return Promise.reject(new Error(`refusing to send your LIME_CI_TOKEN over cleartext http to ${o.hostname} \u2014 use https (http is allowed only for localhost).`));let i=o.protocol==="https:"?require("https"):require("http"),a={method:t,hostname:o.hostname,port:o.port||(o.protocol==="https:"?443:80),path:o.pathname+(o.search||""),headers:{...s,Authorization:`Bearer ${this.token}`,Origin:`${o.protocol}//${o.host}`,"X-Lime-Cli-Version":li}};return new Promise((c,u)=>{let l=i.request(a,d=>{let p=d.headers["x-lime-cli-update"];p&&(this.update={status:String(p),latest:d.headers["x-lime-cli-latest"]||null});let h="",m=0;d.setEncoding("utf8"),d.on("data",g=>{if(m+=Buffer.byteLength(g),m>En){l.destroy(new Error(`Server response exceeded ${En} bytes`));return}h+=g}),d.on("end",()=>{let g;try{g=h?JSON.parse(h):{}}catch{let b=kn(d.statusCode,h),y=new Error(b||`Server returned non-JSON (${d.statusCode}): ${h.substring(0,200)}`);return y.status=d.statusCode,b?y.edgeBlock=!0:/^\s*error code:\s*\d{3,4}\s*$/i.test(h)&&(y.edgeError=!0),u(y)}c({status:d.statusCode,body:g})})});l.setTimeout(Sn,()=>{let d=new Error(`request timed out after ${Sn/1e3}s`);d.code="ETIMEDOUT",l.destroy(d)}),l.on("error",u),r&&l.write(r),l.end()})}};function di(e,t){if(!e.body||!e.body.success)throw new Error(`${t} \u2014 ${e.body&&e.body.error||"unknown"}`);return e.body}var pi=new Set(["ECONNRESET","ECONNREFUSED","ECONNABORTED","EPIPE","ETIMEDOUT","EAI_AGAIN","ENOTFOUND","ENETUNREACH","EHOSTUNREACH","ENETDOWN"]),hi=new Set([502,503,504,520,521,522,523,524]);function fi(e){return!e||e.edgeBlock?!1:e.edgeError||e.code&&pi.has(e.code)?!0:hi.has(e.status)}Tn.exports={isLoopbackHost:vn,HttpClient:It,expectSuccess:di,describeEdgeBlock:kn,isTransientNetworkError:fi}});var le=O((lh,An)=>{"use strict";var mi=require("fs"),gi=require("path"),jt="lime.json";function $n(e){let t;try{t=mi.readFileSync(gi.join(e,jt),"utf8")}catch{return{pageObjects:!0,declared:!1}}let n;try{n=JSON.parse(t)}catch(s){return{pageObjects:!0,declared:!1,error:`${jt} could not be read (${s.message}); using the defaults`}}return{pageObjects:!(n&&n.pageObjects===!1),declared:!0,...n&&typeof n.project=="string"&&n.project.trim()?{project:n.project.trim()}:{},...n&&n.locatorHelpers&&typeof n.locatorHelpers=="object"?{locatorHelpers:n.locatorHelpers}:{},...n&&typeof n.testCasePlan=="string"&&n.testCasePlan.trim()?{testCasePlan:n.testCasePlan.trim()}:{},...n&&typeof n.testCaseId=="string"&&n.testCaseId.trim()?{testCaseId:n.testCaseId.trim()}:{}}}function wi(e,t){return e&&e.project!==void 0?e.project:$n(t).project}An.exports={readProjectSettings:$n,projectDefault:wi,PROJECT_SETTINGS_FILE:jt}});var jn=O((uh,In)=>{"use strict";var _t="npm install -g @taqwright/lime-cli@latest",yi=/^\d+\.\d+\.\d+([-.+][0-9A-Za-z.-]{1,20})?$/;function bi({status:e,current:t,latest:n,env:s=process.env}){return s.LIME_NO_UPDATE_NOTICE==="1"?null:e==="required"?`lime-cli: ${t} is no longer supported by this server. Run: ${_t}`:e==="available"&&typeof n=="string"&&yi.test(n)?`lime-cli: update available: ${t} \u2192 ${n}. Run: ${_t}`:null}In.exports={formatUpdateNotice:bi,INSTALL_COMMAND:_t}});var Ee=O((dh,_n)=>{"use strict";var Si={browserstack:{label:"BrowserStack",envUsername:"BROWSERSTACK_USERNAME",envAccessKey:"BROWSERSTACK_ACCESS_KEY",hubHost:"hub.browserstack.com"},lambdatest:{label:"LambdaTest",envUsername:"LT_USERNAME",envAccessKey:"LT_ACCESS_KEY",hubHost:"mobile-hub.lambdatest.com"}};function Ei({provider:e,platform:t,device:n,os:s,appUrl:r,username:o,accessKey:i,capabilities:a}){let c={connectionMode:"cloud",cloudProvider:e||"browserstack",cloudUsername:o,cloudAccessKey:i,platform:t,deviceName:n,deviceOsVersion:s,cloudAppUrl:r,automationName:t==="ios"?"XCUITest":"UiAutomator2"};return a&&(c.cloudCapabilities=a),c}_n.exports={CLOUD_PROVIDERS:Si,buildCloudSettingsPayload:Ei}});var ie=O((ph,xn)=>{"use strict";var Qe=require("fs"),Ot=require("path"),On=["taqwright","webdriverio-js","appium-java-junit5","appium-java-cucumber","appium-python-pytest","appium-ruby-rspec","appium-csharp-nunit"],vi={taqwright:"deterministic","webdriverio-js":"gemini","appium-java-junit5":"gemini","appium-java-cucumber":"gemini","appium-python-pytest":"gemini","appium-ruby-rspec":"gemini","appium-csharp-nunit":"gemini"},ue={taqwright:"taqwright (native)","webdriverio-js":"WebdriverIO (JavaScript)","appium-java-junit5":"Appium Java (JUnit 5)","appium-java-cucumber":"Appium Java (Cucumber)","appium-python-pytest":"Appium Python (pytest)","appium-ruby-rspec":"Appium Ruby (RSpec)","appium-csharp-nunit":"Appium C# (NUnit)"},ki=5*1024*1024,et={exists:e=>Qe.existsSync(e),readText:e=>{try{return Qe.statSync(e).size>ki?null:Qe.readFileSync(e,"utf8")}catch{return null}},list:e=>{try{return Qe.readdirSync(e)}catch{return[]}}};function Ti(e,t){let n=e.readText(Ot.join(t,"package.json"));if(!n)return{};try{let s=JSON.parse(n);return{...s.dependencies||{},...s.devDependencies||{}}}catch{return{}}}var $i=new Set(["node_modules","dist","build","target","bin","obj","vendor","out","coverage"]);function Ai(e,t){let n=new Set([""]),s=[];try{s=e.list(t)}catch{s=[]}for(let r of s)r.startsWith(".")||$i.has(r)||n.add(r);return[...n]}function Ii(e,t,n){let s=n?Ot.join(t,n):t,r=d=>Ot.join(s,d),o=d=>n?`${n}/${d}`:d,i=[],a=Ti(e,s),c=[];try{c=e.list(s)}catch{c=[]}(a["@taqwright/taqwright"]||a.taqwright||e.exists(r("taqwright.config.ts"))||e.exists(r("taqwright.config.js")))&&i.push({id:"taqwright",label:ue.taqwright,reason:"taqwright dependency/config found",manifest:o("package.json")});let u=c.some(d=>/^wdio\.conf\.(js|ts|mjs|cjs)$/.test(d));(a.webdriverio||a["@wdio/cli"]||u)&&i.push({id:"webdriverio-js",label:ue["webdriverio-js"],reason:u?"wdio.conf.* found":"webdriverio dependency found",manifest:o("package.json")});for(let d of["pom.xml","build.gradle","build.gradle.kts"]){let p=e.readText(r(d));if(p&&/io\.appium|java-client/.test(p)){let h=/io\.cucumber/.test(p),m=h?"appium-java-cucumber":"appium-java-junit5";i.push({id:m,label:ue[m],reason:h?`io.appium:java-client and io.cucumber in ${o(d)}`:`io.appium:java-client in ${o(d)}`,manifest:o(d)});break}}for(let d of["requirements.txt","pyproject.toml"]){let p=e.readText(r(d));if(p&&/appium-python-client/i.test(p)){i.push({id:"appium-python-pytest",label:ue["appium-python-pytest"],reason:`Appium-Python-Client in ${o(d)}`,manifest:o(d)});break}}let l=e.readText(r("Gemfile"));l&&/appium_lib(_core)?/.test(l)&&i.push({id:"appium-ruby-rspec",label:ue["appium-ruby-rspec"],reason:"appium_lib in Gemfile",manifest:o("Gemfile")});for(let d of c){if(!/\.csproj$/i.test(d))continue;let p=e.readText(r(d));if(p&&/Appium\.WebDriver/i.test(p)){i.push({id:"appium-csharp-nunit",label:ue["appium-csharp-nunit"],reason:`Appium.WebDriver in ${o(d)}`,manifest:o(d)});break}}return i}function Rn(e,t=et){let n=new Map;for(let s of Ai(t,e))for(let r of Ii(t,e,s))n.has(r.id)||n.set(r.id,r);return[...n.values()]}function Nn(e,t=et){let n=Rn(e,t);return n.some(s=>s.id==="taqwright")||n.push({id:"taqwright",label:ue.taqwright,reason:"default output"}),n}function Cn(e){let{requested:t,configured:n,remembered:s,offeredIds:r,detectedRealIds:o,taqwrightDetected:i,javaSignal:a}=e,c=u=>!!u&&r.includes(u);return c(t)?t:c(n)?n:c(s)&&(o.includes(s)||s==="taqwright"&&i)?s:o.length?o[0]:i?"taqwright":a?"appium-java-junit5":"taqwright"}function ji(e,t=et){let n=Nn(e,t);return Cn({offeredIds:On,detectedRealIds:n.filter(s=>s.id!=="taqwright").map(s=>s.id),taqwrightDetected:n.some(s=>s.id==="taqwright"&&!/default output/.test(s.reason)),javaSignal:!1})}xn.exports={detectRepoFramework:ji,FRAMEWORK_IDS:On,FRAMEWORK_ENGINES:vi,FRAMEWORK_LABELS:ue,nodeFs:et,detectFrameworks:Rn,rankFrameworks:Nn,pickDefaultFramework:Cn}});var tt=O((hh,Un)=>{"use strict";var De=require("path"),{nodeFs:_i}=ie(),Pn={taqwright:"tests","webdriverio-js":"test/specs","appium-java-junit5":"src/test/java","appium-java-cucumber":"src/test/resources/features","appium-python-pytest":"tests","appium-ruby-rspec":"spec","appium-csharp-nunit":"Tests"},Oi="tests",Ri={taqwright:".spec.ts","webdriverio-js":".spec.ts","appium-java-junit5":".java","appium-java-cucumber":".feature","appium-python-pytest":".py","appium-ruby-rspec":"_spec.rb","appium-csharp-nunit":".cs"},Ni=new Set(["appium-python-pytest","appium-ruby-rspec","appium-java-cucumber"]);function Rt(e){return Pn[e]||Oi}function Nt(e){let t=(e||"").split(/[^A-Za-z0-9]+/).filter(Boolean);return t.length?t.map(n=>/^[A-Z0-9]+$/.test(n)?n[0]+n.slice(1).toLowerCase():n[0].toUpperCase()+n.slice(1)).join(""):""}function Ct(e){return(e||"").replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/([A-Z])([A-Z][a-z])/g,"$1_$2").split(/[^A-Za-z0-9]+/).filter(Boolean).join("_").toLowerCase()}function Ci(e){return Ct(e).split("_").filter(Boolean).join("-")}var xi=6,Li=new Set(["and","or","the","a","an","to","of","in","on","at","as","with","for","then","into","from","by","that","is"]),Pi=/@|\d{6,}/;function Mi(e){let t=String(e||"").trim().split(/\s+/).filter(Boolean).filter(n=>!Pi.test(n)).slice(0,xi);for(;t.length>1&&Li.has(t[t.length-1].toLowerCase());)t.pop();return Nt(t.join(" "))||"RecordedTest"}function Di(e){let t=String(e||"").trim();return t?/[A-Za-z]/.test(t)?t.length>80?"Keep the name under 80 characters.":/[/\\]/.test(t)?"Use the destination field for the folder.":null:"Use at least one letter.":"Enter a test name."}function qi(e){if(e==null||e==="")return null;let t=String(e);return t!==t.trim()?"must not have leading or trailing spaces.":t.length>120?"is longer than any key LIME mints (120 characters).":/^[a-z0-9][a-z0-9._/:-]*$/.test(t)?t.includes("..")?'must not contain "..".':null:"is not a scenario key \u2014 expected lower-case letters, digits and . _ - / : only."}function Mn(e,t){let n;return Ni.has(e)?n=Ct(t):n=Nt(t),`${n}${Ri[e]||""}`}function qe(e){return String(e||"").split(/[/\\]+/).filter(t=>t&&t!=="."&&t!=="..").join("/")}function Ui(e){if(e==null)return null;let t=String(e);return t.trim()===""?null:/^([A-Za-z]:)?[/\\]/.test(t)?"must be a path inside the project, not an absolute path.":t.split(/[/\\]+/).includes("..")?'must not contain ".." \u2014 the test belongs inside the project.':null}function xt(e){let t=qe(e).split("/");return t.pop(),t.join("/")}function Dn(e){let t=/(?:^|\/)src\/(?:test|main)\/java\/(.+)$/.exec(qe(e));return t&&t[1].split("/").filter(Boolean).join(".")||void 0}function Fi(e){let t=qe(e),n=t.search(/\/src\/(?:test|main)\/java(?:\/|$)/);return n>0?t.slice(0,n):""}function Bi(e){let t=new Map;for(let s of e){let r=xt(s);t.set(r,(t.get(r)||0)+1)}if(!t.size)return null;let n=[...t.entries()].sort((s,r)=>r[1]-s[1]||s[0].localeCompare(r[0]));return{dir:n[0][0],count:n[0][1]}}var qn={taqwright:{segment:"tests",file:/\.spec\.(ts|js)$/},"webdriverio-js":{segment:"test/specs",file:/\.(ts|js)$/},"appium-java-junit5":{segment:"src/test/java",file:/\.java$/},"appium-java-cucumber":{segment:"",file:/\.feature$/},"appium-python-pytest":{segment:"tests",file:/^(test_.+|.+_test)\.py$/},"appium-ruby-rspec":{segment:"spec",file:/_spec\.rb$/},"appium-csharp-nunit":{segment:"",file:/Tests\.cs$/}},Hi=/@(?:org\.junit(?:\.jupiter\.api)?\.)?(?:Test|ParameterizedTest|RepeatedTest|TestFactory|TestTemplate)\b/,Ki=/^(?:Test\w*|\w*(?:Test|Tests|TestCase))\.java$/;function Wi(e,t,n){let s=n.readText?n.readText(e):null;return typeof s=="string"?Hi.test(s):Ki.test(t)}var Vi=new Set(["node_modules","dist","build","target","bin","obj","vendor","out","coverage",".git"]),Gi=2e4;function Yi(e,t,n=_i){let s=qn[t];if(!s)return[];let r=[],o=Gi,i=a=>{if(o<=0)return;let c=a?De.join(e,a):e,u=[];try{u=n.list(c)}catch{return}for(let l of u){if(o--<=0)return;if(l.startsWith(".")||Vi.has(l))continue;let d=a?`${a}/${l}`:l;if(n.isDir?n.isDir(De.join(e,d)):n.list(De.join(e,d)).length>0){i(d);continue}s.file.test(l)&&(s.segment&&!`/${xt(d)}/`.includes(`/${s.segment}/`)||t==="appium-java-junit5"&&!Wi(De.join(e,d),l,n)||r.push(d))}};return i(""),r.sort()}var Ln=["TestCase","Tests","Test","IT"];function Ji(e,t,n){if(e!=="appium-java-junit5"||!t||(t=t[0].toUpperCase()+t.slice(1),/^Test[A-Z0-9_]/.test(t)||Ln.some(o=>t.endsWith(o))))return t;let s=new Map;for(let o of n||[]){let i=De.posix.basename(String(o)).replace(/\.java$/,""),a=Ln.find(c=>i.endsWith(c));a&&s.set(a,(s.get(a)||0)+1)}let r=[...s.entries()].sort((o,i)=>i[1]-o[1]||(o[0]==="Test"?-1:i[0]==="Test"?1:0));return t+(r.length?r[0][0]:"Test")}function zi(e){let{framework:t,testName:n}=e,s=Mn(t,n),r=(a,c,u=0)=>{let l=qe(a),d=t==="appium-java-junit5"?Dn(l):void 0;return{dir:l,fileName:s,...d?{packageName:d}:{},source:c,neighbourCount:u}};if(e.remembered!=null)return r(e.remembered,"remembered");let o=Bi(e.existingTests||[]);if(o&&o.dir)return r(o.dir,"existing",o.count);let i=e.detection&&e.detection.manifest?xt(e.detection.manifest):"";return i?r(`${i}/${Rt(t)}`,"module"):r(Rt(t),"convention")}Un.exports={CONVENTIONAL_DIRS:Pn,TEST_PATTERNS:qn,conventionalDir:Rt,pascalCase:Nt,snakeCase:Ct,kebabCase:Ci,testNameFromGoal:Mi,validateTestName:Di,validateDest:Ui,validateScenarioKey:qi,fileNameFor:Mn,normalizeDir:qe,javaPackageOf:Dn,moduleRootOf:Fi,findExistingTests:Yi,resolveExportTarget:zi,conventionalTestName:Ji}});var Lt=O((fh,Hn)=>{"use strict";var{CLOUD_PROVIDERS:nt}=Ee(),{validateScenarioKey:Xi}=tt();function Zi(e){let t=Object.create(null);for(let n=0;n<e.length;n++){let s=e[n];if(!s.startsWith("--"))continue;let r=s.slice(2),o=e[n+1];o===void 0||o.startsWith("--")?t[r]=!0:(t[r]=o,n++)}return t}var Bn=["export","adapt","verify","check","check-locators","check-pom","disconnect","report","doctor","init","pr","hooks","scenarios"];function Qi(e){let t=Array.isArray(e)?e:[],n=[];for(let s=0;s<t.length;s+=1){let r=String(t[s]==null?"":t[s]);!r||r.startsWith("-")||(s>0?String(t[s-1]||""):"").startsWith("--")||n.push(r)}return n}function ea(e){let t=e[0];return t&&Bn.includes(t)?{command:t,rest:e.slice(1)}:{command:"run",rest:e}}function ta(e="taqwright"){return e==="json"?"recorded-steps.json":"RecordedTest.spec.ts"}function na(e,t=process.env){let n=[],s=!!e["list-devices"],r=!!e["keep-session"],o=!!e["no-boot"],i=e["lime-dir"]===!0?".lime":typeof e["lime-dir"]=="string"&&e["lime-dir"].trim()?e["lime-dir"].trim():void 0,a=e.format?String(e.format).toLowerCase():"taqwright";if(["taqwright","json"].includes(a)||n.push(`--format must be taqwright or json (got "${e.format}")`),s)return{errors:n,listDevices:s,keepSession:r,noBoot:o,format:a,limeDir:i};(!e.goal||typeof e.goal!="string"||!e.goal.trim())&&n.push("--goal is required");let c;e.project!==void 0&&(typeof e.project!="string"||!e.project.trim()?n.push("--project requires a project name"):c=e.project.trim());let u;if(e.scenario!==void 0){let w=typeof e.scenario=="string"?e.scenario.trim():"",S=w?Xi(w):"requires a scenario key";S?n.push(`--scenario ${S}`):u=w}for(let w of["gemini-key","qwen-key"])e[w]!==void 0&&n.push(`--${w} is no longer supported: runs use the AI key provisioned for your LIME account`);if(e["max-steps"]!==void 0){let w=Number(e["max-steps"]);(!Number.isFinite(w)||w<1||w>200)&&n.push("--max-steps must be a number between 1 and 200")}let l;e.platform&&(l=String(e.platform).toLowerCase(),["android","ios"].includes(l)||n.push(`--platform must be android or ios (got "${e.platform}")`));let d=!!e.cloud,p=typeof e.os=="string"?e.os:void 0,h=typeof e["app-url"]=="string"?e["app-url"]:void 0,m=typeof e.app=="string"?e.app:void 0,g=typeof e.caps=="string"&&e.caps.trim()?e.caps.trim():void 0,f,b,y;if(d&&(f=e.cloud===!0?"browserstack":String(e.cloud).toLowerCase(),nt[f]||n.push(`--cloud must be ${Object.keys(nt).join(" or ")} (got "${e.cloud}")`)),d){(!e.device||typeof e.device!="string")&&n.push('--cloud requires --device (the cloud device name, e.g. "Google Pixel 8")'),l||n.push("--cloud requires --platform (android or ios)"),p||n.push("--cloud requires --os (the device OS version, e.g. 14.0)"),m?n.push("--app is not supported for cloud runs. Upload the build to your provider \u2014 LambdaTest: POST https://manual-api.lambdatest.com/app/upload/realDevice (-F appFile=@<file>), BrowserStack: POST https://api-cloud.browserstack.com/app-automate/upload (-F file=@<file>) \u2014 then pass the returned id with --app-url. (--app is still supported for local runs, where it clean-reinstalls on the agent device.)"):h||n.push("--cloud requires --app-url <bs://\u2026 | lt://\u2026> (the id from your provider\u2019s app upload API)"),e["app-url"]!==void 0&&(typeof e["app-url"]!="string"||!e["app-url"].trim())&&n.push("--app-url requires a bs:// or lt:// app id"),h&&nt[f]&&(f==="browserstack"&&h.startsWith("lt://")?n.push(`--app-url "${h}" is a LambdaTest app id, but the provider is browserstack`):f==="lambdatest"&&h.startsWith("bs://")&&n.push(`--app-url "${h}" is a BrowserStack app id, but the provider is lambdatest`)),e["cloud-username"]!==void 0&&(typeof e["cloud-username"]!="string"||!e["cloud-username"].trim())&&n.push("--cloud-username requires a value"),e["cloud-access-key"]!==void 0&&(typeof e["cloud-access-key"]!="string"||!e["cloud-access-key"].trim())&&n.push("--cloud-access-key requires a value"),e.caps!==void 0&&(typeof e.caps!="string"||!e.caps.trim())&&n.push("--caps requires a path to a JSON file");let w=nt[f];w&&(b=typeof e["cloud-username"]=="string"&&e["cloud-username"].trim()||t[w.envUsername]||void 0,y=typeof e["cloud-access-key"]=="string"&&e["cloud-access-key"].trim()||t[w.envAccessKey]||void 0,b||n.push(`cloud runs require a username \u2014 pass --cloud-username or set ${w.envUsername} (credentials are never read from your LIME account for CLI runs)`),y||n.push(`cloud runs require an access key \u2014 pass --cloud-access-key or set ${w.envAccessKey}`))}else e.app!==void 0&&(typeof e.app!="string"||!e.app.trim()?n.push("--app requires a path to an APK"):e.device?l&&l!=="android"&&n.push("--app is Android only"):n.push("--app requires --device (lime-cli must connect to a device to reinstall the app)")),e["app-url"]!==void 0&&n.push("--app-url requires --cloud"),e.os!==void 0&&n.push("--os requires --cloud"),e["cloud-username"]!==void 0&&n.push("--cloud-username requires --cloud"),e["cloud-access-key"]!==void 0&&n.push("--cloud-access-key requires --cloud"),e.caps!==void 0&&n.push("--caps requires --cloud");return{errors:n,listDevices:s,keepSession:r,noBoot:o,limeDir:i,device:e.device,platform:l,projectName:c,scenarioKey:u,app:m,cloud:d,cloudProvider:f,cloudUsername:b,cloudAccessKey:y,os:p,appUrl:h,capsPath:g,format:a}}var Fn=["browserstack","lambdatest","appium"];function sa(e){let t=[],n=[];for(let[s,r]of Object.entries(e||{}))!r||typeof r!="object"||Array.isArray(r)?t.push(`--caps block "${s}" must be a JSON object, e.g. { "${s}": { "someCap": true } }`):Fn.includes(s)||n.push(`--caps block "${s}" is not one of ${Fn.join("/")} \u2014 it will be ignored (typo?)`);return{errors:t,warnings:n}}Hn.exports={parseArgs:Zi,parseCommand:ea,positionalPaths:Qi,validateArgs:na,extToFilename:ta,validateCapsObject:sa,COMMANDS:Bn}});var Mt=O((mh,Xn)=>{"use strict";var ra=".lime/ADAPT.md",Ue=".lime/recorded-steps.json",oa=".lime/VERIFY.md",Kn=".lime/verify-target.json",Wn="docs/app-flows",rt="LIME_VERIFY_RESULT";function Pt(e){let t=(e||"").trim().toLowerCase();return t?t.includes("android")?"android":t.includes("ios")||t.includes("iphone")||t.includes("ipad")?"ios":"":""}function ia(e){let{frameworkLabel:t,framework:n,testName:s,destination:r,goal:o,recordedPlatform:i,hasAppDocs:a,scenarioKey:c,flatSpecs:u,cucumber:l,fileName:d,locatorHelpers:p,otherRecording:h}=e,m=(n||"").toLowerCase()==="appium-java-cucumber",g=Pt(i),f=g==="android"?"iOS":g==="ios"?"Android":"",b=(n||"").toLowerCase()==="taqwright"||String(t||"").toLowerCase()==="taqwright",y=['## Visual verification steps (verb "VISUAL_VERIFY")','- A recorded step with `verb: "VISUAL_VERIFY"` is an Applitools Eyes VISUAL CHECKPOINT; its name'," is `visual.name` (or `target`). It performs a real baseline comparison. Do NOT replace it with"," `mobile.screenshot()` + `testInfo.attach(...)`, a `toBeVisible(...)` assertion, or any other"," stand-in, and never drop it.",b?"- Render each one, at that point in the flow (spec-level, NOT a page-object method):":"- Render it with the project's configured visual-testing SDK, using the checkpoint name. If the",b?" `await eyes.check('<name>', Target.image(await mobile.screenshot()));`":" project has no visual-testing tool configured, capture a screenshot named `<name>` as the",b?" When ANY step is VISUAL_VERIFY, wrap the test body in the Eyes lifecycle:":" checkpoint and note it in the summary. Never silently drop the checkpoint.",b?" - import: `import { Eyes, Target } from '@applitools/eyes-images';`":null,b?` - at the start: \`const eyes = new Eyes(); eyes.setApiKey(process.env.APPLITOOLS_API_KEY || ''); await eyes.open('<app>', '${s}');\``:null,b?" - wrap the flow in `try { ... } finally { await eyes.close(false); }` (close(false) reports a mismatch without failing the run).":null,b?" Do NOT use `mobile.visuallyVerify(...)`: that API was removed. Use the Eyes SDK above.":null],w=b?["## The taqwright API \u2014 use ONLY what is listed here","- DO NOT INVENT A METHOD. If the thing you want is not on this page, use the closest"," one that is and say so in your summary. A method that does not exist fails at"," runtime on a real device, minutes into a billed session.","- The test fixture is `mobile`, NOT `page`: `test('...', async ({ mobile }) => { ... })`."," There is no `page` fixture.","- `rawDriver` (the underlying WebdriverIO client) is a SEPARATE FIXTURE, destructured"," beside `mobile`: `async ({ mobile, rawDriver }) => { ... }`. There is no"," `mobile.rawDriver` \u2014 it does not compile. You almost never need it: reach for it only"," when nothing on this page can express the step.","- Import from '@taqwright/taqwright': `test`, `expect`, and the types `Mobile` and `Locator`.","","### Finding elements (all on `mobile`, all return a Locator)"," getByText, getByLabel, getById, getByTestId, getByPlaceholder, getByRole, getByType,"," getByXpath, getByCss, getByUiSelector (Android only), getByPredicate (iOS only),"," getByClassChain (iOS only)","- `getByLabel(x)` is the ACCESSIBILITY ID / content-desc lookup. There is no"," `getByAccessibilityId`.","- `getByPlaceholder(x)` is the Android `hint` attribute (`//*[@hint='x']`) and the iOS"," placeholderValue. UiAutomator's UiSelector has no `.hint()` method \u2014 do not write one.","- `getById` is a resource-id on Android and an accessibility id on iOS.","","### Acting on a Locator"," click, tap, doubleClick, doubleTap, longPress, fill, clear, sendKeyStrokes,"," pressSequentially, press, focus, blur, check, uncheck, selectOption, scrollIntoView,"," swipeUp, swipeDown, swipeLeft, swipeRight, dragTo, pinchIn, pinchOut, waitFor,"," getText, getValue, getAttribute, count, first, last, nth, filter, all","","### Asserting"," await expect(locator).toBeVisible() \u2014 and toBeHidden, toBeAttached, toBeEnabled,"," toBeDisabled, toBeChecked, toBeEditable, toBeEmpty, toBeFocused, toBeInViewport,"," toHaveText, toContainText, toHaveValue, toHaveAttribute, toHaveCount","","### Device-level actions (on `mobile`)"," launchApp, terminateApp, activateApp, installApp, uninstallApp, goBack, press,"," pressButton, hideKeyboard, isKeyboardShown, waitForTimeout, getScreenSize, screenshot,"," gesture, swipe, scroll, scrollIntoView, dragAndDrop, tap({x,y}), click({x,y})","","#### A step that acts on no element has exactly one call"," These verbs carry no locator. Do not choose between plausible methods \u2014 each row"," below is the whole answer, and it is what LIME's own generator emits:"," DISMISS_KEYBOARD await mobile.hideKeyboard();"," BACK await mobile.goBack();"," HOME await mobile.pressButton('HOME');"," PRESS_ENTER await mobile.pressButton('ENTER');"," WAIT await mobile.waitForTimeout(<ms>);"," OPEN_APP await mobile.activateApp('<package or bundle id>');","- A keyboard is dismissed by `hideKeyboard()`, NOT by pressing a hardware button."," `mobile.pressButton('back')` is wrong twice over: wrong method, and the argument"," is an enum whose values are UPPERCASE.","- `pressButton` takes one of 'HOME' | 'BACK' | 'POWER' | 'VOLUME_UP' | 'VOLUME_DOWN' | 'ENTER'."," Any other string does not compile.","","#### After typing, close the keyboard before asserting what is on screen","- A field keeps focus after the step that typed into it, so the keyboard is still up"," when the next check runs \u2014 and what is behind it is often left out of the"," accessibility tree (Flutter does this), so `toBeVisible()` fails on a screen that is"," right. Whenever a step types (`fill`, `pressSequentially`, `sendKeyStrokes`) and a"," LATER step asserts on the screen, close the keyboard in between \u2014 even where the"," recording has no DISMISS_KEYBOARD step.","- Guard it: on Android `hideKeyboard()` throws when no keyboard is up, and whether one"," is depends on the handset. The guard touches the device, so it is a method on the"," screen's page object and the spec calls that \u2014 `lime-cli check-pom` rejects any"," `mobile.` call in a spec:"," async dismissKeyboard() {"," if (await this.mobile.isKeyboardShown()) await this.mobile.hideKeyboard();"," }","- Do not scroll the content out from under the keyboard instead. A swipe that starts"," low on the screen lands ON the keyboard: it types a letter and scrolls nothing.","","#### Gestures take a DIRECTION, never coordinates"," swipe(direction, opts?) scroll(direction?, opts?) scrollIntoView(locator, opts?)","- `direction` is one of 'up' | 'down' | 'left' | 'right'. It is the FIRST argument and"," it is a string. There is no coordinate form \u2014 never `swipe({ start, end, duration })`,"," which passes an object where the direction goes. Geometry lives in `opts`, and its"," points are `from`/`to`, never `start`/`end`: { from, to, duration?, distance? }.","- A recorded gesture step carries `gesture: { direction, fromYPct, toYPct, xPct }` \u2014"," PERCENTAGES of the screen, not pixels. They go in the options object as fractions"," (divide by 100), and the direction still leads:"," await mobile.scroll('down', { from: { x: 0.37, y: 0.93 }, to: { x: 0.37, y: 0.28 } });"," Because they are fractions there is no screen size to look up, which is the only"," reason anyone reaches for the raw driver here. Do not.","- A `SCROLL_TO` step names the element the scroll was for, and `scrollIntoView` is a"," method ON THAT ELEMENT. So it goes through the page object like every other element"," access \u2014 the locator already lives there, and routing it through `mobile` reaches the"," device from a spec, which `lime-cli check-pom` rejects:"," await homePage.logoutButton.scrollIntoView();"," await homePage.logoutButton.click();"," It is the built-in scroll-until-visible: it loops until the element is there, and does"," nothing when it already is. Cheaper and shorter than the raw-device form, which is why"," there was never a reason to write one.","- That step may carry `scroll: { bottomMargin }`, meaning the element was recorded"," hard against the bottom edge. The key is named for the option, so pass it straight"," through \u2014 do not convert it, and do not compute one of your own:"," await homePage.logoutButton.scrollIntoView({ bottomMargin: 0.2 });"," When the step has no `scroll` block, pass nothing: omit the options argument"," entirely rather than inventing a value. Absent means the element was comfortably"," in view and needs no nudge.","","## Values the run took from a variable","- A recorded step whose `valueRef` is `{ kind: 'env' }` \u2014 or whose value still reads"," `${NAME}` \u2014 is a VARIABLE, not text. Render it as `process.env.NAME ?? ''`.","- NEVER inline the value, and never invent a plausible one. These are routinely"," credentials: writing them into the spec puts them in the repository's history, which"," is exactly what the placeholder exists to prevent. The recording carries the"," template, never the secret \u2014 so if you find yourself typing an email or a password,"," you are guessing, and the answer is an env read.",`- The \`variables\` manifest in ${Ue} names every one the test needs.`,""]:[],S=b&&c?["## Declare which LIME scenario this test implements","- This run was started from a card on the LIME Scenarios board. The test MUST carry that"," card's id as a Playwright annotation, or the results reported for it register a NEW"," scenario instead of updating the one somebody planned:","","```ts","test('<the test title>', {",` annotation: [{ type: 'taqwright-scenario', description: '${c}' }],`,"}, async ({ mobile }) => {","```","","- Copy the id EXACTLY as written above. It is an opaque key, not a name: do not re-slug it,"," re-case it, translate it or tidy it, and do not derive one from the test title.","- Do NOT remove, rename or move the annotation, and do not put it on a `describe` block \u2014"," the reporter reads it per test.","- It is the ONLY thing in this brief that may be copied verbatim into the test as an id.",""]:[],E=l||{},v=Array.isArray(E.stepPhrases)?E.stepPhrases:[],T=Array.isArray(E.featureFiles)?E.featureFiles:[],$=`${r?`${r}/`:""}${d||"new_flow.feature"}`,R=m?["## Cucumber: a scenario, its steps, and page objects","This project is Cucumber. The test you write is a SCENARIO, and it is made of three layers,",'each with one job. "The test body" in the rules below means the scenario AND its step',"definitions: neither touches the device; page objects do.","","### 1. The scenario, in a `.feature` file","- Business language only: no locators, taps, coordinates or credentials. It reads like the"," scenarios already in the project, in their tense and voice.",T.length?`- Features that already exist:
3
3
  ${T.slice(0,50).map(N=>` ${N}`).join(`
4
4
  `)}
5
5
  If one of them covers this area (login, catalog, cart, checkout...), add the scenario to that file,
@@ -325,7 +325,8 @@ Usage:
325
325
  list Each flow's id and name, and per platform its last CI result (passed / failed) or
326
326
  "planned". --json prints LIME's answer as it is.
327
327
  import Puts the plan onto the board: docs/e2e-flows.csv (or lime.json "testCasePlan", or the
328
- file named), columns id, flow, covers, feature, persona, steps, expected, platforms.
328
+ file named), columns id, flow, covers, feature, persona, runs_after, steps, expected,
329
+ platforms (runs_after: the ids of the flows this one starts after, the board's arrows).
329
330
  A flow with an id updates the same card on every import. ALWAYS a dry run first; it
330
331
  changes the board only with --yes.
331
332
  --sync also retire flows the file no longer lists (hidden, history kept; a flow
@@ -884,7 +885,7 @@ ${H}
884
885
  `);return}let i=0;for(let a of r)try{let c=await t.http.json("POST","/api/ci/results/screen",a),u=c&&c.body||{};if(u.wanted===!1){Ce(`lime-cli: LIME is not accepting failure screens for this team; skipping the rest.
885
886
  `);return}u.stored&&(i+=1)}catch(c){W(`lime-cli: could not send a failure screen (${c.message}).
886
887
  `);return}i&&Ce(`lime-cli: sent ${i} failure screen(s).
887
- `)}Bo.exports={cmdReport:yp,fetchSessions:Fo}});var Yo=O((Kh,Go)=>{"use strict";var Sp=require("fs"),Ep=require("path"),{readProjectSettings:Ko}=le(),{csvRecords:vp,DEFAULT_PLAN:kp}=gn(),Tp={id:["id","test case id","tc id","case id","flow id","scenario id"],name:["flow","name","title","flow name","scenario","scenario name"],steps:["steps","test steps"],expected:["expected","expected result","expected results"],goal:["goal"],covers:["covers"],feature:["feature","module"],persona:["persona"],squad:["squad","team"],targetPlatforms:["platforms","platform"],priority:["priority"],tags:["tags"]},$p=e=>String(e).toLowerCase().replace(/[^a-z0-9]+/g," ").trim();function Wo(e,t={}){let n=vp(e).filter(i=>i.some(a=>String(a).trim()));if(!n.length)return{error:"the plan is empty: no rows"};let s=-1,r={};for(let i=0;i<n.length&&s===-1;i+=1){let a=n[i].map($p),c={};for(let[u,l]of Object.entries(Tp)){let d=a.findIndex(p=>l.includes(p));d!==-1&&(c[u]=d)}c.name!==void 0&&(s=i,r=c)}if(s===-1)return{error:'the plan has no flow column (a header named "flow", "name" or "title")'};let o=n.slice(s+1).map(i=>{let a={};for(let[c,u]of Object.entries(r)){let l=String(i[u]==null?"":i[u]).trim();c==="targetPlatforms"&&(l=l.replace(/\s*(?:[/;&+|]|\band\b)\s*/gi,",").replace(/\s*,\s*/g,",")),l&&(a[c]=l)}for(let c of["feature","persona"])!a[c]&&t[c]&&String(t[c]).trim()&&(a[c]=String(t[c]).trim());return a}).filter(i=>Object.keys(i).length);return o.length?{rows:o}:{error:"the plan has a header row and no flows under it"}}async function Vo(e,t,n,s){let r=typeof t.project=="string"&&t.project.trim()||Ko(n).project,o=await e.json("GET","/api/cli/projects").catch(()=>null),i=o&&o.body&&Array.isArray(o.body.projects)?o.body.projects:null;if(!i)return s(`lime-cli: could not list your LIME projects (${vt(o)}).
888
+ `)}Bo.exports={cmdReport:yp,fetchSessions:Fo}});var Yo=O((Kh,Go)=>{"use strict";var Sp=require("fs"),Ep=require("path"),{readProjectSettings:Ko}=le(),{csvRecords:vp,DEFAULT_PLAN:kp}=gn(),Tp={id:["id","test case id","tc id","case id","flow id","scenario id"],name:["flow","name","title","flow name","scenario","scenario name"],steps:["steps","test steps"],expected:["expected","expected result","expected results"],goal:["goal"],covers:["covers"],dependsOn:["runs after","run after","after","depends on"],feature:["feature","module"],persona:["persona"],squad:["squad","team"],targetPlatforms:["platforms","platform"],priority:["priority"],tags:["tags"]},$p=e=>String(e).toLowerCase().replace(/[^a-z0-9]+/g," ").trim();function Wo(e,t={}){let n=vp(e).filter(i=>i.some(a=>String(a).trim()));if(!n.length)return{error:"the plan is empty: no rows"};let s=-1,r={};for(let i=0;i<n.length&&s===-1;i+=1){let a=n[i].map($p),c={};for(let[u,l]of Object.entries(Tp)){let d=a.findIndex(p=>l.includes(p));d!==-1&&(c[u]=d)}c.name!==void 0&&(s=i,r=c)}if(s===-1)return{error:'the plan has no flow column (a header named "flow", "name" or "title")'};let o=n.slice(s+1).map(i=>{let a={};for(let[c,u]of Object.entries(r)){let l=String(i[u]==null?"":i[u]).trim();c==="targetPlatforms"&&(l=l.replace(/\s*(?:[/;&+|]|\band\b)\s*/gi,",").replace(/\s*,\s*/g,",")),(l||c==="dependsOn")&&(a[c]=l)}for(let c of["feature","persona"])!a[c]&&t[c]&&String(t[c]).trim()&&(a[c]=String(t[c]).trim());return a}).filter(i=>Object.keys(i).length);return o.length?{rows:o}:{error:"the plan has a header row and no flows under it"}}async function Vo(e,t,n,s){let r=typeof t.project=="string"&&t.project.trim()||Ko(n).project,o=await e.json("GET","/api/cli/projects").catch(()=>null),i=o&&o.body&&Array.isArray(o.body.projects)?o.body.projects:null;if(!i)return s(`lime-cli: could not list your LIME projects (${vt(o)}).
888
889
  `),{code:1};let a=i.map(u=>u.name).join(", ");if(!r)return i.length===1?{id:i[0].id,name:i[0].name}:(s(`lime-cli: which project? Pass --project "<name>" or run lime-cli init (projects: ${a}).
889
890
  `),{code:2});let c=i.find(u=>String(u.name).toLowerCase()===r.toLowerCase());return c?{id:c.id,name:c.name}:(s(`lime-cli: no LIME project called "${r}" (projects: ${a}).
890
891
  `),{code:2})}function vt(e){return e?e.status===403?"flows are not enabled for this account yet; ask your Taqwright contact":e.status===404?"this LIME server does not have this yet":e.body&&e.body.error||`HTTP ${e.status}`:"LIME could not be reached"}function Ap(e){return e?e.passed?"passed":"failed":"not run"}async function Ip({http:e,args:t,cwd:n,out:s,warn:r}){let o=await Vo(e,t,n,r);if(!o.id)return o.code;let i=await e.json("GET",`/api/cli/scenarios?projectId=${o.id}`).catch(()=>null);if(!i||i.status!==200||!i.body||!i.body.success)return r(`lime-cli: could not read the flows of "${o.name}": ${vt(i)}.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taqwright/lime-cli",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Thin CLI client for the LIME server — fire a natural-language QA Agent goal against a connected device and write back a taqwright spec.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Taqwright",