How to use Cypress to write E2E Tests over a Registration Page
Vložit
- čas přidán 15. 07. 2024
- Showing an overview of how to write cypress tests to verify a registration form shows errors and redirects the user
00:00 talking about e2e testing
02:20 getting started with cypress
------------
🤑 Patreon / webdevjunkie
🔔 Newsletter eepurl.com/hnderP
💬 Discord / discord
📁. GitHub github.com/codyseibert/youtube
credits:
www.freepik.com/vectors/dynamic - Dynamic vector created by pikisuperstar - www.freepik.com
I had chatgpt help in doing this and for long time I was not getting everything woring right, I am not saying chatgpt was wrong but I didn't take a tutorial and was looking for a fast way to test the frontend even though I am mainly a backend person. The first 10:24 minutes of this video cleared everything up for me and I was able to write tests for both /login and /register pages in no time. Thank you.
Find this super helpful, thank you for explaining!
amazing video, thank you for sharing. it was very useful!
great tutorial, thank you!
Great video!
great job, man!
Great Video. I am trying to set up Cypress e2e code coverage for my next app. Do you have any information about achieving this. I managed to configure it correctly but I am not seeing the coverage repost updating it values
❤️😇
can you make a video of :how to use ts as the language instead of js
You don't need to write .should('exist') after DOM commands like cy.get(). These commands expect the element to eventually exist in the DOM.
Good job babe! Lol I forgot you shaved your beard so when you popped up in the corner I was like….👀 who is that 👀🥵
What a nub
Can u share me code
But if you run a test once won't it write Bob to the database? So for every test you write the same thing into the database. How do you clean it before every test?
Why is that an issue if you start with a fresh database before you run your tests? Just create users with unique names each time you run the test or append a random id to the persons name if having too many bobs is an issue
One approach is to stub the API requests so that you don't even need a database at all to do the testing. Technically that wouldn't be a true "E2E" test anymore since anything you're stubbing is effectively removed from the test, but in theory it should run a lot faster since there's no network latency... plus it allows you to simulate a lot of different API response conditions
Does cypress insert data into the database? If you run the test multiple times will it insert multiple data into the database?
It uses your Ui just like your users do, so yes I should
@@WebDevCody but isn't that bad?
@@theanswer1993 you can just run commands to clean up the data after it’s created. Also often your database should start with a new fresh database with seed data.
I had the same question. What commands do we need to add in order to start with a fresh database?
A video on Playwright please 🙏
I’ll have to check it out, I’ve never used it
Can u share me code today
p̳r̳o̳m̳o̳s̳m̳