Selector is influenced by assertions
See original GitHub issueCurrent behavior:
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:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.Yes, this seems to be the case. You may want to add a
cy.wait()
for the autosuggest XHR to finish before running thecy.get()
to ensure the correct results are populated first.