Skip to content

Commit b58c369

Browse files
committed
Fix strict mode violation in Audit Logs Playwright tests (#26043)
* Fix strict mode violation in Audit Logs Playwright tests * add required api waits * address gitar * nit * remove unwanted check (cherry picked from commit b0aecba)
1 parent d52db56 commit b58c369

1 file changed

Lines changed: 18 additions & 13 deletions

File tree

openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/AuditLogs.spec.ts

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,10 @@ test.describe('Audit Logs Page', PLAYWRIGHT_BASIC_TEST_TAG_OBJ, () => {
306306
.getByText('admin', { exact: true });
307307
await expect(adminOption).toBeVisible();
308308

309-
const auditLogResponse = page.waitForResponse((response) =>
310-
response.url().includes('/api/v1/audit')
309+
const auditLogResponse = page.waitForResponse(
310+
(response) =>
311+
response.url().includes('/api/v1/audit/logs') &&
312+
response.url().includes('userName=admin')
311313
);
312314

313315
await adminOption.click();
@@ -343,14 +345,17 @@ test.describe('Audit Logs Page', PLAYWRIGHT_BASIC_TEST_TAG_OBJ, () => {
343345
const entityOption = page.locator('.ant-dropdown-menu-item').first();
344346
await expect(entityOption).toBeVisible();
345347

346-
const auditLogResponse = page.waitForResponse((response) =>
347-
response.url().includes('/api/v1/audit')
348+
const auditLogResponse = page.waitForResponse(
349+
(response) =>
350+
response.url().includes('/api/v1/audit/logs') &&
351+
response.url().includes('entityType=')
348352
);
349353

350354
await entityOption.click();
351355
await page.getByTestId('update-btn').click();
352356
const response = await auditLogResponse;
353357
expect(response.status()).toBe(200);
358+
354359
const entityFilterTag = page.getByTestId('filter-chip-entityType');
355360
await expect(entityFilterTag).toBeVisible();
356361
await expect(entityFilterTag).toContainText(entityType);
@@ -777,9 +782,9 @@ test.describe(
777782
state: 'visible',
778783
});
779784

780-
const todayCell = page.locator(
781-
'.ant-picker-dropdown:visible .ant-picker-cell-today'
782-
);
785+
const todayCell = page
786+
.locator('.ant-picker-dropdown:visible .ant-picker-cell-today')
787+
.first();
783788
await todayCell.click();
784789
await todayCell.click();
785790
});
@@ -858,9 +863,9 @@ test.describe(
858863
state: 'visible',
859864
});
860865

861-
const todayCell = page.locator(
862-
'.ant-picker-dropdown:visible .ant-picker-cell-today'
863-
);
866+
const todayCell = page
867+
.locator('.ant-picker-dropdown:visible .ant-picker-cell-today')
868+
.first();
864869
await todayCell.click();
865870
await todayCell.click();
866871

@@ -904,9 +909,9 @@ test.describe(
904909
state: 'visible',
905910
});
906911

907-
const todayCell = page.locator(
908-
'.ant-picker-dropdown:visible .ant-picker-cell-today'
909-
);
912+
const todayCell = page
913+
.locator('.ant-picker-dropdown:visible .ant-picker-cell-today')
914+
.first();
910915
await todayCell.click();
911916
await todayCell.click();
912917
});

0 commit comments

Comments
 (0)