mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
fix: use specific data-testid selectors in project switcher assertions
Replace generic getByRole('button', { name: /.../ }) selectors with specific
getByTestId('project-switcher-project-') to avoid strict mode
violations where the selector resolves to multiple elements (project switcher
button and sidebar button).
Fixes failing E2E tests:
- feature-manual-review-flow.spec.ts
- new-project-creation.spec.ts
- open-existing-project.spec.ts
This commit is contained in:
@@ -130,8 +130,8 @@ test.describe('Feature Manual Review Flow', () => {
|
||||
await page.waitForTimeout(300);
|
||||
}
|
||||
|
||||
// Verify we're on the correct project (project name appears in sidebar button)
|
||||
await expect(page.getByRole('button', { name: new RegExp(projectName) })).toBeVisible({
|
||||
// Verify we're on the correct project (project switcher button shows project name)
|
||||
await expect(page.getByTestId(`project-switcher-project-${projectName}`)).toBeVisible({
|
||||
timeout: 10000,
|
||||
});
|
||||
|
||||
|
||||
@@ -77,8 +77,8 @@ test.describe('Project Creation', () => {
|
||||
}
|
||||
|
||||
// Wait for project to be set as current and visible on the page
|
||||
// The project name appears in the sidebar project selector button
|
||||
await expect(page.getByRole('button', { name: new RegExp(projectName) })).toBeVisible({
|
||||
// The project name appears in the project switcher button
|
||||
await expect(page.getByTestId(`project-switcher-project-${projectName}`)).toBeVisible({
|
||||
timeout: 15000,
|
||||
});
|
||||
|
||||
|
||||
@@ -156,9 +156,9 @@ test.describe('Open Project', () => {
|
||||
}
|
||||
|
||||
// Wait for a project to be set as current and visible on the page
|
||||
// The project name appears in the sidebar project selector button
|
||||
// The project name appears in the project switcher button
|
||||
if (targetProjectName) {
|
||||
await expect(page.getByRole('button', { name: new RegExp(targetProjectName) })).toBeVisible({
|
||||
await expect(page.getByTestId(`project-switcher-project-${targetProjectName}`)).toBeVisible({
|
||||
timeout: 15000,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user