import { chromium } from 'playwright'; (async () => { const browser = await chromium.launch({ headless: false }); const context = await browser.newContext(); const page = await context.newPage(); // Enable console logging page.on('console', msg => console.log('BROWSER: ' + msg.text())); // Capture network errors page.on('response', response => { if (response.status() >= 400) { console.log('ERROR: ' + response.status() + ' ' + response.url()); response.text().then(body => console.log('Response body: ' + body)).catch(() => {}); } }); try { console.log('1. Navigating to app...'); await page.goto('http://100.81.138.77:8081/#/login', { waitUntil: 'networkidle' }); await page.waitForTimeout(2000); console.log('2. Logging in...'); await page.fill('input[type="text"]', 'admin'); await page.fill('input[type="password"]', 'admin'); await page.click('button:has-text("Login")'); await page.waitForTimeout(3000); console.log('3. Navigating to Action Mappings...'); await page.goto('http://100.81.138.77:8081/#/action-mappings', { waitUntil: 'networkidle' }); await page.waitForTimeout(2000); console.log('4. Clicking download button...'); const downloadButton = page.locator('button[aria-label*="Download"], button:has(svg)').nth(2); await downloadButton.click(); console.log('5. Waiting for response...'); await page.waitForTimeout(5000); console.log('Test complete'); } catch (error) { console.error('Test failed:', error.message); } await page.waitForTimeout(3000); await browser.close(); })();