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.

Pytest CLI arguments

Pytest CLI arguments

In this lesson, we'll learn about the different CLI arguments which can be used with our Playwright PyTest plugin. Now, we have already used a few of them, that is when running our test, we can set the browser in the headed mode using the headed argument, that is this right here. This will enable us to see the user interface of our browser when running the test. Now if we want to slow down the browser, we can use the slowmo argument providing it the number to slow our browser down by. Now we can also specify the browser driver. By default it is chrome. So to do that we can use the browser argument and provide it the name of our browser. say Firefox or WebKit. Now these are the ones which we already know about but there are others available as well. Say if we want to emulate a device for our test then we can use the device argument provided the name of our device that is say Pixel 5 and if I run the test the Pixel 5 device will be emulated and the test will be performed on the same. So…

Contents