cy-api icon indicating copy to clipboard operation
cy-api copied to clipboard

Hide options that do not belong to `Cypress.RequestOptions` from "Request:" in the HTML

Open aubincc opened this issue 1 year ago • 11 comments

This does not make a big difference, but I have never found it useful to have this property shown in the HTML.

If you like I can turn it into an option.

aubincc avatar Mar 23 '23 13:03 aubincc

Hi @aubincc ! Can you add a testing case please ? Thanks for your contribution !

LeJeanbono avatar Mar 23 '23 15:03 LeJeanbono

Hi @aubincc ! Can you add a testing case please ? Thanks for your contribution !

Sure, I'll see if I can have a look. I might even try and make it an option. Do you think I should?

aubincc avatar Mar 23 '23 15:03 aubincc

Nice one ! By The Way, I'm thinking that we could elarge this one with more stuff than failOnStatusCode to hide, like:

interface Loggable {
    log: boolean
  }

interface Failable {
    failOnStatusCode: boolean
    retryOnStatusCodeFailure: boolean
    retryOnNetworkFailure: boolean
  }

To only show what's depend on pure request stuff :

interface RequestOptions {
    auth: object
    body: RequestBody
    encoding: Encodings
    followRedirect: boolean
    form: boolean
    gzip: boolean
    headers: object
    method: HttpMethod
    qs: object
    url: string
}

What's do you think ?

LeJeanbono avatar Mar 23 '23 21:03 LeJeanbono

I think of a question:

showLoggables/API_SHOW_LOGGABLES & showFailables/API_SHOW_FAILABLES ?

aubincc avatar Mar 23 '23 21:03 aubincc

API_SHOW_CYPRESS_SPECIFIC_REQUEST_OPTION for both ?

LeJeanbono avatar Mar 23 '23 21:03 LeJeanbono

Alright, please be nice and patient now, today was my first go at TypeScript ever 🥵

aubincc avatar Mar 23 '23 21:03 aubincc

I have done it and it is working but I'm running into a little bit of a nightmare when pushing. Could be something to do with the husky pre-push, I don't know.

aubincc avatar Mar 24 '23 11:03 aubincc

I'd like a review @LeJeanbono

My next goal would be to convert the qs object to a real querystring. Baby steps 👶🏻

aubincc avatar Mar 24 '23 12:03 aubincc

Are you done @aubincc ?

LeJeanbono avatar Apr 28 '23 19:04 LeJeanbono

Are you done @aubincc ?

Done with the RequestOptions yes, would you care to verify my code?

About the querystring, I will see to that another time.

aubincc avatar Apr 28 '23 21:04 aubincc

@LeJeanbono what must I do now?

aubincc avatar Jun 19 '23 13:06 aubincc