microsoft / playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
https://playwright.dev
Apache License 2.0
67.12k stars 3.69k forks source link

[Feature]: List all tests with their steps #33669

Closed AdamOakman closed 3 days ago

AdamOakman commented 3 days ago

🚀 Feature Request

It would be very useful for documentation reasons to be able to export/list all tests along with their steps.

There is already a way to list all the steps with npx playwright test --list command. New option like npx playwright test --list-with-steps would print all the test cases with all their steps underneath.

One idea is to make it work by analogy to list reporter with printSteps: true but without having to execute actual tests.

Example

npx playwright test --list-with-steps

Motivation

Having a way of exporting all tests along with their steps for documentation purposes, quick way to verify if no steps are missing etc.

dgozman commented 3 days ago

@AdamOakman Unfortunately, this is impossible to implement. Playwright does not know about test steps without running the test, because steps are not declarative, but dynamic. As you pointed out, printSteps: true is the way to go.