Release Healer Man 0.1.44
This commit is contained in:
1 parent
ccc01396cd
commit
756ee4f64a
24 files changed
+575
-46
No files matched your search
@@ -2,7 +2,8 @@ const { chromium } = require('C:/Users/phenom/.cache/codex-runtimes/codex-primar
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const assert = require('node:assert/strict');
|
||||
const directory = path.resolve('playtest-artifacts/boss-testing');
|
||||
const selectedBossName = process.env.BOSS_TEST_BOSS || 'Lady Anacondra';
|
||||
const directory = path.resolve('playtest-artifacts', selectedBossName === 'Celebras the Cursed' ? 'boss-testing-scaling' : 'boss-testing');
|
||||
fs.mkdirSync(directory, { recursive: true });
|
||||
const base = process.env.BOSS_TEST_URL || 'http://127.0.0.1:4187';
|
||||
(async () => {
|
||||
@@ -48,8 +49,8 @@ const base = process.env.BOSS_TEST_URL || 'http://127.0.0.1:4187';
|
||||
await page.getByRole('button', { name: /Boss Testing/ }).click();
|
||||
await page.getByRole('heading', { name: 'Boss Testing', exact: true }).waitFor();
|
||||
const picker = page.getByLabel(/Choose a boss/);
|
||||
const option = await picker.locator('option').evaluateAll((options) => options.find((entry) => /Lady Anacondra.*Wailing Caverns/.test(entry.textContent))?.value);
|
||||
assert(option, 'Lady Anacondra is selectable');
|
||||
const option = await picker.locator('option').evaluateAll((options, name) => options.find((entry) => entry.textContent.startsWith(`${name} ·`))?.value, selectedBossName);
|
||||
assert(option, `${selectedBossName} is selectable`);
|
||||
await picker.selectOption(option);
|
||||
await page.getByRole('button', { name: 'Test selected boss', exact: true }).waitFor({ state: 'visible' });
|
||||
await capture('02-boss-selection');
|
||||
@@ -68,9 +69,17 @@ const base = process.env.BOSS_TEST_URL || 'http://127.0.0.1:4187';
|
||||
const game = useGameStore.getState();
|
||||
const combat = useCombatStore.getState();
|
||||
const boss = game.bossTest;
|
||||
return { boss, xp: combat.xp, saved: JSON.stringify(useShellStore.getState().characters), count: Object.keys(combat.mobs).length };
|
||||
return { boss, xp: combat.xp, saved: JSON.stringify(useShellStore.getState().characters), count: Object.keys(combat.mobs).length,
|
||||
classId: combat.classId, level: combat.level, bossLevel: combat.mobs[boss.runtimeIds[0]].level,
|
||||
bossMaxHealth: combat.mobs[boss.runtimeIds[0]].maxHealth };
|
||||
});
|
||||
assert.equal(before.count, 1, 'Only the selected boss spawns initially');
|
||||
if (selectedBossName === 'Celebras the Cursed') {
|
||||
assert.equal(before.classId, 'priest');
|
||||
assert.equal(before.level, 1);
|
||||
assert.equal(before.bossLevel, 2);
|
||||
assert.equal(before.bossMaxHealth, 575, 'Level-one Celebras uses scaled native health without campaign floors');
|
||||
}
|
||||
await page.keyboard.press('Escape');
|
||||
await page.getByRole('button', { name: 'Boss readiness & report', exact: true }).click();
|
||||
await page.getByRole('button', { name: 'Mark not ready', exact: true }).click();
|
||||
@@ -115,7 +124,7 @@ const base = process.env.BOSS_TEST_URL || 'http://127.0.0.1:4187';
|
||||
await capture('07-mobile-selection');
|
||||
assert(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1), 'No mobile horizontal overflow');
|
||||
await page.setViewportSize({ width: 1440, height: 1000 });
|
||||
await page.getByLabel('Search bosses').fill('Lady Anacondra');
|
||||
await page.getByLabel('Search bosses').fill(selectedBossName);
|
||||
await page.getByRole('button', { name: 'Fight a random boss', exact: true }).click();
|
||||
await page.locator('canvas').waitFor();
|
||||
await page.waitForTimeout(3000);
|
||||
@@ -154,7 +163,9 @@ const base = process.env.BOSS_TEST_URL || 'http://127.0.0.1:4187';
|
||||
await capture('12-bottom-display-review');
|
||||
await bottom.close();
|
||||
assert.deepEqual(errors, [], 'No browser runtime errors');
|
||||
fs.writeFileSync(path.join(directory, 'results.json'), `${JSON.stringify({ passed: true, boss: before.boss, initialMobCount: before.count, xpUnchanged: true, profileUnchanged: true, automaticDownload: 'dungeon:ragefire-chasm', report: reports[0], errors }, null, 2)}\n`);
|
||||
fs.writeFileSync(path.join(directory, 'results.json'), `${JSON.stringify({ passed: true, boss: before.boss, classId: before.classId,
|
||||
characterLevel: before.level, bossLevel: before.bossLevel, bossMaxHealth: before.bossMaxHealth,
|
||||
initialMobCount: before.count, xpUnchanged: true, profileUnchanged: true, automaticDownload: 'dungeon:ragefire-chasm', report: reports[0], errors }, null, 2)}\n`);
|
||||
console.log('Boss Testing live flow passed');
|
||||
} catch (error) {
|
||||
await capture('failure');
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
const { chromium } = require('C:/Users/phenom/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/node_modules/playwright');
|
||||
const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
const zlib = require('node:zlib');
|
||||
const assert = require('node:assert/strict');
|
||||
const directory = path.resolve('playtest-artifacts/dungeon-health-scaling');
|
||||
fs.mkdirSync(directory, { recursive: true });
|
||||
const catalogSource = fs.readFileSync('src/game/generated/dungeonCampaignCatalog.compressed.ts', 'utf8');
|
||||
const catalog = JSON.parse(zlib.gunzipSync(Buffer.from(catalogSource.match(/"([A-Za-z0-9+/=]+)"/)[1], 'base64')));
|
||||
const dungeon = catalog.definitions.find((entry) => entry.id === 'stormwind-stockade');
|
||||
const boss = dungeon.bosses[0];
|
||||
|
||||
(async () => {
|
||||
const { createGameServer } = await import('../server/server.mjs');
|
||||
const runtime = createGameServer({ dataDir: path.join(directory, 'test-database'), enableShelvedModes: false });
|
||||
await new Promise((resolve) => runtime.server.listen(4190, '127.0.0.1', resolve));
|
||||
const browser = await chromium.launch({ channel: 'msedge', headless: true });
|
||||
const page = await browser.newPage({ viewport: { width: 1440, height: 1000 } });
|
||||
page.setDefaultTimeout(90000);
|
||||
const errors = [];
|
||||
page.on('pageerror', (error) => errors.push(error.message));
|
||||
const files = fs.readdirSync('dist/assets');
|
||||
const mainModule = `/assets/${files.find((file) => /^index-.*\.js$/.test(file))}`;
|
||||
const combatModule = `/assets/${files.find((file) => /^combatStore-.*\.js$/.test(file))}`;
|
||||
await page.addInitScript(({ mainModule, combatModule }) => {
|
||||
window.healthTestStores = async () => {
|
||||
const exports = [...Object.values(await import(mainModule)), ...Object.values(await import(combatModule))];
|
||||
return {
|
||||
game: exports.find((value) => value?.getState && 'bossTest' in value.getState()),
|
||||
shell: exports.find((value) => value?.getState && 'characters' in value.getState()),
|
||||
combat: exports.find((value) => value?.getState && 'damageMob' in value.getState()),
|
||||
party: exports.find((value) => value?.getState && 'categoryId' in value.getState() && 'members' in value.getState()),
|
||||
};
|
||||
};
|
||||
}, { mainModule, combatModule });
|
||||
try {
|
||||
await page.goto('http://127.0.0.1:4190', { waitUntil: 'domcontentloaded' });
|
||||
await page.getByRole('button', { name: /Play offline/ }).click();
|
||||
await page.getByRole('button', { name: /Create character/ }).click();
|
||||
await page.getByRole('button', { name: /Customize & name/ }).click();
|
||||
await page.getByLabel('Character name').fill('Healthtester');
|
||||
await page.getByRole('button', { name: /Create character/ }).click();
|
||||
await page.getByRole('button', { name: /Continue|Enter world/ }).first().click();
|
||||
await page.locator('.main-menu-screen').waitFor();
|
||||
// Isolated level-three profile fixture; dungeon entry and registration use the normal UI.
|
||||
await page.evaluate(async () => {
|
||||
const { shell } = await window.healthTestStores();
|
||||
const state = shell.getState();
|
||||
const character = state.characters.find((entry) => entry.id === state.selectedCharacterId);
|
||||
shell.setState({ activeCharacter: character });
|
||||
shell.getState().saveActiveProgression(3, 0, character.talentRanks);
|
||||
shell.setState({ activeCharacter: null });
|
||||
});
|
||||
await page.getByRole('button', { name: /^Dungeons/ }).click();
|
||||
await page.locator('.dungeon-select-row').filter({ hasText: /Stockade/i }).click();
|
||||
await page.getByRole('button', { name: 'Download and continue', exact: true }).click();
|
||||
await page.locator('.dungeon-role-option--healer').click();
|
||||
await page.evaluate(async () => {
|
||||
const { game } = await window.healthTestStores();
|
||||
game.getState().openOverlay('pause');
|
||||
});
|
||||
await page.waitForFunction(async () => {
|
||||
const { game, combat } = await window.healthTestStores();
|
||||
return game.getState().assetStatus === 'ready' && combat.getState().level === 3;
|
||||
});
|
||||
await page.waitForTimeout(10000);
|
||||
await page.evaluate(async (boss) => {
|
||||
const { game, combat, party } = await window.healthTestStores();
|
||||
party?.getState().setCommand('stop');
|
||||
game.getState().relocatePlayer({ footPosition: [boss.position[0], boss.position[1], boss.position[2] + 5], yaw: Math.PI });
|
||||
combat.getState().setPlayerPosition(game.getState().playerPosition);
|
||||
}, boss);
|
||||
await page.waitForFunction(async (id) => {
|
||||
const { combat } = await window.healthTestStores();
|
||||
return combat.getState().level === 3 && combat.getState().mobs[id]?.maxHealth === 1300;
|
||||
}, boss.id);
|
||||
const result = await page.evaluate(async (id) => {
|
||||
const { game, combat } = await window.healthTestStores();
|
||||
const state = combat.getState();
|
||||
state.selectMob(id);
|
||||
game.getState().closeOverlay();
|
||||
return { dungeonId: game.getState().activeDungeonId, gameMode: game.getState().gameMode,
|
||||
bossTest: game.getState().bossTest, bossDifficulty: game.getState().activeBossDifficulty,
|
||||
classId: state.classId, characterLevel: state.level, boss: state.mobs[id].name,
|
||||
bossLevel: state.mobs[id].level, bossMaxHealth: state.mobs[id].maxHealth };
|
||||
}, boss.id);
|
||||
assert.equal(result.dungeonId, 'stormwind-stockade');
|
||||
assert.equal(result.gameMode, 'dungeon');
|
||||
assert.equal(result.bossTest, null);
|
||||
assert.equal(result.bossDifficulty, 1);
|
||||
assert.equal(result.classId, 'priest');
|
||||
assert.equal(result.characterLevel, 3);
|
||||
assert.equal(result.bossLevel, 4);
|
||||
assert.equal(result.bossMaxHealth, 1300);
|
||||
await page.waitForTimeout(1500);
|
||||
await page.screenshot({ path: path.join(directory, 'stockades-level-three.png') });
|
||||
assert.deepEqual(errors, []);
|
||||
fs.writeFileSync(path.join(directory, 'results.json'), `${JSON.stringify({ passed: true, ...result, errors }, null, 2)}\n`);
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
console.log('Regular dungeon health playtest passed');
|
||||
} catch (error) {
|
||||
await page.screenshot({ path: path.join(directory, 'failure.png') });
|
||||
console.log((await page.locator('body').innerText()).slice(-2000));
|
||||
console.log('Browser errors:', errors);
|
||||
throw error;
|
||||
} finally {
|
||||
await browser.close();
|
||||
await new Promise((resolve) => runtime.server.close(resolve));
|
||||
}
|
||||
})().catch((error) => { console.error(error); process.exitCode = 1; });
|
||||
Reference in new issue
Block a user