Rayrun
← Back to videos

Circle CI & GitHub Actions environment variables | Playwright Tutorial - Part 90

In this video, we'll learn how to set the environment variables from Circle CI and GitHub actions.

This video is a tutorial on how to pass environment variables from Circle CI or GitHub Actions. The host starts by mentioning that the previous tutorial covered how to encrypt and decrypt user credentials with the help of CryptoJS in a Playwright test script. However, viewers had questions about how to set the values in the CI (Continuous Integration) environment.

The host walks viewers through the process step-by-step, starting with the playwright.config file. They explain that the secret key is set as an environment variable that is accessed using process.env.secret_key in the test script. The host demonstrates how the test runs successfully when the correct secret key is provided, but fails if an incorrect value is used.

To solve this issue in Circle CI, the host explains that the environment variables need to be set in the config.yml file. They demonstrate how to add the environment keyword before the test command in the workflow. The secret key can be any variable name, but it must match the environment variable set in Circle CI.

The host then goes to the Circle CI project settings and shows how to add environment variables in the dashboard. They delete the existing environment variable and add a new one with their specific secret key value.

Finally, the host triggers the pipeline to run the tests, and it passes successfully because the secret key matches the one set in Circle CI.

The host briefly mentions that a similar process can be followed in Jenkins and provides an example of how to use parameterized builds. They also mention that the same process can be followed in GitHub Actions, using the secrets keyword in the workflow file.

The video concludes with the host expressing willingness to answer any questions in the comments section and wishing viewers a Merry Christmas and Happy New Year.

Related Videos

#16 - ARIA and how Playwright is making use of it to identify UI controls?
#16 - ARIA and how Playwright is making use of it to identify UI controls?
Playwright - Set timeout, parallelisation and retries directly in your test files
Playwright - Set timeout, parallelisation and retries directly in your test files
Playwright & Lighthouse Integration | Playwright Tutorial - Part 88
Playwright & Lighthouse Integration | Playwright Tutorial - Part 88
Maximize Window | Playwright Tutorial - Part 72
Maximize Window | Playwright Tutorial - Part 72
TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.