CYPRESS INTERCEPT to SPY API Calls

Sdílet
Vložit
  • čas přidán 20. 10. 2021
  • 🔥In this CYPRESS TUTORIAL video, you'll learn HOW to SPY an API REQUEST using CY.INTERCEPT with Cypress IO or INTERCEPT API CALLS with cy.intercept() method in Cypress.
    Cypress server, and Cypress router are deprecated and now we can use this method.
    #cypress #testing #e2e

Komentáře • 31

  • @joanmedia
    @joanmedia  Před 2 lety

    🤖DISCORD: discord.gg/2F9E2fRGaU
    ⭐PREMIUM Cypress + Typescript course: shorturl.at/dcnPn
    📣FREE Cypress videos: shorturl.at/h6iEX

  • @tuananhdo1870
    @tuananhdo1870 Před rokem

    Very helpful! Thank you

  • @vigensmbatyan9948
    @vigensmbatyan9948 Před 2 lety +1

    I always find the solution to my issues in your video tutorials, thank you very much

    • @joanmedia
      @joanmedia  Před rokem

      Thanks for the comment Vigen. Just released a new Udemy course in case you are interested :D 📚 Cypress 10+ Udemy Full Course 👉 bit.ly/3pLazsY

    • @vigensmbatyan9948
      @vigensmbatyan9948 Před rokem +1

      @@joanmedia I'll keep it on mind🙂

  • @terminal3553
    @terminal3553 Před 2 lety +1

    your channel will has 1 million subscribes , it is a time matter

    • @joanmedia
      @joanmedia  Před 2 lety

      Haha thank you very much 🙏

  • @HLS6935
    @HLS6935 Před 2 lety +1

    Thanks! Very helpful.

    • @joanmedia
      @joanmedia  Před 2 lety

      Thank you for your comment.

    • @HLS6935
      @HLS6935 Před 2 lety +1

      @@joanmedia You’re welcome. Trying to use my Cypress automation to work behind the scenes to get cookies and jwt needed for Azure SSO login. What you have demoed here looks really promising. Good luck with your channel! I’m a new subscriber. Looking forward to watching more of your videos.

    • @joanmedia
      @joanmedia  Před 2 lety +1

      @@HLS6935 Thank you! Trying to upload at least 1 video per week, hope you find them useful :)

  • @gohind
    @gohind Před 2 lety +1

    very well explained . can you please make a video on SSO login as well using cypress.

    • @joanmedia
      @joanmedia  Před 2 lety

      Thanks GoHind! I'll add it to the list

  • @MrSontiny
    @MrSontiny Před 2 lety +1

    It's really nice. Thanks mate

    • @joanmedia
      @joanmedia  Před 2 lety

      Thanks for the comment! happy to hear that

    • @MrSontiny
      @MrSontiny Před 2 lety +1

      @@joanmedia Can you make a video that tell what differences between cy.routes() and cy.intercept()?

    • @joanmedia
      @joanmedia  Před 2 lety +1

      @@MrSontiny Hi man, it is not required. Actually cy.server and cy.route are deprecated methods. Now we just need intercept to do the same stuff.

    • @MrSontiny
      @MrSontiny Před 2 lety +1

      @@joanmedia Now I understand. Thanks pal

    • @joanmedia
      @joanmedia  Před 2 lety

      @@MrSontiny np

  • @Concerned_Indianz
    @Concerned_Indianz Před 2 lety +1

    Hi Joan Great stuff like always,, Could you please make a video on Single Sign On - Cypress Please..
    It's really appreciated. Thanks

    • @joanmedia
      @joanmedia  Před 2 lety

      Hi! I will add to my list. The difficult part is find a project to test it, but I will try.

    • @Concerned_Indianz
      @Concerned_Indianz Před 2 lety

      @@joanmedia Thanks a Lot

  • @xxsanyxx1
    @xxsanyxx1 Před rokem +1

    Hi Joan! I've been able to successfully mock API calls with the help of your video! Thank you so much for such an awesome video as always. I have a question I'd like to ask and I would appreciate your response a ton! My app makes an API call and stores the response in a datastore object. Is there a way to mock the value of the datastore object in Cypress? I've seen that it's possible to set localstorage items in Cypress, but I would imagine what I'm asking to be very different from that.

    • @joanmedia
      @joanmedia  Před rokem +1

      Hello! Not sure about that, I will have to research a bit :P. Just wanted to let you know also that there is a new udemy course with some topics that I wanted to cover, in case you are interested! 📚 Cypress 10+ Udemy Full Course 👉 bit.ly/3pLazsY

    • @xxsanyxx1
      @xxsanyxx1 Před rokem

      @@joanmedia Thanks for the recommendation, will definitely check it out! Love your videos! :)

    • @joanmedia
      @joanmedia  Před rokem

      @@xxsanyxx1 Thanks

  • @AdnanErlansyah-nx7xp
    @AdnanErlansyah-nx7xp Před 7 měsíci

    Hi joan, how about if the url of api is different from baseUrl or root url. so there's 2 server, one for client and two for server. How can I setup this ? and for the server, there's a header to allowing the request like appToken or authorization token

  • @rcbchowdarytumati1224
    @rcbchowdarytumati1224 Před 2 lety +1

    As usual great stuff. Can I get application url to practice?

    • @joanmedia
      @joanmedia  Před 2 lety

      Thanks man. The repo is here: github.com/JoanEsquivel/testing-lists
      I think I did not commit the code unfortunately but you can do the same stuff I did step by step.

  • @2ndRandomDudeOnline
    @2ndRandomDudeOnline Před rokem +1

    Does cypress intercept cancel the original request or does it just mock the response data?

    • @joanmedia
      @joanmedia  Před rokem

      It does not cancel the request. you can use it to mock the response or mock the request itself.