Files
wehub-resource-sync 7a0da7932b
Backwards Compatibility / Verify Encryption Constants (push) Waiting to run
Backwards Compatibility / PyPI Version Compatibility (push) Waiting to run
Backwards Compatibility / Database Migration Tests (push) Waiting to run
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
CodeQL Advanced / Analyze (python) (push) Waiting to run
Docker Tests (Consolidated) / UI Tests (Puppeteer) [research-form] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [research-metrics] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [research-workflow] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [settings-core] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [settings-pages] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [history-news] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [library] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [link-analytics] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [mobile] (push) Blocked by required conditions
Docker Tests (Consolidated) / detect-changes (push) Waiting to run
Docker Tests (Consolidated) / Build Test Image (push) Waiting to run
Docker Tests (Consolidated) / All Pytest Tests + Coverage (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [accessibility] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [api-crud] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [auth-login] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [auth-pages] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [auth-register] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [chat-core] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [chat-lifecycle] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) [error-benchmark] (push) Blocked by required conditions
Docker Tests (Consolidated) / UI Tests (Puppeteer) (push) Blocked by required conditions
Docker Tests (Consolidated) / Accessibility Tests (push) Blocked by required conditions
Docker Tests (Consolidated) / LLM Unit Tests (push) Blocked by required conditions
Docker Tests (Consolidated) / LLM Example Tests (push) Blocked by required conditions
Docker Tests (Consolidated) / Production Image Smoke Test (push) Blocked by required conditions
Docker Tests (Consolidated) / Infrastructure Tests (push) Blocked by required conditions
OSSF Scorecard / OSSF Security Scorecard Analysis (push) Waiting to run
OSV-Scanner (Scheduled) / scan-scheduled (push) Failing after 0s
Create Release / test-gate (push) Has been cancelled
Create Release / release-gate (push) Has been cancelled
Create Release / ci-gate (push) Has been cancelled
Create Release / version-check (push) Has been cancelled
Create Release / e2e-test-gate (push) Has been cancelled
Create Release / responsive-test-gate (push) Has been cancelled
Create Release / compat-test-gate (push) Has been cancelled
Create Release / compose-integration-gate (push) Has been cancelled
Create Release / vulture-gate (push) Has been cancelled
Create Release / build (push) Has been cancelled
Create Release / provenance (push) Has been cancelled
Create Release / prerelease-docker (push) Has been cancelled
Create Release / publish-docker (push) Has been cancelled
Create Release / create-release (push) Has been cancelled
Create Release / cleanup-changelog (push) Has been cancelled
Create Release / trigger-pypi (push) Has been cancelled
Create Release / monitor-pypi (push) Has been cancelled
Create Release / Clean up orphan prerelease tags and signatures (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:08:55 +08:00

87 lines
3.2 KiB
JavaScript

const puppeteer = require('puppeteer');
const AuthHelper = require('./auth_helper');
const { BROWSER_CONFIG, PAGE_CONFIG } = require('./browser_config');
async function testCharts() {
console.log('🎯 Testing chart functionality...');
const browser = await puppeteer.launch(BROWSER_CONFIG);
const page = await browser.newPage();
const baseUrl = 'http://127.0.0.1:5000';
const authHelper = new AuthHelper(page, baseUrl);
// Handle any dialogs that appear
page.on('dialog', async dialog => {
console.log(`📢 Dialog appeared: ${dialog.type()} - ${dialog.message()}`);
await dialog.dismiss();
});
// Listen to console errors
page.on('console', msg => {
if (msg.type() === 'error') {
console.log(` Browser error: ${msg.text()}`);
}
});
// Listen to errors
page.on('pageerror', error => {
console.log(`❌ JS Error: ${error.message}`);
});
try {
// Login first
await authHelper.ensureAuthenticated();
console.log('✅ Logged in');
await page.goto(`${baseUrl}/metrics/`, {
waitUntil: 'domcontentloaded',
timeout: 10000
});
// Wait for all processing to complete
await new Promise(resolve => setTimeout(resolve, 6000));
// Check if charts were created
const chartInfo = await page.evaluate(() => {
const tokenChart = document.getElementById('time-series-chart');
const searchChart = document.getElementById('search-activity-chart');
return {
hasTokenChart: !!tokenChart,
hasSearchChart: !!searchChart,
tokenChartVisible: tokenChart ? window.getComputedStyle(tokenChart).display !== 'none' : false,
searchChartVisible: searchChart ? window.getComputedStyle(searchChart).display !== 'none' : false,
// Check if Chart.js created canvas charts
timeSeriesChartExists: !!window.timeSeriesChart,
searchActivityChartExists: !!window.searchActivityChart
};
});
console.log('📊 Chart Analysis:');
console.log(` Token chart element: ${chartInfo.hasTokenChart}`);
console.log(` Search chart element: ${chartInfo.hasSearchChart}`);
console.log(` Token chart visible: ${chartInfo.tokenChartVisible}`);
console.log(` Search chart visible: ${chartInfo.searchChartVisible}`);
console.log(` Time series chart object: ${chartInfo.timeSeriesChartExists}`);
console.log(` Search activity chart object: ${chartInfo.searchActivityChartExists}`);
// Take screenshot
await page.screenshot({ path: 'charts_test.png' });
console.log('📸 Screenshot saved as charts_test.png');
await browser.close();
const success = chartInfo.hasTokenChart && chartInfo.hasSearchChart;
console.log(success ? '🎉 Charts test PASSED!' : '💥 Charts test FAILED!');
return success;
} catch (error) {
console.log(`❌ Test failed: ${error.message}`);
await browser.close();
return false;
}
}
testCharts().catch(console.error);