Testing JavaScript with Cypress - Full Course

  Рет қаралды 129,131

freeCodeCamp.org

freeCodeCamp.org

8 ай бұрын

Learn how to use Cypress to test JavaScript applications in this full course for beginners! You'll dive deep into the world of end-to-end testing, as you learn about setting up, writing, and executing robust tests to ensure the reliability and performance of your web applications.
✏️ Course created by @coderyan
💻 Starter project - github.com/coderyansolomon/cy...
💻 Final project - github.com/coderyansolomon/cy...
⭐️ Contents ⭐️
⌨️ (0:00:28) Introduction
⌨️ (0:01:52) Course Overview
⌨️ (0:04:04) Why Cypress?
⌨️ (0:08:24) Project Setup And Install
⌨️ (0:17:21) Cypress Describe Blocks
⌨️ (0:18:55) Cypress It Blocks
⌨️ (0:20:42) Cypress Commands
⌨️ (0:29:17) Cypress Getting Elements
⌨️ (0:30:29) Cypress Command Chaining And Assertions
⌨️ (0:55:39) Cypress beforeEach Blocks
⌨️ (0:57:55) Cypress Custom Commands
⌨️ (1:06:01) Testing Forms In Cypress
⌨️ (1:27:31) Multi-Page Testing
⌨️ (1:36:01) Cypress Intercepts
⌨️ (1:47:34) Helpful Cypress Methods
⌨️ (1:55:11) Testing A Grudge List Feature
⌨️ (2:10:57) Cypress Component Tests
⌨️ (2:26:37) Cypress Best Practices
🎉 Thanks to our Champion and Sponsor supporters:
👾 davthecoder
👾 jedi-or-sith
👾 南宮千影
👾 Agustín Kussrow
👾 Nattira Maneerat
👾 Heather Wcislo
👾 Serhiy Kalinets
👾 Justin Hual
👾 Otis Morgan
--
Learn to code for free and get a developer job: www.freecodecamp.org
Read hundreds of articles on programming: freecodecamp.org/news

Пікірлер: 141
@coderyan
@coderyan 8 ай бұрын
Thank you for checking this course out! And thank you Free Code Camp for all you do for the community. I had a great time creating it and I hope you all enjoy it!
@prashlovessamosa
@prashlovessamosa 8 ай бұрын
Good to see you on FCC love your teachings.
@renatosousa9971
@renatosousa9971 8 ай бұрын
Can't believe you're also a developer! I've been following your work at Revive Stronger for some years, thanks for sharing your knowledge, I started learning web development last year and now I'm on the grind to enter the tech field
@coderyan
@coderyan 8 ай бұрын
@@renatosousa9971 That's awesome to hear you know me from Revive Stronger! Best of luck with getting into the tech field. Just let me know if there's anything I can do to help out
@markthomasnoonan
@markthomasnoonan 8 ай бұрын
Ryan, thank you for creating this! freeCodeCamp has been an amazing resource for me, the FCC front-end cert was a huge part of my development as a programmer. I now work at Cypress and helped build some of what you are showing in this video. Learning Cypress early in my career helped me a lot too. So it just makes me so happy to see an FCC Cypress course like this. Absolutely made my day!
@jotasenator
@jotasenator 8 ай бұрын
on it right away, liking-sharing-downloading
@nanonkay5669
@nanonkay5669 7 ай бұрын
Timestamps: 0:00 Intro 1:52 Course Overview 4:04 Why Cypress? 8:29 Project setup and overview 17:29 Testing Fundamentals: Describe Block 18:54 Testing Fundamentals: It Block 20:50 Testing Fundamentals: Commands and interacting with elements 29:29 Testing Fundamentals: Getting elements 30:38 Testing Fundamentals: Command chaining & assertions 38:04 Testing Fundamentals: Writing first test 54:34 Running a single test using "only" 55:45 beforeEach 58:08 Custom commands 1:03:00 Testing Fundamentals summary 1:06:29 Testing forms 1:16:44 Doggo is tryna cuddle with his feet........ 1:16:58 Testing forms (contd) 1:17:32 Aliases and Retry-ability 1:28:26 Multi-page testing 1:36:13 Intercepts 1:42:20 Intercepts: Fixtures 1:47:48 Helpful Methods 1:55:20 "Grudge list" example 2:11:06 Component testing 2:26:44 Best practices 2:39:32 Fin
@yogeshdevaggarwal
@yogeshdevaggarwal Ай бұрын
From where did you get them?? I mean seriously are you actually writing them while just watching the video??
@kalduntechnologies
@kalduntechnologies 8 ай бұрын
I really appreciated the content. This was a great refresher on JavaScript and Cypress seems like an excellent tool for web app testing!
@ElinaStamb
@ElinaStamb 7 ай бұрын
Thank you, it was so useful! I've already created few tests for our Angular application after watching your tutorial
@spacexnix
@spacexnix 8 ай бұрын
I've been waiting for a long time. thank you very much
@jolness1
@jolness1 2 ай бұрын
Thanks for making this. I haven't used cypress for a couple of years and am interviewing for a role that is testing focused. Java testing has been my wheelhouse for the last couple years but need a refresher so I can jump in and not make a fool of myself. This seems to be just what I need.
@aeonian8687
@aeonian8687 8 ай бұрын
perfect course again just in time
@KamranV21
@KamranV21 Ай бұрын
Thank you, Ryan! This course was really helpful.
@notsuio
@notsuio 8 ай бұрын
Good explaination and examples. 👏🏻
@marwanabouesmaail5199
@marwanabouesmaail5199 3 ай бұрын
Informative and the course I was looking for. Thank you so much
@daddy7934
@daddy7934 8 ай бұрын
Thank you brother we all really appreciate it 🙏
@DThompsonDev
@DThompsonDev 8 ай бұрын
Love to see more content on Testing! Cypress is great. Even used it at 2 companies I have worked at! Rock solid resource.
@disrael2101
@disrael2101 6 ай бұрын
is testing by itself a really in demand skill to get a job in?
@brownknight8104
@brownknight8104 4 ай бұрын
Absolutely. Go look at how many job openings there are. SDET or QA Engineer. @@disrael2101
@smpc500
@smpc500 18 күн бұрын
@@disrael2101 I got my first job in IT as a test developer. Now I'm working with Cypress!
@mikejakusz1493
@mikejakusz1493 7 күн бұрын
@@disrael2101 QA is all testing. It's very important to have tests when implementing new features to production with a large app, they're essential to catching bugs.
@ACHUAREM
@ACHUAREM 8 ай бұрын
Much awaited. Thank you for this course.
@smpc500
@smpc500 18 күн бұрын
Where's your async? :D
@segovia102
@segovia102 4 ай бұрын
I agree that this makes testing fun. Compared to debugging your tests for 5 hours to work out why stuff is leaking between tests, DIY dentistry is fun! This is great content, thanks! Update: I spoke too soon. Am getting some flakiness in the testing. Getting htmlFor prop did not match when testing the form input, and this is causing Cypress test runner to hang indefinitely requiring a restart. Also some flakiness around the Testing Fundamentals click to expand the accordion item after we added div[role="button"] - test wouldn't work and then would. Further update: hanging was caused by .type() - can be fixed with: cy.get('selector').find('input').click().type('hi mom')
@YoungMiner
@YoungMiner 4 ай бұрын
Thanks man for this course !
@jenyakarpova2146
@jenyakarpova2146 8 ай бұрын
great content, thanks!
@skiphouston7392
@skiphouston7392 24 күн бұрын
Fantastic. Thank you for this.
@user-kv4tw6wc4w
@user-kv4tw6wc4w 3 ай бұрын
This was really helpful!
@ammarhaidar5995
@ammarhaidar5995 4 ай бұрын
Great video, thanks Ryan..!
@BoolFalse
@BoolFalse 8 ай бұрын
love this vid almost as much as TOOL's last album 🎉
@shafiulAlamShafi
@shafiulAlamShafi 8 ай бұрын
Wow!! What a timing video !!!
@andreyli8634
@andreyli8634 6 ай бұрын
Thank you so much!
@ricardorien
@ricardorien Ай бұрын
Good stuff, thanks a lot!
@Michael_Andish
@Michael_Andish 8 ай бұрын
Thanks!
@saimohankrishnabandarupall8785
@saimohankrishnabandarupall8785 8 ай бұрын
Right when i need it
@rishiraj2548
@rishiraj2548 8 ай бұрын
Thanks a lot
@jayTzanTG15
@jayTzanTG15 11 күн бұрын
Thank you ryan
@RogerDOdipo
@RogerDOdipo 2 ай бұрын
Amazing tutorial
@tomasz6011
@tomasz6011 16 күн бұрын
Great video, very helpfull
@TheFGrox
@TheFGrox 6 ай бұрын
Thanks a lot for the course! Will there be one with Playwright, also?
@swdavis7042
@swdavis7042 7 ай бұрын
I am new to javaScript and Cypress. When I downloaded visual studio, my ide looks different from yours! Can you please share the info about the version of vs you are using?
@MotherMaryprocathedral9
@MotherMaryprocathedral9 8 ай бұрын
i love your content
@dangray5809
@dangray5809 8 ай бұрын
Great course! However, the example app has a bug in it. The POST request on the "POST DATA" button returns an error every time.
@marlbo4627
@marlbo4627 6 ай бұрын
Were you able to fix this issue?
@ashutoshsingh-uh4io
@ashutoshsingh-uh4io 8 ай бұрын
please make a similar project on playwrights from basic to advance E2E framework
@disrael2101
@disrael2101 6 ай бұрын
is testing by itself a really in demand skill to get a job in?
@MotherMaryprocathedral9
@MotherMaryprocathedral9 8 ай бұрын
lovely
@Calocarv
@Calocarv 8 ай бұрын
The reason , I stopped using Cypress and jumped to Playwright was that every time I installed an update (which I was forced to do as it froze whenever it detected that I didn't have the latest) - the config got messed up and I had to fresh install cypress to get my tests working again. This was 3 years ago, I will give it another go this time round.
@disrael2101
@disrael2101 6 ай бұрын
any updates how is it this time? is testing by itself a really in demand skill to get a job in?
@Calocarv
@Calocarv 6 ай бұрын
@@disrael2101 it has improved, the only reason that it is preferred over playwright is that is somewhat easier to run the same tests on different environments. It is demand along with playwright a they are the latest tech and open-source.
@disrael2101
@disrael2101 6 ай бұрын
​@@Calocarv cool thanks so do you see a high demand in coming years for qa by itself (no dev) nowadays? no ai gonna replace it? haha.. thanks
@Calocarv
@Calocarv 6 ай бұрын
There will always be demand for QA .All Software is a product and no customer will want a product that does not have quality control. AI is not as advanced as the media is leading us to believe. Consumer confidence comes from reputation and reputation comes from people not AI. Would you choose wine made by machines in USA or people in Italy?
@ichiroutakashima4503
@ichiroutakashima4503 8 ай бұрын
This could be really useful. I've been using Jest though.
@disrael2101
@disrael2101 6 ай бұрын
is testing by itself a really in demand skill to get a job in?
@Zack9924
@Zack9924 8 ай бұрын
any retrofit library course? or ktor?
@PeteTaylor
@PeteTaylor 3 ай бұрын
Great tutorial, I do have a tangential question though, what VSCode theme are you using @coderyan? It's very pleasing to look at - dark and with nice subtle colours.
@its_funnih
@its_funnih 6 ай бұрын
Do we have to install Cypress for each and every project OR Options 2: we can store cypress at a central llocation inlo cal C: drive and access it from there. If option 2: how to access Cypress / where to specify path for cypress?
@jopadjr
@jopadjr 6 күн бұрын
3.1k+...Thanks. Great tutorial !!!
@swdavis7042
@swdavis7042 7 ай бұрын
Thanks for posting the video.Your dog is beautiful.
@myJapanTV013
@myJapanTV013 8 ай бұрын
getting error on doing npm install in the directory
@jamesvickery6158
@jamesvickery6158 2 ай бұрын
Thank you for the great video! At 49:38 he adds a data-test to his accordion. When I type from the $ sign, my local environment doesn't seem to pick it up - so when I inspect the page after the string appears exactly as I wrote it instead of interpreting it and applying the ID automatically.. to workaround I just set the data-test to 'accordion-item-1' and called that directly in the test.. could there be some dependancies I am missing? Thanks in advance!
@walkingin6375
@walkingin6375 6 ай бұрын
Is this not outdated? All the mention about jquery etc. . . Do people still use this for React, or is it generally Jest / Vitest?
@marcinbjl
@marcinbjl 3 ай бұрын
hi guys, question for those who actually do work with cypress professionally - Is it a normal practice to pollute production code with test tags? are testers actually allowed to add them everywhere? or in reality elements are selected in more complicated ways? e.g. checking parents, siblings, by regex etc.
@djillalirafil9749
@djillalirafil9749 3 ай бұрын
I think testers and developers discuss this, so test-id tags are added. And yes, Iv already seen test data id tags on a real website
@user-qf7dt2yg7x
@user-qf7dt2yg7x 8 ай бұрын
what a lovely dog
@WendyLiving
@WendyLiving 3 ай бұрын
I got an error while doing npm run dev, pls what can i do? Getting this error: ReferenceError: performance is not defined
@FrontendFLow811
@FrontendFLow811 8 ай бұрын
course on playwright testing for writing E2E test cases
@disrael2101
@disrael2101 6 ай бұрын
is testing by itself a really in demand skill to get a job in?
@FrontendFLow811
@FrontendFLow811 6 ай бұрын
@@disrael2101 not an in demand skill while interviewing but definitely a good one while you’re at the job
@disrael2101
@disrael2101 6 ай бұрын
@@FrontendFLow811 hmm thanks so do you see a high demand in coming years for qa by itself (no dev) nowadays? no ai gonna replace it? haha.. thanks
@waleedsharif618
@waleedsharif618 8 ай бұрын
Cyppres vs react testing library (for react), which one better ?
@sahandsepidar4089
@sahandsepidar4089 7 ай бұрын
not-related ; both have own capibilities ; react testing library is for unit-testing cyppress is for E2E testing ; theres no preference
@disrael2101
@disrael2101 6 ай бұрын
is testing by itself a really in demand skill to get a job in? @@sahandsepidar4089
@yogeshdevaggarwal
@yogeshdevaggarwal Ай бұрын
I like the way he made a whole website just for a tutorial 🗿
@russozelinsky
@russozelinsky 6 ай бұрын
How to show stats for each browser if more than one browsers is used, and the same test is run twice?
@hahamen
@hahamen 7 ай бұрын
Timed out retrying after 4000ms: expected '/fundamentals' to equal '/examples' why am i getting error? Even though it's according to the video
@chadiesanagustin7260
@chadiesanagustin7260 8 күн бұрын
same
@michaeledwardharris
@michaeledwardharris 3 ай бұрын
This reminds me of the guy who, years ago, was able to sneak a completely meaningless PR into the Linux kernel. He's now technically a "kernel contributor." Iirc, he git rejected numerous times, but for some reason, his final attempt got through.
@Khanasad_
@Khanasad_ 8 ай бұрын
Can a web application penetration tester watch this is it helpful for pentester?? I am new in it and found javascript as crucial language of web want to start learning .. and find ways to test
@jordanmuller2536
@jordanmuller2536 8 ай бұрын
I don't know if it's specifically applicable directly to penetration testing but it certainly would help you understand the inner workings of JavaScript which could lead to insights that help you in pen testing. I guess what I'm saying is, it's not super related but it's good to learn new things to learn more about stuff in general! The more general knowledge you have the more specific niche knowledge you'll start to uncover.
@jordanmuller2536
@jordanmuller2536 8 ай бұрын
That being said, if you don't know JavaScript, I would start with learning it before learning how to test it! Maybe worth learning in parallel but JS foundations are probably best to have before
@raianforhad7057
@raianforhad7057 8 ай бұрын
I have a question We will learn HTML CSS JavaScript for become a web developer So , which college degree I will take for a web developer? BSc in computer science? BSc in web development?
@skyy_banerjee
@skyy_banerjee 8 ай бұрын
Computer Science.
@HealthyBodyHealthyLyf
@HealthyBodyHealthyLyf 8 ай бұрын
BSc in either IT or CS
@user-xg2du3bb9b
@user-xg2du3bb9b 4 ай бұрын
cool video)
@otisprogramming2437
@otisprogramming2437 5 ай бұрын
Aren't .find and .within the same thing when chained with the same .get(element)? What am I missing here?
@sarvarbek_vakhobov
@sarvarbek_vakhobov 3 ай бұрын
Hi, First of All, Thanks for this tutorial. I have learnt so many things. But I have faced one problem on component testing. I created new spec, but I was not detected... can anyone tell me why I got this error?
@betzelem5757
@betzelem5757 8 ай бұрын
Can we get some Playwright content next?
@smpc500
@smpc500 17 күн бұрын
51:06 Testing is fun! It is my job :)
@aishna7457
@aishna7457 8 ай бұрын
Hello, I'm new here and i want to learn coding.while searching for some best coding websites and youtube channels to learn coding I came across this one. But I don't have any idea about this and don't know how to start and where to start. Could you guys please suggest me something?
@freecodecamp
@freecodecamp 8 ай бұрын
Consider going through the free coding curriculum at www.freecodecamp.org
@rajibhossain928
@rajibhossain928 4 ай бұрын
What is the meaning of " TDS "? Can I know?
@Ankit-fl3wl
@Ankit-fl3wl 8 ай бұрын
Please on Android development using new Ui technology
@rajibhossain928
@rajibhossain928 4 ай бұрын
❤️❤️❤️❤️❤️
@suvrajitmondal2325
@suvrajitmondal2325 8 ай бұрын
Please make video in jest
@ichiroutakashima4503
@ichiroutakashima4503 8 ай бұрын
This. I requested this months ago. 😂
@ciprianov2006
@ciprianov2006 7 ай бұрын
Nice vid bro, thx
@user_8982
@user_8982 Ай бұрын
01:30:15
@James-uv7zt
@James-uv7zt 2 ай бұрын
anyone else's cypress ( chrome or electron ) crashing after something ( im not sure what ) - but I open the app and it's back to "tests loading"
@sebastianponce628
@sebastianponce628 2 ай бұрын
i think i've got the same problem, sometimes while testing, the test spinner keeps loading forever
@James-uv7zt
@James-uv7zt 2 ай бұрын
mine was due to the mac window shutting down it caued the tests to fail@@sebastianponce628
@taras-weezzy
@taras-weezzy 8 ай бұрын
Add timestamps plsssss
@mehrnazaboutalebi2862
@mehrnazaboutalebi2862 Ай бұрын
cant run the app.
@ernestpfannen8920
@ernestpfannen8920 8 ай бұрын
👁👁👍 1:02
@RowafaEdits
@RowafaEdits 8 ай бұрын
Can I edit your videos?
@sobeidalagrange7129
@sobeidalagrange7129 8 ай бұрын
00:36
@skyy_banerjee
@skyy_banerjee 8 ай бұрын
Are you guys reading minds? No seriously, are y'all? 😑🤔
@spacebeetle
@spacebeetle 8 ай бұрын
you are not alone lol
@skyy_banerjee
@skyy_banerjee 8 ай бұрын
@@spacebeetle Exactly 😅
@rajendrawagle1854
@rajendrawagle1854 8 ай бұрын
Exactly 😂😂😂
@alirezagarshasbi6557
@alirezagarshasbi6557 8 ай бұрын
just added cypress today :/
@dharaniprakash3472
@dharaniprakash3472 8 ай бұрын
Exactly they're 😅
@SoStop
@SoStop 8 ай бұрын
Today was discussing the use of Cypress with team
@samarbid13
@samarbid13 8 ай бұрын
No examples on mocking authentication for tests?
@torieptaka7149
@torieptaka7149 8 ай бұрын
I dont see APi testing. Why not? do we really care about the frontend that much?
@sazk4000
@sazk4000 5 ай бұрын
why even bother uploading if you can't do timestamps
@isambo400
@isambo400 8 ай бұрын
I’m showing this to African refugees
@paul_reddy
@paul_reddy 6 ай бұрын
This video doesn't covers many things 😢😢😢😢😢😢😢 , 1 dislike .
@wasd3108
@wasd3108 8 ай бұрын
testing frontend, not javascript lmfao
@mariaturzynska1592
@mariaturzynska1592 5 ай бұрын
Too much talking.. to little coding
@stirpro2073
@stirpro2073 8 ай бұрын
After hearing "Ask chatgpt or go old fashion and look up to docs" lost interest in video.
@ShipWreck68
@ShipWreck68 Ай бұрын
At around min 50 the it("Accordion works correctly", () => { cy.visit("/fundamentals"); cy .contains(/Your test will exist in a describe block/i) .should("not.be.visible"); fails the assertion. Cannot get past this in the code example.
@MynamedidntFitDonkey
@MynamedidntFitDonkey 6 ай бұрын
If you have to make changes to the code you are testing to make tests work, that's not a good practice.
@Hypergraph
@Hypergraph 8 ай бұрын
i don't understand why thenewboston paused for years and later try to make its own crypto and failed.
React Testing Course for Beginners - Code and Test 3 Apps
2:04:21
freeCodeCamp.org
Рет қаралды 116 М.
Cypress Complete Beginners Masterclass 1 | Step by Step | Raghav Pal |
1:20:54
Automation Step by Step
Рет қаралды 176 М.
I Trapped Myself in a Box with Colored Smoke!
00:50
A4
Рет қаралды 17 МЛН
INO IS A KIND ALIEN😂
00:45
INO
Рет қаралды 8 МЛН
And what’s your age? 🥰 @karina-kola
00:12
Andrey Grechka
Рет қаралды 4,6 МЛН
Test-Driven Development // Fun TDD Introduction with JavaScript
12:55
Learn TypeScript Generics In 13 Minutes
12:52
Web Dev Simplified
Рет қаралды 190 М.
Stop Writing So Many Tests
10:02
Web Dev Simplified
Рет қаралды 77 М.
How to Get a Developer Job - Even in This Economy [Full Course]
3:59:46
freeCodeCamp.org
Рет қаралды 1,4 МЛН
Cypress Testing with React - Simple Tutorial
12:43
Cosden Solutions
Рет қаралды 29 М.
JavaScript Tutorial for Beginners: Learn JavaScript in 1 Hour
48:17
Programming with Mosh
Рет қаралды 12 МЛН
Something Strange Happens When You Follow Einstein's Math
37:03
Veritasium
Рет қаралды 3,7 МЛН
#AskRaghav | Cypress Or Selenium | Which is better automation platform |
11:26
Automation Step by Step
Рет қаралды 38 М.
I Trapped Myself in a Box with Colored Smoke!
00:50
A4
Рет қаралды 17 МЛН