kryptheon 0.1.70 → 0.1.71

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.
@@ -1,29 +1,29 @@
1
- // Says one line per probe run as it ends, in a form kryptheon-probe.js reads
2
- // back and turns into words: "KXPROBE <done> <total> <id> <status>". Nothing
3
- // else - a probe that fails is usually the app refusing a bad value, and a
4
- // failure report for it would say the opposite of what happened.
5
-
6
- class ProbeReporter {
7
- onBegin(config, suite) {
8
- this.total = suite.allTests().length;
9
- this.done = 0;
10
- }
11
-
12
- onTestEnd(test, result) {
13
- this.done += 1;
14
- const id = String(test.location.file).replace(/^.*[\\/]/, '').replace(/\.kxprobe\.js$/, '');
15
- console.log('KXPROBE ' + this.done + ' ' + this.total + ' ' + id + ' ' + result.status);
16
- }
17
-
18
- onError(error) {
19
- // The run itself could not start - a broken copy, a missing browser.
20
- const text = String((error && error.message) || error).split(/\r?\n/)[0];
21
- console.log('KXPROBE-ERROR ' + text.slice(0, 300));
22
- }
23
-
24
- printsToStdio() {
25
- return true;
26
- }
27
- }
28
-
29
- module.exports = ProbeReporter;
1
+ // Says one line per probe run as it ends, in a form kryptheon-probe.js reads
2
+ // back and turns into words: "KXPROBE <done> <total> <id> <status>". Nothing
3
+ // else - a probe that fails is usually the app refusing a bad value, and a
4
+ // failure report for it would say the opposite of what happened.
5
+
6
+ class ProbeReporter {
7
+ onBegin(config, suite) {
8
+ this.total = suite.allTests().length;
9
+ this.done = 0;
10
+ }
11
+
12
+ onTestEnd(test, result) {
13
+ this.done += 1;
14
+ const id = String(test.location.file).replace(/^.*[\\/]/, '').replace(/\.kxprobe\.js$/, '');
15
+ console.log('KXPROBE ' + this.done + ' ' + this.total + ' ' + id + ' ' + result.status);
16
+ }
17
+
18
+ onError(error) {
19
+ // The run itself could not start - a broken copy, a missing browser.
20
+ const text = String((error && error.message) || error).split(/\r?\n/)[0];
21
+ console.log('KXPROBE-ERROR ' + text.slice(0, 300));
22
+ }
23
+
24
+ printsToStdio() {
25
+ return true;
26
+ }
27
+ }
28
+
29
+ module.exports = ProbeReporter;
@@ -1,37 +1,37 @@
1
- // @ts-check
2
- // The Playwright config for probe copies (kryptheon-probe.js). Kept apart from
3
- // playwright.config.js on purpose: probes live in the store, not in tests/;
4
- // they report through their own reporter; and their screenshots and traces
5
- // go to a folder of their own - Playwright empties its output folder on every
6
- // run, and the last check's evidence must not be wiped by a probe.
7
- const path = require('path');
8
- const { defineConfig } = require('@playwright/test');
9
-
10
- const PACKAGE_DIR = __dirname;
11
- const USER_DIR = process.cwd();
12
- const PROBE_DIR = process.env.KRYPTHEON_PROBE_DIR || path.join(USER_DIR, 'tests');
13
-
14
- // The same .env reading as playwright.config.js, for the same reasons.
15
- const secrets = require(path.join(PACKAGE_DIR, 'kryptheon-secrets.js'));
16
- const values = secrets.readEnvFile(path.join(USER_DIR, '.env'));
17
- for (const name of Object.keys(values)) {
18
- if (!secrets.isSet(process.env[name])) process.env[name] = values[name];
19
- }
20
-
21
- module.exports = defineConfig({
22
- testDir: PROBE_DIR,
23
- testMatch: ['**/*.kxprobe.js'],
24
- outputDir: path.join(PROBE_DIR, 'output'),
25
- fullyParallel: false,
26
- workers: 1,
27
- retries: 0,
28
- // Room for the gap before each run and for opening the page again after it.
29
- timeout: 60000,
30
- reporter: [[path.join(PACKAGE_DIR, 'kryptheon-probe-reporter.js')]],
31
- use: {
32
- headless: true,
33
- channel: 'chromium',
34
- screenshot: 'off',
35
- trace: 'off',
36
- },
37
- });
1
+ // @ts-check
2
+ // The Playwright config for probe copies (kryptheon-probe.js). Kept apart from
3
+ // playwright.config.js on purpose: probes live in the store, not in tests/;
4
+ // they report through their own reporter; and their screenshots and traces
5
+ // go to a folder of their own - Playwright empties its output folder on every
6
+ // run, and the last check's evidence must not be wiped by a probe.
7
+ const path = require('path');
8
+ const { defineConfig } = require('@playwright/test');
9
+
10
+ const PACKAGE_DIR = __dirname;
11
+ const USER_DIR = process.cwd();
12
+ const PROBE_DIR = process.env.KRYPTHEON_PROBE_DIR || path.join(USER_DIR, 'tests');
13
+
14
+ // The same .env reading as playwright.config.js, for the same reasons.
15
+ const secrets = require(path.join(PACKAGE_DIR, 'kryptheon-secrets.js'));
16
+ const values = secrets.readEnvFile(path.join(USER_DIR, '.env'));
17
+ for (const name of Object.keys(values)) {
18
+ if (!secrets.isSet(process.env[name])) process.env[name] = values[name];
19
+ }
20
+
21
+ module.exports = defineConfig({
22
+ testDir: PROBE_DIR,
23
+ testMatch: ['**/*.kxprobe.js'],
24
+ outputDir: path.join(PROBE_DIR, 'output'),
25
+ fullyParallel: false,
26
+ workers: 1,
27
+ retries: 0,
28
+ // Room for the gap before each run and for opening the page again after it.
29
+ timeout: 60000,
30
+ reporter: [[path.join(PACKAGE_DIR, 'kryptheon-probe-reporter.js')]],
31
+ use: {
32
+ headless: true,
33
+ channel: 'chromium',
34
+ screenshot: 'off',
35
+ trace: 'off',
36
+ },
37
+ });