@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.
- package/dist/support.mjs +30 -35
- 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 =
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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.
|
|
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.
|
|
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": "
|
|
61
|
+
"gitHead": "672a6e0fce11cd9e0acd8b77dad137d85d224ef9"
|
|
62
62
|
}
|