@bughunters/vision 1.0.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/README.md +167 -0
- package/dist/check.d.ts +16 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/check.js +255 -0
- package/dist/fixture.d.ts +21 -0
- package/dist/fixture.d.ts.map +1 -0
- package/dist/fixture.js +25 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/pixel-match.d.ts +6 -0
- package/dist/pixel-match.d.ts.map +1 -0
- package/dist/pixel-match.js +20 -0
- package/dist/reporter.d.ts +15 -0
- package/dist/reporter.d.ts.map +1 -0
- package/dist/reporter.js +1039 -0
- package/dist/results.d.ts +3 -0
- package/dist/results.d.ts.map +1 -0
- package/dist/results.js +46 -0
- package/dist/types.d.ts +20 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/package.json +60 -0
- package/reporter.d.ts +2 -0
- package/reporter.js +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../src/results.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,IAAI,CAO1F"}
|
package/dist/results.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.appendResult = appendResult;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
function appendResult(snapshotsDir, result) {
|
|
40
|
+
const resultsPath = path.join(snapshotsDir, 'results.json');
|
|
41
|
+
const existing = fs.existsSync(resultsPath)
|
|
42
|
+
? JSON.parse(fs.readFileSync(resultsPath, 'utf-8'))
|
|
43
|
+
: [];
|
|
44
|
+
existing.push({ index: existing.length + 1, ...result });
|
|
45
|
+
fs.writeFileSync(resultsPath, JSON.stringify(existing, null, 2));
|
|
46
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type VisionMode = 'ai' | 'strict' | 'off';
|
|
2
|
+
export interface TestResult {
|
|
3
|
+
index: number;
|
|
4
|
+
testName: string;
|
|
5
|
+
status: 'PASS' | 'FAIL' | 'BASELINE_CREATED' | 'ERROR';
|
|
6
|
+
reason: string;
|
|
7
|
+
method: 'AI' | 'FAST_PIXEL_MATCH' | null;
|
|
8
|
+
baselineFile: string;
|
|
9
|
+
currentFile: string | null;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Meta {
|
|
13
|
+
generatedAt: string;
|
|
14
|
+
total: number;
|
|
15
|
+
passed: number;
|
|
16
|
+
failed: number;
|
|
17
|
+
baselines: number;
|
|
18
|
+
errored: number;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEjD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,kBAAkB,GAAG,OAAO,CAAC;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,IAAI,GAAG,kBAAkB,GAAG,IAAI,CAAC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,IAAI;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
package/dist/types.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bughunters/vision",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "InfoSec-friendly AI Visual Testing plugin for Playwright.",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"require": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"./reporter": {
|
|
13
|
+
"require": "./dist/reporter.js",
|
|
14
|
+
"types": "./dist/reporter.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"reporter.js",
|
|
20
|
+
"reporter.d.ts",
|
|
21
|
+
"README.md"
|
|
22
|
+
],
|
|
23
|
+
"homepage": "https://bughunters.vision",
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/bughunters/vision.git"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18.0.0"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsc",
|
|
33
|
+
"prepublishOnly": "npm run build"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"playwright",
|
|
37
|
+
"testing",
|
|
38
|
+
"visual-regression",
|
|
39
|
+
"ai",
|
|
40
|
+
"claude",
|
|
41
|
+
"qa",
|
|
42
|
+
"pixelmatch"
|
|
43
|
+
],
|
|
44
|
+
"author": "BugHunters <jakub@bughunters.dev>",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"pixelmatch": "^5.3.0",
|
|
48
|
+
"pngjs": "^6.0.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@playwright/test": "^1.50.1",
|
|
52
|
+
"@types/node": "^22.0.0",
|
|
53
|
+
"@types/pixelmatch": "^5.2.6",
|
|
54
|
+
"@types/pngjs": "^6.0.4",
|
|
55
|
+
"typescript": "^5.7.3"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"@playwright/test": ">=1.40.0"
|
|
59
|
+
}
|
|
60
|
+
}
|
package/reporter.d.ts
ADDED
package/reporter.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/reporter.js');
|