Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'signals' of undefined - Windows, Node LTS, latest versions of cypress ad preprocessor #555

Closed
mastrobardo opened this issue Apr 26, 2021 · 11 comments

Comments

@mastrobardo
Copy link

mastrobardo commented Apr 26, 2021

On windows, with latest version, tests are failing because of the error in the title

Current behavior

Cannot read property 'signals' of undefined

When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Cypress could not associate this error to any specific test.

We dynamically generated a new test to display this failure.
at normalizeSignal (http://localhost:3006/__cypress/tests?p=cypress\integration\features\game.feature:65568:1)
at Array.map ()
at getSignals (http://localhost:3006/__cypress/tests?p=cypress\integration\features\game.feature:65548:53)
at getSignalsByName (http://localhost:3006/__cypress/tests?p=cypress\integration\features\game.feature:65455:38)
at Object.501../realtime.js (http://localhost:3006/__cypress/tests?p=cypress\integration\features\game.feature:65469:21)
at o (http://localhost:3006/__cypress/tests?p=cypress\integration\features\game.feature:1:265)
at eval (http://localhost:3006/__cypress/tests?p=cypress\integration\features\game.feature:1:316)
at Object.495.human-signals (http://localhost:3006/__cypress/tests?p=cypress\integration\features\game.feature:64771:25)
at o (http://localhost:3006/__cypress/tests?p=cypress\integration\features\game.feature:1:265)
at eval (http://localhost:3006/__cypress/tests?p=cypress\integration\features\game.feature:1:316)

Desired behavior

Tests should run, fail or success status are not important. I'm using a really basic test on the line 'i can open google'. Even running only the 'Given' bit gives the same result, cypress open or cypress run ( electron and google) gives the same result.
Running through npx or package script is the same

game.spec.js

import { Given, Then, And } from 'cypress-cucumber-preprocessor/steps';
import cy from "cypress";

const url = 'http://localhost:3006';
const configUrl = 'http://localhost:3000/config';

Given('I am on game main page', () => {
    cy.visit(url);
})

And('the config server is running', () => {
    cy.request(configUrl).should((response) => {
        expect(response.status).to.eq(200)
        expect(response).to.have.property('headers')
        expect(response).to.have.property('items')
      })
})

Then('Im presented with a list of item', () => {
    cy.get('[data-testid^=game-item"]').should('have.length', 5)
})

game.feature

Feature: Game is rendered

    Scenario: I want to open the game page with no errors
        Given I am on game main page
        And the config server is running
        Then Im presented with a list of item
        And A recap section is visible but empty

Versions

  • Cypress version": cypress": "^7.1.0",
  • Preprocessor version: "cypress-cucumber-preprocessor": "^4.1.0",
  • Node version: LTS

I saw there are several bugs online for human-signal on windows. That may be the cause ... but could not debug it further, apologies.

@CherrySurat
Copy link

me too, getting the same error after install es lint not sure it related or not.

`The following error originated from your test code, not from Cypress.

Cannot read property 'signals' of undefined

When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Cypress could not associate this error to any specific test.

We dynamically generated a new test to display this failure.`

@pranitmahajan
Copy link

I also face the same issue on mac though

@pranitmahajan
Copy link

This error was resolved to me when I set nonGlobalStepDefinitions to true in package.json

"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}

Because of this change, I did moved all step definitions and feature files to their default location.

@abonje2000
Copy link

abonje2000 commented Jul 13, 2021

I'm also getting this error message on windows
The following error originated from your test code, not from Cypress.

Cannot read property 'signals' of undefined

When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Cypress could not associate this error to any specific test.

We dynamically generated a new test to display this failure.

my nonGlobalStepDefinitions is set to True

"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true
}

Please can anyone help.
2021-07-13 17_03_33-QA-CSFEAUTOMATION

@abonje2000
Copy link

me too, getting the same error after install es lint not sure it related or not.

`The following error originated from your test code, not from Cypress.

Cannot read property 'signals' of undefined

When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Cypress could not associate this error to any specific test.

We dynamically generated a new test to display this failure.`

Have you resolved this?

@VitorHugoCarvalho
Copy link

My friends, I had the same problem, in my case I use cypress with cucumber, I believe you also use it, strangely it was created in a steps file a line automatically 'import cypress from "cypress";'
I just removed this import and my problem was solved, I hope I helped someone in this situation.

@sbarbat
Copy link

sbarbat commented Aug 10, 2021

Remove import cy from "cypress"; from your game.spec.js file

@noamSchwarz42
Copy link

Removing import cy from "cypress"; solved the issue for me

@mithilesh777
Copy link

This might be an issue, please check this in your code
Screenshot 2021-11-30 at 12 04 28 AM

@ugyenlekzin
Copy link

My friends, I had the same problem, in my case I use cypress with cucumber, I believe you also use it, strangely it was created in a steps file a line automatically 'import cypress from "cypress";' I just removed this import and my problem was solved, I hope I helped someone in this situation.

I'm also getting this error message on windows The following error originated from your test code, not from Cypress.

Cannot read property 'signals' of undefined

When Cypress detects uncaught errors originating from your test code it will automatically fail the current test.

Cypress could not associate this error to any specific test.

We dynamically generated a new test to display this failure.

my nonGlobalStepDefinitions is set to True

"cypress-cucumber-preprocessor": { "nonGlobalStepDefinitions": true }

Please can anyone help. 2021-07-13 17_03_33-QA-CSFEAUTOMATION

dis you solve the problem?

@badeball
Copy link
Owner

Due to personal reasons, the previous maintainers of this package are stepping down and handing the reigns over to me, a long-time contributor to the project and a user of it myself. This is a responsibility I'm very excited about. Furthermore, I'd like to thank @lgandecki ++ for all the work that they've done so far.

Read more about the transfer of ownership here.

The repository has however moved and all outstanding issues are being closed. This is not a reflection of the perceived importance of your reported issue. However, if after upgrading to the new version, you still find there to be an issue, feel free to open up another ticket or comment below. Please make sure to read CONTRIBUTING.md before doing so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants