const { test, expect } = require('@playwright/test'); const RESET_URL = 'https://gitea.wellnua.com/user/recover_account?code=202512111241000180718f2083d36c90ef12f385dc56ccea121af2b2437365726765695f74'; const NEW_PASSWORD = 'WellNuo2025!Secure'; const USERNAME = 'sergei_t'; test('set password and access repo', async ({ page }) => { console.log('=== GITEA FINAL SETUP ===\n'); // Step 1: Set new password await page.goto(RESET_URL); await page.waitForLoadState('networkidle'); console.log('1. On recovery page'); // Fill password await page.locator('input[name="password"]').fill(NEW_PASSWORD); console.log('2. Password filled'); // Click Recover Account button await page.locator('button:has-text("Recover Account")').click(); console.log('3. Clicked Recover Account'); await page.waitForLoadState('networkidle'); await page.waitForTimeout(2000); await page.screenshot({ path: 'tests/screenshots/gitea-final-1.png', fullPage: true }); console.log('4. After recovery URL:', page.url()); // Step 2: Login console.log('\n5. Logging in...'); await page.goto('https://gitea.wellnua.com/user/login'); await page.waitForLoadState('networkidle'); await page.locator('input#user_name').fill(USERNAME); await page.locator('input#password').fill(NEW_PASSWORD); await page.locator('button:has-text("Sign In")').click(); await page.waitForLoadState('networkidle'); await page.waitForTimeout(2000); await page.screenshot({ path: 'tests/screenshots/gitea-final-2.png', fullPage: true }); console.log('6. After login URL:', page.url()); // Step 3: Access repo console.log('\n7. Accessing repository...'); await page.goto('https://gitea.wellnua.com/robert/MobileApp_react_native'); await page.waitForLoadState('networkidle'); await page.screenshot({ path: 'tests/screenshots/gitea-final-3.png', fullPage: true }); const title = await page.title(); console.log('8. Repo title:', title); // Check if repo is accessible const is404 = title.includes('Not Found') || title.includes('404'); if (!is404) { console.log('\nSUCCESS! Repository is accessible!'); // Get clone URL const cloneUrl = await page.locator('input[value*="git"]').first().inputValue().catch(() => ''); if (cloneUrl) { console.log('Clone URL:', cloneUrl); } } else { console.log('\nRepository still not accessible'); } console.log('\n=== CREDENTIALS ==='); console.log('Gitea URL: https://gitea.wellnua.com'); console.log('Username:', USERNAME); console.log('Password:', NEW_PASSWORD); console.log('Email: serter2069@gmail.com'); console.log('\n=== DONE ==='); });