Support Playwright test.step in reports
Describe the solution you'd like When uploading a Playwright test run repot to testomat.io, we would like to be able to:
- See all the tests included in the run
- Expand each test to see the steps (test.step in Playwright API) of each test
It's similar to what you get in Playwright HTML reporter or when running in --ui mode.
When I go to Test => Automated in my testomat.io dashboard or explore test run report in a List view, I get close to what we need, but the missing part is simple sub-list of steps.
Describe alternatives you've considered Step in Testomat functions. But ideally would prefer to not adjust tests code for concrete reporter needs.
@AZANIR please do the following
- propose steps format which is simple and universal and supports nested steps
- add this format definition to
types.d.ts - check how Playwright passes steps and how it formats them
We can also use Playwright steps to write description to tests
Step Format Proposal The proposed format will include the following elements:
title: The name of the step. body: The function that performs the step, returning a Promise. options (optional): Additional options such as box. We will define the structure to support nested steps by allowing the body to call other steps.
// types.d.ts
type StepOptions = {
box?: boolean;
};
type StepFunction = () => Promise<any>;
interface Step {
title: string;
body: StepFunction;
options?: StepOptions;
}
type Steps = Step[];
Step Declaration: Use test.step('Title', async () => { ... }) to declare steps. Nested Steps: Nest steps by calling test.step within another test.step. Step Formatting: Titles and body functions are used to describe and implement steps, which are then shown in the test reports. Options: Customize step behavior using options like box.
related to https://github.com/testomatio/app/issues/1036#issuecomment-2222839603