Skip to content

setupScenario returning a response #9

@theog

Description

@theog

I would like to be able to use setupScenario similar to cucumbers background steps. As the setupScenario calls the webrick server. I would like to know if it is possible for the backend to return a json response so i can use the generated factory_bot data in the front end e.g.

scenario :basic do
  a =  MyModel.create name: 'something'
  # return as response that can be used in the POST below
  respond_with a
end
  cy
    .request(
      "POST",
      Cypress.env("CALLBACK"),
      JSON.stringify({ scenario: name })
    )
    .then(response => {
      console.log("response:", response);
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions