You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to use cypress-downloadfile to download a file on hitting a url. However, the url I am hitting is behind proxy, hence downloadfile is failing with 403 error. However, when I hit the same url that is behind proxy using cy.request it works as expected
To Reproduce
Steps to reproduce the behavior:
Try to download a file that is behind proxy using cy.download file
Even though HTTP_PROXY is set cy.download fails with. 403 error
However, the same url works when used as cy.request()
See stack trace:
cy.task('downloadFile') failed with the following error:
> request is not defined
at <unknown> (http://localhost:51356/__cypress/runner/cypress_runner.js:135703:70)
at tryCatcher (http://localhost:51356/__cypress/runner/cypress_runner.js:1807:23)
at Promise._settlePromiseFromHandler (http://localhost:51356/__cypress/runner/cypress_runner.js:1519:31)
at Promise._settlePromise (http://localhost:51356/__cypress/runner/cypress_runner.js:1576:18)
at Promise._settlePromise0 (http://localhost:51356/__cypress/runner/cypress_runner.js:1621:10)
at Promise._settlePromises (http://localhost:51356/__cypress/runner/cypress_runner.js:1697:18)
at <unknown> (http://localhost:51356/__cypress/runner/cypress_runner.js:2392:25)
From previous event:
at Promise.longStackTracesCaptureStackTrace [as _captureStackTrace] (http://localhost:51356/__cypress/runner/cypress_runner.js:3486:19)
at Promise._then (http://localhost:51356/__cypress/runner/cypress_runner.js:1239:17)
at Promise._passThrough (http://localhost:51356/__cypress/runner/cypress_runner.js:4110:17)
at Promise.lastly.Promise.finally (http://localhost:51356/__cypress/runner/cypress_runner.js:4119:17)
at Object.onRunnableRun (http://localhost:51356/__cypress/runner/cypress_runner.js:163777:53)
at $Cypress.action (http://localhost:51356/__cypress/runner/cypress_runner.js:41042:28)
at Runnable.run (http://localhost:51356/__cypress/runner/cypress_runner.js:146089:13)
at Runner.runTest (http://localhost:51356/__cypress/runner/cypress_runner.js:156307:10)
at <unknown> (http://localhost:51356/__cypress/runner/cypress_runner.js:156433:12)
at next (http://localhost:51356/__cypress/runner/cypress_runner.js:156216:14)
at <unknown> (http://localhost:51356/__cypress/runner/cypress_runner.js:156226:7)
at next (http://localhost:51356/__cypress/runner/cypress_runner.js:156128:14)
at <unknown> (http://localhost:51356/__cypress/runner/cypress_runner.js:156194:5)
at timeslice (http://localhost:51356/__cypress/runner/cypress_runner.js:146429:27)
From Your Spec Code:
at Context.eval ([webpack:///./node_modules/cypress-downloadfile/lib/downloadFileCommand.js:5](http://localhost:51356/__/#))
From Node.js Internals:
ReferenceError: request is not defined
at downloadFile (/Users/nmath/Content_Gateway/node_modules/cypress-downloadfile/lib/addPlugin.js:21:3)
at invoke (/Users/nmath/Library/Caches/Cypress/13.6.1/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:248:16)
at <unknown> (/Users/nmath/Library/Caches/Cypress/13.6.1/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:59:14)
at tryCatcher (/Users/nmath/Library/Caches/Cypress/13.6.1/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/util.js:16:23)
at Function.Promise.attempt.Promise.try (/Users/nmath/Library/Caches/Cypress/13.6.1/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/method.js:39:29)
at Object.wrapChildPromise (/Users/nmath/Library/Caches/Cypress/13.6.1/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:58:23)
at RunPlugins.taskExecute (/Users/nmath/Library/Caches/Cypress/13.6.1/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:254:10)
at RunPlugins.execute (/Users/nmath/Library/Caches/Cypress/13.6.1/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:166:21)
at EventEmitter.<anonymous> (/Users/nmath/Library/Caches/Cypress/13.6.1/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:56:12)
at EventEmitter.emit (events.js:400:28)
at process.<anonymous> (/Users/nmath/Library/Caches/Cypress/13.6.1/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:33:22)
at process.emit (events.js:400:28)
at emit (internal/child_process.js:912:12)
at processTicksAndRejections (internal/process/task_queues.js:83:21)
Expected behavior
cypress-downloadfile should request the proxy set
Describe the bug
I am trying to use cypress-downloadfile to download a file on hitting a url. However, the url I am hitting is behind proxy, hence downloadfile is failing with 403 error. However, when I hit the same url that is behind proxy using cy.request it works as expected
To Reproduce
Steps to reproduce the behavior:
Expected behavior
cypress-downloadfile should request the proxy set
Screenshots
Desktop:
The text was updated successfully, but these errors were encountered: