Merge pull request #13 from avalon-vanguard/fix/catalogue-refresh-e2e
Follow the catalogue rather than a star it used to rank fourth
This commit is contained in:
@@ -17,16 +17,23 @@ test.describe('Neighbour jump', () => {
|
|||||||
await expect(readout).toHaveText('Sol', { timeout: 30_000 });
|
await expect(readout).toHaveText('Sol', { timeout: 30_000 });
|
||||||
|
|
||||||
// Its nearest neighbours are named around the edge of the view; each is a button that flies
|
// Its nearest neighbours are named around the edge of the view; each is a button that flies
|
||||||
// there. Barnard's Star rather than the Alpha Centauri trio, whose three members share one
|
// there. Whichever one the ring names, not a star named here: the catalogue is refreshed on
|
||||||
// bearing and so are decluttered down to whichever the label pass reaches first.
|
// a schedule, and a refresh reorders which four are nearest — a hand-picked name made this a
|
||||||
const neighbour = page.getByRole('button', { name: /Barnard's Star/ });
|
// test of the catalogue's contents rather than of the ring. Which of them survives the
|
||||||
|
// declutter is a property of the view, so the first is as good as any.
|
||||||
|
const neighbour = page.getByRole('button', { name: /^Go to .+ pc away$/ }).first();
|
||||||
await expect(neighbour).toBeVisible({ timeout: 30_000 });
|
await expect(neighbour).toBeVisible({ timeout: 30_000 });
|
||||||
await neighbour.click();
|
const label = (await neighbour.getAttribute('aria-label'))!;
|
||||||
|
const name = /^Go to (.+), [\d.]+ pc away$/.exec(label)![1];
|
||||||
|
|
||||||
await expect(readout).toHaveText("Barnard's Star", { timeout: 45_000 });
|
// Clicked by the name just read rather than through `neighbour`, which re-resolves `.first()`
|
||||||
|
// and could land on a different star if the label pass reorders the ring in between.
|
||||||
|
await page.getByRole('button', { name: label, exact: true }).click();
|
||||||
|
|
||||||
|
await expect(readout).toHaveText(name, { timeout: 45_000 });
|
||||||
// And from there the walk goes on: the new system names its own neighbours. Which ones is
|
// And from there the walk goes on: the new system names its own neighbours. Which ones is
|
||||||
// not asserted — several of Barnard's nearest share a bearing, so which of them survives
|
// not asserted — neighbours sharing a bearing are decluttered, so which of them survives is
|
||||||
// the declutter is a property of the view, not a fact about the catalogue.
|
// a property of the view, not a fact about the catalogue.
|
||||||
await expect(page.locator('.map-label--ghost')).not.toHaveCount(0, { timeout: 30_000 });
|
await expect(page.locator('.map-label--ghost')).not.toHaveCount(0, { timeout: 30_000 });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ export default defineConfig({
|
|||||||
forbidOnly: !!process.env.CI,
|
forbidOnly: !!process.env.CI,
|
||||||
retries: process.env.CI ? 2 : 0,
|
retries: process.env.CI ? 2 : 0,
|
||||||
reporter: 'html',
|
reporter: 'html',
|
||||||
|
// Well above Playwright's 5 s, which was a fair ceiling when the star catalogue was 820 kB and
|
||||||
|
// is not now that the scheduled refresh has it at 5.4 MB and 447 410 rows: every one of these
|
||||||
|
// tests boots that catalogue, and the suite boots several at once on a software rasterizer.
|
||||||
|
// The heavy waits already carry their own longer timeouts; this is the same judgement applied
|
||||||
|
// to the assertions that were left on the default. A ceiling costs nothing when it is not hit.
|
||||||
|
expect: { timeout: 15_000 },
|
||||||
use: {
|
use: {
|
||||||
baseURL: 'http://localhost:4300',
|
baseURL: 'http://localhost:4300',
|
||||||
trace: 'on-first-retry'
|
trace: 'on-first-retry'
|
||||||
|
|||||||
Reference in New Issue
Block a user