upskill-event-manager/test-quick-screenshots.js
bengizmo 993a820a84 feat: Add comprehensive development artifacts to repository
- Add 26 documentation files including test reports, deployment guides, and troubleshooting documentation
- Include 3 CSV data files for trainer imports and user registration tracking
- Add 43 JavaScript test files covering mobile optimization, Safari compatibility, and E2E testing
- Include 18 PHP utility files for debugging, geocoding, and data analysis
- Add 12 shell scripts for deployment verification, user management, and database operations
- Update .gitignore with whitelist patterns for development files, documentation, and CSV data

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 12:26:11 -03:00

71 lines
No EOL
2.2 KiB
JavaScript

const { chromium } = require('playwright');
const BASE_URL = 'https://upskill-staging.measurequick.com';
async function captureScreenshots() {
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({
viewport: { width: 1920, height: 1080 }
});
const page = await context.newPage();
console.log('Capturing screenshots of deployed features...\n');
try {
// Login first
console.log('Logging in...');
await page.goto(`${BASE_URL}/training-login/`);
await page.fill('#username', 'test_trainer');
await page.fill('#password', 'password123');
await page.click('button[type="submit"]');
await page.waitForTimeout(3000);
// Capture trainer dashboard
console.log('Capturing trainer dashboard...');
const dashboardUrl = page.url();
console.log(`Current URL: ${dashboardUrl}`);
await page.screenshot({
path: 'screenshots/test-01-dashboard.png',
fullPage: true
});
// Try to navigate to new pages
const pages = [
{ name: 'venues-list', url: '/trainer/venue/list/' },
{ name: 'venue-manage', url: '/trainer/venue/manage/' },
{ name: 'profile-view', url: '/trainer/profile/' },
{ name: 'profile-edit', url: '/trainer/profile/edit/' },
{ name: 'organizers-list', url: '/trainer/organizer/list/' },
{ name: 'organizer-manage', url: '/trainer/organizer/manage/' }
];
for (const pageInfo of pages) {
console.log(`\nNavigating to ${pageInfo.name}...`);
await page.goto(`${BASE_URL}${pageInfo.url}`);
await page.waitForTimeout(2000);
const currentUrl = page.url();
const title = await page.title();
console.log(` URL: ${currentUrl}`);
console.log(` Title: ${title}`);
await page.screenshot({
path: `screenshots/test-${pageInfo.name}.png`,
fullPage: true
});
}
console.log('\nScreenshots captured successfully!');
} catch (error) {
console.error('Error:', error.message);
await page.screenshot({
path: 'screenshots/test-error.png',
fullPage: true
});
} finally {
await browser.close();
}
}
captureScreenshots().catch(console.error);