Workflow
End-to-end workflow for setting up SolidX for automated testing, loading data, running tests, and tearing down safely.
Testing Workflow
This page describes the end-to-end operational workflow for running automated tests in SolidX.
The goal of this workflow is to bring the application into SUT mode: a clean, isolated system under test with predictable metadata, predictable test data, and safe cleanup afterwards.
Canonical Workflow
The standard flow is:
- Create isolated test datasources
- Seed metadata into those datasources
- Load test fixtures
- Run test scenarios
- Tear everything down
These are the canonical commands:
npx @solidxai/solidctl@latest test data --setup
npx @solidxai/solidctl@latest seed
npx @solidxai/solidctl@latest test data --load
npx @solidxai/solidctl@latest test run --module <module-name>
npx @solidxai/solidctl@latest test data --teardownStep 1: Test Datasource Setup
Command:
npx @solidxai/solidctl@latest test data --setupThis step creates isolated test databases or schemas for the datasources configured in the project.
What happens here:
- a unique run name is generated,
.envis backed up,- datasource database names are rewritten to test-specific names,
- fresh databases or schemas are created,
- and a manifest is written so teardown can later reverse the process safely.
This is what moves the project into SUT mode.
Step 2: Seed Metadata
Command:
npx @solidxai/solidctl@latest seedThis seeds the fresh test databases with the metadata required for the platform to function.
That includes things like:
- models,
- fields,
- views,
- actions,
- roles,
- permissions,
- users,
- settings,
- and other platform metadata.
Why this step matters:
- test data loading depends on model metadata being present,
- security and identity setup depend on seeded metadata,
- and scenario execution assumes the metadata model already exists.
Step 3: Load Test Data
Command:
npx @solidxai/solidctl@latest test data --loadThis step ingests testing identity and fixture data from module metadata.
In order, it:
- creates test roles from
testing.rolesand binds their permissions, - creates test users from
testing.users, - and loads fixture records from
testing.datainto the test databases.
Key characteristics:
- data stays close to the module that owns it,
- loading is metadata-aware and idempotent — existing roles and users are not duplicated,
- record inserts behave like upserts,
- and relations can be resolved using user-key based conventions.
'> Note
''> solid seed must complete before running --load. Controller permissions are registered during seeding, and role binding will fail if they are not yet in the database.
'
You can also limit the load to certain modules:
npx @solidxai/solidctl@latest test data --load --modules-to-test venue,reportsStep 4: Run Test Cases
Command:
npx @solidxai/solidctl@latest test run --module venue --api-base-url http://localhost:3000 --ui-base-url http://localhost:5173 --headless falseThis step executes testing.scenarios from the selected module metadata.
The runner:
- filters scenarios by ids or tags if requested,
- registers built-in and custom step handlers,
- creates adapters,
- runs API, UI, or mixed scenarios,
- and reports results to the configured reporter.
Useful variants:
npx @solidxai/solidctl@latest test run --module venue --list-specs true
npx @solidxai/solidctl@latest test run --module venue --include-tags smoke
npx @solidxai/solidctl@latest test run --module venue --scenario-ids api-authenticate-success,api-create-statesStep 5: Teardown
Command:
npx @solidxai/solidctl@latest test data --teardownThis reverses the SUT setup process.
It typically:
- restores
.envfrom its backup, - deletes test datasource backups and manifests,
- drops the test databases or schemas that were created,
- and returns the local environment to its normal state.
This step is important because it keeps local development environments clean and prevents test databases from accumulating over time.
Why This Workflow Exists
SolidX testing is intentionally workflow-heavy because the platform is metadata-driven.
That means good automated testing is not only about running assertions. It also depends on:
- predictable metadata,
- clean test datasources,
- deterministic fixture loading,
- and safe cleanup.
The setup/load/run/teardown pattern ensures the system under test is isolated enough to be trustworthy.
Local Development vs CI
The same workflow works in both local and automated environments.
Local development usually emphasises:
- running tests against local API and UI servers,
- inspecting UI behaviour in headed browser mode,
- iterating on a narrow set of scenarios.
CI usually emphasises:
- deterministic setup,
- full teardown,
- headless browser execution,
- module-scoped or tag-scoped runs.
Recommended SOP
For most teams, the safest operating procedure is:
- Run
test data --setup - Run
seed - Run
test data --load - Start the application servers if needed
- Run
test run - Always finish with
test data --teardown
Common Failure Modes
Typical problems usually come from one of these:
- skipping
seedbefore loading test data, - pointing
--api-base-urlor--ui-base-urlat the wrong server, - forgetting that UI tests require a running frontend,
- stale
.envvalues after interrupted runs, - running scenarios that depend on data that was never loaded.
Next: Vocabulary