test(e2e): wait for the visible shell and use the phone path to new workspaces

Since phones get a bottom bar instead of the sidebar (UF-057), the shell
wait matched the hidden sidebar first and timed out at 390 px, and the
mobile journey clicked the sidebar's workspace button. The wait now takes
the first visible shell element, and the journey opens New workspace from
All workspaces, as a phone user does.
This commit is contained in:
shumeiko.it
2026-11-01 10:56:12 +01:00
parent 4d54612374
commit 8e528b3467
5 changed files with 9 additions and 10 deletions

View File

@@ -707,7 +707,7 @@ async function collectProbeContext(page: Page): Promise<ProbeContext> {
if (!shellResponse.ok()) {
shellText = `Shell navigation returned ${shellResponse.status()} ${shellResponse.statusText()}.`;
}
await page.waitForSelector('.waggle-sidebar, [role="navigation"], main', { timeout: 15_000 }).catch(() => {});
await page.waitForSelector('.waggle-sidebar:visible, [role="navigation"]:visible, main:visible', { timeout: 15_000 }).catch(() => {});
await page.waitForTimeout(600);
const bodyText = await page.locator('body').innerText().catch(() => '');
shellText = bodyText || shellText;

View File

@@ -510,7 +510,7 @@ function critical(items: string[], extraBenign: RegExp[] = []): string[] {
}
async function waitForShell(page: Page): Promise<void> {
await page.waitForSelector('.waggle-sidebar, [role="navigation"], main', { timeout: 20_000 });
await page.waitForSelector('.waggle-sidebar:visible, [role="navigation"]:visible, main:visible', { timeout: 20_000 });
await page.waitForTimeout(400);
}

View File

@@ -8,7 +8,7 @@ function routeWithSkip(route: string): string {
}
async function waitForShell(page: Page): Promise<void> {
await page.waitForSelector('.waggle-sidebar, [role="navigation"], main', { timeout: 15_000 });
await page.waitForSelector('.waggle-sidebar:visible, [role="navigation"]:visible, main:visible', { timeout: 15_000 });
await page.waitForTimeout(300);
}

View File

@@ -70,7 +70,7 @@ function routeWithSkip(route: string) {
async function gotoApp(page: Page, route: string) {
await page.goto(routeWithSkip(route), { waitUntil: 'domcontentloaded' });
await page.waitForSelector('.waggle-sidebar, [role="navigation"], main', { timeout: 15_000 });
await page.waitForSelector('.waggle-sidebar:visible, [role="navigation"]:visible, main:visible', { timeout: 15_000 });
// Let lazy route content and the shell's 200ms entrance transition settle
// before axe samples transient dialog/backdrop layers.
await page.waitForTimeout(800);

View File

@@ -21,7 +21,7 @@ async function gotoApp(page: Page, route = '/home') {
}
async function waitForShell(page: Page) {
await page.waitForSelector('.waggle-sidebar, [role="navigation"], main', { timeout: 15_000 });
await page.waitForSelector('.waggle-sidebar:visible, [role="navigation"]:visible, main:visible', { timeout: 15_000 });
await page.waitForTimeout(300);
}
@@ -601,12 +601,11 @@ test.describe('User Journey Tests', () => {
test('J-mobile: create workspace prioritizes primary setup at 390px width', async ({ page }) => {
await page.setViewportSize({ width: 390, height: 844 });
await gotoApp(page);
// Phones have no sidebar: the bottom bar's More opens the palette, which
// leads to All workspaces and its New workspace button.
await gotoApp(page, '/workspaces');
await page.getByTestId('sidebar-workspace').click();
const switcher = page.getByRole('dialog', { name: /switch workspace/i });
await expect(switcher).toBeVisible({ timeout: 5_000 });
await switcher.getByRole('button', { name: /new workspace/i }).click();
await page.getByTestId('all-workspaces-new').click();
const dialog = page.getByRole('dialog', { name: /create workspace/i });
await expect(dialog).toBeVisible({ timeout: 5_000 });