Cypress.io: How to mock API response

Поділитися
Вставка
  • Опубліковано 7 лис 2024
  • This lesson is a part of my Udemy class: Cypress from Zero to Hero.
    Link to the class: www.udemy.com/...
    In this lesson, you will learn how to create a mock or stub of your back-end server in Cypress to automate web applications. Mocks are very useful when you need to automate edge case scenarios and it speeds up the test execution process a lot. Cypress has a really great built-in mocking tools

КОМЕНТАРІ • 35

  • @666aladdin
    @666aladdin 7 місяців тому

    i bought the course on Udemy . Its verrry well done . highly recommend it

  • @ravibx
    @ravibx 2 роки тому

    Literally you saved my a**. Excellent contents.

  • @tanner8291
    @tanner8291 2 роки тому

    This is going to help me do my current ticket this sprint at work 🤣

  • @faizalshaikh6559
    @faizalshaikh6559 4 роки тому +1

    hi i have a question, Can i use dynamic data in json reponse, for example few paramters are not fixed for me,.

    • @artembondar6577
      @artembondar6577  4 роки тому

      Yes, you can update your mock object with the data you need and set it as a route response again

  • @RoshanSingh-wb2pw
    @RoshanSingh-wb2pw 2 роки тому +1

    very useful. thanks artem

  • @martinanguiano3353
    @martinanguiano3353 Рік тому

    How do you created your local server from scratch?, Ive seen many examples with locals, but none with comercials, can you do 1?

    • @artembondar6577
      @artembondar6577  Рік тому

      That's an Angular application. Any angular app can be running on localhost

  • @gdd546
    @gdd546 3 роки тому

    Will there be a course on just API automation with cypress? Courses I've seen have just a small section on API testing with all the focus on UI automation. I really want to learn more on how to develop and maintain an API framework using cypress, advanced tests, real world examples, integrating excel or some form of dynamic data for requests, cucumber, CI tool etc. I have seen many people and companies are now moving towards API automation using cypress

    • @artembondar6577
      @artembondar6577  2 роки тому

      Cypress is not a framework for API automation so I don't recommend to do it. Cypress is great for UI functional automation and API capability is a useful feature that helps to manipulate data or set up test data for your test. If you need API testing, check the frameworks that are designed for it like Karate DSL or RestAssured.

  • @JhoanGarciaing
    @JhoanGarciaing 4 роки тому

    excellent, thank you very much, I have a question, is it possible to mockup a websocket?

    • @artembondar6577
      @artembondar6577  4 роки тому

      I am not sure. Cypress capability of mocking is limited or XHR calls

    • @Kpizzle1289
      @Kpizzle1289 4 роки тому

      @@artembondar6577 They've just releases route2, which is experimental, which allows you to mock Fetch and other request types now.

  • @firuzakasirova8303
    @firuzakasirova8303 2 роки тому

    Hello Artem, may I ask you inside your course you have Mocking API response , but may be you can to show us this process with Cypress BDD Mocking API response, I think your source looks good, but need more information with Cypress BDD mocking

  • @danr4826
    @danr4826 3 роки тому

    @Artjem Bondar
    I've cloned the github repo ngx-cypress-test that's used in your udemy code and confirmed node js, npm and git are installed correctly. When I try to run npm install on the root folder I keep getting several errors such as:
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR!
    npm ERR! While resolving: ngx-admin@4.0.1
    npm ERR! Found: @angular/common@8.2.14
    npm ERR! node_modules/@angular/common
    npm ERR! @angular/common@"^8.0.0" from the root project
    Any ideas what I could be doing wrong? Have been struggling with this, keeping me from working through some exercises.

  • @kjleshem
    @kjleshem 4 роки тому +1

    thanks u realy make it simple for understanding

  • @natalyruda8275
    @natalyruda8275 Рік тому

    Привет Артем. Подскажите пожалуйста как можно получить полный курс что на платформе Юдеми на русском языке.

    • @artembondar6577
      @artembondar6577  Рік тому

      Никак. Курс доступен только на английском

  • @slavonnord3210
    @slavonnord3210 2 роки тому

    Артём подскажите,можно ли создать тесты вне папки integration?

  • @arunasavyasachi5617
    @arunasavyasachi5617 5 місяців тому

    Thank you so much!

  • @shashankhegde1454
    @shashankhegde1454 4 роки тому

    How to set up this conduit application in my local machine

  • @wilsonafs
    @wilsonafs 3 роки тому +1

    Thanks bro, this content is excellent

  • @nafisrahman5791
    @nafisrahman5791 Рік тому

    why did he have to change from fixtures:tags.json into fixture:tag.json? the folder was called fixtures as far as I can see.

    • @mohammadmutaib2515
      @mohammadmutaib2515 Рік тому

      The folder name is fixtures only, its the keyword within the intercept command that should read fixture.

  • @acthilina
    @acthilina 4 роки тому +1

    Amazing. Thank you

  • @Johnny-pt5jb
    @Johnny-pt5jb 4 роки тому

    Thanks for the excellent video. Can you make one for bypassing login UI?

  • @ViktoriaLukyanchuk
    @ViktoriaLukyanchuk 3 роки тому +1

    спассссибо!

  • @nadim.a4351
    @nadim.a4351 2 роки тому

    outdated