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.

Selector is influenced by assertions

See original GitHub issue

Current behavior:

Screenshot 2019-05-02 at 17 35 44

The same selector finds a different number of elements. The code is the same except for the assertions.

Desired behavior:

The same selector finds the same elements, regardless of chained assertions.

Steps to reproduce: (app code and test code)

This code:

describe("autocomplete", function() {
    var locationSearchBar = ".location-selector"
    var locationSearchField = ".select2-dropdown .select2-search__field"

    it("should display District and County results", function() {
      // ARRANGE
      cy.visit("https://www.imovirtual.com/comprar/apartamento/")
      // ACT
      cy.get(locationSearchBar).click()
      cy.get(locationSearchField).type("lisboa")
      // ASSERT
      cy.get("li.select2-results__option > div").should("contain", "Lisboa")
      cy.get("li.select2-results__option > div").should("contain", "(Distrito)")
    })
  })

Versions

macOS 10.14.4, Chrome 74, Latest Cypress

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dialexcommented, May 12, 2019

Right now I’m using a

cy.get(".loading-results").should("not.be.visible") // explicit wait

instead of the cy.wait() you suggested. Is that ok too? I prefer explicit waits.

0reactions
jennifer-shehanecommented, May 7, 2019

Yes, this seems to be the case. You may want to add a cy.wait() for the autosuggest XHR to finish before running the cy.get() to ensure the correct results are populated first.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assertion selectors - IBM
An Assertion of type Assertion Selector allows you to make a selection from a range of permissible assertions. When a new Assertion Selector...
Read more >
AS 2305: Substantive Analytical Procedures - PCAOB
For some assertions, analytical procedures are effective in providing the appropriate ... The following factors influence the auditor's consideration of the ...
Read more >
Chapter 5 Smartbook Flashcards - Quizlet
Select All that Apply: Management makes financial statement assertions related to ______. -Classes of transactions and events. -Account balances -Fairness of ...
Read more >
Assertion Styles - Chai
The assert style is exposed through assert interface. This provides the classic assert-dot notation, similar to that packaged with node.js.
Read more >
Recording Panel | TestCafe Studio - DevExpress Documentation
Customize your Selector Generation settings to influence the ... Use the Selector Inspector to generate Selectors for assertions and actions ...
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