{model.columns.map((column, i) => {
+ const title = <>
+
{model.columnTitle(column)}
+
+
+ >;
return
model.setSorting && toggleSorting(column)}
>
- {model.columnTitle(column)}
-
-
+ {model.setSorting ? : title}
;
})}
diff --git a/tests/library/trace-viewer.spec.ts b/tests/library/trace-viewer.spec.ts
index 3bad29611ad22..f920fd48cccaf 100644
--- a/tests/library/trace-viewer.spec.ts
+++ b/tests/library/trace-viewer.spec.ts
@@ -518,6 +518,21 @@ test('should have network requests', async ({ showTraceViewer }) => {
await expect(traceViewer.networkRequests.filter({ hasText: '404GET404text' })).toHaveCSS('background-color', 'rgb(242, 222, 222)');
});
+test('should sort network columns from the keyboard', async ({ showTraceViewer }) => {
+ const traceViewer = await showTraceViewer(traceFile);
+ await traceViewer.selectAction('Navigate');
+ await traceViewer.showNetworkTab();
+
+ const nameColumn = traceViewer.page.getByRole('button', { name: 'Name', exact: true });
+ await expect(nameColumn).toBeVisible();
+
+ await nameColumn.focus();
+ await expect(nameColumn).toBeFocused();
+
+ await nameColumn.press('Enter');
+ await expect(traceViewer.networkRequests.first()).toContainText('404');
+});
+
test('should attribute network requests to service workers', async ({ runAndTrace, page, context, server, browserName }) => {
test.skip(browserName !== 'chromium', 'Service worker requests are only reported in Chromium');
const traceViewer = await runAndTrace(async () => {
diff --git a/tests/playwright-test/reporter-html.spec.ts b/tests/playwright-test/reporter-html.spec.ts
index b9575303b806b..33e24a496bcdb 100644
--- a/tests/playwright-test/reporter-html.spec.ts
+++ b/tests/playwright-test/reporter-html.spec.ts
@@ -2145,6 +2145,40 @@ for (const useIntermediateMergeReport of [true, false] as const) {
await expect(page.locator('.test-file-test .test-file-title')).toHaveText('Error Pages › @GCC-1510 fails');
});
+ test('should filter by label from the keyboard', async ({ runInlineTest, showReport, page }) => {
+ const result = await runInlineTest({
+ 'a.test.js': `
+ const { expect, test } = require('@playwright/test');
+ test('@smoke passes', async ({}) => {
+ expect(1).toBe(1);
+ });
+ test('@regression passes', async ({}) => {
+ expect(1).toBe(1);
+ });
+ `,
+ }, { reporter: 'dot,html' }, { PLAYWRIGHT_HTML_OPEN: 'never' });
+
+ expect(result.exitCode).toBe(0);
+ expect(result.passed).toBe(2);
+
+ await showReport();
+
+ const smokeLabel = page.locator('.test-file-test', { has: page.getByText('@smoke passes', { exact: true }) }).getByRole('button', { name: 'smoke' });
+ await smokeLabel.focus();
+ await expect(smokeLabel).toBeFocused();
+ await smokeLabel.press('Enter');
+ await expect(page.getByPlaceholder('Search tests')).toHaveValue('@smoke ');
+ await expect(page.locator('.test-file-test')).toHaveCount(1);
+
+ await page.getByPlaceholder('Search tests').clear();
+ const regressionLabel = page.locator('.test-file-test', { has: page.getByText('@regression passes', { exact: true }) }).getByRole('button', { name: 'regression' });
+ await regressionLabel.focus();
+ await expect(regressionLabel).toBeFocused();
+ await regressionLabel.press('Space');
+ await expect(page.getByPlaceholder('Search tests')).toHaveValue('@regression ');
+ await expect(page.locator('.test-file-test')).toHaveCount(1);
+ });
+
test('tags with special symbols', async ({ runInlineTest, showReport, page }) => {
const result = await runInlineTest({
'a.test.js': `
diff --git a/tests/playwright-test/ui-mode-test-filters.spec.ts b/tests/playwright-test/ui-mode-test-filters.spec.ts
index f549d150e4b09..7e2edd89831b5 100644
--- a/tests/playwright-test/ui-mode-test-filters.spec.ts
+++ b/tests/playwright-test/ui-mode-test-filters.spec.ts
@@ -72,6 +72,23 @@ test('should display native tags and filter by them on click', async ({ runUITes
`);
});
+test('should filter by tag from the keyboard', async ({ runUITest }) => {
+ const { page } = await runUITest({
+ 'a.test.ts': `
+ import { test, expect } from '@playwright/test';
+ test('p', () => {});
+ test('pwt', { tag: '@smoke' }, () => {});
+ `,
+ });
+
+ const tag = page.locator('.ui-mode-tree-item-title').getByRole('button', { name: 'smoke' });
+ await tag.focus();
+ await expect(tag).toBeFocused();
+
+ await tag.press('Enter');
+ await expect(page.getByPlaceholder('Filter (e.g. text, @tag)')).toHaveValue('@smoke');
+});
+
test('should toggle filters from the keyboard', async ({ runUITest }) => {
const { page } = await runUITest(basicTestTree);
const summary = page.locator('.filter-summary');