adobe / adobe/aem-test-samples

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

Open
#80 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
36
Forks
42
PR merge metrics
No merged PRs in 30d

Description

### 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.

Contributor guide

Open the contributing guide

Research direction

Start with assets.cy.js and reproduce the timeout using npx cypress run --headed --no-exit --browser chrome. Trace the @completeupload step and its cy.wait handling, then verify that a correct image path reaches completed upload status without timing out.

Written by the indexing model from the issue text.

Assessment

Tech stack
cypress, javascript
Domain
testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.