(page, needle, status, timeout)
| 346 | |
| 347 | /** Warten, bis ein Zug zu dieser Frage diesen Zustand hat. */ |
| 348 | const waitForTurn = (page, needle, status, timeout) => |
| 349 | page.waitForFunction( |
| 350 | ({ needle: word, status: wanted }) => |
| 351 | (globalThis.__atlasChat?.turns ?? []).some( |
| 352 | (turn) => turn.question.includes(word) && turn.status === wanted, |
| 353 | ), |
| 354 | { needle, status }, |
| 355 | { timeout }, |
| 356 | ); |
| 357 | |
| 358 | const turnOf = (seam, needle) => |
| 359 | (seam?.turns ?? []).filter((turn) => turn.question.includes(needle)).slice(-1)[0]; |