Learn how to customize and set up your TestDriver environment to optimize your CI/CD pipeline.
prerun
scriptprompt
and commands
sections accordingly.
wait-For-text
command is crucial for ensuring that the browser is fully
loaded before proceeding with the test steps. If you are testing a web
application, you may want to adjust the text
parameter to match the expected
app name, title or content of the page../lifecycle/prerun.yaml
, it’s executed before the test begins. This will happen even if you have a pre or post test script defined in your GitHub Actions workflow. This file works like any other TestDriver file and is commonly used to perform tasks such as opening a browser, navigating to a specific page, or resetting the application state.
Note that the prerun
script is found in the GitHub Actions workflow file for deployed tests.
prerun.yaml
file can be combined with the exec
command to open the Chrome browser and navigate to a page, similar to the example provided above. This ensures that the test environment is properly set up before the test starts. Note that the prerun is a TestDriver test file like any other, combining commands to complete a task.
prerun.yaml
file that opens Firefox instead of Chrome (note the wait-for-text
command at the end):
exec
shell commands in prerun to set up a test fileshell
context is setting up the calculator app to be used by the test file. This method is useful if you are going to use the same application over again in many tests.
exec
for more examples and use cases of including
shell
or js
context and proper usage within your prerun!