@iqual/playwright-vrt 0.1.5 → 0.1.7
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/playwright.config.js +10 -5
- package/dist/tests/vrt.spec.js +1 -1
- package/package.json +1 -1
|
@@ -1,34 +1,39 @@
|
|
|
1
1
|
// This config is shipped with playwright-vrt package
|
|
2
2
|
// User's config is loaded via environment variables
|
|
3
3
|
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
|
|
4
6
|
const vrtConfig = process.env.VRT_CONFIG
|
|
5
7
|
? JSON.parse(process.env.VRT_CONFIG)
|
|
6
8
|
: { viewports: [{ name: 'desktop', width: 1920, height: 1080 }] };
|
|
7
9
|
|
|
10
|
+
// Use absolute paths based on user's working directory
|
|
11
|
+
const workingDir = process.cwd();
|
|
12
|
+
|
|
8
13
|
export default {
|
|
9
14
|
testDir: './tests',
|
|
10
15
|
testMatch: '**/*.spec.js', // JavaScript test files
|
|
11
16
|
fullyParallel: true,
|
|
12
17
|
retries: process.env.CI ? 2 : 1,
|
|
13
|
-
workers:
|
|
18
|
+
workers: 3,
|
|
14
19
|
timeout: 60000,
|
|
15
20
|
|
|
16
21
|
// Store snapshots in playwright-snapshots/ for easy caching
|
|
17
|
-
snapshotDir: '
|
|
22
|
+
snapshotDir: join(workingDir, 'playwright-snapshots'),
|
|
18
23
|
|
|
19
24
|
// Store temporary test artifacts in playwright-tmp/
|
|
20
|
-
outputDir: '
|
|
25
|
+
outputDir: join(workingDir, 'playwright-tmp'),
|
|
21
26
|
|
|
22
27
|
reporter: [
|
|
23
28
|
['html', {
|
|
24
|
-
outputFolder: process.env.OUTPUT_DIR || 'playwright-report',
|
|
29
|
+
outputFolder: process.env.OUTPUT_DIR || join(workingDir, 'playwright-report'),
|
|
25
30
|
open: 'never',
|
|
26
31
|
noSnippets: true,
|
|
27
32
|
}],
|
|
28
33
|
['json', {
|
|
29
34
|
outputFile: process.env.OUTPUT_DIR
|
|
30
35
|
? `${process.env.OUTPUT_DIR}/results.json`
|
|
31
|
-
: 'playwright-report
|
|
36
|
+
: join(workingDir, 'playwright-report', 'results.json')
|
|
32
37
|
}],
|
|
33
38
|
['list'],
|
|
34
39
|
],
|
package/dist/tests/vrt.spec.js
CHANGED
|
@@ -47,7 +47,7 @@ for (const url of urls) {
|
|
|
47
47
|
await page.evaluate(() => new Promise(resolve => requestAnimationFrame(resolve)));
|
|
48
48
|
|
|
49
49
|
// Additional stability wait for lazy-loaded content
|
|
50
|
-
await page.waitForTimeout(
|
|
50
|
+
await page.waitForTimeout(500);
|
|
51
51
|
|
|
52
52
|
// Take full page screenshot and compare
|
|
53
53
|
await expect(page).toHaveScreenshot({
|