Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: additional test for setup/teardown (#24261)

Pavel Feldmanaf3e7351479d
diff --git a/tests/playwright-test/ui-mode-test-setup.spec.ts b/tests/playwright-test/ui-mode-test-setup.spec.ts
index 62c323247d..45ac9b3f94 100644
--- a/tests/playwright-test/ui-mode-test-setup.spec.ts
+++ b/tests/playwright-test/ui-mode-test-setup.spec.ts
@@ -173,3 +173,23 @@ test('should run setup and teardown projects (3)', async ({ runUITest }) => {
await expect(page.getByTestId('output')).not.toContainText(`from-setup`);
await expect(page.getByTestId('output')).not.toContainText(`from-teardown`);
});
+
+test('should run part of the setup only', async ({ runUITest }) => {
+ const { page } = await runUITest(testsWithSetup);
+ await page.getByText('Status:').click();
+ await page.getByLabel('setup').setChecked(true);
+ await page.getByLabel('teardown').setChecked(true);
+ await page.getByLabel('test').setChecked(true);
+
+ await page.getByText('setup.ts').hover();
+ await page.getByRole('listitem').filter({ hasText: 'setup.ts' }).getByTitle('Run').click();
+
+ await expect.poll(dumpTestTree(page)).toBe(`
+ ▼ ✅ setup.ts <=
+ ✅ setup
+ ▼ ✅ teardown.ts
+ ✅ teardown
+ ▼ ◯ test.ts
+ ◯ test
+ `);
+});