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

Running test

In the previous lesson, we created our test. Now we'll go ahead and run the same. So we know how to run a pytest test. That is, we simply use the pytest command and just provide it the filename. In this case, it's testapp.py. Now there's one other way to run the same. That is if we just run the pytest command in the current directory, it will go ahead and find all of the test files. In this case, in our directory, we only have one. But if there were multiple, then pytest will go ahead and run all of them one by one. So if we go ahead and just use the pytest command, it will find the file and run the same. it took a bit here because it started the browser, opened the page and performed the actions in our test and then closed the same. You can also see it took 1.65 seconds and also it passed the test. That is the link after we click on it is the documentation one. Great. Now when running our test, we can configure some things playwright specific as well. is by default you see that the…

Contents