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

assets.cy.js: @completeupload invocation does not complete if invoked with cy.wait construct #80

Open
sachinlala opened this issue Sep 19, 2023 · 1 comment

Comments

@sachinlala
Copy link

Expected Behaviour

assets.cy.js >> @completeupload should complete successfully, when the image path and previous steps are correct

Actual Behaviour

assets.cy.js >> @completeupload times-out while the status of asset upload is 'Processing'

Steps to Reproduce

npx cypress run --headed --no-exit --browser chrome >> reports timeout for @completeupload step

Enhancement Proposal

Instead of cy.wait, we can rather invoke the more deterministic cy.waitUntil - as follows:

    // wait for the /content/dam.completeUpload.json POST to complete before polling for the asset
    cy.waitUntil(
        () => ['@completeupload'], {
          errorMsg: `asset ${imagePath} should be uploaded`,
          timeout: 5000,
          interval: 1000
        }
    );

Please let me know if this looks ok - will accordingly raise a PR.

@dulvac
Copy link
Member

dulvac commented Feb 21, 2024

@sachinlala , Sorry for the long delay. I think that sounds good. Feel free to raise a PR

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

2 participants