Verify public game handle stays disabled
This commit is contained in:
@@ -4,7 +4,7 @@ import { chromium } from 'playwright';
|
|||||||
|
|
||||||
const targetUrl = withQaParams(process.env.PUBLIC_QA_URL ?? 'https://comtropy.synology.me/heros_web/');
|
const targetUrl = withQaParams(process.env.PUBLIC_QA_URL ?? 'https://comtropy.synology.me/heros_web/');
|
||||||
const screenshotPath = process.env.PUBLIC_QA_SCREENSHOT ?? 'dist/public-deploy-qa.png';
|
const screenshotPath = process.env.PUBLIC_QA_SCREENSHOT ?? 'dist/public-deploy-qa.png';
|
||||||
const expectedTitle = '삼국지: 세 형제의 맹세';
|
const expectedTitle = '\uC0BC\uAD6D\uC9C0: \uC138 \uD615\uC81C\uC758 \uB9F9\uC138';
|
||||||
const relevantLogPattern = /asset|audio|cannot|failed|map|missing|portrait|sprite|story|texture|unit/i;
|
const relevantLogPattern = /asset|audio|cannot|failed|map|missing|portrait|sprite|story|texture|unit/i;
|
||||||
|
|
||||||
mkdirSync(dirname(screenshotPath), { recursive: true });
|
mkdirSync(dirname(screenshotPath), { recursive: true });
|
||||||
@@ -45,6 +45,7 @@ try {
|
|||||||
title: document.title,
|
title: document.title,
|
||||||
canvasCount: document.querySelectorAll('canvas').length,
|
canvasCount: document.querySelectorAll('canvas').length,
|
||||||
debugApiPresent: Boolean(window.__HEROS_DEBUG__),
|
debugApiPresent: Boolean(window.__HEROS_DEBUG__),
|
||||||
|
gameApiPresent: Boolean(window.__HEROS_GAME__),
|
||||||
canvas: canvas
|
canvas: canvas
|
||||||
? {
|
? {
|
||||||
width: canvas.width,
|
width: canvas.width,
|
||||||
@@ -91,6 +92,7 @@ try {
|
|||||||
assert(state.title === expectedTitle, `Expected deployed page title "${expectedTitle}": ${JSON.stringify(state)}`);
|
assert(state.title === expectedTitle, `Expected deployed page title "${expectedTitle}": ${JSON.stringify(state)}`);
|
||||||
assert(state.canvasCount === 1, `Expected exactly one game canvas: ${JSON.stringify(state)}`);
|
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.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 >= 960 && state.canvas?.height >= 540, `Expected desktop-size game canvas: ${JSON.stringify(state)}`);
|
||||||
assert(state.canvas?.pixelProbe?.readable === true, `Expected readable canvas pixels: ${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.sampleCount >= 500, `Expected enough canvas pixel samples: ${JSON.stringify(state)}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user