Skip to content

[REQ] Cypress API Generator #8008

@vanakema

Description

@vanakema

Is your feature request related to a problem? Please describe.

We've found ourselves frustrated in having to write a manual API for doing state setup in our Cypress E2E tests.

Describe the solution you'd like

A Typescript Cypress generator that creates a library that uses cy.request for requests, and includes all the models as well, so we get type completion

Describe alternatives you've considered

We're currently using the ts-node generator and using cy.then to make requests in cypress through the ts-node generated library, but this doesn't use cypress's cy worker and logging, which makes debugging issues much harder, as you do not know what request failed, and command ordering is more unpredictable.

Additional context

All cy commands in cypress, go into a worker queue, for the Cypress runner to execute in FIFO order, rather than using the native async/await, which can obscure the execution order of commands if not using all cy commands, as well as obscures errors that occur.

I think all that really needs to happen is for the generator to make cy.request commands instead of node's built in request library

Intro to what Cypress is:
https://docs.cypress.io/guides/core-concepts/introduction-to-cypress.html#Cypress-Can-Be-Simple-Sometimes

Explanation of Cypress's worker/runner:
https://docs.cypress.io/guides/core-concepts/test-runner.html#Overview

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions