question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3.1.1 -> 3.1.2 breaks commands using element arrays

See original GitHub issue

Current behavior:

click() fails with the following error related to https://github.com/kentcdodds/cypress-testing-library/pull/25

CypressError: cy.click() failed because it requires a DOM element.

The subject received was:

  > [<button>, <button>]

The previous command that ran was:

  > cy.then()
      at Object.cypressErr (http://localhost:13370/__cypress/runner/cypress_runner.js:63008:11)
      at Object.throwErr (http://localhost:13370/__cypress/runner/cypress_runner.js:62973:18)
      at Object.throwErrByPath (http://localhost:13370/__cypress/runner/cypress_runner.js:63000:17)
      at ensureElement (http://localhost:13370/__cypress/runner/cypress_runner.js:56011:21)
      at validateType (http://localhost:13370/__cypress/runner/cypress_runner.js:55897:16)
      at Object.ensureSubjectByType (http://localhost:13370/__cypress/runner/cypress_runner.js:55919:9)
      at pushSubjectAndValidate (http://localhost:13370/__cypress/runner/cypress_runner.js:58778:15)
      at Context.<anonymous> (http://localhost:13370/__cypress/runner/cypress_runner.js:58940:18)
      at http://localhost:13370/__cypress/runner/cypress_runner.js:58649:33
      at tryCatcher (http://localhost:13370/__cypress/runner/cypress_runner.js:124249:23)
      at Promise._settlePromiseFromHandler (http://localhost:13370/__cypress/runner/cypress_runner.js:122267:31)
      at Promise._settlePromise (http://localhost:13370/__cypress/runner/cypress_runner.js:122324:18)
      at Promise._settlePromiseCtx (http://localhost:13370/__cypress/runner/cypress_runner.js:122361:10)
      at Async._drainQueue (http://localhost:13370/__cypress/runner/cypress_runner.js:119178:12)
      at Async._drainQueues (http://localhost:13370/__cypress/runner/cypress_runner.js:119183:10)
      at Async.drainQueues (http://localhost:13370/__cypress/runner/cypress_runner.js:119057:14)

Desired behavior:

click() to work. (works on 3.1.1)

Steps to reproduce:

clone https://github.com/kentcdodds/cypress-testing-library run npm setup confirm test fails. run npm install cypress@3.1.1 run npm run test:cypress:run confirm test passes

Versions

cypress: 3.1.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
brian-manncommented, Dec 3, 2018

Released in 3.1.3.

1reaction
kucebcommented, Nov 21, 2018

@misoguy this is high priority for us. We’ll have a fix soon, but thank you!

the array-wrapping functionality of cy.wrap wasn’t purposeful, so this wasn’t captured in a test. we are now adding it to a spec

Read more comments on GitHub >

github_iconTop Results From Across the Web

Arrays - The Linux Documentation Project
Arrays. Newer versions of Bash support one-dimensional arrays. Array elements may be initialized with the variable[xx] notation. Alternatively, a script may ...
Read more >
1.4 Arrays - Introduction to Programming in Java
Making an array in a Java program involves three distinct steps: Declare the array name. Create the array. Initialize the array values. We...
Read more >
Array | Ruby API (v3.1)
An Array is an ordered, integer-indexed collection of objects, called elements. Any object may be an Array element. Array Indexes.
Read more >
class Array - RDoc Documentation - doc.ruby-lang.org
An Array is an ordered, integer-indexed collection of objects, called elements. ... A positive index is an offset from the first element:.
Read more >
Bash Reference Manual - GNU.org
The array variable BASH_REMATCH records which parts of the string matched the pattern. The element of BASH_REMATCH with index 0 contains the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found