Use when validating UI changes in a branch require Playwright E2E testing. Reviews branch changes, validates UI with Playwright MCP, and adds missing test cases.
This skill guides you through validating UI changes and ensuring comprehensive Playwright E2E test coverage.
Identify changed files vs main:
git diff main --stat
git diff main --name-only | grep -E "\.(tsx?|less|css|scss)$"
Focus on UI component changes:
git diff main -- "openmetadata-ui/src/main/resources/ui/src/components/**" --stat
Check for existing Playwright tests:
git diff main --name-only | grep -E "playwright.*\.spec\.ts$"
Read the changed component files to understand the UI modifications
Locate relevant test files:
playwright/e2e/Pages/ for page-level testsplaywright/e2e/Features/ for feature-specific testsAnalyze test coverage:
Review test utilities:
playwright/utils/ for helper functionsplaywright/support/ for entity classes and fixturesStart the browser and navigate:
mcp__playwright__browser_navigate to http://localhost:8585
Authenticate if needed:
mcp__playwright__browser_fill_form for login[email protected] / adminNavigate to the feature area:
mcp__playwright__browser_click for navigationmcp__playwright__browser_snapshot to inspect page stateValidate UI behavior:
Document findings:
Create a TodoWrite checklist of missing test scenarios
For each missing test case:
a. Add necessary test fixtures in beforeAll:
b. Add cleanup in afterAll:
c. Write the test following the pattern:
test('Descriptive Test Name - What it validates', async ({ page }) => {
test.setTimeout(300000);
await test.step('Step description', async () => {
// Test actions and assertions
});
await test.step('Next step', async () => {
// More actions and assertions
});
});
Test patterns to cover:
Run Playwright lint check:
yarn lint:playwright
Error-level rules (no-networkidle, no-page-pause, no-focused-test) will block CI. See the handbook's ESLint Enforcement section for the full rule reference.
import { sidebarClick } from '../../utils/sidebar';
import { redirectToHomePage } from '../../utils/common';
import { selectDataProduct, selectDomain } from '../../utils/domain';
import { waitForAllLoadersToDisappear } from '../../utils/entity';
await waitForAllLoadersToDisappear(page);
await expect(page.getByTestId('content')).toBeVisible();
// NEVER use: page.waitForLoadState('networkidle') — blocked by ESLint
const response = page.waitForResponse('/api/v1/endpoint*');
await someAction();
await response;
expect((await response).status()).toBe(200);
await expect(page.getByTestId('element')).toBeVisible();
await expect(page.getByTestId('element')).toContainText('text');
await expect(page.locator('.class')).not.toBeVisible();
yarn lint:playwright passes with zero errorsnetworkidle, page.pause(), or test.only() usage (blocked by ESLint)test.slow() (preferred) or test.setTimeout()For reference, see the comprehensive test coverage in:
playwright/e2e/Pages/DataContractInheritance.spec.ts
This file demonstrates: