|
1 | 1 | import { test, expect } from '@playwright/test' |
2 | 2 |
|
3 | 3 | test.describe('Manage Page - Backend Logs Link', () => { |
4 | | - test('models table shows terminal icon for logs', async ({ page }) => { |
| 4 | + test('row action menu exposes Backend logs entry with terminal icon', async ({ page }) => { |
5 | 5 | await page.goto('/app/manage') |
6 | | - // Wait for models to load |
7 | 6 | await expect(page.locator('.table')).toBeVisible({ timeout: 10_000 }) |
8 | 7 |
|
9 | | - // Check for terminal icon (backend logs link) |
10 | | - const terminalIcon = page.locator('a[title="Backend logs"] i.fa-terminal') |
11 | | - await expect(terminalIcon.first()).toBeVisible() |
| 8 | + // Row actions live behind the kebab (ActionMenu) — open the first row's menu. |
| 9 | + const trigger = page.locator('button.action-menu__trigger').first() |
| 10 | + await expect(trigger).toBeVisible() |
| 11 | + await trigger.click() |
| 12 | + |
| 13 | + const logsItem = page.getByRole('menuitem', { name: 'Backend logs' }) |
| 14 | + await expect(logsItem).toBeVisible() |
| 15 | + await expect(logsItem.locator('i.fa-terminal')).toBeVisible() |
12 | 16 | }) |
13 | 17 |
|
14 | | - test('terminal icon links to backend-logs page', async ({ page }) => { |
| 18 | + test('Backend logs menu item navigates to backend-logs page', async ({ page }) => { |
15 | 19 | await page.goto('/app/manage') |
16 | 20 | await expect(page.locator('.table')).toBeVisible({ timeout: 10_000 }) |
17 | 21 |
|
18 | | - const logsLink = page.locator('a[title="Backend logs"]').first() |
19 | | - await expect(logsLink).toBeVisible() |
| 22 | + const trigger = page.locator('button.action-menu__trigger').first() |
| 23 | + await expect(trigger).toBeVisible() |
| 24 | + await trigger.click() |
20 | 25 |
|
21 | | - // Link uses href="#" with onClick for navigation |
22 | | - const href = await logsLink.getAttribute('href') |
23 | | - expect(href).toBe('#') |
| 26 | + const logsItem = page.getByRole('menuitem', { name: 'Backend logs' }) |
| 27 | + await expect(logsItem).toBeVisible() |
| 28 | + await logsItem.click() |
24 | 29 |
|
25 | | - // Click and verify navigation |
26 | | - await logsLink.click() |
27 | 30 | await expect(page).toHaveURL(/\/app\/backend-logs\//) |
28 | 31 | }) |
29 | 32 | }) |
0 commit comments