Learn how to customize TestDriver execution with lifecycle files for setup, provisioning, and cleanup.
lifecycle/
directory. TestDriver automatically executes these files during the appropriate phases:
lifecycle/provision.yaml
: Executed when a new sandbox is createdlifecycle/prerun.yaml
: Executed before tests runlifecycle/postrun.yaml
: Executed after tests completelifecycle/provision.yaml
file is executed when a new sandbox is created. This is ideal for installing dependencies, setting up the environment, or preparing the system for testing.
lifecycle/provision.yaml
lifecycle/prerun.yaml
file is executed before each test run. This replaces the previous prerun
parameter from the GitHub Action and is useful for preparing the immediate test environment.
lifecycle/prerun.yaml
lifecycle/postrun.yaml
file is executed after tests complete. This is useful for cleanup tasks, generating reports, or capturing final state information.
lifecycle/postrun.yaml
${TD_WEBSITE}
: The target website URL${TD_THIS_FILE}
: Current test file name${TD_API_KEY}
: Your TestDriver API keyexec
with lang: pwsh
for system commandswait-for-text
, hover-text
, etc.) for UI interactionslifecycle/
directoryexec
commands