@argos-ci/cypress 1.2.0 → 1.2.2

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 (2) hide show
  1. package/dist/support.mjs +30 -35
  2. package/package.json +3 -3
package/dist/support.mjs CHANGED
@@ -1,24 +1,21 @@
1
1
  import 'cypress-wait-until';
2
2
  import { resolveViewport } from '@argos-ci/browser';
3
+ import { getGlobalFilePath } from '@argos-ci/browser/cypress.cjs';
3
4
  import { getScreenshotName, getMetadataPath } from '@argos-ci/util/browser';
4
5
 
6
+ var version = "1.2.1";
7
+
5
8
  function injectArgos() {
6
9
  cy.window({
7
10
  log: false
8
11
  }).then((window)=>{
9
12
  if (typeof window.__ARGOS__ !== "undefined") return;
10
- const fileName = typeof require.resolve === "function" ? require.resolve("@argos-ci/browser/global.js") : "node_modules/@argos-ci/browser/dist/global.js";
13
+ const fileName = getGlobalFilePath();
11
14
  return cy.readFile(fileName).then((source)=>{
12
15
  window.eval(source);
13
16
  });
14
17
  });
15
18
  }
16
- function readArgosCypressVersion() {
17
- const fileName = typeof require.resolve === "function" ? require.resolve("@argos-ci/cypress/package.json") : "node_modules/@argos-ci/cypress/package.json";
18
- return cy.readFile(fileName).then((source)=>{
19
- return source.version;
20
- });
21
- }
22
19
  Cypress.Commands.add("argosScreenshot", {
23
20
  prevSubject: [
24
21
  "optional",
@@ -62,34 +59,32 @@ Cypress.Commands.add("argosScreenshot", {
62
59
  }).then((window)=>{
63
60
  const mediaType = window.__ARGOS__.getMediaType();
64
61
  const colorScheme = window.__ARGOS__.getColorScheme();
65
- readArgosCypressVersion().then((argosCypressVersion)=>{
66
- const metadata = {
67
- url: window.location.href,
68
- viewport: {
69
- width: window.innerWidth,
70
- height: window.innerHeight
71
- },
72
- colorScheme,
73
- mediaType,
74
- test: {
75
- title: Cypress.currentTest.title,
76
- titlePath: Cypress.currentTest.titlePath
77
- },
78
- browser: {
79
- name: Cypress.browser.name,
80
- version: Cypress.browser.version
81
- },
82
- automationLibrary: {
83
- name: "cypress",
84
- version: Cypress.version
85
- },
86
- sdk: {
87
- name: "@argos-ci/cypress",
88
- version: argosCypressVersion
89
- }
90
- };
91
- cy.writeFile(getMetadataPath(ref.props.path), JSON.stringify(metadata));
92
- });
62
+ const metadata = {
63
+ url: window.location.href,
64
+ viewport: {
65
+ width: window.innerWidth,
66
+ height: window.innerHeight
67
+ },
68
+ colorScheme,
69
+ mediaType,
70
+ test: {
71
+ title: Cypress.currentTest.title,
72
+ titlePath: Cypress.currentTest.titlePath
73
+ },
74
+ browser: {
75
+ name: Cypress.browser.name,
76
+ version: Cypress.browser.version
77
+ },
78
+ automationLibrary: {
79
+ name: "cypress",
80
+ version: Cypress.version
81
+ },
82
+ sdk: {
83
+ name: "@argos-ci/cypress",
84
+ version
85
+ }
86
+ };
87
+ cy.writeFile(getMetadataPath(ref.props.path), JSON.stringify(metadata));
93
88
  });
94
89
  }
95
90
  if (viewports) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/cypress",
3
3
  "description": "Visual testing solution to avoid visual regression. Cypress commands and utilities for Argos visual testing.",
4
- "version": "1.2.0",
4
+ "version": "1.2.2",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -36,7 +36,7 @@
36
36
  "node": ">=16.0.0"
37
37
  },
38
38
  "dependencies": {
39
- "@argos-ci/browser": "1.2.0",
39
+ "@argos-ci/browser": "1.2.2",
40
40
  "@argos-ci/util": "1.1.0",
41
41
  "cypress-wait-until": "^1.7.2"
42
42
  },
@@ -58,5 +58,5 @@
58
58
  "argos-upload": "pnpm exec argos upload cypress/screenshots --build-name \"argos-cypress-e2e-node-$NODE_VERSION-$OS\"",
59
59
  "e2e": "pnpm run test && pnpm run argos-upload"
60
60
  },
61
- "gitHead": "ad3ddc6e774f2b6e381259b4bfae72855326246b"
61
+ "gitHead": "672a6e0fce11cd9e0acd8b77dad137d85d224ef9"
62
62
  }