From bed1a9e2fa155ffb5153418606cff4d183c5486c Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Thu, 28 Nov 2024 12:16:35 +0100 Subject: [PATCH] add test --- tests/playwright-test/ui-mode-trace.spec.ts | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/playwright-test/ui-mode-trace.spec.ts b/tests/playwright-test/ui-mode-trace.spec.ts index eb56204813..16ebeaf499 100644 --- a/tests/playwright-test/ui-mode-trace.spec.ts +++ b/tests/playwright-test/ui-mode-trace.spec.ts @@ -339,3 +339,27 @@ test('should show request source context id', async ({ runUITest, server }) => { await expect(page.getByText('page#2')).toBeVisible(); await expect(page.getByText('api#1')).toBeVisible(); }); + +test('should filter actions tab on double-click', async ({ runUITest, server }) => { + const { page } = await runUITest({ + 'a.spec.ts': ` + import { test, expect } from '@playwright/test'; + test('pass', async ({ page }) => { + await page.goto('${server.EMPTY_PAGE}'); + }); + `, + }); + + await page.getByText('pass').dblclick(); + + const actionsTree = page.getByTestId('actions-tree'); + await expect(actionsTree.getByRole('treeitem')).toHaveText([ + /Before Hooks/, + /page.goto/, + /After Hooks/, + ]); + await actionsTree.getByRole('treeitem', { name: 'page.goto' }).dblclick(); + await expect(actionsTree.getByRole('treeitem')).toHaveText([ + /page.goto/, + ]); +});