Files
Crystal/tests/atlas-browser.spec.ts
T
kawaandClaude Opus 5.5 9c3579937c Open the Radio Tower takeover, Ice Path, Blackthorn and Dragon's Den (#32)
The Rocket-held Radio Tower, the Underground's switch room and warehouse,
Ice Path, Blackthorn City and its gym, Routes 45 and 46, Dark Cave's
Blackthorn entrance, Dragon's Den and the Dragon Shrine are open. The story
plays through the Basement Key, the switches and the director, the Clear
Bell, Ice Path's falling boulder, Clair's gym and the shrine's test for the
RISINGBADGE, TM24 and the elder's Dratini.

New specials: GiveDratini and MoveDeletion. A save keeps an object that a
script made disappear (or appear against its flag) as Continue does, so the
Radio Tower director no longer blocks the 5F stairs after a reload. A
whiteout from a battle started in an scall no longer refuses.

The playthrough driver pushes boulders into their holes (planned breadth
first), clears whirlpools, chooses the move a TM replaces and heals with
the strongest potion; the run gains six stages to the Rising Badge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:19:02 +02:00

54 lines
2.5 KiB
TypeScript

import { test, expect, type Page } from "@playwright/test";
import { existsSync } from "node:fs";
import { resolve } from "node:path";
const romPath = resolve(
process.env.CRYSTAL_ROM_PATH ?? "Pokemon - Crystal Version (UE) (V1.1) [C][!].gbc",
);
test.beforeEach(() => test.skip(!existsSync(romPath), "Requires the local user ROM."));
async function start(page: Page) {
await page.route("**/src/game/runtime.ts", async (route) => {
const response = await route.fetch(),
source = await response.text();
const needle = "const world = new GameWorld(assets);";
expect(source).toContain(needle);
// Fixture worlds stand in for a saved session, so no introduction runs.
expect(source).toContain("this.world?.beginIntro();");
await route.fulfill({
response,
body: source.replace("this.world?.beginIntro();", "").replace(
needle,
`const { pokedexFixtureWorld } = await import('/tests/pokedex-fixture.ts'); const world = pokedexFixtureWorld(assets);`,
),
});
});
await page.clock.install({ time: new Date("2026-09-22T12:00:00") });
await page.goto("/");
await page.locator("#rom-file").setInputFiles(romPath);
await expect(page.locator("#status")).toContainText("verified");
await page.clock.pauseAt(new Date("2026-09-22T12:05:00"));
await page.locator("#play").click();
}
test("the Map tab shows the Johto atlas with the player and open areas", async ({ page }) => {
const errors: string[] = [];
page.on("pageerror", (error) => errors.push(error.message));
await start(page);
await page.locator("#tab-map").click();
const atlas = page.locator("#atlas");
await expect(atlas).toBeVisible();
await expect(page.locator("#atlas-title")).toHaveText("Johto");
await expect(page.locator("#atlas-regions button")).toHaveCount(0);
await expect(page.locator("#atlas-here")).toHaveText("You are in NEW BARK TOWN.");
await expect(page.locator("#atlas-map")).toHaveAttribute("aria-label", "Johto map, you are in NEW BARK TOWN");
const open = page.locator("#atlas-open li");
await expect(open.first()).toHaveText("NEW BARK TOWN");
await expect(page.locator("#atlas-open")).toContainText("VIOLET CITY");
await expect(page.locator("#atlas-open")).toContainText("AZALEA TOWN");
await expect(page.locator("#atlas-open")).toContainText("BLACKTHORN CITY");
// Mt. Silver's cave belongs to Kanto's postgame (board #33).
await expect(page.locator("#atlas-open")).not.toContainText("SILVER CAVE");
expect(errors).toEqual([]);
});