Custom Headers with CLI Deployment Events
You can now provide custom headers with the mabl CLI. All tests started by the deployment will have these headers added to their browser requests. Simply add the --http-headers
flag followed by the desired headers to your deployment CLI command.
mabl deployments create -a my-app-id --http-headers "foo:bar" "baz:qux"
Sample use cases include:
- Setting tracking IDs on each execution like
x-test-id:test-123
- Setting custom authorization headers like
authorization:Bearer my-token
To use this feature, update your CLI to 0.6.13-beta
or higher using
npm install -g @mablhq/mabl-cli
Combination of Authorization Headers and Credentials
If your test plan is configured with Basic Auth credentials, then these will take precedence over
authorization
headers set by--http-headers
Authorization Header Domain Constraints
If you set
authorization
headers, they will only be sent on web requests to the same domain/sub domains of the application's start URL.e.g. if application URL is
foo.com/login
,foo.com
andtracking.foo.com
requests would receive the authorization header, butbar.com
requests would not.