@emesoft_company/playwright-core 2.1.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.
Files changed (92) hide show
  1. package/README.md +62 -0
  2. package/dist/api/index.cjs +248 -0
  3. package/dist/api/index.cjs.map +1 -0
  4. package/dist/api/index.d.cts +12 -0
  5. package/dist/api/index.d.ts +12 -0
  6. package/dist/api/index.js +245 -0
  7. package/dist/api/index.js.map +1 -0
  8. package/dist/api-client-C_StjpPX.d.ts +58 -0
  9. package/dist/api-client-CpXo_NOU.d.cts +58 -0
  10. package/dist/auth/index.cjs +310 -0
  11. package/dist/auth/index.cjs.map +1 -0
  12. package/dist/auth/index.d.cts +98 -0
  13. package/dist/auth/index.d.ts +98 -0
  14. package/dist/auth/index.js +304 -0
  15. package/dist/auth/index.js.map +1 -0
  16. package/dist/config/index.cjs +268 -0
  17. package/dist/config/index.cjs.map +1 -0
  18. package/dist/config/index.d.cts +105 -0
  19. package/dist/config/index.d.ts +105 -0
  20. package/dist/config/index.js +254 -0
  21. package/dist/config/index.js.map +1 -0
  22. package/dist/data/index.cjs +59 -0
  23. package/dist/data/index.cjs.map +1 -0
  24. package/dist/data/index.d.cts +25 -0
  25. package/dist/data/index.d.ts +25 -0
  26. package/dist/data/index.js +50 -0
  27. package/dist/data/index.js.map +1 -0
  28. package/dist/di/index.cjs +47 -0
  29. package/dist/di/index.cjs.map +1 -0
  30. package/dist/di/index.d.cts +19 -0
  31. package/dist/di/index.d.ts +19 -0
  32. package/dist/di/index.js +45 -0
  33. package/dist/di/index.js.map +1 -0
  34. package/dist/errors/index.cjs +90 -0
  35. package/dist/errors/index.cjs.map +1 -0
  36. package/dist/errors/index.d.cts +38 -0
  37. package/dist/errors/index.d.ts +38 -0
  38. package/dist/errors/index.js +83 -0
  39. package/dist/errors/index.js.map +1 -0
  40. package/dist/expect/index.cjs +36 -0
  41. package/dist/expect/index.cjs.map +1 -0
  42. package/dist/expect/index.d.cts +30 -0
  43. package/dist/expect/index.d.ts +30 -0
  44. package/dist/expect/index.js +34 -0
  45. package/dist/expect/index.js.map +1 -0
  46. package/dist/fixtures/index.cjs +660 -0
  47. package/dist/fixtures/index.cjs.map +1 -0
  48. package/dist/fixtures/index.d.cts +68 -0
  49. package/dist/fixtures/index.d.ts +68 -0
  50. package/dist/fixtures/index.js +651 -0
  51. package/dist/fixtures/index.js.map +1 -0
  52. package/dist/index.cjs +1322 -0
  53. package/dist/index.cjs.map +1 -0
  54. package/dist/index.d.cts +21 -0
  55. package/dist/index.d.ts +21 -0
  56. package/dist/index.js +1248 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/logging/index.cjs +32 -0
  59. package/dist/logging/index.cjs.map +1 -0
  60. package/dist/logging/index.d.cts +18 -0
  61. package/dist/logging/index.d.ts +18 -0
  62. package/dist/logging/index.js +25 -0
  63. package/dist/logging/index.js.map +1 -0
  64. package/dist/reporting/index.cjs +59 -0
  65. package/dist/reporting/index.cjs.map +1 -0
  66. package/dist/reporting/index.d.cts +63 -0
  67. package/dist/reporting/index.d.ts +63 -0
  68. package/dist/reporting/index.js +52 -0
  69. package/dist/reporting/index.js.map +1 -0
  70. package/dist/retry-XqnSC8YL.d.cts +27 -0
  71. package/dist/retry-XqnSC8YL.d.ts +27 -0
  72. package/dist/schema-y5w2hbT-.d.cts +292 -0
  73. package/dist/schema-y5w2hbT-.d.ts +292 -0
  74. package/dist/types-CbWnSYEK.d.cts +5 -0
  75. package/dist/types-CbWnSYEK.d.ts +5 -0
  76. package/dist/types-CopwwpSW.d.cts +8 -0
  77. package/dist/types-CopwwpSW.d.ts +8 -0
  78. package/dist/types-hInbkPXf.d.cts +59 -0
  79. package/dist/types-hInbkPXf.d.ts +59 -0
  80. package/dist/ui/index.cjs +366 -0
  81. package/dist/ui/index.cjs.map +1 -0
  82. package/dist/ui/index.d.cts +190 -0
  83. package/dist/ui/index.d.ts +190 -0
  84. package/dist/ui/index.js +348 -0
  85. package/dist/ui/index.js.map +1 -0
  86. package/dist/utils/index.cjs +72 -0
  87. package/dist/utils/index.cjs.map +1 -0
  88. package/dist/utils/index.d.cts +27 -0
  89. package/dist/utils/index.d.ts +27 -0
  90. package/dist/utils/index.js +66 -0
  91. package/dist/utils/index.js.map +1 -0
  92. package/package.json +133 -0
@@ -0,0 +1,52 @@
1
+ // src/reporting/allure-setup.ts
2
+ function buildReporterConfig(config) {
3
+ const reporters = [["html", { open: "never" }]];
4
+ if (config.reporting.allureEnabled) {
5
+ reporters.push(["allure-playwright", { resultsDir: config.reporting.resultsDir, detail: true }]);
6
+ }
7
+ return reporters;
8
+ }
9
+
10
+ // src/reporting/attachments.ts
11
+ async function attachText(testInfo, name, body) {
12
+ await testInfo.attach(name, { body, contentType: "text/plain" });
13
+ }
14
+ async function attachJson(testInfo, name, value) {
15
+ await testInfo.attach(name, {
16
+ body: JSON.stringify(value, null, 2),
17
+ contentType: "application/json"
18
+ });
19
+ }
20
+ async function attachScreenshot(testInfo, name, buffer) {
21
+ await testInfo.attach(name, { body: buffer, contentType: "image/png" });
22
+ }
23
+
24
+ // src/reporting/meta.ts
25
+ function toArray(value) {
26
+ if (value === void 0) return [];
27
+ return Array.isArray(value) ? value : [value];
28
+ }
29
+ function meta(options) {
30
+ const tags = toArray(options.tag).map((tag) => tag.startsWith("@") ? tag : `@${tag}`);
31
+ const testCaseAnnotations = toArray(options.testCase).map((id) => ({
32
+ type: "testCase",
33
+ description: id
34
+ }));
35
+ const annotation = [...testCaseAnnotations, ...options.annotation ?? []];
36
+ return {
37
+ ...tags.length > 0 ? { tag: tags } : {},
38
+ ...annotation.length > 0 ? { annotation } : {}
39
+ };
40
+ }
41
+ function linkTestCases(testInfo, urlTemplate) {
42
+ if (!urlTemplate) return;
43
+ for (const annotation of testInfo.annotations) {
44
+ if (annotation.type === "testCase" && annotation.description) {
45
+ annotation.description = urlTemplate.replace("{id}", annotation.description);
46
+ }
47
+ }
48
+ }
49
+
50
+ export { attachJson, attachScreenshot, attachText, buildReporterConfig, linkTestCases, meta };
51
+ //# sourceMappingURL=index.js.map
52
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/reporting/allure-setup.ts","../../src/reporting/attachments.ts","../../src/reporting/meta.ts"],"names":[],"mappings":";AAaO,SAAS,oBAAoB,MAAA,EAAiE;AACnG,EAAA,MAAM,SAAA,GAAuC,CAAC,CAAC,MAAA,EAAQ,EAAE,IAAA,EAAM,OAAA,EAAS,CAAC,CAAA;AACzE,EAAA,IAAI,MAAA,CAAO,UAAU,aAAA,EAAe;AAClC,IAAA,SAAA,CAAU,IAAA,CAAK,CAAC,mBAAA,EAAqB,EAAE,UAAA,EAAY,MAAA,CAAO,SAAA,CAAU,UAAA,EAAY,MAAA,EAAQ,IAAA,EAAM,CAAC,CAAA;AAAA,EACjG;AACA,EAAA,OAAO,SAAA;AACT;;;ACXA,eAAsB,UAAA,CAAW,QAAA,EAAoB,IAAA,EAAc,IAAA,EAA6B;AAC9F,EAAA,MAAM,SAAS,MAAA,CAAO,IAAA,EAAM,EAAE,IAAA,EAAM,WAAA,EAAa,cAAc,CAAA;AACjE;AAEA,eAAsB,UAAA,CAAW,QAAA,EAAoB,IAAA,EAAc,KAAA,EAA+B;AAChG,EAAA,MAAM,QAAA,CAAS,OAAO,IAAA,EAAM;AAAA,IAC1B,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,KAAA,EAAO,MAAM,CAAC,CAAA;AAAA,IACnC,WAAA,EAAa;AAAA,GACd,CAAA;AACH;AAEA,eAAsB,gBAAA,CAAiB,QAAA,EAAoB,IAAA,EAAc,MAAA,EAA+B;AACtG,EAAA,MAAM,QAAA,CAAS,OAAO,IAAA,EAAM,EAAE,MAAM,MAAA,EAAQ,WAAA,EAAa,aAAa,CAAA;AACxE;;;ACLA,SAAS,QAAQ,KAAA,EAAgD;AAC/D,EAAA,IAAI,KAAA,KAAU,MAAA,EAAW,OAAO,EAAC;AACjC,EAAA,OAAO,MAAM,OAAA,CAAQ,KAAK,CAAA,GAAI,KAAA,GAAQ,CAAC,KAAK,CAAA;AAC9C;AAcO,SAAS,KAAK,OAAA,EAAoC;AACvD,EAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,OAAA,CAAQ,GAAG,EAAE,GAAA,CAAI,CAAC,GAAA,KAAS,GAAA,CAAI,WAAW,GAAG,CAAA,GAAI,GAAA,GAAM,CAAA,CAAA,EAAI,GAAG,CAAA,CAAG,CAAA;AACtF,EAAA,MAAM,sBAAsB,OAAA,CAAQ,OAAA,CAAQ,QAAQ,CAAA,CAAE,GAAA,CAAI,CAAC,EAAA,MAAQ;AAAA,IACjE,IAAA,EAAM,UAAA;AAAA,IACN,WAAA,EAAa;AAAA,GACf,CAAE,CAAA;AAEF,EAAA,MAAM,UAAA,GAAa,CAAC,GAAG,mBAAA,EAAqB,GAAI,OAAA,CAAQ,UAAA,IAAc,EAAG,CAAA;AAEzE,EAAA,OAAO;AAAA,IACL,GAAI,KAAK,MAAA,GAAS,CAAA,GAAI,EAAE,GAAA,EAAK,IAAA,KAAS,EAAC;AAAA,IACvC,GAAI,UAAA,CAAW,MAAA,GAAS,IAAI,EAAE,UAAA,KAAe;AAAC,GAChD;AACF;AAMO,SAAS,aAAA,CAAc,UAAoB,WAAA,EAAuC;AACvF,EAAA,IAAI,CAAC,WAAA,EAAa;AAClB,EAAA,KAAA,MAAW,UAAA,IAAc,SAAS,WAAA,EAAa;AAC7C,IAAA,IAAI,UAAA,CAAW,IAAA,KAAS,UAAA,IAAc,UAAA,CAAW,WAAA,EAAa;AAC5D,MAAA,UAAA,CAAW,WAAA,GAAc,WAAA,CAAY,OAAA,CAAQ,MAAA,EAAQ,WAAW,WAAW,CAAA;AAAA,IAC7E;AAAA,EACF;AACF","file":"index.js","sourcesContent":["import type { AppConfig } from \"../config/schema.js\";\n\nexport type PlaywrightReporterEntry = [string] | [string, Record<string, unknown>];\n\n/**\n * Builds the `reporter` array for a project's `playwright.config.ts`. Always includes\n * the built-in HTML reporter; adds Allure when `reporting.allureEnabled` is true.\n *\n * Allure is optional and NOT bundled transitively: because Playwright resolves reporter\n * packages relative to the project that runs the tests, a project enabling Allure must add\n * `allure-playwright` (and `allure-js-commons` if using manual annotations) to its own\n * `devDependencies`. See `docs/EXTENDING.md`.\n */\nexport function buildReporterConfig(config: Pick<AppConfig, \"reporting\">): PlaywrightReporterEntry[] {\n const reporters: PlaywrightReporterEntry[] = [[\"html\", { open: \"never\" }]];\n if (config.reporting.allureEnabled) {\n reporters.push([\"allure-playwright\", { resultsDir: config.reporting.resultsDir, detail: true }]);\n }\n return reporters;\n}\n","import type { TestInfo } from \"@playwright/test\";\n\n/**\n * Report attachment helpers. These show up in the HTML report (and Allure, when enabled)\n * next to the test, which is usually the difference between a failure you can diagnose from\n * CI and one you have to reproduce locally.\n */\n\nexport async function attachText(testInfo: TestInfo, name: string, body: string): Promise<void> {\n await testInfo.attach(name, { body, contentType: \"text/plain\" });\n}\n\nexport async function attachJson(testInfo: TestInfo, name: string, value: unknown): Promise<void> {\n await testInfo.attach(name, {\n body: JSON.stringify(value, null, 2),\n contentType: \"application/json\",\n });\n}\n\nexport async function attachScreenshot(testInfo: TestInfo, name: string, buffer: Buffer): Promise<void> {\n await testInfo.attach(name, { body: buffer, contentType: \"image/png\" });\n}\n","import type { TestInfo } from \"@playwright/test\";\n\nexport interface TestMetaOptions {\n /** Test-case id(s) in your test management tool, e.g. `\"TC-1234\"` or `[\"TC-1\", \"TC-2\"]`. */\n testCase?: string | string[];\n /** Tag(s) for filtering with `--grep`, e.g. `\"@smoke\"`. The leading `@` is added if missing. */\n tag?: string | string[];\n /** Free-form annotations, e.g. `{ type: \"issue\", description: \"JIRA-42\" }`. */\n annotation?: { type: string; description?: string }[];\n}\n\nexport interface TestMeta {\n tag?: string[];\n annotation?: { type: string; description?: string }[];\n}\n\nfunction toArray(value: string | string[] | undefined): string[] {\n if (value === undefined) return [];\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Builds the `details` argument of `test(title, details, body)` from test-case ids and tags,\n * so the mapping between an automated test and its test-case id lives in the test itself and\n * shows up in the report.\n *\n * ```ts\n * test(\"login success\", meta({ testCase: \"TC-1234\", tag: \"@smoke\" }), async ({ page }) => { ... });\n * ```\n *\n * Set `reporting.testCaseUrlTemplate` (env `TEST_CASE_URL_TEMPLATE`, with `{id}` as the\n * placeholder) to turn the ids into links — see `linkTestCases`.\n */\nexport function meta(options: TestMetaOptions): TestMeta {\n const tags = toArray(options.tag).map((tag) => (tag.startsWith(\"@\") ? tag : `@${tag}`));\n const testCaseAnnotations = toArray(options.testCase).map((id) => ({\n type: \"testCase\",\n description: id,\n }));\n\n const annotation = [...testCaseAnnotations, ...(options.annotation ?? [])];\n\n return {\n ...(tags.length > 0 ? { tag: tags } : {}),\n ...(annotation.length > 0 ? { annotation } : {}),\n };\n}\n\n/**\n * Rewrites `testCase` annotations into full URLs using a template containing `{id}`.\n * Call from a project's `beforeEach`/fixture when `reporting.testCaseUrlTemplate` is set.\n */\nexport function linkTestCases(testInfo: TestInfo, urlTemplate: string | undefined): void {\n if (!urlTemplate) return;\n for (const annotation of testInfo.annotations) {\n if (annotation.type === \"testCase\" && annotation.description) {\n annotation.description = urlTemplate.replace(\"{id}\", annotation.description);\n }\n }\n}\n"]}
@@ -0,0 +1,27 @@
1
+ interface RetryOptions {
2
+ /** Number of retry attempts after the initial try. Default: 2. */
3
+ retries?: number;
4
+ minDelayMs?: number;
5
+ maxDelayMs?: number;
6
+ /** Exponential backoff factor. Default: 2. */
7
+ factor?: number;
8
+ /** Return true to retry this error, false to fail fast. Default: retry everything. */
9
+ retryOn?: (error: unknown) => boolean;
10
+ /** Called before each retry (not before the first attempt). */
11
+ onRetry?: (error: unknown, attempt: number) => void;
12
+ /** Called once when giving up, with the total number of attempts made. */
13
+ onGiveUp?: (error: unknown, attempts: number) => void;
14
+ }
15
+ /**
16
+ * Runs `fn` with exponential-backoff retry. Used for both flaky API calls and
17
+ * flaky UI actions so the retry policy stays consistent across the framework.
18
+ *
19
+ * Always rethrows the ORIGINAL error — whether it failed fast (`retryOn` returned
20
+ * false) or exhausted its retries. That's what makes `catch (e) { e instanceof ApiError }`
21
+ * and `expect(...).rejects.toThrow(ApiError)` work in tests; wrapping the error in a
22
+ * retry-specific type would hide the only thing the caller actually wants to assert on.
23
+ * Use `onGiveUp` if you need the attempt count.
24
+ */
25
+ declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
26
+
27
+ export { type RetryOptions as R, withRetry as w };
@@ -0,0 +1,27 @@
1
+ interface RetryOptions {
2
+ /** Number of retry attempts after the initial try. Default: 2. */
3
+ retries?: number;
4
+ minDelayMs?: number;
5
+ maxDelayMs?: number;
6
+ /** Exponential backoff factor. Default: 2. */
7
+ factor?: number;
8
+ /** Return true to retry this error, false to fail fast. Default: retry everything. */
9
+ retryOn?: (error: unknown) => boolean;
10
+ /** Called before each retry (not before the first attempt). */
11
+ onRetry?: (error: unknown, attempt: number) => void;
12
+ /** Called once when giving up, with the total number of attempts made. */
13
+ onGiveUp?: (error: unknown, attempts: number) => void;
14
+ }
15
+ /**
16
+ * Runs `fn` with exponential-backoff retry. Used for both flaky API calls and
17
+ * flaky UI actions so the retry policy stays consistent across the framework.
18
+ *
19
+ * Always rethrows the ORIGINAL error — whether it failed fast (`retryOn` returned
20
+ * false) or exhausted its retries. That's what makes `catch (e) { e instanceof ApiError }`
21
+ * and `expect(...).rejects.toThrow(ApiError)` work in tests; wrapping the error in a
22
+ * retry-specific type would hide the only thing the caller actually wants to assert on.
23
+ * Use `onGiveUp` if you need the attempt count.
24
+ */
25
+ declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
26
+
27
+ export { type RetryOptions as R, withRetry as w };
@@ -0,0 +1,292 @@
1
+ import { z } from 'zod';
2
+
3
+ /** Environments seen most often across projects — autocompleted, but any string is accepted. */
4
+ declare const KNOWN_ENVIRONMENTS: readonly ["local", "dev", "qa", "uat", "staging", "prod"];
5
+ /**
6
+ * Free-form on purpose: teams run `uat`, `qa`, `sit`, per-tenant envs and so on. The union
7
+ * below keeps editor autocomplete for the common ones without rejecting anything else
8
+ * (`(string & {})` is the TS idiom that preserves suggestions on an open string type).
9
+ */
10
+ type Environment = (typeof KNOWN_ENVIRONMENTS)[number] | (string & {});
11
+ declare const EnvironmentSchema: z.ZodString;
12
+ declare const TimeoutsSchema: z.ZodObject<{
13
+ actionMs: z.ZodDefault<z.ZodNumber>;
14
+ navigationMs: z.ZodDefault<z.ZodNumber>;
15
+ testMs: z.ZodDefault<z.ZodNumber>;
16
+ /** Default budget for `waitForCondition` and other non-locator polling. */
17
+ waitMs: z.ZodDefault<z.ZodNumber>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ actionMs: number;
20
+ navigationMs: number;
21
+ testMs: number;
22
+ waitMs: number;
23
+ }, {
24
+ actionMs?: number | undefined;
25
+ navigationMs?: number | undefined;
26
+ testMs?: number | undefined;
27
+ waitMs?: number | undefined;
28
+ }>;
29
+ declare const AuthConfigSchema: z.ZodDefault<z.ZodObject<{
30
+ tokenUrl: z.ZodOptional<z.ZodString>;
31
+ clientId: z.ZodOptional<z.ZodString>;
32
+ clientSecret: z.ZodOptional<z.ZodString>;
33
+ username: z.ZodOptional<z.ZodString>;
34
+ password: z.ZodOptional<z.ZodString>;
35
+ /** Single-session storage state file (see `buildGlobalSetup`). */
36
+ storageStatePath: z.ZodOptional<z.ZodString>;
37
+ /** Directory used for per-role storage state files in multi-role setups. */
38
+ storageStateDir: z.ZodDefault<z.ZodString>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ storageStateDir: string;
41
+ tokenUrl?: string | undefined;
42
+ clientId?: string | undefined;
43
+ clientSecret?: string | undefined;
44
+ username?: string | undefined;
45
+ password?: string | undefined;
46
+ storageStatePath?: string | undefined;
47
+ }, {
48
+ tokenUrl?: string | undefined;
49
+ clientId?: string | undefined;
50
+ clientSecret?: string | undefined;
51
+ username?: string | undefined;
52
+ password?: string | undefined;
53
+ storageStatePath?: string | undefined;
54
+ storageStateDir?: string | undefined;
55
+ }>>;
56
+ declare const ReportingConfigSchema: z.ZodDefault<z.ZodObject<{
57
+ allureEnabled: z.ZodDefault<z.ZodBoolean>;
58
+ resultsDir: z.ZodDefault<z.ZodString>;
59
+ /** `{id}` is replaced with a test-case id — see `meta()` in `@emesoft_company/playwright-core/reporting`. */
60
+ testCaseUrlTemplate: z.ZodOptional<z.ZodString>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ allureEnabled: boolean;
63
+ resultsDir: string;
64
+ testCaseUrlTemplate?: string | undefined;
65
+ }, {
66
+ allureEnabled?: boolean | undefined;
67
+ resultsDir?: string | undefined;
68
+ testCaseUrlTemplate?: string | undefined;
69
+ }>>;
70
+ declare const RetryConfigSchema: z.ZodDefault<z.ZodObject<{
71
+ retries: z.ZodDefault<z.ZodNumber>;
72
+ minDelayMs: z.ZodDefault<z.ZodNumber>;
73
+ maxDelayMs: z.ZodDefault<z.ZodNumber>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ retries: number;
76
+ minDelayMs: number;
77
+ maxDelayMs: number;
78
+ }, {
79
+ retries?: number | undefined;
80
+ minDelayMs?: number | undefined;
81
+ maxDelayMs?: number | undefined;
82
+ }>>;
83
+ declare const DiagnosticsConfigSchema: z.ZodDefault<z.ZodObject<{
84
+ /** Collect browser console errors + failed requests and attach them to the report. */
85
+ enabled: z.ZodDefault<z.ZodBoolean>;
86
+ /** Fail the test if the page logged a console error. Off by default — many apps are noisy. */
87
+ failOnConsoleError: z.ZodDefault<z.ZodBoolean>;
88
+ /** Fail the test on an uncaught page exception. */
89
+ failOnPageError: z.ZodDefault<z.ZodBoolean>;
90
+ /** Console messages matching any of these substrings are ignored entirely. */
91
+ ignoreConsolePatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
92
+ }, "strip", z.ZodTypeAny, {
93
+ enabled: boolean;
94
+ failOnConsoleError: boolean;
95
+ failOnPageError: boolean;
96
+ ignoreConsolePatterns: string[];
97
+ }, {
98
+ enabled?: boolean | undefined;
99
+ failOnConsoleError?: boolean | undefined;
100
+ failOnPageError?: boolean | undefined;
101
+ ignoreConsolePatterns?: string[] | undefined;
102
+ }>>;
103
+ /**
104
+ * Base config schema shared by every project. Projects extend this via
105
+ * `AppConfigSchema.extend({ ... })` or by nesting project-specific fields
106
+ * under `custom` — core never hardcodes project business fields here.
107
+ */
108
+ declare const AppConfigSchema: z.ZodObject<{
109
+ environment: z.ZodString;
110
+ baseUrl: z.ZodString;
111
+ apiBaseUrl: z.ZodOptional<z.ZodString>;
112
+ tenant: z.ZodOptional<z.ZodString>;
113
+ timeouts: z.ZodDefault<z.ZodObject<{
114
+ actionMs: z.ZodDefault<z.ZodNumber>;
115
+ navigationMs: z.ZodDefault<z.ZodNumber>;
116
+ testMs: z.ZodDefault<z.ZodNumber>;
117
+ /** Default budget for `waitForCondition` and other non-locator polling. */
118
+ waitMs: z.ZodDefault<z.ZodNumber>;
119
+ }, "strip", z.ZodTypeAny, {
120
+ actionMs: number;
121
+ navigationMs: number;
122
+ testMs: number;
123
+ waitMs: number;
124
+ }, {
125
+ actionMs?: number | undefined;
126
+ navigationMs?: number | undefined;
127
+ testMs?: number | undefined;
128
+ waitMs?: number | undefined;
129
+ }>>;
130
+ auth: z.ZodDefault<z.ZodObject<{
131
+ tokenUrl: z.ZodOptional<z.ZodString>;
132
+ clientId: z.ZodOptional<z.ZodString>;
133
+ clientSecret: z.ZodOptional<z.ZodString>;
134
+ username: z.ZodOptional<z.ZodString>;
135
+ password: z.ZodOptional<z.ZodString>;
136
+ /** Single-session storage state file (see `buildGlobalSetup`). */
137
+ storageStatePath: z.ZodOptional<z.ZodString>;
138
+ /** Directory used for per-role storage state files in multi-role setups. */
139
+ storageStateDir: z.ZodDefault<z.ZodString>;
140
+ }, "strip", z.ZodTypeAny, {
141
+ storageStateDir: string;
142
+ tokenUrl?: string | undefined;
143
+ clientId?: string | undefined;
144
+ clientSecret?: string | undefined;
145
+ username?: string | undefined;
146
+ password?: string | undefined;
147
+ storageStatePath?: string | undefined;
148
+ }, {
149
+ tokenUrl?: string | undefined;
150
+ clientId?: string | undefined;
151
+ clientSecret?: string | undefined;
152
+ username?: string | undefined;
153
+ password?: string | undefined;
154
+ storageStatePath?: string | undefined;
155
+ storageStateDir?: string | undefined;
156
+ }>>;
157
+ reporting: z.ZodDefault<z.ZodObject<{
158
+ allureEnabled: z.ZodDefault<z.ZodBoolean>;
159
+ resultsDir: z.ZodDefault<z.ZodString>;
160
+ /** `{id}` is replaced with a test-case id — see `meta()` in `@emesoft_company/playwright-core/reporting`. */
161
+ testCaseUrlTemplate: z.ZodOptional<z.ZodString>;
162
+ }, "strip", z.ZodTypeAny, {
163
+ allureEnabled: boolean;
164
+ resultsDir: string;
165
+ testCaseUrlTemplate?: string | undefined;
166
+ }, {
167
+ allureEnabled?: boolean | undefined;
168
+ resultsDir?: string | undefined;
169
+ testCaseUrlTemplate?: string | undefined;
170
+ }>>;
171
+ retry: z.ZodDefault<z.ZodObject<{
172
+ retries: z.ZodDefault<z.ZodNumber>;
173
+ minDelayMs: z.ZodDefault<z.ZodNumber>;
174
+ maxDelayMs: z.ZodDefault<z.ZodNumber>;
175
+ }, "strip", z.ZodTypeAny, {
176
+ retries: number;
177
+ minDelayMs: number;
178
+ maxDelayMs: number;
179
+ }, {
180
+ retries?: number | undefined;
181
+ minDelayMs?: number | undefined;
182
+ maxDelayMs?: number | undefined;
183
+ }>>;
184
+ diagnostics: z.ZodDefault<z.ZodObject<{
185
+ /** Collect browser console errors + failed requests and attach them to the report. */
186
+ enabled: z.ZodDefault<z.ZodBoolean>;
187
+ /** Fail the test if the page logged a console error. Off by default — many apps are noisy. */
188
+ failOnConsoleError: z.ZodDefault<z.ZodBoolean>;
189
+ /** Fail the test on an uncaught page exception. */
190
+ failOnPageError: z.ZodDefault<z.ZodBoolean>;
191
+ /** Console messages matching any of these substrings are ignored entirely. */
192
+ ignoreConsolePatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
193
+ }, "strip", z.ZodTypeAny, {
194
+ enabled: boolean;
195
+ failOnConsoleError: boolean;
196
+ failOnPageError: boolean;
197
+ ignoreConsolePatterns: string[];
198
+ }, {
199
+ enabled?: boolean | undefined;
200
+ failOnConsoleError?: boolean | undefined;
201
+ failOnPageError?: boolean | undefined;
202
+ ignoreConsolePatterns?: string[] | undefined;
203
+ }>>;
204
+ logLevel: z.ZodDefault<z.ZodEnum<["fatal", "error", "warn", "info", "debug", "trace", "silent"]>>;
205
+ custom: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
206
+ }, "strip", z.ZodTypeAny, {
207
+ environment: string;
208
+ baseUrl: string;
209
+ timeouts: {
210
+ actionMs: number;
211
+ navigationMs: number;
212
+ testMs: number;
213
+ waitMs: number;
214
+ };
215
+ auth: {
216
+ storageStateDir: string;
217
+ tokenUrl?: string | undefined;
218
+ clientId?: string | undefined;
219
+ clientSecret?: string | undefined;
220
+ username?: string | undefined;
221
+ password?: string | undefined;
222
+ storageStatePath?: string | undefined;
223
+ };
224
+ reporting: {
225
+ allureEnabled: boolean;
226
+ resultsDir: string;
227
+ testCaseUrlTemplate?: string | undefined;
228
+ };
229
+ retry: {
230
+ retries: number;
231
+ minDelayMs: number;
232
+ maxDelayMs: number;
233
+ };
234
+ diagnostics: {
235
+ enabled: boolean;
236
+ failOnConsoleError: boolean;
237
+ failOnPageError: boolean;
238
+ ignoreConsolePatterns: string[];
239
+ };
240
+ logLevel: "fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent";
241
+ custom: Record<string, unknown>;
242
+ apiBaseUrl?: string | undefined;
243
+ tenant?: string | undefined;
244
+ }, {
245
+ environment: string;
246
+ baseUrl: string;
247
+ apiBaseUrl?: string | undefined;
248
+ tenant?: string | undefined;
249
+ timeouts?: {
250
+ actionMs?: number | undefined;
251
+ navigationMs?: number | undefined;
252
+ testMs?: number | undefined;
253
+ waitMs?: number | undefined;
254
+ } | undefined;
255
+ auth?: {
256
+ tokenUrl?: string | undefined;
257
+ clientId?: string | undefined;
258
+ clientSecret?: string | undefined;
259
+ username?: string | undefined;
260
+ password?: string | undefined;
261
+ storageStatePath?: string | undefined;
262
+ storageStateDir?: string | undefined;
263
+ } | undefined;
264
+ reporting?: {
265
+ allureEnabled?: boolean | undefined;
266
+ resultsDir?: string | undefined;
267
+ testCaseUrlTemplate?: string | undefined;
268
+ } | undefined;
269
+ retry?: {
270
+ retries?: number | undefined;
271
+ minDelayMs?: number | undefined;
272
+ maxDelayMs?: number | undefined;
273
+ } | undefined;
274
+ diagnostics?: {
275
+ enabled?: boolean | undefined;
276
+ failOnConsoleError?: boolean | undefined;
277
+ failOnPageError?: boolean | undefined;
278
+ ignoreConsolePatterns?: string[] | undefined;
279
+ } | undefined;
280
+ logLevel?: "fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent" | undefined;
281
+ custom?: Record<string, unknown> | undefined;
282
+ }>;
283
+ type AppConfig = Omit<z.infer<typeof AppConfigSchema>, "environment"> & {
284
+ environment: Environment;
285
+ };
286
+ type TimeoutsConfig = z.infer<typeof TimeoutsSchema>;
287
+ type AuthConfig = z.infer<typeof AuthConfigSchema>;
288
+ type ReportingConfig = z.infer<typeof ReportingConfigSchema>;
289
+ type RetryConfig = z.infer<typeof RetryConfigSchema>;
290
+ type DiagnosticsConfig = z.infer<typeof DiagnosticsConfigSchema>;
291
+
292
+ export { type AppConfig as A, type DiagnosticsConfig as D, type Environment as E, KNOWN_ENVIRONMENTS as K, type ReportingConfig as R, type TimeoutsConfig as T, AppConfigSchema as a, type AuthConfig as b, AuthConfigSchema as c, DiagnosticsConfigSchema as d, EnvironmentSchema as e, ReportingConfigSchema as f, type RetryConfig as g, RetryConfigSchema as h, TimeoutsSchema as i };