Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cypress: I want run tests in 100 spec files by login one time and persist login for every file. Is it possible?

I have almost 100 specs files including multiple tests. I want run all these specs files by login one time. I dont want my cypress should login process every time on every spec file It it possible to persist single login for all spec files

like image 775
Kashif nadeem Avatar asked Dec 10 '19 11:12

Kashif nadeem


People also ask

How do I run multiple spec files in Cypress?

cypress run --group <name> You can add multiple groups to the same run by passing a different name. This can help distinguish groups of specs from each other. Specifying the --ci-build-id may also be necessary.


1 Answers

Take a look at our "Logging in" recipes https://github.com/cypress-io/cypress-example-recipes#logging-in-recipes - most of them log in once using before hook, and then save the cookie / token in a local variable and set it again and again in beforeEach hook

like image 61
gleb bahmutov Avatar answered Oct 14 '22 04:10

gleb bahmutov