Тёмный

How to parameterize and configure your custom Playwright fixtures 

Подписаться
Просмотров 2,3 тыс.
% 108

Join Stefan Judis in this Playwright tutorial, where he explains how to make your custom Playwright fixtures configurable using "option fixtures". Stefan briefly explains the fixture concept but then focuses on creating an option fixture configurable on a global, project, and spec file basis.
Example source code: github.com/checkly/playwright-examples/tree/main/parameterized-fixtures
Playwright docs: playwright.dev/docs/test-parameterize
Checkly Synthetic Monitoring: www.checklyhq.com/product/synthetic-monitoring/
0:00 Intro
0:52 The problem - custom fixtures are not configurable
1:59 Custom fixtures explained
2:46 Provide configuration values via environment variables
3:07 Add a custom fixture option
4:13 Override the defined fixture option
5:53 Summary
6:18 Outro
#checkly #playwright #syntheticmonitoring

Наука

Опубликовано:

 

19 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 22   
@ChecklyHQ
@ChecklyHQ 19 дней назад
🦝If you have any questions or comments, drop them below, and if you're looking for the example code, you can find it on GitHub: github.com/checkly/playwright-examples/
@DJ_Locks
@DJ_Locks 18 дней назад
This needs to be better outlined in the documentation... I've been trying to work around not having this for the last 11 months. THANK YOU!
@ChecklyHQ
@ChecklyHQ 18 дней назад
Wooohoooo! Happy this video resolves a year-lasting problem. 🎉
@yurademchenko9924
@yurademchenko9924 18 дней назад
Greetings from Ukraine I have 7+ years of C# experience in UI, API testing. But now the market has changed and I have to learn new languages ​​and technologies. Thank you for the videos.
@ChecklyHQ
@ChecklyHQ 16 дней назад
Welcome to the channel! If you have any questions or comments, just leave a comment. I love to create follow ups. :)
@3VAudioVideo
@3VAudioVideo 18 дней назад
Awesome video! Glad that great question was asked! Always something new and cool to learn from you. What I would really like to know is how to run tests as a Playwright job on Jenkins, where more than once PC is running Playwright tests. I got it to run on a single PC, the same PC that is hosting Jenkins. But how do I tell it to run the same job (or multiple jobs?) concurrently on remote PCs? Maybe you could do a series on Jenkins, covering all the basics leading up to this? If not, just one video for this scenario? Your videos Rock!
@ChecklyHQ
@ChecklyHQ 6 дней назад
Great question! 💯 Did you discover this video? ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-fG0YePSS5iA.html Generally what you describe should be possible with a bit of Playwright config. :)
@ICIC-cl4qk
@ICIC-cl4qk День назад
Can you build an example to show how multiple test data fixture files could be used along with page fixtures in a test?
@alexanderkomanov4151
@alexanderkomanov4151 19 дней назад
Wow! So cool!!!
@ChecklyHQ
@ChecklyHQ 19 дней назад
Thanks for watching! 🦝
@manuQAE
@manuQAE 19 дней назад
Cool!
@YenovSegal
@YenovSegal 13 дней назад
test.use only affects a test.describe or whole test file, what I can do if I want only affect on one test from the test file?
@ChecklyHQ
@ChecklyHQ 6 дней назад
Great question! 💯 It's written in the Playwright docs: "[test.use] specifies options or fixtures to use in a single test file or a test.describe() group". I have to research if you can do only one test, but I think this is not possible right now.
@YenovSegal
@YenovSegal 2 дня назад
@@ChecklyHQ OK, I really hope you find it
@AKHILDABRAL
@AKHILDABRAL 10 дней назад
Can u guys make playwright-bdd library videos ??
@ChecklyHQ
@ChecklyHQ 6 дней назад
Thanks for the question. :) I don't have much experience with playwright-bdd so I'm not sure if we'll cover this topic. Is there anything particular you'd like to see?
@AKHILDABRAL
@AKHILDABRAL 5 дней назад
@@ChecklyHQ I would like to see how to use multiple projects with multiple dependencies using different credentials and saving them to different auth file. Currently when I am trying to pass the auth file name from metadata using project dependencies it is giving file error for page.context(). storageState(path : passed filename);
@ChecklyHQ
@ChecklyHQ 5 дней назад
@@AKHILDABRAL Thanks I'll add it to the list. :)
@rafaeldanelogomez
@rafaeldanelogomez 19 дней назад
Which method is best for you in this user credentials scenario? .env or parameterized fixtures?
@ChecklyHQ
@ChecklyHQ 19 дней назад
I personally prefer to only have flags or single values in `.env`. For example, a base URL is something where I set a sane default, but make it possible to overwrite via .env. For user creds, I usually setup a single user fixture with multiple levels (user.admin, user.customer, etc.) or go with multiple ones. It depends a bit on the scenario. :)
@dadslife2464
@dadslife2464 18 дней назад
@@ChecklyHQ Can you pls make a short video of above solution, i have the same question .env or parameterized fixtures for user credentials scenario?
@ChecklyHQ
@ChecklyHQ 18 дней назад
@@dadslife2464 I'll put it on the list, but just so I understand your question. You're looking for pros/cons of each approach?