Intelligence, Advanced Charting & Trading Platform
test(chartnova): verify real-HTML lazy loading in both Chromium and Safari-like WebKit
davoodmehraban89 committed
Oct 15, 2026 at 14:54 UTC
31468d3411f93847c5d0629cb14a0ab9a5e6edb2
1 file changed
+5
-3
scripts/test-chartnova-live-html-simulator.mjs
+5
-3
@@ -4,7 +4,7 @@
4
* Does not upload or deploy a Cloudflare Worker and does not modify the
5
* live site. Only the test browser is served simulated HTML+summary JSON.
6
*/
7
-import { chromium } from 'playwright';
7
+import { chromium, webkit } from 'playwright';
8
import {patchChartNovaV26} from './patch-chartnova-v26-light-catalog.mjs';
9
import {marketCatalogSummary} from '../packages/market-domain/src/market-catalog-summary.mjs';
10
@@ -34,9 +34,10 @@ const syntheticV26=
34
',{headers:{"content-type":"text/html; charset=utf-8"}})'+
35
'},async scheduled(event,env){}}';
36
const patched=patchChartNovaV26(syntheticV26);
37
+for(const spec of [{browserName:'Chromium',engine:chromium},{browserName:'WebKit',engine:webkit}]){
38
const errors=[],summaryCalls=[],marketCalls=[];
38
-const browser=await chromium.launch({headless:true});
39
-const stats={model:'staged-v26-html-in-browser',originalBytes:originalSize,summaryBytes:summarySize,
39
+const browser=await spec.engine.launch({headless:true});
40
+const stats={browser:spec.browserName,model:'staged-v26-html-in-browser',originalBytes:originalSize,summaryBytes:summarySize,
41
savingsPercent:Math.round((1-summarySize/originalSize)*100),catalogCount:projected.markets.length};
42
try{
43
const context=await browser.newContext({viewport:{width:390,height:844},isMobile:true,
@@ -93,3 +94,4 @@ if(stats.status!==200||!stats.dashboard?.chart||stats.visibleMarkets!==projected
94
stats.summaryCalls!==1||stats.historyRequests.length<2||
95
stats.historyRequests.some(symbol=>!symbol)||errors.length)
96
throw Error('Browser integration did not meet acceptance criteria');
97
+}