diff --git a/.gitea/workflows/devstar-studio-e2e.yaml b/.gitea/workflows/devstar-studio-e2e.yaml index 9a6da86004..656a21f1af 100644 --- a/.gitea/workflows/devstar-studio-e2e.yaml +++ b/.gitea/workflows/devstar-studio-e2e.yaml @@ -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: diff --git a/tests/e2e/global-setup.ts b/tests/e2e/global-setup.ts index e144b1d154..706c036857 100644 --- a/tests/e2e/global-setup.ts +++ b/tests/e2e/global-setup.ts @@ -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);