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

Cypress request plugin #1579

Open
Ericlm opened this issue Feb 26, 2025 · 0 comments · May be fixed by #1580
Open

Cypress request plugin #1579

Ericlm opened this issue Feb 26, 2025 · 0 comments · May be fixed by #1580
Labels
enhancement New feature or request

Comments

@Ericlm
Copy link
Contributor

Ericlm commented Feb 26, 2025

What is the problem this feature would solve?

Making requests with Cypress is not type-checked (neither the request nor the body), making it difficult to work with.

External documents/projects?

What is the feature you are proposing to solve the problem?

It would be great if a plugin for Cypress was created that would allow generation of commands that accept only the right request body, and return a Chainable<Response>.

Something like :

// CypressPetCreateRequest.ts

namespace Cypress {
   interface Chainable {
      createPetRequest: (body: CreatePetRequestBody) => Chainable<CreatePetResponse>
   }
}

What alternatives have you considered?

For now I'm using cy.request directly.

@Ericlm Ericlm added the enhancement New feature or request label Feb 26, 2025
@Ericlm Ericlm changed the title Cypress plugin Cypress request plugin Feb 26, 2025
@Ericlm Ericlm linked a pull request Feb 26, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant