Skip to content

Commit 8a0d223

Browse files
Onatcerkorridor
authored andcommitted
fix flakyness in e2e tests for reporting
1 parent 38f3879 commit 8a0d223

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

e2e/reporting.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async function createTimeEntryWithProject(page: Page, projectName: string, durat
3131
await page.getByRole('button', { name: 'Manual time entry' }).click();
3232

3333
// Fill in the time entry details
34-
await page.getByTestId('time_entry_description').fill(`Time entry for ${projectName}`);
34+
await page.getByRole('dialog').getByRole('textbox', { name: 'Description' }).fill(`Time entry for ${projectName}`);
3535

3636
await page.getByRole('button', { name: 'No Project' }).click();
3737
await page.getByText(projectName).click();
@@ -52,7 +52,7 @@ async function createTimeEntryWithTag(page: Page, tagName: string, duration: str
5252
await page.getByRole('button', { name: 'Manual time entry' }).click();
5353

5454
// Fill in the time entry details
55-
await page.getByTestId('time_entry_description').fill(`Time entry with tag ${tagName}`);
55+
await page.getByRole('dialog').getByRole('textbox', { name: 'Description' }).fill(`Time entry with tag ${tagName}`);
5656

5757
// Add tag
5858
await page.getByRole('button', { name: 'Tags' }).click();
@@ -74,7 +74,7 @@ async function createTimeEntryWithBillableStatus(page: Page, isBillable: boolean
7474
await page.getByRole('button', { name: 'Manual time entry' }).click();
7575

7676
// Fill in the time entry details
77-
await page.getByTestId('time_entry_description').fill(`Time entry ${isBillable ? 'billable' : 'non-billable'}`);
77+
await page.getByRole('dialog').getByRole('textbox', { name: 'Description' }).fill(`Time entry ${isBillable ? 'billable' : 'non-billable'}`);
7878

7979
// Set billable status
8080
await page.getByRole('button', { name: 'Non-Billable' }).click();
@@ -103,7 +103,7 @@ test('test that project filtering works in reporting', async ({ page }) => {
103103
// Go to reporting and filter by project1
104104
await goToReporting(page);
105105
await page.getByRole('button', { name: 'Project' }).nth(0).click();
106-
await page.getByText(project1).click();
106+
await page.getByRole('dialog').getByText(project1).click();
107107

108108
await Promise.all([
109109
// escape

resources/js/packages/ui/src/TimeEntry/TimeEntryCreateModal.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ type BillableOption = {
136136
id="description"
137137
ref="description"
138138
v-model="timeEntry.description"
139+
aria-label="Description"
139140
placeholder="What did you work on?"
140141
type="text"
141142
class="mt-1 block w-full"

0 commit comments

Comments
 (0)