Harden E2E selectors for Forge mode toggle and spread actions card.
Use scoped Simple button locator, containText for hostname in actions card, and card-scoped TRACE click to avoid strict-mode and encoding flakes.
This commit is contained in:
@@ -16,9 +16,7 @@ async function openCrucibleSpreadTab(page: import('@playwright/test').Page, host
|
||||
await expect(page.getByRole('heading', { name: 'Crucible' })).toBeVisible({ timeout: 10_000 });
|
||||
const card = await expectOnlineCrucibleCard(page, hostname);
|
||||
await card.click();
|
||||
await expect(
|
||||
page.locator('.crucible-actions-card').getByText(new RegExp(`→ ${hostname}`)),
|
||||
).toBeVisible({ timeout: 10_000 });
|
||||
await expect(page.locator('.crucible-actions-card')).toContainText(hostname, { timeout: 10_000 });
|
||||
await page.getByRole('button', { name: 'LATERAL / SPREAD' }).click();
|
||||
await expect(page.getByRole('button', { name: 'Probe & Join' })).toBeVisible({
|
||||
timeout: 10_000,
|
||||
@@ -126,9 +124,7 @@ test.describe('Crucible discover and spread E2E', () => {
|
||||
const card = await expectOnlineCrucibleCard(page, hop.hostname);
|
||||
await card.scrollIntoViewIfNeeded();
|
||||
await card.click();
|
||||
await expect(
|
||||
page.locator('.crucible-actions-card').getByText(new RegExp(`→ ${hop.hostname}`)),
|
||||
).toBeVisible({ timeout: 20_000 });
|
||||
await expect(page.locator('.crucible-actions-card')).toContainText(hop.hostname, { timeout: 20_000 });
|
||||
await page.getByRole('button', { name: 'LATERAL / SPREAD' }).click();
|
||||
await expect(page.locator('.access-depth-panel')).toContainText(hop.joinLabel, {
|
||||
timeout: 20_000,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expect, test } from '@playwright/test';
|
||||
import { expect, test } from '@playwright/test';
|
||||
import { loginToDashboard } from './fixtures';
|
||||
|
||||
test.describe('Page smoke', () => {
|
||||
@@ -46,6 +46,6 @@ test.describe('Page smoke', () => {
|
||||
await page.getByRole('link', { name: /Forge/i }).click();
|
||||
await expect(page.getByRole('heading', { level: 1, name: 'Forge', exact: true })).toBeVisible({ timeout: 10_000 });
|
||||
await expect(page.getByRole('heading', { name: 'Quick Forge' })).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: 'Simple', exact: true })).toBeVisible();
|
||||
await expect(page.locator('.forge-mode-toggle').getByRole('button', { name: 'Simple', exact: true }).first()).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -56,7 +56,7 @@ test.describe('Path Tracer E2E', () => {
|
||||
const card = page.locator('.pt-agent-card').filter({ hasText: E2E_STUB_AGENT_HOSTNAME });
|
||||
await expect(card).toBeVisible({ timeout: 15_000 });
|
||||
await card.click();
|
||||
await page.getByRole('button', { name: '⬡ TRACE' }).click();
|
||||
await card.getByRole('button', { name: /TRACE/i }).click();
|
||||
|
||||
await expect(page.getByText('Spread Routes')).toBeVisible({ timeout: 15_000 });
|
||||
await expect(page.getByText(/192\.168\.1\.0\/24/)).toBeVisible();
|
||||
|
||||
Reference in New Issue
Block a user