From ffe9150f2664551f4742c4b12286a01c6c448a96 Mon Sep 17 00:00:00 2001 From: Ilia Denisov Date: Wed, 17 Jun 2026 21:54:22 +0200 Subject: [PATCH] fix: game.new button e2e test bundle --- ui/e2e/game.spec.ts | 4 ++-- ui/e2e/gamelimit.spec.ts | 2 +- ui/e2e/quickmatch.spec.ts | 8 ++++---- ui/e2e/social.spec.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/e2e/game.spec.ts b/ui/e2e/game.spec.ts index 0d94119..3f3a4de 100644 --- a/ui/e2e/game.spec.ts +++ b/ui/e2e/game.spec.ts @@ -66,7 +66,7 @@ test('a placed tile is saved as a draft and restored on reopening the game', asy test('new game: variant buttons show a rules summary and the move-limit', async ({ page }) => { await page.goto('/'); await page.getByRole('button', { name: /guest/i }).click(); - await page.getByRole('button', { name: /Play/ }).click(); // lobby tab bar -> auto-match + await page.getByRole('button', { name: /🎲/ }).click(); // lobby tab bar -> auto-match await expect(page.locator('.vrules').first()).toBeVisible(); // per-variant rules summary await expect(page.locator('.movelimit')).toBeVisible(); // turn-time under the buttons }); @@ -74,7 +74,7 @@ test('new game: variant buttons show a rules summary and the move-limit', async test('new game: auto-match shows the off-by-default rule toggle from the start (no layout jump on selection)', async ({ page }) => { await page.goto('/'); await page.getByRole('button', { name: /guest/i }).click(); - await page.getByRole('button', { name: /Play/ }).click(); // auto-match + await page.getByRole('button', { name: /🎲/ }).click(); // auto-match // Several variants are offered, so nothing is selected: Start is disabled. The rule toggle is shown // from the start (a Russian variant is available), so selecting one does not shift the layout. const start = page.getByRole('button', { name: /Start game/i }); diff --git a/ui/e2e/gamelimit.spec.ts b/ui/e2e/gamelimit.spec.ts index 203e3da..b316a0f 100644 --- a/ui/e2e/gamelimit.spec.ts +++ b/ui/e2e/gamelimit.spec.ts @@ -11,7 +11,7 @@ test('lobby: New Game disables and a notice shows at the simultaneous-game limit await page.getByRole('button', { name: /guest/i }).click(); // Below the limit: the New Game tab is enabled and no notice is shown. - const newGame = page.getByRole('button', { name: /Play/ }); + const newGame = page.getByRole('button', { name: /🎲/ }); await expect(newGame).toBeEnabled(); await expect(page.getByText(/reached the simultaneous games limit/i)).toHaveCount(0); diff --git a/ui/e2e/quickmatch.spec.ts b/ui/e2e/quickmatch.spec.ts index dcf8640..59d9a3a 100644 --- a/ui/e2e/quickmatch.spec.ts +++ b/ui/e2e/quickmatch.spec.ts @@ -8,7 +8,7 @@ import { expect, test } from './fixtures'; test('quick game: enter immediately, wait for an opponent, then it joins', async ({ page }) => { await page.goto('/'); await page.getByRole('button', { name: /guest/i }).click(); - await page.getByRole('button', { name: /Play/ }).click(); // lobby tab bar -> auto-match + await page.getByRole('button', { name: /🎲/ }).click(); // lobby tab bar -> auto-match // Choose a random human opponent (the default is the AI); pick a variant and start. The player // lands in an open game at once (no "searching" screen). @@ -38,7 +38,7 @@ test('quick game: enter immediately, wait for an opponent, then it joins', async test('AI game: 🤖 opponent, no wait, chat disabled, dictionary still works', async ({ page }) => { await page.goto('/'); await page.getByRole('button', { name: /guest/i }).click(); - await page.getByRole('button', { name: /Play/ }).click(); + await page.getByRole('button', { name: /🎲/ }).click(); // AI is the default opponent: the move-clock line is replaced by the 7-day inactivity rule. await expect(page.getByText(/Loss after 7 days of inactivity/)).toBeVisible(); @@ -64,7 +64,7 @@ test('AI game: 🤖 opponent, no wait, chat disabled, dictionary still works', a test('AI game: no GCG export offered after it ends', async ({ page }) => { await page.goto('/'); await page.getByRole('button', { name: /guest/i }).click(); - await page.getByRole('button', { name: /Play/ }).click(); + await page.getByRole('button', { name: /🎲/ }).click(); await page.locator('.variant').first().click(); // AI is the default opponent await page.getByRole('button', { name: /Start game/i }).click(); await expect(page.locator('.scoreboard').getByText('🤖')).toBeVisible(); @@ -90,7 +90,7 @@ test('AI game: no GCG export offered after it ends', async ({ page }) => { async function enterOpenGame(page: import('@playwright/test').Page): Promise { await page.goto('/'); await page.getByRole('button', { name: /guest/i }).click(); - await page.getByRole('button', { name: /Play/ }).click(); + await page.getByRole('button', { name: /🎲/ }).click(); await page.getByRole('button', { name: 'Random player' }).click(); await page.locator('.variant').first().click(); await page.getByRole('button', { name: /Start game/i }).click(); diff --git a/ui/e2e/social.spec.ts b/ui/e2e/social.spec.ts index 9a0405f..b5e475c 100644 --- a/ui/e2e/social.spec.ts +++ b/ui/e2e/social.spec.ts @@ -162,7 +162,7 @@ test('lobby ⚙️ tab shows the pending friend-request count', async ({ page }) test('play with friends: a game type is required to send an invitation', async ({ page }) => { await loginLobby(page); - await page.getByRole('button', { name: /Play/ }).click(); // lobby tab bar + await page.getByRole('button', { name: /🎲/ }).click(); // lobby tab bar (New Game tab, by its 🎲 icon — the label is themeable) await page.getByRole('button', { name: 'Play with friends' }).click(); const send = page.getByRole('button', { name: 'Send invitation' });