修改登陆脚本,修改docker网络模式,如果ci成功准备删构建部分

This commit is contained in:
jiaojm
2025-11-20 15:18:39 +08:00
repo.diff.parent 15a471f247
repo.diff.commit 72dfb0aeaf
repo.diff.stats_desc%!(EXTRA int=2, int=11, int=9)

repo.diff.view_file

@@ -49,6 +49,8 @@ jobs:
sleep 30
- name: 3. Run E2E Tests
run: |
sed -i 's|network_mode: "${E2E_NETWORK_MODE:-bridge}"|network_mode: host|g' tests/e2e/docker-compose.yml
grep "network_mode" tests/e2e/docker-compose.yml
export E2E_NETWORK_MODE="host"
make e2e-test TARGET_URL="http://localhost:80" || true
env:

repo.diff.view_file

@@ -19,15 +19,15 @@ async function globalSetup(config: FullConfig) {
const url1=env.DEVSTAR_URL;
await page.goto(url1, { timeout: 15000 });
console.log('[GlobalSetup] 检测到安装界面!正在开始自动化安装...');
await page.getByText('Server and Third-Party Service Settings').click();
await page.getByRole('checkbox', { name: 'Enable user sign-in via Wechat QR Code.' }).uncheck();
await page.getByRole('checkbox', { name: 'Require a CAPTCHA for user' }).uncheck();
await page.getByText('Administrator Account Settings').click();
await page.getByRole('textbox', { name: 'Administrator Username' }).fill('testuser');
await page.getByRole('textbox', { name: 'Email Address' }).fill('ilovcatlyn750314@gmail.com');
await page.getByRole('textbox', { name: 'Password', exact: true }).fill('12345678');
await page.getByRole('textbox', { name: 'Confirm Password' }).fill('12345678');
await page.getByRole('button', { name: 'Install Gitea'}).click();
await page.getByText('服务器和第三方服务设置').click();
await page.getByRole('checkbox', { name: '启用通过 微信二维码 登录' }).uncheck();
await page.getByRole('checkbox', { name: '要求在用户注册时输入预验证码' }).uncheck();
await page.getByText('管理员帐号设置').click();
await page.getByRole('textbox', { name: '管理员用户名' }).fill('testuser');
await page.getByRole('textbox', { name: '邮箱地址' }).fill('ilovcatlyn750314@gmail.com');
await page.getByRole('textbox', { name: '管理员密码', exact: true }).fill('12345678');
await page.getByRole('textbox', { name: '确认密码' }).fill('12345678');
await page.getByRole('button', { name: '立即安装'}).click();
await page.waitForTimeout(90000);
} catch (error) {
console.error('[GlobalSetup] "URL 模式" 登录失败:', error);