feat: adopt 1920x1080 baseline
This commit is contained in:
@@ -15,7 +15,7 @@ mkdirSync(dirname(screenshotPath), { recursive: true });
|
||||
const browser = await chromium.launch({ headless: true });
|
||||
|
||||
try {
|
||||
const page = await browser.newPage({ viewport: { width: 1280, height: 720 } });
|
||||
const page = await browser.newPage({ viewport: { width: 1920, height: 1080 } });
|
||||
const consoleMessages = [];
|
||||
const pageErrors = [];
|
||||
const requestFailures = [];
|
||||
@@ -37,7 +37,7 @@ try {
|
||||
await page.waitForFunction(() => document.querySelector('canvas') !== null, undefined, { timeout: 90000 });
|
||||
await page.waitForFunction(() => {
|
||||
const canvas = document.querySelector('canvas');
|
||||
return Boolean(canvas && canvas.width >= 960 && canvas.height >= 540);
|
||||
return Boolean(canvas && canvas.width === 1920 && canvas.height === 1080);
|
||||
}, undefined, { timeout: 90000 });
|
||||
await page.waitForTimeout(3000);
|
||||
await page.screenshot({ path: screenshotPath, fullPage: true });
|
||||
@@ -96,7 +96,7 @@ try {
|
||||
assert(state.canvasCount === 1, `Expected exactly one game canvas: ${JSON.stringify(state)}`);
|
||||
assert(state.debugApiPresent === false, `Expected public deploy to keep debug API disabled: ${JSON.stringify(state)}`);
|
||||
assert(state.gameApiPresent === false, `Expected public deploy to keep game handle disabled: ${JSON.stringify(state)}`);
|
||||
assert(state.canvas?.width >= 960 && state.canvas?.height >= 540, `Expected desktop-size game canvas: ${JSON.stringify(state)}`);
|
||||
assert(state.canvas?.width === 1920 && state.canvas?.height === 1080, `Expected FHD game canvas: ${JSON.stringify(state)}`);
|
||||
assert(state.canvas?.pixelProbe?.readable === true, `Expected readable canvas pixels: ${JSON.stringify(state)}`);
|
||||
assert(state.canvas.pixelProbe.sampleCount >= 500, `Expected enough canvas pixel samples: ${JSON.stringify(state)}`);
|
||||
assert(state.canvas.pixelProbe.nonTransparentRatio > 0.5, `Expected non-empty canvas pixels: ${JSON.stringify(state)}`);
|
||||
|
||||
Reference in New Issue
Block a user