Oh no it got worse lol, now it says Error: cannot ...
# help
b
Oh no it got worse lol, now it says Error: cannot find module 'mocha'
b
That seems unrelated to what you were doing before. A screenshot of the test runner maybe more helpful.
b
Sorry had to get it back up and running
b
So the uncaught exception is a result of a clicking an element on the page. Seems like something a dev will have to fix. Does the function still work if you ignore the exception?
b
Hm let me try to add that code.
Weird side note: I can click on this element manually
b
I'm not sure what the click on this element is suppose to do, but does the app respond as it normally would?
b
Sorry was at lunch, I am simply trying to click in a text field if that is what you are asking. And the app responds how it normally would when I do it manually
So adding that exception to my index file worked! Makes me nervous haha but it worked
b
Usually you want to type into a text field rather than click it then type.
If you are nervous about the global uncaught exception you can add it to only your spec file by wrapping it in a
beforeEach()
block in.
Copy code
js
beforeEach(() => {
  cy.on('uncaught:exception', (err, runnable) => {
    if (err.message.includes('ev.element is not a function')) {
      return false
    }
  })
})
6 Views