Skip to content

Mixing sync and async flows #16088

Discussion options

You must be logged in to vote

It seems all works fine just by returning cy.get

export const hasResults = gridSelector => {
    return cy.get("table > tbody > tr")
        .then($rows => {
            if ($rows.length) {
                return !Cypress.$($rows[0]).hasClass("no-results")
            }
        })
}

and then consumer-side this

hasResults("opencga-family-grid").then($result => {
    console.log(result)
})

I'm going to leave the discussion here, it could be useful to someone else, or in case someone wants to add related information.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by antonioaltamura
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant