@inluxc/propmaster 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +696 -2
- package/dist/src/annotations/index.d.ts +11 -0
- package/dist/src/annotations/index.d.ts.map +1 -0
- package/dist/src/annotations/index.js +11 -0
- package/dist/src/annotations/index.js.map +1 -0
- package/dist/src/annotations/recorder.d.ts +57 -0
- package/dist/src/annotations/recorder.d.ts.map +1 -0
- package/dist/src/annotations/recorder.js +100 -0
- package/dist/src/annotations/recorder.js.map +1 -0
- package/dist/src/annotations/truncation.d.ts +34 -0
- package/dist/src/annotations/truncation.d.ts.map +1 -0
- package/dist/src/annotations/truncation.js +54 -0
- package/dist/src/annotations/truncation.js.map +1 -0
- package/dist/src/auth/apply.d.ts +15 -0
- package/dist/src/auth/apply.d.ts.map +1 -0
- package/dist/src/auth/apply.js +21 -0
- package/dist/src/auth/apply.js.map +1 -0
- package/dist/src/auth/setup.d.ts +56 -0
- package/dist/src/auth/setup.d.ts.map +1 -0
- package/dist/src/auth/setup.js +79 -0
- package/dist/src/auth/setup.js.map +1 -0
- package/dist/src/auth/state-file.d.ts +8 -0
- package/dist/src/auth/state-file.d.ts.map +1 -0
- package/dist/src/auth/state-file.js +13 -0
- package/dist/src/auth/state-file.js.map +1 -0
- package/dist/src/auth/token-manager.d.ts +61 -0
- package/dist/src/auth/token-manager.d.ts.map +1 -0
- package/dist/src/auth/token-manager.js +200 -0
- package/dist/src/auth/token-manager.js.map +1 -0
- package/dist/src/cli/banner.d.ts +23 -0
- package/dist/src/cli/banner.d.ts.map +1 -0
- package/dist/src/cli/banner.js +67 -0
- package/dist/src/cli/banner.js.map +1 -0
- package/dist/src/cli/check-tests.d.ts +143 -0
- package/dist/src/cli/check-tests.d.ts.map +1 -0
- package/dist/src/cli/check-tests.js +541 -0
- package/dist/src/cli/check-tests.js.map +1 -0
- package/dist/src/cli/coverage.d.ts +14 -0
- package/dist/src/cli/coverage.d.ts.map +1 -0
- package/dist/src/cli/coverage.js +97 -0
- package/dist/src/cli/coverage.js.map +1 -0
- package/dist/src/cli/doctor.d.ts +82 -0
- package/dist/src/cli/doctor.d.ts.map +1 -0
- package/dist/src/cli/doctor.js +656 -0
- package/dist/src/cli/doctor.js.map +1 -0
- package/dist/src/cli/env.d.ts +76 -0
- package/dist/src/cli/env.d.ts.map +1 -0
- package/dist/src/cli/env.js +344 -0
- package/dist/src/cli/env.js.map +1 -0
- package/dist/src/cli/failures.d.ts +29 -0
- package/dist/src/cli/failures.d.ts.map +1 -0
- package/dist/src/cli/failures.js +114 -0
- package/dist/src/cli/failures.js.map +1 -0
- package/dist/src/cli/fixture-catalog.d.ts +83 -0
- package/dist/src/cli/fixture-catalog.d.ts.map +1 -0
- package/dist/src/cli/fixture-catalog.js +773 -0
- package/dist/src/cli/fixture-catalog.js.map +1 -0
- package/dist/src/cli/fixture.d.ts +149 -0
- package/dist/src/cli/fixture.d.ts.map +1 -0
- package/dist/src/cli/fixture.js +742 -0
- package/dist/src/cli/fixture.js.map +1 -0
- package/dist/src/cli/flaky.d.ts +25 -0
- package/dist/src/cli/flaky.d.ts.map +1 -0
- package/dist/src/cli/flaky.js +96 -0
- package/dist/src/cli/flaky.js.map +1 -0
- package/dist/src/cli/generate.d.ts +37 -0
- package/dist/src/cli/generate.d.ts.map +1 -0
- package/dist/src/cli/generate.js +230 -0
- package/dist/src/cli/generate.js.map +1 -0
- package/dist/src/cli/init.d.ts +36 -0
- package/dist/src/cli/init.d.ts.map +1 -0
- package/dist/src/cli/init.js +1039 -0
- package/dist/src/cli/init.js.map +1 -0
- package/dist/src/cli/json-edit.d.ts +58 -0
- package/dist/src/cli/json-edit.d.ts.map +1 -0
- package/dist/src/cli/json-edit.js +250 -0
- package/dist/src/cli/json-edit.js.map +1 -0
- package/dist/src/cli/layout.d.ts +31 -0
- package/dist/src/cli/layout.d.ts.map +1 -0
- package/dist/src/cli/layout.js +175 -0
- package/dist/src/cli/layout.js.map +1 -0
- package/dist/src/cli/mcp-setup.d.ts +141 -0
- package/dist/src/cli/mcp-setup.d.ts.map +1 -0
- package/dist/src/cli/mcp-setup.js +548 -0
- package/dist/src/cli/mcp-setup.js.map +1 -0
- package/dist/src/cli/organize.d.ts +136 -0
- package/dist/src/cli/organize.d.ts.map +1 -0
- package/dist/src/cli/organize.js +467 -0
- package/dist/src/cli/organize.js.map +1 -0
- package/dist/src/cli/prompts.d.ts +102 -0
- package/dist/src/cli/prompts.d.ts.map +1 -0
- package/dist/src/cli/prompts.js +346 -0
- package/dist/src/cli/prompts.js.map +1 -0
- package/dist/src/cli/standards.d.ts +160 -0
- package/dist/src/cli/standards.d.ts.map +1 -0
- package/dist/src/cli/standards.js +389 -0
- package/dist/src/cli/standards.js.map +1 -0
- package/dist/src/cli/style.d.ts +28 -0
- package/dist/src/cli/style.d.ts.map +1 -0
- package/dist/src/cli/style.js +57 -0
- package/dist/src/cli/style.js.map +1 -0
- package/dist/src/config/env-loader.d.ts +33 -0
- package/dist/src/config/env-loader.d.ts.map +1 -0
- package/dist/src/config/env-loader.js +72 -0
- package/dist/src/config/env-loader.js.map +1 -0
- package/dist/src/config/index.d.ts +10 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/index.js +10 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/loader.d.ts +66 -0
- package/dist/src/config/loader.d.ts.map +1 -0
- package/dist/src/config/loader.js +810 -0
- package/dist/src/config/loader.js.map +1 -0
- package/dist/src/config/schema.d.ts +596 -0
- package/dist/src/config/schema.d.ts.map +1 -0
- package/dist/src/config/schema.js +9 -0
- package/dist/src/config/schema.js.map +1 -0
- package/dist/src/containers/container-manager.d.ts +157 -0
- package/dist/src/containers/container-manager.d.ts.map +1 -0
- package/dist/src/containers/container-manager.js +627 -0
- package/dist/src/containers/container-manager.js.map +1 -0
- package/dist/src/coverage/code-coverage.d.ts +89 -0
- package/dist/src/coverage/code-coverage.d.ts.map +1 -0
- package/dist/src/coverage/code-coverage.js +395 -0
- package/dist/src/coverage/code-coverage.js.map +1 -0
- package/dist/src/coverage/inventory.d.ts +80 -0
- package/dist/src/coverage/inventory.d.ts.map +1 -0
- package/dist/src/coverage/inventory.js +417 -0
- package/dist/src/coverage/inventory.js.map +1 -0
- package/dist/src/coverage/languages.d.ts +34 -0
- package/dist/src/coverage/languages.d.ts.map +1 -0
- package/dist/src/coverage/languages.js +156 -0
- package/dist/src/coverage/languages.js.map +1 -0
- package/dist/src/coverage/report.d.ts +128 -0
- package/dist/src/coverage/report.d.ts.map +1 -0
- package/dist/src/coverage/report.js +472 -0
- package/dist/src/coverage/report.js.map +1 -0
- package/dist/src/errors.d.ts +164 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +267 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/fixtures/amqp.fixture.d.ts +163 -0
- package/dist/src/fixtures/amqp.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/amqp.fixture.js +494 -0
- package/dist/src/fixtures/amqp.fixture.js.map +1 -0
- package/dist/src/fixtures/appium.fixture.d.ts +112 -0
- package/dist/src/fixtures/appium.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/appium.fixture.js +309 -0
- package/dist/src/fixtures/appium.fixture.js.map +1 -0
- package/dist/src/fixtures/aws.d.ts +44 -0
- package/dist/src/fixtures/aws.d.ts.map +1 -0
- package/dist/src/fixtures/aws.js +93 -0
- package/dist/src/fixtures/aws.js.map +1 -0
- package/dist/src/fixtures/cassandra.fixture.d.ts +179 -0
- package/dist/src/fixtures/cassandra.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/cassandra.fixture.js +489 -0
- package/dist/src/fixtures/cassandra.fixture.js.map +1 -0
- package/dist/src/fixtures/clickhouse.fixture.d.ts +171 -0
- package/dist/src/fixtures/clickhouse.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/clickhouse.fixture.js +514 -0
- package/dist/src/fixtures/clickhouse.fixture.js.map +1 -0
- package/dist/src/fixtures/database.fixture.d.ts +63 -0
- package/dist/src/fixtures/database.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/database.fixture.js +407 -0
- package/dist/src/fixtures/database.fixture.js.map +1 -0
- package/dist/src/fixtures/dynamodb.fixture.d.ts +243 -0
- package/dist/src/fixtures/dynamodb.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/dynamodb.fixture.js +580 -0
- package/dist/src/fixtures/dynamodb.fixture.js.map +1 -0
- package/dist/src/fixtures/graphql.fixture.d.ts +107 -0
- package/dist/src/fixtures/graphql.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/graphql.fixture.js +158 -0
- package/dist/src/fixtures/graphql.fixture.js.map +1 -0
- package/dist/src/fixtures/grpc.fixture.d.ts +167 -0
- package/dist/src/fixtures/grpc.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/grpc.fixture.js +635 -0
- package/dist/src/fixtures/grpc.fixture.js.map +1 -0
- package/dist/src/fixtures/inbox.fixture.d.ts +136 -0
- package/dist/src/fixtures/inbox.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/inbox.fixture.js +239 -0
- package/dist/src/fixtures/inbox.fixture.js.map +1 -0
- package/dist/src/fixtures/index.d.ts +174 -0
- package/dist/src/fixtures/index.d.ts.map +1 -0
- package/dist/src/fixtures/index.js +379 -0
- package/dist/src/fixtures/index.js.map +1 -0
- package/dist/src/fixtures/kafka-driver.d.ts +108 -0
- package/dist/src/fixtures/kafka-driver.d.ts.map +1 -0
- package/dist/src/fixtures/kafka-driver.js +113 -0
- package/dist/src/fixtures/kafka-driver.js.map +1 -0
- package/dist/src/fixtures/kafka.fixture.d.ts +75 -0
- package/dist/src/fixtures/kafka.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/kafka.fixture.js +188 -0
- package/dist/src/fixtures/kafka.fixture.js.map +1 -0
- package/dist/src/fixtures/mock-server.fixture.d.ts +142 -0
- package/dist/src/fixtures/mock-server.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/mock-server.fixture.js +271 -0
- package/dist/src/fixtures/mock-server.fixture.js.map +1 -0
- package/dist/src/fixtures/mongodb.fixture.d.ts +121 -0
- package/dist/src/fixtures/mongodb.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/mongodb.fixture.js +258 -0
- package/dist/src/fixtures/mongodb.fixture.js.map +1 -0
- package/dist/src/fixtures/neo4j.fixture.d.ts +72 -0
- package/dist/src/fixtures/neo4j.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/neo4j.fixture.js +202 -0
- package/dist/src/fixtures/neo4j.fixture.js.map +1 -0
- package/dist/src/fixtures/openapi.fixture.d.ts +101 -0
- package/dist/src/fixtures/openapi.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/openapi.fixture.js +266 -0
- package/dist/src/fixtures/openapi.fixture.js.map +1 -0
- package/dist/src/fixtures/optional-package.d.ts +54 -0
- package/dist/src/fixtures/optional-package.d.ts.map +1 -0
- package/dist/src/fixtures/optional-package.js +79 -0
- package/dist/src/fixtures/optional-package.js.map +1 -0
- package/dist/src/fixtures/otp.fixture.d.ts +60 -0
- package/dist/src/fixtures/otp.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/otp.fixture.js +101 -0
- package/dist/src/fixtures/otp.fixture.js.map +1 -0
- package/dist/src/fixtures/realtime.fixture.d.ts +205 -0
- package/dist/src/fixtures/realtime.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/realtime.fixture.js +606 -0
- package/dist/src/fixtures/realtime.fixture.js.map +1 -0
- package/dist/src/fixtures/redis.fixture.d.ts +55 -0
- package/dist/src/fixtures/redis.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/redis.fixture.js +209 -0
- package/dist/src/fixtures/redis.fixture.js.map +1 -0
- package/dist/src/fixtures/s3.fixture.d.ts +126 -0
- package/dist/src/fixtures/s3.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/s3.fixture.js +296 -0
- package/dist/src/fixtures/s3.fixture.js.map +1 -0
- package/dist/src/fixtures/search.fixture.d.ts +178 -0
- package/dist/src/fixtures/search.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/search.fixture.js +472 -0
- package/dist/src/fixtures/search.fixture.js.map +1 -0
- package/dist/src/fixtures/sqs.fixture.d.ts +172 -0
- package/dist/src/fixtures/sqs.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/sqs.fixture.js +428 -0
- package/dist/src/fixtures/sqs.fixture.js.map +1 -0
- package/dist/src/index.d.ts +43 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +48 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/mcp/guards.d.ts +21 -0
- package/dist/src/mcp/guards.d.ts.map +1 -0
- package/dist/src/mcp/guards.js +118 -0
- package/dist/src/mcp/guards.js.map +1 -0
- package/dist/src/mcp/project-tools.d.ts +14 -0
- package/dist/src/mcp/project-tools.d.ts.map +1 -0
- package/dist/src/mcp/project-tools.js +252 -0
- package/dist/src/mcp/project-tools.js.map +1 -0
- package/dist/src/mcp/protocol.d.ts +116 -0
- package/dist/src/mcp/protocol.d.ts.map +1 -0
- package/dist/src/mcp/protocol.js +199 -0
- package/dist/src/mcp/protocol.js.map +1 -0
- package/dist/src/mcp/server.d.ts +43 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +244 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/test-tools.d.ts +65 -0
- package/dist/src/mcp/test-tools.d.ts.map +1 -0
- package/dist/src/mcp/test-tools.js +380 -0
- package/dist/src/mcp/test-tools.js.map +1 -0
- package/dist/src/mcp/tools.d.ts +49 -0
- package/dist/src/mcp/tools.d.ts.map +1 -0
- package/dist/src/mcp/tools.js +726 -0
- package/dist/src/mcp/tools.js.map +1 -0
- package/dist/src/network-error.d.ts +11 -0
- package/dist/src/network-error.d.ts.map +1 -0
- package/dist/src/network-error.js +34 -0
- package/dist/src/network-error.js.map +1 -0
- package/dist/src/openapi/contract.d.ts +98 -0
- package/dist/src/openapi/contract.d.ts.map +1 -0
- package/dist/src/openapi/contract.js +407 -0
- package/dist/src/openapi/contract.js.map +1 -0
- package/dist/src/openapi/generate.d.ts +89 -0
- package/dist/src/openapi/generate.d.ts.map +1 -0
- package/dist/src/openapi/generate.js +607 -0
- package/dist/src/openapi/generate.js.map +1 -0
- package/dist/src/openapi/load.d.ts +8 -0
- package/dist/src/openapi/load.d.ts.map +1 -0
- package/dist/src/openapi/load.js +26 -0
- package/dist/src/openapi/load.js.map +1 -0
- package/dist/src/package-manager.d.ts +58 -0
- package/dist/src/package-manager.d.ts.map +1 -0
- package/dist/src/package-manager.js +137 -0
- package/dist/src/package-manager.js.map +1 -0
- package/dist/src/reporter/history.d.ts +85 -0
- package/dist/src/reporter/history.d.ts.map +1 -0
- package/dist/src/reporter/history.js +147 -0
- package/dist/src/reporter/history.js.map +1 -0
- package/dist/src/reporter/index.d.ts +59 -0
- package/dist/src/reporter/index.d.ts.map +1 -0
- package/dist/src/reporter/index.js +201 -0
- package/dist/src/reporter/index.js.map +1 -0
- package/dist/src/reporter/last-run.d.ts +88 -0
- package/dist/src/reporter/last-run.d.ts.map +1 -0
- package/dist/src/reporter/last-run.js +133 -0
- package/dist/src/reporter/last-run.js.map +1 -0
- package/dist/src/reporter/quarantine.d.ts +62 -0
- package/dist/src/reporter/quarantine.d.ts.map +1 -0
- package/dist/src/reporter/quarantine.js +148 -0
- package/dist/src/reporter/quarantine.js.map +1 -0
- package/dist/src/secrets/index.d.ts +4 -0
- package/dist/src/secrets/index.d.ts.map +1 -0
- package/dist/src/secrets/index.js +3 -0
- package/dist/src/secrets/index.js.map +1 -0
- package/dist/src/secrets/provider.interface.d.ts +30 -0
- package/dist/src/secrets/provider.interface.d.ts.map +1 -0
- package/dist/src/secrets/provider.interface.js +2 -0
- package/dist/src/secrets/provider.interface.js.map +1 -0
- package/dist/src/secrets/providers/aws.provider.d.ts +33 -0
- package/dist/src/secrets/providers/aws.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/aws.provider.js +88 -0
- package/dist/src/secrets/providers/aws.provider.js.map +1 -0
- package/dist/src/secrets/providers/azure.provider.d.ts +26 -0
- package/dist/src/secrets/providers/azure.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/azure.provider.js +71 -0
- package/dist/src/secrets/providers/azure.provider.js.map +1 -0
- package/dist/src/secrets/providers/env-file.provider.d.ts +29 -0
- package/dist/src/secrets/providers/env-file.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/env-file.provider.js +56 -0
- package/dist/src/secrets/providers/env-file.provider.js.map +1 -0
- package/dist/src/secrets/providers/gitlab.provider.d.ts +26 -0
- package/dist/src/secrets/providers/gitlab.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/gitlab.provider.js +67 -0
- package/dist/src/secrets/providers/gitlab.provider.js.map +1 -0
- package/dist/src/secrets/providers/index.d.ts +52 -0
- package/dist/src/secrets/providers/index.d.ts.map +1 -0
- package/dist/src/secrets/providers/index.js +81 -0
- package/dist/src/secrets/providers/index.js.map +1 -0
- package/dist/src/secrets/providers/openbao.provider.d.ts +28 -0
- package/dist/src/secrets/providers/openbao.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/openbao.provider.js +29 -0
- package/dist/src/secrets/providers/openbao.provider.js.map +1 -0
- package/dist/src/secrets/providers/vault-compatible.d.ts +140 -0
- package/dist/src/secrets/providers/vault-compatible.d.ts.map +1 -0
- package/dist/src/secrets/providers/vault-compatible.js +405 -0
- package/dist/src/secrets/providers/vault-compatible.js.map +1 -0
- package/dist/src/secrets/providers/vault.provider.d.ts +27 -0
- package/dist/src/secrets/providers/vault.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/vault.provider.js +23 -0
- package/dist/src/secrets/providers/vault.provider.js.map +1 -0
- package/dist/src/secrets/secrets-manager.d.ts +67 -0
- package/dist/src/secrets/secrets-manager.d.ts.map +1 -0
- package/dist/src/secrets/secrets-manager.js +255 -0
- package/dist/src/secrets/secrets-manager.js.map +1 -0
- package/dist/src/steps/amqp.steps.d.ts +37 -0
- package/dist/src/steps/amqp.steps.d.ts.map +1 -0
- package/dist/src/steps/amqp.steps.js +86 -0
- package/dist/src/steps/amqp.steps.js.map +1 -0
- package/dist/src/steps/appium.steps.d.ts +53 -0
- package/dist/src/steps/appium.steps.d.ts.map +1 -0
- package/dist/src/steps/appium.steps.js +109 -0
- package/dist/src/steps/appium.steps.js.map +1 -0
- package/dist/src/steps/aws.steps.d.ts +47 -0
- package/dist/src/steps/aws.steps.d.ts.map +1 -0
- package/dist/src/steps/aws.steps.js +116 -0
- package/dist/src/steps/aws.steps.js.map +1 -0
- package/dist/src/steps/browser.steps.d.ts +54 -0
- package/dist/src/steps/browser.steps.d.ts.map +1 -0
- package/dist/src/steps/browser.steps.js +102 -0
- package/dist/src/steps/browser.steps.js.map +1 -0
- package/dist/src/steps/cassandra.steps.d.ts +32 -0
- package/dist/src/steps/cassandra.steps.d.ts.map +1 -0
- package/dist/src/steps/cassandra.steps.js +81 -0
- package/dist/src/steps/cassandra.steps.js.map +1 -0
- package/dist/src/steps/clickhouse.steps.d.ts +30 -0
- package/dist/src/steps/clickhouse.steps.d.ts.map +1 -0
- package/dist/src/steps/clickhouse.steps.js +73 -0
- package/dist/src/steps/clickhouse.steps.js.map +1 -0
- package/dist/src/steps/database.steps.d.ts +43 -0
- package/dist/src/steps/database.steps.d.ts.map +1 -0
- package/dist/src/steps/database.steps.js +79 -0
- package/dist/src/steps/database.steps.js.map +1 -0
- package/dist/src/steps/dynamodb.steps.d.ts +32 -0
- package/dist/src/steps/dynamodb.steps.d.ts.map +1 -0
- package/dist/src/steps/dynamodb.steps.js +89 -0
- package/dist/src/steps/dynamodb.steps.js.map +1 -0
- package/dist/src/steps/graphql.steps.d.ts +60 -0
- package/dist/src/steps/graphql.steps.d.ts.map +1 -0
- package/dist/src/steps/graphql.steps.js +76 -0
- package/dist/src/steps/graphql.steps.js.map +1 -0
- package/dist/src/steps/grpc.steps.d.ts +29 -0
- package/dist/src/steps/grpc.steps.d.ts.map +1 -0
- package/dist/src/steps/grpc.steps.js +68 -0
- package/dist/src/steps/grpc.steps.js.map +1 -0
- package/dist/src/steps/inbox.steps.d.ts +30 -0
- package/dist/src/steps/inbox.steps.d.ts.map +1 -0
- package/dist/src/steps/inbox.steps.js +72 -0
- package/dist/src/steps/inbox.steps.js.map +1 -0
- package/dist/src/steps/index.d.ts +43 -0
- package/dist/src/steps/index.d.ts.map +1 -0
- package/dist/src/steps/index.js +26 -0
- package/dist/src/steps/index.js.map +1 -0
- package/dist/src/steps/kafka.steps.d.ts +56 -0
- package/dist/src/steps/kafka.steps.d.ts.map +1 -0
- package/dist/src/steps/kafka.steps.js +61 -0
- package/dist/src/steps/kafka.steps.js.map +1 -0
- package/dist/src/steps/mock-server.steps.d.ts +21 -0
- package/dist/src/steps/mock-server.steps.d.ts.map +1 -0
- package/dist/src/steps/mock-server.steps.js +45 -0
- package/dist/src/steps/mock-server.steps.js.map +1 -0
- package/dist/src/steps/mongodb.steps.d.ts +107 -0
- package/dist/src/steps/mongodb.steps.d.ts.map +1 -0
- package/dist/src/steps/mongodb.steps.js +117 -0
- package/dist/src/steps/mongodb.steps.js.map +1 -0
- package/dist/src/steps/openapi.steps.d.ts +49 -0
- package/dist/src/steps/openapi.steps.d.ts.map +1 -0
- package/dist/src/steps/openapi.steps.js +113 -0
- package/dist/src/steps/openapi.steps.js.map +1 -0
- package/dist/src/steps/otp.steps.d.ts +43 -0
- package/dist/src/steps/otp.steps.d.ts.map +1 -0
- package/dist/src/steps/otp.steps.js +83 -0
- package/dist/src/steps/otp.steps.js.map +1 -0
- package/dist/src/steps/realtime.steps.d.ts +40 -0
- package/dist/src/steps/realtime.steps.d.ts.map +1 -0
- package/dist/src/steps/realtime.steps.js +116 -0
- package/dist/src/steps/realtime.steps.js.map +1 -0
- package/dist/src/steps/redis.steps.d.ts +54 -0
- package/dist/src/steps/redis.steps.d.ts.map +1 -0
- package/dist/src/steps/redis.steps.js +89 -0
- package/dist/src/steps/redis.steps.js.map +1 -0
- package/dist/src/steps/search.steps.d.ts +23 -0
- package/dist/src/steps/search.steps.d.ts.map +1 -0
- package/dist/src/steps/search.steps.js +54 -0
- package/dist/src/steps/search.steps.js.map +1 -0
- package/dist/src/test-data/factory.d.ts +82 -0
- package/dist/src/test-data/factory.d.ts.map +1 -0
- package/dist/src/test-data/factory.js +116 -0
- package/dist/src/test-data/factory.js.map +1 -0
- package/dist/src/test-data/index.d.ts +4 -0
- package/dist/src/test-data/index.d.ts.map +1 -0
- package/dist/src/test-data/index.js +4 -0
- package/dist/src/test-data/index.js.map +1 -0
- package/dist/src/test-data/registry.d.ts +37 -0
- package/dist/src/test-data/registry.d.ts.map +1 -0
- package/dist/src/test-data/registry.js +51 -0
- package/dist/src/test-data/registry.js.map +1 -0
- package/dist/src/test-data/tracking.d.ts +47 -0
- package/dist/src/test-data/tracking.d.ts.map +1 -0
- package/dist/src/test-data/tracking.js +166 -0
- package/dist/src/test-data/tracking.js.map +1 -0
- package/environments.json +263 -0
- package/package.json +299 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/steps/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,UAAU,EAAE,YAAY,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AAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1H,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Steps Module — Reusable Step Classes
|
|
3
|
+
*
|
|
4
|
+
* Exports all step classes for use in test specs.
|
|
5
|
+
* Step classes wrap common multi-step operations with test.step() tracing.
|
|
6
|
+
*/
|
|
7
|
+
export { OpenApiSteps } from './openapi.steps.js';
|
|
8
|
+
export { DatabaseSteps } from './database.steps.js';
|
|
9
|
+
export { GraphQLSteps } from './graphql.steps.js';
|
|
10
|
+
export { KafkaSteps } from './kafka.steps.js';
|
|
11
|
+
export { AmqpSteps } from './amqp.steps.js';
|
|
12
|
+
export { MongoDbSteps } from './mongodb.steps.js';
|
|
13
|
+
export { RedisSteps } from './redis.steps.js';
|
|
14
|
+
export { OtpSteps } from './otp.steps.js';
|
|
15
|
+
export { InboxSteps } from './inbox.steps.js';
|
|
16
|
+
export { MockServerSteps } from './mock-server.steps.js';
|
|
17
|
+
export { BrowserSteps } from './browser.steps.js';
|
|
18
|
+
export { AppiumSteps } from './appium.steps.js';
|
|
19
|
+
export { S3Steps, SqsSteps } from './aws.steps.js';
|
|
20
|
+
export { DynamoDbSteps } from './dynamodb.steps.js';
|
|
21
|
+
export { SearchSteps } from './search.steps.js';
|
|
22
|
+
export { GrpcSteps } from './grpc.steps.js';
|
|
23
|
+
export { RealtimeSteps } from './realtime.steps.js';
|
|
24
|
+
export { CassandraSteps } from './cassandra.steps.js';
|
|
25
|
+
export { ClickHouseSteps } from './clickhouse.steps.js';
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/steps/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kafka Step Class
|
|
3
|
+
*
|
|
4
|
+
* Reusable step sequences for Kafka client operations.
|
|
5
|
+
* Wraps common produce/consume patterns for test reuse.
|
|
6
|
+
*/
|
|
7
|
+
export interface KafkaMessage {
|
|
8
|
+
key: string | null;
|
|
9
|
+
value: string | Buffer;
|
|
10
|
+
topic: string;
|
|
11
|
+
partition: number;
|
|
12
|
+
offset: string;
|
|
13
|
+
}
|
|
14
|
+
export interface KafkaClient {
|
|
15
|
+
produce(topic: string, messages: Array<{
|
|
16
|
+
key?: string | null;
|
|
17
|
+
value: string | Buffer;
|
|
18
|
+
}>): Promise<void>;
|
|
19
|
+
consume(topic: string, options?: {
|
|
20
|
+
timeout?: number;
|
|
21
|
+
count?: number;
|
|
22
|
+
fromBeginning?: boolean;
|
|
23
|
+
}): Promise<KafkaMessage[]>;
|
|
24
|
+
}
|
|
25
|
+
export declare class KafkaSteps {
|
|
26
|
+
private kafkaClient;
|
|
27
|
+
constructor(kafkaClient: KafkaClient);
|
|
28
|
+
/**
|
|
29
|
+
* Produces messages to a Kafka topic.
|
|
30
|
+
*/
|
|
31
|
+
produce(description: string, topic: string, messages: Array<{
|
|
32
|
+
key?: string | null;
|
|
33
|
+
value: string | Buffer;
|
|
34
|
+
}>): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Consumes messages from a Kafka topic and returns them.
|
|
37
|
+
*/
|
|
38
|
+
consume(description: string, topic: string, options?: {
|
|
39
|
+
timeout?: number;
|
|
40
|
+
count?: number;
|
|
41
|
+
fromBeginning?: boolean;
|
|
42
|
+
}): Promise<KafkaMessage[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Consumes and asserts that messages were received.
|
|
45
|
+
*/
|
|
46
|
+
consumeExpectMessages(description: string, topic: string, options?: {
|
|
47
|
+
timeout?: number;
|
|
48
|
+
count?: number;
|
|
49
|
+
fromBeginning?: boolean;
|
|
50
|
+
}): Promise<KafkaMessage[]>;
|
|
51
|
+
/**
|
|
52
|
+
* Consumes and asserts no messages were received (timeout scenario).
|
|
53
|
+
*/
|
|
54
|
+
consumeExpectEmpty(description: string, topic: string, timeout?: number): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=kafka.steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kafka.steps.d.ts","sourceRoot":"","sources":["../../../src/steps/kafka.steps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,YAAY;IACzB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IACxB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC;QAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxG,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;CAC5H;AAED,qBAAa,UAAU;IACP,OAAO,CAAC,WAAW;IAA/B,YAAoB,WAAW,EAAE,WAAW,EAAI;IAEhD;;OAEG;IACG,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC;QAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAIjI;IAED;;OAEG;IACG,OAAO,CACT,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GACxE,OAAO,CAAC,YAAY,EAAE,CAAC,CAQzB;IAED;;OAEG;IACG,qBAAqB,CACvB,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,GACxE,OAAO,CAAC,YAAY,EAAE,CAAC,CAgBzB;IAED;;OAEG;IACG,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,MAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAQlG;CACJ"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kafka Step Class
|
|
3
|
+
*
|
|
4
|
+
* Reusable step sequences for Kafka client operations.
|
|
5
|
+
* Wraps common produce/consume patterns for test reuse.
|
|
6
|
+
*/
|
|
7
|
+
import { test, expect } from '../index.js';
|
|
8
|
+
export class KafkaSteps {
|
|
9
|
+
kafkaClient;
|
|
10
|
+
constructor(kafkaClient) {
|
|
11
|
+
this.kafkaClient = kafkaClient;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Produces messages to a Kafka topic.
|
|
15
|
+
*/
|
|
16
|
+
async produce(description, topic, messages) {
|
|
17
|
+
await test.step(`Step: ${description}`, async () => {
|
|
18
|
+
await this.kafkaClient.produce(topic, messages);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Consumes messages from a Kafka topic and returns them.
|
|
23
|
+
*/
|
|
24
|
+
async consume(description, topic, options) {
|
|
25
|
+
let messages = [];
|
|
26
|
+
await test.step(`Step: ${description}`, async () => {
|
|
27
|
+
messages = await this.kafkaClient.consume(topic, options);
|
|
28
|
+
});
|
|
29
|
+
return messages;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Consumes and asserts that messages were received.
|
|
33
|
+
*/
|
|
34
|
+
async consumeExpectMessages(description, topic, options) {
|
|
35
|
+
let messages = [];
|
|
36
|
+
await test.step(`Step: ${description}`, async () => {
|
|
37
|
+
messages = await this.kafkaClient.consume(topic, options);
|
|
38
|
+
expect(messages.length).toBeGreaterThan(0);
|
|
39
|
+
for (const msg of messages) {
|
|
40
|
+
expect(msg.topic).toBe(topic);
|
|
41
|
+
expect(msg.value).toBeDefined();
|
|
42
|
+
expect(msg.partition).toBeGreaterThanOrEqual(0);
|
|
43
|
+
expect(msg.offset).toBeDefined();
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return messages;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Consumes and asserts no messages were received (timeout scenario).
|
|
50
|
+
*/
|
|
51
|
+
async consumeExpectEmpty(description, topic, timeout = 2000) {
|
|
52
|
+
await test.step(`Step: ${description}`, async () => {
|
|
53
|
+
const messages = await this.kafkaClient.consume(topic, {
|
|
54
|
+
timeout,
|
|
55
|
+
fromBeginning: true,
|
|
56
|
+
});
|
|
57
|
+
expect(messages).toEqual([]);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=kafka.steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kafka.steps.js","sourceRoot":"","sources":["../../../src/steps/kafka.steps.ts"],"names":[],"mappings":"A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AC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC9B,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;gBAChC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;gBAChD,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;YACrC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB,CAAC,WAAmB,EAAE,KAAa,EAAE,OAAO,GAAW,IAAI;QAC/E,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,WAAW,EAAE,EAAE,KAAK,IAAI,EAAE;YAC/C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE;gBACnD,OAAO;gBACP,aAAa,EAAE,IAAI;aACtB,CAAC,CAAC;YACH,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock Server Step Class
|
|
3
|
+
*
|
|
4
|
+
* Reusable steps for stubbing third-party APIs (WireMock) and checking the
|
|
5
|
+
* calls the application made. Each method runs inside `test.step()`.
|
|
6
|
+
*/
|
|
7
|
+
import type { MockServer, RecordedRequest, RequestMatch, Stub, StubResponse } from '../fixtures/mock-server.fixture.js';
|
|
8
|
+
export type { MockServer, RecordedRequest } from '../fixtures/mock-server.fixture.js';
|
|
9
|
+
export declare class MockServerSteps {
|
|
10
|
+
private mockServer;
|
|
11
|
+
constructor(mockServer: MockServer);
|
|
12
|
+
/** Stubs a third-party endpoint for the rest of the test. */
|
|
13
|
+
stub(description: string, match: RequestMatch, response: StubResponse): Promise<Stub>;
|
|
14
|
+
/** Stubs a series of responses, e.g. two failures then a success, to test retries. */
|
|
15
|
+
stubSequence(description: string, match: RequestMatch, responses: StubResponse[]): Promise<Stub>;
|
|
16
|
+
/** Checks the application made the call (`times`, or at least once). */
|
|
17
|
+
verifyCalled(description: string, match: RequestMatch, times?: number): Promise<RecordedRequest[]>;
|
|
18
|
+
/** Checks the application did not make the call. */
|
|
19
|
+
verifyNotCalled(description: string, match: RequestMatch): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=mock-server.steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-server.steps.d.ts","sourceRoot":"","sources":["../../../src/steps/mock-server.steps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAExH,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAEtF,qBAAa,eAAe;IACZ,OAAO,CAAC,UAAU;IAA9B,YAAoB,UAAU,EAAE,UAAU,EAAI;IAE9C,6DAA6D;IACvD,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAO1F;IAED,sFAAsF;IAChF,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMrG;IAED,wEAAwE;IAClE,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAMvG;IAED,oDAAoD;IAC9C,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAI7E;CACJ"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock Server Step Class
|
|
3
|
+
*
|
|
4
|
+
* Reusable steps for stubbing third-party APIs (WireMock) and checking the
|
|
5
|
+
* calls the application made. Each method runs inside `test.step()`.
|
|
6
|
+
*/
|
|
7
|
+
import { test, expect } from '../index.js';
|
|
8
|
+
export class MockServerSteps {
|
|
9
|
+
mockServer;
|
|
10
|
+
constructor(mockServer) {
|
|
11
|
+
this.mockServer = mockServer;
|
|
12
|
+
}
|
|
13
|
+
/** Stubs a third-party endpoint for the rest of the test. */
|
|
14
|
+
async stub(description, match, response) {
|
|
15
|
+
let stub;
|
|
16
|
+
await test.step(`Step: ${description}`, async () => {
|
|
17
|
+
stub = await this.mockServer.stub(match, response);
|
|
18
|
+
expect(stub.id).toBeTruthy();
|
|
19
|
+
});
|
|
20
|
+
return stub;
|
|
21
|
+
}
|
|
22
|
+
/** Stubs a series of responses, e.g. two failures then a success, to test retries. */
|
|
23
|
+
async stubSequence(description, match, responses) {
|
|
24
|
+
let stub;
|
|
25
|
+
await test.step(`Step: ${description}`, async () => {
|
|
26
|
+
stub = await this.mockServer.stubSequence(match, responses);
|
|
27
|
+
});
|
|
28
|
+
return stub;
|
|
29
|
+
}
|
|
30
|
+
/** Checks the application made the call (`times`, or at least once). */
|
|
31
|
+
async verifyCalled(description, match, times) {
|
|
32
|
+
let found = [];
|
|
33
|
+
await test.step(`Step: ${description}`, async () => {
|
|
34
|
+
found = await this.mockServer.verify(match, times === undefined ? {} : { times });
|
|
35
|
+
});
|
|
36
|
+
return found;
|
|
37
|
+
}
|
|
38
|
+
/** Checks the application did not make the call. */
|
|
39
|
+
async verifyNotCalled(description, match) {
|
|
40
|
+
await test.step(`Step: ${description}`, async () => {
|
|
41
|
+
await this.mockServer.verify(match, { times: 0 });
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=mock-server.steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-server.steps.js","sourceRoot":"","sources":["../../../src/steps/mock-server.steps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAK3C,MAAM,OAAO,eAAe;IACJ,UAAU;IAA9B,YAAoB,UAAsB;0BAAtB,UAAU;IAAe,CAAC;IAE9C,6DAA6D;IAC7D,KAAK,CAAC,IAAI,CAAC,WAAmB,EAAE,KAAmB,EAAE,QAAsB;QACvE,IAAI,IAAW,CAAC;QAChB,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,WAAW,EAAE,EAAE,KAAK,IAAI,EAAE;YAC/C,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YACnD,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC;QACjC,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,sFAAsF;IACtF,KAAK,CAAC,YAAY,CAAC,WAAmB,EAAE,KAAmB,EAAE,SAAyB;QAClF,IAAI,IAAW,CAAC;QAChB,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,WAAW,EAAE,EAAE,KAAK,IAAI,EAAE;YAC/C,IAAI,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAChE,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,wEAAwE;IACxE,KAAK,CAAC,YAAY,CAAC,WAAmB,EAAE,KAAmB,EAAE,KAAc;QACvE,IAAI,KAAK,GAAsB,EAAE,CAAC;QAClC,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,WAAW,EAAE,EAAE,KAAK,IAAI,EAAE;YAC/C,KAAK,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACtF,CAAC,CAAC,CAAC;QACH,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,oDAAoD;IACpD,KAAK,CAAC,eAAe,CAAC,WAAmB,EAAE,KAAmB;QAC1D,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,WAAW,EAAE,EAAE,KAAK,IAAI,EAAE;YAC/C,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MongoDB Step Class
|
|
3
|
+
*
|
|
4
|
+
* Reusable step sequences for MongoDB client operations.
|
|
5
|
+
* Wraps common CRUD and aggregation patterns for test reuse.
|
|
6
|
+
*/
|
|
7
|
+
export interface MongoDbClient {
|
|
8
|
+
find<T = any>(collection: string, filter: Record<string, any>, options?: {
|
|
9
|
+
limit?: number;
|
|
10
|
+
skip?: number;
|
|
11
|
+
sort?: Record<string, 1 | -1>;
|
|
12
|
+
projection?: Record<string, 0 | 1>;
|
|
13
|
+
}): Promise<T[]>;
|
|
14
|
+
findOne<T = any>(collection: string, filter: Record<string, any>): Promise<T | null>;
|
|
15
|
+
insertOne(collection: string, document: Record<string, any>): Promise<{
|
|
16
|
+
acknowledged: boolean;
|
|
17
|
+
insertedId: any;
|
|
18
|
+
}>;
|
|
19
|
+
insertMany(collection: string, documents: Record<string, any>[]): Promise<{
|
|
20
|
+
acknowledged: boolean;
|
|
21
|
+
insertedCount: number;
|
|
22
|
+
insertedIds: Record<number, unknown>;
|
|
23
|
+
}>;
|
|
24
|
+
updateOne(collection: string, filter: Record<string, any>, update: Record<string, any>): Promise<{
|
|
25
|
+
acknowledged: boolean;
|
|
26
|
+
matchedCount: number;
|
|
27
|
+
modifiedCount: number;
|
|
28
|
+
upsertedId?: any;
|
|
29
|
+
}>;
|
|
30
|
+
updateMany(collection: string, filter: Record<string, any>, update: Record<string, any>): Promise<{
|
|
31
|
+
acknowledged: boolean;
|
|
32
|
+
matchedCount: number;
|
|
33
|
+
modifiedCount: number;
|
|
34
|
+
}>;
|
|
35
|
+
deleteOne(collection: string, filter: Record<string, any>): Promise<{
|
|
36
|
+
acknowledged: boolean;
|
|
37
|
+
deletedCount: number;
|
|
38
|
+
}>;
|
|
39
|
+
deleteMany(collection: string, filter: Record<string, any>): Promise<{
|
|
40
|
+
acknowledged: boolean;
|
|
41
|
+
deletedCount: number;
|
|
42
|
+
}>;
|
|
43
|
+
aggregate<T = any>(collection: string, pipeline: Record<string, any>[]): Promise<T[]>;
|
|
44
|
+
}
|
|
45
|
+
export declare class MongoDbSteps {
|
|
46
|
+
private mongoDbClient;
|
|
47
|
+
constructor(mongoDbClient: MongoDbClient);
|
|
48
|
+
/**
|
|
49
|
+
* Finds documents matching a filter.
|
|
50
|
+
*/
|
|
51
|
+
find<T = any>(description: string, collection: string, filter: Record<string, any>, options?: {
|
|
52
|
+
limit?: number;
|
|
53
|
+
skip?: number;
|
|
54
|
+
sort?: Record<string, 1 | -1>;
|
|
55
|
+
projection?: Record<string, 0 | 1>;
|
|
56
|
+
}): Promise<T[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Finds a single document matching a filter.
|
|
59
|
+
*/
|
|
60
|
+
findOne<T = any>(description: string, collection: string, filter: Record<string, any>): Promise<T | null>;
|
|
61
|
+
/**
|
|
62
|
+
* Inserts a single document and returns the result.
|
|
63
|
+
*/
|
|
64
|
+
insertOne(description: string, collection: string, document: Record<string, any>): Promise<{
|
|
65
|
+
acknowledged: boolean;
|
|
66
|
+
insertedId: any;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Inserts multiple documents and returns the result.
|
|
70
|
+
*/
|
|
71
|
+
insertMany(description: string, collection: string, documents: Record<string, any>[]): Promise<{
|
|
72
|
+
acknowledged: boolean;
|
|
73
|
+
insertedCount: number;
|
|
74
|
+
insertedIds: Record<number, unknown>;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Updates a single document matching a filter.
|
|
78
|
+
*/
|
|
79
|
+
updateOne(description: string, collection: string, filter: Record<string, any>, update: Record<string, any>): Promise<{
|
|
80
|
+
acknowledged: boolean;
|
|
81
|
+
matchedCount: number;
|
|
82
|
+
modifiedCount: number;
|
|
83
|
+
}>;
|
|
84
|
+
/**
|
|
85
|
+
* Deletes a single document matching a filter.
|
|
86
|
+
*/
|
|
87
|
+
deleteOne(description: string, collection: string, filter: Record<string, any>): Promise<{
|
|
88
|
+
acknowledged: boolean;
|
|
89
|
+
deletedCount: number;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* Deletes multiple documents matching a filter.
|
|
93
|
+
*/
|
|
94
|
+
deleteMany(description: string, collection: string, filter: Record<string, any>): Promise<{
|
|
95
|
+
acknowledged: boolean;
|
|
96
|
+
deletedCount: number;
|
|
97
|
+
}>;
|
|
98
|
+
/**
|
|
99
|
+
* Runs an aggregation pipeline and returns results.
|
|
100
|
+
*/
|
|
101
|
+
aggregate<T = any>(description: string, collection: string, pipeline: Record<string, any>[]): Promise<T[]>;
|
|
102
|
+
/**
|
|
103
|
+
* Verifies documents have expected properties.
|
|
104
|
+
*/
|
|
105
|
+
verifyDocumentProperties(description: string, documents: any[], properties: string[]): Promise<void>;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=mongodb.steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongodb.steps.d.ts","sourceRoot":"","sources":["../../../src/steps/mongodb.steps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,aAAa;IAC1B,IAAI,CAAC,CAAC,GAA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AS,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;QAAE,YAAY,EAAE,OAAO,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC,CAS9I;IAED;;OAEG;IACG,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;QAAE,YAAY,EAAE,OAAO,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC,CAS/I;IAED;;OAEG;IACG,SAAS,CAAC,CAAC,GAAG,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAU/G;IAED;;OAEG;IACG,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAQzG;CACJ"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MongoDB Step Class
|
|
3
|
+
*
|
|
4
|
+
* Reusable step sequences for MongoDB client operations.
|
|
5
|
+
* Wraps common CRUD and aggregation patterns for test reuse.
|
|
6
|
+
*/
|
|
7
|
+
import { test, expect } from '../index.js';
|
|
8
|
+
export class MongoDbSteps {
|
|
9
|
+
mongoDbClient;
|
|
10
|
+
constructor(mongoDbClient) {
|
|
11
|
+
this.mongoDbClient = mongoDbClient;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Finds documents matching a filter.
|
|
15
|
+
*/
|
|
16
|
+
async find(description, collection, filter, options) {
|
|
17
|
+
let documents = [];
|
|
18
|
+
await test.step(`Step: ${description}`, async () => {
|
|
19
|
+
documents = await this.mongoDbClient.find(collection, filter, options);
|
|
20
|
+
expect(documents).toBeDefined();
|
|
21
|
+
expect(Array.isArray(documents)).toBe(true);
|
|
22
|
+
});
|
|
23
|
+
return documents;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Finds a single document matching a filter.
|
|
27
|
+
*/
|
|
28
|
+
async findOne(description, collection, filter) {
|
|
29
|
+
let document = null;
|
|
30
|
+
await test.step(`Step: ${description}`, async () => {
|
|
31
|
+
document = await this.mongoDbClient.findOne(collection, filter);
|
|
32
|
+
});
|
|
33
|
+
return document;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Inserts a single document and returns the result.
|
|
37
|
+
*/
|
|
38
|
+
async insertOne(description, collection, document) {
|
|
39
|
+
let result;
|
|
40
|
+
await test.step(`Step: ${description}`, async () => {
|
|
41
|
+
result = await this.mongoDbClient.insertOne(collection, document);
|
|
42
|
+
expect(result.acknowledged).toBe(true);
|
|
43
|
+
expect(result.insertedId).toBeDefined();
|
|
44
|
+
});
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Inserts multiple documents and returns the result.
|
|
49
|
+
*/
|
|
50
|
+
async insertMany(description, collection, documents) {
|
|
51
|
+
let result;
|
|
52
|
+
await test.step(`Step: ${description}`, async () => {
|
|
53
|
+
result = await this.mongoDbClient.insertMany(collection, documents);
|
|
54
|
+
expect(result.acknowledged).toBe(true);
|
|
55
|
+
expect(result.insertedCount).toBe(documents.length);
|
|
56
|
+
});
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Updates a single document matching a filter.
|
|
61
|
+
*/
|
|
62
|
+
async updateOne(description, collection, filter, update) {
|
|
63
|
+
let result;
|
|
64
|
+
await test.step(`Step: ${description}`, async () => {
|
|
65
|
+
result = await this.mongoDbClient.updateOne(collection, filter, update);
|
|
66
|
+
expect(result.acknowledged).toBe(true);
|
|
67
|
+
});
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Deletes a single document matching a filter.
|
|
72
|
+
*/
|
|
73
|
+
async deleteOne(description, collection, filter) {
|
|
74
|
+
let result;
|
|
75
|
+
await test.step(`Step: ${description}`, async () => {
|
|
76
|
+
result = await this.mongoDbClient.deleteOne(collection, filter);
|
|
77
|
+
expect(result.acknowledged).toBe(true);
|
|
78
|
+
});
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Deletes multiple documents matching a filter.
|
|
83
|
+
*/
|
|
84
|
+
async deleteMany(description, collection, filter) {
|
|
85
|
+
let result;
|
|
86
|
+
await test.step(`Step: ${description}`, async () => {
|
|
87
|
+
result = await this.mongoDbClient.deleteMany(collection, filter);
|
|
88
|
+
expect(result.acknowledged).toBe(true);
|
|
89
|
+
});
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Runs an aggregation pipeline and returns results.
|
|
94
|
+
*/
|
|
95
|
+
async aggregate(description, collection, pipeline) {
|
|
96
|
+
let results = [];
|
|
97
|
+
await test.step(`Step: ${description}`, async () => {
|
|
98
|
+
results = await this.mongoDbClient.aggregate(collection, pipeline);
|
|
99
|
+
expect(results).toBeDefined();
|
|
100
|
+
expect(Array.isArray(results)).toBe(true);
|
|
101
|
+
});
|
|
102
|
+
return results;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Verifies documents have expected properties.
|
|
106
|
+
*/
|
|
107
|
+
async verifyDocumentProperties(description, documents, properties) {
|
|
108
|
+
await test.step(`Step: ${description}`, async () => {
|
|
109
|
+
if (documents.length > 0) {
|
|
110
|
+
for (const prop of properties) {
|
|
111
|
+
expect(documents[0]).toHaveProperty(prop);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=m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O,CAAC,CAAC,WAAW,EAAE,CAAC;YAC9B,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9C,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,wBAAwB,CAAC,WAAmB,EAAE,SAAgB,EAAE,UAAoB;QACtF,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,WAAW,EAAE,EAAE,KAAK,IAAI,EAAE;YAC/C,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvB,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;oBAC5B,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;gBAC9C,CAAC;YACL,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI Step Class
|
|
3
|
+
*
|
|
4
|
+
* Reusable step sequences for OpenAPI client operations.
|
|
5
|
+
* Wraps common API interactions so spec files stay concise.
|
|
6
|
+
*/
|
|
7
|
+
import type { AxiosResponseLike, OpenApiClient } from '../fixtures/openapi.fixture.js';
|
|
8
|
+
import { type ContractResult } from '../openapi/contract.js';
|
|
9
|
+
export declare class OpenApiSteps {
|
|
10
|
+
private openApiClient;
|
|
11
|
+
constructor(openApiClient: OpenApiClient);
|
|
12
|
+
private get client();
|
|
13
|
+
get api(): import("openapi-client-axios").OpenAPIClientAxios;
|
|
14
|
+
/**
|
|
15
|
+
* Calls an operation by name with optional params and returns the response.
|
|
16
|
+
*/
|
|
17
|
+
callOperation(operationId: string, params?: any, body?: any, config?: any): Promise<any>;
|
|
18
|
+
/**
|
|
19
|
+
* Verifies a response matches the spec: its status is documented, and its
|
|
20
|
+
* content type and body match the operation's schema. Fails with a
|
|
21
|
+
* ContractError listing each mismatch (JSON path, expected, actual).
|
|
22
|
+
* Works whether or not `validateResponses` is on.
|
|
23
|
+
*
|
|
24
|
+
* @param operationId the operation to check against; by default the one
|
|
25
|
+
* matching the request's method and URL
|
|
26
|
+
*/
|
|
27
|
+
verifyMatchesSchema(response: AxiosResponseLike, operationId?: string): Promise<ContractResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Verifies the client base URL is configured and contains http.
|
|
30
|
+
*/
|
|
31
|
+
verifyBaseUrl(): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Verifies that specific operation methods exist on the client.
|
|
34
|
+
*/
|
|
35
|
+
verifyOperationMethodsExist(operationIds: string[]): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves all operations from the parsed OpenAPI document.
|
|
38
|
+
*/
|
|
39
|
+
getOperations(): Promise<any[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Gets all operation IDs from the spec.
|
|
42
|
+
*/
|
|
43
|
+
getOperationIds(): Promise<string[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Calls getInventory with api_key and returns the response.
|
|
46
|
+
*/
|
|
47
|
+
getInventory(): Promise<any>;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=openapi.steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openapi.steps.d.ts","sourceRoot":"","sources":["../../../src/steps/openapi.steps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7E,qBAAa,YAAY;IACT,OAAO,CAAC,aAAa;IAAjC,YAAoB,aAAa,EAAE,aAAa,EAAI;IAEpD,OAAO,KAAK,MAAM,GAEjB;IAED,IAAI,GAAG,sDAEN;IAED;;OAEG;IACG,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAU7F;IAED;;;;;;;;OAQG;IACG,mBAAmB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAapG;IAED;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAUrC;IAED;;OAEG;IACG,2BAA2B,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMvE;IAED;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CASpC;IAED;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAUzC;IAED;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,CAYjC;CACJ"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI Step Class
|
|
3
|
+
*
|
|
4
|
+
* Reusable step sequences for OpenAPI client operations.
|
|
5
|
+
* Wraps common API interactions so spec files stay concise.
|
|
6
|
+
*/
|
|
7
|
+
import { test, expect } from '../index.js';
|
|
8
|
+
import { assertContract } from '../openapi/contract.js';
|
|
9
|
+
export class OpenApiSteps {
|
|
10
|
+
openApiClient;
|
|
11
|
+
constructor(openApiClient) {
|
|
12
|
+
this.openApiClient = openApiClient;
|
|
13
|
+
}
|
|
14
|
+
get client() {
|
|
15
|
+
return this.openApiClient.client;
|
|
16
|
+
}
|
|
17
|
+
get api() {
|
|
18
|
+
return this.openApiClient.api;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Calls an operation by name with optional params and returns the response.
|
|
22
|
+
*/
|
|
23
|
+
async callOperation(operationId, params, body, config) {
|
|
24
|
+
let response;
|
|
25
|
+
await test.step(`Step: Call operation "${operationId}"`, async () => {
|
|
26
|
+
response = await this.client[operationId](params, body, config);
|
|
27
|
+
expect(response.status).toBeGreaterThanOrEqual(200);
|
|
28
|
+
expect(response.status).toBeLessThan(300);
|
|
29
|
+
});
|
|
30
|
+
return response;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Verifies a response matches the spec: its status is documented, and its
|
|
34
|
+
* content type and body match the operation's schema. Fails with a
|
|
35
|
+
* ContractError listing each mismatch (JSON path, expected, actual).
|
|
36
|
+
* Works whether or not `validateResponses` is on.
|
|
37
|
+
*
|
|
38
|
+
* @param operationId the operation to check against; by default the one
|
|
39
|
+
* matching the request's method and URL
|
|
40
|
+
*/
|
|
41
|
+
async verifyMatchesSchema(response, operationId) {
|
|
42
|
+
let result;
|
|
43
|
+
const label = operationId ?? `${(response.config?.method ?? 'get').toUpperCase()} ${response.config?.url ?? ''}`.trim();
|
|
44
|
+
await test.step(`Step: Verify the ${label} response matches the OpenAPI spec`, async () => {
|
|
45
|
+
result = await this.openApiClient.checkResponse(response, operationId);
|
|
46
|
+
if (result.skipped && !result.operation) {
|
|
47
|
+
throw new Error(`Can't check the response against the spec: ${result.skipped}`);
|
|
48
|
+
}
|
|
49
|
+
assertContract(result);
|
|
50
|
+
});
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Verifies the client base URL is configured and contains http.
|
|
55
|
+
*/
|
|
56
|
+
async verifyBaseUrl() {
|
|
57
|
+
let baseUrl = '';
|
|
58
|
+
await test.step('Step: Verify client base URL is set correctly', async () => {
|
|
59
|
+
baseUrl = this.openApiClient.client.defaults.baseURL ?? '';
|
|
60
|
+
expect(baseUrl).toBeDefined();
|
|
61
|
+
expect(baseUrl).toContain('http');
|
|
62
|
+
});
|
|
63
|
+
return baseUrl;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Verifies that specific operation methods exist on the client.
|
|
67
|
+
*/
|
|
68
|
+
async verifyOperationMethodsExist(operationIds) {
|
|
69
|
+
await test.step(`Step: Verify operation methods exist: ${operationIds.join(', ')}`, async () => {
|
|
70
|
+
for (const opId of operationIds) {
|
|
71
|
+
expect(typeof this.client[opId]).toBe('function');
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves all operations from the parsed OpenAPI document.
|
|
77
|
+
*/
|
|
78
|
+
async getOperations() {
|
|
79
|
+
let operations = [];
|
|
80
|
+
await test.step('Step: Retrieve operations from parsed OpenAPI document', async () => {
|
|
81
|
+
operations = this.api.getOperations();
|
|
82
|
+
expect(operations.length).toBeGreaterThan(0);
|
|
83
|
+
});
|
|
84
|
+
return operations;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Gets all operation IDs from the spec.
|
|
88
|
+
*/
|
|
89
|
+
async getOperationIds() {
|
|
90
|
+
let operationIds = [];
|
|
91
|
+
await test.step('Step: Get all operation IDs from the spec', async () => {
|
|
92
|
+
const operations = this.api.getOperations();
|
|
93
|
+
operationIds = operations.map((op) => op.operationId).filter(Boolean);
|
|
94
|
+
expect(operationIds.length).toBeGreaterThan(0);
|
|
95
|
+
});
|
|
96
|
+
return operationIds;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Calls getInventory with api_key and returns the response.
|
|
100
|
+
*/
|
|
101
|
+
async getInventory() {
|
|
102
|
+
let response;
|
|
103
|
+
await test.step('Step: Call getInventory with api_key header', async () => {
|
|
104
|
+
response = await this.client.getInventory(null, null, {
|
|
105
|
+
headers: { api_key: 'special-key' },
|
|
106
|
+
});
|
|
107
|
+
expect(response.status).toBe(200);
|
|
108
|
+
expect(response.data).toBeDefined();
|
|
109
|
+
});
|
|
110
|
+
return response;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=openapi.steps.js.map
|