@browserstack/mcp-server 2.2.5-beta.3 → 2.2.6-beta.1
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 +32 -194
- package/dist/server-factory.js +1 -6
- package/dist/tools/accessibility.js +62 -576
- package/dist/tools/accessiblity-utils/accessibility-rag.d.ts +12 -0
- package/dist/tools/accessiblity-utils/accessibility-rag.js +59 -0
- package/dist/tools/accessiblity-utils/report-fetcher.d.ts +7 -116
- package/dist/tools/accessiblity-utils/report-fetcher.js +29 -268
- package/dist/tools/accessiblity-utils/report-parser.d.ts +1 -41
- package/dist/tools/accessiblity-utils/report-parser.js +43 -142
- package/dist/tools/appautomate-utils/appium-sdk/config-generator.d.ts +0 -2
- package/dist/tools/appautomate-utils/appium-sdk/config-generator.js +5 -15
- package/dist/tools/appautomate-utils/appium-sdk/constants.d.ts +1 -2
- package/dist/tools/appautomate-utils/appium-sdk/constants.js +1 -6
- package/dist/tools/appautomate-utils/appium-sdk/handler.js +1 -11
- package/dist/tools/appautomate-utils/appium-sdk/instructions.d.ts +1 -3
- package/dist/tools/appautomate-utils/appium-sdk/instructions.js +2 -2
- package/dist/tools/appautomate-utils/appium-sdk/languages/nodejs.d.ts +1 -3
- package/dist/tools/appautomate-utils/appium-sdk/languages/nodejs.js +6 -19
- package/dist/tools/appautomate-utils/native-execution/appautomate.d.ts +2 -7
- package/dist/tools/appautomate-utils/native-execution/appautomate.js +12 -15
- package/dist/tools/appautomate-utils/native-execution/constants.d.ts +1 -2
- package/dist/tools/appautomate-utils/native-execution/constants.js +1 -6
- package/dist/tools/appautomate.js +16 -29
- package/dist/tools/testmanagement-utils/create-testrun.d.ts +1 -1
- package/dist/tools/testmanagement-utils/update-testrun.d.ts +1 -1
- package/dist/tools/tool-handoff.d.ts +2 -3
- package/dist/tools/tool-handoff.js +2 -3
- package/package.json +1 -1
- package/dist/lib/accessibility-routing.d.ts +0 -5
- package/dist/lib/accessibility-routing.js +0 -5
- package/dist/tools/accessiblity-utils/app-report-fetcher.d.ts +0 -341
- package/dist/tools/accessiblity-utils/app-report-fetcher.js +0 -731
- package/dist/tools/accessiblity-utils/paginate.d.ts +0 -21
- package/dist/tools/accessiblity-utils/paginate.js +0 -44
- package/dist/tools/appautomate-utils/appium-sdk/languages/accessibility.d.ts +0 -2
- package/dist/tools/appautomate-utils/appium-sdk/languages/accessibility.js +0 -32
|
@@ -96,26 +96,8 @@ async function takeAppScreenshot(args) {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
/**
|
|
100
|
-
* What a native suite needs for App Accessibility to scan it. The build request's flag
|
|
101
|
-
* turns the checks on, but only a suite built with BrowserStack's instrumentation records
|
|
102
|
-
* scans; without it the run finishes with none, and nothing says why.
|
|
103
|
-
*/
|
|
104
|
-
const NATIVE_ACCESSIBILITY_SETUP = {
|
|
105
|
-
Espresso: "The test suite must be built with BrowserStack's Gradle plugin and SDK, or the run records no scans: classpath 'com.browserstack:gradle-tool:latest.release' in the root build.gradle, id 'com.browserstack.gradle-tool' in the app's plugins, and androidTestImplementation 'com.browserstack:browserstack-java-sdk:latest.release' (1.31.0 or newer). The app also needs internet permission.",
|
|
106
|
-
XCUITest: "The UI test target must embed and initialize the BrowserStack Swift SDK (BrowserstackSwiftSDK.xcframework, or the Swift package), or the run records no scans: set NSPrincipalClass to BrowserstackSwiftSDK.BrowserstackSwiftSDK in the test target's Info.plist, or call BrowserstackSwiftSDK.init() in the test class's init(). Swift 5.4+ and iOS 14+.",
|
|
107
|
-
};
|
|
108
|
-
/** The run's build and, with accessibility on, where its issues are read once it finishes. */
|
|
109
|
-
function runStartedMessage(framework, buildId, accessibility) {
|
|
110
|
-
const link = `https://app-automate.browserstack.com/builds/${buildId}`;
|
|
111
|
-
const a11y = accessibility
|
|
112
|
-
? `\n\n♿ App Accessibility checks are on. ${NATIVE_ACCESSIBILITY_SETUP[framework] ?? ""}\nWhen the build finishes (typically 10–20 minutes), read the issues with fetchAccessibilityIssues, reportUrl: ${link} — it maps the build to its accessibility report and waits while the report is still processing.`
|
|
113
|
-
: "";
|
|
114
|
-
return `✅ ${framework} run started successfully!\n\n🔧 Build ID: ${buildId}\n🔗 View your build: ${link}${a11y}`;
|
|
115
|
-
}
|
|
116
99
|
//Runs AppAutomate tests on BrowserStack by uploading app and test suite, then triggering a test run.
|
|
117
100
|
async function runAppTestsOnBrowserStack(args, config) {
|
|
118
|
-
const accessibility = args.accessibility === true;
|
|
119
101
|
// Validate that either paths or URLs are provided for both app and test suite
|
|
120
102
|
if (!args.browserstackAppUrl && !args.appPath) {
|
|
121
103
|
throw new Error("appPath is required when browserstackAppUrl is not provided");
|
|
@@ -123,13 +105,8 @@ async function runAppTestsOnBrowserStack(args, config) {
|
|
|
123
105
|
if (!args.browserstackTestSuiteUrl && !args.testSuitePath) {
|
|
124
106
|
throw new Error("testSuitePath is required when browserstackTestSuiteUrl is not provided");
|
|
125
107
|
}
|
|
126
|
-
// Validate devices against real BrowserStack device data
|
|
127
|
-
|
|
128
|
-
// a device that never matches.
|
|
129
|
-
const validated = await validateAppAutomateDevices(args.devices);
|
|
130
|
-
const deviceStrings = args.devices.length > 0
|
|
131
|
-
? validated.map((device) => `${device.deviceName}-${device.osVersion}`)
|
|
132
|
-
: [];
|
|
108
|
+
// Validate devices against real BrowserStack device data
|
|
109
|
+
await validateAppAutomateDevices(args.devices);
|
|
133
110
|
switch (args.detectedAutomationFramework) {
|
|
134
111
|
case AppTestPlatform.ESPRESSO: {
|
|
135
112
|
try {
|
|
@@ -151,12 +128,17 @@ async function runAppTestsOnBrowserStack(args, config) {
|
|
|
151
128
|
test_suite_url = await uploadEspressoTestSuite(args.testSuitePath, config);
|
|
152
129
|
logger.info(`Test suite uploaded. URL: ${test_suite_url}`);
|
|
153
130
|
}
|
|
154
|
-
|
|
131
|
+
// Convert array format to string format for Espresso
|
|
132
|
+
const deviceStrings = args.devices.map((device) => {
|
|
133
|
+
const [, deviceName, osVersion] = device;
|
|
134
|
+
return `${deviceName}-${osVersion}`;
|
|
135
|
+
});
|
|
136
|
+
const build_id = await triggerEspressoBuild(app_url, test_suite_url, deviceStrings, args.project, config);
|
|
155
137
|
return {
|
|
156
138
|
content: [
|
|
157
139
|
{
|
|
158
140
|
type: "text",
|
|
159
|
-
text:
|
|
141
|
+
text: `✅ Espresso run started successfully!\n\n🔧 Build ID: ${build_id}\n🔗 View your build: https://app-automate.browserstack.com/builds/${build_id}`,
|
|
160
142
|
},
|
|
161
143
|
],
|
|
162
144
|
};
|
|
@@ -186,12 +168,17 @@ async function runAppTestsOnBrowserStack(args, config) {
|
|
|
186
168
|
test_suite_url = await uploadXcuiTestSuite(args.testSuitePath, config);
|
|
187
169
|
logger.info(`Test suite uploaded. URL: ${test_suite_url}`);
|
|
188
170
|
}
|
|
189
|
-
|
|
171
|
+
// Convert array format to string format for XCUITest
|
|
172
|
+
const deviceStrings = args.devices.map((device) => {
|
|
173
|
+
const [, deviceName, osVersion] = device;
|
|
174
|
+
return `${deviceName}-${osVersion}`;
|
|
175
|
+
});
|
|
176
|
+
const build_id = await triggerXcuiBuild(app_url, test_suite_url, deviceStrings, args.project, config);
|
|
190
177
|
return {
|
|
191
178
|
content: [
|
|
192
179
|
{
|
|
193
180
|
type: "text",
|
|
194
|
-
text:
|
|
181
|
+
text: `✅ XCUITest run started successfully!\n\n🔧 Build ID: ${build_id}\n🔗 View your build: https://app-automate.browserstack.com/builds/${build_id}`,
|
|
195
182
|
},
|
|
196
183
|
],
|
|
197
184
|
};
|
|
@@ -11,8 +11,8 @@ export declare const CreateTestRunSchema: z.ZodObject<{
|
|
|
11
11
|
description: z.ZodOptional<z.ZodString>;
|
|
12
12
|
run_state: z.ZodOptional<z.ZodEnum<{
|
|
13
13
|
done: "done";
|
|
14
|
-
in_progress: "in_progress";
|
|
15
14
|
new_run: "new_run";
|
|
15
|
+
in_progress: "in_progress";
|
|
16
16
|
under_review: "under_review";
|
|
17
17
|
rejected: "rejected";
|
|
18
18
|
closed: "closed";
|
|
@@ -11,8 +11,8 @@ export declare const UpdateTestRunSchema: z.ZodObject<{
|
|
|
11
11
|
name: z.ZodOptional<z.ZodString>;
|
|
12
12
|
run_state: z.ZodOptional<z.ZodEnum<{
|
|
13
13
|
done: "done";
|
|
14
|
-
in_progress: "in_progress";
|
|
15
14
|
new_run: "new_run";
|
|
15
|
+
in_progress: "in_progress";
|
|
16
16
|
under_review: "under_review";
|
|
17
17
|
rejected: "rejected";
|
|
18
18
|
closed: "closed";
|
|
@@ -62,9 +62,8 @@ export declare const NEEDS_BUILD_ID: string;
|
|
|
62
62
|
*/
|
|
63
63
|
export declare const NEEDS_SESSION_ID: string;
|
|
64
64
|
/**
|
|
65
|
-
* A scan run's ids come from startAccessibilityScan
|
|
66
|
-
* the
|
|
67
|
-
* dashboard link, or an Automate link, and looks the ids up itself.
|
|
65
|
+
* A scan run's ids come from startAccessibilityScan. Nothing here lists builds or reports,
|
|
66
|
+
* but the tool takes a report's dashboard link and looks the ids up itself.
|
|
68
67
|
*/
|
|
69
68
|
export declare const NEEDS_A11Y_SCAN_ID = " Ids: startAccessibilityScan or a dashboard link; nothing here lists reports.";
|
|
70
69
|
/** Auth-config ids are not listable by any tool here. */
|
|
@@ -71,9 +71,8 @@ export const NEEDS_BUILD_ID = needsIdFrom("a BrowserStack build id", "getBuildId
|
|
|
71
71
|
export const NEEDS_SESSION_ID = " Requires a session id. listSessions lists them for a build; if you do not have the " +
|
|
72
72
|
"build either, getBuildId or listBuildId resolves one from a project and build name.";
|
|
73
73
|
/**
|
|
74
|
-
* A scan run's ids come from startAccessibilityScan
|
|
75
|
-
* the
|
|
76
|
-
* dashboard link, or an Automate link, and looks the ids up itself.
|
|
74
|
+
* A scan run's ids come from startAccessibilityScan. Nothing here lists builds or reports,
|
|
75
|
+
* but the tool takes a report's dashboard link and looks the ids up itself.
|
|
77
76
|
*/
|
|
78
77
|
export const NEEDS_A11Y_SCAN_ID = " Ids: startAccessibilityScan or a dashboard link; nothing here lists reports.";
|
|
79
78
|
/** Auth-config ids are not listable by any tool here. */
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Which product checks what for accessibility, said once to every client, since the tools
|
|
3
|
-
* alone do not tell an agent that a web page and a mobile app are scanned differently.
|
|
4
|
-
*/
|
|
5
|
-
export declare const ACCESSIBILITY_ROUTING_INSTRUCTION = "Accessibility checks: a web page or site \u2192 startAccessibilityScan (Website Scanner); a multi-step web flow \u2192 Automate tests with `accessibility: true` in browserstack.yml (setupBrowserStackAutomateTests); a mobile app \u2192 its tests on App Automate with accessibility on (setupBrowserStackAppAutomateTests, or runAppTestsOnBrowserStack for Espresso/XCUITest). Then read the issues with fetchAccessibilityIssues.";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Which product checks what for accessibility, said once to every client, since the tools
|
|
3
|
-
* alone do not tell an agent that a web page and a mobile app are scanned differently.
|
|
4
|
-
*/
|
|
5
|
-
export const ACCESSIBILITY_ROUTING_INSTRUCTION = "Accessibility checks: a web page or site → startAccessibilityScan (Website Scanner); a multi-step web flow → Automate tests with `accessibility: true` in browserstack.yml (setupBrowserStackAutomateTests); a mobile app → its tests on App Automate with accessibility on (setupBrowserStackAppAutomateTests, or runAppTestsOnBrowserStack for Espresso/XCUITest). Then read the issues with fetchAccessibilityIssues.";
|
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* App Accessibility: the issues of a mobile app build run through App Automate with
|
|
3
|
-
* accessibility on. Unlike the web products there is no CSV export behind an access key,
|
|
4
|
-
* so the issues come inline, one API page per batch of scanned screens.
|
|
5
|
-
*/
|
|
6
|
-
export declare const APP_API_BASE = "https://api-app-accessibility.browserstack.com/automate/api/v1";
|
|
7
|
-
export declare const APP_DASHBOARD = "https://app-accessibility.browserstack.com";
|
|
8
|
-
/** Manual (Workflow Analyzer) reports recorded on the dashboard: a separate, older route. */
|
|
9
|
-
export declare const MANUAL_API_BASE = "https://api-app-accessibility.browserstack.com/api/v1";
|
|
10
|
-
export declare const MAX_SNAPSHOT_PAGES = 20;
|
|
11
|
-
/** A dashboard link names a build by number; a build someone just opened is among the newest. */
|
|
12
|
-
export declare const MAX_APP_BUILD_LIST_PAGES = 3;
|
|
13
|
-
export declare const MAX_APP_AUTOMATE_BUILD_PAGES = 3;
|
|
14
|
-
export interface AppBuildMeta {
|
|
15
|
-
/** The build's number within its project, which the dashboard link uses. */
|
|
16
|
-
build_id: number;
|
|
17
|
-
created_at?: string;
|
|
18
|
-
th_build_id: string;
|
|
19
|
-
name: string;
|
|
20
|
-
normalised_name: string;
|
|
21
|
-
project_name: string;
|
|
22
|
-
/** running | rule_processing | passed | failed | timeout | update_os_version */
|
|
23
|
-
status: string;
|
|
24
|
-
issue_summary?: {
|
|
25
|
-
total?: number;
|
|
26
|
-
scan_count?: number;
|
|
27
|
-
};
|
|
28
|
-
fup?: {
|
|
29
|
-
capped?: boolean;
|
|
30
|
-
tests_partial?: boolean;
|
|
31
|
-
tests_dropped?: boolean;
|
|
32
|
-
};
|
|
33
|
-
/** What ran the tests: an SDK framework (pytest, …) or a native one (Espresso-Junit4, …). */
|
|
34
|
-
session_data?: {
|
|
35
|
-
framework?: {
|
|
36
|
-
name?: string;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
interface AppRuleIssue {
|
|
41
|
-
uid: string;
|
|
42
|
-
status?: string;
|
|
43
|
-
duplication_count?: number;
|
|
44
|
-
issue_class_android?: string;
|
|
45
|
-
issue_class_ios?: string;
|
|
46
|
-
issue_id_android?: string;
|
|
47
|
-
issue_id_ios?: string;
|
|
48
|
-
how_to_fix_desc?: string;
|
|
49
|
-
issue_details?: {
|
|
50
|
-
label?: string;
|
|
51
|
-
value?: unknown;
|
|
52
|
-
}[];
|
|
53
|
-
}
|
|
54
|
-
interface AppRule {
|
|
55
|
-
rule_id: string;
|
|
56
|
-
label: string;
|
|
57
|
-
description?: string;
|
|
58
|
-
severity?: string;
|
|
59
|
-
guidelines?: {
|
|
60
|
-
message?: string;
|
|
61
|
-
}[];
|
|
62
|
-
rule_issues?: AppRuleIssue[];
|
|
63
|
-
}
|
|
64
|
-
export interface AppSnapshot {
|
|
65
|
-
meta?: {
|
|
66
|
-
screenshot_url?: string;
|
|
67
|
-
testcase_name?: string;
|
|
68
|
-
/** A manual report's snapshot keeps its rules here. */
|
|
69
|
-
aggregated_results?: AppRule[];
|
|
70
|
-
};
|
|
71
|
-
aggregated_results?: AppRule[];
|
|
72
|
-
}
|
|
73
|
-
export type AppAccessibilityIssue = {
|
|
74
|
-
issue_type: string;
|
|
75
|
-
rule_id: string;
|
|
76
|
-
severity: string;
|
|
77
|
-
/** Which scanned screen of which test the element was on. */
|
|
78
|
-
screen: string;
|
|
79
|
-
/** The element's id when it has one, else its class. */
|
|
80
|
-
component: string;
|
|
81
|
-
/** The element's identifying details, as captured on the device. */
|
|
82
|
-
element: Record<string, unknown>;
|
|
83
|
-
issue_description: string;
|
|
84
|
-
how_to_fix: string;
|
|
85
|
-
/** The WCAG success criteria the rule maps to. */
|
|
86
|
-
wcag: string;
|
|
87
|
-
screenshot?: string;
|
|
88
|
-
/** How many more occurrences of this issue the report folded into it. */
|
|
89
|
-
duplicate_count?: number;
|
|
90
|
-
};
|
|
91
|
-
/** A report's issues counted by severity, by rule and by screen, largest first. */
|
|
92
|
-
export interface AppIssueSummary {
|
|
93
|
-
by_severity: Record<string, number>;
|
|
94
|
-
by_rule: {
|
|
95
|
-
rule_id: string;
|
|
96
|
-
issue_type: string;
|
|
97
|
-
count: number;
|
|
98
|
-
}[];
|
|
99
|
-
by_screen: {
|
|
100
|
-
screen: string;
|
|
101
|
-
count: number;
|
|
102
|
-
}[];
|
|
103
|
-
}
|
|
104
|
-
export interface AppBuildReport {
|
|
105
|
-
records: AppAccessibilityIssue[];
|
|
106
|
-
page_length: number;
|
|
107
|
-
total_issues: number;
|
|
108
|
-
next_page: number | null;
|
|
109
|
-
/** How many issues the pages after this one hold. */
|
|
110
|
-
remaining: number;
|
|
111
|
-
summary: AppIssueSummary;
|
|
112
|
-
/** Issues hidden in the dashboard, which the API leaves out of the screens. */
|
|
113
|
-
hidden_issues: number;
|
|
114
|
-
scan_count: number;
|
|
115
|
-
status: string;
|
|
116
|
-
build_name: string;
|
|
117
|
-
dashboard_link?: string;
|
|
118
|
-
/** Whether the fair-usage cap dropped tests or scans from this build. */
|
|
119
|
-
fup_capped: boolean;
|
|
120
|
-
/** The test framework the build ran under, when the build's details name it. */
|
|
121
|
-
framework?: string;
|
|
122
|
-
}
|
|
123
|
-
/** A manual (Workflow Analyzer) report's issues, read inline from its scanned screens. */
|
|
124
|
-
export interface AppManualReport {
|
|
125
|
-
records: AppAccessibilityIssue[];
|
|
126
|
-
page_length: number;
|
|
127
|
-
/** Every occurrence the API lists; the dashboard folds duplicates it does not mark. */
|
|
128
|
-
total_issues: number;
|
|
129
|
-
next_page: number | null;
|
|
130
|
-
/** How many issues the pages after this one hold. */
|
|
131
|
-
remaining: number;
|
|
132
|
-
summary: AppIssueSummary;
|
|
133
|
-
dashboard_count: number;
|
|
134
|
-
duplicate_occurrences: number;
|
|
135
|
-
hidden_issues: number;
|
|
136
|
-
scan_count: number;
|
|
137
|
-
/** complete | in_progress */
|
|
138
|
-
status: string;
|
|
139
|
-
report_name: string;
|
|
140
|
-
device?: string;
|
|
141
|
-
dashboard_link: string;
|
|
142
|
-
}
|
|
143
|
-
/** Every issue of one app build, with what a comparison needs to know of the build. */
|
|
144
|
-
export interface AppBuildIssues {
|
|
145
|
-
buildId: string;
|
|
146
|
-
build_name: string;
|
|
147
|
-
build_number: number;
|
|
148
|
-
created_at?: string;
|
|
149
|
-
status: string;
|
|
150
|
-
scan_count: number;
|
|
151
|
-
/** The tests whose screens were scanned, in the order first seen. */
|
|
152
|
-
tests: string[];
|
|
153
|
-
issues: AppAccessibilityIssue[];
|
|
154
|
-
}
|
|
155
|
-
/** An earlier build of a project, as the build list names it. */
|
|
156
|
-
export interface AppBuildRef {
|
|
157
|
-
buildId: string;
|
|
158
|
-
name?: string;
|
|
159
|
-
build_number?: number;
|
|
160
|
-
created_at?: string;
|
|
161
|
-
/** Whether it has the later build's name; a native run's builds are each named apart. */
|
|
162
|
-
same_name: boolean;
|
|
163
|
-
/**
|
|
164
|
-
* Whether the project's whole build list was read. When it was not, a build of the same
|
|
165
|
-
* name may still be further back than the newest builds read.
|
|
166
|
-
*/
|
|
167
|
-
searched_all: boolean;
|
|
168
|
-
}
|
|
169
|
-
export interface AppProjectRow {
|
|
170
|
-
id: number;
|
|
171
|
-
name: string;
|
|
172
|
-
created_at?: string;
|
|
173
|
-
}
|
|
174
|
-
/** A build as the listing tool shows it: what it is, how it went, and how to read it. */
|
|
175
|
-
export interface AppBuildRow {
|
|
176
|
-
buildId: string;
|
|
177
|
-
build_number?: number;
|
|
178
|
-
name: string;
|
|
179
|
-
status?: string;
|
|
180
|
-
report_status?: string;
|
|
181
|
-
created_at?: string;
|
|
182
|
-
scan_count: number;
|
|
183
|
-
issues: {
|
|
184
|
-
total: number;
|
|
185
|
-
critical: number;
|
|
186
|
-
serious: number;
|
|
187
|
-
moderate: number;
|
|
188
|
-
minor: number;
|
|
189
|
-
};
|
|
190
|
-
app?: string;
|
|
191
|
-
framework?: string;
|
|
192
|
-
dashboard_link: string;
|
|
193
|
-
}
|
|
194
|
-
export interface AppManualReportRow {
|
|
195
|
-
reportId: string;
|
|
196
|
-
name: string;
|
|
197
|
-
status?: string;
|
|
198
|
-
created_at?: string;
|
|
199
|
-
app?: string;
|
|
200
|
-
scan_count: number;
|
|
201
|
-
issues: {
|
|
202
|
-
total: number;
|
|
203
|
-
critical: number;
|
|
204
|
-
serious: number;
|
|
205
|
-
moderate: number;
|
|
206
|
-
minor: number;
|
|
207
|
-
duplicates: number;
|
|
208
|
-
hidden: number;
|
|
209
|
-
};
|
|
210
|
-
dashboard_link: string;
|
|
211
|
-
}
|
|
212
|
-
/** One row per element with an issue, most severe first. Screens are numbered in order. */
|
|
213
|
-
export declare function flattenAppSnapshots(details: AppSnapshot[]): AppAccessibilityIssue[];
|
|
214
|
-
/** The issues counted by severity, by rule and by screen, largest first. */
|
|
215
|
-
export declare function summarizeAppIssues(rows: AppAccessibilityIssue[]): AppIssueSummary;
|
|
216
|
-
/**
|
|
217
|
-
* Which issues of two builds are the same issue. Issues that look alike (one rule on
|
|
218
|
-
* elements known by neither id nor label) are paired one for one, those on the same screen
|
|
219
|
-
* and spot first, then on the same screen, then any; what is left over in either build is
|
|
220
|
-
* new or resolved. So new and still open add up to the later build's issues, and resolved
|
|
221
|
-
* and still open to the earlier one's.
|
|
222
|
-
*/
|
|
223
|
-
export declare function compareAppIssues(before: AppAccessibilityIssue[], after: AppAccessibilityIssue[]): {
|
|
224
|
-
added: AppAccessibilityIssue[];
|
|
225
|
-
resolved: AppAccessibilityIssue[];
|
|
226
|
-
retained: number;
|
|
227
|
-
};
|
|
228
|
-
/** The id a manual report's dashboard link names (`/report/{uuid}`), if it is one. */
|
|
229
|
-
export declare function manualReportIdFromDashboardLink(url: URL): string | undefined;
|
|
230
|
-
/** A manual report has no status of its own; it is complete once it has ended. */
|
|
231
|
-
export declare function manualReportStatus(detail: {
|
|
232
|
-
meta_data?: {
|
|
233
|
-
ended_at?: string | null;
|
|
234
|
-
};
|
|
235
|
-
}): string;
|
|
236
|
-
export declare class AppAccessibilityApi {
|
|
237
|
-
private readonly headers;
|
|
238
|
-
constructor(headers: () => Record<string, string> | undefined);
|
|
239
|
-
/** The build's details, or undefined when the API does not know the id. */
|
|
240
|
-
buildMeta(buildId: string): Promise<AppBuildMeta | undefined>;
|
|
241
|
-
/**
|
|
242
|
-
* The id of the build an App Accessibility dashboard link points at, if it is one: the
|
|
243
|
-
* project's newest builds, by number. (The list's name filter would not do: the link
|
|
244
|
-
* carries TestHub's name for the build, which the filter does not match.)
|
|
245
|
-
*/
|
|
246
|
-
buildIdFromDashboardLink(url: URL): Promise<string | undefined>;
|
|
247
|
-
/**
|
|
248
|
-
* The accessibility build of an App Automate build or session link. An SDK (Appium)
|
|
249
|
-
* session's test code carries the TestHub build id its results went to, which is the
|
|
250
|
-
* App Accessibility build when accessibility was on; a build link goes through any one
|
|
251
|
-
* of its sessions. A native (Espresso, XCUITest) build has no SDK session, and is found
|
|
252
|
-
* by name instead.
|
|
253
|
-
*/
|
|
254
|
-
buildIdFromAppAutomateLink(url: URL): Promise<string | undefined>;
|
|
255
|
-
private buildOfSdkSession;
|
|
256
|
-
/** The first SDK session of an App Automate build; a native build lists none. */
|
|
257
|
-
private anySdkSession;
|
|
258
|
-
/**
|
|
259
|
-
* A native build's details name its project and when it started; App Accessibility lists
|
|
260
|
-
* the run under the same project, created as it started, and named as the App Automate
|
|
261
|
-
* build list names it ("Build #N: app vX"). The start finds it among the project's newest
|
|
262
|
-
* builds; the name, read from the account's build list, tells runs that started together
|
|
263
|
-
* apart, and finds a run older than those.
|
|
264
|
-
*/
|
|
265
|
-
private buildOfNativeBuild;
|
|
266
|
-
/** A native build's project and start, from whichever framework API knows the build. */
|
|
267
|
-
private nativeBuild;
|
|
268
|
-
/** The project's builds created within moments of a run's start, newest first. */
|
|
269
|
-
private buildsStartedNear;
|
|
270
|
-
/** The build's name in the account's App Automate build list, walked newest first. */
|
|
271
|
-
private appAutomateBuildName;
|
|
272
|
-
/** The App Accessibility project of that exact name, if any. */
|
|
273
|
-
private projectId;
|
|
274
|
-
/** The projects whose name contains `name`, as the API searches it. */
|
|
275
|
-
private projectsNamed;
|
|
276
|
-
/**
|
|
277
|
-
* A listing's page. The API answers an empty list with 404 ("No builds found") for
|
|
278
|
-
* access-key callers, which is not an error here; any other failure is, a 404 from a
|
|
279
|
-
* wrong route or a missing permission included.
|
|
280
|
-
*/
|
|
281
|
-
private listing;
|
|
282
|
-
/** The newest projects, as many as asked for. */
|
|
283
|
-
listAppProjects(limit: number): Promise<{
|
|
284
|
-
projects: AppProjectRow[];
|
|
285
|
-
total: number;
|
|
286
|
-
}>;
|
|
287
|
-
/**
|
|
288
|
-
* A project's newest builds, by exact project name, optionally filtered by build name.
|
|
289
|
-
* A project name that matches none exactly names the near matches, so the agent can
|
|
290
|
-
* pick rather than guess.
|
|
291
|
-
*/
|
|
292
|
-
listAppBuilds(projectName: string, buildName: string | undefined, limit: number): Promise<{
|
|
293
|
-
project: {
|
|
294
|
-
id: number;
|
|
295
|
-
name: string;
|
|
296
|
-
};
|
|
297
|
-
total: number;
|
|
298
|
-
builds: AppBuildRow[];
|
|
299
|
-
}>;
|
|
300
|
-
/** The newest manual reports, optionally filtered by name. */
|
|
301
|
-
listAppManualReports(name: string | undefined, limit: number): Promise<{
|
|
302
|
-
total: number;
|
|
303
|
-
reports: AppManualReportRow[];
|
|
304
|
-
}>;
|
|
305
|
-
/** A manual report's details, or undefined when the API does not know the id. */
|
|
306
|
-
manualReport(reportId: string): Promise<any | undefined>;
|
|
307
|
-
/**
|
|
308
|
-
* A manual report's issues, every occurrence the API lists, most severe first. The
|
|
309
|
-
* dashboard's own count comes from the report's summary: it folds duplicates that the
|
|
310
|
-
* issue rows do not mark, so the two numbers are both given.
|
|
311
|
-
*/
|
|
312
|
-
appReportIssues(reportId: string, cursor?: number, maxCharacterLength?: number): Promise<AppManualReport>;
|
|
313
|
-
/**
|
|
314
|
-
* The id of the project's build that `pick` accepts, newest first, within the first
|
|
315
|
-
* pages; `buildName` narrows the list to builds named like it, when the name is known
|
|
316
|
-
* to be the build's own.
|
|
317
|
-
*/
|
|
318
|
-
private findBuild;
|
|
319
|
-
/**
|
|
320
|
-
* The project's builds a page at a time, newest first, within the first pages; `more`
|
|
321
|
-
* says whether the list goes on past the page.
|
|
322
|
-
*/
|
|
323
|
-
private projectBuilds;
|
|
324
|
-
/**
|
|
325
|
-
* The build before this one in its project: the newest earlier build of the same name,
|
|
326
|
-
* as an SDK suite keeps its name from run to run, or else the build just before it, as
|
|
327
|
-
* each native (Espresso, XCUITest) run is named apart. None for a project's first build.
|
|
328
|
-
*/
|
|
329
|
-
previousBuild(buildId: string): Promise<AppBuildRef | undefined>;
|
|
330
|
-
/** The build's page on the App Accessibility dashboard, when its project can be found. */
|
|
331
|
-
private dashboardLink;
|
|
332
|
-
/** Every scanned screen of the build, and how many issues the dashboard hides. */
|
|
333
|
-
private snapshots;
|
|
334
|
-
private requireBuildMeta;
|
|
335
|
-
/** The build's details and scanned screens; a build with no scans has none to read. */
|
|
336
|
-
private readBuild;
|
|
337
|
-
/** Every issue of the build at once, to compare it with another. */
|
|
338
|
-
buildIssues(buildId: string): Promise<AppBuildIssues>;
|
|
339
|
-
report(buildId: string, cursor?: number, maxCharacterLength?: number): Promise<AppBuildReport>;
|
|
340
|
-
}
|
|
341
|
-
export {};
|