@argos-ci/cypress 2.1.5 → 2.1.6-alpha.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/support.mjs +1 -1
- package/dist/task.cjs +22 -4
- package/dist/task.mjs +22 -4
- package/package.json +6 -6
package/dist/support.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import 'cypress-wait-until';
|
|
|
2
2
|
import { resolveViewport, getGlobalScript } from '@argos-ci/browser';
|
|
3
3
|
import { getScreenshotName, validateThreshold, getMetadataPath } from '@argos-ci/util/browser';
|
|
4
4
|
|
|
5
|
-
var version = "2.1.
|
|
5
|
+
var version = "2.1.5";
|
|
6
6
|
|
|
7
7
|
function injectArgos() {
|
|
8
8
|
cy.window({
|
package/dist/task.cjs
CHANGED
|
@@ -5,6 +5,9 @@ var node_path = require('node:path');
|
|
|
5
5
|
var promises = require('node:fs/promises');
|
|
6
6
|
|
|
7
7
|
/// <reference types="cypress" />
|
|
8
|
+
function checkIsCypressFailedResult(results) {
|
|
9
|
+
return "status" in results && results.status === "failed";
|
|
10
|
+
}
|
|
8
11
|
function registerArgosTask(on, config, options) {
|
|
9
12
|
on("after:screenshot", async (details)=>{
|
|
10
13
|
// Get the base filename without extension
|
|
@@ -19,17 +22,32 @@ function registerArgosTask(on, config, options) {
|
|
|
19
22
|
path: newPath
|
|
20
23
|
};
|
|
21
24
|
});
|
|
22
|
-
on("after:run", async ()=>{
|
|
25
|
+
on("after:run", async (results)=>{
|
|
23
26
|
const { screenshotsFolder } = config;
|
|
24
|
-
if (!screenshotsFolder)
|
|
27
|
+
if (!screenshotsFolder) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
25
30
|
const { uploadToArgos = true } = options || {};
|
|
26
|
-
if (!uploadToArgos)
|
|
31
|
+
if (!uploadToArgos) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
27
34
|
const res = await core.upload({
|
|
35
|
+
...options,
|
|
28
36
|
files: [
|
|
29
37
|
"**/*.png"
|
|
30
38
|
],
|
|
31
39
|
root: screenshotsFolder,
|
|
32
|
-
|
|
40
|
+
metadata: {
|
|
41
|
+
testReport: checkIsCypressFailedResult(results) ? {
|
|
42
|
+
status: "failed"
|
|
43
|
+
} : {
|
|
44
|
+
status: "passed",
|
|
45
|
+
stats: {
|
|
46
|
+
startTime: results.startedTestsAt,
|
|
47
|
+
duration: results.totalDuration
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
33
51
|
});
|
|
34
52
|
console.log(`✅ Argos build created: ${res.build.url}`);
|
|
35
53
|
});
|
package/dist/task.mjs
CHANGED
|
@@ -3,6 +3,9 @@ import { basename, extname, join, dirname } from 'node:path';
|
|
|
3
3
|
import { rename } from 'node:fs/promises';
|
|
4
4
|
|
|
5
5
|
/// <reference types="cypress" />
|
|
6
|
+
function checkIsCypressFailedResult(results) {
|
|
7
|
+
return "status" in results && results.status === "failed";
|
|
8
|
+
}
|
|
6
9
|
function registerArgosTask(on, config, options) {
|
|
7
10
|
on("after:screenshot", async (details)=>{
|
|
8
11
|
// Get the base filename without extension
|
|
@@ -17,17 +20,32 @@ function registerArgosTask(on, config, options) {
|
|
|
17
20
|
path: newPath
|
|
18
21
|
};
|
|
19
22
|
});
|
|
20
|
-
on("after:run", async ()=>{
|
|
23
|
+
on("after:run", async (results)=>{
|
|
21
24
|
const { screenshotsFolder } = config;
|
|
22
|
-
if (!screenshotsFolder)
|
|
25
|
+
if (!screenshotsFolder) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
23
28
|
const { uploadToArgos = true } = options || {};
|
|
24
|
-
if (!uploadToArgos)
|
|
29
|
+
if (!uploadToArgos) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
25
32
|
const res = await upload({
|
|
33
|
+
...options,
|
|
26
34
|
files: [
|
|
27
35
|
"**/*.png"
|
|
28
36
|
],
|
|
29
37
|
root: screenshotsFolder,
|
|
30
|
-
|
|
38
|
+
metadata: {
|
|
39
|
+
testReport: checkIsCypressFailedResult(results) ? {
|
|
40
|
+
status: "failed"
|
|
41
|
+
} : {
|
|
42
|
+
status: "passed",
|
|
43
|
+
stats: {
|
|
44
|
+
startTime: results.startedTestsAt,
|
|
45
|
+
duration: results.totalDuration
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
31
49
|
});
|
|
32
50
|
console.log(`✅ Argos build created: ${res.build.url}`);
|
|
33
51
|
});
|
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": "2.1.
|
|
4
|
+
"version": "2.1.6-alpha.0+4ed9b25",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
"node": ">=18.0.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@argos-ci/browser": "2.1.
|
|
46
|
-
"@argos-ci/core": "2.7.0",
|
|
47
|
-
"@argos-ci/util": "2.1.
|
|
45
|
+
"@argos-ci/browser": "2.1.4-alpha.14+4ed9b25",
|
|
46
|
+
"@argos-ci/core": "2.7.1-alpha.0+4ed9b25",
|
|
47
|
+
"@argos-ci/util": "2.1.2-alpha.14+4ed9b25",
|
|
48
48
|
"cypress-wait-until": "^3.0.2"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"cypress": "^12.0.0 || ^13.0.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@argos-ci/cli": "2.4.
|
|
54
|
+
"@argos-ci/cli": "2.4.2-alpha.0+4ed9b25",
|
|
55
55
|
"@argos-ci/cypress": "workspace:.",
|
|
56
56
|
"@types/node": "^18.19.44",
|
|
57
57
|
"cypress": "^13.13.3",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"test": "pnpm exec cypress run",
|
|
65
65
|
"e2e": "UPLOAD_TO_ARGOS=true pnpm run test"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "4ed9b253b5037f2111d44bcd41fe3467371c41e3"
|
|
68
68
|
}
|