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.

Your callback function returned a promise that never resolved.

See original GitHub issue

Hello there 👋

I’m running Percy orb alongside Cypress orb in CircleCI. However, about 20% of my tests are failing with the following error. It can be resolved simply by removing any reference to cy.percySnapshot.

CypressError:cy.then()timed out after waiting4000ms`.

Your callback function returned a promise that never resolved.

The callback function was:

dom => { let domSnapshot = window.PercyDOM.serialize({ …options, dom });

  // Post the DOM snapshot to Percy
  return utils.postSnapshot({
    ...options,
    environmentInfo: ENV_INFO,
    clientInfo: CLIENT_INFO,
    domSnapshot,
    url: dom.URL,
    name
  }).then(() => {
    // Log the snapshot name on success
    cylog(name, { name });
  }).catch(error => {
    // Handle errors
    log.error(`Could not take DOM snapshot "${name}"`);
    log.error(error);
  });
}`

My CircleCI config file looks like: ` version: 2.1 orbs: node: circleci/node@4.5.1 cypress: cypress-io/cypress@1.28.0 slack: circleci/slack@4.4.2 percy: percy/agent@0.1.3

workflows: version: 2 commit-workflow: jobs: - cypress/run: name: Smoke Tests record: true store_artifacts: true
spec: cypress/integration/E2E/* command-prefix: npx percy exec – post-steps: - store_test_results: path: test-results - slack/notify: channel: general event: fail template: basic_fail_1 mentions: ‘@Jac’ - slack/notify: channel: general event: pass template: basic_success_1 mentions: ‘@Jac
- percy/finalize_all: requires: - Smoke Tests `

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JackMunncommented, Jul 1, 2021

Hey @Robdel12 - I see the change was merged to master yesterday, but I’m still getting the same error above. In fact I seem to be getting it every time now?

1reaction
Robdel12commented, Jun 30, 2021

Hey @JackMunn! This is the same issue as #371 (which will be fixed by https://github.com/percy/cli/pull/400 today). I’ll close this up since it’s a duplicate – we should be shipping that PR pretty soon

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Your callback function returned a promise which never ...
Your callback function returned a promise which never resolved. The callback function was: function Command__queryByText(thenArgs) { return ...
Read more >
Your callback function returned a promise that never resolved
Hii Team, I am working to programmatically login to Okta using Cypress. Getting error, Can you please help. Cypress.
Read more >
Cypress function randomly times out "promise that never ...
Your callback function returned a promise that never resolved. My function is: Cypress.Commands.overwrite("visit", (originalFn ...
Read more >
cypress-io/cypress - Gitter
Your callback function returned a promise which never resolved. . I don't want to change the defaultCommandTimeout for all tests, only for this...
Read more >
How to make a Promise out of a Callback function in JavaScript
What if the data you're fetching is the MongoDB URL that you need to connect to? You'd have to nest these calls inside...
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