Instead of cy.visit('/'); in every test we can also add to a login() function right after the session block cy.login('/'); and now we can write tests without that cy.visit('/'); as well. Thank you for tutorial!
hey, if i close the cypress runner and reopen and run the test, it is coming as session is creating but the whole cypress is got refreshed, so I won't be able to properly cache the session, so login got fail, pls help with this
In order to use cy.session(), provide a setup as the second argument: cy.session(id, setup) Because this error occurred during a before each hook we are skipping all of the remaining tests.
Hi, When I use npx cypress open if I login once for the other spec files I am logged in automatically. But when I run using npx cypress run the login is happening for every spec files
How would i run tests that depend on each other, sequentially, without logging on before each test? So i execute test1 and then test 2 and so on, without having to logon
Excellent! I wonder which Cypress version is it? I'm trying to introduce cy.session() in my tests using v10.11 and there are several challenges. Keep isolation:false, experimentalSessionAndOrigin:true, but I can't restore the session in the next spec file. Cypress create a new one. I would appreciate whatever opinion on this. Thanks!!!
Thank you for the very helpful video. How to solve this one? So I have website I login with UI (it adds a cookie) I close the Cypress and open again Now I don't want to login again, I want to inject the cookie inside the browser and visit my user area Could you please share how we can solve this? Thank you
Hi, I have a quick question. I am using an internal URL (this is running in the browser) using cy.visit() but Im getting this error :A connection to the upstream proxy could not be established: ERR_EMPTY_RESPONSE: The upstream proxy closed the socket after connecting but before sending a response. Can you please advice on what needs to be done in running an internal url? Thanks in advance.
This is very helpful. Was wondering if you know a way to cache cy.visit('/') since going to '/' will take up of resource. Like you mentioned, in each test we need to specify cy.visit('/')
Thanks a lot for this video and its a great help. Amazing. Can i request one video where we can longin using Microsoft authentication or multi domain and returns to application. Basically application is authenticated using Microsoft authentication. I have reached out multiple places. I feel you are the right one to help. Appreciate of you can share a video on this and it really helps UI automation using Cypress. Thanks again and looking forward for your video
I got this error "experimentalSessionSupport is not enabled. You must enable the experimentalSessionSupport flag in order to use Cypress session commands"
Thank you so much for this video really helpful. I have a question currently i am using bdd page object model in cypress in typescript and i am passing username in feature file i want that all users which i am goanna use should login first and save the session before any tests run is this something possible ?
Hey great but how is having the username and password readable as string in the codebase considered good practice ? Anyone that gains access to your git repo for any reason (pentest or stuff like that) will have those credentials. Any way to get around this issue ?
It's not best practice, this video is just to show the basics. Ideally you would use your preferred method of secure retrieval. I current use azure keyvault for mine, however you can use anything. Even git secrets may be something for you to look into
Make sure not to log credentials! Don't create a security risk with testing and hide them away with "type(password, { log: false });" The cypress example does not follow it's own recommendations.
hey i don't know why but this isn't working for me, in 'it' block i am adding cy.visit('/') it goes back to login page if i dont add it, it doesn't go anywhere.. help me resolve this
I just LOVE that you showed how to do it "the best practise way". IE: Watching your video, I learned how to use command.js
Thanks a bunch !
Love to read these type of comments! Thank you
Thank you, this helped. I had over 600 tests, and now I'm saving a ton of time simply because of cy.session(). Thanks again!
Great job! Happy to help!
Exactly what i was looking for, it was hard to understand the docs about this. You explained it very well ❤❤
Thank you! Glad I can help!
Hey man! great video, helped a lot! dispersed a lot of confusion in my mind! Than you very much!
Instead of cy.visit('/'); in every test we can also add to a login() function right after the session block cy.login('/'); and now we can write tests without that cy.visit('/'); as well. Thank you for tutorial!
Great comment!
Wow, this was really useful, thank you for the video very clear explanation!
Nice video. So easily explained compared to other videos.
Thank you for the great comment :)
Great explanation! Thank you very much!
Great video and explanation! Thank you!
Thanks for the support :)
Amazing, Thanks a lot u safe my test
Perfect video! Just need to expand for Dotenv. No hard coding.
Thankyou for this great effort !!
Awesome! Thanks!
Great job, it helped me a lot!
Thanks :)
Thanks for the kind comment. Glad to have helped
Great videos my friend. Thanks for sharing!
Thank you for the kind words and support!
Perfectly done. Thanks a lot, mate!
nice video bro
Thank you! 👍
This is a Gem
Thank you :)
hey, if i close the cypress runner and reopen and run the test, it is coming as session is creating but the whole cypress is got refreshed, so I won't be able to properly cache the session, so login got fail, pls help with this
In order to use cy.session(), provide a setup as the second argument:
cy.session(id, setup)
Because this error occurred during a before each hook we are skipping all of the remaining tests.
facing this error on cypress console
Hi, When I use npx cypress open if I login once for the other spec files I am logged in automatically. But when I run using npx cypress run the login is happening for every spec files
Tks for the video! But how is session () possible when logging in via API? Because I don't use visit() on my tests.
This is what I'm trying to do. Did you manage to make it?
How would i run tests that depend on each other, sequentially, without logging on before each test? So i execute test1 and then test 2 and so on, without having to logon
Excellent! I wonder which Cypress version is it? I'm trying to introduce cy.session() in my tests using v10.11 and there are several challenges. Keep isolation:false, experimentalSessionAndOrigin:true, but I can't restore the session in the next spec file. Cypress create a new one. I would appreciate whatever opinion on this. Thanks!!!
thanks for this!
Thank you for the very helpful video.
How to solve this one?
So I have website
I login with UI
(it adds a cookie)
I close the Cypress and open again
Now I don't want to login again, I want to inject the cookie inside the browser and visit my user area
Could you please share how we can solve this?
Thank you
Hi, I have a quick question. I am using an internal URL (this is running in the browser) using cy.visit() but Im getting this error :A connection to the upstream proxy could not be established: ERR_EMPTY_RESPONSE: The upstream proxy closed the socket after connecting but before sending a response. Can you please advice on what needs to be done in running an internal url? Thanks in advance.
can you help me i am facing issue Cy.vist in it block gives error
What is the error?
This is very helpful. Was wondering if you know a way to cache cy.visit('/') since going to '/' will take up of resource. Like you mentioned, in each test we need to specify cy.visit('/')
Thanks a lot for this video and its a great help. Amazing. Can i request one video where we can longin using Microsoft authentication or multi domain and returns to application. Basically application is authenticated using Microsoft authentication. I have reached out multiple places. I feel you are the right one to help. Appreciate of you can share a video on this and it really helps UI automation using Cypress. Thanks again and looking forward for your video
Yes I can try to create one. I would need to find a suitable test website to do this first though
Hello @sharmak2746 , i am also facing the same problem , did your issue resolved ? please do comment, thanks
@@tharunv3952 no, not yet unfortunately.
How am I not seeing any Describe block in the code ?
I got this error "experimentalSessionSupport is not enabled. You must enable the experimentalSessionSupport flag in order to use Cypress session commands"
Have you set that flag in your config?
Thank you so much for this video really helpful. I have a question currently i am using bdd page object model in cypress in typescript and i am passing username in feature file i want that all users which i am goanna use should login first and save the session before any tests run is this something possible ?
If you're using cucumber JS as your BDD tool, look into hooks, before all sounds like you may want that one
Thanks!
Hey great but how is having the username and password readable as string in the codebase considered good practice ? Anyone that gains access to your git repo for any reason (pentest or stuff like that) will have those credentials. Any way to get around this issue ?
It's not best practice, this video is just to show the basics. Ideally you would use your preferred method of secure retrieval. I current use azure keyvault for mine, however you can use anything. Even git secrets may be something for you to look into
❤
Can u share me code
Make sure not to log credentials! Don't create a security risk with testing and hide them away with "type(password, { log: false });"
The cypress example does not follow it's own recommendations.
hey i don't know why but this isn't working for me, in 'it' block i am adding cy.visit('/') it goes back to login page if i dont add it, it doesn't go anywhere.. help me resolve this
Can you provide your full code please? I'm happy to take a look for you