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
101 lines
3.5 KiB
JavaScript
101 lines
3.5 KiB
JavaScript
const puppeteer = require('puppeteer');
|
|
const { getPuppeteerLaunchOptions } = require('./puppeteer_config');
|
|
const AuthHelper = require('./auth_helper');
|
|
|
|
async function testMetricsPage() {
|
|
console.log('🚀 Starting browser test of metrics page...');
|
|
|
|
const browser = await puppeteer.launch(getPuppeteerLaunchOptions());
|
|
|
|
const page = await browser.newPage();
|
|
|
|
// Set longer timeout for CI environments
|
|
page.setDefaultTimeout(30000);
|
|
page.setDefaultNavigationTimeout(30000);
|
|
|
|
// Create auth helper
|
|
const authHelper = new AuthHelper(page);
|
|
|
|
// Listen to console errors
|
|
page.on('console', msg => {
|
|
if (msg.type() === 'error') {
|
|
console.log(` Browser error: ${msg.text()}`);
|
|
}
|
|
});
|
|
|
|
// Listen to JavaScript errors
|
|
page.on('pageerror', error => {
|
|
console.log(`❌ [ERROR] ${error.message}`);
|
|
});
|
|
|
|
// Listen to failed requests
|
|
page.on('requestfailed', request => {
|
|
console.log(`🔴 [REQUEST FAILED] ${request.url()} - ${request.failure().errorText}`);
|
|
});
|
|
|
|
try {
|
|
// Ensure we're authenticated first
|
|
console.log('🔐 Ensuring authentication...');
|
|
await authHelper.ensureAuthenticated();
|
|
|
|
console.log('📄 Navigating to metrics page...');
|
|
await page.goto('http://127.0.0.1:5000/metrics/', {
|
|
waitUntil: 'domcontentloaded',
|
|
timeout: 30000
|
|
});
|
|
|
|
console.log('✅ Page loaded successfully');
|
|
|
|
// Wait a bit for JavaScript to execute
|
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
|
|
// Check if specific elements are visible
|
|
const loadingVisible = await page.evaluate(() => {
|
|
const loading = document.getElementById('loading');
|
|
return loading ? window.getComputedStyle(loading).display !== 'none' : false;
|
|
});
|
|
|
|
const contentVisible = await page.evaluate(() => {
|
|
const content = document.getElementById('metrics-content');
|
|
return content ? window.getComputedStyle(content).display !== 'none' : false;
|
|
});
|
|
|
|
const errorVisible = await page.evaluate(() => {
|
|
const error = document.getElementById('error');
|
|
return error ? window.getComputedStyle(error).display !== 'none' : false;
|
|
});
|
|
|
|
console.log(`🔍 Element visibility check:`);
|
|
console.log(` Loading: ${loadingVisible}`);
|
|
console.log(` Content: ${contentVisible}`);
|
|
console.log(` Error: ${errorVisible}`);
|
|
|
|
// Check if token values are populated
|
|
const tokenValues = await page.evaluate(() => {
|
|
const totalTokens = document.getElementById('total-tokens');
|
|
const totalResearches = document.getElementById('total-researches');
|
|
return {
|
|
totalTokens: totalTokens ? totalTokens.textContent : 'NOT FOUND',
|
|
totalResearches: totalResearches ? totalResearches.textContent : 'NOT FOUND'
|
|
};
|
|
});
|
|
|
|
console.log(`📊 Token values:`);
|
|
console.log(` Total Tokens: ${tokenValues.totalTokens}`);
|
|
console.log(` Total Researches: ${tokenValues.totalResearches}`);
|
|
|
|
|
|
} catch (error) {
|
|
console.log(`❌ Error during test: ${error.message}`);
|
|
process.exitCode = 1;
|
|
} finally {
|
|
await browser.close();
|
|
console.log('🏁 Browser test completed');
|
|
}
|
|
}
|
|
|
|
testMetricsPage().catch(err => {
|
|
console.error('❌ Unhandled error:', err);
|
|
process.exitCode = 1;
|
|
});
|