@fluentui-react-native/desktop-driver 0.2.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/.cache/tsconfig.tsbuildinfo +1 -0
- package/AGENTS.md +68 -0
- package/CHANGELOG.md +16 -0
- package/PLAN.md +1394 -0
- package/README.md +223 -0
- package/SPEC.md +105 -0
- package/config/cli.cjs +8 -0
- package/jest.config.cjs +9 -0
- package/lib/agent/DesktopAgent.d.ts +56 -0
- package/lib/agent/DesktopAgent.d.ts.map +1 -0
- package/lib/agent/DesktopAgent.js +118 -0
- package/lib/agent/DesktopAgent.js.map +1 -0
- package/lib/agent/DesktopAgent.test.d.ts +2 -0
- package/lib/agent/DesktopAgent.test.d.ts.map +1 -0
- package/lib/agent/DesktopAgent.test.js +97 -0
- package/lib/agent/DesktopAgent.test.js.map +1 -0
- package/lib/agent/agent.contract.cjs +66 -0
- package/lib/agent/agent.contract.cjs.map +1 -0
- package/lib/agent/agent.contract.d.cts +2 -0
- package/lib/agent/agent.contract.d.cts.map +1 -0
- package/lib/agent/index.d.ts +3 -0
- package/lib/agent/index.d.ts.map +1 -0
- package/lib/agent/index.js +2 -0
- package/lib/agent/index.js.map +1 -0
- package/lib/artifacts/ArtifactManager.d.ts +13 -0
- package/lib/artifacts/ArtifactManager.d.ts.map +1 -0
- package/lib/artifacts/ArtifactManager.js +88 -0
- package/lib/artifacts/ArtifactManager.js.map +1 -0
- package/lib/artifacts/ArtifactManager.test.d.ts +2 -0
- package/lib/artifacts/ArtifactManager.test.d.ts.map +1 -0
- package/lib/artifacts/ArtifactManager.test.js +19 -0
- package/lib/artifacts/ArtifactManager.test.js.map +1 -0
- package/lib/artifacts/index.d.ts +2 -0
- package/lib/artifacts/index.d.ts.map +1 -0
- package/lib/artifacts/index.js +2 -0
- package/lib/artifacts/index.js.map +1 -0
- package/lib/authoring/index.d.ts +4 -0
- package/lib/authoring/index.d.ts.map +1 -0
- package/lib/authoring/index.js +2 -0
- package/lib/authoring/index.js.map +1 -0
- package/lib/authoring/results.d.ts +43 -0
- package/lib/authoring/results.d.ts.map +1 -0
- package/lib/authoring/results.js +2 -0
- package/lib/authoring/results.js.map +1 -0
- package/lib/authoring/storyTests.d.ts +81 -0
- package/lib/authoring/storyTests.d.ts.map +1 -0
- package/lib/authoring/storyTests.js +272 -0
- package/lib/authoring/storyTests.js.map +1 -0
- package/lib/authoring/storyTests.test.d.ts +2 -0
- package/lib/authoring/storyTests.test.d.ts.map +1 -0
- package/lib/authoring/storyTests.test.js +46 -0
- package/lib/authoring/storyTests.test.js.map +1 -0
- package/lib/cli/DesktopDriverCli.test.d.ts +2 -0
- package/lib/cli/DesktopDriverCli.test.d.ts.map +1 -0
- package/lib/cli/DesktopDriverCli.test.js +141 -0
- package/lib/cli/DesktopDriverCli.test.js.map +1 -0
- package/lib/cli/createDesktopDriverCommand.d.ts +8 -0
- package/lib/cli/createDesktopDriverCommand.d.ts.map +1 -0
- package/lib/cli/createDesktopDriverCommand.js +242 -0
- package/lib/cli/createDesktopDriverCommand.js.map +1 -0
- package/lib/cli/index.d.ts +3 -0
- package/lib/cli/index.d.ts.map +1 -0
- package/lib/cli/index.js +2 -0
- package/lib/cli/index.js.map +1 -0
- package/lib/client/DesktopDriverClient.d.ts +60 -0
- package/lib/client/DesktopDriverClient.d.ts.map +1 -0
- package/lib/client/DesktopDriverClient.js +155 -0
- package/lib/client/DesktopDriverClient.js.map +1 -0
- package/lib/client/index.d.ts +3 -0
- package/lib/client/index.d.ts.map +1 -0
- package/lib/client/index.js +2 -0
- package/lib/client/index.js.map +1 -0
- package/lib/host/types.d.ts +153 -0
- package/lib/host/types.d.ts.map +1 -0
- package/lib/host/types.js +2 -0
- package/lib/host/types.js.map +1 -0
- package/lib/hosts/fake/FakeDesktopHost.d.ts +72 -0
- package/lib/hosts/fake/FakeDesktopHost.d.ts.map +1 -0
- package/lib/hosts/fake/FakeDesktopHost.js +452 -0
- package/lib/hosts/fake/FakeDesktopHost.js.map +1 -0
- package/lib/index.d.ts +23 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +11 -0
- package/lib/index.js.map +1 -0
- package/lib/protocol/actions.d.ts +11 -0
- package/lib/protocol/actions.d.ts.map +1 -0
- package/lib/protocol/actions.js +137 -0
- package/lib/protocol/actions.js.map +1 -0
- package/lib/protocol/capabilities.d.ts +11 -0
- package/lib/protocol/capabilities.d.ts.map +1 -0
- package/lib/protocol/capabilities.js +103 -0
- package/lib/protocol/capabilities.js.map +1 -0
- package/lib/protocol/constants.d.ts +2 -0
- package/lib/protocol/constants.d.ts.map +1 -0
- package/lib/protocol/constants.js +2 -0
- package/lib/protocol/constants.js.map +1 -0
- package/lib/protocol/errors.d.ts +37 -0
- package/lib/protocol/errors.d.ts.map +1 -0
- package/lib/protocol/errors.js +66 -0
- package/lib/protocol/errors.js.map +1 -0
- package/lib/protocol/timeouts.d.ts +2 -0
- package/lib/protocol/timeouts.d.ts.map +1 -0
- package/lib/protocol/timeouts.js +23 -0
- package/lib/protocol/timeouts.js.map +1 -0
- package/lib/protocol/types.d.ts +46 -0
- package/lib/protocol/types.d.ts.map +1 -0
- package/lib/protocol/types.js +2 -0
- package/lib/protocol/types.js.map +1 -0
- package/lib/runner/StoryTestRunner.d.ts +38 -0
- package/lib/runner/StoryTestRunner.d.ts.map +1 -0
- package/lib/runner/StoryTestRunner.js +497 -0
- package/lib/runner/StoryTestRunner.js.map +1 -0
- package/lib/runner/StoryTestRunner.test.d.ts +2 -0
- package/lib/runner/StoryTestRunner.test.d.ts.map +1 -0
- package/lib/runner/StoryTestRunner.test.js +349 -0
- package/lib/runner/StoryTestRunner.test.js.map +1 -0
- package/lib/runner/index.d.ts +3 -0
- package/lib/runner/index.d.ts.map +1 -0
- package/lib/runner/index.js +2 -0
- package/lib/runner/index.js.map +1 -0
- package/lib/server/SessionManager.d.ts +52 -0
- package/lib/server/SessionManager.d.ts.map +1 -0
- package/lib/server/SessionManager.js +208 -0
- package/lib/server/SessionManager.js.map +1 -0
- package/lib/server/TargetRegistry.d.ts +9 -0
- package/lib/server/TargetRegistry.d.ts.map +1 -0
- package/lib/server/TargetRegistry.js +24 -0
- package/lib/server/TargetRegistry.js.map +1 -0
- package/lib/server/createDesktopDriverServer.d.ts +19 -0
- package/lib/server/createDesktopDriverServer.d.ts.map +1 -0
- package/lib/server/createDesktopDriverServer.js +609 -0
- package/lib/server/createDesktopDriverServer.js.map +1 -0
- package/lib/server/desktopDriver.test.d.ts +2 -0
- package/lib/server/desktopDriver.test.d.ts.map +1 -0
- package/lib/server/desktopDriver.test.js +389 -0
- package/lib/server/desktopDriver.test.js.map +1 -0
- package/lib/server/index.d.ts +6 -0
- package/lib/server/index.d.ts.map +1 -0
- package/lib/server/index.js +4 -0
- package/lib/server/index.js.map +1 -0
- package/lib/server/webdriverio.contract.cjs +35 -0
- package/lib/server/webdriverio.contract.cjs.map +1 -0
- package/lib/server/webdriverio.contract.d.cts +2 -0
- package/lib/server/webdriverio.contract.d.cts.map +1 -0
- package/lib/server/webdriverio.test.d.ts +2 -0
- package/lib/server/webdriverio.test.d.ts.map +1 -0
- package/lib/server/webdriverio.test.js +40 -0
- package/lib/server/webdriverio.test.js.map +1 -0
- package/lib/storybook.d.ts +36 -0
- package/lib/storybook.d.ts.map +1 -0
- package/lib/storybook.js +2 -0
- package/lib/storybook.js.map +1 -0
- package/lib/testing/FakeStoryOrchestrator.d.ts +21 -0
- package/lib/testing/FakeStoryOrchestrator.d.ts.map +1 -0
- package/lib/testing/FakeStoryOrchestrator.js +44 -0
- package/lib/testing/FakeStoryOrchestrator.js.map +1 -0
- package/lib/testing/fakeStoryElements.d.ts +4 -0
- package/lib/testing/fakeStoryElements.d.ts.map +1 -0
- package/lib/testing/fakeStoryElements.js +143 -0
- package/lib/testing/fakeStoryElements.js.map +1 -0
- package/lib/testing/fakeStoryElements.test.d.ts +2 -0
- package/lib/testing/fakeStoryElements.test.d.ts.map +1 -0
- package/lib/testing/fakeStoryElements.test.js +38 -0
- package/lib/testing/fakeStoryElements.test.js.map +1 -0
- package/lib/testing/index.d.ts +7 -0
- package/lib/testing/index.d.ts.map +1 -0
- package/lib/testing/index.js +5 -0
- package/lib/testing/index.js.map +1 -0
- package/lib/testing/protocolHarness.d.ts +17 -0
- package/lib/testing/protocolHarness.d.ts.map +1 -0
- package/lib/testing/protocolHarness.js +46 -0
- package/lib/testing/protocolHarness.js.map +1 -0
- package/lib/wdio/DesktopWebdriver.d.ts +47 -0
- package/lib/wdio/DesktopWebdriver.d.ts.map +1 -0
- package/lib/wdio/DesktopWebdriver.js +76 -0
- package/lib/wdio/DesktopWebdriver.js.map +1 -0
- package/lib/wdio/DesktopWebdriver.test.d.ts +2 -0
- package/lib/wdio/DesktopWebdriver.test.d.ts.map +1 -0
- package/lib/wdio/DesktopWebdriver.test.js +74 -0
- package/lib/wdio/DesktopWebdriver.test.js.map +1 -0
- package/lib/wdio/index.d.ts +3 -0
- package/lib/wdio/index.d.ts.map +1 -0
- package/lib/wdio/index.js +2 -0
- package/lib/wdio/index.js.map +1 -0
- package/lib/wdio/wdioRunner.contract.cjs +64 -0
- package/lib/wdio/wdioRunner.contract.cjs.map +1 -0
- package/lib/wdio/wdioRunner.contract.d.cts +2 -0
- package/lib/wdio/wdioRunner.contract.d.cts.map +1 -0
- package/package.json +96 -0
- package/src/agent/DesktopAgent.test.ts +102 -0
- package/src/agent/DesktopAgent.ts +170 -0
- package/src/agent/agent.contract.cjs +32 -0
- package/src/agent/index.ts +8 -0
- package/src/artifacts/ArtifactManager.test.ts +20 -0
- package/src/artifacts/ArtifactManager.ts +105 -0
- package/src/artifacts/index.ts +1 -0
- package/src/authoring/index.ts +26 -0
- package/src/authoring/results.ts +47 -0
- package/src/authoring/storyTests.test.ts +58 -0
- package/src/authoring/storyTests.ts +345 -0
- package/src/cli/DesktopDriverCli.test.ts +150 -0
- package/src/cli/createDesktopDriverCommand.ts +290 -0
- package/src/cli/index.ts +2 -0
- package/src/client/DesktopDriverClient.ts +218 -0
- package/src/client/index.ts +2 -0
- package/src/host/types.ts +158 -0
- package/src/hosts/fake/FakeDesktopHost.ts +558 -0
- package/src/index.ts +101 -0
- package/src/protocol/actions.ts +163 -0
- package/src/protocol/capabilities.ts +129 -0
- package/src/protocol/constants.ts +1 -0
- package/src/protocol/errors.ts +76 -0
- package/src/protocol/timeouts.ts +26 -0
- package/src/protocol/types.ts +55 -0
- package/src/runner/StoryTestRunner.test.ts +362 -0
- package/src/runner/StoryTestRunner.ts +624 -0
- package/src/runner/index.ts +9 -0
- package/src/server/SessionManager.ts +302 -0
- package/src/server/TargetRegistry.ts +29 -0
- package/src/server/createDesktopDriverServer.ts +775 -0
- package/src/server/desktopDriver.test.ts +421 -0
- package/src/server/index.ts +5 -0
- package/src/server/webdriverio.contract.cjs +38 -0
- package/src/server/webdriverio.test.ts +41 -0
- package/src/storybook.ts +40 -0
- package/src/testing/FakeStoryOrchestrator.ts +55 -0
- package/src/testing/fakeStoryElements.test.ts +40 -0
- package/src/testing/fakeStoryElements.ts +167 -0
- package/src/testing/index.ts +6 -0
- package/src/testing/protocolHarness.ts +66 -0
- package/src/wdio/DesktopWebdriver.test.ts +76 -0
- package/src/wdio/DesktopWebdriver.ts +130 -0
- package/src/wdio/index.ts +2 -0
- package/src/wdio/wdioRunner.contract.cjs +30 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
const path = require('node:path');
|
|
36
|
+
const { pathToFileURL } = require('node:url');
|
|
37
|
+
async function main() {
|
|
38
|
+
const moduleUrl = pathToFileURL(path.resolve(__dirname, '..', '..', 'lib', 'agent', 'index.js')).href;
|
|
39
|
+
const { connectDesktopAgent } = await Promise.resolve(`${moduleUrl}`).then(s => __importStar(require(s)));
|
|
40
|
+
const [url, targetId, artifactsRoot] = process.argv.slice(2);
|
|
41
|
+
const agent = await connectDesktopAgent({
|
|
42
|
+
artifactsRoot,
|
|
43
|
+
platformName: 'windows',
|
|
44
|
+
targetId,
|
|
45
|
+
url,
|
|
46
|
+
});
|
|
47
|
+
try {
|
|
48
|
+
const stories = await agent.listStories();
|
|
49
|
+
const story = await agent.explainStory('components-button--default');
|
|
50
|
+
await agent.openStory(story.id);
|
|
51
|
+
const tree = await agent.describe({ depth: 2, maxNodes: 10, scope: 'story' });
|
|
52
|
+
await agent.click({ testId: 'button-primary' });
|
|
53
|
+
const check = await agent.check({ state: 'focused', target: { testId: 'button-primary' }, value: true });
|
|
54
|
+
const screenshot = await agent.screenshot('agent-button');
|
|
55
|
+
const run = await agent.runStoryTest(story.id, 'agent-plan');
|
|
56
|
+
process.stdout.write(JSON.stringify({ check, run, screenshot, stories: stories.length, tree: tree.length }));
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
await agent.delete();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
main().catch((error) => {
|
|
63
|
+
process.stderr.write(error.stack ?? error.message);
|
|
64
|
+
process.exitCode = 1;
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=agent.contract.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.contract.cjs","sourceRoot":"","sources":["../../src/agent/agent.contract.cjs"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAClC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAE9C,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC;IACtG,MAAM,EAAE,mBAAmB,EAAE,GAAG,yBAAa,SAAS,uCAAC,CAAC;IACxD,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7D,MAAM,KAAK,GAAG,MAAM,mBAAmB,CAAC;QACtC,aAAa;QACb,YAAY,EAAE,SAAS;QACvB,QAAQ;QACR,GAAG;K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AO,CAAC,CAAC;IACnD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.contract.d.cts","sourceRoot":"","sources":["../../src/agent/agent.contract.cjs"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtE,YAAY,EACV,uBAAuB,EACvB,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DesktopArtifact, DesktopStoryRunResult } from '../authoring/results.js';
|
|
2
|
+
export declare class ArtifactManager {
|
|
3
|
+
readonly root: string;
|
|
4
|
+
constructor(root: string);
|
|
5
|
+
writeScreenshot(testDirectory: string, name: string, base64: string): DesktopArtifact;
|
|
6
|
+
writeSource(testDirectory: string, name: string, source: string): DesktopArtifact;
|
|
7
|
+
writeTree(testDirectory: string, name: string, tree: unknown): DesktopArtifact;
|
|
8
|
+
writeRunResult(result: DesktopStoryRunResult): string;
|
|
9
|
+
writeMetadata(name: string, value: unknown): string;
|
|
10
|
+
private write;
|
|
11
|
+
private resolvePath;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ArtifactManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArtifactManager.d.ts","sourceRoot":"","sources":["../../src/artifacts/ArtifactManager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEtF,qBAAa,eAAe;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,YAAY,IAAI,EAAE,MAAM,EAMvB;IAED,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAEpF;IAED,WAAW,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAEhF;IAED,SAAS,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,eAAe,CAE7E;IAED,cAAc,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAIpD;IAED,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAIlD;IAED,OAAO,CAAC,KAAK;IAmBb,OAAO,CAAC,WAAW;CAkBpB"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
export class ArtifactManager {
|
|
5
|
+
root;
|
|
6
|
+
constructor(root) {
|
|
7
|
+
if (!root) {
|
|
8
|
+
throw new TypeError('ArtifactManager requires a non-empty root path.');
|
|
9
|
+
}
|
|
10
|
+
fs.mkdirSync(root, { recursive: true });
|
|
11
|
+
this.root = fs.realpathSync.native(root);
|
|
12
|
+
}
|
|
13
|
+
writeScreenshot(testDirectory, name, base64) {
|
|
14
|
+
return this.write(testDirectory, name, 'png', Buffer.from(base64, 'base64'), 'screenshot');
|
|
15
|
+
}
|
|
16
|
+
writeSource(testDirectory, name, source) {
|
|
17
|
+
return this.write(testDirectory, name, 'xml', source, 'source');
|
|
18
|
+
}
|
|
19
|
+
writeTree(testDirectory, name, tree) {
|
|
20
|
+
return this.write(testDirectory, name, 'json', `${JSON.stringify(tree, null, 2)}\n`, 'tree');
|
|
21
|
+
}
|
|
22
|
+
writeRunResult(result) {
|
|
23
|
+
const outputPath = this.resolvePath('run.json');
|
|
24
|
+
writeAtomic(outputPath, `${JSON.stringify(result, null, 2)}\n`);
|
|
25
|
+
return outputPath;
|
|
26
|
+
}
|
|
27
|
+
writeMetadata(name, value) {
|
|
28
|
+
const outputPath = this.resolvePath(`${sanitizeSegment(name)}.json`);
|
|
29
|
+
writeAtomic(outputPath, `${JSON.stringify(value, null, 2)}\n`);
|
|
30
|
+
return outputPath;
|
|
31
|
+
}
|
|
32
|
+
write(testDirectory, name, extension, data, kind) {
|
|
33
|
+
const safeDirectory = sanitizeSegment(testDirectory);
|
|
34
|
+
const safeName = sanitizeSegment(name);
|
|
35
|
+
const relativePath = path.join('tests', safeDirectory, `${safeName}.${extension}`);
|
|
36
|
+
const outputPath = this.resolvePath(relativePath);
|
|
37
|
+
writeAtomic(outputPath, data);
|
|
38
|
+
return {
|
|
39
|
+
kind,
|
|
40
|
+
name,
|
|
41
|
+
path: relativePath.split(path.sep).join('/'),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
resolvePath(relativePath) {
|
|
45
|
+
if (path.isAbsolute(relativePath)) {
|
|
46
|
+
throw new Error('Artifact paths must be relative to the configured root.');
|
|
47
|
+
}
|
|
48
|
+
const outputPath = path.resolve(this.root, relativePath);
|
|
49
|
+
const relative = path.relative(this.root, outputPath);
|
|
50
|
+
if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
|
|
51
|
+
throw new Error(`Artifact path escapes the configured root: ${relativePath}`);
|
|
52
|
+
}
|
|
53
|
+
const parent = path.dirname(outputPath);
|
|
54
|
+
fs.mkdirSync(parent, { recursive: true });
|
|
55
|
+
const realParent = fs.realpathSync.native(parent);
|
|
56
|
+
const realRelative = path.relative(this.root, realParent);
|
|
57
|
+
if (realRelative === '..' || realRelative.startsWith(`..${path.sep}`) || path.isAbsolute(realRelative)) {
|
|
58
|
+
throw new Error(`Artifact path traverses outside the configured root: ${relativePath}`);
|
|
59
|
+
}
|
|
60
|
+
return path.join(realParent, path.basename(outputPath));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function sanitizeSegment(value) {
|
|
64
|
+
let sanitized = value
|
|
65
|
+
.replaceAll(/[^A-Za-z0-9._-]/g, '-')
|
|
66
|
+
.replaceAll(/-+/g, '-')
|
|
67
|
+
.replace(/^\.+/, '');
|
|
68
|
+
if (/^(?:aux|con|nul|prn|com[1-9]|lpt[1-9])(?:\.|$)/i.test(sanitized)) {
|
|
69
|
+
sanitized = `_${sanitized}`;
|
|
70
|
+
}
|
|
71
|
+
if (!sanitized || sanitized === '.' || sanitized === '..') {
|
|
72
|
+
throw new Error(`Invalid artifact name "${value}".`);
|
|
73
|
+
}
|
|
74
|
+
return sanitized;
|
|
75
|
+
}
|
|
76
|
+
function writeAtomic(outputPath, data) {
|
|
77
|
+
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
78
|
+
const temporaryPath = `${outputPath}.${randomUUID()}.tmp`;
|
|
79
|
+
try {
|
|
80
|
+
fs.writeFileSync(temporaryPath, data);
|
|
81
|
+
fs.renameSync(temporaryPath, outputPath);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
fs.rmSync(temporaryPath, { force: true });
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=ArtifactManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArtifactManager.js","sourceRoot":"","sources":["../../src/artifacts/ArtifactManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,M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IAAI,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,WAAW,CAAC,UAAkB,EAAE,IAAyB;IAChE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,MAAM,aAAa,GAAG,GAAG,UAAU,IAAI,UAAU,EAAE,MAAM,CAAC;IAC1D,IAAI,CAAC;QACH,EAAE,CAAC,aAAa,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QACtC,EAAE,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1C,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArtifactManager.test.d.ts","sourceRoot":"","sources":["../../src/artifacts/ArtifactManager.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { ArtifactManager } from './ArtifactManager.js';
|
|
5
|
+
describe('ArtifactManager', () => {
|
|
6
|
+
test('confines and atomically writes artifacts beneath the run root', () => {
|
|
7
|
+
const temporaryDirectory = fs.mkdtempSync(path.join(os.tmpdir(), 'desktop-driver-artifacts-'));
|
|
8
|
+
try {
|
|
9
|
+
const manager = new ArtifactManager(temporaryDirectory);
|
|
10
|
+
const artifact = manager.writeSource('../story:id', '../source', '<application />');
|
|
11
|
+
expect(artifact.path).toBe('tests/-story-id/-source.xml');
|
|
12
|
+
expect(fs.readFileSync(path.join(temporaryDirectory, ...artifact.path.split('/')), 'utf8')).toBe('<application />');
|
|
13
|
+
}
|
|
14
|
+
finally {
|
|
15
|
+
fs.rmSync(temporaryDirectory, { force: true, recursive: true });
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=ArtifactManager.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArtifactManager.test.js","sourceRoot":"","sources":["../../src/artifacts/ArtifactManager.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,IAAI,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACzE,MAAM,kBAAkB,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,2BAA2B,CAAC,CAAC,CAAC;QAC/F,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,kBAAkB,CAAC,CAAC;YACxD,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,EAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC;YAEpF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;YAC1D,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACtH,CAAC;gBAAS,CAAC;YACT,EAAE,CAAC,MAAM,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAClE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/artifacts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { DesktopArtifact, DesktopRunStatus, DesktopStepStatus, DesktopStoryRunResult, DesktopStoryStepResult, DesktopStoryTestResult, DesktopTestStatus, } from './results.js';
|
|
2
|
+
export { defineDesktopStoryTests, desktopBy, desktopStoryCapabilities, desktopStoryPlatforms, validateDesktopStoryTests, } from './storyTests.js';
|
|
3
|
+
export type { DesktopStoryCapability, DesktopStoryExpectation, DesktopStoryPlatform, DesktopStorySelector, DesktopStoryState, DesktopStoryStep, DesktopStoryTest, DesktopStoryTests, } from './storyTests.js';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authoring/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authoring/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,uBAAuB,EACvB,SAAS,EACT,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { DesktopEndpoint, DesktopPlatformName } from '../protocol/types.js';
|
|
2
|
+
export type DesktopArtifact = {
|
|
3
|
+
kind: 'screenshot' | 'source' | 'tree';
|
|
4
|
+
name: string;
|
|
5
|
+
path: string;
|
|
6
|
+
};
|
|
7
|
+
export type DesktopStepStatus = 'failed' | 'passed' | 'skipped';
|
|
8
|
+
export type DesktopTestStatus = 'cancelled' | 'failed' | 'infrastructure-error' | 'passed' | 'skipped' | 'timed-out';
|
|
9
|
+
export type DesktopRunStatus = 'failed' | 'passed';
|
|
10
|
+
export type DesktopStoryStepResult = {
|
|
11
|
+
artifacts: readonly DesktopArtifact[];
|
|
12
|
+
durationMs: number;
|
|
13
|
+
error?: string;
|
|
14
|
+
index: number;
|
|
15
|
+
status: DesktopStepStatus;
|
|
16
|
+
};
|
|
17
|
+
export type DesktopStoryTestResult = {
|
|
18
|
+
artifacts: readonly DesktopArtifact[];
|
|
19
|
+
durationMs: number;
|
|
20
|
+
error?: string;
|
|
21
|
+
skipReason?: string;
|
|
22
|
+
status: DesktopTestStatus;
|
|
23
|
+
steps: readonly DesktopStoryStepResult[];
|
|
24
|
+
storyId: string;
|
|
25
|
+
testId: string;
|
|
26
|
+
title: string;
|
|
27
|
+
};
|
|
28
|
+
export type DesktopStoryRunResult = {
|
|
29
|
+
endpoint: DesktopEndpoint;
|
|
30
|
+
finishedAt: string;
|
|
31
|
+
manifest: {
|
|
32
|
+
platform: string;
|
|
33
|
+
portable: string;
|
|
34
|
+
};
|
|
35
|
+
platformName: DesktopPlatformName;
|
|
36
|
+
runId: string;
|
|
37
|
+
schemaVersion: 1;
|
|
38
|
+
startedAt: string;
|
|
39
|
+
status: DesktopRunStatus;
|
|
40
|
+
targetId: string;
|
|
41
|
+
tests: readonly DesktopStoryTestResult[];
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=results.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../src/authoring/results.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,YAAY,GAAG,QAAQ,GAAG,MAAM,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAChE,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,QAAQ,GAAG,sBAAsB,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AACrH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEnD,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,KAAK,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,eAAe,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,EAAE,mBAAmB,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,SAAS,sBAAsB,EAAE,CAAC;CAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results.js","sourceRoot":"","sources":["../../src/authoring/results.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { WebDriverActionSequence } from '../protocol/types.js';
|
|
2
|
+
export declare const desktopStoryPlatforms: readonly ['macos', 'windows', 'win32'];
|
|
3
|
+
export declare const desktopStoryCapabilities: readonly ['accessibility-click', 'element-screenshot', 'focus', 'keyboard', 'physical-click', 'screenshot', 'wheel'];
|
|
4
|
+
export type DesktopStoryPlatform = (typeof desktopStoryPlatforms)[number];
|
|
5
|
+
export type DesktopStoryCapability = (typeof desktopStoryCapabilities)[number];
|
|
6
|
+
export type DesktopStorySelector = {
|
|
7
|
+
testId: string;
|
|
8
|
+
} | {
|
|
9
|
+
role: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
} | {
|
|
12
|
+
accessibleName: string;
|
|
13
|
+
} | {
|
|
14
|
+
text: string;
|
|
15
|
+
};
|
|
16
|
+
export type DesktopStoryState = 'accessibleName' | 'checked' | 'count' | 'displayed' | 'enabled' | 'expanded' | 'exists' | 'focused' | 'role' | 'selected' | 'text' | 'value';
|
|
17
|
+
export type DesktopStoryExpectation = {
|
|
18
|
+
state: DesktopStoryState;
|
|
19
|
+
target: DesktopStorySelector;
|
|
20
|
+
value?: boolean | number | string;
|
|
21
|
+
};
|
|
22
|
+
export type DesktopStoryStep = {
|
|
23
|
+
action: 'actions';
|
|
24
|
+
sequences: readonly WebDriverActionSequence[];
|
|
25
|
+
} | {
|
|
26
|
+
action: 'clear' | 'click' | 'doubleClick';
|
|
27
|
+
target: DesktopStorySelector;
|
|
28
|
+
} | {
|
|
29
|
+
action: 'keys';
|
|
30
|
+
value: readonly string[];
|
|
31
|
+
} | {
|
|
32
|
+
action: 'note';
|
|
33
|
+
message: string;
|
|
34
|
+
} | {
|
|
35
|
+
action: 'screenshot';
|
|
36
|
+
name: string;
|
|
37
|
+
target?: DesktopStorySelector;
|
|
38
|
+
} | {
|
|
39
|
+
action: 'scroll';
|
|
40
|
+
deltaX?: number;
|
|
41
|
+
deltaY: number;
|
|
42
|
+
target?: DesktopStorySelector;
|
|
43
|
+
} | {
|
|
44
|
+
action: 'setArgs';
|
|
45
|
+
args: Readonly<Record<string, unknown>>;
|
|
46
|
+
} | {
|
|
47
|
+
action: 'source';
|
|
48
|
+
name: string;
|
|
49
|
+
} | {
|
|
50
|
+
action: 'type';
|
|
51
|
+
target: DesktopStorySelector;
|
|
52
|
+
text: string;
|
|
53
|
+
} | {
|
|
54
|
+
action: 'wait';
|
|
55
|
+
target?: DesktopStorySelector;
|
|
56
|
+
timeoutMs?: number;
|
|
57
|
+
until?: DesktopStoryExpectation;
|
|
58
|
+
} | {
|
|
59
|
+
expect: DesktopStoryExpectation;
|
|
60
|
+
};
|
|
61
|
+
export type DesktopStoryTest = {
|
|
62
|
+
id: string;
|
|
63
|
+
platforms?: readonly DesktopStoryPlatform[];
|
|
64
|
+
requires?: readonly DesktopStoryCapability[];
|
|
65
|
+
steps: readonly DesktopStoryStep[];
|
|
66
|
+
title?: string;
|
|
67
|
+
};
|
|
68
|
+
export type DesktopStoryTests = {
|
|
69
|
+
portable?: boolean;
|
|
70
|
+
tests: readonly DesktopStoryTest[];
|
|
71
|
+
version: 1;
|
|
72
|
+
};
|
|
73
|
+
export declare const desktopBy: {
|
|
74
|
+
accessibleName: (accessibleName: string) => DesktopStorySelector;
|
|
75
|
+
role: (role: string, name?: string) => DesktopStorySelector;
|
|
76
|
+
testId: (testId: string) => DesktopStorySelector;
|
|
77
|
+
text: (text: string) => DesktopStorySelector;
|
|
78
|
+
};
|
|
79
|
+
export declare function defineDesktopStoryTests(plan: DesktopStoryTests): DesktopStoryTests;
|
|
80
|
+
export declare function validateDesktopStoryTests(value: unknown, source?: string): DesktopStoryTests;
|
|
81
|
+
//# sourceMappingURL=storyTests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storyTests.d.ts","sourceRoot":"","sources":["../../src/authoring/storyTests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAGpE,eAAO,MAAM,qBAAqB,YAAI,OAAO,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AAC5E,eAAO,MAAM,wBAAwB,YACnC,qBAAqB,EACrB,oBAAoB,EACpB,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,OAAO,CACC,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1E,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE/E,MAAM,MAAM,oBAAoB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,cAAc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