kryptheon 0.1.57 → 0.1.61
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/LICENSE +38 -38
- package/README.md +8 -1
- package/kryptheon-api.js +614 -20
- package/kryptheon-baselines.js +232 -232
- package/kryptheon-changes.js +222 -222
- package/kryptheon-code.js +61 -1
- package/kryptheon-dashboard.js +8 -2
- package/kryptheon-fonts-OFL.txt +98 -98
- package/kryptheon-keys.js +353 -353
- package/kryptheon-map.js +152 -12
- package/kryptheon-probe-reporter.js +29 -29
- package/kryptheon-probe.config.js +37 -37
- package/kryptheon-project.js +600 -600
- package/kryptheon-roles.js +239 -37
- package/kryptheon-selectors.js +301 -301
- package/kryptheon-store.js +334 -334
- package/kryptheon-testfiles.js +98 -98
- package/kryptheon-webhook.js +332 -67
- package/package.json +1 -1
- package/playwright.config.js +73 -73
package/playwright.config.js
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const { defineConfig } = require('@playwright/test');
|
|
4
|
-
|
|
5
|
-
// Tool files come from the installed package; anything belonging to the person
|
|
6
|
-
// running the command comes from the folder they ran it in.
|
|
7
|
-
const PACKAGE_DIR = __dirname;
|
|
8
|
-
const USER_DIR = process.cwd();
|
|
9
|
-
|
|
10
|
-
// Node's built-in .env loader (no dependency). This file is re-evaluated in
|
|
11
|
-
// each worker process, so the values reach the tests themselves. A missing
|
|
12
|
-
// .env is not fatal: CI can supply the same variables as real env vars.
|
|
13
|
-
// loadEnvFile only exists from Node 20.12, and the package supports 20.6, so
|
|
14
|
-
// fall back to a small parser rather than silently skipping the file.
|
|
15
|
-
// Deliberately not process.loadEnvFile, and this is the whole reason:
|
|
16
|
-
//
|
|
17
|
-
// On Windows, PowerShell's `Out-File -Encoding utf8` and Notepad's "Save as
|
|
18
|
-
// UTF-8" both write a byte order mark. loadEnvFile keeps it, so the first line
|
|
19
|
-
// of the file defines "KRYPTHEON_PASSWORD" rather than
|
|
20
|
-
// "KRYPTHEON_PASSWORD" - measured, not assumed. The variable then reads as
|
|
21
|
-
// undefined, the recording signs in with an empty password, and the login
|
|
22
|
-
// fails for a reason nothing in the report mentions. The file is right there,
|
|
23
|
-
// so nothing warns either.
|
|
24
|
-
//
|
|
25
|
-
// One parser, shared with the CLI, is also what stops the command that decides
|
|
26
|
-
// whether a password is present from disagreeing with the test that uses it.
|
|
27
|
-
function loadEnv(file) {
|
|
28
|
-
const secrets = require(path.join(PACKAGE_DIR, 'kryptheon-secrets.js'));
|
|
29
|
-
const values = secrets.readEnvFile(file);
|
|
30
|
-
for (const name of Object.keys(values)) {
|
|
31
|
-
// A real environment variable wins over the file - but only a real one.
|
|
32
|
-
// A variable that exists and is empty is how "unset" arrives from a shell
|
|
33
|
-
// or a CI job, and letting that beat the file would leave the password
|
|
34
|
-
// blank with the answer sitting right there on disk.
|
|
35
|
-
if (!secrets.isSet(process.env[name])) process.env[name] = values[name];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
loadEnv(path.join(USER_DIR, '.env'));
|
|
40
|
-
|
|
41
|
-
module.exports = defineConfig({
|
|
42
|
-
// The tests belong to the user, so they are found in their folder.
|
|
43
|
-
testDir: path.join(USER_DIR, 'tests'),
|
|
44
|
-
// Playwright's own pattern, plus <name>.kryptheon.js: the name a recording
|
|
45
|
-
// gets in a project whose unit-test runner would also collect *.spec.js.
|
|
46
|
-
testMatch: ['**/*.@(spec|test).?(c|m)[jt]s?(x)', '**/*.kryptheon.js'],
|
|
47
|
-
// Screenshots and other artefacts default to sitting next to the config,
|
|
48
|
-
// which once installed means inside node_modules. They belong to the user's
|
|
49
|
-
// project, so they go to its store - outside the project, where a commit of
|
|
50
|
-
// "everything that changed" cannot pick them up. Playwright empties this
|
|
51
|
-
// folder at the start of every run, so it never grows.
|
|
52
|
-
outputDir: require(path.join(PACKAGE_DIR, 'kryptheon-store.js')).pathsFor(USER_DIR).testResults,
|
|
53
|
-
// These tests all run against one live site, so in parallel they interfere
|
|
54
|
-
// with each other - a shared logged-in session, and rate limiting on the
|
|
55
|
-
// real endpoints. Serial is the safe default here.
|
|
56
|
-
fullyParallel: false,
|
|
57
|
-
workers: 1,
|
|
58
|
-
// Only the plain-language reporter: Playwright's 'list' reporter prints its
|
|
59
|
-
// own stack-trace block on failure, which is what we are hiding here.
|
|
60
|
-
// Resolved from the package so it is found wherever the command is run.
|
|
61
|
-
reporter: [[path.join(PACKAGE_DIR, 'kryptheon-reporter.js')]],
|
|
62
|
-
use: {
|
|
63
|
-
headless: true,
|
|
64
|
-
// The full Chromium, run headless - not Playwright's separate headless
|
|
65
|
-
// shell. Measured on a Windows 11 machine: the shell took 23 seconds to
|
|
66
|
-
// open each new page, every time, and that time counts against the 30
|
|
67
|
-
// second test timeout. A correct flow longer than about 7 seconds failed,
|
|
68
|
-
// and the report blamed the app. The full Chromium opened the same page in
|
|
69
|
-
// 1.5 seconds. It is also the browser `record` checks is installed.
|
|
70
|
-
channel: 'chromium',
|
|
71
|
-
screenshot: 'only-on-failure',
|
|
72
|
-
},
|
|
73
|
-
});
|
|
1
|
+
// @ts-check
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const { defineConfig } = require('@playwright/test');
|
|
4
|
+
|
|
5
|
+
// Tool files come from the installed package; anything belonging to the person
|
|
6
|
+
// running the command comes from the folder they ran it in.
|
|
7
|
+
const PACKAGE_DIR = __dirname;
|
|
8
|
+
const USER_DIR = process.cwd();
|
|
9
|
+
|
|
10
|
+
// Node's built-in .env loader (no dependency). This file is re-evaluated in
|
|
11
|
+
// each worker process, so the values reach the tests themselves. A missing
|
|
12
|
+
// .env is not fatal: CI can supply the same variables as real env vars.
|
|
13
|
+
// loadEnvFile only exists from Node 20.12, and the package supports 20.6, so
|
|
14
|
+
// fall back to a small parser rather than silently skipping the file.
|
|
15
|
+
// Deliberately not process.loadEnvFile, and this is the whole reason:
|
|
16
|
+
//
|
|
17
|
+
// On Windows, PowerShell's `Out-File -Encoding utf8` and Notepad's "Save as
|
|
18
|
+
// UTF-8" both write a byte order mark. loadEnvFile keeps it, so the first line
|
|
19
|
+
// of the file defines "KRYPTHEON_PASSWORD" rather than
|
|
20
|
+
// "KRYPTHEON_PASSWORD" - measured, not assumed. The variable then reads as
|
|
21
|
+
// undefined, the recording signs in with an empty password, and the login
|
|
22
|
+
// fails for a reason nothing in the report mentions. The file is right there,
|
|
23
|
+
// so nothing warns either.
|
|
24
|
+
//
|
|
25
|
+
// One parser, shared with the CLI, is also what stops the command that decides
|
|
26
|
+
// whether a password is present from disagreeing with the test that uses it.
|
|
27
|
+
function loadEnv(file) {
|
|
28
|
+
const secrets = require(path.join(PACKAGE_DIR, 'kryptheon-secrets.js'));
|
|
29
|
+
const values = secrets.readEnvFile(file);
|
|
30
|
+
for (const name of Object.keys(values)) {
|
|
31
|
+
// A real environment variable wins over the file - but only a real one.
|
|
32
|
+
// A variable that exists and is empty is how "unset" arrives from a shell
|
|
33
|
+
// or a CI job, and letting that beat the file would leave the password
|
|
34
|
+
// blank with the answer sitting right there on disk.
|
|
35
|
+
if (!secrets.isSet(process.env[name])) process.env[name] = values[name];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
loadEnv(path.join(USER_DIR, '.env'));
|
|
40
|
+
|
|
41
|
+
module.exports = defineConfig({
|
|
42
|
+
// The tests belong to the user, so they are found in their folder.
|
|
43
|
+
testDir: path.join(USER_DIR, 'tests'),
|
|
44
|
+
// Playwright's own pattern, plus <name>.kryptheon.js: the name a recording
|
|
45
|
+
// gets in a project whose unit-test runner would also collect *.spec.js.
|
|
46
|
+
testMatch: ['**/*.@(spec|test).?(c|m)[jt]s?(x)', '**/*.kryptheon.js'],
|
|
47
|
+
// Screenshots and other artefacts default to sitting next to the config,
|
|
48
|
+
// which once installed means inside node_modules. They belong to the user's
|
|
49
|
+
// project, so they go to its store - outside the project, where a commit of
|
|
50
|
+
// "everything that changed" cannot pick them up. Playwright empties this
|
|
51
|
+
// folder at the start of every run, so it never grows.
|
|
52
|
+
outputDir: require(path.join(PACKAGE_DIR, 'kryptheon-store.js')).pathsFor(USER_DIR).testResults,
|
|
53
|
+
// These tests all run against one live site, so in parallel they interfere
|
|
54
|
+
// with each other - a shared logged-in session, and rate limiting on the
|
|
55
|
+
// real endpoints. Serial is the safe default here.
|
|
56
|
+
fullyParallel: false,
|
|
57
|
+
workers: 1,
|
|
58
|
+
// Only the plain-language reporter: Playwright's 'list' reporter prints its
|
|
59
|
+
// own stack-trace block on failure, which is what we are hiding here.
|
|
60
|
+
// Resolved from the package so it is found wherever the command is run.
|
|
61
|
+
reporter: [[path.join(PACKAGE_DIR, 'kryptheon-reporter.js')]],
|
|
62
|
+
use: {
|
|
63
|
+
headless: true,
|
|
64
|
+
// The full Chromium, run headless - not Playwright's separate headless
|
|
65
|
+
// shell. Measured on a Windows 11 machine: the shell took 23 seconds to
|
|
66
|
+
// open each new page, every time, and that time counts against the 30
|
|
67
|
+
// second test timeout. A correct flow longer than about 7 seconds failed,
|
|
68
|
+
// and the report blamed the app. The full Chromium opened the same page in
|
|
69
|
+
// 1.5 seconds. It is also the browser `record` checks is installed.
|
|
70
|
+
channel: 'chromium',
|
|
71
|
+
screenshot: 'only-on-failure',
|
|
72
|
+
},
|
|
73
|
+
});
|