@brillout/test-e2e 0.5.20 → 0.5.22
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/Logs.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.Logs = {
|
|
|
13
13
|
logEagerly: false,
|
|
14
14
|
};
|
|
15
15
|
const utils_1 = require("./utils");
|
|
16
|
-
const picocolors_1 = __importDefault(require("picocolors"));
|
|
16
|
+
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
17
17
|
const getCurrentTest_1 = require("./getCurrentTest");
|
|
18
18
|
const logSection_1 = require("./logSection");
|
|
19
19
|
const isTolerateError_1 = require("./Logs/isTolerateError");
|
package/dist/logSection.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.logSection = void 0;
|
|
7
|
-
const picocolors_1 = __importDefault(require("picocolors"));
|
|
7
|
+
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
8
8
|
function logSection(sectionTitle) {
|
|
9
9
|
const title = `vvvvvv ${sectionTitle} vvvvvv`;
|
|
10
10
|
const width = title.length;
|
package/dist/logTestStatus.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.hasFail = exports.logBoot = exports.logFail = exports.logWarn = exports.logPass = void 0;
|
|
7
7
|
const getCurrentTest_1 = require("./getCurrentTest");
|
|
8
8
|
const utils_1 = require("./utils");
|
|
9
|
-
const picocolors_1 = __importDefault(require("picocolors"));
|
|
9
|
+
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
10
10
|
function logPass() {
|
|
11
11
|
logStatus(false);
|
|
12
12
|
}
|
package/dist/runAll.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.runAll = void 0;
|
|
4
7
|
const getCurrentTest_1 = require("./getCurrentTest");
|
|
@@ -12,6 +15,7 @@ const findTestFiles_1 = require("./findTestFiles");
|
|
|
12
15
|
const getConfig_1 = require("./getConfig");
|
|
13
16
|
const logError_1 = require("./logError");
|
|
14
17
|
const logTestStatus_1 = require("./logTestStatus");
|
|
18
|
+
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
15
19
|
async function runAll(filter) {
|
|
16
20
|
await (0, getConfig_1.loadConfig)();
|
|
17
21
|
const testFiles = await (0, findTestFiles_1.findTestFiles)(filter);
|
|
@@ -25,10 +29,10 @@ async function runAll(filter) {
|
|
|
25
29
|
// - When assert.ts calls logFail() this code block isn't run
|
|
26
30
|
(0, utils_1.assert)(hasFailedTestFile && hasFailLog);
|
|
27
31
|
(0, utils_1.assert)(failedTestFiles.length > 0);
|
|
28
|
-
throw new Error([
|
|
29
|
-
'Following test files failed, see logs above for more information (search for [TEST_FAILURE])
|
|
32
|
+
throw new Error(picocolors_1.default.red(picocolors_1.default.bold([
|
|
33
|
+
'Following test files failed, see logs above for more information (search for [TEST_FAILURE]):',
|
|
30
34
|
...failedTestFiles.map((testFile) => ` ${testFile}`),
|
|
31
|
-
].join('\n'));
|
|
35
|
+
].join('\n'))));
|
|
32
36
|
}
|
|
33
37
|
}
|
|
34
38
|
exports.runAll = runAll;
|
|
@@ -57,7 +61,7 @@ async function runTestFiles(testFiles, browser) {
|
|
|
57
61
|
else {
|
|
58
62
|
// Second & third attempt
|
|
59
63
|
for (let i = 0; i <= 1; i++) {
|
|
60
|
-
console.log((i === 0 ? 'SECOND' : 'THIRD') + '_ATTEMPT');
|
|
64
|
+
console.log('[' + (i === 0 ? 'SECOND' : 'THIRD') + '_ATTEMPT]');
|
|
61
65
|
for (const testFile of failedTestFiles) {
|
|
62
66
|
const { success } = await buildAndTest(testFile, browser, i === 1);
|
|
63
67
|
if (success) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { testScreenshotFixture };
|
|
2
|
-
declare function testScreenshotFixture({ screenshotFixturePath, }?: {
|
|
2
|
+
declare function testScreenshotFixture({ screenshotFixturePath, doNotTestLocally, }?: {
|
|
3
3
|
screenshotFixturePath?: string;
|
|
4
|
+
/** Only test screenshot in CI environment (e.g. GitHub Actions) */
|
|
5
|
+
doNotTestLocally?: true;
|
|
4
6
|
}): Promise<void>;
|
|
@@ -12,9 +12,14 @@ const path_1 = __importDefault(require("path"));
|
|
|
12
12
|
const utils_1 = require("./utils");
|
|
13
13
|
const getCurrentTest_1 = require("./getCurrentTest");
|
|
14
14
|
const expect_1 = require("./chai/expect");
|
|
15
|
-
|
|
15
|
+
const picocolors_1 = __importDefault(require("@brillout/picocolors"));
|
|
16
|
+
async function testScreenshotFixture({ screenshotFixturePath, doNotTestLocally, } = {}) {
|
|
16
17
|
const pngPaths = getPngPaths();
|
|
17
18
|
const pngFixturPath = screenshotFixturePath || pngPaths.pngFixturPath;
|
|
19
|
+
if (doNotTestLocally && (0, utils_1.isCI)()) {
|
|
20
|
+
console.log(`${picocolors_1.default.blue(picocolors_1.default.bold('INFO'))} screenshot test ${pngFixturPath} skipped because running test locally (i.e. not in a CI environment)`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
18
23
|
if (!fs_1.default.existsSync(pngFixturPath)) {
|
|
19
24
|
const pngActual = await takeScreenshot();
|
|
20
25
|
const fileContent = pngjs_1.PNG.sync.write(pngActual);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brillout/test-e2e",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.22",
|
|
4
4
|
"bin": "./bin.js",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
"release": "npm version patch && npm publish && git push && git push --tags"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@brillout/part-regex": "^0.1.
|
|
16
|
+
"@brillout/part-regex": "^0.1.3",
|
|
17
17
|
"chai": "^4.3.6",
|
|
18
18
|
"esbuild": "^0.16.5",
|
|
19
19
|
"fast-glob": "^3.2.12",
|
|
20
20
|
"node-fetch": "^2.6.1",
|
|
21
|
-
"picocolors": "^1.0.
|
|
21
|
+
"@brillout/picocolors": "^1.0.9",
|
|
22
22
|
"pixelmatch": "^5.3.0",
|
|
23
23
|
"playwright-chromium": "^1.22.2",
|
|
24
24
|
"pngjs": "^6.0.0",
|