Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async Await in Loop is not working for me #4

Open
vinod236 opened this issue Nov 12, 2019 · 0 comments
Open

Async Await in Loop is not working for me #4

vinod236 opened this issue Nov 12, 2019 · 0 comments

Comments

@vinod236
Copy link

vinod236 commented Nov 12, 2019

i get below error CypressError: cy.then() timed out after waiting '4000ms'.

Your callback function returned a promise which never resolved.

The callback function was:

function (_x) {
return _ref.apply(this, arguments);
}

for below code ,

cy.xpath(LOGO).then(async $ele => {
      for (const i in $ele) {
        if ($ele.eq(i).text() === 'USA') {
          $ele.eq(i).click();
          cy.wait(5000);
        }
        const count = await cy.get(COUNT).invoke('text').promisify();
        if(count>0) break;
      }
});

My Cypress Details :
Version : 3.4.1
Chrome: 77
Node : 10.15.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant