mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
Capture vessel cards after first-run chrome and camera settling
This commit is contained in:
1 parent
73135a7ae4
commit
0007ace064
1 file changed
+8
-1
@@ -253,6 +253,10 @@ async function main() {
|
|||||||
|
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
await page.setViewport({ width: 1600, height: 900 });
|
await page.setViewport({ width: 1600, height: 900 });
|
||||||
|
await page.evaluateOnNewDocument(() => {
|
||||||
|
// This harness inspects cards, so keep first-run chrome out of the view.
|
||||||
|
localStorage.setItem('gev:first-run-mission:v1', 'suppressed');
|
||||||
|
});
|
||||||
page.on('pageerror', (err) => console.error(` [page-error] ${err.message}`));
|
page.on('pageerror', (err) => console.error(` [page-error] ${err.message}`));
|
||||||
|
|
||||||
await page.goto(APP_URL, { waitUntil: 'domcontentloaded', timeout: 60000 });
|
await page.goto(APP_URL, { waitUntil: 'domcontentloaded', timeout: 60000 });
|
||||||
@@ -319,7 +323,10 @@ async function main() {
|
|||||||
orientation: { heading: p.heading, pitch: p.pitch, roll: 0 },
|
orientation: { heading: p.heading, pitch: p.pitch, roll: 0 },
|
||||||
});
|
});
|
||||||
}, port);
|
}, port);
|
||||||
const resettled = settled ? true : await page
|
// A changed camera invalidates the previous settled result. Let the new
|
||||||
|
// view schedule its tiles before checking readiness again.
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 1500));
|
||||||
|
const resettled = await page
|
||||||
.waitForFunction(() => {
|
.waitForFunction(() => {
|
||||||
const gev = window.__godsEyeView;
|
const gev = window.__godsEyeView;
|
||||||
const ais = gev.dataManager.getAll().find((l) => l.id === 'ais-live-vessels');
|
const ais = gev.dataManager.getAll().find((l) => l.id === 'ais-live-vessels');
|
||||||
|
|||||||
Reference in new issue
Block a user