digital-ai-testing-mcp 1.2.8 → 2.0.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 +147 -46
- package/dist/api/browser-inspection.d.ts.map +1 -1
- package/dist/api/browser-inspection.js +14 -15
- package/dist/api/browser-inspection.js.map +1 -1
- package/dist/api/client.d.ts +7 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +9 -0
- package/dist/api/client.js.map +1 -1
- package/dist/api/projects.d.ts +16 -3
- package/dist/api/projects.d.ts.map +1 -1
- package/dist/api/projects.js +60 -18
- package/dist/api/projects.js.map +1 -1
- package/dist/api/reporting.d.ts +91 -0
- package/dist/api/reporting.d.ts.map +1 -1
- package/dist/api/reporting.js +178 -6
- package/dist/api/reporting.js.map +1 -1
- package/dist/api/test-orchestrator.d.ts +59 -0
- package/dist/api/test-orchestrator.d.ts.map +1 -0
- package/dist/api/test-orchestrator.js +126 -0
- package/dist/api/test-orchestrator.js.map +1 -0
- package/dist/api/test-runs.d.ts +80 -0
- package/dist/api/test-runs.d.ts.map +1 -0
- package/dist/api/test-runs.js +209 -0
- package/dist/api/test-runs.js.map +1 -0
- package/dist/api/test-views.d.ts.map +1 -1
- package/dist/api/test-views.js +5 -1
- package/dist/api/test-views.js.map +1 -1
- package/dist/api/transactions.d.ts +6 -0
- package/dist/api/transactions.d.ts.map +1 -1
- package/dist/api/transactions.js +19 -3
- package/dist/api/transactions.js.map +1 -1
- package/dist/api/usage-reports.d.ts.map +1 -1
- package/dist/api/usage-reports.js +3 -3
- package/dist/api/usage-reports.js.map +1 -1
- package/dist/api/webdriver.d.ts +39 -1
- package/dist/api/webdriver.d.ts.map +1 -1
- package/dist/api/webdriver.js +169 -65
- package/dist/api/webdriver.js.map +1 -1
- package/dist/index.js +79 -32
- package/dist/index.js.map +1 -1
- package/dist/tools/agent-tools.js +2 -2
- package/dist/tools/agent-tools.js.map +1 -1
- package/dist/tools/application-tools.d.ts.map +1 -1
- package/dist/tools/application-tools.js +5 -4
- package/dist/tools/application-tools.js.map +1 -1
- package/dist/tools/boilerplate-tools.d.ts +3 -0
- package/dist/tools/boilerplate-tools.d.ts.map +1 -1
- package/dist/tools/boilerplate-tools.js +301 -20
- package/dist/tools/boilerplate-tools.js.map +1 -1
- package/dist/tools/browser-tools.d.ts.map +1 -1
- package/dist/tools/browser-tools.js +8 -5
- package/dist/tools/browser-tools.js.map +1 -1
- package/dist/tools/device-group-tools.js +5 -5
- package/dist/tools/device-group-tools.js.map +1 -1
- package/dist/tools/device-tools.d.ts.map +1 -1
- package/dist/tools/device-tools.js +5 -4
- package/dist/tools/device-tools.js.map +1 -1
- package/dist/tools/health-tools.d.ts.map +1 -1
- package/dist/tools/health-tools.js +5 -4
- package/dist/tools/health-tools.js.map +1 -1
- package/dist/tools/inspection-tools.d.ts.map +1 -1
- package/dist/tools/inspection-tools.js +110 -10
- package/dist/tools/inspection-tools.js.map +1 -1
- package/dist/tools/meta-tools.d.ts +4 -1
- package/dist/tools/meta-tools.d.ts.map +1 -1
- package/dist/tools/meta-tools.js +59 -36
- package/dist/tools/meta-tools.js.map +1 -1
- package/dist/tools/performance-tools.d.ts.map +1 -1
- package/dist/tools/performance-tools.js +1 -7
- package/dist/tools/performance-tools.js.map +1 -1
- package/dist/tools/project-tools.d.ts.map +1 -1
- package/dist/tools/project-tools.js +38 -19
- package/dist/tools/project-tools.js.map +1 -1
- package/dist/tools/provisioning-profile-tools.d.ts.map +1 -1
- package/dist/tools/provisioning-profile-tools.js +5 -4
- package/dist/tools/provisioning-profile-tools.js.map +1 -1
- package/dist/tools/remediation-tools.d.ts +7 -0
- package/dist/tools/remediation-tools.d.ts.map +1 -0
- package/dist/tools/remediation-tools.js +50 -0
- package/dist/tools/remediation-tools.js.map +1 -0
- package/dist/tools/reporting-tools.d.ts.map +1 -1
- package/dist/tools/reporting-tools.js +334 -134
- package/dist/tools/reporting-tools.js.map +1 -1
- package/dist/tools/repository-tools.d.ts.map +1 -1
- package/dist/tools/repository-tools.js +5 -4
- package/dist/tools/repository-tools.js.map +1 -1
- package/dist/tools/reservation-tools.js +2 -2
- package/dist/tools/reservation-tools.js.map +1 -1
- package/dist/tools/test-run-tools.d.ts +3 -0
- package/dist/tools/test-run-tools.d.ts.map +1 -0
- package/dist/tools/test-run-tools.js +284 -0
- package/dist/tools/test-run-tools.js.map +1 -0
- package/dist/tools/test-view-tools.d.ts.map +1 -1
- package/dist/tools/test-view-tools.js +11 -11
- package/dist/tools/test-view-tools.js.map +1 -1
- package/dist/tools/toolset-tools.d.ts +8 -0
- package/dist/tools/toolset-tools.d.ts.map +1 -0
- package/dist/tools/toolset-tools.js +40 -0
- package/dist/tools/toolset-tools.js.map +1 -0
- package/dist/tools/transaction-tools.d.ts.map +1 -1
- package/dist/tools/transaction-tools.js +17 -7
- package/dist/tools/transaction-tools.js.map +1 -1
- package/dist/tools/usage-report-tools.d.ts.map +1 -1
- package/dist/tools/usage-report-tools.js +43 -15
- package/dist/tools/usage-report-tools.js.map +1 -1
- package/dist/tools/user-tools.js +2 -2
- package/dist/tools/user-tools.js.map +1 -1
- package/dist/tools/web-inspection-tools.d.ts.map +1 -1
- package/dist/tools/web-inspection-tools.js +39 -26
- package/dist/tools/web-inspection-tools.js.map +1 -1
- package/dist/tools/workflow-tools.js +1 -1
- package/dist/types/digital-ai.d.ts +14 -1
- package/dist/types/digital-ai.d.ts.map +1 -1
- package/dist/utils/browser-name.d.ts +2 -0
- package/dist/utils/browser-name.d.ts.map +1 -0
- package/dist/utils/browser-name.js +19 -0
- package/dist/utils/browser-name.js.map +1 -0
- package/dist/utils/command-payload.d.ts +19 -0
- package/dist/utils/command-payload.d.ts.map +1 -0
- package/dist/utils/command-payload.js +13 -0
- package/dist/utils/command-payload.js.map +1 -0
- package/dist/utils/csv.d.ts +6 -0
- package/dist/utils/csv.d.ts.map +1 -1
- package/dist/utils/csv.js +28 -2
- package/dist/utils/csv.js.map +1 -1
- package/dist/utils/locality.d.ts +7 -0
- package/dist/utils/locality.d.ts.map +1 -1
- package/dist/utils/locality.js +19 -0
- package/dist/utils/locality.js.map +1 -1
- package/dist/utils/maestro-flow.d.ts +38 -0
- package/dist/utils/maestro-flow.d.ts.map +1 -0
- package/dist/utils/maestro-flow.js +114 -0
- package/dist/utils/maestro-flow.js.map +1 -0
- package/dist/utils/metric-semantics.d.ts +22 -0
- package/dist/utils/metric-semantics.d.ts.map +1 -0
- package/dist/utils/metric-semantics.js +24 -0
- package/dist/utils/metric-semantics.js.map +1 -0
- package/dist/utils/pagination.d.ts +11 -0
- package/dist/utils/pagination.d.ts.map +1 -1
- package/dist/utils/pagination.js +16 -0
- package/dist/utils/pagination.js.map +1 -1
- package/dist/utils/remediation.d.ts +113 -0
- package/dist/utils/remediation.d.ts.map +1 -0
- package/dist/utils/remediation.js +392 -0
- package/dist/utils/remediation.js.map +1 -0
- package/dist/utils/report-ref.d.ts +23 -0
- package/dist/utils/report-ref.d.ts.map +1 -0
- package/dist/utils/report-ref.js +31 -0
- package/dist/utils/report-ref.js.map +1 -0
- package/dist/utils/response-formatter.d.ts +2 -1
- package/dist/utils/response-formatter.d.ts.map +1 -1
- package/dist/utils/response-formatter.js +32 -21
- package/dist/utils/response-formatter.js.map +1 -1
- package/dist/utils/test-orchestrator.d.ts +102 -0
- package/dist/utils/test-orchestrator.d.ts.map +1 -0
- package/dist/utils/test-orchestrator.js +236 -0
- package/dist/utils/test-orchestrator.js.map +1 -0
- package/dist/utils/test-status.d.ts +48 -0
- package/dist/utils/test-status.d.ts.map +1 -0
- package/dist/utils/test-status.js +92 -0
- package/dist/utils/test-status.js.map +1 -0
- package/dist/utils/tool-catalog.d.ts +6 -0
- package/dist/utils/tool-catalog.d.ts.map +1 -0
- package/dist/utils/tool-catalog.js +15 -0
- package/dist/utils/tool-catalog.js.map +1 -0
- package/dist/utils/toolsets.d.ts +79 -0
- package/dist/utils/toolsets.d.ts.map +1 -0
- package/dist/utils/toolsets.js +156 -0
- package/dist/utils/toolsets.js.map +1 -0
- package/dist/utils/usage-report-guard.d.ts +7 -0
- package/dist/utils/usage-report-guard.d.ts.map +1 -1
- package/dist/utils/usage-report-guard.js +18 -1
- package/dist/utils/usage-report-guard.js.map +1 -1
- package/dist/utils/usage-report-summary.d.ts +12 -0
- package/dist/utils/usage-report-summary.d.ts.map +1 -1
- package/dist/utils/usage-report-summary.js +25 -6
- package/dist/utils/usage-report-summary.js.map +1 -1
- package/package.json +40 -4
- package/resources/boilerplate/Android-Native/Java JUnit5/gradle +6 -1
- package/resources/boilerplate/Android-Native/Java JUnit5/gradle-oss +6 -1
- package/resources/boilerplate/Android-Native/java TestNG/AndroidNative-oss.java +2 -2
- package/resources/boilerplate/Android-Native/java TestNG/AndroidNative.java +2 -2
- package/resources/boilerplate/Android-Native/java TestNG/gradle +1 -1
- package/resources/boilerplate/Android-Native/java TestNG/gradle-oss +1 -1
- package/resources/boilerplate/iOS-Native/java-JUnit5/gradle +6 -1
- package/resources/boilerplate/iOS-Native/java-JUnit5/gradle-oss +6 -1
- package/resources/boilerplate/iOS-Native/java-TestNG/gradle +1 -1
- package/resources/boilerplate/iOS-Native/java-TestNG/gradle-oss +1 -1
- package/resources/boilerplate/iOS-Native/java-TestNG/iOSNative-oss.java +2 -2
- package/resources/boilerplate/iOS-Native/java-TestNG/iOSNative.java +2 -2
- package/resources/test-orchestrator/agent.json +19 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-views.js","sourceRoot":"","sources":["../../src/api/test-views.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAUjE,mEAAmE;AACnE,+DAA+D;AAE/D,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,IAAI,CAAC;QACH,OAAO,MAAM,MAAM,CAAa,wBAAwB,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,I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E,MAAM,CAAC,CAAC;QACvE,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,OAAQ,MAAkC,CAAC,EAAE,KAAK,QAAQ,EAAE,CAAC;YAChH,MAAM,IAAI,KAAK,CAAC,qBAAqB,MAAM,CAAC,EAAE,oCAAoC,CAAC,CAAC;QACtF,CAAC;QACD,OAAO,MAAkB,CAAC;IAC5B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,0BAA2B,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EAAU;IAC7C,IAAI,CAAC;QACH,MAAM,SAAS,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,0BAA2B,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { Transaction } from '../types/digital-ai.js';
|
|
2
|
+
/**
|
|
3
|
+
* deviceOs arrives in more than one casing — recent records say "IOS"/"ANDROID", older ones "iOS"/"Android" (UAT
|
|
4
|
+
* 2026-10-09: id 1950 is "IOS", 2024 records are "iOS"). Every filter (deviceOs: "iOS"), group-by and the comparison
|
|
5
|
+
* confound check compare exact strings, so normalise once here.
|
|
6
|
+
*/
|
|
7
|
+
export declare function normaliseDeviceOs(os: string | null | undefined): string | null | undefined;
|
|
2
8
|
export declare function listTransactions(): Promise<Transaction[]>;
|
|
3
9
|
export declare function getTransaction(transactionId: number): Promise<Transaction>;
|
|
4
10
|
//# sourceMappingURL=transactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../src/api/transactions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../src/api/transactions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAiB1D;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAM1F;AAYD,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAQ/D;AAED,wBAAsB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAMhF"}
|
package/dist/api/transactions.js
CHANGED
|
@@ -1,17 +1,33 @@
|
|
|
1
1
|
import { apiGet, apiPost } from './client.js';
|
|
2
|
+
/**
|
|
3
|
+
* deviceOs arrives in more than one casing — recent records say "IOS"/"ANDROID", older ones "iOS"/"Android" (UAT
|
|
4
|
+
* 2026-10-09: id 1950 is "IOS", 2024 records are "iOS"). Every filter (deviceOs: "iOS"), group-by and the comparison
|
|
5
|
+
* confound check compare exact strings, so normalise once here.
|
|
6
|
+
*/
|
|
7
|
+
export function normaliseDeviceOs(os) {
|
|
8
|
+
if (typeof os !== 'string')
|
|
9
|
+
return os;
|
|
10
|
+
const lower = os.trim().toLowerCase();
|
|
11
|
+
if (lower === 'ios')
|
|
12
|
+
return 'iOS';
|
|
13
|
+
if (lower === 'android')
|
|
14
|
+
return 'Android';
|
|
15
|
+
return os;
|
|
16
|
+
}
|
|
2
17
|
// The transaction API uses -1 as a sentinel for "metric not captured" on some fields.
|
|
3
18
|
// Normalise to null at the API boundary so consumers see a consistent null contract.
|
|
4
|
-
function
|
|
19
|
+
function normalise(t) {
|
|
5
20
|
return {
|
|
6
21
|
...t,
|
|
7
22
|
speedIndex: t.speedIndex === -1 ? null : t.speedIndex,
|
|
23
|
+
deviceOs: normaliseDeviceOs(t.deviceOs),
|
|
8
24
|
};
|
|
9
25
|
}
|
|
10
26
|
export async function listTransactions() {
|
|
11
27
|
try {
|
|
12
28
|
// Empty body required — any filter params trigger CSRF blocks or are ignored.
|
|
13
29
|
const res = await apiPost('/reporter/api/transactions/list', {});
|
|
14
|
-
return (res.data ?? []).map(
|
|
30
|
+
return (res.data ?? []).map(normalise);
|
|
15
31
|
}
|
|
16
32
|
catch (e) {
|
|
17
33
|
throw new Error(`listTransactions failed: ${e.message}`);
|
|
@@ -19,7 +35,7 @@ export async function listTransactions() {
|
|
|
19
35
|
}
|
|
20
36
|
export async function getTransaction(transactionId) {
|
|
21
37
|
try {
|
|
22
|
-
return await apiGet(`/reporter/api/transactions/${transactionId}`);
|
|
38
|
+
return normalise(await apiGet(`/reporter/api/transactions/${transactionId}`));
|
|
23
39
|
}
|
|
24
40
|
catch (e) {
|
|
25
41
|
throw new Error(`getTransaction failed: ${e.message}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../src/api/transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAkB9C,sFAAsF;AACtF,qFAAqF;AACrF,SAAS,
|
|
1
|
+
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../src/api/transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAkB9C;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAA6B;IAC7D,IAAI,OAAO,EAAE,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IACtC,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACtC,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAClC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,sFAAsF;AACtF,qFAAqF;AACrF,SAAS,SAAS,CAAC,CAAc;IAC/B,OAAO;QACL,GAAG,CAAC;QACJ,UAAU,EAAE,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU;QACrD,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,QAAQ,CAA4B;KACnE,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,CAAC;QACH,8EAA8E;QAC9E,MAAM,GAAG,GAAG,MAAM,OAAO,CAA0B,iCAAiC,EAAE,EAAE,CAAC,CAAC;QAC1F,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,4BAA6B,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,aAAqB;IACxD,IAAI,CAAC;QACH,OAAO,SAAS,CAAC,MAAM,MAAM,CAAc,8BAA8B,aAAa,EAAE,CAAC,CAAC,CAAC;IAC7F,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,0BAA2B,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-reports.d.ts","sourceRoot":"","sources":["../../src/api/usage-reports.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAE5G,OAAO,
|
|
1
|
+
{"version":3,"file":"usage-reports.d.ts","sourceRoot":"","sources":["../../src/api/usage-reports.ts"],"names":[],"mappings":"AAEA,OAAO,EAAwC,KAAK,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAE5G,OAAO,EAA8B,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAMzH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,gGAAgG;AAChG,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAOpG;AAED,kEAAkE;AAClE,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,eAAe,EAAE,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAGlH;AAED,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,eAAe,EAC3B,MAAM,EAAE,kBAAkB,EAC1B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAQ5B;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,eAAe,EAC3B,MAAM,EAAE,kBAAkB,EAC1B,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,aAAa,CAAC,CAQxB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { writeFile } from 'fs/promises';
|
|
2
2
|
import { apiDownload } from './client.js';
|
|
3
3
|
import { USAGE_REPORT_TYPES, usageReportUtcMs } from '../utils/usage-report-guard.js';
|
|
4
|
-
import {
|
|
5
|
-
import { summarizeRows } from '../utils/usage-report-summary.js';
|
|
4
|
+
import { parseCsvSections } from '../utils/csv.js';
|
|
5
|
+
import { pickSection, summarizeRows } from '../utils/usage-report-summary.js';
|
|
6
6
|
/** Path segments are project/user/startMs/endMs/objectType — 0 means "All" for project/user. */
|
|
7
7
|
export function buildUsageReportPath(reportType, params) {
|
|
8
8
|
const caps = USAGE_REPORT_TYPES[reportType];
|
|
@@ -37,7 +37,7 @@ export async function downloadUsageReport(reportType, params, localPath) {
|
|
|
37
37
|
export async function summarizeUsageReport(reportType, params, opts) {
|
|
38
38
|
try {
|
|
39
39
|
const data = await fetchUsageReportCsv(reportType, params);
|
|
40
|
-
const parsed =
|
|
40
|
+
const parsed = pickSection(parseCsvSections(data.toString('utf8')), opts);
|
|
41
41
|
return summarizeRows(parsed, opts);
|
|
42
42
|
}
|
|
43
43
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-reports.js","sourceRoot":"","sources":["../../src/api/usage-reports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAwB,MAAM,gCAAgC,CAAC;AAC5G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"usage-reports.js","sourceRoot":"","sources":["../../src/api/usage-reports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAwB,MAAM,gCAAgC,CAAC;AAC5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,aAAa,EAA6C,MAAM,kCAAkC,CAAC;AAazH,gGAAgG;AAChG,MAAM,UAAU,oBAAoB,CAAC,UAA2B,EAAE,MAA0B;IAC1F,MAAM,IAAI,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC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,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAC1E,OAAO,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,gCAAiC,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC"}
|
package/dist/api/webdriver.d.ts
CHANGED
|
@@ -8,7 +8,16 @@ export interface InspectionSessionOptions {
|
|
|
8
8
|
appActivity?: string;
|
|
9
9
|
noReset?: boolean;
|
|
10
10
|
testName?: string;
|
|
11
|
+
/** Android Auto / CarPlay projection resolution (digitalai:automotiveProjection) — projection runs for the whole session. */
|
|
12
|
+
automotiveProjection?: AutomotiveResolution;
|
|
13
|
+
/** iOS CarPlay only: instrument cluster content (digitalai:instrumentCluster). */
|
|
14
|
+
instrumentCluster?: InstrumentClusterContent;
|
|
11
15
|
}
|
|
16
|
+
/** Android Auto supports all three; CarPlay supports 800x480 only (platform docs). */
|
|
17
|
+
export declare const AUTOMOTIVE_RESOLUTIONS: readonly ["800x480", "1280x720", "1920x1080"];
|
|
18
|
+
export type AutomotiveResolution = (typeof AUTOMOTIVE_RESOLUTIONS)[number];
|
|
19
|
+
export declare const INSTRUMENT_CLUSTER_CONTENT: readonly ["Instruction Card", "Map", "Navigation App"];
|
|
20
|
+
export type InstrumentClusterContent = (typeof INSTRUMENT_CLUSTER_CONTENT)[number];
|
|
12
21
|
export declare function createInspectionSession(opts: InspectionSessionOptions): Promise<InspectionSession>;
|
|
13
22
|
export declare function quitInspectionSession(handle: string, keepReport?: boolean): Promise<{
|
|
14
23
|
reportDeleted: boolean;
|
|
@@ -34,8 +43,22 @@ export interface WdElement {
|
|
|
34
43
|
name: string | null;
|
|
35
44
|
label: string | null;
|
|
36
45
|
value: string | null;
|
|
46
|
+
/** false when the match is beyond the attribute cap/time budget — only elementId is set. */
|
|
47
|
+
enriched?: boolean;
|
|
37
48
|
}
|
|
38
|
-
export
|
|
49
|
+
export interface FindElementsOptions {
|
|
50
|
+
/** Fetch attributes for at most this many matches (default 20); the rest come back as IDs only. */
|
|
51
|
+
maxEnriched?: number;
|
|
52
|
+
/** Stop fetching attributes after this long (default 35 s) so the call stays under MCP client timeouts (~60 s). */
|
|
53
|
+
budgetMs?: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Attribute enrichment costs 7–8 requests per element. Done one element at a time with no cap, 48 iOS home-screen
|
|
57
|
+
* icons took 80–160 s (measured live 2026-10-09) — past the ~60 s MCP client timeout. So: a cap, a time budget, and
|
|
58
|
+
* bounded parallelism (iOS kept low — hammering WebDriverAgent has crashed sessions before). Elements beyond the cap
|
|
59
|
+
* or budget are still returned, with `enriched: false` and null attributes.
|
|
60
|
+
*/
|
|
61
|
+
export declare function findElements(handle: string, using: string, value: string, opts?: FindElementsOptions): Promise<WdElement[]>;
|
|
39
62
|
export declare function findFirstElementId(handle: string, using: string, value: string): Promise<string | null>;
|
|
40
63
|
export declare function tapElement(handle: string, elementId: string): Promise<void>;
|
|
41
64
|
export declare function typeIntoElement(handle: string, elementId: string, text: string): Promise<void>;
|
|
@@ -47,6 +70,21 @@ export declare function getWindowSize(handle: string): Promise<{
|
|
|
47
70
|
export declare function swipeScreen(handle: string, startX: number, startY: number, endX: number, endY: number, durationMs?: number): Promise<'w3c-actions' | 'jwp-touch'>;
|
|
48
71
|
export declare function launchApp(handle: string, packageName: string, activity?: string): Promise<string>;
|
|
49
72
|
export declare function pressBack(handle: string): Promise<string>;
|
|
73
|
+
export type AutomotiveAction = 'start' | 'stop' | 'screenshot' | 'tap' | 'dump';
|
|
74
|
+
export declare function automotiveControl(handle: string, action: AutomotiveAction, opts?: {
|
|
75
|
+
resolution?: AutomotiveResolution;
|
|
76
|
+
clusterContent?: InstrumentClusterContent;
|
|
77
|
+
x?: number;
|
|
78
|
+
y?: number;
|
|
79
|
+
display?: 'main' | 'cluster';
|
|
80
|
+
}): Promise<{
|
|
81
|
+
message: string;
|
|
82
|
+
image?: {
|
|
83
|
+
data: string;
|
|
84
|
+
mimeType: string;
|
|
85
|
+
};
|
|
86
|
+
dump?: string;
|
|
87
|
+
}>;
|
|
50
88
|
export declare function performanceTransaction(handle: string, action: 'start' | 'end', opts: {
|
|
51
89
|
networkProfile?: string;
|
|
52
90
|
transactionName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webdriver.d.ts","sourceRoot":"","sources":["../../src/api/webdriver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AA8BhE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"webdriver.d.ts","sourceRoot":"","sources":["../../src/api/webdriver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AA8BhE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6HAA6H;IAC7H,oBAAoB,CAAC,EAAE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,CAAC,CA2Bf;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAcf;AAED,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAajB;AAID,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,EAChD,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAGhE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAYhE;AAED,wBAAgB,kBAAkB,IAAI,iBAAiB,EAAE,CAExD;AAED,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,CAE9C;AAED,wBAAsB,uBAAuB,IAAI,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CA0BhG"}
|
package/dist/api/webdriver.js
CHANGED
|
@@ -25,6 +25,9 @@ function makeClient() {
|
|
|
25
25
|
headers: { 'Content-Type': 'application/json' },
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
+
/** Android Auto supports all three; CarPlay supports 800x480 only (platform docs). */
|
|
29
|
+
export const AUTOMOTIVE_RESOLUTIONS = ['800x480', '1280x720', '1920x1080'];
|
|
30
|
+
export const INSTRUMENT_CLUSTER_CONTENT = ['Instruction Card', 'Map', 'Navigation App'];
|
|
28
31
|
export async function createInspectionSession(opts) {
|
|
29
32
|
// getActiveAccessKey (not process.env) — the session must be created with the
|
|
30
33
|
// active profile's credential so canDeleteReport is derived from the same credential.
|
|
@@ -64,6 +67,10 @@ export async function createInspectionSession(opts) {
|
|
|
64
67
|
if (opts.appActivity)
|
|
65
68
|
desiredCapabilities['appActivity'] = opts.appActivity;
|
|
66
69
|
}
|
|
70
|
+
if (opts.automotiveProjection)
|
|
71
|
+
desiredCapabilities['digitalai:automotiveProjection'] = opts.automotiveProjection;
|
|
72
|
+
if (opts.instrumentCluster)
|
|
73
|
+
desiredCapabilities['digitalai:instrumentCluster'] = opts.instrumentCluster;
|
|
67
74
|
// Dual-protocol session request: the proprietary Grid (JWP) reads
|
|
68
75
|
// desiredCapabilities; standard Appium Server (W3C) reads capabilities.alwaysMatch
|
|
69
76
|
// and requires non-standard caps to carry the appium: vendor prefix.
|
|
@@ -137,6 +144,7 @@ export async function createInspectionSession(opts) {
|
|
|
137
144
|
sessionFormat: isW3c ? 'w3c' : 'jwp',
|
|
138
145
|
platform,
|
|
139
146
|
projectName,
|
|
147
|
+
...(opts.automotiveProjection ? { automotiveMode: 'capability', automotiveRunning: true } : {}),
|
|
140
148
|
};
|
|
141
149
|
sessionRegistry.set(handle, session);
|
|
142
150
|
return session;
|
|
@@ -222,7 +230,13 @@ export async function getPageSource(handle) {
|
|
|
222
230
|
});
|
|
223
231
|
return res.data.value ?? '';
|
|
224
232
|
}
|
|
225
|
-
|
|
233
|
+
/**
|
|
234
|
+
* Attribute enrichment costs 7–8 requests per element. Done one element at a time with no cap, 48 iOS home-screen
|
|
235
|
+
* icons took 80–160 s (measured live 2026-10-09) — past the ~60 s MCP client timeout. So: a cap, a time budget, and
|
|
236
|
+
* bounded parallelism (iOS kept low — hammering WebDriverAgent has crashed sessions before). Elements beyond the cap
|
|
237
|
+
* or budget are still returned, with `enriched: false` and null attributes.
|
|
238
|
+
*/
|
|
239
|
+
export async function findElements(handle, using, value, opts = {}) {
|
|
226
240
|
const session = requireSession(handle);
|
|
227
241
|
const client = makeClient();
|
|
228
242
|
const sid = session.gridSessionId;
|
|
@@ -234,11 +248,14 @@ export async function findElements(handle, using, value) {
|
|
|
234
248
|
throw new Error(sessionAwareError(e, handle));
|
|
235
249
|
}
|
|
236
250
|
const rawList = res.data.value ?? [];
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
251
|
+
const ids = rawList
|
|
252
|
+
.map((raw) => raw['ELEMENT'] ?? raw['element-6066-11e4-a52e-4f735466cecf'])
|
|
253
|
+
.filter((id) => Boolean(id));
|
|
254
|
+
const bare = (elementId) => ({
|
|
255
|
+
elementId, className: null, resourceId: null, contentDesc: null, text: null, bounds: null,
|
|
256
|
+
clickable: null, enabled: null, name: null, label: null, value: null, enriched: false,
|
|
257
|
+
});
|
|
258
|
+
const enrich = async (elementId) => {
|
|
242
259
|
if (session.platform === 'ios') {
|
|
243
260
|
// iOS attribute model: name/label/value/type. XCUITest rejects Android
|
|
244
261
|
// names (class, text, bounds) outright; the Grid exposes `class` instead
|
|
@@ -260,7 +277,7 @@ export async function findElements(handle, using, value) {
|
|
|
260
277
|
catch {
|
|
261
278
|
// Non-fatal — element is still usable without geometry
|
|
262
279
|
}
|
|
263
|
-
|
|
280
|
+
return {
|
|
264
281
|
elementId,
|
|
265
282
|
className: type ?? cls,
|
|
266
283
|
resourceId: null,
|
|
@@ -272,8 +289,8 @@ export async function findElements(handle, using, value) {
|
|
|
272
289
|
name,
|
|
273
290
|
label,
|
|
274
291
|
value: val,
|
|
275
|
-
|
|
276
|
-
|
|
292
|
+
enriched: true,
|
|
293
|
+
};
|
|
277
294
|
}
|
|
278
295
|
// Android: Appium 1.x JWP uses XML-matching hyphenated attribute names
|
|
279
296
|
const [className, resourceId, contentDesc, text, bounds, clickable, enabled] = await Promise.allSettled([
|
|
@@ -285,7 +302,7 @@ export async function findElements(handle, using, value) {
|
|
|
285
302
|
getAttr(client, sid, elementId, 'clickable'),
|
|
286
303
|
getAttr(client, sid, elementId, 'enabled'),
|
|
287
304
|
]).then((rs) => rs.map((r) => (r.status === 'fulfilled' ? r.value : null)));
|
|
288
|
-
|
|
305
|
+
return {
|
|
289
306
|
elementId,
|
|
290
307
|
className,
|
|
291
308
|
resourceId,
|
|
@@ -297,8 +314,21 @@ export async function findElements(handle, using, value) {
|
|
|
297
314
|
name: null,
|
|
298
315
|
label: null,
|
|
299
316
|
value: null,
|
|
300
|
-
|
|
301
|
-
|
|
317
|
+
enriched: true,
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
const maxEnriched = Math.max(0, opts.maxEnriched ?? 20);
|
|
321
|
+
const deadline = Date.now() + (opts.budgetMs ?? 35_000);
|
|
322
|
+
const concurrency = session.platform === 'ios' ? 2 : 4;
|
|
323
|
+
const elements = ids.map(bare);
|
|
324
|
+
let next = 0;
|
|
325
|
+
const worker = async () => {
|
|
326
|
+
while (next < Math.min(ids.length, maxEnriched) && Date.now() < deadline) {
|
|
327
|
+
const i = next++;
|
|
328
|
+
elements[i] = await enrich(ids[i]);
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
await Promise.all(Array.from({ length: Math.min(concurrency, ids.length) }, worker));
|
|
302
332
|
return elements;
|
|
303
333
|
}
|
|
304
334
|
// Lightweight single-element lookup: one round trip via the singular /element
|
|
@@ -409,6 +439,37 @@ function isUnknownCommand(e) {
|
|
|
409
439
|
text.includes('not implemented') ||
|
|
410
440
|
text.includes('could not find a route'));
|
|
411
441
|
}
|
|
442
|
+
/**
|
|
443
|
+
* Run a gesture through the session's native mechanism, falling back to the other protocol on an unknown-command
|
|
444
|
+
* error. W3C sessions (Appium 2/3) use POST /actions; JWP sessions (the Grid) use POST /touch/perform.
|
|
445
|
+
*
|
|
446
|
+
* Appium 3 removed /touch/perform (verified live on Appium Server 3.8.0: 404). When a W3C gesture fails and the
|
|
447
|
+
* fallback 404s too, the old code surfaced only the FALLBACK's error — "touch/perform not found" — hiding why
|
|
448
|
+
* /actions failed. Both errors are now reported, the primary first. The primary error's HTTP response stays attached
|
|
449
|
+
* so sessionAwareError can still recognise a dead session (404 on every route).
|
|
450
|
+
*/
|
|
451
|
+
async function gestureWithFallback(session, w3c, jwp) {
|
|
452
|
+
const order = session.sessionFormat === 'w3c' ? [['w3c-actions', w3c], ['jwp-touch', jwp]] : [['jwp-touch', jwp], ['w3c-actions', w3c]];
|
|
453
|
+
try {
|
|
454
|
+
await order[0][1]();
|
|
455
|
+
return order[0][0];
|
|
456
|
+
}
|
|
457
|
+
catch (e) {
|
|
458
|
+
if (!isUnknownCommand(e))
|
|
459
|
+
throw e;
|
|
460
|
+
try {
|
|
461
|
+
await order[1][1]();
|
|
462
|
+
return order[1][0];
|
|
463
|
+
}
|
|
464
|
+
catch (e2) {
|
|
465
|
+
const note = order[1][0] === 'jwp-touch' ? ' (the legacy /touch/perform route does not exist on Appium 3)' : '';
|
|
466
|
+
const combined = new Error(`${order[0][0] === 'w3c-actions' ? 'W3C /actions' : 'JWP /touch/perform'} failed: ${describeWdError(e)}; ` +
|
|
467
|
+
`fallback ${order[1][0] === 'w3c-actions' ? 'W3C /actions' : 'JWP /touch/perform'} failed: ${describeWdError(e2)}${note}`);
|
|
468
|
+
combined.response = e.response;
|
|
469
|
+
throw combined;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
412
473
|
export async function getWindowSize(handle) {
|
|
413
474
|
const session = requireSession(handle);
|
|
414
475
|
const client = makeClient();
|
|
@@ -459,28 +520,7 @@ export async function swipeScreen(handle, startX, startY, endX, endY, durationMs
|
|
|
459
520
|
{ action: 'release', options: {} },
|
|
460
521
|
],
|
|
461
522
|
}, { timeout: 30_000 });
|
|
462
|
-
|
|
463
|
-
try {
|
|
464
|
-
await w3c();
|
|
465
|
-
return 'w3c-actions';
|
|
466
|
-
}
|
|
467
|
-
catch (e) {
|
|
468
|
-
if (!isUnknownCommand(e))
|
|
469
|
-
throw e;
|
|
470
|
-
await jwp();
|
|
471
|
-
return 'jwp-touch';
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
try {
|
|
475
|
-
await jwp();
|
|
476
|
-
return 'jwp-touch';
|
|
477
|
-
}
|
|
478
|
-
catch (e) {
|
|
479
|
-
if (!isUnknownCommand(e))
|
|
480
|
-
throw e;
|
|
481
|
-
await w3c();
|
|
482
|
-
return 'w3c-actions';
|
|
483
|
-
}
|
|
523
|
+
return gestureWithFallback(session, w3c, jwp);
|
|
484
524
|
}
|
|
485
525
|
export async function launchApp(handle, packageName, activity) {
|
|
486
526
|
const session = requireSession(handle);
|
|
@@ -501,7 +541,13 @@ export async function launchApp(handle, packageName, activity) {
|
|
|
501
541
|
errors.push(`${desc}: ${detail}`);
|
|
502
542
|
}
|
|
503
543
|
}
|
|
504
|
-
|
|
544
|
+
// On Appium Grid an app that is not installed on the allocated device fails with an opaque "javascript error …
|
|
545
|
+
// status='false'" (verified live 2026-10-09: the same launch succeeded once the app was installed via the session's
|
|
546
|
+
// app capability) — so name the most likely cause instead of leaving the caller with the raw message.
|
|
547
|
+
throw new Error(`All launch mechanisms failed:\n ${errors.join('\n ')}\n` +
|
|
548
|
+
'Most common cause: the app is not installed on THIS device. Install it first (install_application on this device ' +
|
|
549
|
+
'before the session, or start the session with app="cloud:<package>/<activity>"), and pass the exact activity from ' +
|
|
550
|
+
'get_application_info.mainActivity.');
|
|
505
551
|
};
|
|
506
552
|
if (session.platform === 'ios') {
|
|
507
553
|
// iOS launches by bundle ID — there is no activity concept.
|
|
@@ -567,9 +613,91 @@ export async function pressBack(handle) {
|
|
|
567
613
|
}
|
|
568
614
|
// Execute a script via the protocol-appropriate endpoint.
|
|
569
615
|
// JWP agents route /execute; W3C agents (Appium 2/3) only route /execute/sync.
|
|
570
|
-
function execScript(client, session, script, args) {
|
|
616
|
+
function execScript(client, session, script, args, timeoutMs = 30_000) {
|
|
571
617
|
const path = session.sessionFormat === 'w3c' ? 'execute/sync' : 'execute';
|
|
572
|
-
return client.post(`/session/${session.gridSessionId}/${path}`, { script, args }, { timeout:
|
|
618
|
+
return client.post(`/session/${session.gridSessionId}/${path}`, { script, args }, { timeout: timeoutMs });
|
|
619
|
+
}
|
|
620
|
+
export async function automotiveControl(handle, action, opts = {}) {
|
|
621
|
+
const session = requireSession(handle);
|
|
622
|
+
if (session.platform === 'web')
|
|
623
|
+
throw new Error('automotive_control needs a mobile inspection session (Android Auto / CarPlay), not a browser session.');
|
|
624
|
+
const client = makeClient();
|
|
625
|
+
const run = (script, args, timeoutMs) => execScript(client, session, script, args, timeoutMs);
|
|
626
|
+
try {
|
|
627
|
+
switch (action) {
|
|
628
|
+
case 'start': {
|
|
629
|
+
if (session.automotiveMode === 'capability') {
|
|
630
|
+
return { message: 'Projection is already running — this session was started with automotiveProjection, and the platform refuses start/stop for such sessions.' };
|
|
631
|
+
}
|
|
632
|
+
if (session.automotiveRunning)
|
|
633
|
+
return { message: 'Projection is already running for this session — call stop first to change resolution.' };
|
|
634
|
+
const resolution = opts.resolution ?? '800x480';
|
|
635
|
+
const args = [resolution];
|
|
636
|
+
if (opts.clusterContent) {
|
|
637
|
+
if (session.platform !== 'ios')
|
|
638
|
+
throw new Error('clusterContent (instrument cluster) is CarPlay / iOS only.');
|
|
639
|
+
args.push(opts.clusterContent);
|
|
640
|
+
}
|
|
641
|
+
await run('digitalai:automotive.start', args, 180_000);
|
|
642
|
+
session.automotiveMode = 'command';
|
|
643
|
+
session.automotiveRunning = true;
|
|
644
|
+
return { message: `Projection started at ${resolution}${opts.clusterContent ? ` with cluster content "${opts.clusterContent}"` : ''}. Use action "screenshot" to see the head unit.` };
|
|
645
|
+
}
|
|
646
|
+
case 'stop': {
|
|
647
|
+
if (session.automotiveMode === 'capability') {
|
|
648
|
+
return { message: 'This session was started with automotiveProjection — projection stays on until the session ends (the platform refuses stop).' };
|
|
649
|
+
}
|
|
650
|
+
await run('digitalai:automotive.stop', [], 120_000);
|
|
651
|
+
session.automotiveRunning = false;
|
|
652
|
+
return { message: 'Projection stopped. The phone remains controllable with the normal inspection tools.' };
|
|
653
|
+
}
|
|
654
|
+
case 'screenshot': {
|
|
655
|
+
const args = opts.display === 'cluster' ? ['cluster'] : [];
|
|
656
|
+
const res = await run('digitalai:automotive.getScreenshot', args, 60_000);
|
|
657
|
+
const data = String(res.data.value ?? '');
|
|
658
|
+
if (!data)
|
|
659
|
+
throw new Error('the platform returned an empty projection screenshot');
|
|
660
|
+
const mimeType = data.startsWith('/9j/') ? 'image/jpeg' : 'image/png';
|
|
661
|
+
const note = opts.display === 'cluster' && session.platform !== 'ios' ? ' (the instrument cluster is CarPlay-only — Android returns the main display)' : '';
|
|
662
|
+
return { message: `Projection screenshot captured${note}.`, image: { data, mimeType } };
|
|
663
|
+
}
|
|
664
|
+
case 'tap': {
|
|
665
|
+
if (opts.x == null || opts.y == null)
|
|
666
|
+
throw new Error('tap needs x and y in projection-display coordinates (e.g. 0–800 × 0–480 at 800x480).');
|
|
667
|
+
await run('digitalai:automotive.tap', [opts.x, opts.y], 30_000);
|
|
668
|
+
return { message: `Tapped the projected display at (${opts.x}, ${opts.y}).` };
|
|
669
|
+
}
|
|
670
|
+
case 'dump': {
|
|
671
|
+
if (session.platform !== 'ios')
|
|
672
|
+
throw new Error('dump is CarPlay / iOS only — the platform does not implement it for Android. Use action "screenshot" instead.');
|
|
673
|
+
const res = await run('digitalai:automotive.getDump', [], 60_000);
|
|
674
|
+
return { message: 'Projection element dump captured.', dump: String(res.data.value ?? '') };
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
catch (e) {
|
|
679
|
+
throw new Error(`automotive_control ${action} failed: ${automotiveError(e, handle)}`);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
// The platform answers automotive commands it can't run with 404/500 + a specific message — NOT a dead session. Only
|
|
683
|
+
// fall back to the dead-session diagnosis (sessionAwareError) when the message is not one of these.
|
|
684
|
+
function automotiveError(e, handle) {
|
|
685
|
+
const detail = describeWdError(e);
|
|
686
|
+
if (/start\("?LOW"?\)|Failed to execute start/i.test(detail)) {
|
|
687
|
+
return (`${detail} — the mid-session start command is not supported on this device. Start a new session with ` +
|
|
688
|
+
`automotiveProjection instead (verified: a Galaxy S10 / Android 12 fails this command but projects fine with the ` +
|
|
689
|
+
`capability; Pixel 7/8 support both). An Android Automotive OS emulator is not a projection target at all — drive it ` +
|
|
690
|
+
`with the normal inspection tools.`);
|
|
691
|
+
}
|
|
692
|
+
if (/hybridRunJavascript/i.test(detail)) {
|
|
693
|
+
// Verified live 2026-10-09 on an Appium Grid project: the Grid execute layer treats digitalai:automotive.* as page
|
|
694
|
+
// JavaScript, so every automotive command fails — with or without the automotiveProjection capability.
|
|
695
|
+
return ('Appium Grid does not support Android Auto / CarPlay projection commands (the Grid execute layer runs them as ' +
|
|
696
|
+
'JavaScript). Use a project on Appium Server — projection is verified there.');
|
|
697
|
+
}
|
|
698
|
+
if (/automotive|projection|DHU|cluster|GetDump/i.test(detail))
|
|
699
|
+
return detail;
|
|
700
|
+
return sessionAwareError(e, handle);
|
|
573
701
|
}
|
|
574
702
|
// Start or end a Digital.ai performance transaction inside a live inspection
|
|
575
703
|
// session. The platform records CPU/memory/battery/network + Speed Index for
|
|
@@ -652,15 +780,7 @@ export async function longPress(handle, opts, durationMs = 1500) {
|
|
|
652
780
|
},
|
|
653
781
|
],
|
|
654
782
|
}, { timeout: 30_000 });
|
|
655
|
-
|
|
656
|
-
try {
|
|
657
|
-
await primary();
|
|
658
|
-
}
|
|
659
|
-
catch (e) {
|
|
660
|
-
if (!isUnknownCommand(e))
|
|
661
|
-
throw e;
|
|
662
|
-
await fallback();
|
|
663
|
-
}
|
|
783
|
+
await gestureWithFallback(session, w3c, jwp);
|
|
664
784
|
}
|
|
665
785
|
export async function doubleTap(handle, opts) {
|
|
666
786
|
const session = requireSession(handle);
|
|
@@ -686,15 +806,7 @@ export async function doubleTap(handle, opts) {
|
|
|
686
806
|
},
|
|
687
807
|
],
|
|
688
808
|
}, { timeout: 30_000 });
|
|
689
|
-
|
|
690
|
-
try {
|
|
691
|
-
await primary();
|
|
692
|
-
}
|
|
693
|
-
catch (e) {
|
|
694
|
-
if (!isUnknownCommand(e))
|
|
695
|
-
throw e;
|
|
696
|
-
await fallback();
|
|
697
|
-
}
|
|
809
|
+
await gestureWithFallback(session, w3c, jwp);
|
|
698
810
|
}
|
|
699
811
|
export async function dragAndDrop(handle, startX, startY, endX, endY, holdMs = 600, moveMs = 1200) {
|
|
700
812
|
const session = requireSession(handle);
|
|
@@ -726,15 +838,7 @@ export async function dragAndDrop(handle, startX, startY, endX, endY, holdMs = 6
|
|
|
726
838
|
},
|
|
727
839
|
],
|
|
728
840
|
}, { timeout: 30_000 });
|
|
729
|
-
|
|
730
|
-
try {
|
|
731
|
-
await primary();
|
|
732
|
-
}
|
|
733
|
-
catch (e) {
|
|
734
|
-
if (!isUnknownCommand(e))
|
|
735
|
-
throw e;
|
|
736
|
-
await fallback();
|
|
737
|
-
}
|
|
841
|
+
await gestureWithFallback(session, w3c, jwp);
|
|
738
842
|
}
|
|
739
843
|
export async function pinchZoom(handle, direction, centerX, centerY, distance = 300, durationMs = 400) {
|
|
740
844
|
const session = requireSession(handle);
|
|
@@ -783,7 +887,7 @@ export async function scrollToElement(handle, using, value, direction = 'up', ma
|
|
|
783
887
|
let swipesUsed = 0;
|
|
784
888
|
let lastSource = '';
|
|
785
889
|
for (let i = 0; i <= maxSwipes; i++) {
|
|
786
|
-
const found = await findElements(handle, using, value);
|
|
890
|
+
const found = await findElements(handle, using, value, { maxEnriched: 1 });
|
|
787
891
|
if (found.length > 0)
|
|
788
892
|
return { found: true, element: found[0], swipesUsed, reachedEnd: false };
|
|
789
893
|
if (i === maxSwipes)
|