fix: game.new button e2e test bundle
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 51s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m9s
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 15s
CI / ui (pull_request) Successful in 51s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m9s
This commit is contained in:
+2
-2
@@ -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 }) => {
|
test('new game: variant buttons show a rules summary and the move-limit', async ({ page }) => {
|
||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
await page.getByRole('button', { name: /guest/i }).click();
|
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('.vrules').first()).toBeVisible(); // per-variant rules summary
|
||||||
await expect(page.locator('.movelimit')).toBeVisible(); // turn-time under the buttons
|
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 }) => {
|
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.goto('/');
|
||||||
await page.getByRole('button', { name: /guest/i }).click();
|
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
|
// 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.
|
// 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 });
|
const start = page.getByRole('button', { name: /Start game/i });
|
||||||
|
|||||||
@@ -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();
|
await page.getByRole('button', { name: /guest/i }).click();
|
||||||
|
|
||||||
// Below the limit: the New Game tab is enabled and no notice is shown.
|
// 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(newGame).toBeEnabled();
|
||||||
await expect(page.getByText(/reached the simultaneous games limit/i)).toHaveCount(0);
|
await expect(page.getByText(/reached the simultaneous games limit/i)).toHaveCount(0);
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { expect, test } from './fixtures';
|
|||||||
test('quick game: enter immediately, wait for an opponent, then it joins', async ({ page }) => {
|
test('quick game: enter immediately, wait for an opponent, then it joins', async ({ page }) => {
|
||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
await page.getByRole('button', { name: /guest/i }).click();
|
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
|
// 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).
|
// 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 }) => {
|
test('AI game: 🤖 opponent, no wait, chat disabled, dictionary still works', async ({ page }) => {
|
||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
await page.getByRole('button', { name: /guest/i }).click();
|
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.
|
// 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();
|
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 }) => {
|
test('AI game: no GCG export offered after it ends', async ({ page }) => {
|
||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
await page.getByRole('button', { name: /guest/i }).click();
|
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.locator('.variant').first().click(); // AI is the default opponent
|
||||||
await page.getByRole('button', { name: /Start game/i }).click();
|
await page.getByRole('button', { name: /Start game/i }).click();
|
||||||
await expect(page.locator('.scoreboard').getByText('🤖')).toBeVisible();
|
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<void> {
|
async function enterOpenGame(page: import('@playwright/test').Page): Promise<void> {
|
||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
await page.getByRole('button', { name: /guest/i }).click();
|
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.getByRole('button', { name: 'Random player' }).click();
|
||||||
await page.locator('.variant').first().click();
|
await page.locator('.variant').first().click();
|
||||||
await page.getByRole('button', { name: /Start game/i }).click();
|
await page.getByRole('button', { name: /Start game/i }).click();
|
||||||
|
|||||||
@@ -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 }) => {
|
test('play with friends: a game type is required to send an invitation', async ({ page }) => {
|
||||||
await loginLobby(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();
|
await page.getByRole('button', { name: 'Play with friends' }).click();
|
||||||
|
|
||||||
const send = page.getByRole('button', { name: 'Send invitation' });
|
const send = page.getByRole('button', { name: 'Send invitation' });
|
||||||
|
|||||||
Reference in New Issue
Block a user