Understanding Playwright Test Assertions

preview_player
Показать описание
a beginner friendly, but in depth walk through of playwright assertions.
understand how they work and the difference between different assertions.
Web first assertions
soft assertions
jest expect assertions
Polling that can be used to make resilient API assertions.
Рекомендации по теме
Комментарии
Автор

Hello there! Thank you for this educative video. I have a question regarding the usage of assertions in conditional statements. Specifically, I would like to know if it's possible to use an assertion as a condition in an if-else block. Here's an example to illustrate my point:

Let's say I have an assertion that checks the visibility of an element. If the element is visible, I want to print a console message saying "Visible." If the element is not visible, I want to print a console message saying "omg my test is broken!"

Is it possible to use assertions in this way within an if-else block? Your insights on this matter would be greatly appreciated. Thank you in advance for your help!

randolphcarter