const { test, expect } = require('@playwright/test'); const GITEA_URL = 'https://gitea.wellnua.com'; const EMAIL = 'serter2069@gmail.com'; test('reset Gitea password', async ({ page }) => { console.log('=== GITEA PASSWORD RESET ===\n'); // Go to forgot password page await page.goto(`${GITEA_URL}/user/forgot_password`); await page.waitForLoadState('networkidle'); await page.screenshot({ path: 'tests/screenshots/gitea-forgot-1.png', fullPage: true }); console.log('1. On forgot password page'); // Fill email const emailField = page.locator('input[name="email"], input#email, input[type="email"]').first(); if (await emailField.isVisible()) { await emailField.fill(EMAIL); console.log('2. Email filled:', EMAIL); await page.screenshot({ path: 'tests/screenshots/gitea-forgot-2.png', fullPage: true }); // Click submit const submitBtn = page.locator('button[type="submit"], button:has-text("Send"), button:has-text("Reset")').first(); if (await submitBtn.isVisible()) { await submitBtn.click(); console.log('3. Clicked submit button'); await page.waitForLoadState('networkidle'); await page.waitForTimeout(2000); await page.screenshot({ path: 'tests/screenshots/gitea-forgot-3.png', fullPage: true }); console.log('4. Current URL:', page.url()); console.log('5. Check email for reset link!'); } } else { console.log('Email field not found'); const content = await page.content(); console.log('Page content:', content.substring(0, 500)); } console.log('\n=== DONE ==='); });