From the course: Playwright Python and Pytest for Web Automation Testing: Master Modern Web Testing with Playwright and Pytest in Python
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Running test
In the previous lesson, we have written this basic test case, which tests the root function, and makes sure that its return value is as expected. Now to run this test, we can use the pytest command. That is, in our terminal, we can use the pytest command, and provide it our filename, which is utils underscore test. So let's go ahead and provide that. So utils underscore test dot py, hit enter, pytest will go ahead and find the test function and then run the same. And it also generates a beautiful log like this. That is we get some information on our platform and the packages along with its versions. we get the root directory and the total number of test cases that is the collected items. And then we get the file in which it's running the test. One green dot means that the test has passed. And we also get a progress bar type of thing where we get the percent that is if you'd have two tests then it would be 50% and then 100% and at the end we get a green bar which means all the tests…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.