To interrupt a running @playwright/test, use the keyboard shortcut
Ctrl + C on Windows or
Command + C on Mac. This sends an interrupt signal to the terminal, stopping the test execution. You can also close the terminal window or tab where the test is running.
If you're running tests in headless mode (no browser window opens), stopping a test is as simple as using the keyboard shortcut or closing the terminal.
If you're running tests in headed mode (a browser window opens), you have a couple of options:
Remember, the method to stop a running test depends on whether it's being run in headless or headed mode. In headless mode, use keyboard shortcuts or close the terminal, while in headed mode, click the "Stop" button in VS Code or close the browser window.
If you still have questions, please ask a question and I will try to answer it.
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email firstname.lastname@example.org.