webdriverio/webdriverio

[🐛 Bug]: BrowserStack false error about `Unable to fetch Percy project token`

Open

#14,526 opened on 2025年6月1日

GitHub で見る
 (10 comments) (0 reactions) (0 assignees)JavaScript (6,029 stars) (1,793 forks)batch import
Bug 🐛help wanted

説明

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

9.15.0

Node.js Version

N/A

Mode

Standalone Mode

Which capabilities are you using?

{
    platformName: 'android',
    'appium:deviceName': '^(?!REDMI|Samsung Galaxy Tab|OnePlus 12R).*$',
    'appium:platformVersion': '1[345]',
    'appium:autoGrantPermissions': true,
    'wdio:specs': [ '../../src/tests/all/**/*.test.ts' ],
    'goto:caps': {
      isLocalRun: false,
      iosEnterpriseBuild: false,
      testUserEmail: '',
      isDevMode: true
    },
    'bstack:options': {
      projectName: 'REDACTED',
      buildName: 'REDACTED',
      sessionName: 'BStack wdio tests',
      debug: true,
      networkLogs: false,
      interactiveDebugging: true,
      appiumLogs: false,
      maskCommands: 'setValues, getValues, setCookies, getCookies'
    },
    'appium:settings[allowInvisibleElements]': true,
    'appium:locale': 'US',
    'appium:language': 'en'
  }

What happened?

I upgraded from 9.3.1 to 9.15.0, and I started to see the error Unable to fetch Percy project token. However, from the product map, Percy is disabled.

This PR seems related to the problem where it outputs an error without accounting for the Percy feature to be enabled or not.

What is your expected behavior?

`@wdio/browserstack-service should not output error for services I do not use or is disabled

How to reproduce the bug.

  1. Upgrade to 9.15.0
  2. Launch a test from my machine to BrowserStack
  3. Observe the log
  4. The error is output for @wdio/browserstack-service

Relevant log output

...
processLaunchBuildResponse called with response: {
  observability: {
    success: true,
    options: { allow_screenshots: true },
    code: null,
    errors: null,
    error_trace_id: null
  },
  accessibility: null,
  automate: null,
  build_hashed_id: ‘REDACTED’,
  jwt: 'REDACTED',
  discard_build: null,
  app_automate: {
    success: true,
    options: { allow_screenshots: true },
    code: null,
    errors: null,
    error_trace_id: null
  }
}
...
2025-06-01T15:23:43.742Z ERROR @wdio/browserstack-service: Unable to fetch percy project token
...
2025-06-01T15:03:27.390Z DEBUG @wdio/browserstack-service: Sending SDK event with data {
  userName: '[REDACTED]',
  accessKey: '[REDACTED]',
  event_type: 'SDKTestAttempted',
  detectedFramework: 'WebdriverIO-mocha',
  event_properties: {
    sdkRunId: ‘REDACTED’,
    testhub_uuid: undefined,
    language_framework: 'WebdriverIO_mocha',
    referrer: 'WebdriverIO-mocha/9.14.0',
    language: 'WebdriverIO',
    languageVersion: 'v18.20.4',
    buildName: 'REDACTED’,
    buildIdentifier: 'undefined',
    os: 'Darwin',
    hostname: 'REDACTED’',
    productMap: {
      observability: true,
      accessibility: null,
      percy: false,
      automate: false,
      app_automate: true
    },
    product: [ 'observability', 'app-automate' ],
    framework: 'mocha'
  }
}

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

コントリビューターガイド