@testivai/witness-playwright 0.1.13 → 0.1.14
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.
Potentially problematic release.
This version of @testivai/witness-playwright might be problematic. Click here for more details.
- package/dist/cli/init.js +0 -0
- package/dist/config/loader.js +9 -1
- package/dist/snapshot.js +2 -0
- package/package.json +1 -1
- package/src/config/loader.ts +9 -1
- package/src/snapshot.ts +2 -0
package/dist/cli/init.js
CHANGED
|
File without changes
|
package/dist/config/loader.js
CHANGED
|
@@ -107,7 +107,9 @@ function mergeTestConfig(projectConfig, testConfig) {
|
|
|
107
107
|
if (!testConfig) {
|
|
108
108
|
return {
|
|
109
109
|
layout: projectConfig.layout,
|
|
110
|
-
ai: projectConfig.ai
|
|
110
|
+
ai: projectConfig.ai,
|
|
111
|
+
dom: projectConfig.dom,
|
|
112
|
+
performance: projectConfig.performance
|
|
111
113
|
};
|
|
112
114
|
}
|
|
113
115
|
return {
|
|
@@ -119,6 +121,10 @@ function mergeTestConfig(projectConfig, testConfig) {
|
|
|
119
121
|
...projectConfig.ai,
|
|
120
122
|
...testConfig.ai
|
|
121
123
|
},
|
|
124
|
+
dom: {
|
|
125
|
+
...projectConfig.dom,
|
|
126
|
+
...testConfig.dom
|
|
127
|
+
},
|
|
122
128
|
performance: {
|
|
123
129
|
...projectConfig.performance,
|
|
124
130
|
...testConfig.performance
|
|
@@ -209,6 +215,8 @@ function validateAndMergeConfig(config) {
|
|
|
209
215
|
confidence: validateRange(config.ai?.confidence ?? DEFAULT_CONFIG.ai.confidence, 0, 1, 'ai.confidence', DEFAULT_CONFIG.ai.confidence),
|
|
210
216
|
enableReasoning: config.ai?.enableReasoning
|
|
211
217
|
},
|
|
218
|
+
dom: config.dom, // Pass through DOM configuration as-is
|
|
219
|
+
performance: config.performance, // Pass through performance configuration as-is
|
|
212
220
|
environments: config.environments
|
|
213
221
|
};
|
|
214
222
|
return applyEnvironmentOverrides(validatedConfig);
|
package/dist/snapshot.js
CHANGED
|
@@ -415,7 +415,9 @@ async function snapshot(page, testInfo, name, config) {
|
|
|
415
415
|
let domAnalysis;
|
|
416
416
|
if (effectiveConfig.dom) {
|
|
417
417
|
try {
|
|
418
|
+
console.log('[TestivAI] Performing DOM analysis with config:', effectiveConfig.dom);
|
|
418
419
|
domAnalysis = await (0, domAnalyzer_1.analyzeDOM)(page, effectiveConfig.dom);
|
|
420
|
+
console.log('[TestivAI] DOM Analysis result:', domAnalysis);
|
|
419
421
|
if (process.env.TESTIVAI_DEBUG === 'true') {
|
|
420
422
|
console.log('[TestivAI] DOM Analysis:', domAnalysis);
|
|
421
423
|
}
|
package/package.json
CHANGED
package/src/config/loader.ts
CHANGED
|
@@ -77,7 +77,9 @@ export function mergeTestConfig(
|
|
|
77
77
|
if (!testConfig) {
|
|
78
78
|
return {
|
|
79
79
|
layout: projectConfig.layout,
|
|
80
|
-
ai: projectConfig.ai
|
|
80
|
+
ai: projectConfig.ai,
|
|
81
|
+
dom: projectConfig.dom,
|
|
82
|
+
performance: projectConfig.performance
|
|
81
83
|
};
|
|
82
84
|
}
|
|
83
85
|
|
|
@@ -90,6 +92,10 @@ export function mergeTestConfig(
|
|
|
90
92
|
...projectConfig.ai,
|
|
91
93
|
...testConfig.ai
|
|
92
94
|
},
|
|
95
|
+
dom: {
|
|
96
|
+
...projectConfig.dom,
|
|
97
|
+
...testConfig.dom
|
|
98
|
+
},
|
|
93
99
|
performance: {
|
|
94
100
|
...projectConfig.performance,
|
|
95
101
|
...testConfig.performance
|
|
@@ -191,6 +197,8 @@ function validateAndMergeConfig(config: any): TestivAIProjectConfig {
|
|
|
191
197
|
confidence: validateRange(config.ai?.confidence ?? DEFAULT_CONFIG.ai.confidence, 0, 1, 'ai.confidence', DEFAULT_CONFIG.ai.confidence),
|
|
192
198
|
enableReasoning: config.ai?.enableReasoning
|
|
193
199
|
},
|
|
200
|
+
dom: config.dom, // Pass through DOM configuration as-is
|
|
201
|
+
performance: config.performance, // Pass through performance configuration as-is
|
|
194
202
|
environments: config.environments
|
|
195
203
|
};
|
|
196
204
|
|
package/src/snapshot.ts
CHANGED
|
@@ -432,7 +432,9 @@ export async function snapshot(
|
|
|
432
432
|
let domAnalysis;
|
|
433
433
|
if (effectiveConfig.dom) {
|
|
434
434
|
try {
|
|
435
|
+
console.log('[TestivAI] Performing DOM analysis with config:', effectiveConfig.dom);
|
|
435
436
|
domAnalysis = await analyzeDOM(page, effectiveConfig.dom);
|
|
437
|
+
console.log('[TestivAI] DOM Analysis result:', domAnalysis);
|
|
436
438
|
if (process.env.TESTIVAI_DEBUG === 'true') {
|
|
437
439
|
console.log('[TestivAI] DOM Analysis:', domAnalysis);
|
|
438
440
|
}
|