- Updated E2E selectors for input fields to use stable IDs instead of `name` attributes, improving reliability and alignment with form field guarantees. - Refined mock auth state injection in Playwright to establish test store state prior to page load. - Optimized test clarity and consistency by consolidating selector logic and introducing stabilization steps where necessary. - Removed redundant `AuthInitializer` mocks and refactored related tests to align with the updated `AuthContext` pattern. - Enhanced readability and maintainability across affected test suites.
18 lines
623 B
TypeScript
18 lines
623 B
TypeScript
import { test } from '@playwright/test';
|
|
import { setupAuthenticatedMocks } from './helpers/auth';
|
|
|
|
test('debug selectors', async ({ page }) => {
|
|
await setupAuthenticatedMocks(page);
|
|
await page.goto('/settings/profile');
|
|
await page.waitForTimeout(2000); // Wait for render
|
|
|
|
// Print all input elements
|
|
const inputs = await page.locator('input').all();
|
|
for (const input of inputs) {
|
|
const name = await input.getAttribute('name');
|
|
const id = await input.getAttribute('id');
|
|
const type = await input.getAttribute('type');
|
|
console.log(`Input: id="${id}", name="${name}", type="${type}"`);
|
|
}
|
|
});
|