@yoqa/cli 0.3.22 → 0.3.24
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/main.js +53 -4
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -6327,6 +6327,11 @@ var caseScriptActionSchema = exports_external.union([
|
|
|
6327
6327
|
text: exports_external.string().min(1),
|
|
6328
6328
|
timeoutMs: exports_external.number().min(0).max(120000).optional(),
|
|
6329
6329
|
reason: exports_external.string().optional()
|
|
6330
|
+
}),
|
|
6331
|
+
exports_external.object({
|
|
6332
|
+
type: exports_external.literal("alert"),
|
|
6333
|
+
alertAction: exports_external.union([exports_external.literal("accept"), exports_external.literal("dismiss")]).default("accept"),
|
|
6334
|
+
reason: exports_external.string().optional()
|
|
6330
6335
|
})
|
|
6331
6336
|
]);
|
|
6332
6337
|
var caseScriptSchema = exports_external.object({
|
|
@@ -6829,6 +6834,9 @@ function actionSummary(action) {
|
|
|
6829
6834
|
return `Type${typeof record.text === "string" ? `: ${record.text}` : ""}`;
|
|
6830
6835
|
if (type === "wait")
|
|
6831
6836
|
return "Wait";
|
|
6837
|
+
if (type === "alert") {
|
|
6838
|
+
return record.alertAction === "dismiss" ? "Dismiss alert" : "Accept alert";
|
|
6839
|
+
}
|
|
6832
6840
|
if (type === "assert") {
|
|
6833
6841
|
const assertion = typeof record.assertion === "string" ? record.assertion : "visible";
|
|
6834
6842
|
const text = typeof record.text === "string" ? record.text : "";
|
|
@@ -7166,6 +7174,31 @@ function formatRunReportGithubSummary(doc) {
|
|
|
7166
7174
|
return lines.join(`
|
|
7167
7175
|
`);
|
|
7168
7176
|
}
|
|
7177
|
+
// ../runner-client/src/xml-entities.ts
|
|
7178
|
+
var NAMED = {
|
|
7179
|
+
amp: "&",
|
|
7180
|
+
lt: "<",
|
|
7181
|
+
gt: ">",
|
|
7182
|
+
quot: '"',
|
|
7183
|
+
apos: "'"
|
|
7184
|
+
};
|
|
7185
|
+
function decodeXmlEntities(value) {
|
|
7186
|
+
return value.replace(/&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z][a-zA-Z0-9]+);/g, (entity, body) => {
|
|
7187
|
+
if (body.startsWith("#")) {
|
|
7188
|
+
const code = body[1] === "x" || body[1] === "X" ? Number.parseInt(body.slice(2), 16) : Number.parseInt(body.slice(1), 10);
|
|
7189
|
+
if (!Number.isFinite(code) || code < 0 || code > 1114111) {
|
|
7190
|
+
return entity;
|
|
7191
|
+
}
|
|
7192
|
+
try {
|
|
7193
|
+
return String.fromCodePoint(code);
|
|
7194
|
+
} catch {
|
|
7195
|
+
return entity;
|
|
7196
|
+
}
|
|
7197
|
+
}
|
|
7198
|
+
return NAMED[body] ?? entity;
|
|
7199
|
+
});
|
|
7200
|
+
}
|
|
7201
|
+
|
|
7169
7202
|
// ../runner-client/src/shell-script.ts
|
|
7170
7203
|
function shellSingleQuote(value) {
|
|
7171
7204
|
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
@@ -7452,12 +7485,15 @@ function sleepMs(ms, signal) {
|
|
|
7452
7485
|
signal?.addEventListener("abort", onAbort, { once: true });
|
|
7453
7486
|
});
|
|
7454
7487
|
}
|
|
7488
|
+
function normalizedLabel(value) {
|
|
7489
|
+
return decodeXmlEntities(value ?? "").trim().toLowerCase();
|
|
7490
|
+
}
|
|
7455
7491
|
function screenHasText(elements, text) {
|
|
7456
|
-
const needle = text
|
|
7492
|
+
const needle = normalizedLabel(text);
|
|
7457
7493
|
if (!needle)
|
|
7458
7494
|
return false;
|
|
7459
7495
|
return (elements ?? []).some((el) => {
|
|
7460
|
-
const label = el.label
|
|
7496
|
+
const label = normalizedLabel(el.label);
|
|
7461
7497
|
const type = el.type?.toLowerCase() ?? "";
|
|
7462
7498
|
return label.includes(needle) || type.includes(needle);
|
|
7463
7499
|
});
|
|
@@ -8007,7 +8043,7 @@ var {
|
|
|
8007
8043
|
// package.json
|
|
8008
8044
|
var package_default = {
|
|
8009
8045
|
name: "@yoqa/cli",
|
|
8010
|
-
version: "0.3.
|
|
8046
|
+
version: "0.3.24",
|
|
8011
8047
|
description: "Yoqa CLI — drive local mobile QA from the terminal or CI (talks to the Yoqa runner over HTTP)",
|
|
8012
8048
|
license: "UNLICENSED",
|
|
8013
8049
|
type: "module",
|
|
@@ -8045,7 +8081,7 @@ var package_default = {
|
|
|
8045
8081
|
health: "bun run src/main.ts health"
|
|
8046
8082
|
},
|
|
8047
8083
|
dependencies: {
|
|
8048
|
-
"@yoqa/runner": "0.3.
|
|
8084
|
+
"@yoqa/runner": "0.3.24"
|
|
8049
8085
|
},
|
|
8050
8086
|
devDependencies: {
|
|
8051
8087
|
"@types/node": "^22.15.30",
|
|
@@ -9774,6 +9810,19 @@ scriptCmd.command("run").argument("<file>", "Path to a .yoqa.json / CaseScript J
|
|
|
9774
9810
|
}
|
|
9775
9811
|
continue;
|
|
9776
9812
|
}
|
|
9813
|
+
if (action2.type === "alert") {
|
|
9814
|
+
const body2 = await c.performAction({
|
|
9815
|
+
kind: "alert",
|
|
9816
|
+
alertAction: action2.alertAction === "dismiss" ? "dismiss" : "accept"
|
|
9817
|
+
});
|
|
9818
|
+
if (options.json) {
|
|
9819
|
+
console.log(JSON.stringify({ ...body2, step: idx }, null, 2));
|
|
9820
|
+
} else {
|
|
9821
|
+
console.log(`ok ${body2.kind} (${idx}/${script.actions.length})`);
|
|
9822
|
+
}
|
|
9823
|
+
await sleep(800);
|
|
9824
|
+
continue;
|
|
9825
|
+
}
|
|
9777
9826
|
const tapBody = { kind: "tap" };
|
|
9778
9827
|
if (action2.type === "tap") {
|
|
9779
9828
|
if (action2.label)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoqa/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.24",
|
|
4
4
|
"description": "Yoqa CLI — drive local mobile QA from the terminal or CI (talks to the Yoqa runner over HTTP)",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"health": "bun run src/main.ts health"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@yoqa/runner": "0.3.
|
|
41
|
+
"@yoqa/runner": "0.3.24"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^22.15.30",
|