mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-16 07:45:17 +03:00
feat(web-test): test CLI принимает несколько путей + флаг --url, fail-fast валидация
Привод контракта `run.mjs test` к общей практике (pytest/jest/playwright): - позиционные аргументы = пути к тестам, можно несколько (`test a.test.mjs b.test.mjs dir/`); discoverTests объединяет, дедуплицирует, сортирует (порядок по числовым префиксам сохраняется); - URL переехал из первого позиционного во флаг --url= (по умолчанию из webtest.config.mjs) — раньше url-первым путал: второй путь уходил в page.goto() и падал с криптовым 'Cannot navigate to invalid URL'; - fail-fast: несуществующий путь → понятная ошибка вместо падения goto; аргумент, похожий на URL, подсказывает про --url=. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// web-test cli/util v1.1 — generic helpers for CLI commands
|
||||
// web-test cli/util v1.2 — generic helpers for CLI commands
|
||||
// Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
|
||||
export function out(obj) {
|
||||
@@ -85,7 +85,7 @@ Commands:
|
||||
shot [file] Take screenshot (default: shot.png)
|
||||
stop Logout and close browser
|
||||
status Check session status
|
||||
test [url] <dir|file> Run regression tests (*.test.mjs)
|
||||
test <dir|file>... Run regression tests (*.test.mjs); accepts multiple paths
|
||||
|
||||
Options for exec:
|
||||
--no-record Skip video recording (record() becomes no-op)
|
||||
@@ -95,6 +95,7 @@ Global options (any command):
|
||||
Default: on (env: WEB_TEST_PRESERVE_CLIPBOARD=0 to disable globally).
|
||||
|
||||
Options for test:
|
||||
--url=URL Override the base URL (default: from webtest.config.mjs)
|
||||
--tags=smoke,crud Filter tests by tags
|
||||
--grep=pattern Filter tests by name (regex)
|
||||
--bail Stop on first failure
|
||||
|
||||
Reference in New Issue
Block a user