@argos-ci/playwright 1.7.0 → 1.8.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/dist/index.mjs +9 -12
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { mkdir
|
|
1
|
+
import { mkdir } from 'node:fs/promises';
|
|
2
2
|
import { relative, resolve, dirname } from 'node:path';
|
|
3
|
-
import {
|
|
4
|
-
import { resolveViewport } from '@argos-ci/browser';
|
|
3
|
+
import { resolveViewport, getGlobalScript } from '@argos-ci/browser';
|
|
5
4
|
import { getGitRepositoryPath, readVersionFromPackage, getScreenshotName, writeMetadata, getMetadataPath } from '@argos-ci/util';
|
|
5
|
+
import { createRequire } from 'node:module';
|
|
6
6
|
|
|
7
7
|
function getAttachmentName(name, type) {
|
|
8
8
|
return `argos/${type}___${name}`;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const require$
|
|
11
|
+
const require$1 = createRequire(import.meta.url);
|
|
12
12
|
const tryResolve = (pkg)=>{
|
|
13
13
|
try {
|
|
14
|
-
return require$
|
|
14
|
+
return require$1.resolve(pkg);
|
|
15
15
|
} catch {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
@@ -35,7 +35,7 @@ async function getAutomationLibrary() {
|
|
|
35
35
|
throw new Error(`Unable to find any of the following packages: ${libraries.join(", ")}`);
|
|
36
36
|
}
|
|
37
37
|
async function getArgosPlaywrightVersion() {
|
|
38
|
-
const pkgPath = require$
|
|
38
|
+
const pkgPath = require$1.resolve("@argos-ci/playwright/package.json");
|
|
39
39
|
return readVersionFromPackage(pkgPath);
|
|
40
40
|
}
|
|
41
41
|
async function getLibraryMetadata() {
|
|
@@ -69,23 +69,20 @@ async function getTestMetadataFromTestInfo(testInfo) {
|
|
|
69
69
|
return testMetadata;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
const require
|
|
72
|
+
const require = createRequire(import.meta.url);
|
|
73
73
|
function checkIsUsingArgosReporter(testInfo) {
|
|
74
|
-
const reporterPath = require
|
|
74
|
+
const reporterPath = require.resolve("@argos-ci/playwright/reporter");
|
|
75
75
|
return testInfo.config.reporter.some((reporter)=>reporter[0].includes("@argos-ci/playwright/reporter") || reporter[0] === reporterPath);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
const require = createRequire(import.meta.url);
|
|
79
78
|
const screenshotFolder = "./screenshots";
|
|
80
79
|
/**
|
|
81
80
|
* Inject Argos script into the page.
|
|
82
81
|
*/ async function injectArgos(page) {
|
|
83
82
|
const injected = await page.evaluate(()=>typeof window.__ARGOS__ !== "undefined");
|
|
84
83
|
if (injected) return;
|
|
85
|
-
const fileName = require.resolve("@argos-ci/browser/global.js");
|
|
86
|
-
const content = await readFile(fileName, "utf-8");
|
|
87
84
|
await page.addScriptTag({
|
|
88
|
-
content
|
|
85
|
+
content: getGlobalScript()
|
|
89
86
|
});
|
|
90
87
|
}
|
|
91
88
|
async function getTestInfo() {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/playwright",
|
|
3
3
|
"description": "Visual testing solution to avoid visual regression. Playwright commands and utilities for Argos visual testing.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.8.0",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"node": ">=16.0.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@argos-ci/browser": "1.
|
|
46
|
-
"@argos-ci/core": "1.5.
|
|
45
|
+
"@argos-ci/browser": "1.4.0",
|
|
46
|
+
"@argos-ci/core": "1.5.1",
|
|
47
47
|
"@argos-ci/util": "1.2.0",
|
|
48
48
|
"chalk": "^5.3.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@argos-ci/cli": "1.0.
|
|
51
|
+
"@argos-ci/cli": "1.0.8",
|
|
52
52
|
"@argos-ci/playwright": "workspace:.",
|
|
53
53
|
"@playwright/test": "^1.38.1",
|
|
54
54
|
"@types/node": "^16.0.0"
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"test": "pnpm exec playwright test",
|
|
60
60
|
"e2e": "UPLOAD_TO_ARGOS=true pnpm run test"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "dbd169d2307a498a7c44001197924947c28be803"
|
|
63
63
|
}
|