@brillout/test-e2e 0.3.4 → 0.3.6
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/setup.js
CHANGED
|
@@ -24,7 +24,7 @@ Object.defineProperty(exports, "partRegex", { enumerable: true, get: function ()
|
|
|
24
24
|
var Logs_2 = require("./Logs");
|
|
25
25
|
Object.defineProperty(exports, "expectError", { enumerable: true, get: function () { return Logs_2.expectError; } });
|
|
26
26
|
const serverUrlDefault = 'http://localhost:3000';
|
|
27
|
-
const TIMEOUT_NPM_SCRIPT = 2 * 60 * 1000;
|
|
27
|
+
const TIMEOUT_NPM_SCRIPT = 2 * 60 * 1000 * (!(0, utils_1.isGithubAction)() ? 1 : (0, utils_1.isWindows)() ? 2 : 1);
|
|
28
28
|
const TIMEOUT_TEST_FUNCTION = 60 * 1000 * (!(0, utils_1.isGithubAction)() ? 1 : (0, utils_1.isWindows)() ? 5 : 3);
|
|
29
29
|
const TIMEOUT_PROCESS_TERMINATION = 10 * 1000 * (!(0, utils_1.isGithubAction)() ? 1 : (0, utils_1.isLinux)() ? 1 : 4);
|
|
30
30
|
const TIMEOUT_AUTORETRY = TIMEOUT_TEST_FUNCTION / 2;
|
|
@@ -12,8 +12,9 @@ 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
|
-
async function testScreenshotFixture() {
|
|
16
|
-
const
|
|
15
|
+
async function testScreenshotFixture({ screenshotFixturePath, } = {}) {
|
|
16
|
+
const pngPaths = getPngPaths();
|
|
17
|
+
const pngFixturPath = screenshotFixturePath || pngPaths.pngFixturPath;
|
|
17
18
|
if (!fs_1.default.existsSync(pngFixturPath)) {
|
|
18
19
|
const pngActual = await takeScreenshot();
|
|
19
20
|
const fileContent = pngjs_1.PNG.sync.write(pngActual);
|
|
@@ -31,6 +32,7 @@ async function testScreenshotFixture() {
|
|
|
31
32
|
(0, expect_1.expect)(numDiffPixels).toBe(0);
|
|
32
33
|
}
|
|
33
34
|
catch (err) {
|
|
35
|
+
const { pngExpectPath, pngActualPath, pngDifferPath } = pngPaths;
|
|
34
36
|
{
|
|
35
37
|
console.log('Actual image written at', pngActualPath);
|
|
36
38
|
fs_1.default.writeFileSync(pngActualPath, pngjs_1.PNG.sync.write(pngActual));
|