test(ui): update the native offline-first e2e for the Erudit-only guest default
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 1m14s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m57s
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 1m14s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m57s
The offline native guest is now offered only Erudit (the profileless default from the variants fix), so the specs that picked the English "Scrabble" variant timed out. Play Erudit instead: the single `.variant` click both selects it and asserts nothing else is offered; the vs_ai test plays НОЖ from the pinned Erudit rack (ОЖЬЯНАО), and the bundled ru_erudit dawg drives the robot reply.
This commit is contained in:
+14
-11
@@ -43,20 +43,22 @@ test.describe('native offline-first', () => {
|
|||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
await expectOfflineGuestLobby(page);
|
await expectOfflineGuestLobby(page);
|
||||||
|
|
||||||
// Play a local English vs_ai game with a pinned bag seed (deals the rack NEWYMAO). The dictionary
|
// Play a local Erudit vs_ai game with a pinned bag seed (deals the rack ОЖЬЯНАО). Erudit is the
|
||||||
// comes from the APK's bundled tier (./dict/scrabble_en@dev.dawg served from dist-e2e), so no
|
// only variant the profileless offline guest is offered (the new-account default), so the single
|
||||||
// network is needed — this is the device-local guest playing with zero connectivity.
|
// `.variant` click both selects it and asserts nothing else is on offer. The dictionary comes from
|
||||||
|
// the APK's bundled tier (./dict/ru_erudit@dev.dawg served from dist-e2e), so no network is needed
|
||||||
|
// — this is the device-local guest playing with zero connectivity.
|
||||||
await page.evaluate(() => (window as unknown as { __mock: { setLocalSeed(s: string): void } }).__mock.setLocalSeed('1'));
|
await page.evaluate(() => (window as unknown as { __mock: { setLocalSeed(s: string): void } }).__mock.setLocalSeed('1'));
|
||||||
await page.locator('button.tab').nth(0).click();
|
await page.locator('button.tab').nth(0).click();
|
||||||
await page.locator('.variant', { hasText: 'Scrabble' }).click();
|
await page.locator('.variant').click();
|
||||||
await page.locator('button.invite').click();
|
await page.locator('button.invite').click();
|
||||||
await expect(page.locator('[data-cell]').first()).toBeVisible();
|
await expect(page.locator('[data-cell]').first()).toBeVisible();
|
||||||
|
|
||||||
// The human plays WAY horizontally across the centre (7,5)-(7,7); the local robot replies with a
|
// The human plays НОЖ horizontally across the centre (7,5)-(7,7); the local robot replies with a
|
||||||
// real move (which needs the bundled dictionary), so the board gains tiles beyond WAY's three.
|
// real move (which needs the bundled dictionary), so the board gains tiles beyond НОЖ's three.
|
||||||
await placeTile(page, 'W', 7, 5);
|
await placeTile(page, 'Н', 7, 5);
|
||||||
await placeTile(page, 'A', 7, 6);
|
await placeTile(page, 'О', 7, 6);
|
||||||
await placeTile(page, 'Y', 7, 7);
|
await placeTile(page, 'Ж', 7, 7);
|
||||||
await expect(page.locator('[data-cell].pending')).toHaveCount(3);
|
await expect(page.locator('[data-cell].pending')).toHaveCount(3);
|
||||||
await page.locator('.make').click();
|
await page.locator('.make').click();
|
||||||
await expect(async () => {
|
await expect(async () => {
|
||||||
@@ -95,14 +97,15 @@ test.describe('native offline-first', () => {
|
|||||||
await expectOfflineGuestLobby(page);
|
await expectOfflineGuestLobby(page);
|
||||||
|
|
||||||
// New game -> the offline mode selector offers "with friends" (pass-and-play) to the local guest.
|
// New game -> the offline mode selector offers "with friends" (pass-and-play) to the local guest.
|
||||||
// A minimal create: set the mandatory host (master) PIN, decline a seat, English, two open seats.
|
// A minimal create: set the mandatory host (master) PIN, decline a seat, the sole offered variant
|
||||||
|
// (Erudit — the profileless guest's default), two open seats.
|
||||||
await page.locator('button.tab').nth(0).click();
|
await page.locator('button.tab').nth(0).click();
|
||||||
await page.getByRole('button', { name: /With friends|друзьями/i }).click();
|
await page.getByRole('button', { name: /With friends|друзьями/i }).click();
|
||||||
await page.locator('.hostpin .plink').click();
|
await page.locator('.hostpin .plink').click();
|
||||||
await typePin(page, '9999');
|
await typePin(page, '9999');
|
||||||
await typePin(page, '9999');
|
await typePin(page, '9999');
|
||||||
await page.getByRole('button', { name: /^(No|Нет)$/ }).click();
|
await page.getByRole('button', { name: /^(No|Нет)$/ }).click();
|
||||||
await page.locator('.variant', { hasText: 'Scrabble' }).click();
|
await page.locator('.variant').click();
|
||||||
await page.locator('.pname').nth(0).fill('Ann');
|
await page.locator('.pname').nth(0).fill('Ann');
|
||||||
await page.locator('.pname').nth(1).fill('Bob');
|
await page.locator('.pname').nth(1).fill('Bob');
|
||||||
await page.locator('button.invite').click();
|
await page.locator('button.invite').click();
|
||||||
|
|||||||
Reference in New Issue
Block a user