@orion-qa/orion 3.3.0 → 3.4.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/.claude/skills/appium/SKILL.md +2 -2
- package/.claude/skills/appium/templates/ci/github-actions-android.yml +1 -1
- package/.claude/skills/appium/templates/ci/github-actions-ios.yml +1 -1
- package/.claude/skills/appium/templates/ci/github-actions-windows.yml +1 -1
- package/.claude/skills/automation-implementation/SKILL.md +1 -1
- package/.claude/skills/automation-strategy/SKILL.md +1 -0
- package/.claude/skills/cicd-integration/SKILL.md +1 -1
- package/.claude/skills/code-review/SKILL.md +1 -1
- package/.claude/skills/code-review/references/pattern-rules.md +1 -0
- package/.claude/skills/csharp/SKILL.md +1 -0
- package/.claude/skills/documentation/SKILL.md +1 -1
- package/.claude/skills/execution/SKILL.md +8 -8
- package/.claude/skills/httpclient/templates/ci/github-actions.yml +2 -2
- package/.claude/skills/java/SKILL.md +1 -0
- package/.claude/skills/javascript/SKILL.md +1 -0
- package/.claude/skills/junit5/SKILL.md +1 -1
- package/.claude/skills/k6/SKILL.md +1 -1
- package/.claude/skills/k6/templates/project/tests/load/products.js +1 -1
- package/.claude/skills/karate/SKILL.md +1 -1
- package/.claude/skills/karate/templates/ci/github-actions.yml +2 -2
- package/.claude/skills/newman/templates/ci/github-actions.yml +2 -2
- package/.claude/skills/newman/templates/collection/src/config/env.js +1 -1
- package/.claude/skills/nunit/SKILL.md +1 -1
- package/.claude/skills/orion/SKILL.md +1 -1
- package/.claude/skills/orion/references/assess-fix.md +1 -1
- package/.claude/skills/orion/references/batch.md +1 -1
- package/.claude/skills/orion/references/capabilities.md +1 -1
- package/.claude/skills/orion/references/conversation.md +3 -3
- package/.claude/skills/orion/references/modes.md +1 -1
- package/.claude/skills/orion/references/plain-language.md +3 -2
- package/.claude/skills/orion/references/recovery-loop.md +2 -2
- package/.claude/skills/orion/references/status-lines.md +4 -4
- package/.claude/skills/orion/references/task-brief.md +1 -1
- package/.claude/skills/orion/scripts/batch_state.mjs +1 -1
- package/.claude/skills/orion/scripts/done_check.mjs +7 -5
- package/.claude/skills/orion/scripts/quiet.mjs +1 -1
- package/.claude/skills/orion/templates/project-context/report.md +2 -2
- package/.claude/skills/pact/SKILL.md +1 -1
- package/.claude/skills/playwright/SKILL.md +2 -2
- package/.claude/skills/playwright/references/electron.md +1 -1
- package/.claude/skills/playwright/templates/README.md +1 -1
- package/.claude/skills/playwright/templates/ci/azure-pipelines.yml +1 -1
- package/.claude/skills/playwright/templates/ci/github-actions-dotnet.yml +2 -2
- package/.claude/skills/playwright/templates/ci/github-actions-javascript.yml +2 -2
- package/.claude/skills/playwright/templates/ci/github-actions-python.yml +2 -2
- package/.claude/skills/playwright/templates/ci/github-actions.yml +1 -1
- package/.claude/skills/playwright/templates/javascript/.prettierignore +6 -0
- package/.claude/skills/playwright/templates/javascript/.prettierrc.json +4 -0
- package/.claude/skills/playwright/templates/javascript/fixtures/index.js +56 -48
- package/.claude/skills/playwright/templates/javascript/package.json +4 -1
- package/.claude/skills/playwright/templates/javascript/pageObjects/basePage.js +5 -1
- package/.claude/skills/playwright/templates/javascript/playwright.config.js +6 -2
- package/.claude/skills/playwright/templates/javascript/reporters/summaryReporter.js +80 -17
- package/.claude/skills/playwright/templates/javascript/resources/desc/signIn.desc.js +10 -3
- package/.claude/skills/playwright/templates/javascript/src/config/env.js +12 -3
- package/.claude/skills/playwright/templates/javascript/src/config/flags.js +3 -1
- package/.claude/skills/playwright/templates/javascript/tests/api/session.spec.js +8 -4
- package/.claude/skills/playwright/templates/javascript/tests/unit/summaryReporter.test.js +30 -6
- package/.claude/skills/playwright/templates/javascript/utils/random.js +3 -1
- package/.claude/skills/playwright/templates/project/.prettierignore +6 -0
- package/.claude/skills/playwright/templates/project/.prettierrc.json +4 -0
- package/.claude/skills/playwright/templates/project/fixtures/index.ts +21 -15
- package/.claude/skills/playwright/templates/project/fixtures/session.ts +9 -2
- package/.claude/skills/playwright/templates/project/package.json +4 -1
- package/.claude/skills/playwright/templates/project/pageObjects/basePage.ts +5 -1
- package/.claude/skills/playwright/templates/project/playwright.config.ts +4 -2
- package/.claude/skills/playwright/templates/project/reporters/summaryReporter.ts +84 -17
- package/.claude/skills/playwright/templates/project/resources/desc/signIn.desc.ts +10 -3
- package/.claude/skills/playwright/templates/project/src/config/env.ts +15 -4
- package/.claude/skills/playwright/templates/project/src/services/apiClient.ts +5 -1
- package/.claude/skills/playwright/templates/project/tests/api/session.spec.ts +8 -4
- package/.claude/skills/playwright/templates/project/tests/unit/summaryReporter.test.ts +30 -6
- package/.claude/skills/playwright/templates/project/utils/formFill.ts +4 -1
- package/.claude/skills/playwright/templates/project/utils/random.ts +3 -1
- package/.claude/skills/playwright/templates/project/utils/redact.ts +4 -1
- package/.claude/skills/pytest/SKILL.md +1 -1
- package/.claude/skills/python/SKILL.md +1 -0
- package/.claude/skills/quality-checks/SKILL.md +1 -1
- package/.claude/skills/requests/templates/ci/github-actions.yml +2 -2
- package/.claude/skills/rest-assured/SKILL.md +2 -2
- package/.claude/skills/rest-assured/templates/ci/github-actions.yml +2 -2
- package/.claude/skills/selenium/SKILL.md +1 -1
- package/.claude/skills/selenium/templates/ci/github-actions-csharp.yml +2 -2
- package/.claude/skills/selenium/templates/ci/github-actions-java.yml +2 -2
- package/.claude/skills/selenium/templates/ci/github-actions-python.yml +2 -2
- package/.claude/skills/self-healing/SKILL.md +1 -1
- package/.claude/skills/test-design/SKILL.md +1 -1
- package/.claude/skills/test-reporting/references/report-levels.md +1 -1
- package/.claude/skills/test-reporting/references/tool-mapping.md +1 -1
- package/.claude/skills/testng/SKILL.md +1 -1
- package/.claude/skills/typescript/SKILL.md +1 -0
- package/.claude/skills/ui-observation/SKILL.md +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +8 -7
- package/assets/architecture.svg +1 -1
- package/assets/run-flow.svg +1 -1
- package/bin/orion.mjs +6 -6
- package/hosts/gemini-extension/gemini-extension.json +1 -1
- package/package.json +2 -2
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Usage (from the workspace root):
|
|
10
10
|
* node .claude/skills/orion/scripts/done_check.mjs --project <test project> --story <KEY> --run <run id>
|
|
11
|
-
* [--existing] [--base <git sha>] [--command "npm test"] [--no-run] [--results project-context/results] [--report <report.md>]
|
|
11
|
+
* [--existing] [--base <git sha>] [--runs <n>] [--command "npm test"] [--no-run] [--results project-context/results] [--report <report.md>]
|
|
12
12
|
* [--result-text <file with the result message>] [--known-failures TS-4,TS-6] [--json]
|
|
13
13
|
* Checks (each PASS, FAIL with the next action, or SKIP with why):
|
|
14
14
|
* project suite_check.mjs reports 0 findings (placeholders, layers, scripts that name missing projects, …); for an
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
* hold for any suite count: placeholders left and scripts that name a missing project
|
|
17
17
|
* command the command the result gives the user exits 0; a failing test is allowed only when it is in
|
|
18
18
|
* --known-failures (an app defect the result reports)
|
|
19
|
-
* runs
|
|
19
|
+
* runs at least --runs results files for this run (default 1; results_parse.mjs output, `<run id>*.json`; a
|
|
20
|
+
* stability check passes --runs 3 or more), and in each, every
|
|
20
21
|
* test of the story passed on its first attempt (retries off), except --known-failures
|
|
21
22
|
* coverage graph.mjs check --story finds no gap (an AC with no case, a case with no test, a test with no case)
|
|
22
23
|
* report report_check.mjs finds nothing in the report
|
|
@@ -34,7 +35,7 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
34
35
|
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
35
36
|
|
|
36
37
|
function args(argv) {
|
|
37
|
-
const o = { results: 'project-context/results', known: [] };
|
|
38
|
+
const o = { results: 'project-context/results', known: [], runs: 1 };
|
|
38
39
|
for (let i = 0; i < argv.length; i++) {
|
|
39
40
|
const a = argv[i];
|
|
40
41
|
const v = () => argv[++i];
|
|
@@ -50,6 +51,7 @@ function args(argv) {
|
|
|
50
51
|
else if (a === '--json') o.json = true;
|
|
51
52
|
else if (a === '--existing') o.existing = true;
|
|
52
53
|
else if (a === '--base') o.base = v();
|
|
54
|
+
else if (a === '--runs') { o.runs = Number(v()); if (!Number.isInteger(o.runs) || o.runs < 1) { console.log('done_check: --runs takes a whole number, 1 or more'); process.exit(2); } }
|
|
53
55
|
else { console.log(`done_check: unknown argument ${a}`); process.exit(2); }
|
|
54
56
|
}
|
|
55
57
|
if (!o.project || !o.story || !o.run) {
|
|
@@ -129,7 +131,7 @@ function main() {
|
|
|
129
131
|
// runs
|
|
130
132
|
const dir = path.resolve(root, o.results);
|
|
131
133
|
const files = fs.existsSync(dir) ? fs.readdirSync(dir).filter((f) => f.startsWith(o.run) && f.endsWith('.json') && !/\.(pw|raw|report)\.json$/.test(f)).sort() : [];
|
|
132
|
-
if (files.length <
|
|
134
|
+
if (files.length < o.runs) add('runs', 'FAIL', `${files.length} results file(s) for ${o.run} in ${o.results}`, 'after each counted run: results_parse.mjs <project>/test-summary/results.json (or the run\'s JSON or JUnit report) --run <run id>-<n> --out project-context/results/<run id>-<n>.json');
|
|
133
135
|
else {
|
|
134
136
|
const bad = [];
|
|
135
137
|
for (const f of files) {
|
|
@@ -143,7 +145,7 @@ function main() {
|
|
|
143
145
|
if (t.status !== 'passed' || (t.attempts || 1) > 1) bad.push(`${f}: ${id} ${t.status}${t.attempts > 1 ? ` after ${t.attempts} attempts` : ''}`);
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
|
-
if (bad.length) add('runs', 'FAIL', bad.slice(0, 4).join(' | '),
|
|
148
|
+
if (bad.length) add('runs', 'FAIL', bad.slice(0, 4).join(' | '), `a new test passes ${o.runs > 1 ? `${o.runs} of ${o.runs}` : 'its counted run'} with retries off: recovery loop for each test named`);
|
|
147
149
|
else add('runs', 'PASS', `${files.length} recorded runs, every ${o.story} test passed first time`);
|
|
148
150
|
}
|
|
149
151
|
|
|
@@ -28,7 +28,7 @@ import path from 'node:path';
|
|
|
28
28
|
import { spawnSync } from 'node:child_process';
|
|
29
29
|
import { pathToFileURL } from 'node:url';
|
|
30
30
|
|
|
31
|
-
const ALLOWED = /^(npm (test|t|ci|install|i)\b|npm run (test|build|lint|typecheck|check|e2e|verify|smoke|compile)[\w:.-]*|npx (--no-install )?playwright (test|install|show-report|--version)\b|pytest\b|python3? -m pytest\b|py -m pytest\b|mvn\b|\.\/mvnw\b|gradle\b|\.\/gradlew\b|dotnet (test|build|restore)\b|k6 (run|version)\b|newman run\b|npx newman run\b|pip3? install\b|python3? -m pip install\b|node (?!-e\b|--eval\b)(?:[\w.-]+\/)*(?:run|test[\w-]*|[\w-]+\.(?:spec|test))\.(?:m?js|cjs)\b|yarn(\s*$| (test|install)\b| run (test|build|lint|typecheck|check|e2e|verify|smoke|compile)[\w:.-]*)|pnpm (test|install|i|run (test|build|lint|typecheck|check|e2e|verify|smoke|compile)[\w:.-]*)\b)/;
|
|
31
|
+
const ALLOWED = /^(npm (test|t|ci|install|i)\b|npm run (test|build|lint|typecheck|check|e2e|verify|smoke|compile|format)[\w:.-]*|npx (--no-install )?playwright (test|install|show-report|--version)\b|pytest\b|python3? -m pytest\b|py -m pytest\b|mvn\b|\.\/mvnw\b|gradle\b|\.\/gradlew\b|dotnet (test|build|restore|format)\b|npx (--no-install )?prettier\b|ruff (format|check)\b|python3? -m ruff (format|check)\b|k6 (run|version)\b|newman run\b|npx newman run\b|pip3? install\b|python3? -m pip install\b|node (?!-e\b|--eval\b)(?:[\w.-]+\/)*(?:run|test[\w-]*|[\w-]+\.(?:spec|test))\.(?:m?js|cjs)\b|yarn(\s*$| (test|install)\b| run (test|build|lint|typecheck|check|e2e|verify|smoke|compile|format)[\w:.-]*)|pnpm (test|install|i|run (test|build|lint|typecheck|check|e2e|verify|smoke|compile|format)[\w:.-]*)\b)/;
|
|
32
32
|
const KEEP = /(\b(error|errors|failed|failing|failure|fail|exception|traceback|assert(ion)?error|timed? ?out|warning|warn|deprecated|npm err|err!|build (success|failure)|tests? run:|passed|skipped|flaky|did not run|interrupted|expected|received|not found|cannot find|unable to)\b|✘|✗|×|^\s*\d+\) |^\s*at .*\.(spec|test)\.|^={3,}|^-{3,} |^\s*\d+ (passed|failed|skipped|flaky))/i;
|
|
33
33
|
const NOISE = /^\s*at .*(node_modules|internal\/|node:)|^\s*$|^\s*(✓|✔|ok \d+|\[\d+\/\d+\].*(✓|passed))/;
|
|
34
34
|
const SECRET_NAME = /(PASSWORD|PASSWD|TOKEN|SECRET|API[_-]?KEY|AUTH|COOKIE)/i;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# <Story title> · test report
|
|
2
2
|
|
|
3
|
-
**<✅ Ready to accept | ⚠️ Ready, with notes | ❌ Not ready>**: <one sentence: what was built and how it ran, e.g. "6 new tests for login and logout, all passed
|
|
3
|
+
**<✅ Ready to accept | ⚠️ Ready, with notes | ❌ Not ready>**: <one sentence: what was built and how it ran, e.g. "6 new tests for login and logout, all passed with retries off; no app bugs found.">
|
|
4
4
|
|
|
5
5
|
| | |
|
|
6
6
|
|---|---|
|
|
7
7
|
| Story | <key and title, or the request in a few words> |
|
|
8
8
|
| App | <base URL> (<test environment name>) |
|
|
9
9
|
| Tests | <n> <UI · API> tests · <tool + language> · `<test folder inside the workspace>` |
|
|
10
|
-
| Runs | <
|
|
10
|
+
| Runs | <1 counted run, retries off: n/n passed (stability check: N runs, n/n each time)> · <each new test also failed when its check was broken | fail check not run: reason> |
|
|
11
11
|
| Date | <d Mon yyyy> |
|
|
12
12
|
|
|
13
13
|
## Coverage
|
|
@@ -27,7 +27,7 @@ Adapter rules: holds only what differs from the capability skills; the project's
|
|
|
27
27
|
- `publishVerificationResult` and `providerVersion` (the git SHA) only in CI and only with H9 [S3]; tokens (`pactBrokerToken`) from the environment.
|
|
28
28
|
|
|
29
29
|
## Run
|
|
30
|
-
- Consumer: the project's runner on the contract tests (`npm run test:contract`, i.e. `node --test "tests/contract/**/*.test.js"`; a bare folder path fails on Node 22; or `npx jest test/contract`),
|
|
30
|
+
- Consumer: the project's runner on the contract tests (`npm run test:contract`, i.e. `node --test "tests/contract/**/*.test.js"`; a bare folder path fails on Node 22; or `npx jest test/contract`), once for new tests (a stability check on request: N times) [M1].
|
|
31
31
|
- Provider: the verification script against the provider running locally or in a test environment (H6 for a shared one) [M3].
|
|
32
32
|
- **Local verification behind a proxy:** clear `HTTP_PROXY` / `HTTPS_PROXY` for that command (`env -u HTTPS_PROXY -u HTTP_PROXY …`), or every interaction fails with the proxy's 403 (M5).
|
|
33
33
|
- Fail checks: consumer, point the client at a wrong path or field and show the test failing on `mismatches` (M2); provider, change one response field's type and show the verifier naming it (M4). Restore both.
|
|
@@ -32,7 +32,7 @@ Adapter rules: holds only what differs from the capability skills; the project's
|
|
|
32
32
|
## Run
|
|
33
33
|
- Use the project's script if present (`npm test`, `npm run e2e`). Otherwise `npx playwright test`.
|
|
34
34
|
- Scope: `npx playwright test <file>` · `-g "<title>"` · `--project=<name>`. A suite on the suite architecture runs by project: `--project=regression` (UI), `--project=api`, `--project=unit`, `--project=smoke`; the `setup` project runs first on its own (a `--grep` keeps it).
|
|
35
|
-
- New tests: `npx playwright test <files> --repeat-each
|
|
35
|
+
- New tests: `npx playwright test <files> --retries=0`, once. A stability check the user asks for: `--repeat-each=<N> --retries=0` (default 3; all N must agree; on the suite architecture add the spec's project, e.g. `--project=regression`, so a test isn't counted twice through `smoke`).
|
|
36
36
|
- Flaky: Playwright reports tests that passed on retry as `flaky` in the summary line; record that count, never fold it into passed.
|
|
37
37
|
- Fail check: change the expected value of the main assertion, run the single test with `-g`, confirm it fails **on that assertion** (not on an earlier wait or visibility check), restore.
|
|
38
38
|
- A quantity change: read the count before the action (`await quantity.inputValue()` or the cell's text), act, then assert `toHaveValue(String(before + added))` / `toHaveText(...)`; never assert a fixed 1 on a state you didn't measure.
|
|
@@ -51,7 +51,7 @@ Same rules (role, label and test-id locators; web-first assertions; no fixed wai
|
|
|
51
51
|
| Locator | `page.getByRole('button', { name: 'Log in' })` | `page.get_by_role("button", name="Log in")` | `Page.GetByRole(AriaRole.Button, new() { Name = "Log in" })` |
|
|
52
52
|
| Assertion | `await expect(loc).toBeVisible()` | `expect(loc).to_be_visible()` | `await Expect(loc).ToBeVisibleAsync()` |
|
|
53
53
|
| Fixtures / setup | `test.extend` | pytest fixtures (`page`, `context`, `browser`, `base_url`) | `PageTest` base class, `ContextOptions()` |
|
|
54
|
-
|
|
|
54
|
+
| Stability check, N× (on request) | `--repeat-each=<N> --retries=0` | the command N times | the command N times |
|
|
55
55
|
| Trace on failure | config `trace: 'retain-on-failure'` | `--tracing retain-on-failure` | `Context.Tracing.StartAsync` / `StopAsync` in setup and teardown |
|
|
56
56
|
|
|
57
57
|
## Failure signals
|
|
@@ -6,7 +6,7 @@ Use this for desktop apps built on Electron (Windows, macOS, Linux). Native Wind
|
|
|
6
6
|
- **Detect:** `electron` in the app's package.json and tests importing `_electron` from `playwright` (or `@playwright/test`).
|
|
7
7
|
- **Launch:** `const app = await _electron.launch({ args: ['<main script>'] })`; `const window = await app.firstWindow()` gives a normal `Page`, so locators, web-first assertions and fixtures work as in the main adapter [E1]. Code in the main process: `app.evaluate(...)`.
|
|
8
8
|
- **Write:** same locator order as web (`getByRole`, `getByLabel`, `getByTestId`); put the launch in a fixture that closes the app in teardown (`await app.close()`), even on failure.
|
|
9
|
-
- **Run:** the project's Playwright command; new tests `--repeat-each
|
|
9
|
+
- **Run:** the project's Playwright command; new tests `--retries=0`, once (a stability check adds `--repeat-each=<N>`). On Linux CI the app needs a display (`xvfb-run`).
|
|
10
10
|
- **Versions:** check the Electron versions Playwright supports on the page [E1]; an unsupported version → NEEDS_ENVIRONMENT.
|
|
11
11
|
- **Failure signals:** launch timeout or "Process failed to launch" → NEEDS_ENVIRONMENT; locator timeouts → as in the main adapter.
|
|
12
12
|
|
|
@@ -13,7 +13,7 @@ config (environment first, then `.env`; nothing is read or thrown on import) →
|
|
|
13
13
|
| `{{USERNAME_LABEL}}`, `{{PASSWORD_LABEL}}`, `{{SUBMIT_LABEL}}` | the sign-in form's labels as observed (UI map) |
|
|
14
14
|
| `{{SIGNED_IN_ROLE}}` (.NET: `{{SIGNED_IN_ARIA_ROLE}}`, an `AriaRole` member such as `Heading`) | the role of the element that greets the signed-in user, as observed |
|
|
15
15
|
| `{{SIGNED_IN_TEXT}}`, `{{LOGIN_ERROR_TEXT}}` | the expected greeting and wrong-password message, from the requirement (or as observed, said so) |
|
|
16
|
-
| versions (`PLAYWRIGHT_VERSION`, `TYPES_NODE_VERSION`, `TYPESCRIPT_VERSION` (TypeScript), `PYTEST_PLAYWRIGHT_VERSION`, `PYTEST_VERSION`, `PLAYWRIGHT_DOTNET_VERSION`, `TEST_SDK_VERSION`, `NUNIT_ADAPTER_VERSION`) | looked up at init (`npm view`, `pip index versions`, `dotnet package search`) and recorded |
|
|
16
|
+
| versions (`PLAYWRIGHT_VERSION`, `TYPES_NODE_VERSION`, `TYPESCRIPT_VERSION` (TypeScript), `PRETTIER_VERSION` (JavaScript and TypeScript), `PYTEST_PLAYWRIGHT_VERSION`, `PYTEST_VERSION`, `PLAYWRIGHT_DOTNET_VERSION`, `TEST_SDK_VERSION`, `NUNIT_ADAPTER_VERSION`) | looked up at init (`npm view`, `pip index versions`, `dotnet package search`) and recorded |
|
|
17
17
|
|
|
18
18
|
If the app has no sign-in (JavaScript and TypeScript starters): delete `setup/`; in the config the `setup` and `teardown` projects, `signedIn`, and the `dependencies` and `storageState` entries (UI projects then `use: desktop`); `pageObjects/loginPage` and its fixture; `tests/ui/signIn.spec`, `tests/api/session.spec` and `resources/desc/signIn.desc`. Start with the story's first page. `suite_check.mjs` then reports the app as having no sign-in and skips the sign-in-once checks (done this way for the quality-checks run, 2026-11-12). Other starters: delete the login page, the sign-in flow, its data and the smoke tests.
|
|
19
19
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Playwright (.NET, NUnit). Runs on PRs, pushes to the default branch, and on demand: the executor triggers it with
|
|
3
3
|
# actions_run_trigger (run_workflow) on the work branch and reads the result with get_job_logs.
|
|
4
4
|
# Actions are pinned to commit SHAs (tag in the comment, resolved 2026-10-15); update them with Dependabot.
|
|
5
|
-
# "repeat: 3" runs the selection three times with retries off (
|
|
5
|
+
# "repeat: 3" runs the selection three times with retries off (a stability check); any failing run fails the job.
|
|
6
6
|
name: e2e
|
|
7
7
|
on:
|
|
8
8
|
pull_request:
|
|
@@ -22,7 +22,7 @@ on:
|
|
|
22
22
|
required: false
|
|
23
23
|
default: ""
|
|
24
24
|
repeat:
|
|
25
|
-
description: "Runs of the selection (3 for
|
|
25
|
+
description: "Runs of the selection (3 for a stability check)"
|
|
26
26
|
type: choice
|
|
27
27
|
options: ["1", "3"]
|
|
28
28
|
default: "1"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Playwright (JavaScript). Runs on PRs, pushes to the default branch, and on demand: the executor triggers it with
|
|
3
3
|
# actions_run_trigger (run_workflow) on the work branch and reads the result with get_job_logs.
|
|
4
4
|
# Actions are pinned to commit SHAs (tag in the comment, resolved 2026-10-15); update them with Dependabot.
|
|
5
|
-
# "repeat: 3" runs the selection three times with retries off (
|
|
5
|
+
# "repeat: 3" runs the selection three times with retries off (a stability check); any failing run fails the job.
|
|
6
6
|
name: e2e
|
|
7
7
|
on:
|
|
8
8
|
pull_request:
|
|
@@ -22,7 +22,7 @@ on:
|
|
|
22
22
|
required: false
|
|
23
23
|
default: ""
|
|
24
24
|
repeat:
|
|
25
|
-
description: "Runs of the selection (3 for
|
|
25
|
+
description: "Runs of the selection (3 for a stability check)"
|
|
26
26
|
type: choice
|
|
27
27
|
options: ["1", "3"]
|
|
28
28
|
default: "1"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Playwright (Python, pytest). Runs on PRs, pushes to the default branch, and on demand: the executor triggers it with
|
|
3
3
|
# actions_run_trigger (run_workflow) on the work branch and reads the result with get_job_logs.
|
|
4
4
|
# Actions are pinned to commit SHAs (tag in the comment, resolved 2026-10-15); update them with Dependabot.
|
|
5
|
-
# "repeat: 3" runs the selection three times with retries off (
|
|
5
|
+
# "repeat: 3" runs the selection three times with retries off (a stability check); any failing run fails the job.
|
|
6
6
|
name: e2e
|
|
7
7
|
on:
|
|
8
8
|
pull_request:
|
|
@@ -22,7 +22,7 @@ on:
|
|
|
22
22
|
required: false
|
|
23
23
|
default: ""
|
|
24
24
|
repeat:
|
|
25
|
-
description: "Runs of the selection (3 for
|
|
25
|
+
description: "Runs of the selection (3 for a stability check)"
|
|
26
26
|
type: choice
|
|
27
27
|
options: ["1", "3"]
|
|
28
28
|
default: "1"
|
|
@@ -32,54 +32,62 @@ const { ensureSession } = require('./session');
|
|
|
32
32
|
* @property {void} session Makes sure a project that starts signed in has a usable saved session.
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
-
const test = base.test.extend(
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}, { scope: 'worker', auto: true }],
|
|
51
|
-
/**
|
|
52
|
-
* Playwright's browser context, plus the saved `sessionStorage` when `AUTH_SESSION_STORAGE=1` and the test
|
|
53
|
-
* starts signed in (Playwright's own saved state doesn't include it; this is its documented workaround).
|
|
54
|
-
*/
|
|
55
|
-
context: async ({ context, storageState }, use) => {
|
|
56
|
-
if (flags.authSessionStorage && storageState && fs.existsSync(paths.sessionStorage)) {
|
|
57
|
-
const origin = new URL(env.baseUrl() || 'http://localhost').origin;
|
|
58
|
-
const storage = JSON.parse(fs.readFileSync(paths.sessionStorage, 'utf-8'));
|
|
59
|
-
await context.addInitScript(({ origin: o, entries }) => {
|
|
60
|
-
if (window.location.origin === o) {
|
|
61
|
-
for (const [key, value] of Object.entries(entries)) window.sessionStorage.setItem(key, String(value));
|
|
35
|
+
const test = base.test.extend(
|
|
36
|
+
/** @type {import('@playwright/test').Fixtures<SuiteFixtures, WorkerFixtures, TestArgs, WorkerArgs>} */ ({
|
|
37
|
+
/**
|
|
38
|
+
* Before the first test of a worker in a signed-in project: signs in again when the saved session is missing or
|
|
39
|
+
* stale (the setup project didn't run, e.g. UI mode with only the tests' project ticked, or the session is old).
|
|
40
|
+
* Normal runs, where setup has just signed in, reuse its session and do nothing here.
|
|
41
|
+
*/
|
|
42
|
+
session: [
|
|
43
|
+
async ({ playwright, browserName, channel, headless, launchOptions }, use, workerInfo) => {
|
|
44
|
+
const projectUse = workerInfo.project.use;
|
|
45
|
+
if (projectUse.storageState === paths.userSession) {
|
|
46
|
+
/** Starts this project's browser, with its channel, only when the session must be renewed. */
|
|
47
|
+
const launch = () => playwright[browserName].launch({ ...launchOptions, channel, headless });
|
|
48
|
+
const why = await ensureSession(launch, projectUse);
|
|
49
|
+
if (why) logger.info(`Signed in again before the tests: ${why}`);
|
|
62
50
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
51
|
+
await use();
|
|
52
|
+
},
|
|
53
|
+
{ scope: 'worker', auto: true },
|
|
54
|
+
],
|
|
55
|
+
/**
|
|
56
|
+
* Playwright's browser context, plus the saved `sessionStorage` when `AUTH_SESSION_STORAGE=1` and the test
|
|
57
|
+
* starts signed in (Playwright's own saved state doesn't include it; this is its documented workaround).
|
|
58
|
+
*/
|
|
59
|
+
context: async ({ context, storageState }, use) => {
|
|
60
|
+
if (flags.authSessionStorage && storageState && fs.existsSync(paths.sessionStorage)) {
|
|
61
|
+
const origin = new URL(env.baseUrl() || 'http://localhost').origin;
|
|
62
|
+
const storage = JSON.parse(fs.readFileSync(paths.sessionStorage, 'utf-8'));
|
|
63
|
+
await context.addInitScript(
|
|
64
|
+
({ origin: o, entries }) => {
|
|
65
|
+
if (window.location.origin === o) {
|
|
66
|
+
for (const [key, value] of Object.entries(entries)) window.sessionStorage.setItem(key, String(value));
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{ origin, entries: storage },
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
await use(context);
|
|
73
|
+
},
|
|
74
|
+
/** The sign-in page. */
|
|
75
|
+
loginPage: async ({ page }, use) => {
|
|
76
|
+
await use(new LoginPage(page));
|
|
77
|
+
},
|
|
78
|
+
/** The page a signed-in user lands on. */
|
|
79
|
+
homePage: async ({ page }, use) => {
|
|
80
|
+
await use(new HomePage(page));
|
|
81
|
+
},
|
|
82
|
+
/** The app's shell (header, navigation, account menu). */
|
|
83
|
+
shellPage: async ({ page }, use) => {
|
|
84
|
+
await use(new ShellPage(page));
|
|
85
|
+
},
|
|
86
|
+
/** The app's HTTP API, with the project's base URL and session. */
|
|
87
|
+
apiClient: async ({ request }, use) => {
|
|
88
|
+
await use(new ApiClient(request));
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
);
|
|
84
92
|
|
|
85
93
|
module.exports = { test, expect: base.expect };
|
|
@@ -8,10 +8,13 @@
|
|
|
8
8
|
"test:regression": "playwright test --project=regression",
|
|
9
9
|
"test:api": "playwright test --project=api",
|
|
10
10
|
"test:unit": "playwright test --project=unit",
|
|
11
|
+
"format": "prettier --write \"**/*.{js,ts}\"",
|
|
12
|
+
"format:check": "prettier --check \"**/*.{js,ts}\"",
|
|
11
13
|
"report": "playwright show-report"
|
|
12
14
|
},
|
|
13
15
|
"devDependencies": {
|
|
14
16
|
"@playwright/test": "{{PLAYWRIGHT_VERSION}}",
|
|
15
|
-
"@types/node": "{{TYPES_NODE_VERSION}}"
|
|
17
|
+
"@types/node": "{{TYPES_NODE_VERSION}}",
|
|
18
|
+
"prettier": "{{PRETTIER_VERSION}}"
|
|
16
19
|
}
|
|
17
20
|
}
|
|
@@ -28,7 +28,11 @@ class BasePage {
|
|
|
28
28
|
async open() {
|
|
29
29
|
if (/\{\{[A-Z_]+\}\}/.test(String(this.path))) {
|
|
30
30
|
// A starter copied but not filled: say so now, instead of opening /%7B%7BLOGIN_PATH%7D%7D and timing out.
|
|
31
|
-
throw new AutomationError(
|
|
31
|
+
throw new AutomationError(
|
|
32
|
+
'Open',
|
|
33
|
+
this.path,
|
|
34
|
+
'unfilled starter placeholder: fill it in resources/testData from the UI map',
|
|
35
|
+
);
|
|
32
36
|
}
|
|
33
37
|
let response;
|
|
34
38
|
try {
|
|
@@ -20,14 +20,18 @@ module.exports = defineConfig({
|
|
|
20
20
|
fullyParallel: false,
|
|
21
21
|
workers: 1,
|
|
22
22
|
forbidOnly: !!process.env.CI,
|
|
23
|
-
//
|
|
23
|
+
// Retries stay off so a flaky test shows up instead of passing on a retry.
|
|
24
24
|
retries: 0,
|
|
25
25
|
// A missing screenshot baseline fails instead of being saved unseen; a person approves it first.
|
|
26
26
|
updateSnapshots: 'none',
|
|
27
27
|
timeout: flags.testTimeout,
|
|
28
28
|
expect: { timeout: flags.expectTimeout },
|
|
29
29
|
// list while it runs; the one-page summary to read and share (test-summary/index.html); Playwright's report for traces.
|
|
30
|
-
reporter: [
|
|
30
|
+
reporter: [
|
|
31
|
+
['list'],
|
|
32
|
+
[path.join(__dirname, 'reporters', 'summaryReporter.js'), { outputFile: paths.summaryReport }],
|
|
33
|
+
['html', { open: 'never', outputFolder: paths.htmlReport }],
|
|
34
|
+
],
|
|
31
35
|
use: {
|
|
32
36
|
baseURL: env.baseUrl(),
|
|
33
37
|
// The installed Chrome or Edge for every project, not only the UI ones: the session fixture may start a browser in
|
|
@@ -35,7 +35,10 @@ const SUPPORT_PROJECTS = new Set(['setup', 'teardown']);
|
|
|
35
35
|
* @returns {string} Safe HTML text.
|
|
36
36
|
*/
|
|
37
37
|
function esc(s) {
|
|
38
|
-
return String(s).replace(
|
|
38
|
+
return String(s).replace(
|
|
39
|
+
/[&<>"']/g,
|
|
40
|
+
(c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c] || c,
|
|
41
|
+
);
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
/**
|
|
@@ -71,12 +74,31 @@ function verdictOf(rows, support = []) {
|
|
|
71
74
|
const n = (o) => rows.filter((r) => r.outcome === o).length;
|
|
72
75
|
const [failed, flaky, skipped, passed] = [n('failed'), n('flaky'), n('skipped'), n('passed')];
|
|
73
76
|
const setup = support.find((r) => r.outcome === 'failed');
|
|
74
|
-
if (setup)
|
|
77
|
+
if (setup)
|
|
78
|
+
return {
|
|
79
|
+
mark: '❌',
|
|
80
|
+
label: 'Setup failed',
|
|
81
|
+
sentence: `${setup.title || 'The setup'} failed, so the tests that need it didn't run; ${passed} other tests passed.`,
|
|
82
|
+
tone: 'bad',
|
|
83
|
+
};
|
|
75
84
|
if (!rows.length) return { mark: '⚠️', label: 'Nothing ran', sentence: 'No tests matched this run.', tone: 'warn' };
|
|
76
|
-
if (failed)
|
|
85
|
+
if (failed)
|
|
86
|
+
return {
|
|
87
|
+
mark: '❌',
|
|
88
|
+
label: 'Failed',
|
|
89
|
+
sentence: `${failed} of ${rows.length} tests failed; ${passed} passed.`,
|
|
90
|
+
tone: 'bad',
|
|
91
|
+
};
|
|
77
92
|
if (flaky || skipped) {
|
|
78
|
-
const parts = [flaky && `${flaky} passed only on a retry`, skipped && `${skipped} skipped`]
|
|
79
|
-
|
|
93
|
+
const parts = [flaky && `${flaky} passed only on a retry`, skipped && `${skipped} skipped`]
|
|
94
|
+
.filter(Boolean)
|
|
95
|
+
.join(', ');
|
|
96
|
+
return {
|
|
97
|
+
mark: '⚠️',
|
|
98
|
+
label: 'Passed, with notes',
|
|
99
|
+
sentence: `${passed} of ${rows.length} tests passed; ${parts}.`,
|
|
100
|
+
tone: 'warn',
|
|
101
|
+
};
|
|
80
102
|
}
|
|
81
103
|
return { mark: '✅', label: 'All passed', sentence: `All ${rows.length} tests passed.`, tone: 'good' };
|
|
82
104
|
}
|
|
@@ -91,7 +113,9 @@ function renderSummary(run) {
|
|
|
91
113
|
const order = { failed: 0, flaky: 1, skipped: 2, passed: 3 };
|
|
92
114
|
const MARK = { passed: '✅', failed: '❌', flaky: '⚠️', skipped: '⏭' };
|
|
93
115
|
const groups = new Map();
|
|
94
|
-
for (const r of [...run.rows].sort(
|
|
116
|
+
for (const r of [...run.rows].sort(
|
|
117
|
+
(a, b) => order[a.outcome] - order[b.outcome] || a.id.localeCompare(b.id, 'en', { numeric: true }),
|
|
118
|
+
)) {
|
|
95
119
|
const key = r.story || r.file.split(':')[0];
|
|
96
120
|
if (!groups.has(key)) groups.set(key, []);
|
|
97
121
|
groups.get(key).push(r);
|
|
@@ -109,12 +133,17 @@ function renderSummary(run) {
|
|
|
109
133
|
<td class="num">${duration(r.durationMs)}${r.attempts > 1 ? ` <span class="muted">· ${r.attempts} tries</span>` : ''}</td>
|
|
110
134
|
</tr>`;
|
|
111
135
|
// Story cases first, then framework and unit checks (grouped by file).
|
|
112
|
-
const sections = [...groups]
|
|
136
|
+
const sections = [...groups]
|
|
137
|
+
.sort(([, a], [, b]) => Number(!a[0].story) - Number(!b[0].story))
|
|
138
|
+
.map(
|
|
139
|
+
([key, rows]) => `
|
|
113
140
|
<section>
|
|
114
141
|
<h2>${esc(key)} <span class="muted">${rows.filter((r) => r.outcome === 'passed').length}/${rows.length} passed</span></h2>
|
|
115
142
|
<div class="scroll"><table><thead><tr><th></th><th>Test</th><th>Project</th><th class="num">Time</th></tr></thead><tbody>${rows.map(row).join('')}
|
|
116
143
|
</tbody></table></div>
|
|
117
|
-
</section
|
|
144
|
+
</section>`,
|
|
145
|
+
)
|
|
146
|
+
.join('');
|
|
118
147
|
return `<!doctype html>
|
|
119
148
|
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
|
|
120
149
|
<title>Test run · ${esc(run.startedAt.toISOString().slice(0, 10))}</title>
|
|
@@ -196,20 +225,37 @@ class SummaryReporter {
|
|
|
196
225
|
const outcome = test.outcome();
|
|
197
226
|
const parts = parseTitle(test.title);
|
|
198
227
|
const failedRun = [...results].reverse().find((r) => r.status !== 'passed' && r.status !== 'skipped');
|
|
199
|
-
const message = failedRun && failedRun.error ?
|
|
200
|
-
const links =
|
|
201
|
-
|
|
202
|
-
|
|
228
|
+
const message = failedRun && failedRun.error ? failedRun.error.message || failedRun.error.value || '' : '';
|
|
229
|
+
const links =
|
|
230
|
+
outcome === 'unexpected' && failedRun
|
|
231
|
+
? failedRun.attachments
|
|
232
|
+
.filter((a) => a.path && /screenshot|trace/.test(a.name))
|
|
233
|
+
.map((a) => ({
|
|
234
|
+
name: a.name,
|
|
235
|
+
href: path
|
|
236
|
+
.relative(dir, /** @type {string} */ (a.path))
|
|
237
|
+
.split(path.sep)
|
|
238
|
+
.join('/'),
|
|
239
|
+
}))
|
|
240
|
+
: [];
|
|
203
241
|
return {
|
|
204
242
|
...parts,
|
|
205
243
|
acs: test.tags.filter((t) => /^@AC-/.test(t)).map((t) => t.slice(1)),
|
|
206
244
|
project: test.parent.project()?.name || '',
|
|
207
245
|
file: `${path.relative(paths.root, test.location.file).split(path.sep).join('/')}:${test.location.line}`,
|
|
208
|
-
outcome: /** @type {Row['outcome']} */ (
|
|
246
|
+
outcome: /** @type {Row['outcome']} */ (
|
|
247
|
+
{ expected: 'passed', unexpected: 'failed', flaky: 'flaky', skipped: 'skipped' }[outcome]
|
|
248
|
+
),
|
|
209
249
|
durationMs: last ? last.duration : 0,
|
|
210
250
|
attempts: results.length,
|
|
211
251
|
// eslint-disable-next-line no-control-regex
|
|
212
|
-
error:
|
|
252
|
+
error:
|
|
253
|
+
outcome === 'unexpected'
|
|
254
|
+
? redact(message.replace(/\u001b\[[0-9;]*m/g, ''))
|
|
255
|
+
.split('\n')
|
|
256
|
+
.slice(0, 12)
|
|
257
|
+
.join('\n')
|
|
258
|
+
: '',
|
|
213
259
|
links,
|
|
214
260
|
};
|
|
215
261
|
});
|
|
@@ -217,7 +263,17 @@ class SummaryReporter {
|
|
|
217
263
|
const support = all.filter((r) => SUPPORT_PROJECTS.has(r.project));
|
|
218
264
|
const projects = [...new Set(rows.map((r) => r.project))];
|
|
219
265
|
fs.mkdirSync(dir, { recursive: true });
|
|
220
|
-
fs.writeFileSync(
|
|
266
|
+
fs.writeFileSync(
|
|
267
|
+
this.outputFile,
|
|
268
|
+
renderSummary({
|
|
269
|
+
rows,
|
|
270
|
+
support,
|
|
271
|
+
startedAt: this.startedAt,
|
|
272
|
+
durationMs: full.duration,
|
|
273
|
+
baseUrl: this.baseUrl,
|
|
274
|
+
projects,
|
|
275
|
+
}),
|
|
276
|
+
);
|
|
221
277
|
// The same run as data, next to the page: every run (yours, CI's or an agent's) leaves results a script can read
|
|
222
278
|
// (Orion's results_parse.mjs), so nothing has to run again just to get a machine-readable report.
|
|
223
279
|
const data = {
|
|
@@ -227,8 +283,15 @@ class SummaryReporter {
|
|
|
227
283
|
// `all` was built from the same entries in the same order: match by position, since tests made in a loop share a line.
|
|
228
284
|
tests: [...this.results].map(([test, results], i) => {
|
|
229
285
|
const r = all[i];
|
|
230
|
-
return {
|
|
231
|
-
|
|
286
|
+
return {
|
|
287
|
+
title: test.title,
|
|
288
|
+
file: r ? r.file : '',
|
|
289
|
+
project: r ? r.project : '',
|
|
290
|
+
status: r ? r.outcome : 'failed',
|
|
291
|
+
duration_ms: r ? r.durationMs : 0,
|
|
292
|
+
attempts: results.length,
|
|
293
|
+
failure_sig: r && r.error ? r.error.split('\n')[0].slice(0, 200) : null,
|
|
294
|
+
};
|
|
232
295
|
}),
|
|
233
296
|
};
|
|
234
297
|
fs.writeFileSync(path.join(dir, 'results.json'), `${JSON.stringify(data, null, 2)}\n`);
|
|
@@ -8,21 +8,28 @@
|
|
|
8
8
|
/** @type {Record<string, import('../../utils/titles').TestDescription>} */
|
|
9
9
|
const SIGN_IN = {
|
|
10
10
|
'TS-0': {
|
|
11
|
-
id: 'TS-0',
|
|
11
|
+
id: 'TS-0',
|
|
12
|
+
ac: 'AC-0',
|
|
13
|
+
story: '{{STORY_KEY}}',
|
|
14
|
+
tags: ['@smoke'],
|
|
12
15
|
title: 'the test account signs in and the app greets the user',
|
|
13
16
|
preconditions: ['Signed in (the session the setup project saved)'],
|
|
14
17
|
steps: ['Open the home page'],
|
|
15
18
|
expected: 'The home page greets the user',
|
|
16
19
|
},
|
|
17
20
|
'TS-1': {
|
|
18
|
-
id: 'TS-1',
|
|
21
|
+
id: 'TS-1',
|
|
22
|
+
ac: 'AC-0',
|
|
23
|
+
story: '{{STORY_KEY}}',
|
|
19
24
|
title: 'a wrong password is refused with a message',
|
|
20
25
|
preconditions: ['Signed out'],
|
|
21
26
|
steps: ['Open the sign-in page', 'Enter the user name and a wrong password', 'Submit'],
|
|
22
27
|
expected: 'The form shows the wrong-password message',
|
|
23
28
|
},
|
|
24
29
|
'TS-2': {
|
|
25
|
-
id: 'TS-2',
|
|
30
|
+
id: 'TS-2',
|
|
31
|
+
ac: 'AC-0',
|
|
32
|
+
story: '{{STORY_KEY}}',
|
|
26
33
|
title: 'signing out returns to the sign-in page',
|
|
27
34
|
preconditions: ['Signed out (signs in on its own, so the shared session stays valid)'],
|
|
28
35
|
steps: ['Sign in', 'Open the account menu', 'Sign out'],
|
|
@@ -37,9 +37,16 @@ function installedChannel() {
|
|
|
37
37
|
const fs = require('node:fs');
|
|
38
38
|
const path = require('node:path');
|
|
39
39
|
/** Whether a file or folder exists. */
|
|
40
|
-
const exists = (p) => {
|
|
40
|
+
const exists = (p) => {
|
|
41
|
+
try {
|
|
42
|
+
return fs.statSync(p).isFile() || fs.statSync(p).isDirectory();
|
|
43
|
+
} catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
41
47
|
/** Whether one of the commands is on the PATH. */
|
|
42
|
-
const onPath = (names) =>
|
|
48
|
+
const onPath = (names) =>
|
|
49
|
+
(process.env.PATH || '').split(path.delimiter).some((d) => names.some((n) => exists(path.join(d, n))));
|
|
43
50
|
if (process.platform === 'win32') {
|
|
44
51
|
const roots = ['ProgramFiles', 'ProgramFiles(x86)', 'LOCALAPPDATA'].map((v) => process.env[v]).filter(Boolean);
|
|
45
52
|
if (roots.some((r) => exists(path.join(r, 'Google', 'Chrome', 'Application', 'chrome.exe')))) return 'chrome';
|
|
@@ -51,7 +58,9 @@ function installedChannel() {
|
|
|
51
58
|
return exists('/Applications/Microsoft Edge.app') ? 'msedge' : undefined;
|
|
52
59
|
}
|
|
53
60
|
if (exists('/opt/google/chrome/chrome') || onPath(['google-chrome', 'google-chrome-stable'])) return 'chrome';
|
|
54
|
-
return exists('/opt/microsoft/msedge/msedge') || onPath(['microsoft-edge', 'microsoft-edge-stable'])
|
|
61
|
+
return exists('/opt/microsoft/msedge/msedge') || onPath(['microsoft-edge', 'microsoft-edge-stable'])
|
|
62
|
+
? 'msedge'
|
|
63
|
+
: undefined;
|
|
55
64
|
}
|
|
56
65
|
|
|
57
66
|
const env = {
|