playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Feature]: Skip some step from the test file in tarceviwer as action

Open darshandp007 opened this issue 1 year ago • 1 comments

🚀 Feature Request

I have a test file mentioned below. After execution, I got the traceviwer. In traceviwer there are all actions present same as in file.

import { test, expect } from '@playwright/test';

function modifyUser(params){
  /** Doing some operations and return some data*/
   await page.getByRole('buttonJ').click();
}

test('get started link', async ({ page }) => {
  await page.goto('https://playwright.dev/');

  await modifyUser({data: 'abc'});
  await page.getByRole('link', { name: 'Get started' }).click();

  await modifyUser({data: 'def'});
  await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible();

  await page.goto('https://playwright.dev/');

  await page.getByRole('button').click();

  await modifyUser({data: 'ghi'});
  await page.getByRole('buttonB').click();
});

Expected Output:

  • I want to skip some action into the tarceviwer. Like i have use one function here as modifyUser. So whatever activity happen in modifyUser() function. it should not be visible in tarceviwer in action tab.
  • Do we have any option to avoid some actions in traceviwer, but it should consider in test execution.
  • The agenda is do not disclosing sensitive actions in the action tab.

Note: Image is different from the above test file example. Image only for the reference.

image

Motivation

It better to other competitor.

Example

No response

Pitch

I believe this feature helpful for all of the playwright user in daily basis usecases.

darshandp007 avatar Feb 02 '24 09:02 darshandp007

https://playwright.dev/docs/release-notes#hide-implementation-details-box-test-steps - follow the demo here to box the implementation details of your helper function.

pavelfeldman avatar Feb 02 '24 20:02 pavelfeldman

Closing as per above.

pavelfeldman avatar Feb 06 '24 00:02 pavelfeldman