Environment variables are not available in the Nightwatch context

Created on 5 November 2024, about 2 months ago

Problem/Motivation

I need to pass an environment variable to the Nightwatch test. It is visible with the _SHOW_ENVIRONMENT_VARIABLES: "1" but missing in the Nightwatch test.

Steps to reproduce

1. Extend the CI file like this:

variables:
  MY_VARIABLE: My value
  _SHOW_ENVIRONMENT_VARIABLES: "1"

2. Get this environment variable in a Nightwatch test - JS code:

console.log('MY_VARIABLE', process.env.MY_VARIABLE);
console.log('All environment variables', process.env);

3. See that the variable is missing in the Nightwatch test output, but present in the _SHOW_ENVIRONMENT_VARIABLES output.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Component

gitlab-ci

Created by

🇦🇲Armenia murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024