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
77 lines
2.9 KiB
JavaScript
77 lines
2.9 KiB
JavaScript
const puppeteer = require('puppeteer');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const AuthHelper = require('./auth_helper');
|
|
|
|
async function captureUIScreenshots() {
|
|
const browser = await puppeteer.launch({
|
|
headless: process.env.HEADLESS === 'true',
|
|
args: ['--no-sandbox', '--disable-setuid-sandbox']
|
|
});
|
|
|
|
const page = await browser.newPage();
|
|
await page.setViewport({ width: 1280, height: 720 });
|
|
|
|
// Create screenshots directory
|
|
const screenshotDir = path.join(__dirname, 'ui-review-screenshots');
|
|
if (!fs.existsSync(screenshotDir)) {
|
|
fs.mkdirSync(screenshotDir, { recursive: true });
|
|
}
|
|
|
|
try {
|
|
console.log('🔐 Authenticating...');
|
|
const auth = new AuthHelper(page);
|
|
await auth.ensureAuthenticated();
|
|
console.log('✅ Authentication successful');
|
|
|
|
// Pages to capture
|
|
const pages = [
|
|
{ name: 'home', url: 'http://127.0.0.1:5000/', description: 'Research Home' },
|
|
{ name: 'settings', url: 'http://127.0.0.1:5000/settings/', description: 'Settings' },
|
|
{ name: 'metrics', url: 'http://127.0.0.1:5000/metrics/', description: 'Metrics' },
|
|
{ name: 'history', url: 'http://127.0.0.1:5000/history/', description: 'History' },
|
|
{ name: 'news', url: 'http://127.0.0.1:5000/news/', description: 'News Feed' },
|
|
{ name: 'benchmark', url: 'http://127.0.0.1:5000/benchmark/', description: 'Benchmark' }
|
|
];
|
|
|
|
for (const pageInfo of pages) {
|
|
console.log(`📸 Capturing ${pageInfo.description}...`);
|
|
await page.goto(pageInfo.url, { waitUntil: 'domcontentloaded' });
|
|
await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for any animations
|
|
|
|
const screenshotPath = path.join(screenshotDir, `${pageInfo.name}.png`);
|
|
await page.screenshot({
|
|
path: screenshotPath,
|
|
fullPage: true
|
|
});
|
|
console.log(`✅ Saved: ${screenshotPath}`);
|
|
|
|
// Also capture mobile view
|
|
await page.setViewport({ width: 375, height: 667 });
|
|
await new Promise(resolve => setTimeout(resolve, 500));
|
|
|
|
const mobileScreenshotPath = path.join(screenshotDir, `${pageInfo.name}_mobile.png`);
|
|
await page.screenshot({
|
|
path: mobileScreenshotPath,
|
|
fullPage: true
|
|
});
|
|
console.log(`📱 Saved mobile: ${mobileScreenshotPath}`);
|
|
|
|
// Reset to desktop
|
|
await page.setViewport({ width: 1280, height: 720 });
|
|
}
|
|
|
|
console.log('\n✅ All screenshots captured successfully!');
|
|
console.log(`📁 Screenshots saved to: ${screenshotDir}`);
|
|
|
|
} catch (error) {
|
|
console.error('❌ Error capturing screenshots:', error.message);
|
|
throw error;
|
|
} finally {
|
|
await browser.close();
|
|
}
|
|
}
|
|
|
|
// Run the test
|
|
captureUIScreenshots().catch(console.error);
|