From fb41d60a217809bbb6063f67b1f37bf220d80b27 Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Thu, 17 Jul 2025 18:11:40 +0200 Subject: [PATCH] fix flakyness in e2e tests for reporting --- e2e/reporting.spec.ts | 8 ++++---- .../js/packages/ui/src/TimeEntry/TimeEntryCreateModal.vue | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/e2e/reporting.spec.ts b/e2e/reporting.spec.ts index c0b8d54f..3651b6ec 100644 --- a/e2e/reporting.spec.ts +++ b/e2e/reporting.spec.ts @@ -31,7 +31,7 @@ async function createTimeEntryWithProject(page: Page, projectName: string, durat await page.getByRole('button', { name: 'Manual time entry' }).click(); // Fill in the time entry details - await page.getByTestId('time_entry_description').fill(`Time entry for ${projectName}`); + await page.getByRole('dialog').getByRole('textbox', { name: 'Description' }).fill(`Time entry for ${projectName}`); await page.getByRole('button', { name: 'No Project' }).click(); await page.getByText(projectName).click(); @@ -52,7 +52,7 @@ async function createTimeEntryWithTag(page: Page, tagName: string, duration: str await page.getByRole('button', { name: 'Manual time entry' }).click(); // Fill in the time entry details - await page.getByTestId('time_entry_description').fill(`Time entry with tag ${tagName}`); + await page.getByRole('dialog').getByRole('textbox', { name: 'Description' }).fill(`Time entry with tag ${tagName}`); // Add tag await page.getByRole('button', { name: 'Tags' }).click(); @@ -74,7 +74,7 @@ async function createTimeEntryWithBillableStatus(page: Page, isBillable: boolean await page.getByRole('button', { name: 'Manual time entry' }).click(); // Fill in the time entry details - await page.getByTestId('time_entry_description').fill(`Time entry ${isBillable ? 'billable' : 'non-billable'}`); + await page.getByRole('dialog').getByRole('textbox', { name: 'Description' }).fill(`Time entry ${isBillable ? 'billable' : 'non-billable'}`); // Set billable status await page.getByRole('button', { name: 'Non-Billable' }).click(); @@ -103,7 +103,7 @@ test('test that project filtering works in reporting', async ({ page }) => { // Go to reporting and filter by project1 await goToReporting(page); await page.getByRole('button', { name: 'Project' }).nth(0).click(); - await page.getByText(project1).click(); + await page.getByRole('dialog').getByText(project1).click(); await Promise.all([ // escape diff --git a/resources/js/packages/ui/src/TimeEntry/TimeEntryCreateModal.vue b/resources/js/packages/ui/src/TimeEntry/TimeEntryCreateModal.vue index 1e670dd6..fc76b84b 100644 --- a/resources/js/packages/ui/src/TimeEntry/TimeEntryCreateModal.vue +++ b/resources/js/packages/ui/src/TimeEntry/TimeEntryCreateModal.vue @@ -136,6 +136,7 @@ type BillableOption = { id="description" ref="description" v-model="timeEntry.description" + aria-label="Description" placeholder="What did you work on?" type="text" class="mt-1 block w-full"