Cypress Tutorial: Login Once with cy.session() for faster tests

Cypress Tutorial: Login Once with cy.session() for faster tests

CommitQuality

1 год назад

25,226 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

ZAIN WEB DEV
ZAIN WEB DEV - 08.11.2023 18:48

I spent so much time on the docs, StackOverflow, chatgpt but didn't get any valid solution and you explained it in a really easy way. It resolved my issue.
Thank you so much!

Ответить
Geisser Gomez Urquiza
Geisser Gomez Urquiza - 18.10.2023 21:42

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!!!

Ответить
eason tseng
eason tseng - 18.10.2023 10:47

I wonder, the url redirect after login, how to handle the visit? we couldn't use cy.visit('/')

Ответить
Arthur Ivex
Arthur Ivex - 26.09.2023 02:47

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!

Ответить
princepcr
princepcr - 18.09.2023 06:33

thanks for this!

Ответить
Envo
Envo - 06.09.2023 15:12

Exactly what i was looking for, it was hard to understand the docs about this. You explained it very well ❤❤

Ответить
Samuel Caçador
Samuel Caçador - 01.09.2023 20:14

Great explanation! Thank you very much!

Ответить
shahul shas
shahul shas - 09.08.2023 19:55

Ответить
Dr 9mm
Dr 9mm - 18.07.2023 14:45

How am I not seeing any Describe block in the code ?

Ответить
RANVIJAY UPADHYAY
RANVIJAY UPADHYAY - 24.06.2023 13:21

Can u share me code

Ответить
Aline Cristine Fadel
Aline Cristine Fadel - 19.06.2023 16:31

Tks for the video! But how is session () possible when logging in via API? Because I don't use visit() on my tests.

Ответить
Oleksandr Ostapchuk
Oleksandr Ostapchuk - 09.06.2023 00:32

Great video and explanation! Thank you!

Ответить
Gian
Gian - 07.06.2023 18:26

Thanks!

Ответить
Aman Ullah
Aman Ullah - 01.06.2023 18:22

Thankyou for this great effort !!

Ответить
Top 5 lists Mania!
Top 5 lists Mania! - 31.05.2023 06:23

I got this error "experimentalSessionSupport is not enabled. You must enable the experimentalSessionSupport flag in order to use Cypress session commands"

Ответить
SCHMOUKER Clément
SCHMOUKER Clément - 15.05.2023 12:27

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 ?

Ответить
Narendra Mehta
Narendra Mehta - 09.05.2023 13:18

Great job, it helped me a lot!
Thanks :)

Ответить
tarun mehrotra
tarun mehrotra - 26.04.2023 19:39

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 ?

Ответить
Sufiyan ali
Sufiyan ali - 18.04.2023 10:50

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

Ответить
Catalin IONESCU
Catalin IONESCU - 20.03.2023 10:14

This is high quality content, good job, it helped me a lot!

Ответить