Skip to main content

Secrets

Lila tests will most likely be added to the repository. For sensitive information, Lila provides the ability to declare secrets.

Secrets are always declared using the ${SECRET_NAME} format but its retrieval mechanism is:

  • Look for an env var, if not then
  • Look for a Secret defined in Lila app.

Test example:

Without secrets:

login.yaml
steps:
- goto: https://staging.app.com/login
- login: using email 'test@staging.com' and password 'password123'
- verify: login is successfull
...

Using secrets:

login-with-secrets.yaml
steps:
- goto: https://staging.app.com/login
- login: using email ${STAGING_EMAIL} and password ${STAGING_PASSWORD}
- verify: login is successfull
...

Using env vars

First, Lila will look for environment variables. So for example the following will work:

STAGING_EMAIL=foo@bar.com STAGING_PASSWORD=foobar lila run login-with-secrets.yaml

If using Github Actions (or similar CI), you can use their secrets and add them as environment variables

e2e-test.yaml
...
steps:
- name: Run login
env: # Or as an environment variable
STAGING_EMAIL: ${{ secrets.StagingEmail }}
STAGING_PASSWORD: ${{ secrets.StagingPwd }}
run: |
lila run login-with-secrets.yaml
...

For more information on how to use secrets in Github Actions go here

Using Lila app

When running the test case, if the Secret was not found as an environment variable, Lila will look in the defined Secrets for the value.

You can edit your secrets here: https://app.lila.dev/secrets