Skip to content

Local testing fails when testObservability added to e2e.js #657

@jdvegmond

Description

@jdvegmond

I noticed that when I try my Cypress tests on my local machine they will always fail when the following line is present in cypress/support/e2e.js:
require('browserstack-cypress-cli/bin/testObservability/cypress');

The error I get (for every scenario):

TypeError: Cannot read properties of undefined (reading 'get')
      at runPrivilegedCommand (http://localhost:55177/__cypress/runner/cypress_runner.js:173408:27)
      at $Cy.task (http://localhost:55177/__cypress/runner/cypress_runner.js:151114:107)
      at $Cy.now (http://localhost:55177/__cypress/runner/cypress_runner.js:160956:90)
      at ../driver/node_modules/eventemitter2/lib/eventemitter2.js.EventEmitter.emit (http://localhost:55177/__cypress/runner/cypress_runner.js:96092:22)
      at parent.<computed> [as emit] (http://localhost:55177/__cypress/runner/cypress_runner.js:164812:31)
      at $Cypress.action (http://localhost:55177/__cypress/runner/cypress_runner.js:157297:21)
      at LogManager.trigger (http://localhost:55177/__cypress/runner/cypress_runner.js:165684:22)
      at LogManager.triggerLog (http://localhost:55177/__cypress/runner/cypress_runner.js:165689:17)
      at $Cypress.log (http://localhost:55177/__cypress/runner/cypress_runner.js:165736:12)
      at commandRunningFailed (http://localhost:55177/__cypress/runner/cypress_runner.js:159448:18)
      at onError (http://localhost:55177/__cypress/runner/cypress_runner.js:159854:7)
      at tryCatcher (http://localhost:55177/__cypress/runner/cypress_runner.js:18744:23)
      at Promise._settlePromiseFromHandler (http://localhost:55177/__cypress/runner/cypress_runner.js:16679:31)
      at Promise._settlePromise (http://localhost:55177/__cypress/runner/cypress_runner.js:16736:18)
      at Promise._settlePromise0 (http://localhost:55177/__cypress/runner/cypress_runner.js:16781:10)
      at Promise._settlePromises (http://localhost:55177/__cypress/runner/cypress_runner.js:16857:18)
      at _drainQueueStep (http://localhost:55177/__cypress/runner/cypress_runner.js:13451:12)
      at _drainQueue (http://localhost:55177/__cypress/runner/cypress_runner.js:13444:9)
      at ../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:55177/__cypress/runner/cypress_runner.js:13460:5)
      at Async.drainQueues (http://localhost:55177/__cypress/runner/cypress_runner.js:13330:14)

Once I remove the line from e2e.js, my tests run fine on my local machine. It doesn't seem to have an impact on my Browserstack integration either, maybe because in my config I've set "testObservability": false

Cypress version: 12.17.2
Browserstack-cypress-cli version: 1.24.4
Run on latest windows version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions