cypress icon indicating copy to clipboard operation
cypress copied to clipboard

feat: Add RequestResponseBody #22378

Open JohnKalan opened this issue 1 year ago • 5 comments

Additional details

  • Added RequestResponseBody interface.
  • This change improves the typing and structure of the project.
  • Added a test case for the added RequestResponseBody interface.

Steps to test

  • Created a responseBody object of type RequestResponseBody with a placeholder JSON object.
  • The test case to checks the basic structure of the RequestResponseBody interface.

PR tasks

  • Add interface to improve typing structure.

Questions for reviewers

  • Should more fields be added to the interface?

JohnKalan avatar Jun 26 '23 17:06 JohnKalan

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 26 '23 17:06 CLAassistant

cypress-app-bot avatar Jun 26 '23 17:06 cypress-app-bot

@JohnKalan Thanks for the contribution. Couple things:

  1. You'll need to sign the CLA
  2. Can you expand on the need for this change? Depending on how your service responds the body field can be a variety of things which is why it's genericized as T. To fit your use case you could simply pass an appropriate generic to cy.request like so:
type MyResponseType = {
  json: JSON
}

cy.request<MyResponseType>(...)
  1. This would need test updates to cypress/cli/types/tests/kitchen-sink.ts

mike-plummer avatar Jun 26 '23 17:06 mike-plummer

30 flaky tests on run #48240 ↗︎

0 27897 1348 0 Flakiness 30

Details:

Add changelog entry
Project: cypress Commit: bd36070094
Status: Passed Duration: 23:04 💡
Started: Jun 26, 2023 5:45 PM Ended: Jun 26, 2023 6:08 PM
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-firefox

View Output Video

Test Artifacts
network stubbing > intercepting request > can delay and throttle a StaticResponse Output
Flakiness  commands/files.cy.js • 1 flaky test • 5x-driver-firefox

View Output Video

Test Artifacts
... > throws when there is an error writing the file Output
Flakiness  cypress/cypress.cy.js • 3 flaky tests • 5x-driver-firefox

View Output Video

Test Artifacts
... > correctly returns currentRetry Output
... > correctly returns currentRetry Output
... > correctly returns currentRetry Output
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-electron

View Output Video

Test Artifacts
network stubbing > intercepting request > can delay and throttle a StaticResponse Output Video
Flakiness  e2e/origin/navigation.cy.ts • 1 flaky test • 5x-driver-electron

View Output Video

Test Artifacts
delayed navigation > errors > redirects to an unexpected cross-origin and calls another command in the cy.origin command Output Video

The first 5 flaky specs are shown, see all 17 specs in Cypress Cloud.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

cypress[bot] avatar Jun 26 '23 18:06 cypress[bot]

This PR has not had any activity in 180 days. If no activity is detected in the next 14 days, this PR will be closed.

cypress-app-bot avatar Dec 24 '23 01:12 cypress-app-bot

This PR has been closed due to inactivity

cypress-app-bot avatar Jan 07 '24 01:01 cypress-app-bot