mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-05 18:20:39 -08:00
test: increase timeout in CI
This commit is contained in:
parent
160179ee2a
commit
eff8583a01
2 changed files with 12 additions and 6 deletions
|
|
@ -58,7 +58,6 @@ Feature: Agent Workflow - Tool Usage and Multi-Round Conversation
|
||||||
When I click on a "message input textarea" element with selector "[data-testid='agent-message-input']"
|
When I click on a "message input textarea" element with selector "[data-testid='agent-message-input']"
|
||||||
When I type "在 wiki 里创建一个新笔记,内容为 test" in "chat input" element with selector "[data-testid='agent-message-input']"
|
When I type "在 wiki 里创建一个新笔记,内容为 test" in "chat input" element with selector "[data-testid='agent-message-input']"
|
||||||
And I press "Enter" key
|
And I press "Enter" key
|
||||||
And I wait for 0.2 seconds
|
|
||||||
Then I should see 6 messages in chat history
|
Then I should see 6 messages in chat history
|
||||||
# Verify there's an error message about workspace not found (in one of the middle messages)
|
# Verify there's an error message about workspace not found (in one of the middle messages)
|
||||||
And I should see a "workspace not exist error" element with selector "[data-testid='message-bubble']:has-text('default'):has-text('不存在')"
|
And I should see a "workspace not exist error" element with selector "[data-testid='message-bubble']:has-text('default'):has-text('不存在')"
|
||||||
|
|
|
||||||
|
|
@ -115,11 +115,18 @@ Then('I should see {int} messages in chat history', async function(this: Applica
|
||||||
const messageSelector = '[data-testid="message-bubble"]';
|
const messageSelector = '[data-testid="message-bubble"]';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
// Adjust timeouts and attempts for CI vs local runs
|
||||||
|
const isCI = Boolean(process.env.CI);
|
||||||
|
const selectorTimeout = isCI ? 15000 : 5000; // wait longer in CI for selector
|
||||||
|
const waitTimeout = isCI ? 5000 : 2000; // wait between attempts
|
||||||
|
const attemptsMultiplier = isCI ? 5 : 3;
|
||||||
|
|
||||||
// Wait for messages to reach expected count, checking periodically for streaming
|
// Wait for messages to reach expected count, checking periodically for streaming
|
||||||
for (let attempt = 1; attempt <= expectedCount * 3; attempt++) {
|
const maxAttempts = Math.max(3, expectedCount * attemptsMultiplier);
|
||||||
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
||||||
try {
|
try {
|
||||||
// Wait for at least one message to exist
|
// Wait for at least one message to exist
|
||||||
await currentWindow.waitForSelector(messageSelector, { timeout: 5000 });
|
await currentWindow.waitForSelector(messageSelector, { timeout: selectorTimeout });
|
||||||
|
|
||||||
// Count current messages
|
// Count current messages
|
||||||
const messages = currentWindow.locator(messageSelector);
|
const messages = currentWindow.locator(messageSelector);
|
||||||
|
|
@ -132,11 +139,11 @@ Then('I should see {int} messages in chat history', async function(this: Applica
|
||||||
}
|
}
|
||||||
|
|
||||||
// If not enough messages yet, wait a bit more for streaming
|
// If not enough messages yet, wait a bit more for streaming
|
||||||
if (attempt < expectedCount * 3) {
|
if (attempt < maxAttempts) {
|
||||||
await currentWindow.waitForTimeout(2000);
|
await currentWindow.waitForTimeout(waitTimeout);
|
||||||
}
|
}
|
||||||
} catch (timeoutError) {
|
} catch (timeoutError) {
|
||||||
if (attempt === expectedCount * 3) {
|
if (attempt === maxAttempts) {
|
||||||
throw timeoutError;
|
throw timeoutError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue