Merge commit '79aae7c7f71404bdb80d6db52bc6401e0e221d42' into develop

This commit is contained in:
assistant-librarian[bot]
2025-11-27 00:36:02 +00:00
parent 2044d0dd35
commit e7c7922385
41 changed files with 360 additions and 174 deletions

View File

@@ -0,0 +1,53 @@
const puppeteer = require('puppeteer');
(async () => {
try {
// Launch the browser
const browser = await puppeteer.launch({
args: [
'--no-sandbox',
'--headless',
'--disable-gpu',
'--window-size=1920x1080'
]});
const page = await browser.newPage();
await page.setViewport({ width: 1920, height: 1080 });
await page.goto('https://ui.perfetto.dev');
// Wait for the home page to be visible
console.log('Waiting for page to load...');
await page.waitForSelector('.pf-home-page', { visible: true, timeout: 30000 });
// Locate and click the Open trace button
const elements = await page.$$('li');
let element = null;
for (const el of elements) {
const text = await el.evaluate(node => node.textContent);
if (text && text.includes('Open trace file')) {
element = el;
break;
}
}
if (element) {
const [fileChooser] = await Promise.all([
page.waitForFileChooser(),
element.click()
]);
await fileChooser.accept(['/workspace/ck_build_trace.json']);
} else {
throw new Error('Element not found');
}
console.log('Waiting for data to load...');
// Wait for the timeline element to be visible
await page.waitForSelector('.pf-track', { timeout: 30000 });
// Wait for the data to finish loading
await page.waitForFunction(() => {
return !document.body.textContent.includes('Loading...');
}, { timeout: 30000 });
console.log('Capturing screenshot...');
await page.screenshot({path: '/workspace/perfetto_snapshot_build.png'});
console.log('Done capturing screenshot...');
await browser.close();
} catch (err) {
console.error(err);
process.exit(1);
}
})();