fix: 修复豆包上传图片无法点击的问题 (ref #30, ref #41)

This commit is contained in:
foxhui
2026-04-05 03:53:52 +08:00
Unverified
parent cd7f805681
commit bf553005ef
2 changed files with 5 additions and 3 deletions
+1
View File
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### 🐛 Fixed
- **适配器**
- 修复 Gemini 文本适配器遇到长提示词的时候无法选择模型的问题
- 修复豆包上传图片无法点击的问题
## [3.6.2] - 2025-03-31
+4 -3
View File
@@ -55,7 +55,9 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) {
await sleep(300, 500);
// 给予 1 秒的缓冲时间等待 React 渲染按钮
const modelSelectorBtn = page.locator('button[aria-haspopup="menu"]:visible:has([data-testid="deep-thinking-action-button"], [data-testid="mode-select-action-button"])').first();
const modelSelectorBtn = page.locator('button[aria-haspopup="menu"]')
.filter({ has: page.locator('[data-testid="deep-thinking-action-button"], [data-testid="mode-select-action-button"]') })
.first();
let selectorExists = false;
try {
await modelSelectorBtn.waitFor({ state: 'attached', timeout: 1000 });
@@ -98,8 +100,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) {
// 点击上传菜单按钮
const uploadMenuBtn = page.locator('#input-engine-container button[aria-haspopup="menu"]')
.filter({ hasNot: page.locator('[data-testid="deep-thinking-action-button"], [data-testid="mode-select-action-button"]') })
.first()
.locator('button');
.first();
await safeClick(page, uploadMenuBtn, { bias: 'button' });
await sleep(300, 500);