Cypress Complete Beginners Masterclass 2 | Step by Step | Raghav Pal |

  Рет қаралды 61,174

Automation Step by Step

Automation Step by Step

Жыл бұрын

All FREE courses - automationstepbystep.com/
QUIZ - forms.gle/MJFQSFU6bkFP8Ter9
Cypress with JavaScript
Cypress with TypeScript
Assertions
Page Object Model
App Actions
Grouping Tests
In Next Part
CLI
Package.json
File Handling
(Read, Write, Upload, Download)
Reporting
Cypress with JavaScript
Cypress with TypeScript
Cypress tests run with JavaScript, so you can use JavaScript or any language that transpiles down to javascript like TypeScript
Cypress with TypeScript
• Cypress Beginner Tutor...
TypeScript
• TypeScript for Beginners
Assertions in Cypress
Implicit Assertions - in-built assertions
Command in cypress like should() check for the expected condition without having to use any assert or expect command separately
Explicit Assertions - not in-built or referred
Have to use specific assertion commands like assert() or expect()
What is Page Object Model
a design principle
keep the objects & methods separate from test script
efficient reusability
easier, efficient and faster changes & maintenance
Step 1 : Create a login test
Step 2 : Create a file and add a class for the page
export class LoginPage{
}
Step 3 : Add objects and functions in the class
Step 4 : Import the class in the test spec
import {LoginPage} from "../pages/login_page"
Step 5 : Create object of the class
const loginPage = new LoginPage()
Step 6 : call the class functions
loginPage.enterUsername('test')
App Actions
What are App Actions
How is it different from Page Objects
Shortcuts in app
provide users with quick ways to navigate to specific activities in app
change the state of your app without user interactions (GUI)
How to Group tests in Cypress
Step 1 : In the test file add 2 it blocks for login test and run
Step 2 : Have a login test with valid and invalid credentials
Step 3 : Group all tests (it blocks) in a describe block
describe()
.only
.skip
beforeEach block
within describe - Runs before each test in that describe group
outside describe - Runs before each test in that spec file
____________________________________________________________
Stories by Raghav - automationstepbystep.com/stor...
My Udemy Courses - automationstepbystep.com/udem...
Every LIKE & SUBSCRIPTION gives me great motivation to keep working for you
You can support my mission for education by sharing this knowledge and helping as many people as you can
If my work has helped you, consider helping any animal near you, in any way you can.
Ask Raghav - bit.ly/2CoJGWf
Interviews - bit.ly/2NIPPxk
All Playlists - bit.ly/2LSiezA
---------- Connect with Raghav -----------
Udemy Courses - www.udemy.com/user/raghav-pal-3/
Twitter - / learnwithraghav
KZbin - / automationstepbystep
Never Stop Learning
Raghav

Пікірлер: 237
@philipmark9820
@philipmark9820 Жыл бұрын
Another great video - just the right speed. Honestly - this free video course is better than other ones I've paid for access to!
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome Philip, humbled
@nicolasma7424
@nicolasma7424 Жыл бұрын
Really great tutorial Raghav ! I'm used to be working with Selenium but now need to switch to Cypress. Your videos are awesome AND up-to-date, which is not the case of 90% of tutorials out there. Can't wait to see what's next :) Keep up the good work !
@RaghavPal
@RaghavPal Жыл бұрын
Hi Nicolas, thanks a lot
@nishiclaire4179
@nishiclaire4179 3 ай бұрын
Your videos are my go-to for practical test automation guidance! Thanks for making learning enjoyable and effective...
@RaghavPal
@RaghavPal 3 ай бұрын
You're very welcome Nishi
@sibichakravarthy6247
@sibichakravarthy6247 Жыл бұрын
Raghav- it is a such a wonderful training on cypress. Appreciate your effort
@RaghavPal
@RaghavPal Жыл бұрын
Thanks Sibi
@nvn1413
@nvn1413 Жыл бұрын
Thanks Raghav! This is exactly the type of tuitorial that I was looking for. Have been your subscriber from quite long & your videos never disappoint. Thankyou..!
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome
@akhilp2384
@akhilp2384 Жыл бұрын
Raagav sir, you are a life saver......thank you very much.....please provide next class asap.....I was finding it very difficult with selenium, buy cypress literally saved me
@RaghavPal
@RaghavPal Жыл бұрын
Sure Akhil, have added 4 parts on Cypress, Can get from here - automationstepbystep.com/
@VaibhavPatil-ii3jg
@VaibhavPatil-ii3jg Жыл бұрын
@@RaghavPal Hi Raghav Sir by this 4 master lecture videos can we learn full cypress for end to end automation testing ? Please reply soon ?
@andrewa5080
@andrewa5080 Жыл бұрын
Excellent effort! keep up the good work, Fantastic! tutorials, thank you so much, Raghav.
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome Andrew
@marcusguimaraes4232
@marcusguimaraes4232 Жыл бұрын
Hello Raghav! Thank you for this Cypress course, for the way you pass on knowledge, instructions, comments, suggestions. Happy to learn so easily and efficiently! My score on Quiz #2 was 20/25.
@RaghavPal
@RaghavPal Жыл бұрын
Great, all the best Marcus
@salmaaziz2218
@salmaaziz2218 2 ай бұрын
Best teacher, best Cypress's course, im so gratefull to come accross your achannel, thanks a lot teacher
@RaghavPal
@RaghavPal 2 ай бұрын
Most welcome Salma
@kalaiarasan6251
@kalaiarasan6251 Жыл бұрын
Great effort! keep up the good work, thank you so much, Raghav.
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome Kalai
@Cricitalops52
@Cricitalops52 10 ай бұрын
Hey Raghav, your pretty understandable and step by step explanations are easy to follow and very beneficial. Appreciate!
@RaghavPal
@RaghavPal 10 ай бұрын
Thanks
@soniyalazar9377
@soniyalazar9377 9 ай бұрын
Very nice class sir, it is very helpful....got more idea about cypress from your training..expect more trainings on different topics...great work..
@RaghavPal
@RaghavPal 9 ай бұрын
Sure I will Soniya, keep watching
@durgaprasadvadlamoodi1271
@durgaprasadvadlamoodi1271 5 ай бұрын
Thank you @ragahav for very good tutorial with examples. This is very useful for the beginners.
@RaghavPal
@RaghavPal 5 ай бұрын
Glad it was helpful Durga
@qsysopr21
@qsysopr21 Жыл бұрын
It is a great course please keep teaching. My score was 22/25 not bad at all.
@RaghavPal
@RaghavPal Жыл бұрын
Great
@amazingkhan420
@amazingkhan420 11 ай бұрын
I am from Pakistan Since the day reached to your channel, i decided to emphasis on Cypress of Automation., although it does not support Safari officially but by adding dependencies you can test on Safari with limitaitons we can test .... Thanks Raghav,
@RaghavPal
@RaghavPal 11 ай бұрын
Most welcome Akhter
@ooozzzoo6885
@ooozzzoo6885 Жыл бұрын
thank you very much for this lessons!
@RaghavPal
@RaghavPal Жыл бұрын
most welcome
@scarrollnz
@scarrollnz Ай бұрын
Very enjoyable course. Fast and well explained.
@RaghavPal
@RaghavPal Ай бұрын
Great to hear Steven
@Testflaps
@Testflaps Жыл бұрын
Thank you for these excellent tutorials Raghav
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome Michael
@ragnarlathbrok9021
@ragnarlathbrok9021 Жыл бұрын
thank you very much for these lessons
@RaghavPal
@RaghavPal Жыл бұрын
You are welcome!
@asielalabbassi7097
@asielalabbassi7097 11 күн бұрын
Amazing job thanks Raghav
@RaghavPal
@RaghavPal 10 күн бұрын
Thanks a ton Asiel
@tomasemr3839
@tomasemr3839 Жыл бұрын
24/25, really nice tutorial! Thank you so much
@RaghavPal
@RaghavPal Жыл бұрын
Great score Tomáš, well done
@priyanshulasod3365
@priyanshulasod3365 Жыл бұрын
Hi Raghav sir you video pretty easy to understand currently I m learning cypress with your video and I got 22/25 in quiz 2
@RaghavPal
@RaghavPal Жыл бұрын
Great Priyanshu
@anandsarpatwari7341
@anandsarpatwari7341 Жыл бұрын
Great to learn and I have taken Quiz and scored 20marks. Thanks Raghav. Regards Anand Sarpatwari
@RaghavPal
@RaghavPal Жыл бұрын
All the best
@user-zg6zu2hv3j
@user-zg6zu2hv3j 7 ай бұрын
Your lesson videos amazing thank you from Turkey
@RaghavPal
@RaghavPal 7 ай бұрын
Most welcome Sevilay
@roshanpokhrel1421
@roshanpokhrel1421 Жыл бұрын
Thank you so much for this course i find your course really interesting and i got 22 out of 25 in your quiz and hopefully i will do better in next quiz.
@RaghavPal
@RaghavPal Жыл бұрын
Great job Roshan. All the best
@agungdadhi2597
@agungdadhi2597 Жыл бұрын
Thank you, Raghav. Great course. For now, OrangeHRM element would not be the same as you make this video, so I need to do adjustment for the code when I learn Cypress with this video :D
@RaghavPal
@RaghavPal Жыл бұрын
Glad it was helpful!
@philipmark9820
@philipmark9820 Жыл бұрын
Thanks!
@RaghavPal
@RaghavPal Жыл бұрын
Thanks for the support Philip
@ricardorien
@ricardorien Жыл бұрын
Thanks a tons!
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome
@prashantthube
@prashantthube Жыл бұрын
Thanks Raghav
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome Prashant
@vaniamocherniuk4894
@vaniamocherniuk4894 6 ай бұрын
Thank you for the great tutorials. Big up!!! 📢📢📢
@RaghavPal
@RaghavPal 6 ай бұрын
My pleasure Ivan
@sandhyags7713
@sandhyags7713 Жыл бұрын
Thanx for the excellent video .I have scored 19/25. Thanku Raghav
@RaghavPal
@RaghavPal Жыл бұрын
Well done
@WinstonMarkKahid
@WinstonMarkKahid 11 ай бұрын
Thank you for this free course, man. I appreciate you! score 20/25
@RaghavPal
@RaghavPal 11 ай бұрын
most welcome Winston
@hafizsyedzainulabdin3900
@hafizsyedzainulabdin3900 Жыл бұрын
Excellent learning experience Quiz marks 17/20 Thanks Sir
@RaghavPal
@RaghavPal Жыл бұрын
Great job
@raomusadiq6602
@raomusadiq6602 Жыл бұрын
First test 10/10 Second test 21/25(Some are wrong because I have listended half lecture till test) Thank you sir. your lecutures are helping me alot. (Appreciation from Pakistan)
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome. all the best for next quiz
@sergtur8174
@sergtur8174 Жыл бұрын
Thank you Raghav! Please clarify what plugin for Cypress do you use in VSC ?
@RaghavPal
@RaghavPal Жыл бұрын
Most welcome
@rancrosider
@rancrosider Жыл бұрын
23/25. Nice tutorial for Cypress 10.x !! Thank you so much.
@RaghavPal
@RaghavPal Жыл бұрын
most welcome
@nicolahearn4294
@nicolahearn4294 Жыл бұрын
This is brilliant! Thank you, I got 17/20 on your quiz :)
@RaghavPal
@RaghavPal Жыл бұрын
Excellent Nicola
@rajithkumar3424
@rajithkumar3424 Жыл бұрын
Nicely presented
@RaghavPal
@RaghavPal Жыл бұрын
Thanks Rajith
@Lucajeck
@Lucajeck 10 ай бұрын
Grazie.
@RaghavPal
@RaghavPal 10 ай бұрын
Thanks a lot for the support
@xMczZc0x
@xMczZc0x Жыл бұрын
Hi Raghav, thanks again for video as always. Just one question, if I have one long test I would like to break up into smaller test blocks, just to have parts of the test show The result passing or not. Problem is when I split them into different "it" blocks, it doesn't include the result from the previous block. For example 1st "it" block : Navigate to URL, Second 'it" block I want to log into site with credentials. In second "it" block, I am no longer on the same URL as I navigated to in the first block, how can I manage this? Thanks so much
@RaghavPal
@RaghavPal Жыл бұрын
Hi Farhan, Katalon Studio offers a TestOps platform that provides a central repository for storing and sharing your test execution results, including pass/fail rates, baseline, performance, and other metrics. TestOps also offers advanced reporting and analytics features that can help you visualize and analyze your test results, track your testing progress over time, and identify trends and issues. Yes, Katalon Studio supports integration with secret servers, such as HashiCorp Vault, using custom keywords or plugins. This allows you to securely store and manage your passwords and other sensitive data, and retrieve them at runtime when needed. Katalon Studio supports testing from both SQL and non-SQL data sources. You can use Katalon's built-in data-driven testing features to read data from CSV, Excel, or database sources, or write custom scripts to connect to other data sources using JDBC or other APIs. I will try to do a video
@roligbiaye3554
@roligbiaye3554 Жыл бұрын
Hi Raghav , I scored 23/25 in this quiz session...I love this video
@RaghavPal
@RaghavPal Жыл бұрын
Great score Roli. All the best for next
@sirisha8k
@sirisha8k Жыл бұрын
Hi Sir, your videos are simple are easy to understand. Wondering if you could do a small video on cucumber with BDD using JavaScript would be useful.
@RaghavPal
@RaghavPal Жыл бұрын
Hi Sirisha, I will plan
@gadulayuvasaisantosh9036
@gadulayuvasaisantosh9036 Жыл бұрын
hi Raghav instead of saving objects with in the same file , can i add in a separate file and import --> as there could be a chance we have so many locator values with in the web page , for example filling a form and if so , can you please let know how ?
@RaghavPal
@RaghavPal Жыл бұрын
Yes, you can
@anupdeshmane8827
@anupdeshmane8827 23 минут бұрын
my score 24/25
@tejkumarkempaiah5373
@tejkumarkempaiah5373 Жыл бұрын
Thanks for such a great video, Can you please create a video on how to perform multilingual testing using Cypress
@RaghavPal
@RaghavPal Жыл бұрын
I will plan
@tejkumarkempaiah5373
@tejkumarkempaiah5373 Жыл бұрын
@@RaghavPal Thank you 🙏
@hazimabdoh6303
@hazimabdoh6303 Жыл бұрын
Total points 22/25 thanks mr Raghav
@RaghavPal
@RaghavPal Жыл бұрын
All the best
Жыл бұрын
20/25 almost all good
@RaghavPal
@RaghavPal Жыл бұрын
Well done Andrés
@NitinNandanwar
@NitinNandanwar Жыл бұрын
Hi Raghav, do you have any video on cloud performance testing with JMeter?
@RaghavPal
@RaghavPal Жыл бұрын
Hi Nitin, I have shown how to do performance testing with JMeter, you can use the same process for any similar apps, can find all videos here - automationstepbystep.com/
@jeromedigity
@jeromedigity 8 ай бұрын
hi Raghav what is your code theme in VS studio?
@RaghavPal
@RaghavPal 8 ай бұрын
Jerome I do not remember exactly, you can try some dark themes and compare
@whitenoisefocus7962
@whitenoisefocus7962 8 ай бұрын
9/10 on the quiz! 🔥
@RaghavPal
@RaghavPal 8 ай бұрын
Great . All the best for next
@asifshaik1038
@asifshaik1038 Жыл бұрын
Thank you very much sir
@asifshaik1038
@asifshaik1038 Жыл бұрын
Quiz: 22/25
@asifshaik1038
@asifshaik1038 Жыл бұрын
Sir, when we can expect next session?
@RaghavPal
@RaghavPal Жыл бұрын
already uploaded Asif
@adebowaleomolara3786
@adebowaleomolara3786 Жыл бұрын
Thank you so much your awesome tutorial saved me!! Can we get access to the slides?
@RaghavPal
@RaghavPal Жыл бұрын
Thanks, slides not handy with me now
@ravisinghrajpoot3086
@ravisinghrajpoot3086 Жыл бұрын
Hello Raghav... Again a master class session.. QQ is there a way to execute tests in order in Cypress for version 8
@RaghavPal
@RaghavPal Жыл бұрын
Hi Ravi, I believe Cypress itself does not provide this feature and it is to encourage the design where tests are independent and do not have dependency, this will help during parallel runs. can check this - stackoverflow.com/questions/58936891/cypress-how-can-i-run-test-files-in-order
@ravisinghrajpoot3086
@ravisinghrajpoot3086 Жыл бұрын
@@RaghavPal thank you so much Raghav, this will definitely help ❤️
@anaghaprabhakaran2117
@anaghaprabhakaran2117 6 ай бұрын
Hii Ragav thankyou so much.... Can you please is there any courses available with certification for cypress?
@RaghavPal
@RaghavPal 6 ай бұрын
Anagha I don't think there is any official certfication course from Cypress yet.. There may be others.. can check online
@hileooo
@hileooo Жыл бұрын
HI Bro, your videos are very nice, neatly explained in a simple fashion.. are there any videos on Cypress project for practice.. if not please do make some on orange HRM application.. TIA
@RaghavPal
@RaghavPal Жыл бұрын
Thanks Ravi, you can find all here - automationstepbystep.com/
@harshadamali2699
@harshadamali2699 Жыл бұрын
Hii Raghav, i am getting an issue when we import username and pwd //import { loginpages, loginpages } from "./pages/login_pages" let loginpages = new loginpages() it('pom', function(){ loginpages.// after giving .(dot) in suggestion username and password field are not showing.. please suggest.
@RaghavPal
@RaghavPal Жыл бұрын
Hi Harshada, Based on the code snippet you provided, it looks like you are trying to import a module called login_pages and create an instance of the loginpages class, but the username and password fields are not showing up in the suggestion dropdown. There could be several reasons why this is happening. Here are a few things to check: Make sure that the login_pages module exports the loginpages class and that the username and password fields are defined as properties or methods of this class. Verify that the login_pages module is correctly imported into your test file using a relative file path. For example, if login_pages.js is located in a folder called pages in the same directory as your test file, you would import it like this: import { loginpages } from "./pages/login_pages"; Check that your IDE or text editor is configured to provide suggestions for properties and methods of imported modules. This may involve installing additional plugins or configuring the autocomplete settings in your editor. Make sure that the username and password fields are defined as public properties or methods of the loginpages class. If they are defined as private or protected properties or methods, they may not be visible outside of the class. If none of these suggestions solve the issue, please provide more details about your specific code and setup so that I can provide more targeted assistance.
@harshadamali2699
@harshadamali2699 Жыл бұрын
@@RaghavPal thank you
@vishnusaravanan7288
@vishnusaravanan7288 Жыл бұрын
Hi raghav ,thanks for ur master class it was very helpful u are down to the earth person can u please say how we can write a test case or how to automate from drop down lost,for example I need to select a county from list of countries drop down ,please help
@RaghavPal
@RaghavPal Жыл бұрын
Hi Vishnu, thanks, I will plan sessions on this
@santhoshkumar-jz1df
@santhoshkumar-jz1df 11 ай бұрын
@RaghavPal while running my scripts in docker container, facing the issue "Your page did not fire its load event within 60000." no urls are blocked in network. Please help in resolving this
@RaghavPal
@RaghavPal 11 ай бұрын
Hi Santhosh The error "Your page did not fire its load event within 60000" occurs when Cypress times out waiting for the page to load. This can happen for a few reasons, such as: * The page is taking a long time to load. * There is a network issue that is preventing the page from loading. * There is a bug in your Cypress tests that is preventing the page from loading. To resolve the error, you need to identify the root cause of the problem. Here are some things you can try: * Check the network logs to see if there are any errors. * Use a tool like `curl` to see if you can load the page from the command line. * Debug your Cypress tests to see if there is a bug that is preventing the page from loading. If you are still unable to resolve the error, you can try increasing the `pageLoadTimeout` value in your Cypress configuration file. This will tell Cypress to wait longer for the page to load. Here is an example of how to increase the `pageLoadTimeout` value in your Cypress configuration file: ``` { "pageLoadTimeout": 120000 } ``` Once you have increased the `pageLoadTimeout` value, you should be able to run your Cypress tests without getting the error. In addition to the above, you can also try the following: * Make sure that you are using the latest version of Cypress. * Try using a different browser, such as Firefox or Edge. * Try using a different network connection. I hope this helps
@archiebobo
@archiebobo Жыл бұрын
Great video. Is it normal for chai to have not been installed? expect() doesn't work unless I require("chai"), but apparently it was never installed so had to install separately
@RaghavPal
@RaghavPal Жыл бұрын
Hi Archie, Cypress is an end-to-end testing framework, and Chai is an assertion library that can be used with Cypress to make test assertions It's not uncommon for Chai to be installed separately from Cypress, as Chai is not included by default with Cypress. You'll need to install Chai manually if you want to use it in your Cypress tests
@billykidd5313
@billykidd5313 Ай бұрын
Good 2nd class on Cypress I got 10 out of 10 🎉
@RaghavPal
@RaghavPal Ай бұрын
Great... keep learning Billy
@itsfunnyshubh4000
@itsfunnyshubh4000 Жыл бұрын
Hello Raaghav sir!! For example if I insert some data and on click it will save to our UAT db. Do we actually save our data into the db or we can mock request to db.
@RaghavPal
@RaghavPal Жыл бұрын
Hi Shubh, In Cypress, you can mock server responses to simulate the behavior of the application without actually making real requests to the database or server. This is done using Cypress' built-in cy.route() command. When you use cy.route(), you can intercept requests made by your application and return mocked responses instead. This allows you to simulate different server responses and test how your application behaves in different scenarios.
@itsfunnyshubh4000
@itsfunnyshubh4000 Жыл бұрын
@@RaghavPal Thank you so much sir for your response. What would I prefer mock response or actual db response for testing
@RaghavPal
@RaghavPal Жыл бұрын
mocking will be easy and quick
@harkeeratkaur8648
@harkeeratkaur8648 Жыл бұрын
Hello Raghav how i can connect with you i need your help for Karate framework
@RaghavPal
@RaghavPal Жыл бұрын
Hi Harkeerat, can let me know in the comment section of Karate videos
@saikotagiri2501
@saikotagiri2501 Жыл бұрын
Hi Raghav. Please do the videos on Angular latest version. It is the current trending also. Please do this one. It will be very helpful to every one.
@RaghavPal
@RaghavPal Жыл бұрын
I will plan Sai
@manuxavier7578
@manuxavier7578 3 ай бұрын
Hi @Raghav, I have just started cypress with your tutorial. In between, one query. After website loaded, while trying to get the locator of an element, its not giving the actual locator. I tried with multiple websites, but same issue there. It would be helpful if you can advice here. Thanks for your tutorials
@RaghavPal
@RaghavPal 3 ай бұрын
Manu Here are some consolidated steps and strategies to troubleshoot and refine your locator selection: Double-Check Element Uniqueness: - Inspect and Analyze: Use your browser's developer tools to thoroughly inspect the element you're trying to interact with. Ensure it has unique attributes (like `id`, `class`, `data-*` attributes) or a distinctive combination of properties to differentiate it from other elements on the page. - Contextual Identification: If there are multiple similar elements, consider using more specific locators that incorporate their relative position, text content, or other unique qualities. For example, `cy.get('div:nth-child(2) h3').contains('Specific Text')`. Verify Selector Syntax and Typing: - Case Sensitivity: Be mindful of case sensitivity when using CSS selectors. Match element attribute case exactly (e.g., `div.myClass`, not `Div.MyClass`). - Escaping Special Characters: Properly escape special characters (e.g., backslashes in IDs) within locators using double backslashes (`\\`). - Quotes and Delimiters: Ensure correct usage of single or double quotes for string values and commas/spaces to separate selectors when combining attributes. Utilize Advanced Locators and Strategies: - Alias and `data-*` Attributes: For dynamic content or testing components across pages, create unique `data-*` attributes on elements and use them in locators. Cypress has a handy `data-cy` alias for this purpose. - Custom Commands: Create reusable custom commands for complex locators or interactions that you use frequently. This improves code readability and maintainability. - cy.contains() for Text-Based Locators: Use `cy.contains()` for partial or full text matches when appropriate. Be cautious with potential ambiguity. - cy.get(':visible') and Visibility: Ensure the element is visible on the screen before interacting with it. Use `cy.get(':visible')` or visibility checks before your actions. Consider Using Waits and Timeouts: - cy.wait()` for Asynchronous Operations: If the element appears dynamically after an AJAX call or other asynchronous action, use `cy.wait()` or asynchronous handling patterns (e.g., `.should('be.visible').then(...)`) to ensure its presence before attempting to interact. - cy.wait(ms)` for Delays: If there's a known delay between elements appearing, use `cy.wait(ms)` to introduce a short waiting period. Debugging and Troubleshooting: - Cypress Debugger: Use the built-in Cypress debugger to step through your tests, inspect variables, and examine DOM state at specific points. - DOM Inspection: Right-click the element in your browser (Inspect) and then click "Copy selector" to see the exact selector Cypress might be generating and compare it to what you're using.
@daadinaanikahaniyan
@daadinaanikahaniyan Жыл бұрын
Hi Raghav Can we hide 'chrome is being controlled by automated software' from browser in cypress
@RaghavPal
@RaghavPal Жыл бұрын
Hi Raman, can check this discussion - github.com/cypress-io/cypress/issues/5021
@nirmalanj9569
@nirmalanj9569 Жыл бұрын
when I try to use the describe (), I just observed automatically the "import { beforeEach } from "mocha"" is created and not sure of the reason. If you could help me to understand it might be useful. Thanks
@RaghavPal
@RaghavPal Жыл бұрын
You can remove that and go with as shown in the tutorial
@prikshitverma3885
@prikshitverma3885 10 ай бұрын
Hi I have a query related to a functionality . I have 31 URLs programs at which I need to test a single chat icon test ( just open and close) I am having trouble how to do that. Can you please assist me
@RaghavPal
@RaghavPal 10 ай бұрын
Hi Prikshit Here are the steps on how to test a single chat icon test (just open and close) in Cypress: 1. Create a Cypress test file. The test file should be named chat-icon-test.spec.js. 2. Import the Cypress cy object. The cy object is used to interact with the browser. 3. Open the first URL in the list. You can do this by using the cy.visit() method. 4. Find the chat icon. You can find the chat icon by using the cy.get() method. 5. Click on the chat icon. You can click on the chat icon by using the cy.click() method. 6. Verify that the chat window is open. You can verify that the chat window is open by using the cy.get() method to find the chat window and then checking if it is visible. 7. Close the chat window. You can close the chat window by using the cy.close() method. 8. Repeat steps 4-7 for the remaining URLs in the list. Here is an example of a Cypress test file that tests a single chat icon test (just open and close): Code snippet import { cy } from "cypress"; describe("Chat icon test", () => { it("should open and close the chat window", () => { cy.visit("www.example.com"); cy.get(".chat-icon").click(); cy.get(".chat-window").should("be.visible"); cy.close(); }); }); I hope this helps
@madhugoud3850
@madhugoud3850 Жыл бұрын
Can you please make a video on installing, running and general html/json report of lightouse using cypress
@RaghavPal
@RaghavPal Жыл бұрын
I will check and plan Madhu
@madhugoud3850
@madhugoud3850 Жыл бұрын
@@RaghavPal Thanks for the quick response. While I'm executing the script. I'm receiving an error *" cy.task('lighthouse') failed with the following error, the task event has not been registered yet in setupnodes"*. Do you have any suggestions on this pleas
@RaghavPal
@RaghavPal Жыл бұрын
Madhu here are a few suggestions for fixing the error "cy.task('lighthouse') failed with the following error, the task event has not been registered yet in setupnodes": 1. Make sure that you have installed the Cypress Lighthouse plugin. You can do this by running the following command in your terminal: ``` npm install cypress-lighthouse ``` 2. Make sure that you have added the following code to your plugins/index.js file: ``` import { lighthouse } from 'cypress-lighthouse'; on('task', lighthouse); ``` 3. Make sure that you are calling the cy.task() function after the on('task', lighthouse) function has been called. If you are still getting the error after trying these suggestions, please check the Cypress documentation for more information. Here are some additional things to check: * Make sure that you are using the latest version of Cypress. * Make sure that you are using the correct syntax for calling the cy.task() function. * Make sure that there are no errors in your code. If you are still having trouble, please post a question on the Cypress forum or open an issue on the Cypress GitHub repository
@MaazUrRehmanEngrMirza
@MaazUrRehmanEngrMirza Жыл бұрын
Hello Sir, please make a video on cypress code coverage using both Javascript and Typescript.
@RaghavPal
@RaghavPal Жыл бұрын
I will plan
@MyMediaVids
@MyMediaVids 13 күн бұрын
Hi Raghav, these videos are great - even for a TOTAL beginner like me - one issue, I'm receiving the message "> _login_page.LoginPage is not a constructor" when running the test at the same point as you (37:59) and am unable to identify what the issue is - any ideas?
@RaghavPal
@RaghavPal 13 күн бұрын
The error message you're encountering, "_LoginPage is not a constructor," typically occurs when there's an issue with how you're importing or using a class in your Cypress test. Let's troubleshoot this together. First, let's take a look at your code snippet: ```javascript /// import LoginPage from './PageObject/LoginPage' it('valid test', function() { const Login = new LoginPage() // Rest of your test logic... }) ``` The error suggests that the `LoginPage` class is not being recognized as a constructor. Here are a couple of things to check: 1. Named Export: - Ensure that you're exporting the `LoginPage` class using a named export in your `./PageObject/LoginPage` file. Instead of using `export default LoginPage`, try using a named export like this: ```javascript export class LoginPage { // Your class methods... } ``` 2. Import Statement: - When importing the `LoginPage` class, use curly braces to import it as a named import: ```javascript import { LoginPage } from './PageObject/LoginPage' ``` 3. Function Declarations: - Make sure that the functions within your `LoginPage` class are properly declared. You can either use the `function` keyword before each function name or declare them as arrow functions using `const`. Example using `function` keyword: ```javascript class LoginPage { visit() { cy.visit("ec2-35-179-99-242.eu-west-2.compute.amazonaws.com:2021/") } // Other methods... } ``` Example using arrow functions: ```javascript class LoginPage { visit = () => { cy.visit("ec2-35-179-99-242.eu-west-2.compute.amazonaws.com:2021/") } // Other methods... } ``` Try making these adjustments and see if the issue persists --
@navyarai8111
@navyarai8111 Жыл бұрын
Hi Raghav Sir, Great tutorial sir w.r.t Cypress, Can you please help me out in configuring Duo Auth for login where we enter the UName and Password ==> redirects to an approve request for DUO Auth in our phone . Kindly let m the how can I perform this, tried couple of snippets but not able to redirect to the success login
@RaghavPal
@RaghavPal Жыл бұрын
Hi Navya, I have not checked this, will need to find online
@suneethaedara327
@suneethaedara327 Жыл бұрын
Got 10 marks in second quiz. Thank you
@RaghavPal
@RaghavPal Жыл бұрын
Great
@nainis5634
@nainis5634 Жыл бұрын
The scripts written on VS code are not getting displayed under the specs Cypress dashboard. But i can see that under the respective folder .Can you please help me?
@RaghavPal
@RaghavPal Жыл бұрын
Hi Naini, When running Cypress tests, the Cypress dashboard looks for tests that are located in the integration or E2E folder by default. If your test scripts are not located in this folder or its subfolders, they will not be picked up by the Cypress dashboard. To fix this issue, you need to move your test scripts to the integration/e2e folder or one of its subfolders. Once you have moved your test scripts to the correct location, the Cypress dashboard should be able to find them and display them in the test runner.
@Lucajeck
@Lucajeck 9 ай бұрын
Hello thank you very much for your very nice course. I have a question: "I'm trying to automate some tests on the company website, but I'm unable to do so because it uses reCAPTCHA. How can I solve this issue? Thank you very much."
@RaghavPal
@RaghavPal 9 ай бұрын
Please check this - kzbin.info/www/bejne/h3q8k6VuZsl9fbM
@ashwinnair3782
@ashwinnair3782 Жыл бұрын
@39:36 how can we avoid hardcoding and instead user can directly input in cypress? Expecting you kind reply.
@RaghavPal
@RaghavPal Жыл бұрын
Hi Ashwin, you mean the values of username and password, Yes we can take it from another file (excel), class, variable etc Can check some online examples
@ashwinnair3782
@ashwinnair3782 Жыл бұрын
@@RaghavPal thank you 😊
@aditisah3289
@aditisah3289 8 ай бұрын
Hi Raghav, I want to use same session across different spec, for that I am usinf testIsolation:false and also cacheAcrossSpecs: true, but still the session is not maintained, can you please let me know how to create session using cookies and maintain it across all the specs. Thanks!
@RaghavPal
@RaghavPal 8 ай бұрын
Aditi To create a session using cookies and maintain it across all specs in Cypress, you can use the following steps: **1. Create a cookie jar** A cookie jar is a container that stores cookies. You can create a cookie jar using the following code: ```javascript const cookieJar = new Cypress.CookieJar(); ``` **2. Set the cookies** You can set cookies in the cookie jar using the following code: ```javascript cookieJar.setCookie('session_id', '1234567890'); ``` **3. Start a new Cypress spec** When you start a new Cypress spec, you can pass the cookie jar to the `cy.visit()` method. This will tell Cypress to use the cookie jar for the session. ```javascript cy.visit('example.com', { cookieJar }); ``` **4. Maintain the session across specs** To maintain the session across specs, you can use the following code: ```javascript // Get the cookie jar from the current spec. const cookieJar = cy.getCookieJar(); // Set the cookies in the cookie jar for the next spec. cookieJar.setCookie('session_id', '1234567890'); ``` You can call this code at the beginning of each spec that needs to use the existing session. Here is an example of a Cypress script that uses a cookie jar to maintain a session across specs: ```javascript // Create a cookie jar. const cookieJar = new Cypress.CookieJar(); // Set the session cookie. cookieJar.setCookie('session_id', '1234567890'); // Start a new spec and pass the cookie jar to the visit method. cy.visit('example.com', { cookieJar }); // Do some tests. // Maintain the session for the next spec. cookieJar.setCookie('session_id', '1234567890'); // Start a new spec. cy.visit('example.com', { cookieJar }); // Do some more tests. ``` This script will maintain the session across both specs, so that the user will not have to log in again.
@aditisah3289
@aditisah3289 8 ай бұрын
@@RaghavPal Thank you so much, will try it and let you know.
@surajkamble3538
@surajkamble3538 5 ай бұрын
First quiz =10/10 , Second quiz = 10/10
@RaghavPal
@RaghavPal 5 ай бұрын
Great Suraj
@anikinamerica5462
@anikinamerica5462 8 ай бұрын
Thank you Raghav! One thing just like to inform you that please upgrade your video quality please.. Video is not clear like others. Take care
@RaghavPal
@RaghavPal 8 ай бұрын
Noted, Anik, I will improve this
@anikinamerica5462
@anikinamerica5462 8 ай бұрын
@@RaghavPal Appreciated
@DesiMenu2711
@DesiMenu2711 3 ай бұрын
Hi Sir, In login page if we are getting accept cookies popup and want to click on Accept all cookies button from the pop up then how to right code???
@RaghavPal
@RaghavPal 3 ай бұрын
When dealing with a "Accept cookies" popup in Cypress, you can follow these steps to click the button: 1. Identify the Popup Element: - First, inspect the page to find the specific element representing the "Accept all cookies" button. - If the button is inside an , you'll need to handle it accordingly. 2. Handle Iframes (if applicable): - If the button is inside an , you can use the `cypress-` plugin to interact with it. - Install the plugin by running: ``` npm install cypress- ``` - In your test spec, add the following line at the top: ```javascript require('cypress-'); ``` - Then, locate the using its ID (replace `#my-frame` with the actual ID): ```javascript cy.('#my-frame') .find('button[title="Accept Cookies"]') .click(); ``` 3. Click the Button: - If the button is not inside an , you can directly click it using: ```javascript cy.contains('Accept', { timeout: 20000 }).click({ force: true }); ``` 4. Additional Considerations: - Sometimes popups take a moment to appear. You can add a `cy.wait(5000)` to account for any delay. - Ensure that your test environment allows interaction with popups and doesn't block them. Remember to adjust the selectors and timeouts based on your specific application. ..
@DesiMenu2711
@DesiMenu2711 3 ай бұрын
@@RaghavPal Thank you Sir
@niazraza213
@niazraza213 Жыл бұрын
23/25 score :) thnks sir
@RaghavPal
@RaghavPal Жыл бұрын
Well done
@HarelYeh...
@HarelYeh... 8 ай бұрын
thank 23/25
@RaghavPal
@RaghavPal 8 ай бұрын
Great score. All the best for next
@zainabfirdos2666
@zainabfirdos2666 8 ай бұрын
Hello Sir, Can you please explain the git and Jenkins integration with Cypress? It would be helpful. Thanks
@RaghavPal
@RaghavPal 8 ай бұрын
will plan
@cemalatayeter4726
@cemalatayeter4726 Жыл бұрын
The testing industry revolves around this beautiful person :)
@RaghavPal
@RaghavPal Жыл бұрын
Thanks for the kind words Cemal, humbled
@sakthiveldeveloper8710
@sakthiveldeveloper8710 Жыл бұрын
9/10 Quiz because Page object model also part of question am choose wrong
@RaghavPal
@RaghavPal Жыл бұрын
Great, all the best for Next
@TheUnstoppablePirate
@TheUnstoppablePirate Жыл бұрын
the URL is being appended by "__/" in my office machine...can you please suggest a fix
@RaghavPal
@RaghavPal Жыл бұрын
Hi Vishal, will need to check with your IT team
@Harsh12351
@Harsh12351 24 күн бұрын
Hello! Where have you covered integration with Git, Jenkins?
@RaghavPal
@RaghavPal 24 күн бұрын
Harsh, its in part 3 kzbin.info/www/bejne/p5vLl4KYn5issLMsi=xO1fTGorbdzzzUd7
@Harsh12351
@Harsh12351 23 күн бұрын
@@RaghavPal I am afraid I still could not find any mention of integration with Git or Jenkins in your third masterclass video (link above). I had already watched it before raising the query here. There is file handling and running tests via CLI. But no integration. Can you mention the timestamps?
@RaghavPal
@RaghavPal 22 күн бұрын
Okay I will check Harsh, for now can follow these steps: ## Integrating Cypress with Git Prerequisites: Install Git on your system 1. Initialize a Git repository - Navigate to your project directory in the terminal and run `git init` 2. Add all your files to the Git repository - Run `git add .` to add all files in the current directory 3. Commit your changes - Run `git commit -m "Initial commit"` to commit your changes 4. Push your changes to a remote repository - If you haven't already, create a new repository on GitHub. - Run `git remote add origin your-repository-url` to add your remote repository. - Run `git push -u origin master` to push your changes to the remote repository ## Integrating Cypress with Jenkins 1. Install Node.js on Jenkins - Open the Plugin Manager in Jenkins. - Download and configure NodeJS - Open the Global Tool Configuration and configure NodeJS to the latest version 2. Create a new Jenkins job - Add a build step - In the build step, use the following commands to install project dependencies and run Cypress tests: ``` npm install npx cypress run ``` - These commands will install all necessary dependencies and run your Cypress tests 3. Configure Git in Jenkins - In your Jenkins job configuration, specify your Git repository URL and define the branches you want to build - Set up any build triggers (e.g., poll SCM, webhook) 4. Post-build Actions - Configure post-build actions based on your requirements. You can archive test reports, generate HTML reports using the plugin, or trigger deployment steps depending on your project’s needs Please note that these steps are a general guide and the exact process may vary depending on the specific versions of the software you are using.
@godwinoyale3550
@godwinoyale3550 Жыл бұрын
I tried using the orange HRM, I enter invalid details, it failed on the page but on the specs, it shows a 1passed with a green mark tick instead of it to display 1failed on the red cross sign. Please what could be the issue sir
@lestertayag4996
@lestertayag4996 Жыл бұрын
You should check for ' ' on the login_page.js username and password. All username and password should have the same color
@godwinoyale3550
@godwinoyale3550 Жыл бұрын
@@lestertayag4996 thank you. It's the same
@varundutta2381
@varundutta2381 8 күн бұрын
Quiz comes after 23 minutes. All topics asked in quiz are not covered by that time. Is it true or I am missing something.
@RaghavPal
@RaghavPal 8 күн бұрын
Yes Varun, there are several Quizzes, so this quiz contains questions done until this time
@Denys_888
@Denys_888 Жыл бұрын
17/25
@RaghavPal
@RaghavPal Жыл бұрын
great
@wayezahmed1540
@wayezahmed1540 10 ай бұрын
In page object model, why is the file name login_page.js? Why not login_page.cy.js ? Why .cy missing?
@RaghavPal
@RaghavPal 10 ай бұрын
Hi Wayez You can use either `login_page.js` or `login_page.cy.js` as the file name for your Cypress test file. The `.cy` extension is not necessary, but it is a convention that is used by many Cypress users. The `.cy` extension is a way to distinguish Cypress test files from other JavaScript files. It also helps to make it clear that the file contains Cypress code. If you are new to Cypress, you may want to use the `.cy` extension to make it easier to identify your Cypress test files. However, there is no technical reason why you have to use the `.cy` extension. Here is an example of a Cypress test file that does not use the `.cy` extension: ``` // login_page.js const { visit } = require('cypress'); describe('Login Page', () => { it('should display the login form', () => { visit('/login'); expect(cy.get('#login-form')).to.be.visible; }); }); ``` This code will work exactly the same as if it were in a file called `login_page.cy.js`. Ultimately, the decision of whether or not to use the `.cy` extension is up to you. There is no right or wrong answer.
@user-xz3jo8tl8c
@user-xz3jo8tl8c 2 ай бұрын
Hello sir Can you make one more video for "how to read the data from excel file in cypress"
@RaghavPal
@RaghavPal 2 ай бұрын
I will try this Rishabh
@user-xz3jo8tl8c
@user-xz3jo8tl8c 2 ай бұрын
Thank you@@RaghavPal
@shilupg
@shilupg Жыл бұрын
When you have created the login_page, why you given extension as .js instead of cy.js
@RaghavPal
@RaghavPal Жыл бұрын
Where exactly, tell me the time stamp
@shilupg
@shilupg Жыл бұрын
@@RaghavPal 30:57
@RaghavPal
@RaghavPal Жыл бұрын
that is fine, you can go as per the test file extensions you mention in the config file, Can change from there
@ayoubtalan2197
@ayoubtalan2197 Жыл бұрын
what if login can be only throw google account ??
@RaghavPal
@RaghavPal Жыл бұрын
Hi Ayoub, you can use plugin cypress-social-login which does just that. this can help docs.cypress.io/guides/end-to-end-testing/google-authentication stackoverflow.com/questions/53487224/anyone-has-an-example-in-cypress-that-uses-google-login
@myukeshkumar103
@myukeshkumar103 4 ай бұрын
23/25
@RaghavPal
@RaghavPal 4 ай бұрын
Wow
@ahmethalal6926
@ahmethalal6926 Жыл бұрын
19 from 25
@RaghavPal
@RaghavPal Жыл бұрын
Great, all the best for next Ahmet
@VaibhavPatil-ii3jg
@VaibhavPatil-ii3jg Жыл бұрын
1st Quiz score 8/10 & 2nd Quiz score 23/25...
@RaghavPal
@RaghavPal Жыл бұрын
Great, all the best
@welcomemusic6378
@welcomemusic6378 Жыл бұрын
Hey Raghav.. I gained 7 marks in quiz1 and in quiz2 gained 9 marks
@RaghavPal
@RaghavPal Жыл бұрын
Great, take a note of the missed ques and try again
@welcomemusic6378
@welcomemusic6378 Жыл бұрын
@@RaghavPal sur thankyou, i didnot expect reply from you. I am happy that you replied.
@NatashaWaheed-my9mb
@NatashaWaheed-my9mb 2 ай бұрын
My score is 23/25
@RaghavPal
@RaghavPal 2 ай бұрын
Great Natasha.. all the best for next
@MrKhankhan123
@MrKhankhan123 Жыл бұрын
In this video : I want to know that why You dont add //// in starting ?
@RaghavPal
@RaghavPal Жыл бұрын
Hi Noor I may have added that at global level (Config file)
@deepad8224
@deepad8224 Жыл бұрын
After certain time cypress browser is closing automatically then i am seeing below error in vs code terminal read ECONNRESET Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:217:20) please give solution how to fix
@RaghavPal
@RaghavPal Жыл бұрын
Hi Deepa, it may be due to firewall or anti-virus settings, check this can help - stackoverflow.com/questions/71294032/cypress-econnreset
@deepad8224
@deepad8224 Жыл бұрын
Thanks Sir, i will try
Cypress Complete Beginners Masterclass 3 | Step by Step | Raghav Pal |
1:08:45
Automation Step by Step
Рет қаралды 34 М.
Cypress Complete Beginners Masterclass 1 | Step by Step | Raghav Pal |
1:20:54
Automation Step by Step
Рет қаралды 183 М.
Omega Boy Past 3 #funny #viral #comedy
00:22
CRAZY GREAPA
Рет қаралды 34 МЛН
I Need Your Help..
00:33
Stokes Twins
Рет қаралды 148 МЛН
Cypress Testing Interview Questions| Postman Interview Questions For Experienced
38:02
#AskRaghav | Cypress Or Selenium | Which is better automation platform |
11:26
Automation Step by Step
Рет қаралды 38 М.
Cypress (Web Testing Framework) Crash Course - 2021
2:03:05
Laith Academy
Рет қаралды 105 М.
Cypress in a Nutshell - 2019
40:47
Cypress.io
Рет қаралды 300 М.
Cypress Tutorial #3 - How to Install and Configure Cypress | Part 1
14:17
Software Testing Mentor
Рет қаралды 7 М.
Cypress Tutorial: Login Once with cy.session() for faster tests
12:44
Working with Multiple Elements in Cypress | .each()  | Cypress Testing
10:47
SDET Unicorns by Dilpreet Johal
Рет қаралды 16 М.