Understanding Playwright Test Assertions

  Рет қаралды 7,013

CommitQuality

CommitQuality

Күн бұрын

Пікірлер: 5
@imperuminate
@imperuminate Жыл бұрын
thanks for such videos
@randolphcarter3906
@randolphcarter3906 Жыл бұрын
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!
@randolphcarter3906
@randolphcarter3906 Жыл бұрын
I've managed to do it using try-catch block! Finally everything works as it had to.))
@CommitQuality
@CommitQuality Жыл бұрын
Awesome. I was going to suggest you look into try catch blocks, but it's worth noting it may be a bit of anti pattern for the assertions. If you want to find out if something failed but not fail the test immediately, using soft assertions may help
@MaheshJoshi_wellington
@MaheshJoshi_wellington 9 ай бұрын
You are such an amazing teacher take a bow 🙌 looking for ward to BDD with playwright typescript
Playwright Test Annotations (NodeJS)
15:29
CommitQuality
Рет қаралды 3 М.
How To Write First Test Case In Playwright | Playwright Java Tutorial
34:59
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 7 МЛН
Playwright with Javascript | Assertions | Part 7
41:09
SDET- QA
Рет қаралды 25 М.
Test automation with Playwright
15:15
Microsoft Developer
Рет қаралды 52 М.
How to Run Playwright Tests Using Jenkins
17:26
CloudBeesTV
Рет қаралды 16 М.
The Four Futuristic Features Of Playwright
31:22
Applitools: AI-Powered End-to-End Testing Platform
Рет қаралды 11 М.
Reuse Playwright  Code across Files and Tests with Fixtures
5:54