app icon indicating copy to clipboard operation
app copied to clipboard

Support Playwright test.step in reports

Open alexander-goncharuk opened this issue 1 year ago • 3 comments

Describe the solution you'd like When uploading a Playwright test run repot to testomat.io, we would like to be able to:

  1. See all the tests included in the run
  2. 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.

alexander-goncharuk avatar Jun 16 '24 07:06 alexander-goncharuk

@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

DavertMik avatar Jul 02 '24 12:07 DavertMik

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.

AZANIR avatar Jul 02 '24 14:07 AZANIR

related to https://github.com/testomatio/app/issues/1036#issuecomment-2222839603

image

poliarush avatar Jul 17 '24 12:07 poliarush