@orion-qa/orion 3.0.0 → 3.1.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/agents/codebase-analyst.md +1 -1
- package/.claude/settings.json +9 -0
- package/.claude/skills/appium/SKILL.md +1 -1
- package/.claude/skills/appium/templates/README.md +6 -9
- package/.claude/skills/appium/templates/ci/github-actions-android.yml +8 -2
- package/.claude/skills/appium/templates/ci/github-actions-ios.yml +8 -2
- package/.claude/skills/appium/templates/ci/github-actions-windows.yml +9 -2
- package/.claude/skills/appium/templates/project-java/.env.example +4 -0
- package/.claude/skills/appium/templates/project-java/pom.xml +2 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework/Config.java → config/Env.java} +43 -52
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/config/Flags.java +45 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/config/Paths.java +14 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/desc/SignInDesc.java +30 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework → driver}/DriverFactory.java +19 -13
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework → driver}/DriverManager.java +12 -9
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/fixtures/BaseTest.java +75 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/{screens → pageObjects}/BaseScreen.java +12 -12
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/HomeScreen.java +26 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/LoginScreen.java +63 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/ShellScreen.java +26 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/setup/AuthSetup.java +49 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/testData/TestData.java +78 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/ui/SignInTest.java +45 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/unit/UtilsTest.java +34 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework → utils}/AutomationError.java +4 -4
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Case.java +20 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/CaseTransformer.java +54 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Dates.java +42 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Log.java +45 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/MissingSettingError.java +13 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/RandomData.java +41 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Redact.java +33 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/TestDescription.java +25 -0
- package/.claude/skills/appium/templates/project-java/src/test/resources/testData/testData.properties +7 -0
- package/.claude/skills/appium/templates/project-java/testng.xml +11 -4
- package/.claude/skills/architecture-analysis/SKILL.md +2 -1
- package/.claude/skills/automation-implementation/SKILL.md +2 -1
- package/.claude/skills/automation-implementation/references/patterns.md +46 -24
- package/.claude/skills/code-review/SKILL.md +3 -2
- package/.claude/skills/code-review/references/pattern-rules.md +12 -7
- package/.claude/skills/documentation/SKILL.md +23 -18
- package/.claude/skills/execution/SKILL.md +6 -3
- package/.claude/skills/httpclient/templates/README.md +6 -7
- package/.claude/skills/httpclient/templates/csharp-nunit/.env.example +4 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Automation.csproj +7 -3
- package/.claude/skills/httpclient/templates/csharp-nunit/Config/Env.cs +62 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Config/Flags.cs +35 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Config/Paths.cs +22 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Fixtures/BaseTest.cs +22 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Resources/Desc/ProductsDesc.cs +22 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Resources/TestData/TestData.cs +61 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Resources/TestData/testData.json +9 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Services/ApiClient.cs +48 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Services/HealthApi.cs +11 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/{Api → Services}/ProductsApi.cs +8 -5
- package/.claude/skills/httpclient/templates/csharp-nunit/Tests/Api/ProductsTests.cs +61 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Tests/Unit/UtilsTests.cs +40 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Utils/AutomationError.cs +15 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Utils/Dates.cs +18 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Utils/Log.cs +37 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Utils/RandomData.cs +26 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Utils/Redact.cs +22 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Utils/TestDescription.cs +55 -0
- package/.claude/skills/javascript/references/sources.md +1 -1
- package/.claude/skills/k6/SKILL.md +1 -1
- package/.claude/skills/k6/templates/README.md +5 -3
- package/.claude/skills/k6/templates/project/{data/cases.js → resources/desc/products.desc.js} +1 -1
- package/.claude/skills/k6/templates/project/resources/testData/testData.js +32 -0
- package/.claude/skills/k6/templates/project/{lib/config.js → src/config/env.js} +10 -5
- package/.claude/skills/k6/templates/project/{lib → src/services}/products-api.js +7 -5
- package/.claude/skills/k6/templates/project/{load → tests/load}/products.js +8 -8
- package/.claude/skills/karate/templates/README.md +4 -5
- package/.claude/skills/karate/templates/java-junit5/.env.example +2 -0
- package/.claude/skills/karate/templates/java-junit5/pom.xml +4 -0
- package/.claude/skills/karate/templates/java-junit5/src/test/java/{support → config}/EnvSettings.java +1 -1
- package/.claude/skills/karate/templates/java-junit5/src/test/java/karate-config.js +13 -6
- package/.claude/skills/karate/templates/java-junit5/src/test/java/logback-test.xml +1 -1
- package/.claude/skills/karate/templates/java-junit5/src/test/java/{api → tests}/ApiTest.java +7 -4
- package/.claude/skills/karate/templates/java-junit5/src/test/java/{api → tests/api}/health.feature +3 -3
- package/.claude/skills/karate/templates/java-junit5/src/test/java/tests/api/products.feature +29 -0
- package/.claude/skills/karate/templates/java-junit5/src/test/java/{support → utils}/MaskingLogModifier.java +1 -1
- package/.claude/skills/karate/templates/java-junit5/src/test/resources/testData/newProduct.js +7 -0
- package/.claude/skills/karate/templates/java-junit5/src/test/resources/testData/testData.json +6 -0
- package/.claude/skills/newman/templates/README.md +4 -5
- package/.claude/skills/newman/templates/collection/.env.example +2 -0
- package/.claude/skills/newman/templates/collection/collections/api.postman_collection.json +165 -145
- package/.claude/skills/newman/templates/collection/package.json +2 -1
- package/.claude/skills/newman/templates/collection/resources/desc/products.desc.json +53 -0
- package/.claude/skills/newman/templates/collection/resources/testData/testData.json +10 -0
- package/.claude/skills/newman/templates/collection/run.js +41 -31
- package/.claude/skills/newman/templates/collection/src/config/env.js +37 -0
- package/.claude/skills/orion/SKILL.md +9 -7
- package/.claude/skills/orion/references/assess-fix.md +34 -0
- package/.claude/skills/orion/references/capabilities.md +1 -1
- package/.claude/skills/orion/references/conversation.md +9 -8
- package/.claude/skills/orion/references/delivery-formats.md +1 -1
- package/.claude/skills/orion/references/modes.md +3 -1
- package/.claude/skills/orion/references/project-context-files.md +6 -1
- package/.claude/skills/orion/references/setup-card.md +12 -6
- package/.claude/skills/orion/references/status-lines.md +6 -2
- package/.claude/skills/orion/references/task-brief.md +1 -0
- package/.claude/skills/orion/references/work-branch.md +3 -1
- package/.claude/skills/orion/scripts/browser_setup.mjs +30 -15
- package/.claude/skills/orion/scripts/env_check.mjs +8 -3
- package/.claude/skills/orion/scripts/env_check.py +12 -5
- package/.claude/skills/orion/scripts/fix_plan.mjs +149 -0
- package/.claude/skills/orion/scripts/graph.mjs +400 -0
- package/.claude/skills/orion/scripts/lib/inside.mjs +31 -0
- package/.claude/skills/orion/scripts/lib/scan.mjs +357 -0
- package/.claude/skills/orion/scripts/parity_check.mjs +166 -0
- package/.claude/skills/orion/scripts/report_check.mjs +77 -0
- package/.claude/skills/orion/scripts/results_parse.mjs +203 -0
- package/.claude/skills/orion/scripts/reuse_check.mjs +251 -0
- package/.claude/skills/orion/scripts/run_state.mjs +171 -0
- package/.claude/skills/orion/scripts/suite_check.mjs +228 -0
- package/.claude/skills/orion/scripts/timing_profile.mjs +128 -0
- package/.claude/skills/orion/scripts/usage_report.mjs +315 -0
- package/.claude/skills/orion/templates/project-context/assessment.md +45 -0
- package/.claude/skills/orion/templates/project-context/defects.md +5 -0
- package/.claude/skills/orion/templates/project-context/report.md +45 -0
- package/.claude/skills/orion/templates/project-context/run.md +4 -1
- package/.claude/skills/orion/templates/project-context/test-case-map.md +5 -0
- package/.claude/skills/orion/templates/project-context/test-design.md +18 -0
- package/.claude/skills/pact/SKILL.md +2 -2
- package/.claude/skills/pact/templates/README.md +4 -2
- package/.claude/skills/pact/templates/project/package.json +2 -2
- package/.claude/skills/pact/templates/project/{data/cases.js → resources/desc/products.desc.js} +3 -3
- package/.claude/skills/pact/templates/project/resources/testData/testData.js +21 -0
- package/.claude/skills/pact/templates/project/src/config/env.js +32 -0
- package/.claude/skills/pact/templates/project/src/{products-client.js → services/products-client.js} +4 -2
- package/.claude/skills/pact/templates/project/tests/contract/products.contract.test.js +46 -0
- package/.claude/skills/pact/templates/project/{verify → tests/verify}/products.verify.js +7 -22
- package/.claude/skills/playwright/SKILL.md +6 -6
- package/.claude/skills/playwright/templates/README.md +29 -10
- package/.claude/skills/playwright/templates/ci/Jenkinsfile +1 -1
- package/.claude/skills/playwright/templates/ci/azure-pipelines.yml +1 -1
- package/.claude/skills/playwright/templates/ci/github-actions-javascript.yml +1 -1
- package/.claude/skills/playwright/templates/ci/github-actions.yml +1 -1
- package/.claude/skills/playwright/templates/ci/gitlab-ci.yml +1 -1
- package/.claude/skills/playwright/templates/dotnet/.env.example +7 -0
- package/.claude/skills/playwright/templates/dotnet/.runsettings +17 -0
- package/.claude/skills/playwright/templates/dotnet/Automation.csproj +8 -0
- package/.claude/skills/playwright/templates/dotnet/Config/Env.cs +89 -0
- package/.claude/skills/playwright/templates/dotnet/Config/Flags.cs +56 -0
- package/.claude/skills/playwright/templates/dotnet/Config/Paths.cs +31 -0
- package/.claude/skills/playwright/templates/dotnet/Fixtures/ApiBaseTest.cs +39 -0
- package/.claude/skills/playwright/templates/dotnet/Fixtures/BaseTest.cs +72 -0
- package/.claude/skills/playwright/templates/dotnet/PageObjects/BasePage.cs +59 -0
- package/.claude/skills/playwright/templates/dotnet/PageObjects/HomePage.cs +21 -0
- package/.claude/skills/playwright/templates/dotnet/PageObjects/LoginPage.cs +54 -0
- package/.claude/skills/playwright/templates/dotnet/PageObjects/ShellPage.cs +29 -0
- package/.claude/skills/playwright/templates/dotnet/Resources/Desc/SignInDesc.cs +23 -0
- package/.claude/skills/playwright/templates/dotnet/Resources/TestData/TestData.cs +74 -0
- package/.claude/skills/playwright/templates/dotnet/Resources/TestData/testData.json +19 -0
- package/.claude/skills/playwright/templates/dotnet/Services/ApiClient.cs +51 -0
- package/.claude/skills/playwright/templates/dotnet/Setup/AuthSetup.cs +63 -0
- package/.claude/skills/playwright/templates/dotnet/Tests/Api/SessionTests.cs +18 -0
- package/.claude/skills/playwright/templates/dotnet/Tests/Ui/SignInTests.cs +48 -0
- package/.claude/skills/playwright/templates/dotnet/Tests/Unit/UtilsTests.cs +40 -0
- package/.claude/skills/playwright/templates/dotnet/Utils/AutomationError.cs +15 -0
- package/.claude/skills/playwright/templates/dotnet/Utils/Dates.cs +18 -0
- package/.claude/skills/playwright/templates/dotnet/Utils/Log.cs +37 -0
- package/.claude/skills/playwright/templates/dotnet/Utils/RandomData.cs +26 -0
- package/.claude/skills/playwright/templates/dotnet/Utils/Redact.cs +22 -0
- package/.claude/skills/playwright/templates/dotnet/Utils/TestDescription.cs +55 -0
- package/.claude/skills/playwright/templates/dotnet/gitignore +6 -1
- package/.claude/skills/playwright/templates/javascript/.env.example +8 -0
- package/.claude/skills/playwright/templates/javascript/fixtures/index.js +83 -0
- package/.claude/skills/playwright/templates/javascript/fixtures/session.js +79 -0
- package/.claude/skills/playwright/templates/javascript/gitignore +7 -0
- package/.claude/skills/playwright/templates/javascript/jsconfig.json +11 -0
- package/.claude/skills/playwright/templates/javascript/package.json +7 -3
- package/.claude/skills/playwright/templates/javascript/pageObjects/basePage.js +58 -0
- package/.claude/skills/playwright/templates/javascript/pageObjects/homePage.js +19 -0
- package/.claude/skills/playwright/templates/javascript/pageObjects/loginPage.js +44 -0
- package/.claude/skills/playwright/templates/javascript/pageObjects/shellPage.js +26 -0
- package/.claude/skills/playwright/templates/javascript/playwright.config.js +42 -24
- package/.claude/skills/playwright/templates/javascript/reporters/summaryReporter.js +233 -0
- package/.claude/skills/playwright/templates/javascript/resources/desc/signIn.desc.js +33 -0
- package/.claude/skills/playwright/templates/javascript/resources/testData/testData.js +45 -0
- package/.claude/skills/playwright/templates/javascript/setup/auth.setup.js +17 -0
- package/.claude/skills/playwright/templates/javascript/setup/auth.teardown.js +16 -0
- package/.claude/skills/playwright/templates/javascript/src/config/env.js +79 -0
- package/.claude/skills/playwright/templates/javascript/src/config/flags.js +70 -0
- package/.claude/skills/playwright/templates/javascript/src/config/loadEnv.js +21 -0
- package/.claude/skills/playwright/templates/javascript/src/config/paths.js +22 -0
- package/.claude/skills/playwright/templates/javascript/src/services/apiClient.js +68 -0
- package/.claude/skills/playwright/templates/javascript/tests/api/session.spec.js +15 -0
- package/.claude/skills/playwright/templates/javascript/tests/ui/signIn.spec.js +35 -0
- package/.claude/skills/playwright/templates/javascript/tests/unit/summaryReporter.test.js +34 -0
- package/.claude/skills/playwright/templates/javascript/tests/unit/utils.test.js +31 -0
- package/.claude/skills/playwright/templates/javascript/utils/date.js +28 -0
- package/.claude/skills/playwright/templates/javascript/{src → utils}/errors.js +1 -0
- package/.claude/skills/playwright/templates/javascript/utils/formFill.js +29 -0
- package/.claude/skills/playwright/templates/javascript/utils/logger.js +33 -0
- package/.claude/skills/playwright/templates/javascript/utils/random.js +37 -0
- package/.claude/skills/playwright/templates/javascript/utils/redact.js +35 -0
- package/.claude/skills/playwright/templates/javascript/utils/titles.js +38 -0
- package/.claude/skills/playwright/templates/project/.env.example +8 -0
- package/.claude/skills/playwright/templates/project/fixtures/index.ts +84 -0
- package/.claude/skills/playwright/templates/project/fixtures/session.ts +76 -0
- package/.claude/skills/playwright/templates/project/gitignore +9 -2
- package/.claude/skills/playwright/templates/project/package.json +8 -6
- package/.claude/skills/playwright/templates/project/pageObjects/basePage.ts +53 -0
- package/.claude/skills/playwright/templates/project/pageObjects/homePage.ts +20 -0
- package/.claude/skills/playwright/templates/project/pageObjects/loginPage.ts +47 -0
- package/.claude/skills/playwright/templates/project/pageObjects/shellPage.ts +22 -0
- package/.claude/skills/playwright/templates/project/playwright.config.ts +46 -23
- package/.claude/skills/playwright/templates/project/reporters/summaryReporter.ts +241 -0
- package/.claude/skills/playwright/templates/project/resources/desc/signIn.desc.ts +32 -0
- package/.claude/skills/playwright/templates/project/resources/testData/testData.ts +42 -0
- package/.claude/skills/playwright/templates/project/setup/auth.setup.ts +16 -0
- package/.claude/skills/playwright/templates/project/setup/auth.teardown.ts +15 -0
- package/.claude/skills/playwright/templates/project/src/config/env.ts +81 -0
- package/.claude/skills/playwright/templates/project/src/config/flags.ts +70 -0
- package/.claude/skills/playwright/templates/project/src/config/loadEnv.ts +17 -0
- package/.claude/skills/playwright/templates/project/src/config/paths.ts +19 -0
- package/.claude/skills/playwright/templates/project/src/services/apiClient.ts +70 -0
- package/.claude/skills/playwright/templates/project/tests/api/session.spec.ts +14 -0
- package/.claude/skills/playwright/templates/project/tests/ui/signIn.spec.ts +34 -0
- package/.claude/skills/playwright/templates/project/tests/unit/summaryReporter.test.ts +33 -0
- package/.claude/skills/playwright/templates/project/tests/unit/utils.test.ts +30 -0
- package/.claude/skills/playwright/templates/project/tsconfig.json +3 -8
- package/.claude/skills/playwright/templates/project/utils/date.ts +25 -0
- package/.claude/skills/playwright/templates/project/utils/formFill.ts +27 -0
- package/.claude/skills/playwright/templates/project/utils/logger.ts +32 -0
- package/.claude/skills/playwright/templates/project/utils/random.ts +34 -0
- package/.claude/skills/playwright/templates/project/utils/redact.ts +32 -0
- package/.claude/skills/playwright/templates/project/utils/titles.ts +42 -0
- package/.claude/skills/playwright/templates/python/.env.example +8 -0
- package/.claude/skills/playwright/templates/python/conftest.py +91 -16
- package/.claude/skills/playwright/templates/python/gitignore +5 -0
- package/.claude/skills/playwright/templates/python/page_objects/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/page_objects/base_page.py +54 -0
- package/.claude/skills/playwright/templates/python/page_objects/home_page.py +22 -0
- package/.claude/skills/playwright/templates/python/page_objects/login_page.py +42 -0
- package/.claude/skills/playwright/templates/python/page_objects/shell_page.py +21 -0
- package/.claude/skills/playwright/templates/python/pytest.ini +5 -2
- package/.claude/skills/playwright/templates/python/requirements.txt +1 -0
- package/.claude/skills/playwright/templates/python/resources/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/resources/desc/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/resources/desc/sign_in_desc.py +27 -0
- package/.claude/skills/playwright/templates/python/resources/test_data/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/resources/test_data/test_data.py +41 -0
- package/.claude/skills/playwright/templates/python/setup/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/setup/auth.py +53 -0
- package/.claude/skills/playwright/templates/python/src/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/src/config/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/{framework/config.py → src/config/env.py} +24 -33
- package/.claude/skills/playwright/templates/python/src/config/flags.py +63 -0
- package/.claude/skills/playwright/templates/python/src/config/load_env.py +16 -0
- package/.claude/skills/playwright/templates/python/src/config/paths.py +25 -0
- package/.claude/skills/playwright/templates/python/src/services/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/src/services/api_client.py +60 -0
- package/.claude/skills/playwright/templates/python/tests/api/test_session.py +14 -0
- package/.claude/skills/playwright/templates/python/tests/ui/test_sign_in.py +36 -0
- package/.claude/skills/playwright/templates/python/tests/unit/test_utils.py +32 -0
- package/.claude/skills/playwright/templates/python/utils/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/utils/dates.py +23 -0
- package/.claude/skills/playwright/templates/python/{framework → utils}/errors.py +3 -2
- package/.claude/skills/playwright/templates/python/utils/form_fill.py +26 -0
- package/.claude/skills/playwright/templates/python/utils/logger.py +40 -0
- package/.claude/skills/playwright/templates/python/utils/markers.py +6 -0
- package/.claude/skills/playwright/templates/python/utils/random_data.py +35 -0
- package/.claude/skills/playwright/templates/python/utils/redact.py +30 -0
- package/.claude/skills/playwright/templates/python/utils/titles.py +53 -0
- package/.claude/skills/quality-checks/SKILL.md +11 -11
- package/.claude/skills/quality-checks/templates/README.md +14 -12
- package/.claude/skills/quality-checks/templates/playwright-js/pageObjects/scannedPage.js +21 -0
- package/.claude/skills/quality-checks/templates/playwright-js/resources/desc/quality.desc.js +63 -0
- package/.claude/skills/quality-checks/templates/playwright-js/resources/testData/qualityData.js +32 -0
- package/.claude/skills/quality-checks/templates/playwright-js/src/checks/accessibility.js +50 -0
- package/.claude/skills/quality-checks/templates/playwright-js/src/checks/pageHealth.js +38 -0
- package/.claude/skills/quality-checks/templates/playwright-js/src/checks/performance.js +21 -0
- package/.claude/skills/quality-checks/templates/playwright-js/src/services/graphqlClient.js +28 -0
- package/.claude/skills/quality-checks/templates/playwright-js/tests/api/graphql.spec.js +23 -0
- package/.claude/skills/quality-checks/templates/playwright-js/tests/ui/quality.spec.js +50 -0
- package/.claude/skills/quality-checks/templates/playwright-ts/pageObjects/scannedPage.ts +20 -0
- package/.claude/skills/quality-checks/templates/playwright-ts/resources/desc/quality.desc.ts +59 -0
- package/.claude/skills/quality-checks/templates/playwright-ts/{src/data/quality.data.ts → resources/testData/qualityData.ts} +3 -2
- package/.claude/skills/quality-checks/templates/playwright-ts/tests/api/graphql.spec.ts +22 -0
- package/.claude/skills/quality-checks/templates/playwright-ts/tests/ui/quality.spec.ts +49 -0
- package/.claude/skills/requests/templates/README.md +6 -7
- package/.claude/skills/requests/templates/python-pytest/.env.example +4 -0
- package/.claude/skills/requests/templates/python-pytest/conftest.py +24 -9
- package/.claude/skills/requests/templates/python-pytest/pytest.ini +6 -3
- package/.claude/skills/requests/templates/python-pytest/requirements.txt +1 -0
- package/.claude/skills/requests/templates/python-pytest/resources/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/resources/desc/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/resources/desc/products_desc.py +27 -0
- package/.claude/skills/requests/templates/python-pytest/resources/test_data/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/resources/test_data/test_data.py +27 -0
- package/.claude/skills/requests/templates/python-pytest/src/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/src/config/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/src/config/env.py +39 -0
- package/.claude/skills/requests/templates/python-pytest/src/config/flags.py +35 -0
- package/.claude/skills/requests/templates/python-pytest/src/config/load_env.py +16 -0
- package/.claude/skills/requests/templates/python-pytest/src/config/paths.py +16 -0
- package/.claude/skills/requests/templates/python-pytest/src/services/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/{api/client.py → src/services/api_client.py} +19 -10
- package/.claude/skills/requests/templates/python-pytest/{api → src/services}/products_api.py +3 -9
- package/.claude/skills/requests/templates/python-pytest/tests/api/test_products.py +35 -0
- package/.claude/skills/requests/templates/python-pytest/tests/unit/test_utils.py +32 -0
- package/.claude/skills/requests/templates/python-pytest/utils/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/utils/dates.py +23 -0
- package/.claude/skills/{selenium/templates/python-pytest/framework → requests/templates/python-pytest/utils}/errors.py +4 -3
- package/.claude/skills/requests/templates/python-pytest/utils/logger.py +40 -0
- package/.claude/skills/requests/templates/python-pytest/utils/random_data.py +35 -0
- package/.claude/skills/requests/templates/python-pytest/utils/redact.py +30 -0
- package/.claude/skills/requests/templates/python-pytest/utils/titles.py +53 -0
- package/.claude/skills/requirement-analysis/SKILL.md +1 -1
- package/.claude/skills/rest-assured/SKILL.md +1 -1
- package/.claude/skills/rest-assured/templates/README.md +6 -7
- package/.claude/skills/rest-assured/templates/ci/github-actions.yml +5 -2
- package/.claude/skills/rest-assured/templates/java-testng/.env.example +3 -0
- package/.claude/skills/rest-assured/templates/java-testng/pom.xml +7 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/{api/ApiConfig.java → config/Env.java} +35 -22
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/config/Flags.java +17 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/config/Paths.java +14 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/desc/ProductsDesc.java +26 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/fixtures/BaseTest.java +29 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/services/ApiSpec.java +31 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/services/HealthApi.java +17 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/{api → services}/ProductsApi.java +19 -14
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/{data → testData}/ProductBuilder.java +4 -8
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/testData/TestData.java +64 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/api/ProductsTest.java +49 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/unit/UtilsTest.java +34 -0
- package/.claude/skills/{selenium/templates/java-testng/src/test/java/automation/framework → rest-assured/templates/java-testng/src/test/java/automation/utils}/AutomationError.java +4 -4
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Case.java +20 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/CaseTransformer.java +54 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Dates.java +42 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Log.java +45 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/MissingSettingError.java +13 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/RandomData.java +41 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Redact.java +33 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/TestDescription.java +25 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/resources/testData/testData.properties +14 -0
- package/.claude/skills/rest-assured/templates/java-testng/testng.xml +14 -0
- package/.claude/skills/selenium/SKILL.md +1 -1
- package/.claude/skills/selenium/templates/README.md +25 -13
- package/.claude/skills/selenium/templates/ci/github-actions-java.yml +5 -2
- package/.claude/skills/selenium/templates/csharp-nunit/.env.example +15 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Automation.csproj +7 -0
- package/.claude/skills/selenium/templates/csharp-nunit/{Framework/Config.cs → Config/Env.cs} +33 -34
- package/.claude/skills/selenium/templates/csharp-nunit/Config/Flags.cs +39 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Config/Paths.cs +31 -0
- package/.claude/skills/selenium/templates/csharp-nunit/{Framework → Driver}/DriverFactory.cs +16 -13
- package/.claude/skills/selenium/templates/csharp-nunit/Driver/DriverManager.cs +27 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Fixtures/BaseTest.cs +56 -0
- package/.claude/skills/selenium/templates/csharp-nunit/{Pages → PageObjects}/BasePage.cs +40 -14
- package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/HomePage.cs +21 -0
- package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/LoginPage.cs +53 -0
- package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/ShellPage.cs +22 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Resources/Desc/SignInDesc.cs +23 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Resources/TestData/TestData.cs +74 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Resources/TestData/testData.json +14 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Services/ApiClient.cs +71 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Setup/AuthSetup.cs +104 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Tests/Api/SessionTests.cs +23 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Tests/Ui/SignInTests.cs +42 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Tests/Unit/UtilsTests.cs +40 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/AutomationError.cs +15 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/Dates.cs +18 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/FormFill.cs +20 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/Log.cs +37 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/RandomData.cs +26 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/Redact.cs +22 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/TestDescription.cs +55 -0
- package/.claude/skills/selenium/templates/csharp-nunit/gitignore +6 -2
- package/.claude/skills/selenium/templates/java-testng/.env.example +12 -0
- package/.claude/skills/selenium/templates/java-testng/gitignore +5 -2
- package/.claude/skills/selenium/templates/java-testng/pom.xml +2 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{framework/Config.java → config/Env.java} +45 -55
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/config/Flags.java +50 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/config/Paths.java +20 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/desc/SignInDesc.java +30 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{framework → driver}/DriverFactory.java +15 -12
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{framework → driver}/DriverManager.java +4 -7
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/fixtures/BaseTest.java +87 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{pages → pageObjects}/BasePage.java +38 -17
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/HomePage.java +32 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/LoginPage.java +69 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/ShellPage.java +34 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/services/ApiClient.java +93 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/setup/AuthSetup.java +125 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/testData/TestData.java +88 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/api/SessionTest.java +23 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/ui/SignInTest.java +46 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/unit/UtilsTest.java +34 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/AutomationError.java +18 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Case.java +20 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/CaseTransformer.java +54 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Dates.java +42 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/FormFill.java +25 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Log.java +45 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/MissingSettingError.java +13 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/RandomData.java +41 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Redact.java +33 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/TestDescription.java +25 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/resources/testData/testData.properties +11 -0
- package/.claude/skills/selenium/templates/java-testng/testng.xml +15 -5
- package/.claude/skills/selenium/templates/python-pytest/.env.example +12 -0
- package/.claude/skills/selenium/templates/python-pytest/conftest.py +63 -12
- package/.claude/skills/selenium/templates/python-pytest/gitignore +7 -2
- package/.claude/skills/selenium/templates/python-pytest/page_objects/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/{pages → page_objects}/base_page.py +17 -20
- package/.claude/skills/selenium/templates/python-pytest/page_objects/home_page.py +17 -0
- package/.claude/skills/selenium/templates/python-pytest/{pages → page_objects}/login_page.py +12 -14
- package/.claude/skills/selenium/templates/python-pytest/page_objects/shell_page.py +16 -0
- package/.claude/skills/selenium/templates/python-pytest/pytest.ini +6 -2
- package/.claude/skills/selenium/templates/python-pytest/requirements.txt +1 -0
- package/.claude/skills/selenium/templates/python-pytest/resources/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/resources/desc/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/resources/desc/sign_in_desc.py +27 -0
- package/.claude/skills/selenium/templates/python-pytest/resources/test_data/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/resources/test_data/test_data.py +25 -0
- package/.claude/skills/selenium/templates/python-pytest/setup/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/setup/auth.py +60 -0
- package/.claude/skills/selenium/templates/python-pytest/src/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/src/config/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/src/config/env.py +68 -0
- package/.claude/skills/selenium/templates/python-pytest/src/config/flags.py +40 -0
- package/.claude/skills/selenium/templates/python-pytest/src/config/load_env.py +16 -0
- package/.claude/skills/selenium/templates/python-pytest/src/config/paths.py +25 -0
- package/.claude/skills/selenium/templates/python-pytest/src/driver/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/{framework → src/driver}/driver_factory.py +11 -18
- package/.claude/skills/selenium/templates/python-pytest/{framework → src/driver}/driver_manager.py +3 -3
- package/.claude/skills/selenium/templates/python-pytest/src/services/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/src/services/api_client.py +89 -0
- package/.claude/skills/selenium/templates/python-pytest/tests/api/test_session.py +11 -0
- package/.claude/skills/selenium/templates/python-pytest/tests/ui/test_sign_in.py +34 -0
- package/.claude/skills/selenium/templates/python-pytest/tests/unit/test_utils.py +32 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/dates.py +23 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/errors.py +28 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/form_fill.py +29 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/logger.py +40 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/markers.py +6 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/random_data.py +35 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/redact.py +30 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/titles.py +53 -0
- package/.claude/skills/self-healing/SKILL.md +1 -1
- package/.claude/skills/test-design/SKILL.md +1 -1
- package/.claude/skills/ui-observation/SKILL.md +7 -6
- package/.claude/skills/ui-observation/references/login-methods.md +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.cursor/commands/orion.md +1 -1
- package/.gemini/commands/orion.toml +2 -2
- package/.github/prompts/orion.prompt.md +2 -2
- package/.windsurf/workflows/orion.md +2 -2
- package/AGENTS.md +1 -1
- package/README.md +23 -3
- package/assets/architecture.svg +104 -0
- package/hosts/gemini-extension/gemini-extension.json +1 -1
- package/package.json +2 -1
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/data/Cases.java +0 -37
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/data/SignInData.java +0 -25
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/flows/SignInFlow.java +0 -34
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/framework/Account.java +0 -19
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/screens/HomeScreen.java +0 -36
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/screens/LoginScreen.java +0 -57
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/BaseTest.java +0 -33
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/SmokeTest.java +0 -17
- package/.claude/skills/httpclient/templates/csharp-nunit/Api/ApiClient.cs +0 -61
- package/.claude/skills/httpclient/templates/csharp-nunit/Api/ApiConfig.cs +0 -61
- package/.claude/skills/httpclient/templates/csharp-nunit/Api/ApiError.cs +0 -17
- package/.claude/skills/httpclient/templates/csharp-nunit/Data/Cases.cs +0 -41
- package/.claude/skills/httpclient/templates/csharp-nunit/Data/HealthData.cs +0 -11
- package/.claude/skills/httpclient/templates/csharp-nunit/Data/ProductBuilder.cs +0 -16
- package/.claude/skills/httpclient/templates/csharp-nunit/Data/ProductsData.cs +0 -17
- package/.claude/skills/httpclient/templates/csharp-nunit/Tests/HealthTests.cs +0 -18
- package/.claude/skills/httpclient/templates/csharp-nunit/Tests/ProductsTests.cs +0 -48
- package/.claude/skills/k6/templates/project/data/builders.js +0 -8
- package/.claude/skills/karate/templates/java-junit5/src/test/java/api/products.feature +0 -33
- package/.claude/skills/pact/templates/project/test/contract/products.contract.test.js +0 -45
- package/.claude/skills/playwright/templates/dotnet/Components/AccountMenu.cs +0 -23
- package/.claude/skills/playwright/templates/dotnet/Data/Cases.cs +0 -43
- package/.claude/skills/playwright/templates/dotnet/Data/SignInData.cs +0 -24
- package/.claude/skills/playwright/templates/dotnet/Flows/SignInFlow.cs +0 -51
- package/.claude/skills/playwright/templates/dotnet/Framework/AutomationError.cs +0 -17
- package/.claude/skills/playwright/templates/dotnet/Framework/Config.cs +0 -91
- package/.claude/skills/playwright/templates/dotnet/Pages/BasePage.cs +0 -57
- package/.claude/skills/playwright/templates/dotnet/Pages/HomePage.cs +0 -26
- package/.claude/skills/playwright/templates/dotnet/Pages/LoginPage.cs +0 -45
- package/.claude/skills/playwright/templates/dotnet/Tests/SmokeTests.cs +0 -47
- package/.claude/skills/playwright/templates/javascript/src/components/account-menu.component.js +0 -30
- package/.claude/skills/playwright/templates/javascript/src/config.js +0 -53
- package/.claude/skills/playwright/templates/javascript/src/data/accounts.js +0 -23
- package/.claude/skills/playwright/templates/javascript/src/data/cases.js +0 -49
- package/.claude/skills/playwright/templates/javascript/src/data/sign-in.data.js +0 -12
- package/.claude/skills/playwright/templates/javascript/src/flows/sign-in.flow.js +0 -53
- package/.claude/skills/playwright/templates/javascript/src/pages/base.page.js +0 -59
- package/.claude/skills/playwright/templates/javascript/src/pages/home.page.js +0 -31
- package/.claude/skills/playwright/templates/javascript/src/pages/login.page.js +0 -56
- package/.claude/skills/playwright/templates/javascript/tests/fixtures.js +0 -20
- package/.claude/skills/playwright/templates/javascript/tests/smoke.spec.js +0 -22
- package/.claude/skills/playwright/templates/project/src/components/account-menu.component.ts +0 -27
- package/.claude/skills/playwright/templates/project/src/config.ts +0 -56
- package/.claude/skills/playwright/templates/project/src/data/accounts.ts +0 -21
- package/.claude/skills/playwright/templates/project/src/data/cases.ts +0 -55
- package/.claude/skills/playwright/templates/project/src/data/sign-in.data.ts +0 -10
- package/.claude/skills/playwright/templates/project/src/flows/sign-in.flow.ts +0 -51
- package/.claude/skills/playwright/templates/project/src/pages/base.page.ts +0 -52
- package/.claude/skills/playwright/templates/project/src/pages/home.page.ts +0 -30
- package/.claude/skills/playwright/templates/project/src/pages/login.page.ts +0 -53
- package/.claude/skills/playwright/templates/project/tests/fixtures.ts +0 -25
- package/.claude/skills/playwright/templates/project/tests/smoke.spec.ts +0 -22
- package/.claude/skills/playwright/templates/python/components/__init__.py +0 -1
- package/.claude/skills/playwright/templates/python/components/account_menu.py +0 -22
- package/.claude/skills/playwright/templates/python/data/accounts.py +0 -14
- package/.claude/skills/playwright/templates/python/data/cases.py +0 -33
- package/.claude/skills/playwright/templates/python/data/sign_in_data.py +0 -9
- package/.claude/skills/playwright/templates/python/flows/sign_in.py +0 -63
- package/.claude/skills/playwright/templates/python/pages/base_page.py +0 -51
- package/.claude/skills/playwright/templates/python/pages/home_page.py +0 -21
- package/.claude/skills/playwright/templates/python/pages/login_page.py +0 -40
- package/.claude/skills/playwright/templates/python/tests/test_smoke.py +0 -26
- package/.claude/skills/quality-checks/templates/playwright-ts/src/pages/scanned.page.ts +0 -16
- package/.claude/skills/quality-checks/templates/playwright-ts/tests/quality.spec.ts +0 -58
- package/.claude/skills/requests/templates/python-pytest/api/config.py +0 -43
- package/.claude/skills/requests/templates/python-pytest/api/errors.py +0 -15
- package/.claude/skills/requests/templates/python-pytest/data/builders.py +0 -16
- package/.claude/skills/requests/templates/python-pytest/data/cases.py +0 -30
- package/.claude/skills/requests/templates/python-pytest/data/health_data.py +0 -6
- package/.claude/skills/requests/templates/python-pytest/data/products_data.py +0 -10
- package/.claude/skills/requests/templates/python-pytest/tests/test_health.py +0 -12
- package/.claude/skills/requests/templates/python-pytest/tests/test_products.py +0 -25
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/api/ApiError.java +0 -18
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/api/ApiSpec.java +0 -29
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/api/HealthApi.java +0 -21
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/data/Cases.java +0 -45
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/data/HealthData.java +0 -12
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/data/ProductsData.java +0 -16
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/HealthTest.java +0 -15
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/ProductsTest.java +0 -37
- package/.claude/skills/selenium/templates/csharp-nunit/Components/AccountMenu.cs +0 -26
- package/.claude/skills/selenium/templates/csharp-nunit/Data/Cases.cs +0 -43
- package/.claude/skills/selenium/templates/csharp-nunit/Data/SignInData.cs +0 -24
- package/.claude/skills/selenium/templates/csharp-nunit/Flows/SignInFlow.cs +0 -51
- package/.claude/skills/selenium/templates/csharp-nunit/Framework/AutomationError.cs +0 -17
- package/.claude/skills/selenium/templates/csharp-nunit/Framework/DriverManager.cs +0 -26
- package/.claude/skills/selenium/templates/csharp-nunit/Pages/HomePage.cs +0 -28
- package/.claude/skills/selenium/templates/csharp-nunit/Pages/LoginPage.cs +0 -58
- package/.claude/skills/selenium/templates/csharp-nunit/Tests/BaseTest.cs +0 -22
- package/.claude/skills/selenium/templates/csharp-nunit/Tests/SmokeTests.cs +0 -37
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/components/AccountMenu.java +0 -37
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/data/Cases.java +0 -48
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/data/SignInData.java +0 -36
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/flows/SignInFlow.java +0 -60
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/framework/Account.java +0 -19
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pages/HomePage.java +0 -45
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pages/LoginPage.java +0 -78
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/BaseTest.java +0 -33
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/SmokeTest.java +0 -33
- package/.claude/skills/selenium/templates/python-pytest/components/__init__.py +0 -1
- package/.claude/skills/selenium/templates/python-pytest/components/account_menu.py +0 -19
- package/.claude/skills/selenium/templates/python-pytest/data/accounts.py +0 -14
- package/.claude/skills/selenium/templates/python-pytest/data/cases.py +0 -33
- package/.claude/skills/selenium/templates/python-pytest/data/sign_in_data.py +0 -9
- package/.claude/skills/selenium/templates/python-pytest/flows/__init__.py +0 -0
- package/.claude/skills/selenium/templates/python-pytest/flows/sign_in.py +0 -61
- package/.claude/skills/selenium/templates/python-pytest/framework/__init__.py +0 -0
- package/.claude/skills/selenium/templates/python-pytest/framework/config.py +0 -90
- package/.claude/skills/selenium/templates/python-pytest/pages/__init__.py +0 -0
- package/.claude/skills/selenium/templates/python-pytest/pages/home_page.py +0 -23
- package/.claude/skills/selenium/templates/python-pytest/tests/test_smoke.py +0 -25
- /package/.claude/skills/karate/templates/java-junit5/src/test/java/{api → tests/api}/delete-product.feature +0 -0
- /package/.claude/skills/playwright/templates/{python/data/__init__.py → dotnet/auth/.gitkeep} +0 -0
- /package/.claude/skills/playwright/templates/{python/flows/__init__.py → javascript/auth/.gitkeep} +0 -0
- /package/.claude/skills/playwright/templates/{python/framework/__init__.py → project/auth/.gitkeep} +0 -0
- /package/.claude/skills/playwright/templates/project/{src → utils}/errors.ts +0 -0
- /package/.claude/skills/playwright/templates/python/{pages/__init__.py → auth/.gitkeep} +0 -0
- /package/.claude/skills/quality-checks/templates/playwright-ts/src/checks/{page-health.ts → pageHealth.ts} +0 -0
- /package/.claude/skills/quality-checks/templates/playwright-ts/src/{api/graphql.ts → services/graphqlClient.ts} +0 -0
- /package/.claude/skills/{requests/templates/python-pytest/api/__init__.py → selenium/templates/csharp-nunit/auth/.gitkeep} +0 -0
- /package/.claude/skills/{requests/templates/python-pytest/data/__init__.py → selenium/templates/java-testng/auth/.gitkeep} +0 -0
- /package/.claude/skills/selenium/templates/python-pytest/{data/__init__.py → auth/.gitkeep} +0 -0
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Read-only scanner for a test suite in any of the supported languages (JavaScript, TypeScript, Python, Java, C#, plus
|
|
4
|
+
* Gherkin and Robot files). No dependencies and no parser: it reads manifests, file names, imports and lines with
|
|
5
|
+
* regular expressions, so everything it reports carries the evidence it came from, and what it can't see is listed
|
|
6
|
+
* under `limits`. Used by `suite_check.mjs --existing` and by the Orion graph.
|
|
7
|
+
*
|
|
8
|
+
* Usage (from the workspace root):
|
|
9
|
+
* node .claude/skills/orion/scripts/lib/scan.mjs <suite folder> (prints the scan as JSON)
|
|
10
|
+
* import { scan } from './lib/scan.mjs' (returns the same object)
|
|
11
|
+
*
|
|
12
|
+
* Output: frameworks (with the file that shows each), languages, kind (ui | api | ui+api | unknown), the files by role
|
|
13
|
+
* (tests with their test names, page objects, fixtures, test data, config, helpers, locator files), edges from tests to
|
|
14
|
+
* the files they use (`confirmed` when an import names the file, `inferred` when only a class name matches) and
|
|
15
|
+
* findings for the rules a script can see (U1, U2, U3, U7, P1, P2, P5, P6/P18, P8, P17), each with file, line and a
|
|
16
|
+
* short quote. A quote never shows a secret: string values on a line that names a password, token, secret or key are
|
|
17
|
+
* replaced by `***`. Reads source files only; never `.env` files or saved sessions.
|
|
18
|
+
*/
|
|
19
|
+
import fs from 'node:fs';
|
|
20
|
+
import path from 'node:path';
|
|
21
|
+
import { fileURLToPath } from 'node:url';
|
|
22
|
+
|
|
23
|
+
const SKIP_DIRS = new Set(['node_modules', '.git', 'auth', 'playwright-report', 'test-results', 'allure-results', 'blob-report',
|
|
24
|
+
'bin', 'obj', 'target', 'reports', 'TestResults', '.venv', 'venv', '__pycache__', '.pytest_cache', 'test-output', 'dist',
|
|
25
|
+
'build', '.gradle', '.idea', '.vscode', 'coverage', 'screenshots', 'videos', 'downloads', 'project-context', '.claude',
|
|
26
|
+
'.cursor', '.github', '.ui-map', 'app']);
|
|
27
|
+
const SOURCE = /\.(m?[jt]sx?|py|java|cs|feature|robot|kt)$/;
|
|
28
|
+
const MAX_BYTES = 400_000;
|
|
29
|
+
|
|
30
|
+
const LANG_OF = (f) => (/\.m?tsx?$/.test(f) ? 'ts' : /\.m?jsx?$/.test(f) ? 'js' : /\.py$/.test(f) ? 'py' : /\.java$/.test(f) ? 'java'
|
|
31
|
+
: /\.cs$/.test(f) ? 'cs' : /\.feature$/.test(f) ? 'gherkin' : /\.robot$/.test(f) ? 'robot' : /\.kt$/.test(f) ? 'kotlin' : null);
|
|
32
|
+
|
|
33
|
+
/** Test files by name, per language. */
|
|
34
|
+
const TEST_FILE = /(\.(spec|test|cy|e2e)\.m?[jt]sx?$)|((^|\/)tests?\/(load|perf|performance)\/[^/]+\.m?js$)|((^|\/)test_\w+\.py$)|(_test\.py$)|((^|\/)(src\/test\/.*\/)?\w+Tests?\.(java|kt)$)|(\w+Tests?\.cs$)|(\.feature$)|(\.robot$)/;
|
|
35
|
+
/** Page, screen or component objects by folder or name. */
|
|
36
|
+
const PAGE_FILE = /(^|\/)(pages|pageObjects|page_objects|pageobjects|PageObjects|screens|Screens|components)\/[^/]+\.(m?[jt]sx?|py|java|cs|kt)$|(Page|Screen)\.(m?[jt]sx?|java|cs|kt)$|_(page|screen)\.py$|\.(page|screen)\.m?[jt]s$/;
|
|
37
|
+
const FIXTURE_FILE = /(^|\/)(fixtures?|Fixtures)\/[^/]+\.(m?[jt]s|py|java|cs)$|(^|\/)fixtures\.m?[jt]s$|(^|\/)conftest\.py$|(Base(Ui|Api)?Test|TestBase|BaseTest)\.(java|cs|kt)$|(^|\/)support\/(e2e|commands)\.[jt]s$/;
|
|
38
|
+
const DATA_FILE = /(^|\/)(data|testData|test_data|TestData|testdata)\/[^/]+$|(^|\/)(testData|test_data|TestData)\.\w+$|(^|\/)users\.\w+$/i;
|
|
39
|
+
const CONFIG_FILE = /(^|\/)(config|Config)\/[^/]+\.(m?[jt]s|py|java|cs)$|(^|\/)(Config|ApiConfig|Settings|Environment)\.(java|cs|kt)$|(^|\/)config\.(py|m?[jt]s)$|(^|\/)settings\.py$|(^|\/)(playwright|cypress|wdio|jest|vitest)\.conf(ig)?\.m?[jt]s$|(^|\/)(pytest\.ini|pyproject\.toml|testng\.xml|pom\.xml|build\.gradle(\.kts)?|[\w.-]+\.csproj|appsettings\.json|config\.properties)$/;
|
|
40
|
+
const SERVICE_FILE = /(^|\/)(services?|clients?|api|Services|Clients|Api)\/[^/]+\.(m?[jt]s|py|java|cs|kt)$|(Client|Service|Api)\.(m?[jt]s|java|cs|kt)$|_(client|service|api)\.py$/;
|
|
41
|
+
const HELPER_FILE = /(^|\/)(helpers?|utils?|support|Utils|Helpers|Support|lib|common)\/[^/]+\.(m?[jt]s|py|java|cs|kt)$/;
|
|
42
|
+
const LOCATOR_FILE = /(^|\/)locators?(\/|\.(m?[jt]s|py|java|cs|json)$)|\.locators\.m?[jt]s$|(^|\/)selectors\.json$/i;
|
|
43
|
+
|
|
44
|
+
/** Lines that find an element, per language family (P2: these belong in page objects). */
|
|
45
|
+
const LOCATOR_CALL = /\b(page|this\.page|frame)\.(locator|getBy(Role|Text|Label|TestId|Placeholder|AltText|Title))\(|\bcy\.(get|contains|find)\(|\$\$?\(\s*['"`]|\bBy\.(xpath|cssSelector|id|name|className|linkText|tagName|XPath|CssSelector|Id|Name|ClassName|LinkText)\(|\bAppiumBy\.|find_elements?\(\s*By\.|\.(FindElement|FindElements)\(|@FindBy\(|\bpage\.(locator|get_by_\w+)\(/;
|
|
46
|
+
const ASSERTION = /\bexpect\(|^\s*assert\s|\bassert(That|Equals|True|False|NotNull|Null)\(|\bAssert\.\w+\(|\.should\(|\bassertions\.\w+\(/;
|
|
47
|
+
const ENV_READ = /process\.env|os\.environ|os\.getenv|System\.getenv|Environment\.GetEnvironmentVariable|Cypress\.env\(/;
|
|
48
|
+
const SECRET_NAME = /(pass(word|wd)?|pwd|secret|token|api[_-]?key|apikey|client[_-]?secret|authorization|bearer)/i;
|
|
49
|
+
|
|
50
|
+
/** Rules a script can see, per language; each gives the rule, a short label and the line pattern. */
|
|
51
|
+
const LINE_RULES = [
|
|
52
|
+
{ rule: 'U1', what: 'fixed wait', langs: ['java', 'kotlin'], rx: /\bThread\.sleep\(/ },
|
|
53
|
+
{ rule: 'U1', what: 'fixed wait', langs: ['py'], rx: /\btime\.sleep\(|\bsleep\(\s*\d|\bwait_for_load_state\(\s*['"]networkidle['"]|\bwait_for_timeout\(|wait_until\s*=\s*['"]networkidle['"]/ },
|
|
54
|
+
{ rule: 'U1', what: 'fixed wait', langs: ['cs'], rx: /\bThread\.Sleep\(|\bTask\.Delay\(|LoadState\.NetworkIdle|WaitUntilState\.NetworkIdle|\bWaitForTimeoutAsync\(/ },
|
|
55
|
+
{ rule: 'U1', what: 'fixed wait', langs: ['js', 'ts'], rx: /\bwaitForTimeout\(|\bwaitForLoadState\(\s*['"]networkidle['"]|waitUntil:\s*['"]networkidle['"]|\bdriver\.sleep\(|\bbrowser\.pause\(|\bcy\.wait\(\s*\d|new Promise\(\s*\(?\w*\)?\s*=>\s*setTimeout\(/ },
|
|
56
|
+
{ rule: 'U1', what: 'fixed wait', langs: ['robot'], rx: /^\s+Sleep\s/ },
|
|
57
|
+
{ rule: 'U3', what: 'tests depend on order', langs: ['java', 'kotlin'], rx: /dependsOnMethods|@Order\(/ },
|
|
58
|
+
{ rule: 'U3', what: 'tests depend on order', langs: ['js', 'ts'], rx: /describe\.serial\(|mode:\s*['"]serial['"]/ },
|
|
59
|
+
{ rule: 'U3', what: 'tests depend on order', langs: ['py'], rx: /@pytest\.mark\.(order|run\(order)|pytest\.mark\.dependency/ },
|
|
60
|
+
{ rule: 'U3', what: 'tests depend on order', langs: ['cs'], rx: /\[Order\(/ },
|
|
61
|
+
{ rule: 'U7', what: 'absolute XPath', langs: ['js', 'ts', 'py', 'java', 'cs', 'kotlin', 'robot'], rx: /['"`](xpath=)?\/html\/|['"`]\/\/?body\// },
|
|
62
|
+
{ rule: 'U7', what: 'position-based locator', langs: ['js', 'ts', 'py', 'java', 'cs', 'kotlin', 'robot'], rx: /:nth-child\(|:nth-of-type\(|\.nth\(\d+\)|\.eq\(\d+\)|\)\[\d+\]['"`]/ },
|
|
63
|
+
{ rule: 'P5', what: 'static driver shared across threads', langs: ['java', 'kotlin'], rx: /\bstatic\s+(?!final\s+ThreadLocal)(?:final\s+)?(Remote)?WebDriver\s+\w+\s*[;=]|\bstatic\s+(AppiumDriver|AndroidDriver|IOSDriver)(<\w+>)?\s+\w+\s*[;=]/ },
|
|
64
|
+
{ rule: 'P5', what: 'static driver shared across threads', langs: ['cs'], rx: /\bstatic\s+(IWebDriver|WebDriver|AppiumDriver)\S*\s+\w+\s*(;|=(?!>)|\{\s*get;\s*set;)/ },
|
|
65
|
+
{ rule: 'P8', what: 'implicit wait', langs: ['java', 'kotlin', 'py', 'cs', 'js', 'ts'], rx: /implicitlyWait\(|implicitly_wait\(|ImplicitWait\s*=|\.implicit\b/ },
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
/** Same line, with every string value replaced by `***` when the line names a secret (so a quote never shows one). */
|
|
69
|
+
function safeQuote(line) {
|
|
70
|
+
let q = line.trim();
|
|
71
|
+
if (SECRET_NAME.test(q)) q = q.replace(/(['"`])(?:\\.|(?!\1).)*\1/g, '"***"');
|
|
72
|
+
return q.length > 120 ? `${q.slice(0, 117)}...` : q;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* U2: a string literal of 3+ characters, without spaces, given to a secret-looking key (`password: '…'`,
|
|
77
|
+
* `"token": "…"`, `put("api_key", "…")`), an Authorization header with a literal credential, or typed into a field on a
|
|
78
|
+
* line that names a password or token. Not an env read, a placeholder, a label equal to its key (`password: 'Password'`)
|
|
79
|
+
* or an auth scheme word (`"Bearer"`).
|
|
80
|
+
*/
|
|
81
|
+
function secretLiteral(line, lang) {
|
|
82
|
+
if (ENV_READ.test(line) || /\.env\.example|getenv|placeholder|example\.(test|com)|<[^>]+>|\$\{|\{\{/.test(line)) return false;
|
|
83
|
+
if (/^\s*(\/\/|#|\*|\/\*)/.test(line)) return false;
|
|
84
|
+
if (lang === 'gherkin' || lang === 'robot') return /\b(password|token)\b.*\s{2,}\S{4,}/i.test(line) && !/\$\{/.test(line);
|
|
85
|
+
const name = '(?:pass(?:word|wd)?|pwd|secret|token|api[_-]?key|apikey|client[_-]?secret|authorization|bearer)';
|
|
86
|
+
const keyed = new RegExp(`(?:^|[\\s{(,.])['"\`]?\\w*${name}\\w*['"\`]?\\s*(?::|=|=>)\\s*(?:new\\s+\\w+\\()?(?<q>['"\`])(?<v>[^'"\`\\s]{3,})\\k<q>`, 'ig');
|
|
87
|
+
const paired = new RegExp(`(?<k>['"\`])\\w*${name}\\w*\\k<k>\\s*,\\s*(?<q>['"\`])(?<v>[^'"\`\\s]{3,})\\k<q>`, 'ig');
|
|
88
|
+
const label = (v) => /^(bearer|basic|token|password|secret)$/i.test(v) || (new RegExp(name, 'i').test(v) && /^[A-Z][a-z]+$/.test(v));
|
|
89
|
+
for (const rx of [keyed, paired]) for (const m of line.matchAll(rx)) if (!label(m.groups.v)) return true;
|
|
90
|
+
if (/['"`]Authorization['"`]\s*[,:]\s*['"`](Bearer|Basic)\s+[A-Za-z0-9._~+/=-]{6,}/.test(line)) return true;
|
|
91
|
+
return /(pass(word|wd)?|pwd|secret|token)/i.test(line) && /\.(fill|type|sendKeys|send_keys|SendKeys|setValue|press_sequentially)\(\s*['"`][^'"`\s]{3,}['"`]/.test(line);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Every source and manifest file under root (relative, forward slashes). */
|
|
95
|
+
function listFiles(root) {
|
|
96
|
+
const out = [];
|
|
97
|
+
const walk = (dir) => {
|
|
98
|
+
let entries = [];
|
|
99
|
+
try { entries = fs.readdirSync(dir, { withFileTypes: true }); } catch { return; }
|
|
100
|
+
for (const e of entries) {
|
|
101
|
+
if (e.isDirectory()) { if (!SKIP_DIRS.has(e.name) && !e.name.startsWith('.')) walk(path.join(dir, e.name)); continue; }
|
|
102
|
+
if (/^\.env(\.|$)/.test(e.name) && e.name !== '.env.example') continue;
|
|
103
|
+
out.push(path.relative(root, path.join(dir, e.name)).split(path.sep).join('/'));
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
walk(root);
|
|
107
|
+
return out.sort();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function readText(root, rel) {
|
|
111
|
+
try {
|
|
112
|
+
const p = path.join(root, rel);
|
|
113
|
+
if (fs.statSync(p).size > MAX_BYTES) return null;
|
|
114
|
+
return fs.readFileSync(p, 'utf8');
|
|
115
|
+
} catch { return null; }
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Frameworks from manifests and config files, each with the file that shows it. */
|
|
119
|
+
function detectFrameworks(root, files) {
|
|
120
|
+
const found = new Map();
|
|
121
|
+
const add = (name, file) => { if (!found.has(name)) found.set(name, file); };
|
|
122
|
+
const has = (rx) => files.find((f) => rx.test(f));
|
|
123
|
+
const text = (f) => readText(root, f) || '';
|
|
124
|
+
for (const f of files.filter((x) => /(^|\/)package\.json$/.test(x))) {
|
|
125
|
+
let deps = {};
|
|
126
|
+
try { const j = JSON.parse(text(f)); deps = { ...j.dependencies, ...j.devDependencies }; } catch { /* not JSON */ }
|
|
127
|
+
if (deps['@playwright/test'] || deps.playwright) add('playwright', f);
|
|
128
|
+
if (deps.cypress) add('cypress', f);
|
|
129
|
+
if (deps['@wdio/cli'] || deps.webdriverio) add('webdriverio', f);
|
|
130
|
+
if (deps['selenium-webdriver']) add('selenium', f);
|
|
131
|
+
if (deps.appium || deps['@wdio/appium-service']) add('appium', f);
|
|
132
|
+
if (deps.jest) add('jest', f);
|
|
133
|
+
if (deps.vitest) add('vitest', f);
|
|
134
|
+
if (deps.mocha) add('mocha', f);
|
|
135
|
+
if (deps.supertest) add('supertest', f);
|
|
136
|
+
if (deps.axios || deps['node-fetch']) add('http-client-js', f);
|
|
137
|
+
if (deps.newman) add('newman', f);
|
|
138
|
+
if (deps['@pact-foundation/pact']) add('pact', f);
|
|
139
|
+
if (deps['@cucumber/cucumber'] || deps['playwright-bdd']) add('cucumber', f);
|
|
140
|
+
}
|
|
141
|
+
for (const [rx, name] of [[/(^|\/)playwright\.config\.m?[jt]s$/, 'playwright'], [/(^|\/)cypress\.config\.m?[jt]s$/, 'cypress'],
|
|
142
|
+
[/(^|\/)wdio\.conf\.m?[jt]s$/, 'webdriverio'], [/(^|\/)conftest\.py$/, 'pytest'], [/(^|\/)pytest\.ini$/, 'pytest'],
|
|
143
|
+
[/(^|\/)testng\.xml$/, 'testng'], [/\.robot$/, 'robot'], [/\.postman_collection\.json$/, 'newman'], [/(^|\/)k6[^/]*\.m?js$/, 'k6']]) {
|
|
144
|
+
const f = has(rx); if (f) add(name, f);
|
|
145
|
+
}
|
|
146
|
+
for (const f of files.filter((x) => /(^|\/)(pom\.xml|build\.gradle(\.kts)?)$/.test(x))) {
|
|
147
|
+
const t = text(f);
|
|
148
|
+
add(/pom\.xml$/.test(f) ? 'maven' : 'gradle', f);
|
|
149
|
+
if (/selenium-java|org\.seleniumhq/.test(t)) add('selenium', f);
|
|
150
|
+
if (/io\.appium|java-client/.test(t)) add('appium', f);
|
|
151
|
+
if (/rest-assured|io\.rest-assured/.test(t)) add('rest-assured', f);
|
|
152
|
+
if (/<artifactId>testng<|org\.testng/.test(t)) add('testng', f);
|
|
153
|
+
if (/junit-jupiter|junit\.jupiter/.test(t)) add('junit5', f);
|
|
154
|
+
if (/karate/.test(t)) add('karate', f);
|
|
155
|
+
if (/cucumber/.test(t)) add('cucumber', f);
|
|
156
|
+
if (/com\.microsoft\.playwright/.test(t)) add('playwright', f);
|
|
157
|
+
}
|
|
158
|
+
for (const f of files.filter((x) => /\.csproj$/.test(x))) {
|
|
159
|
+
const t = text(f);
|
|
160
|
+
add('dotnet', f);
|
|
161
|
+
if (/Selenium\.WebDriver/.test(t)) add('selenium', f);
|
|
162
|
+
if (/Microsoft\.Playwright/.test(t)) add('playwright', f);
|
|
163
|
+
if (/Appium\.WebDriver/.test(t)) add('appium', f);
|
|
164
|
+
if (/\bNUnit\b/.test(t)) add('nunit', f);
|
|
165
|
+
if (/\bxunit\b/i.test(t)) add('xunit', f);
|
|
166
|
+
if (/MSTest/.test(t)) add('mstest', f);
|
|
167
|
+
if (/RestSharp/.test(t)) add('restsharp', f);
|
|
168
|
+
if (/Reqnroll|SpecFlow/.test(t)) add('cucumber', f);
|
|
169
|
+
}
|
|
170
|
+
for (const f of files.filter((x) => /(^|\/)(pyproject\.toml|requirements[\w.-]*\.txt|setup\.cfg|Pipfile)$/.test(x))) {
|
|
171
|
+
const t = text(f);
|
|
172
|
+
if (/pytest/.test(t)) add('pytest', f);
|
|
173
|
+
if (/playwright/.test(t)) add('playwright', f);
|
|
174
|
+
if (/selenium/.test(t)) add('selenium', f);
|
|
175
|
+
if (/appium/i.test(t)) add('appium', f);
|
|
176
|
+
if (/\brequests\b|httpx/.test(t)) add('http-client-py', f);
|
|
177
|
+
if (/robotframework/.test(t)) add('robot', f);
|
|
178
|
+
if (/behave|pytest-bdd/.test(t)) add('cucumber', f);
|
|
179
|
+
}
|
|
180
|
+
if (!found.has('http-client-py')) {
|
|
181
|
+
const f = files.find((x) => /\.py$/.test(x) && /^\s*(import (requests|httpx)|from (requests|httpx) )/m.test(text(x)));
|
|
182
|
+
if (f) add('http-client-py', f);
|
|
183
|
+
}
|
|
184
|
+
if (!found.has('playwright')) {
|
|
185
|
+
const f = files.find((x) => /\.py$/.test(x) && /from playwright|import playwright/.test(text(x)));
|
|
186
|
+
if (f) add('playwright', f);
|
|
187
|
+
}
|
|
188
|
+
if (!found.has('selenium')) {
|
|
189
|
+
const f = files.find((x) => /\.py$/.test(x) && /from selenium|import selenium/.test(text(x)));
|
|
190
|
+
if (f) add('selenium', f);
|
|
191
|
+
}
|
|
192
|
+
if (has(/\.feature$/) && !found.has('cucumber') && !found.has('karate')) add('gherkin', has(/\.feature$/));
|
|
193
|
+
return [...found].map(([name, evidence]) => ({ name, evidence }));
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** Test names in a test file, with their lines. */
|
|
197
|
+
function testNames(text, lang) {
|
|
198
|
+
const out = [];
|
|
199
|
+
const lines = text.split('\n');
|
|
200
|
+
lines.forEach((line, i) => {
|
|
201
|
+
let m;
|
|
202
|
+
if ((lang === 'js' || lang === 'ts') && (m = line.match(/\b(?:test|it)(?:\.(?:only|skip|fixme|fail))?\(\s*(['"`])((?:\\.|(?!\1).)+)\1/))) out.push({ line: i + 1, name: m[2] });
|
|
203
|
+
else if (lang === 'py' && (m = line.match(/^\s*(?:async\s+)?def\s+(test_\w+)\s*\(/))) out.push({ line: i + 1, name: m[1] });
|
|
204
|
+
else if ((lang === 'java' || lang === 'kotlin') && /@Test\b/.test(line)) {
|
|
205
|
+
for (let j = i; j < Math.min(i + 6, lines.length); j++) {
|
|
206
|
+
const mm = lines[j].match(/(?:public|protected|private|fun)?\s*(?:void\s+|fun\s+)(\w+)\s*\(/);
|
|
207
|
+
if (mm) { out.push({ line: j + 1, name: mm[1] }); break; }
|
|
208
|
+
}
|
|
209
|
+
} else if (lang === 'cs' && /\[(Test|Fact|Theory|TestMethod|TestCase)\b/.test(line)) {
|
|
210
|
+
for (let j = i; j < Math.min(i + 6, lines.length); j++) {
|
|
211
|
+
const mm = lines[j].match(/public\s+(?:async\s+)?(?:Task|void)\s+(\w+)\s*\(/);
|
|
212
|
+
if (mm) { if (!out.some((o) => o.name === mm[1])) out.push({ line: j + 1, name: mm[1] }); break; }
|
|
213
|
+
}
|
|
214
|
+
} else if (lang === 'gherkin' && (m = line.match(/^\s*Scenario(?: Outline)?:\s*(.+)$/))) out.push({ line: i + 1, name: m[1].trim() });
|
|
215
|
+
});
|
|
216
|
+
if (lang === 'robot') {
|
|
217
|
+
let inCases = false;
|
|
218
|
+
lines.forEach((line, i) => {
|
|
219
|
+
if (/^\*+\s*Test Cases/i.test(line)) { inCases = true; return; }
|
|
220
|
+
if (/^\*+/.test(line)) { inCases = false; return; }
|
|
221
|
+
if (inCases && /^\S/.test(line)) out.push({ line: i + 1, name: line.trim() });
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
return out;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** Project files a source file imports (JS/TS relative imports, Python modules, Java/C# imports by class name). */
|
|
228
|
+
function importsOf(text, lang, from, files, classIndex) {
|
|
229
|
+
const out = [];
|
|
230
|
+
const dir = path.posix.dirname(from);
|
|
231
|
+
if (lang === 'js' || lang === 'ts') {
|
|
232
|
+
for (const m of text.matchAll(/(?:from\s+|require\(\s*|import\(\s*)['"](\.{1,2}\/[^'"]+)['"]/g)) {
|
|
233
|
+
const base = path.posix.normalize(path.posix.join(dir, m[1])).replace(/\.m?js$/, '');
|
|
234
|
+
const hit = files.find((f) => f === base || new RegExp(`^${base.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(\\.m?[jt]sx?|/index\\.m?[jt]sx?)$`).test(f));
|
|
235
|
+
if (hit) out.push({ to: hit, tag: 'confirmed', via: 'import' });
|
|
236
|
+
}
|
|
237
|
+
} else if (lang === 'py') {
|
|
238
|
+
for (const m of text.matchAll(/^\s*(?:from\s+([\w.]+)\s+import|import\s+([\w.]+))/gm)) {
|
|
239
|
+
const mod = (m[1] || m[2]).replace(/^\.+/, '').replace(/\./g, '/');
|
|
240
|
+
const hit = files.find((f) => f.endsWith(`${mod}.py`) || f.endsWith(`${mod}/__init__.py`));
|
|
241
|
+
if (hit) out.push({ to: hit, tag: 'confirmed', via: 'import' });
|
|
242
|
+
}
|
|
243
|
+
} else if (lang === 'java' || lang === 'kotlin' || lang === 'cs') {
|
|
244
|
+
const imported = new Set([...text.matchAll(/^\s*import\s+(?:static\s+)?[\w.]+\.(\w+)\s*;?/gm)].map((m) => m[1]));
|
|
245
|
+
for (const [cls, file] of classIndex) {
|
|
246
|
+
if (file === from) continue;
|
|
247
|
+
if (!new RegExp(`\\b${cls}\\b`).test(text)) continue;
|
|
248
|
+
out.push({ to: file, tag: imported.has(cls) ? 'confirmed' : 'inferred', via: imported.has(cls) ? 'import' : 'class name' });
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const seen = new Set();
|
|
252
|
+
return out.filter((e) => (seen.has(e.to) ? false : seen.add(e.to)));
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/** Scan a suite folder. Returns the scan object (see the header). */
|
|
256
|
+
export function scan(root) {
|
|
257
|
+
const files = listFiles(root);
|
|
258
|
+
const sources = files.filter((f) => SOURCE.test(f));
|
|
259
|
+
const languages = {};
|
|
260
|
+
for (const f of sources) { const l = LANG_OF(f); if (l) languages[l] = (languages[l] || 0) + 1; }
|
|
261
|
+
const frameworks = detectFrameworks(root, files);
|
|
262
|
+
const fw = new Set(frameworks.map((x) => x.name));
|
|
263
|
+
|
|
264
|
+
const role = (f) => (LOCATOR_FILE.test(f) ? 'locators' : TEST_FILE.test(f) && !PAGE_FILE.test(f) && !FIXTURE_FILE.test(f) ? 'test'
|
|
265
|
+
: PAGE_FILE.test(f) ? 'page' : FIXTURE_FILE.test(f) ? 'fixture' : CONFIG_FILE.test(f) ? 'config' : DATA_FILE.test(f) ? 'data'
|
|
266
|
+
: SERVICE_FILE.test(f) ? 'service' : HELPER_FILE.test(f) ? 'helper' : 'other');
|
|
267
|
+
const byRole = { test: [], page: [], fixture: [], data: [], config: [], service: [], helper: [], locators: [], other: [] };
|
|
268
|
+
for (const f of files) {
|
|
269
|
+
const r = role(f);
|
|
270
|
+
if (r === 'other' && !SOURCE.test(f)) continue;
|
|
271
|
+
byRole[r].push(f);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const classIndex = new Map();
|
|
275
|
+
for (const f of sources.filter((x) => /\.(java|cs|kt)$/.test(x))) classIndex.set(path.posix.basename(f).replace(/\.\w+$/, ''), f);
|
|
276
|
+
|
|
277
|
+
const tests = [];
|
|
278
|
+
const edges = [];
|
|
279
|
+
const findings = [];
|
|
280
|
+
let uiSignals = 0; let apiSignals = 0;
|
|
281
|
+
for (const f of sources) {
|
|
282
|
+
const lang = LANG_OF(f);
|
|
283
|
+
const text = readText(root, f);
|
|
284
|
+
if (text == null) continue;
|
|
285
|
+
const r = role(f);
|
|
286
|
+
if (/\bpage\.goto\(|\bcy\.visit\(|\bdriver\.(get|navigate)|\bbrowser\.url\(|\.Navigate\(\)|\bpage\.(click|fill)\(|getBy(Role|Label)\(|@FindBy/.test(text)) uiSignals++;
|
|
287
|
+
if (/\brequest\.(get|post|put|patch|delete)\(|\bgiven\(\)|RestAssured|\brequests\.(get|post|put|patch|delete)\(|httpx\.|HttpClient\b|\bsupertest\(|\baxios\.|APIRequestContext|\bcy\.request\(|RestClient\b|\bfetch\(/.test(text)) apiSignals++;
|
|
288
|
+
if (r === 'test') {
|
|
289
|
+
const names = testNames(text, lang);
|
|
290
|
+
tests.push({ file: f, count: names.length, names });
|
|
291
|
+
}
|
|
292
|
+
if (['test', 'page', 'fixture', 'service', 'helper', 'data'].includes(r)) {
|
|
293
|
+
for (const e of importsOf(text, lang, f, files, classIndex)) edges.push({ from: f, to: e.to, to_role: role(e.to), tag: e.tag, via: e.via });
|
|
294
|
+
}
|
|
295
|
+
if (r === 'test' && lang === 'py') {
|
|
296
|
+
// pytest hands fixtures in by parameter name, not by import: link the conftest.py files above the test.
|
|
297
|
+
for (const c of files.filter((x) => /(^|\/)conftest\.py$/.test(x) && (path.posix.dirname(x) === '.' || f.startsWith(`${path.posix.dirname(x)}/`)))) {
|
|
298
|
+
edges.push({ from: f, to: c, to_role: 'fixture', tag: 'inferred', via: 'pytest fixture' });
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
const lines = text.split('\n');
|
|
302
|
+
const unit = /(^|\/)(tests?\/unit|Tests\/Unit|unit)\//.test(f);
|
|
303
|
+
let inDoc = false;
|
|
304
|
+
lines.forEach((line, i) => {
|
|
305
|
+
const at = { file: f, line: i + 1, quote: safeQuote(line), detected: 'script' };
|
|
306
|
+
if (lang === 'py') {
|
|
307
|
+
const q = (line.match(/"""|'''/g) || []).length;
|
|
308
|
+
if (inDoc || q) { if (q % 2 === 1) inDoc = !inDoc; return; }
|
|
309
|
+
}
|
|
310
|
+
if (/^\s*(\/\/|#|\*|\/\*)/.test(line)) return;
|
|
311
|
+
for (const rule of LINE_RULES) if (rule.langs.includes(lang) && rule.rx.test(line)) findings.push({ rule: rule.rule, what: rule.what, ...at });
|
|
312
|
+
if (!unit && secretLiteral(line, lang)) findings.push({ rule: 'U2', what: 'secret in code', ...at });
|
|
313
|
+
if (r === 'test' && LOCATOR_CALL.test(line) && lang !== 'gherkin' && lang !== 'robot') findings.push({ rule: 'P2', what: 'locator in a test file', ...at });
|
|
314
|
+
if (r === 'page' && ASSERTION.test(line) && !/\bimport\b/.test(line)) findings.push({ rule: 'P1', what: 'assertion in a page object', ...at });
|
|
315
|
+
if (!unit && (r === 'test' || r === 'page') && ENV_READ.test(line)) findings.push({ rule: 'P6', what: 'environment read outside the config layer', ...at });
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
for (const f of byRole.locators) findings.push({ rule: 'P17', what: 'separate locators file', file: f, line: 1, quote: '', detected: 'script' });
|
|
319
|
+
|
|
320
|
+
const severity = (rule) => (rule === 'U2' ? 'critical' : rule.startsWith('U') ? 'blocking' : rule.startsWith('P') ? 'major' : 'minor');
|
|
321
|
+
for (const x of findings) x.severity = severity(x.rule);
|
|
322
|
+
findings.sort((a, b) => ['critical', 'blocking', 'major', 'minor'].indexOf(a.severity) - ['critical', 'blocking', 'major', 'minor'].indexOf(b.severity)
|
|
323
|
+
|| a.file.localeCompare(b.file) || a.line - b.line);
|
|
324
|
+
|
|
325
|
+
const uiFw = ['playwright', 'cypress', 'webdriverio', 'selenium', 'appium'].some((n) => fw.has(n));
|
|
326
|
+
const apiFw = ['rest-assured', 'http-client-py', 'supertest', 'http-client-js', 'restsharp', 'karate', 'newman', 'pact', 'k6'].some((n) => fw.has(n));
|
|
327
|
+
const isUi = (uiFw && (byRole.page.length > 0 || uiSignals > 0));
|
|
328
|
+
const isApi = apiFw || (apiSignals > 0 && !isUi) || (apiSignals > 0 && tests.some((t) => /api/i.test(t.file)));
|
|
329
|
+
const kind = isUi && isApi ? 'ui+api' : isUi ? 'ui' : isApi ? 'api' : 'unknown';
|
|
330
|
+
|
|
331
|
+
return {
|
|
332
|
+
root: root.split(path.sep).join('/'),
|
|
333
|
+
frameworks,
|
|
334
|
+
languages,
|
|
335
|
+
kind,
|
|
336
|
+
files: { tests: byRole.test, pages: byRole.page, fixtures: byRole.fixture, data: byRole.data, config: byRole.config,
|
|
337
|
+
services: byRole.service, helpers: byRole.helper, locators: byRole.locators },
|
|
338
|
+
tests,
|
|
339
|
+
edges,
|
|
340
|
+
findings,
|
|
341
|
+
limits: [
|
|
342
|
+
'regular expressions, not a parser: a locator or wait built across several lines, or through a project helper, can be missed',
|
|
343
|
+
'secrets are found only next to a name like password, token, secret or key; a secret passed positionally (for example new User("alice", "…")) is left to the reviewer',
|
|
344
|
+
'edges from Java, Kotlin and C# tests are by class name: `confirmed` when imported, `inferred` when only the name matches (same package or namespace)',
|
|
345
|
+
'folders skipped: dependencies, build output, reports, saved sessions, app/, project-context/, host folders; .env files are never read',
|
|
346
|
+
],
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === path.resolve(process.argv[1])) {
|
|
351
|
+
const root = process.argv[2];
|
|
352
|
+
if (!root || !fs.existsSync(root) || !fs.statSync(root).isDirectory()) {
|
|
353
|
+
console.log('usage: node .claude/skills/orion/scripts/lib/scan.mjs <suite folder>');
|
|
354
|
+
process.exit(2);
|
|
355
|
+
}
|
|
356
|
+
process.stdout.write(`${JSON.stringify(scan(root.replace(/[\\/]+$/, '')), null, 2)}\n`);
|
|
357
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Fix-mode guard: a batch of fixes to an existing suite is kept only if the suite still tests at least what it tested
|
|
4
|
+
* before. Run by the orchestrator after each fix batch (`/orion fix`); a failing check means the batch is reverted.
|
|
5
|
+
*
|
|
6
|
+
* Usage (from the workspace root):
|
|
7
|
+
* node .claude/skills/orion/scripts/parity_check.mjs --before-src <dir> --after-src <dir>
|
|
8
|
+
* [--before <results.json> --after <results.json>] [--map "<old>=<new>" …] [--allow-assertion-change <test|all>]
|
|
9
|
+
* [--json]
|
|
10
|
+
* results files are `results_parse.mjs` output; <dir> is the suite before and after the batch (e.g. a `git worktree`
|
|
11
|
+
* at the previous commit and the working copy). `--map` declares a renamed or moved test (`file#name=file#name`, or
|
|
12
|
+
* `file::title=file::title` for results). `--allow-assertion-change` is given only after the user approved changing
|
|
13
|
+
* that test's expected values (H8).
|
|
14
|
+
*
|
|
15
|
+
* Fails (one line each) when, compared with before:
|
|
16
|
+
* results a test is gone · a passed test now fails or is flaky · a test is newly skipped
|
|
17
|
+
* source a test is gone · a test gained a skip marker · a test has fewer assertions · an assertion's contract changed
|
|
18
|
+
* (its matcher or its expected values), which needs the user's H8 approval
|
|
19
|
+
* An assertion's contract is its matcher names (toHaveText, assertEquals, Is.EqualTo, ==, in …) and its literal
|
|
20
|
+
* values; what is being checked (the locator, the variable) may change, so moving a locator into a page object passes.
|
|
21
|
+
* Moving an expected value into a test-data file shows as a changed contract: approve it (H8) after checking the value.
|
|
22
|
+
* Exit code: 0 parity holds · 1 a check failed · 2 wrong arguments.
|
|
23
|
+
*/
|
|
24
|
+
import fs from 'node:fs';
|
|
25
|
+
import path from 'node:path';
|
|
26
|
+
import { scan } from './lib/scan.mjs';
|
|
27
|
+
import { functionsOf } from './reuse_check.mjs';
|
|
28
|
+
|
|
29
|
+
const LANG = (f) => (/\.m?[jt]sx?$/.test(f) ? 'js' : /\.py$/.test(f) ? 'py' : /\.(java|kt)$/.test(f) ? 'java' : /\.cs$/.test(f) ? 'cs' : null);
|
|
30
|
+
const ASSERT = {
|
|
31
|
+
js: /\bexpect(?:\.soft)?\(|\bassert(?:\.\w+)?\(/,
|
|
32
|
+
py: /^\s*assert\b|\bexpect\(|\bassert_\w+\(/,
|
|
33
|
+
java: /\bassert\w*\(|\bAssert\.\w+\(|\bassertThat\(|\bAssertions\.\w+\(/,
|
|
34
|
+
cs: /\bAssert\.\w+\(|\bExpect\(|\.Should\(\)?/,
|
|
35
|
+
};
|
|
36
|
+
const SKIP = {
|
|
37
|
+
js: /\b(?:test|it|describe)\.(?:skip|fixme)\b|\bx(?:it|describe)\(/,
|
|
38
|
+
py: /@pytest\.mark\.(?:skip|skipif|xfail)\b|\bpytest\.skip\(/,
|
|
39
|
+
java: /@Disabled\b|@Ignore\b|enabled\s*=\s*false|throw new SkipException/,
|
|
40
|
+
cs: /\[[^\]]*\b(?:Ignore|Explicit)\b|Assert\.Ignore\(|Skip\s*=/,
|
|
41
|
+
};
|
|
42
|
+
const MATCHER = /^(?:not|to\w+|assert\w*|Assert|That|Is|Has|Does|Should|Be\w*|Equal\w*|Contain\w*|Match\w*|True|False|Null|NotNull|Empty|Greater\w*|Less\w*|Throws\w*|have_\w+|to_\w+)$/;
|
|
43
|
+
|
|
44
|
+
function usage(msg) {
|
|
45
|
+
if (msg) console.log(msg);
|
|
46
|
+
console.log('usage: parity_check.mjs --before-src DIR --after-src DIR [--before R.json --after R.json] [--map OLD=NEW …] [--allow-assertion-change TEST|all] [--json]');
|
|
47
|
+
process.exit(2);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function args() {
|
|
51
|
+
const o = { map: {}, allow: new Set() };
|
|
52
|
+
const a = process.argv.slice(2);
|
|
53
|
+
for (let i = 0; i < a.length; i++) {
|
|
54
|
+
const k = a[i];
|
|
55
|
+
if (k === '--json') { o.json = true; continue; }
|
|
56
|
+
const v = a[++i];
|
|
57
|
+
if (v === undefined) usage(`${k} needs a value`);
|
|
58
|
+
if (k === '--map') { const [x, y] = v.split('='); if (!y) usage('--map takes OLD=NEW'); o.map[x] = y; }
|
|
59
|
+
else if (k === '--allow-assertion-change') o.allow.add(v);
|
|
60
|
+
else if (['--before-src', '--after-src', '--before', '--after'].includes(k)) o[k.slice(2).replace('-src', 'Src')] = v;
|
|
61
|
+
else usage(`unknown option ${k}`);
|
|
62
|
+
}
|
|
63
|
+
if (!o.beforeSrc || !o.afterSrc) usage();
|
|
64
|
+
if (!!o.before !== !!o.after) usage('--before and --after go together');
|
|
65
|
+
return o;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** The contract of one assertion line: matcher names and literal values, in order; the subject is left out. */
|
|
69
|
+
/** Calls that find an element: their arguments are locators (the subject), not expected values. */
|
|
70
|
+
const LOCATOR_CALL = /\b(?:locator|getBy\w+|get_by_\w+|find_elements?|findElements?|FindElements?|By\.\w+|By\w*|querySelector(?:All)?|\$\$?|cy\.get|cy\.contains|element|elements|AppiumBy\.\w+)\s*\(/g;
|
|
71
|
+
function stripLocators(line) {
|
|
72
|
+
let out = line; let m;
|
|
73
|
+
LOCATOR_CALL.lastIndex = 0;
|
|
74
|
+
while ((m = LOCATOR_CALL.exec(out))) {
|
|
75
|
+
let depth = 0; let i = m.index + m[0].length - 1;
|
|
76
|
+
for (; i < out.length; i++) { if (out[i] === '(') depth++; else if (out[i] === ')') { depth--; if (!depth) break; } }
|
|
77
|
+
out = `${out.slice(0, m.index)}SUBJECT${out.slice(i + 1)}`;
|
|
78
|
+
LOCATOR_CALL.lastIndex = m.index + 7;
|
|
79
|
+
}
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
function contract(raw) {
|
|
83
|
+
const line = stripLocators(raw);
|
|
84
|
+
const literals = [...line.matchAll(/(['"`])((?:\\.|(?!\1).)*)\1|\b\d+(?:\.\d+)?\b|\b(?:true|false|True|False|null|None)\b/g)].map((m) => (m[1] ? `"${m[2]}"` : m[0]));
|
|
85
|
+
const words = [...line.replace(/(['"`])(?:\\.|(?!\1).)*\1/g, ' ').matchAll(/[A-Za-z_]\w*/g)].map((m) => m[0]).filter((w) => MATCHER.test(w));
|
|
86
|
+
const ops = (line.match(/^\s*assert\b.*?(==|!=|>=|<=|\bnot in\b|\bin\b|\bis not\b|\bis\b|>|<)/) || [])[1];
|
|
87
|
+
return [...words, ...(ops ? [ops] : []), ...literals].join(' ');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Tests in a suite folder: key file#name → { assertions: [contract], skipped, line }. */
|
|
91
|
+
function tests(root) {
|
|
92
|
+
const s = scan(root);
|
|
93
|
+
const out = {};
|
|
94
|
+
for (const t of s.tests) {
|
|
95
|
+
const lang = LANG(t.file);
|
|
96
|
+
if (!lang) continue;
|
|
97
|
+
let text; try { text = fs.readFileSync(path.join(root, t.file), 'utf8'); } catch { continue; }
|
|
98
|
+
const lines = text.split('\n');
|
|
99
|
+
for (const fn of functionsOf(text, lang)) {
|
|
100
|
+
const above = lines.slice(Math.max(0, fn.line - 5), fn.line).join('\n');
|
|
101
|
+
const isTest = /^test: /.test(fn.name) || (lang === 'py' && /^test_/.test(fn.name))
|
|
102
|
+
|| ((lang === 'java' || lang === 'cs') && /@Test\b|\[(?:Test|Fact|Theory|TestCase|TestMethod)\b/.test(above));
|
|
103
|
+
if (!isTest) continue;
|
|
104
|
+
const decl = lines[fn.line - 1] || '';
|
|
105
|
+
const body = fn.body.split('\n');
|
|
106
|
+
out[`${t.file}#${fn.name}`] = {
|
|
107
|
+
line: fn.line,
|
|
108
|
+
assertions: body.filter((l) => ASSERT[lang].test(l)).map(contract),
|
|
109
|
+
skipped: SKIP[lang].test(`${above}\n${decl}`) || body.some((l) => /\btest\.skip\(\s*\)|\bpytest\.skip\(|Assert\.Ignore\(|throw new SkipException/.test(l)),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return out;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function results(file) {
|
|
117
|
+
let r; try { r = JSON.parse(fs.readFileSync(file, 'utf8')); } catch { usage(`can't read results ${file}`); }
|
|
118
|
+
const out = {};
|
|
119
|
+
for (const t of r.tests || []) out[`${t.file}::${t.title}`] = t.status;
|
|
120
|
+
return out;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function main() {
|
|
124
|
+
const o = args();
|
|
125
|
+
const fail = []; const notes = [];
|
|
126
|
+
const mapped = (k) => o.map[k] || k;
|
|
127
|
+
|
|
128
|
+
if (o.before) {
|
|
129
|
+
const b = results(o.before); const a = results(o.after);
|
|
130
|
+
for (const [k, st] of Object.entries(b)) {
|
|
131
|
+
const now = a[mapped(k)];
|
|
132
|
+
if (now === undefined) fail.push(`results: ${k} is gone (map it with --map if it was renamed)`);
|
|
133
|
+
else if (st === 'passed' && (now === 'failed' || now === 'flaky')) fail.push(`results: ${k} passed before, now ${now}`);
|
|
134
|
+
else if (st !== 'skipped' && now === 'skipped') fail.push(`results: ${k} is now skipped`);
|
|
135
|
+
else if (st === 'failed' && now === 'passed') notes.push(`results: ${k} failed before, passes now`);
|
|
136
|
+
}
|
|
137
|
+
const added = Object.keys(a).filter((k) => !Object.keys(b).some((x) => mapped(x) === k));
|
|
138
|
+
if (added.length) notes.push(`results: ${added.length} new test(s)`);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const B = tests(o.beforeSrc); const A = tests(o.afterSrc);
|
|
142
|
+
for (const [k, t] of Object.entries(B)) {
|
|
143
|
+
const n = A[mapped(k)];
|
|
144
|
+
if (!n) { fail.push(`source: ${k} is gone (map it with --map if it was renamed or moved)`); continue; }
|
|
145
|
+
if (!t.skipped && n.skipped) fail.push(`source: ${mapped(k)} gained a skip marker`);
|
|
146
|
+
if (n.assertions.length < t.assertions.length) fail.push(`source: ${mapped(k)} has ${n.assertions.length} assertion(s), had ${t.assertions.length}`);
|
|
147
|
+
const left = [...n.assertions];
|
|
148
|
+
const lost = [];
|
|
149
|
+
for (const c of t.assertions) { const i = left.indexOf(c); if (i >= 0) left.splice(i, 1); else lost.push(c); }
|
|
150
|
+
if (lost.length && !(o.allow.has('all') || o.allow.has(k) || o.allow.has(mapped(k)))) {
|
|
151
|
+
fail.push(`source: ${mapped(k)} changed what it asserts (needs H8): before [${lost.join(' | ')}] now [${left.join(' | ') || 'nothing'}]`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const newTests = Object.keys(A).filter((k) => !Object.keys(B).some((x) => mapped(x) === k));
|
|
155
|
+
if (newTests.length) notes.push(`source: ${newTests.length} new test(s)`);
|
|
156
|
+
|
|
157
|
+
if (o.json) process.stdout.write(`${JSON.stringify({ parity: !fail.length, failures: fail, notes, tests_before: Object.keys(B).length, tests_after: Object.keys(A).length }, null, 2)}\n`);
|
|
158
|
+
else {
|
|
159
|
+
fail.forEach((l) => console.log(`FAIL ${l}`));
|
|
160
|
+
notes.forEach((l) => console.log(`note ${l}`));
|
|
161
|
+
console.log(`parity: ${fail.length ? 'broken' : 'holds'} · tests before ${Object.keys(B).length}, after ${Object.keys(A).length} · ${fail.length} failure(s)`);
|
|
162
|
+
}
|
|
163
|
+
process.exit(fail.length ? 1 : 0);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
main();
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Checks a report's shape and style before it is shown: a run report (documentation skill,
|
|
4
|
+
* templates/project-context/report.md) or an assessment (templates/project-context/assessment.md), told apart by the
|
|
5
|
+
* first line (`# … · test report` or `# … · assessment`).
|
|
6
|
+
*
|
|
7
|
+
* Usage (from the workspace root): node .claude/skills/orion/scripts/report_check.mjs <report.md> [<report.md> …] [--json]
|
|
8
|
+
* Run report: `# <story> · test report`; a bold verdict (✅ ⚠️ ❌) in the first lines; the facts table (| Story |);
|
|
9
|
+
* Coverage, What was added, Run it yourself; a <details> block for engineers; the footer.
|
|
10
|
+
* Assessment: `# <suite> · assessment`; the verdict; the facts table (| Suite |, | Baseline run |, | Findings |); Top
|
|
11
|
+
* issues, Fix it (`/orion fix A-…`); a <details> block holding the full findings table (| F | Rule | …); the footer. Above the
|
|
12
|
+
* details block: at most 45 lines, and no decision ids (D-nnn), gate numbers, agent names, rule codes, temporary-folder
|
|
13
|
+
* paths or a bare "unknown". Each finding names what to change.
|
|
14
|
+
* Exit code: 0 passes · 1 findings · 2 wrong arguments or unreadable file.
|
|
15
|
+
*/
|
|
16
|
+
import fs from 'node:fs';
|
|
17
|
+
import { pathToFileURL } from 'node:url';
|
|
18
|
+
|
|
19
|
+
const AGENTS = 'requirement-analyst|environment-discovery|codebase-analyst|automation-strategist|implementer|reviewer|executor|failure-analyst|evidence-validator|test-reporter|orchestrator';
|
|
20
|
+
const BANNED = [
|
|
21
|
+
[/\bD-\d{3}\b/, 'a decision id: move it to the details block'],
|
|
22
|
+
[/\bGate \d\b/, 'a gate number: say what happened in plain words'],
|
|
23
|
+
[new RegExp(`\\b(${AGENTS})\\b`), 'an agent name: say what was done, not who did it'],
|
|
24
|
+
[/\b[UPM]\d{1,2}\b(?!\/)/, 'a rule code: describe the issue in plain words'],
|
|
25
|
+
[/\/tmp\/|\\Temp\\|AppData/, 'a temporary-folder path: use a path inside the workspace'],
|
|
26
|
+
[/\(unknown\)|: unknown\b|\bunknown\./, 'a bare "unknown": say what was not checked and why'],
|
|
27
|
+
];
|
|
28
|
+
const MAX_TOP = 45;
|
|
29
|
+
|
|
30
|
+
/** Findings for one report text. */
|
|
31
|
+
export function checkReport(text) {
|
|
32
|
+
const out = [];
|
|
33
|
+
const lines = text.replace(/\r\n/g, '\n').split('\n');
|
|
34
|
+
while (lines.length && lines[lines.length - 1].trim() === '') lines.pop();
|
|
35
|
+
const assess = / · assessment$/.test(lines[0] || '');
|
|
36
|
+
if (!/^# .+ · (test report|assessment)$/.test(lines[0] || '')) out.push("first line: '# <story title> · test report' (or '# <suite folder> · assessment')");
|
|
37
|
+
const verdicts = assess ? '✅ In good shape · ⚠️ Works, needs fixes · ❌ Serious issues' : '✅ Ready to accept · ⚠️ Ready, with notes · ❌ Not ready';
|
|
38
|
+
if (!lines.slice(1, 5).some((l) => /^\*\*.*(✅|⚠️|❌)/.test(l))) out.push(`no bold verdict (${verdicts}) in the first lines`);
|
|
39
|
+
const facts = assess ? [/^\| Suite \|/m, /^\| Baseline run \|/m, /^\| Findings \|/m] : [/^\| Story \|/m];
|
|
40
|
+
if (!facts.every((rx) => rx.test(text))) out.push(assess ? 'no facts table (| Suite |, | Baseline run |, | Findings |, | Date |)' : 'no facts table (| Story | … |, | App |, | Tests |, | Runs |, | Date |)');
|
|
41
|
+
const need = assess ? ['## Top issues', '## Fix it', '/orion fix A-', '<details>', '<summary>All findings and details for engineers</summary>']
|
|
42
|
+
: ['## Coverage', '## What was added', '## Run it yourself', '<details>', '<summary>Details for engineers</summary>'];
|
|
43
|
+
for (const h of need) if (!text.includes(h)) out.push(`missing: ${h}`);
|
|
44
|
+
if (assess && !/^\| F \| Rule \|/m.test(text.split('<details>')[1] || '')) out.push('the full findings table (| F | Rule | … |) is not inside the details block');
|
|
45
|
+
const foot = assess ? '_Assessment A-' : '_Written by Orion';
|
|
46
|
+
if (!(lines[lines.length - 1] || '').startsWith(foot)) out.push(`no footer ('${foot}…_')`);
|
|
47
|
+
const top = text.split('<details>')[0];
|
|
48
|
+
const n = top.split('\n').length;
|
|
49
|
+
if (n > MAX_TOP) out.push(`${n} lines above the details block (at most ${MAX_TOP}): move detail into the block`);
|
|
50
|
+
for (const [rx, what] of BANNED) {
|
|
51
|
+
const m = top.match(rx);
|
|
52
|
+
if (m) out.push(`above the details block, ${what} (${JSON.stringify(m[0])})`);
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function main() {
|
|
58
|
+
const args = process.argv.slice(2);
|
|
59
|
+
const json = args.includes('--json');
|
|
60
|
+
const files = args.filter((a) => a !== '--json');
|
|
61
|
+
if (!files.length) { console.log('usage: report_check.mjs <report.md> […] [--json]'); process.exit(2); }
|
|
62
|
+
const all = {};
|
|
63
|
+
for (const f of files) {
|
|
64
|
+
let text;
|
|
65
|
+
try { text = fs.readFileSync(f, 'utf8'); } catch { console.log(`can't read ${f}`); process.exit(2); }
|
|
66
|
+
all[f] = checkReport(text);
|
|
67
|
+
}
|
|
68
|
+
const total = Object.values(all).reduce((s, x) => s + x.length, 0);
|
|
69
|
+
if (json) console.log(JSON.stringify(all, null, 2));
|
|
70
|
+
else {
|
|
71
|
+
for (const [f, fs_] of Object.entries(all)) for (const x of fs_) console.log(`${f}: ${x}`);
|
|
72
|
+
console.log(`report check: ${total} finding(s)`);
|
|
73
|
+
}
|
|
74
|
+
process.exit(total ? 1 : 0);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) main();
|