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

(uncaught exception) undefined: undefined #16516

Closed
titivermeesch opened this issue May 14, 2021 · 12 comments
Closed

(uncaught exception) undefined: undefined #16516

titivermeesch opened this issue May 14, 2021 · 12 comments
Labels
stale no activity on this issue for a long period

Comments

@titivermeesch
Copy link

titivermeesch commented May 14, 2021

Current behavior

Here is the test case that is failing:

it('can create a new equipment model', () => {
    cy.clickOnElementByText('Equipment Models')
    cy.clickOnElementByText('Add model')
    cy.pickElementFromSelect('cy|type', equipmentType, '.ant-select-item')
    cy.get('cy|brand').type(modelBrand)
    cy.get('cy|name').type(modelName)
    cy.get('cy|description').type('description')
    cy.get('cy|cost').type(300)
    cy.contains('OK').click()
    // cy.searchTable(modelName)
    // cy.checkElementContainsValue('.ant-table-tbody', modelName)
  })

My test was not like this originally but I've tried to narrow it down as much as possible (by using normal cypress commands instead of custom ones for example).

I keep getting this error:
Screenshot 2021-05-14 at 12 21 38
Screenshot 2021-05-14 at 12 22 28
Screenshot 2021-05-14 at 12 24 06

Right now it's on the command pickElementFromSelect but it also happens on the cy.get ones, it seems like a very random behavior.

I'm not sure where it comes from. There are no other errors in the console during execution and the app just workes fine when I test it manually.

Is there a way to know where this comes from?

Desired behavior

The commands should just be executed.

Versions

  • Using Chrome 90, but also saw this with Edge 90
  • Cypress 7.3.0 (also had it on 7.2.0)
  • MacOS 11.2.3 (It also happens in CI on Ubuntu 18.04.5)

Working versions

My tests seem to run fine on 6.5.0, but not on the latest version

@jennifer-shehane
Copy link
Member

Yah, that's not a great error message to help tracking down. Could you provide the custom command code for the clickOnElementByText and pickElementFromSelect commands?

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label May 14, 2021
@titivermeesch
Copy link
Author

titivermeesch commented May 15, 2021

Sure:

clickOnElementBySelect: text => cy.contains(text).click()
pickElementFromSelect:

(selector, valueToPick, waitForLoading = true) => {
  if (waitForLoading) {
    cy.get('[data-cy=type] > .ant-select-arrow > .anticon > [data-icon=loading]svg').should(
      'not.be.visible'
    )
  }

  cy.get(selector).click().type(valueToPick)
  checkElementExists('.ant-select-item-option')
  clickOnElement('.ant-select-item-option').first()
}

checkElementExists: selector => cy.get(selector).should('exist')
clickOnElement: selector => cy.get(selector).click()

The last ones were little helper functions, but the result is the same by just doing cy.get....

@jennifer-shehane
Copy link
Member

@titivermeesch Yeah, I don't see anything in the custom commands that seems strange. Can you provide a reproducible example? A full test file that we can run and see this throwing the error? Thanks.

@titivermeesch
Copy link
Author

I recently updated to v8.3.0 and I'm not experiencing this issue anymore. I guess it solved itself.

I'll reopen this issue if I manage to recreate the issue again

@Mona-Superscientist
Copy link

I'm facing a similar problem in my test with the last version of cypress.

@titivermeesch titivermeesch reopened this Feb 15, 2022
@titivermeesch
Copy link
Author

titivermeesch commented Feb 15, 2022

Having this as well with the latest version, had it as well with v8.3.0. I'm currently stuck at 6.5 because everything else seems to fail the tests instantly

@cypress-bot cypress-bot bot added stage: backlog and removed stage: needs information Not enough info to reproduce the issue labels Apr 29, 2022
@nullbytesoftware
Copy link

nullbytesoftware commented Aug 15, 2022

I am having similar issues in v10.4.0

This works (depricated):

cy.get('[data-testid="interruption-button-launch"]').then((el) => { el.click(); });

This does not:

cy.get('[data-testid="interruption-button-launch"]').click()

@ushashir
Copy link

I am having a similar issue with version 11.0.0

@geritol
Copy link
Contributor

geritol commented Dec 1, 2022

experiencing the same with version 11.2.0
I am getting (uncaught exception) undefined: undefined errors, on the cypress log, but the error is correctly displayed on the developer console. I think it happens when a promise throws an uncaught exception in the app while executing the test code

@geritol
Copy link
Contributor

geritol commented Dec 1, 2022

isolated a potentatial root cause with reproduction in: #24915

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label May 31, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale no activity on this issue for a long period
Projects
None yet
Development

No branches or pull requests

7 participants