Best Practices for Managing and Optimizing Data Fixtures in Cypress!

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 11

  • @davidpolsanchezmartos8283
    @davidpolsanchezmartos8283 ปีที่แล้ว +1

    why the fixture don't work if you replace the "function()" for the "=>"?

  • @PANDAJACK
    @PANDAJACK 2 ปีที่แล้ว +1

    Thanks a lot!

  • @evatate3104
    @evatate3104 2 ปีที่แล้ว +1

    Nice video! Thank you for the clear explanation on how to use fixtures. The "quick and dirty" way worked, however the cypress documentation recommended way did not. I still get the "Cannot read properties of undefined (reading 'data')". I had the beforeEach() function originally in my e2e.js file which I thought was the issue. When I moved to within my test file, I still received the error. Any suggestion?

    • @evatate3104
      @evatate3104 2 ปีที่แล้ว +1

      Nevermind, I was missing the "function ()" in my it() test. Thanks!!!

    • @ResterTest
      @ResterTest  ปีที่แล้ว

      Glad it helped!

  • @rajann44
    @rajann44 ปีที่แล้ว

    Doesnt it defeats the way cypress recommend to use fixtures?

    • @rajann44
      @rajann44 ปีที่แล้ว

      let examplejson;
      before( () => {
      cy.fixture('example').then((data) => {
      examplejson = data;
      })
      })

    • @ResterTest
      @ResterTest  ปีที่แล้ว

      @@rajann44 - I do not understand the question

    • @rajann44
      @rajann44 ปีที่แล้ว

      @@ResterTest I mean cypress dont recommend to use fixtures via imports

    • @ResterTest
      @ResterTest  ปีที่แล้ว

      I understand you point and in general I do follow the docs. I had issues in the past when doing it like in the docs. That is why I tried to find a way to MAKE IT WORK :D