-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Use fixture as request body shortcut #3387
Comments
mirror to |
hello all , it('Validate the header', function () {
cy.server();
cy.route( 'fixture/fc_return-1adult-1child.json',`fx:data`)
.then(data => cy.request(`POST`,`http://email-dev-external-endpoint.com/api/send-as-email`,`fx:data`)) // fx:data
}) |
Hey @Elshaikh, passing This issue is open as a request for Cypress to support this in the future and has not had any work done on it yet. |
I like the idea to pass a fixture directly to the request. Current: cy.request(url)
cy.request(url, body)
cy.request(method, url)
cy.request(method, url, body)
cy.request(options) Possible: cy.request(url) // does it make sense to provide a fixture to a GET request?
cy.request(url, body) // here we do not need a fixture
cy.request(url, fixture) // if a fixture is provided, ise "POST" as default method?
cy.request(method, url, fixture) // throw if method === GET && fixture is given?
cy.request(method, url, body)
cy.request(options) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I am interested in working on this feature. |
I tried to add this feature..but i think its not possible. (Please correct me if i am thinking wrong) Here is the PR - #20800 The error i get is: Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise. The command that returned the promise was: cy.request() The cy command you invoked inside the promise was: |
@bahmutov/ @jennifer-shehane - Any updates on this please? Is that even in plan? |
Hello! Can I work on this issue? It seems to be abandoned at the moment. I'm just starting out contributing and I thought it would be a good place to start |
I'm running into the problem where calling cy.fixture() is not allowed and the test structure does not allow calling |
@jennifer-shehane Is this issue still active? |
It would be nice to be able to load and send a fixture file by name like
Currently, have to load fixture and then send
The text was updated successfully, but these errors were encountered: