webdriverio/webdriverio

[🐛 Bug]: <NODE_TLS_REJECT_UNAUTHORIZED environment>

Open

#13,889 opened on Nov 18, 2024

View on GitHub
 (6 comments) (0 reactions) (0 assignees)JavaScript (1,793 forks)batch import
Bug 🐛help wantedwdio-browserstack-service

Repository metrics

Stars
 (6,029 stars)
PR merge metrics
 (Avg merge 15d 15h) (48 merged PRs in 30d)

Description

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

9.2.8

Node.js Version

20.10.0

Mode

WDIO Testrunner

Which capabilities are you using?

platformName: 'Android',
      'appium:app': getCIAppID(appIdValue) || process.env.BROWSERSTACK_APP_ID_ANDROID,
      'appium:autoGrantPermissions': 'true', //Auto accept Push Notification
      'appium:interactiveDebugging': 'true',
      'bstack:options': {
        buildName: getCIAppID(appIdValue) || `Manual Android Execution  -  ${new Date().toLocaleString('en-gb')}`,
        projectName: 'App Android',
        networkLogs: true,
        networkLogsOptions: {
          captureContent: true,
        },
        idleTimeout: 120,
        debug: true,
        appiumVersion: '1.22.0',
      },

What happened?

When run locally

 (node:92107) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
[1-0] (Use `node --trace-warnings ...` to show where the warning was created)

When run on CI pipeline

Error only on Pipeline run - 
(node:47) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
Error while trying to execute binary Error: Command failed: /root/.browserstack/BrowserStackLocal --daemon start --log-file /tmp/build/ffa2fcdb/repo/tests/e2e/local.log --source nodejs-1.5.5 --key ((redacted)) --force-local --local-identifier 2681f2a5-d789-49f9-a9c2-b311bdfa5644
/root/.browserstack/BrowserStackLocal: --import is not allowed in NODE_OPTIONS
12:47:02

What is your expected behavior?

no node error, and it should work smoothly as with @wdio/cli - v 8.40.6

How to reproduce the bug.

platformName: 'Android', 'appium:app': getCIAppID(appIdValue) || process.env.BROWSERSTACK_APP_ID_ANDROID, 'appium:autoGrantPermissions': 'true', //Auto accept Push Notification 'appium:interactiveDebugging': 'true', 'bstack:options': { buildName: getCIAppID(appIdValue) || Manual Android Execution - ${new Date().toLocaleString('en-gb')}, projectName: 'App Android', networkLogs: true, networkLogsOptions: { captureContent: true, }, idleTimeout: 120, debug: true, appiumVersion: '1.22.0', },

Relevant log output

platformName: 'Android',
      'appium:app': getCIAppID(appIdValue) || process.env.BROWSERSTACK_APP_ID_ANDROID,
      'appium:autoGrantPermissions': 'true', //Auto accept Push Notification
      'appium:interactiveDebugging': 'true',
      'bstack:options': {
        buildName: getCIAppID(appIdValue) || `Manual Android Execution  -  ${new Date().toLocaleString('en-gb')}`,
        projectName: 'Appv3 Android',
        networkLogs: true,
        networkLogsOptions: {
          captureContent: true,
        },
        idleTimeout: 120,
        debug: true,
        appiumVersion: '1.22.0',
      },

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Contributor guide