@sun-asterisk/sungen 2.6.12 → 2.6.15
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/commands/delivery.d.ts.map +1 -1
- package/dist/cli/commands/delivery.js +215 -65
- package/dist/cli/commands/delivery.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/dashboard/snapshot-builder.d.ts.map +1 -1
- package/dist/dashboard/snapshot-builder.js +173 -32
- package/dist/dashboard/snapshot-builder.js.map +1 -1
- package/dist/dashboard/templates/index.html +84 -84
- package/dist/dashboard/types.d.ts +35 -0
- package/dist/dashboard/types.d.ts.map +1 -1
- package/dist/exporters/csv-exporter.d.ts +24 -3
- package/dist/exporters/csv-exporter.d.ts.map +1 -1
- package/dist/exporters/csv-exporter.js +28 -7
- package/dist/exporters/csv-exporter.js.map +1 -1
- package/dist/exporters/json-exporter.d.ts +15 -0
- package/dist/exporters/json-exporter.d.ts.map +1 -1
- package/dist/exporters/json-exporter.js +7 -2
- package/dist/exporters/json-exporter.js.map +1 -1
- package/dist/exporters/playwright-report-parser.d.ts +7 -0
- package/dist/exporters/playwright-report-parser.d.ts.map +1 -1
- package/dist/exporters/playwright-report-parser.js +20 -0
- package/dist/exporters/playwright-report-parser.js.map +1 -1
- package/dist/exporters/selector-key-resolver.d.ts +55 -0
- package/dist/exporters/selector-key-resolver.d.ts.map +1 -0
- package/dist/exporters/selector-key-resolver.js +208 -0
- package/dist/exporters/selector-key-resolver.js.map +1 -0
- package/dist/exporters/test-data-resolver.d.ts +15 -2
- package/dist/exporters/test-data-resolver.d.ts.map +1 -1
- package/dist/exporters/test-data-resolver.js +61 -8
- package/dist/exporters/test-data-resolver.js.map +1 -1
- package/dist/exporters/types.d.ts +1 -0
- package/dist/exporters/types.d.ts.map +1 -1
- package/dist/exporters/xlsx-exporter.d.ts +28 -3
- package/dist/exporters/xlsx-exporter.d.ts.map +1 -1
- package/dist/exporters/xlsx-exporter.js +34 -6
- package/dist/exporters/xlsx-exporter.js.map +1 -1
- package/dist/generators/test-generator/code-generator.d.ts.map +1 -1
- package/dist/generators/test-generator/code-generator.js +13 -0
- package/dist/generators/test-generator/code-generator.js.map +1 -1
- package/dist/orchestrator/ai-rules-updater.d.ts.map +1 -1
- package/dist/orchestrator/ai-rules-updater.js +4 -0
- package/dist/orchestrator/ai-rules-updater.js.map +1 -1
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-add-screen.md +48 -14
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-dashboard.md +4 -1
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-delivery.md +22 -11
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-locale.md +71 -0
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-review.md +23 -8
- package/dist/orchestrator/templates/ai-instructions/claude-cmd-run-test.md +45 -6
- package/dist/orchestrator/templates/ai-instructions/claude-config.md +4 -1
- package/dist/orchestrator/templates/ai-instructions/claude-skill-locale.md +316 -0
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +50 -13
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-dashboard.md +4 -1
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +20 -9
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-locale.md +70 -0
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-review.md +23 -8
- package/dist/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +44 -6
- package/dist/orchestrator/templates/ai-instructions/copilot-config.md +4 -1
- package/dist/orchestrator/templates/ai-instructions/github-skill-sungen-locale.md +291 -0
- package/dist/orchestrator/templates/playwright.config.ts +25 -8
- package/dist/orchestrator/templates/specs-base.ts +9 -0
- package/dist/orchestrator/templates/specs-locale-fixture.ts +105 -0
- package/package.json +1 -1
- package/src/cli/commands/delivery.ts +256 -65
- package/src/cli/index.ts +1 -1
- package/src/dashboard/snapshot-builder.ts +207 -32
- package/src/dashboard/templates/index.html +84 -84
- package/src/dashboard/types.ts +40 -3
- package/src/exporters/csv-exporter.ts +36 -7
- package/src/exporters/json-exporter.ts +22 -2
- package/src/exporters/playwright-report-parser.ts +20 -0
- package/src/exporters/selector-key-resolver.ts +190 -0
- package/src/exporters/test-data-resolver.ts +65 -7
- package/src/exporters/types.ts +1 -0
- package/src/exporters/xlsx-exporter.ts +61 -7
- package/src/generators/test-generator/code-generator.ts +14 -0
- package/src/orchestrator/ai-rules-updater.ts +4 -0
- package/src/orchestrator/templates/ai-instructions/claude-cmd-add-screen.md +48 -14
- package/src/orchestrator/templates/ai-instructions/claude-cmd-dashboard.md +4 -1
- package/src/orchestrator/templates/ai-instructions/claude-cmd-delivery.md +22 -11
- package/src/orchestrator/templates/ai-instructions/claude-cmd-locale.md +71 -0
- package/src/orchestrator/templates/ai-instructions/claude-cmd-review.md +23 -8
- package/src/orchestrator/templates/ai-instructions/claude-cmd-run-test.md +45 -6
- package/src/orchestrator/templates/ai-instructions/claude-config.md +4 -1
- package/src/orchestrator/templates/ai-instructions/claude-skill-locale.md +316 -0
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-add-screen.md +50 -13
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-dashboard.md +4 -1
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-delivery.md +20 -9
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-locale.md +70 -0
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-review.md +23 -8
- package/src/orchestrator/templates/ai-instructions/copilot-cmd-run-test.md +44 -6
- package/src/orchestrator/templates/ai-instructions/copilot-config.md +4 -1
- package/src/orchestrator/templates/ai-instructions/github-skill-sungen-locale.md +291 -0
- package/src/orchestrator/templates/playwright.config.ts +25 -8
- package/src/orchestrator/templates/specs-base.ts +9 -0
- package/src/orchestrator/templates/specs-locale-fixture.ts +105 -0
- package/dist/orchestrator/templates/playwright.config.d.ts +0 -10
- package/dist/orchestrator/templates/playwright.config.d.ts.map +0 -1
- package/dist/orchestrator/templates/playwright.config.js +0 -104
- package/dist/orchestrator/templates/playwright.config.js.map +0 -1
- package/dist/orchestrator/templates/specs-base.d.ts +0 -14
- package/dist/orchestrator/templates/specs-base.d.ts.map +0 -1
- package/dist/orchestrator/templates/specs-base.js +0 -77
- package/dist/orchestrator/templates/specs-base.js.map +0 -1
- package/dist/orchestrator/templates/specs-test-data.d.ts +0 -16
- package/dist/orchestrator/templates/specs-test-data.d.ts.map +0 -1
- package/dist/orchestrator/templates/specs-test-data.js +0 -151
- package/dist/orchestrator/templates/specs-test-data.js.map +0 -1
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const test_1 = require("@playwright/test");
|
|
4
|
-
/**
|
|
5
|
-
* Read environment variables from file.
|
|
6
|
-
* https://github.com/motdotla/dotenv
|
|
7
|
-
*/
|
|
8
|
-
// import dotenv from 'dotenv';
|
|
9
|
-
// import path from 'path';
|
|
10
|
-
// dotenv.config({ path: path.resolve(__dirname, '.env') });
|
|
11
|
-
/**
|
|
12
|
-
* See https://playwright.dev/docs/test-configuration.
|
|
13
|
-
*/
|
|
14
|
-
exports.default = (0, test_1.defineConfig)({
|
|
15
|
-
testDir: './specs/generated',
|
|
16
|
-
/* Output directory for test artifacts (screenshots, videos, traces). */
|
|
17
|
-
outputDir: './test-results',
|
|
18
|
-
/* Run tests in files in parallel */
|
|
19
|
-
fullyParallel: true,
|
|
20
|
-
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
|
21
|
-
forbidOnly: !!process.env.CI,
|
|
22
|
-
/* Retry on CI only */
|
|
23
|
-
retries: process.env.CI ? 2 : 0,
|
|
24
|
-
/* Opt out of parallel tests on CI. */
|
|
25
|
-
workers: process.env.CI ? 1 : 2,
|
|
26
|
-
/* Global timeout per test */
|
|
27
|
-
timeout: 15000,
|
|
28
|
-
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
|
29
|
-
/* JSON reporter is required by `sungen delivery` to populate test result columns in the exported CSV. */
|
|
30
|
-
/* Output file path is controlled by PLAYWRIGHT_JSON_OUTPUT_NAME env var for per-screen isolation. */
|
|
31
|
-
reporter: [
|
|
32
|
-
['html'],
|
|
33
|
-
[
|
|
34
|
-
'json',
|
|
35
|
-
{
|
|
36
|
-
outputFile: process.env.PLAYWRIGHT_JSON_OUTPUT_NAME ||
|
|
37
|
-
'test-results/results.json',
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
],
|
|
41
|
-
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
|
42
|
-
use: {
|
|
43
|
-
/* Base URL to use in actions like `await page.goto('')`. */
|
|
44
|
-
baseURL: 'https://example.com',
|
|
45
|
-
/* Per-action timeout (click, fill, etc.) */
|
|
46
|
-
actionTimeout: 10000,
|
|
47
|
-
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
|
48
|
-
trace: 'on-first-retry',
|
|
49
|
-
/**
|
|
50
|
-
* Capture screenshot after each test failure.
|
|
51
|
-
* See https://playwright.dev/docs/api/class-testoptions#test-options-screenshot
|
|
52
|
-
*/
|
|
53
|
-
screenshot: 'only-on-failure',
|
|
54
|
-
/**
|
|
55
|
-
* Record video for each test, but remove all videos from successful test runs.
|
|
56
|
-
* See https://playwright.dev/docs/api/class-testoptions#test-options-video
|
|
57
|
-
*/
|
|
58
|
-
// video: 'retain-on-failure',
|
|
59
|
-
},
|
|
60
|
-
/* Configure projects for major browsers */
|
|
61
|
-
projects: [
|
|
62
|
-
{
|
|
63
|
-
name: 'chromium',
|
|
64
|
-
use: { ...test_1.devices['Desktop Chrome'] },
|
|
65
|
-
},
|
|
66
|
-
/*
|
|
67
|
-
// {
|
|
68
|
-
// name: 'firefox',
|
|
69
|
-
// use: { ...devices['Desktop Firefox'] },
|
|
70
|
-
// },
|
|
71
|
-
|
|
72
|
-
// {
|
|
73
|
-
// name: 'webkit',
|
|
74
|
-
// use: { ...devices['Desktop Safari'] },
|
|
75
|
-
// },
|
|
76
|
-
|
|
77
|
-
/* Test against mobile viewports.
|
|
78
|
-
// {
|
|
79
|
-
// name: 'Mobile Chrome',
|
|
80
|
-
// use: { ...devices['Pixel 5'] },
|
|
81
|
-
// },
|
|
82
|
-
// {
|
|
83
|
-
// name: 'Mobile Safari',
|
|
84
|
-
// use: { ...devices['iPhone 12'] },
|
|
85
|
-
// },
|
|
86
|
-
|
|
87
|
-
/* Test against branded browsers. */
|
|
88
|
-
// {
|
|
89
|
-
// name: 'Microsoft Edge',
|
|
90
|
-
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
|
|
91
|
-
// },
|
|
92
|
-
// {
|
|
93
|
-
// name: 'Google Chrome',
|
|
94
|
-
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
|
|
95
|
-
// },
|
|
96
|
-
],
|
|
97
|
-
/* Run your local dev server before starting the tests */
|
|
98
|
-
// webServer: {
|
|
99
|
-
// command: 'npm run start',
|
|
100
|
-
// url: 'http://localhost:3000',
|
|
101
|
-
// reuseExistingServer: !process.env.CI,
|
|
102
|
-
// },
|
|
103
|
-
});
|
|
104
|
-
//# sourceMappingURL=playwright.config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"playwright.config.js","sourceRoot":"","sources":["../../../src/orchestrator/templates/playwright.config.ts"],"names":[],"mappings":";;AAAA,2CAAyD;AAEzD;;;GAGG;AACH,+BAA+B;AAC/B,2BAA2B;AAC3B,4DAA4D;AAE5D;;GAEG;AACH,kBAAe,IAAA,mBAAY,EAAC;IAC1B,OAAO,EAAE,mBAAmB;IAC5B,wEAAwE;IACxE,SAAS,EAAE,gBAAgB;IAC3B,oCAAoC;IACpC,aAAa,EAAE,IAAI;IACnB,iFAAiF;IACjF,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;IAC5B,sBAAsB;IACtB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,sCAAsC;IACtC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,6BAA6B;IAC7B,OAAO,EAAE,KAAM;IACf,qEAAqE;IACrE,yGAAyG;IACzG,qGAAqG;IACrG,QAAQ,EAAE;QACR,CAAC,MAAM,CAAC;QACR;YACE,MAAM;YACN;gBACE,UAAU,EACR,OAAO,CAAC,GAAG,CAAC,2BAA2B;oBACvC,2BAA2B;aAC9B;SACF;KACF;IACD,wGAAwG;IACxG,GAAG,EAAE;QACH,4DAA4D;QAC5D,OAAO,EAAE,qBAAqB;QAE9B,4CAA4C;QAC5C,aAAa,EAAE,KAAM;QAErB,+FAA+F;QAC/F,KAAK,EAAE,gBAAgB;QAEvB;;;WAGG;QACH,UAAU,EAAE,iBAAiB;QAE7B;;;WAGG;QACH,8BAA8B;KAC/B;IAED,2CAA2C;IAC3C,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,EAAE,GAAG,cAAO,CAAC,gBAAgB,CAAC,EAAE;SACtC;QAED;;;;;;;;;;;;;;;;;;;;;4CAqBoC;QACpC,IAAI;QACJ,4BAA4B;QAC5B,4DAA4D;QAC5D,KAAK;QACL,IAAI;QACJ,2BAA2B;QAC3B,8DAA8D;QAC9D,KAAK;KACN;IAED,yDAAyD;IACzD,eAAe;IACf,8BAA8B;IAC9B,kCAAkC;IAClC,0CAA0C;IAC1C,KAAK;CACN,CAAC,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { expect, type Page } from '@playwright/test';
|
|
2
|
-
type CleanupConfig = {
|
|
3
|
-
overlay?: boolean;
|
|
4
|
-
forms?: boolean;
|
|
5
|
-
scroll?: boolean;
|
|
6
|
-
storage?: boolean;
|
|
7
|
-
};
|
|
8
|
-
declare function cleanupPage(page: Page, config: CleanupConfig): Promise<void>;
|
|
9
|
-
declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
|
|
10
|
-
screenshotOnFailure: boolean;
|
|
11
|
-
_autoScreenshot: void;
|
|
12
|
-
}, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
|
13
|
-
export { test, expect, cleanupPage };
|
|
14
|
-
//# sourceMappingURL=specs-base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"specs-base.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEnE,KAAK,aAAa,GAAG;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,iBAAe,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAmD3E;AAED,QAAA,MAAM,IAAI;yBACa,OAAO;qBACX,IAAI;wGAoBrB,CAAC;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.expect = exports.test = void 0;
|
|
4
|
-
exports.cleanupPage = cleanupPage;
|
|
5
|
-
const test_1 = require("@playwright/test");
|
|
6
|
-
Object.defineProperty(exports, "expect", { enumerable: true, get: function () { return test_1.expect; } });
|
|
7
|
-
async function cleanupPage(page, config) {
|
|
8
|
-
if (config.overlay) {
|
|
9
|
-
await page.keyboard.press('Escape').catch(() => { });
|
|
10
|
-
await page.locator('body').click({ position: { x: 1, y: 1 }, force: true }).catch(() => { });
|
|
11
|
-
const hasOverlay = await page.evaluate(`(() => {
|
|
12
|
-
const el = document.elementFromPoint(window.innerWidth / 2, window.innerHeight / 2);
|
|
13
|
-
if (!el) return false;
|
|
14
|
-
let current = el;
|
|
15
|
-
while (current && current !== document.body) {
|
|
16
|
-
if (getComputedStyle(current).position === 'fixed') return true;
|
|
17
|
-
current = current.parentElement;
|
|
18
|
-
}
|
|
19
|
-
return false;
|
|
20
|
-
})()`).catch(() => false);
|
|
21
|
-
if (hasOverlay) {
|
|
22
|
-
await page.keyboard.press('Escape').catch(() => { });
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (config.forms) {
|
|
26
|
-
await page.evaluate(`(() => {
|
|
27
|
-
const inputSetter = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value')?.set;
|
|
28
|
-
const textareaSetter = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value')?.set;
|
|
29
|
-
document.querySelectorAll('input:not([type=hidden]):not([type=submit]):not([type=checkbox]):not([type=radio])').forEach(el => {
|
|
30
|
-
inputSetter?.call(el, '');
|
|
31
|
-
el.dispatchEvent(new Event('input', { bubbles: true }));
|
|
32
|
-
el.dispatchEvent(new Event('change', { bubbles: true }));
|
|
33
|
-
});
|
|
34
|
-
document.querySelectorAll('textarea').forEach(el => {
|
|
35
|
-
textareaSetter?.call(el, '');
|
|
36
|
-
el.dispatchEvent(new Event('input', { bubbles: true }));
|
|
37
|
-
el.dispatchEvent(new Event('change', { bubbles: true }));
|
|
38
|
-
});
|
|
39
|
-
document.querySelectorAll('select').forEach(el => {
|
|
40
|
-
el.selectedIndex = 0;
|
|
41
|
-
el.dispatchEvent(new Event('change', { bubbles: true }));
|
|
42
|
-
});
|
|
43
|
-
document.querySelectorAll('input[type=checkbox]').forEach(el => {
|
|
44
|
-
if (el.checked !== el.defaultChecked) {
|
|
45
|
-
el.checked = el.defaultChecked;
|
|
46
|
-
el.dispatchEvent(new Event('change', { bubbles: true }));
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
document.querySelectorAll('form').forEach(f => f.reset());
|
|
50
|
-
})()`).catch(() => { });
|
|
51
|
-
}
|
|
52
|
-
if (config.scroll) {
|
|
53
|
-
await page.evaluate('window.scrollTo(0, 0)').catch(() => { });
|
|
54
|
-
}
|
|
55
|
-
if (config.storage) {
|
|
56
|
-
await page.evaluate('sessionStorage.clear()').catch(() => { });
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
const test = test_1.test.extend({
|
|
60
|
-
screenshotOnFailure: [false, { option: true }],
|
|
61
|
-
page: async ({ context }, use) => {
|
|
62
|
-
const page = await context.newPage();
|
|
63
|
-
await use(page);
|
|
64
|
-
await page.close();
|
|
65
|
-
},
|
|
66
|
-
_autoScreenshot: [async ({ page, screenshotOnFailure }, use, testInfo) => {
|
|
67
|
-
await use();
|
|
68
|
-
if (screenshotOnFailure && testInfo.status !== testInfo.expectedStatus) {
|
|
69
|
-
await testInfo.attach('screenshot', {
|
|
70
|
-
body: await page.screenshot(),
|
|
71
|
-
contentType: 'image/png',
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
}, { auto: true }],
|
|
75
|
-
});
|
|
76
|
-
exports.test = test;
|
|
77
|
-
//# sourceMappingURL=specs-base.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"specs-base.js","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-base.ts"],"names":[],"mappings":";;;AAsFuB,kCAAW;AAtFlC,2CAAmE;AAsFpD,uFAtFQ,aAAM,OAsFR;AA7ErB,KAAK,UAAU,WAAW,CAAC,IAAU,EAAE,MAAqB;IAC1D,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;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AE,EAAE;QAC/B,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QACrC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC;QAChB,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IAED,eAAe,EAAE,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;YACvE,MAAM,GAAG,EAAE,CAAC;YAEZ,IAAI,mBAAmB,IAAI,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,cAAc,EAAE,CAAC;gBACvE,MAAM,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE;oBAClC,IAAI,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE;oBAC7B,WAAW,EAAE,WAAW;iBACzB,CAAC,CAAC;YACL,CAAC;QACH,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;CACnB,CAAC,CAAC;AAEM,oBAAI"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare class TestDataLoader {
|
|
2
|
-
private data;
|
|
3
|
-
private constructor();
|
|
4
|
-
/**
|
|
5
|
-
* Load test data for a screen/feature or flow/feature combination.
|
|
6
|
-
*
|
|
7
|
-
* Priority (later wins):
|
|
8
|
-
* 1. {feature}.yaml — base data
|
|
9
|
-
* 2. {feature}.{SUNGEN_ENV}.yaml — environment-specific (if SUNGEN_ENV set)
|
|
10
|
-
*
|
|
11
|
-
* Paths: screenName starting with "flows/" loads from qa/flows/, otherwise qa/screens/
|
|
12
|
-
*/
|
|
13
|
-
static load(screenName: string, featureName: string): TestDataLoader;
|
|
14
|
-
get(key: string): string;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=specs-test-data.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"specs-test-data.d.ts","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-test-data.ts"],"names":[],"mappings":"AAKA,qBAAa,cAAc;IACzB,OAAO,CAAC,IAAI,CAAsB;IAElC,OAAO;IAIP;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc;IAqBpE,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;CAczB"}
|
|
@@ -1,151 +0,0 @@
|
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.TestDataLoader = void 0;
|
|
40
|
-
const fs = __importStar(require("fs"));
|
|
41
|
-
const path = __importStar(require("path"));
|
|
42
|
-
const crypto = __importStar(require("crypto"));
|
|
43
|
-
const yaml_1 = __importDefault(require("yaml"));
|
|
44
|
-
class TestDataLoader {
|
|
45
|
-
constructor(data) {
|
|
46
|
-
this.data = data;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Load test data for a screen/feature or flow/feature combination.
|
|
50
|
-
*
|
|
51
|
-
* Priority (later wins):
|
|
52
|
-
* 1. {feature}.yaml — base data
|
|
53
|
-
* 2. {feature}.{SUNGEN_ENV}.yaml — environment-specific (if SUNGEN_ENV set)
|
|
54
|
-
*
|
|
55
|
-
* Paths: screenName starting with "flows/" loads from qa/flows/, otherwise qa/screens/
|
|
56
|
-
*/
|
|
57
|
-
static load(screenName, featureName) {
|
|
58
|
-
let baseDir;
|
|
59
|
-
if (screenName.startsWith('flows/')) {
|
|
60
|
-
baseDir = path.join(process.cwd(), 'qa', screenName, 'test-data');
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
baseDir = path.join(process.cwd(), 'qa', 'screens', screenName, 'test-data');
|
|
64
|
-
}
|
|
65
|
-
const env = process.env.SUNGEN_ENV;
|
|
66
|
-
let data = loadYamlSync(path.join(baseDir, `${featureName}.yaml`)) || {};
|
|
67
|
-
if (env) {
|
|
68
|
-
const envData = loadYamlSync(path.join(baseDir, `${featureName}.${env}.yaml`));
|
|
69
|
-
if (envData)
|
|
70
|
-
data = deepMerge(data, envData);
|
|
71
|
-
}
|
|
72
|
-
data = resolveDynamicVars(data);
|
|
73
|
-
return new TestDataLoader(data);
|
|
74
|
-
}
|
|
75
|
-
get(key) {
|
|
76
|
-
const parts = key.split('.');
|
|
77
|
-
let current = this.data;
|
|
78
|
-
for (const part of parts) {
|
|
79
|
-
if (current == null || typeof current !== 'object') {
|
|
80
|
-
throw new Error(`Test data key not found: ${key} (failed at '${part}')`);
|
|
81
|
-
}
|
|
82
|
-
current = current[part];
|
|
83
|
-
}
|
|
84
|
-
if (current === undefined || current === null) {
|
|
85
|
-
throw new Error(`Test data key not found: ${key}`);
|
|
86
|
-
}
|
|
87
|
-
return String(current);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
exports.TestDataLoader = TestDataLoader;
|
|
91
|
-
function loadYamlSync(filePath) {
|
|
92
|
-
if (!fs.existsSync(filePath))
|
|
93
|
-
return null;
|
|
94
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
95
|
-
return yaml_1.default.parse(content) || null;
|
|
96
|
-
}
|
|
97
|
-
function deepMerge(base, override) {
|
|
98
|
-
const result = { ...base };
|
|
99
|
-
for (const [key, value] of Object.entries(override)) {
|
|
100
|
-
if (value && typeof value === 'object' && !Array.isArray(value) &&
|
|
101
|
-
result[key] && typeof result[key] === 'object' && !Array.isArray(result[key])) {
|
|
102
|
-
result[key] = deepMerge(result[key], value);
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
result[key] = value;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
return result;
|
|
109
|
-
}
|
|
110
|
-
function resolveDynamicVars(data) {
|
|
111
|
-
const ts = String(Date.now());
|
|
112
|
-
const uid = crypto.randomUUID();
|
|
113
|
-
const now = new Date();
|
|
114
|
-
const date = now.toISOString().split('T')[0];
|
|
115
|
-
const datetime = now.toISOString();
|
|
116
|
-
function resolveValue(value) {
|
|
117
|
-
if (typeof value === 'string') {
|
|
118
|
-
return value.replace(/\{\{\$(\w+)(?::([^}]*))?\}\}/g, (match, name, args) => {
|
|
119
|
-
switch (name) {
|
|
120
|
-
case 'timestamp':
|
|
121
|
-
return ts;
|
|
122
|
-
case 'uuid':
|
|
123
|
-
return uid;
|
|
124
|
-
case 'random': {
|
|
125
|
-
const [min, max] = (args || '1:9999').split(':').map(Number);
|
|
126
|
-
return String(Math.floor(Math.random() * (max - min + 1)) + min);
|
|
127
|
-
}
|
|
128
|
-
case 'date':
|
|
129
|
-
return date;
|
|
130
|
-
case 'datetime':
|
|
131
|
-
return datetime;
|
|
132
|
-
default:
|
|
133
|
-
return match;
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
if (Array.isArray(value)) {
|
|
138
|
-
return value.map(resolveValue);
|
|
139
|
-
}
|
|
140
|
-
if (value && typeof value === 'object') {
|
|
141
|
-
const resolved = {};
|
|
142
|
-
for (const [k, v] of Object.entries(value)) {
|
|
143
|
-
resolved[k] = resolveValue(v);
|
|
144
|
-
}
|
|
145
|
-
return resolved;
|
|
146
|
-
}
|
|
147
|
-
return value;
|
|
148
|
-
}
|
|
149
|
-
return resolveValue(data);
|
|
150
|
-
}
|
|
151
|
-
//# sourceMappingURL=specs-test-data.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"specs-test-data.js","sourceRoot":"","sources":["../../../src/orchestrator/templates/specs-test-data.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AACjC,gDAAwB;AAExB,MAAa,cAAc;IAGzB,YAAoB,IAAyB;QAC3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,CAAC,UAAkB,EAAE,WAAmB;QACjD,IAAI,OAAe,CAAC;QACpB,IAAI,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACpC,OAAO,GAAG,I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