agent-qa 0.1.10 → 0.1.12
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/cli.cjs +48 -26
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +48 -26
- package/dist/cli.js.map +1 -1
- package/package.json +9 -9
package/dist/cli.cjs
CHANGED
|
@@ -597,6 +597,7 @@ function buildTargets(platform) {
|
|
|
597
597
|
if (selection.capabilities.includes("web")) {
|
|
598
598
|
targets["example-web"] = { platform: "web", url: "https://example.com" };
|
|
599
599
|
targets["automation-exercise"] = { platform: "web", url: "https://automationexercise.com" };
|
|
600
|
+
targets["wai-bad"] = { platform: "web", url: "https://www.w3.org/WAI/demos/bad/before/home.html" };
|
|
600
601
|
}
|
|
601
602
|
if (selection.mobileRuntimes.includes("android")) {
|
|
602
603
|
targets["example-android"] = { platform: "android" };
|
|
@@ -650,6 +651,7 @@ var AUTOMATION_EXERCISE_TESTS = [
|
|
|
650
651
|
];
|
|
651
652
|
var HN_TOP_STORY_HOOK_ID = "h_aster-bloom-cloud-drift-ember-field-glade-hollow-ivory-jasper";
|
|
652
653
|
var HN_TOP_STORY_TEST_ID = "t_quad-adar-micro-magic-cross-cue-open-agog-rang-cours";
|
|
654
|
+
var BAD_A11Y_TEST_ID = "t_ponent-toa-base-fred-click-sigma-lad-agen-report-sticky";
|
|
653
655
|
function buildAutomationExerciseTest(test) {
|
|
654
656
|
return `test-id: ${test.id}
|
|
655
657
|
name: ${test.name}
|
|
@@ -730,6 +732,15 @@ steps:
|
|
|
730
732
|
- Verify the page shows "{{env:HN_FIRST_STORY_TITLE}}"
|
|
731
733
|
`;
|
|
732
734
|
}
|
|
735
|
+
function buildBadA11yTest() {
|
|
736
|
+
return `test-id: ${BAD_A11Y_TEST_ID}
|
|
737
|
+
name: W3C BAD accessibility smoke
|
|
738
|
+
target: wai-bad
|
|
739
|
+
steps:
|
|
740
|
+
- Verify the page says "Welcome to CityLights"
|
|
741
|
+
- Verify the page says "Inaccessible Home Page"
|
|
742
|
+
`;
|
|
743
|
+
}
|
|
733
744
|
function isSubscriptionProvider(provider) {
|
|
734
745
|
return provider === "openai-subscription" || provider === "anthropic-subscription";
|
|
735
746
|
}
|
|
@@ -841,6 +852,14 @@ function buildDefaultConfig(platform, providerOrLLMs, model, baseURL) {
|
|
|
841
852
|
dashboard: { port: 3100, artifactsDir: ".agent-qa/artifacts" },
|
|
842
853
|
mcp: { enabled: true, transport: "http", host: "127.0.0.1", port: 3471, path: "/mcp" },
|
|
843
854
|
cache: { dir: INIT_CACHE_DIR, ttl: "7d" },
|
|
855
|
+
...hasWeb(platform) ? {
|
|
856
|
+
accessibility: {
|
|
857
|
+
enabled: true,
|
|
858
|
+
standard: "wcag2aa",
|
|
859
|
+
runAfter: "every-step",
|
|
860
|
+
failOnViolation: false
|
|
861
|
+
}
|
|
862
|
+
} : {},
|
|
844
863
|
recording: { enabled: true },
|
|
845
864
|
memory: { enabled: true, provider: "local", dir: "agent-qa-memory" },
|
|
846
865
|
logging: { level: "warn" }
|
|
@@ -891,10 +910,14 @@ function addYamlComments(yamlStr) {
|
|
|
891
910
|
result += " # Optional: persist dashboard state to a custom SQLite path.\n";
|
|
892
911
|
result += " # dbPath: .agent-qa/dashboard.sqlite\n";
|
|
893
912
|
} else if (line === " ttl: 7d") {
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
913
|
+
if (yamlStr.includes("\n accessibility:\n")) {
|
|
914
|
+
result += " # Accessibility checks power the W3C BAD demo test.\n";
|
|
915
|
+
} else {
|
|
916
|
+
result += " # Optional accessibility service example:\n";
|
|
917
|
+
result += " # accessibility:\n";
|
|
918
|
+
result += " # enabled: false\n";
|
|
919
|
+
result += " # standard: wcag2aa\n";
|
|
920
|
+
}
|
|
898
921
|
} else if (line === "registry:") {
|
|
899
922
|
result += " # Optional: local and cloud device/provider profiles.\n";
|
|
900
923
|
result += " # devices:\n";
|
|
@@ -965,9 +988,7 @@ function browserSetupCommand(platform) {
|
|
|
965
988
|
function mobileDriverSetupCommand(platform) {
|
|
966
989
|
const runtimes = normalizePlatformSelection(platform).mobileRuntimes;
|
|
967
990
|
if (runtimes.length === 0) return null;
|
|
968
|
-
|
|
969
|
-
if (runtimes.includes("android")) return "agent-qa install-mobile-drivers --android";
|
|
970
|
-
return "agent-qa install-mobile-drivers --ios";
|
|
991
|
+
return "agent-qa install-mobile-drivers --all";
|
|
971
992
|
}
|
|
972
993
|
function initNextSteps(platform) {
|
|
973
994
|
const steps = [];
|
|
@@ -1001,21 +1022,13 @@ function createInitCommand() {
|
|
|
1001
1022
|
const capabilities = await (0, import_checkbox.default)({
|
|
1002
1023
|
message: "What platform will you test?",
|
|
1003
1024
|
choices: [
|
|
1004
|
-
{ value: "web", name: "Web", description: "Test web apps with Playwright" },
|
|
1005
|
-
{ value: "mobile", name: "Mobile", description: "Test Android or iOS apps with Appium" }
|
|
1025
|
+
{ value: "web", name: "Web", description: "Test web apps with Playwright", checked: true },
|
|
1026
|
+
{ value: "mobile", name: "Mobile", description: "Test Android or iOS apps with Appium", checked: false }
|
|
1006
1027
|
],
|
|
1007
1028
|
required: true,
|
|
1008
1029
|
validate: (value) => value.length > 0 || "Select at least one platform."
|
|
1009
1030
|
});
|
|
1010
|
-
const mobileRuntimes = capabilities.includes("mobile") ?
|
|
1011
|
-
message: "Which mobile platforms will you test?",
|
|
1012
|
-
choices: [
|
|
1013
|
-
{ value: "android", name: "Android", description: "Install or reuse the UiAutomator2 Appium driver" },
|
|
1014
|
-
{ value: "ios", name: "iOS", description: "Install or reuse the XCUITest Appium driver" }
|
|
1015
|
-
],
|
|
1016
|
-
required: true,
|
|
1017
|
-
validate: (value) => value.length > 0 || "Select at least one mobile platform."
|
|
1018
|
-
}) : [];
|
|
1031
|
+
const mobileRuntimes = capabilities.includes("mobile") ? ["android", "ios"] : [];
|
|
1019
1032
|
platform = { capabilities, mobileRuntimes };
|
|
1020
1033
|
const llmSetup = await (0, import_checkbox.default)({
|
|
1021
1034
|
message: `Subscription auth ${import_picocolors3.default.dim("(optional)")}`,
|
|
@@ -1131,6 +1144,9 @@ function createInitCommand() {
|
|
|
1131
1144
|
const hnTestPath = (0, import_node_path3.join)(testsDir, "hacker-news-top-story.yaml");
|
|
1132
1145
|
(0, import_node_fs.writeFileSync)(hnTestPath, buildHackerNewsTopStoryTest());
|
|
1133
1146
|
console.log(import_picocolors3.default.green(`\u2713 Created ${hnTestPath}`));
|
|
1147
|
+
const badA11yTestPath = (0, import_node_path3.join)(testsDir, "bad-a11y.yaml");
|
|
1148
|
+
(0, import_node_fs.writeFileSync)(badA11yTestPath, buildBadA11yTest());
|
|
1149
|
+
console.log(import_picocolors3.default.green(`\u2713 Created ${badA11yTestPath}`));
|
|
1134
1150
|
}
|
|
1135
1151
|
appendGitignore(dir);
|
|
1136
1152
|
console.log(import_picocolors3.default.green("\u2713 Updated .gitignore"));
|
|
@@ -1152,6 +1168,7 @@ function createInitCommand() {
|
|
|
1152
1168
|
if (hasWeb(platform)) {
|
|
1153
1169
|
console.log(` ${import_picocolors3.default.dim("\u2022")} tests/automation-exercise/*.yaml`);
|
|
1154
1170
|
console.log(` ${import_picocolors3.default.dim("\u2022")} tests/hacker-news-top-story.yaml`);
|
|
1171
|
+
console.log(` ${import_picocolors3.default.dim("\u2022")} tests/bad-a11y.yaml`);
|
|
1155
1172
|
console.log(` ${import_picocolors3.default.dim("\u2022")} suites/automation-exercise.suite.yaml`);
|
|
1156
1173
|
console.log(` ${import_picocolors3.default.dim("\u2022")} scripts/fetch-hn-top-story.mjs`);
|
|
1157
1174
|
}
|
|
@@ -1857,18 +1874,13 @@ function checkPlaywright(config) {
|
|
|
1857
1874
|
function appiumResolverCwd(configPath) {
|
|
1858
1875
|
return (0, import_node_path7.dirname)((0, import_node_path7.resolve)(configPath));
|
|
1859
1876
|
}
|
|
1860
|
-
function mobileDriverInstallCommand(
|
|
1861
|
-
const hasAndroid = hasAndroidPlatform(config);
|
|
1862
|
-
const hasIOS = hasIOSPlatform(config);
|
|
1863
|
-
if (hasAndroid && hasIOS) return "agent-qa install-mobile-drivers --all";
|
|
1864
|
-
if (hasAndroid) return "agent-qa install-mobile-drivers --android";
|
|
1865
|
-
if (hasIOS) return "agent-qa install-mobile-drivers --ios";
|
|
1877
|
+
function mobileDriverInstallCommand() {
|
|
1866
1878
|
return "agent-qa install-mobile-drivers --all";
|
|
1867
1879
|
}
|
|
1868
1880
|
function checkAppium(config, configPath) {
|
|
1869
1881
|
return {
|
|
1870
1882
|
name: "Appium",
|
|
1871
|
-
fixInstructions: `${(0, import_agent_qa_core6.formatAppiumInstallGuidance)()} Then run \`${mobileDriverInstallCommand(
|
|
1883
|
+
fixInstructions: `${(0, import_agent_qa_core6.formatAppiumInstallGuidance)()} Then run \`${mobileDriverInstallCommand()}\`.`,
|
|
1872
1884
|
check: async () => {
|
|
1873
1885
|
if (!isMobilePlatform(config)) {
|
|
1874
1886
|
return { status: "skip", message: "not configured" };
|
|
@@ -1886,7 +1898,7 @@ function checkAppium(config, configPath) {
|
|
|
1886
1898
|
function checkAppiumDrivers(config, configPath) {
|
|
1887
1899
|
return {
|
|
1888
1900
|
name: "Appium drivers",
|
|
1889
|
-
fixInstructions: `Run \`${mobileDriverInstallCommand(
|
|
1901
|
+
fixInstructions: `Run \`${mobileDriverInstallCommand()}\``,
|
|
1890
1902
|
check: async () => {
|
|
1891
1903
|
if (!isMobilePlatform(config)) {
|
|
1892
1904
|
return { status: "skip", message: "not configured" };
|
|
@@ -2229,6 +2241,10 @@ async function createPlatformAdapter(platform) {
|
|
|
2229
2241
|
const { WebPlatformAdapter } = await import("@vostride/agent-qa-web");
|
|
2230
2242
|
return new WebPlatformAdapter();
|
|
2231
2243
|
}
|
|
2244
|
+
var runWebAccessibilityCheck = async (page, options) => {
|
|
2245
|
+
const { runAccessibilityCheck } = await import("@vostride/agent-qa-web");
|
|
2246
|
+
return runAccessibilityCheck(page, options);
|
|
2247
|
+
};
|
|
2232
2248
|
function buildPlatformConfig(platform, resolvedDevice, timeouts, globalBrowser, logCapture, farmSession, mobileResolved) {
|
|
2233
2249
|
if (platform === "web") {
|
|
2234
2250
|
return {
|
|
@@ -3224,6 +3240,8 @@ async function executeSuites(suiteFiles, opts, config, globalOpts, configContent
|
|
|
3224
3240
|
resolvedHooks: hooksContext?.resolvedHooks,
|
|
3225
3241
|
sandboxOptions: hooksContext?.sandboxOptions,
|
|
3226
3242
|
logCapture: suiteLogCapture,
|
|
3243
|
+
accessibility: config.services?.accessibility,
|
|
3244
|
+
accessibilityCheck: runWebAccessibilityCheck,
|
|
3227
3245
|
screenshotSize: plannerCfg.screenshotSize,
|
|
3228
3246
|
effectiveResolution: plannerCfg.effectiveResolution,
|
|
3229
3247
|
memoryProvider: suiteMemoryProvider,
|
|
@@ -4072,6 +4090,8 @@ Config for: ${test.name}`));
|
|
|
4072
4090
|
inlineHookDefs: resolvedHooks,
|
|
4073
4091
|
inlineHookSandboxOptions: sandboxOptions,
|
|
4074
4092
|
logCapture: testLogCapture,
|
|
4093
|
+
accessibility: config.services?.accessibility,
|
|
4094
|
+
accessibilityCheck: runWebAccessibilityCheck,
|
|
4075
4095
|
screenshotSize: plannerCfg.screenshotSize,
|
|
4076
4096
|
effectiveResolution: plannerCfg.effectiveResolution,
|
|
4077
4097
|
contextWindow: plannerCfg.contextWindow,
|
|
@@ -4173,6 +4193,8 @@ Config for: ${test.name}`));
|
|
|
4173
4193
|
inlineHookDefs: resolvedHooks,
|
|
4174
4194
|
inlineHookSandboxOptions: sandboxOptions,
|
|
4175
4195
|
logCapture: testLogCapture,
|
|
4196
|
+
accessibility: config.services?.accessibility,
|
|
4197
|
+
accessibilityCheck: runWebAccessibilityCheck,
|
|
4176
4198
|
screenshotSize: plannerCfg.screenshotSize,
|
|
4177
4199
|
effectiveResolution: plannerCfg.effectiveResolution,
|
|
4178
4200
|
contextWindow: plannerCfg.contextWindow
|