Playwright Automation Tutorial | Lecture-2| First Basic Test| How To Test the Title of a Page?

preview_player
Показать описание
Step by Step Process To Create Your First Test Case Using Playwright
========================================================

So, we need to change line no. 7 to the following-

await expect(page).toHaveTitle(/Goog/)

This will check a partial match to Goog instead of the full string Google
To do the full string test, we can change the line no. 7 to

await expect(page).toHaveTitle("Google")
This will check for an exact match- Google

5. We are all set. Now, to run the the test case that we have just written, first open the Terminal from VS Code and write the following command and run-

This will run the single test case in all three browsers in a headless mode

6. To run the test case in headed mode, write the following command and run-
Рекомендации по теме