Playwright Skip Login | Playwright Tutorial part - 31

preview_player
Показать описание
Preserve authenticated state#
Run codegen with --save-storage to save cookies and localStorage at the end. This is useful to separately record authentication step and reuse it later.

Commands:

Source code:
--------------------------Thank you---------------------------

Thanks for watching, if you like the video, give it a thumbs up 👆.
Sharing is caring, kindly share the video with your friends and colleagues.
Don't forget to subscribe and hit the bell 🔔 notification.
--------------------------------SOCIAL--------------------------------

Join our WhatsApp group.

#letcode
Рекомендации по теме
Комментарии
Автор

Works great!

This saves a lot of headaches trying to by-pass SSO, etc.

damienosullivan
Автор

Thank you koushik. It's very informative. excited to learn every day.

VishalDeshpande
Автор

Great vid! Saving so much time for my E2E tests.

benjaminstewart
Автор

This is cool! Thanks a lot for posting this. It saved me a lot of time.

orlo
Автор

Awesome bro...Keep it up...Thanks to you!

shriniwasalle
Автор

Hi Koushik, Thank you for the playwright tutorial. Can you please add video for How to get browser specific cookie value using Playwright. many thanks

kalpeshkumarghinaiya
Автор

Thank You Koushik. It is really a great idea and it's helpful.
Can you please guide us how to handle untrusted SSL certificate with playwright ?

mohiniyerra
Автор

Hello Koushik, I'm sorry to write this in comment but I don't know how I can talk to you otherwise, I'm the guy with the problem of uplloading. I find your videos very interesting and thank you for those tutorials. I'm trying to test if a button of copy is working on my page but I don't know how to see what's in my clipboard once I clicked on copy.

Thank you for your help, tou're the boss.

sebastienmusettiroyer
Автор

Great Video, Its easy to setup but having a quick question how are you handling when the cookies expires after sometime as they have expiry time

humbleharmonic
Автор

Hello Koushik, is there a way we could add this to an before each hook so I do. Or need to type all of this into all of my test cases?

yflako
Автор

This is great koushik! Thank you. As I test several apps in my current repo, can store more than one auth.json? Just by naming them differently I assume? auth1.json, auth2.json etc

srpotqn
Автор

Hi all, is it possible to call an api to get a token, save it in the session storage, and navigate the application? My problem is that the application needs a token from a SSO and I didn't find how to deal with it. Thanks!

StefanoGabriele
Автор

Has anyone else had problems with cookies? They are not being written in the browser context, but
if I run "console.log(await context.cookies())" the cookies are shown in the terminal...

LuanPereira-uogn
Автор

Clear Cut Explanation, but i have a doubt.
Can i use multiple cookies in same auth.json file. will it work or is there any other procedure

ebgwbkf
Автор

It works great but I need some help. I have put this code in a test.beforeeach and then tried to run my first test. However, after it logs in perfectly, it doesn't run my first test. I think it happens because the first test is test('"test1', async ({ page }) => { and here it doesnt reference to the same page as it did in test.beforeeach. How can I solve this? It opens a new page and the new page is of course blank.

barbaroscelik
Автор

We have a requirement to test email content ?Doest playwright supports this feature? I had googled it but was not able to find a proper one. It would be great if you suggest me regarding this. Thank you in advance

sukanyanune
Автор

Hey Koushik, Thank you for this video. I have few queries... If I want to log in to different test files using different login credentials, should I create a separate auth.json for each test file?
And if I want to log in to a single test file using different login credentials, how should I do this?

Could you please guide me?

wrxqgkv
Автор

Hi Koushik,

const page = await context.newPage();
const ctxt = page.context();
ctxt.storageState()

What does this piece of code do in the test?

srpotqn
Автор

awesome 😊,
how can we know if the cookie is expired or not ?
or we have to check the element wiht the login if it's present, thanks

dragon
Автор

Thank you, Koushi. I have a question: when I log in to google, I get the following message: "This browser or app may not be safe" error when trying to log in with Google in desktop apps. I'm using python

fernandomdcn