@argos-ci/playwright 1.0.0-alpha.2 → 1.0.0-alpha.3

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 CHANGED
@@ -9,24 +9,42 @@ function getAttachmentName(name, type) {
9
9
  }
10
10
 
11
11
  const require$2 = createRequire(import.meta.url);
12
- async function getPlaywrightVersion() {
13
- const pkgPath = require$2.resolve("playwright/package.json");
14
- return readVersionFromPackage(pkgPath);
12
+ const tryResolve = (pkg)=>{
13
+ try {
14
+ return require$2.resolve(pkg);
15
+ } catch {
16
+ return null;
17
+ }
18
+ };
19
+ async function getAutomationLibrary() {
20
+ const libraries = [
21
+ "@playwright/test",
22
+ "playwright",
23
+ "playwright-core"
24
+ ];
25
+ for (const name of libraries){
26
+ const pkgPath = tryResolve(`${name}/package.json`);
27
+ if (pkgPath) {
28
+ const version = await readVersionFromPackage(pkgPath);
29
+ return {
30
+ version,
31
+ name
32
+ };
33
+ }
34
+ }
35
+ throw new Error(`Unable to find any of the following packages: ${libraries.join(", ")}`);
15
36
  }
16
37
  async function getArgosPlaywrightVersion() {
17
38
  const pkgPath = require$2.resolve("@argos-ci/playwright/package.json");
18
39
  return readVersionFromPackage(pkgPath);
19
40
  }
20
41
  async function getLibraryMetadata() {
21
- const [playwrightVersion, argosPlaywrightVersion] = await Promise.all([
22
- getPlaywrightVersion(),
42
+ const [automationLibrary, argosPlaywrightVersion] = await Promise.all([
43
+ getAutomationLibrary(),
23
44
  getArgosPlaywrightVersion()
24
45
  ]);
25
46
  const metadata = {
26
- automationLibrary: {
27
- name: "playwright",
28
- version: playwrightVersion
29
- },
47
+ automationLibrary,
30
48
  sdk: {
31
49
  name: "@argos-ci/playwright",
32
50
  version: argosPlaywrightVersion
package/dist/reporter.mjs CHANGED
@@ -20,24 +20,42 @@ function getAttachementFilename(name) {
20
20
  }
21
21
 
22
22
  const require = createRequire(import.meta.url);
23
- async function getPlaywrightVersion() {
24
- const pkgPath = require.resolve("playwright/package.json");
25
- return readVersionFromPackage(pkgPath);
23
+ const tryResolve = (pkg)=>{
24
+ try {
25
+ return require.resolve(pkg);
26
+ } catch {
27
+ return null;
28
+ }
29
+ };
30
+ async function getAutomationLibrary() {
31
+ const libraries = [
32
+ "@playwright/test",
33
+ "playwright",
34
+ "playwright-core"
35
+ ];
36
+ for (const name of libraries){
37
+ const pkgPath = tryResolve(`${name}/package.json`);
38
+ if (pkgPath) {
39
+ const version = await readVersionFromPackage(pkgPath);
40
+ return {
41
+ version,
42
+ name
43
+ };
44
+ }
45
+ }
46
+ throw new Error(`Unable to find any of the following packages: ${libraries.join(", ")}`);
26
47
  }
27
48
  async function getArgosPlaywrightVersion() {
28
49
  const pkgPath = require.resolve("@argos-ci/playwright/package.json");
29
50
  return readVersionFromPackage(pkgPath);
30
51
  }
31
52
  async function getLibraryMetadata() {
32
- const [playwrightVersion, argosPlaywrightVersion] = await Promise.all([
33
- getPlaywrightVersion(),
53
+ const [automationLibrary, argosPlaywrightVersion] = await Promise.all([
54
+ getAutomationLibrary(),
34
55
  getArgosPlaywrightVersion()
35
56
  ]);
36
57
  const metadata = {
37
- automationLibrary: {
38
- name: "playwright",
39
- version: playwrightVersion
40
- },
58
+ automationLibrary,
41
59
  sdk: {
42
60
  name: "@argos-ci/playwright",
43
61
  version: argosPlaywrightVersion
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.0.0-alpha.2",
4
+ "version": "1.0.0-alpha.3",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -42,12 +42,12 @@
42
42
  "node": ">=16.0.0"
43
43
  },
44
44
  "dependencies": {
45
- "@argos-ci/browser": "1.0.0-alpha.2",
46
- "@argos-ci/core": "1.0.0-alpha.1",
47
- "@argos-ci/util": "1.0.0-alpha.1"
45
+ "@argos-ci/browser": "1.0.0-alpha.3",
46
+ "@argos-ci/core": "1.0.0-alpha.2",
47
+ "@argos-ci/util": "1.0.0-alpha.2"
48
48
  },
49
49
  "devDependencies": {
50
- "@argos-ci/cli": "1.0.0-alpha.1",
50
+ "@argos-ci/cli": "1.0.0-alpha.2",
51
51
  "@argos-ci/playwright": "workspace:.",
52
52
  "@playwright/test": "^1.38.1",
53
53
  "@types/node": "^16.0.0"
@@ -58,5 +58,5 @@
58
58
  "test": "pnpm exec playwright test",
59
59
  "e2e": "WITH_ARGOS_REPORTER=true pnpm run test"
60
60
  },
61
- "gitHead": "c0098d1f94517634ee74c141758756cc4a81931d"
61
+ "gitHead": "df6e36fccc387245c17bc7f44b8ca81bbe788bd7"
62
62
  }