fix(camera): make lighting checks advisory only
This commit is contained in:
@@ -117,10 +117,8 @@ try {
|
||||
assert((await page.locator('#cam-step').textContent()).includes('1/3'), 'invalid frontal angle never advances');
|
||||
assert.equal(await page.evaluate(() => window.__voice.some(row => /^hint-turn-|^step[23]-|^shot-done$/.test(row.id))), false, 'no turn/next-step/completion audio before a successful front photo');
|
||||
await page.evaluate(() => { window.__cameraFixture.light(.6); return window.__cameraFixture.set('C3_180.jpg'); });
|
||||
await page.waitForFunction(()=>window.__evaluations.some(row=>row.target==='front'&&!row.ok&&row.hint==='请到光线充足处'));
|
||||
assert((await page.locator('#cam-step').textContent()).includes('1/3'),'dim sample cannot advance');
|
||||
// Simulate improving room lighting, not bypassing the actual quality gate.
|
||||
await page.evaluate(()=>window.__cameraFixture.light(1.3));
|
||||
await page.waitForFunction(()=>document.querySelector('#cam-hint').textContent.includes('建议到光线明亮处拍摄'));
|
||||
// Keep the dim sample through countdown AND final JPEG validation.
|
||||
try { await page.waitForFunction(() => document.querySelector('#cam-step').textContent.includes('2/3')); }
|
||||
catch (error) {
|
||||
console.log(await page.evaluate(async () => {
|
||||
@@ -132,6 +130,7 @@ try {
|
||||
}).then(value => JSON.stringify(value, null, 2)), errors); throw error;
|
||||
}
|
||||
await page.waitForFunction(() => window.__voice.some(row => row.id === 'step2-rightface'));
|
||||
await page.evaluate(()=>window.__cameraFixture.light(1.3));
|
||||
const firstVoice = await page.evaluate(() => window.__voice);
|
||||
const completion = firstVoice.find(row => row.id === 'shot-done'), turn = firstVoice.find(row => row.id === 'step2-rightface');
|
||||
assert(completion && turn && completion.step.includes('1/3') && turn.step.includes('2/3'));
|
||||
@@ -152,7 +151,8 @@ try {
|
||||
for (const key of ['front', 'left', 'right']) {
|
||||
const row = body.capture_diagnostics.views[key];
|
||||
assert.equal(row.mode, 'live'); assert.equal(row.direction_checked, true);
|
||||
assert(row.score >= (key==='front'?.3:.4) && row.luma >= 110 && row.luma <= 220);
|
||||
assert(row.score >= (key==='front'?.25:.3));
|
||||
if(key==='front') assert(row.luma < 110, 'dim JPEG still passes final validation');
|
||||
assert(Math.abs(row.roll) <= 22);
|
||||
}
|
||||
assert(Math.abs(body.capture_diagnostics.views.front.yaw) <= 18);
|
||||
|
||||
Reference in New Issue
Block a user