mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-15 15:52:21 +00:00
Preserve radio playback and imagery comparisons when switching planets
This commit is contained in:
1 parent
b98cbeebf2
commit
b01f1ee7dc
9 files changed
+246
-18
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import {switchGlobe} from './qa-switch-globe.mjs';
|
||||
import fs from 'node:fs/promises';
|
||||
import puppeteer from 'puppeteer';
|
||||
import sharp from 'sharp';
|
||||
@@ -220,6 +221,27 @@ try {
|
||||
await sleep(2500);
|
||||
image = await capture('ab');
|
||||
check('A/B dates on opposite sides', red(image.left) && green(image.right));
|
||||
if (args.includes('--switch')) {
|
||||
const first = await page.evaluate(() => {
|
||||
window.qaImageryOwner = window.__gevRecentImagery.layer;
|
||||
return window.qaImageryOwner.diagnostics().pins;
|
||||
});
|
||||
const reads = () => report.requests.filter(r => r.host === 'cmr.earthdata.nasa.gov').length;
|
||||
const expectedReads = reads();
|
||||
const initial = await page.evaluate(() => window.__godsEyeView.engine.kind);
|
||||
for (const kind of [initial === 'navara' ? 'cesium' : 'navara', initial]) {
|
||||
await switchGlobe(page, kind);
|
||||
const state = await page.evaluate(() => ({
|
||||
same: window.__gevRecentImagery.layer === window.qaImageryOwner,
|
||||
...window.qaImageryOwner.diagnostics(),
|
||||
}));
|
||||
check(kind+' holds both original pins',state.same && state.mode === 'ab' && state.pins.a === first.a && state.pins.b === first.b);
|
||||
await sleep(1800);
|
||||
const pixels=await capture('switch-'+kind);
|
||||
check(kind+' renders both pinned dates',red(pixels.left) && green(pixels.right));
|
||||
check(kind+' reuses the STAC search', reads() === expectedReads);
|
||||
}
|
||||
}
|
||||
await page.evaluate(() => window.__gevRecentImagery.layer.swapSides());
|
||||
image = await capture('swap');
|
||||
check('swap reverses dates', green(image.left) && red(image.right));
|
||||
|
||||
Reference in new issue
Block a user