From 49ce5612446a45acd2156127e2e2b11c46993ad6 Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Fri, 17 Mar 2023 09:43:54 -0700 Subject: [PATCH] chore(ui): add hover-based run test (#21758) --- .../playwright-test/ui-mode-test-run.spec.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/playwright-test/ui-mode-test-run.spec.ts b/tests/playwright-test/ui-mode-test-run.spec.ts index ac8c41ed0b..6e75ed37f3 100644 --- a/tests/playwright-test/ui-mode-test-run.spec.ts +++ b/tests/playwright-test/ui-mode-test-run.spec.ts @@ -61,6 +61,25 @@ test('should run visible', async ({ runUITest }) => { `); }); +test('should run on hover', async ({ runUITest }) => { + const page = await runUITest({ + 'a.test.ts': ` + import { test, expect } from '@playwright/test'; + test('passes', () => {}); + test('fails', () => { expect(1).toBe(2); }); + `, + }); + + await page.getByText('passes').hover(); + await page.getByRole('listitem').filter({ hasText: 'passes' }).getByTitle('Run').click(); + + await expect.poll(dumpTestTree(page), { timeout: 15000 }).toBe(` + ▼ ◯ a.test.ts + ✅ passes <= + ◯ fails + `); +}); + test('should run on double click', async ({ runUITest }) => { const page = await runUITest({ 'a.test.ts': `