Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix: handle navigation race condition in export test (#1797)

LearningCircuit5f9fc78e243b
diff --git a/tests/ui_tests/test_export_functionality.js b/tests/ui_tests/test_export_functionality.js
index 0995b5d6dd..85b2f53c5b 100644
--- a/tests/ui_tests/test_export_functionality.js
+++ b/tests/ui_tests/test_export_functionality.js
@@ -178,15 +178,21 @@ async function createResearchAndWait(page) {
// If we stayed on home page, check for error messages
if (stayedOnHomePage) {
- const hasError = await page.evaluate(() => {
- const errorElements = document.querySelectorAll('.alert-danger, .error-message, .toast-error');
- for (const el of errorElements) {
- if (el.textContent.trim()) {
- return el.textContent.trim();
+ let hasError = null;
+ try {
+ hasError = await page.evaluate(() => {
+ const errorElements = document.querySelectorAll('.alert-danger, .error-message, .toast-error');
+ for (const el of errorElements) {
+ if (el.textContent.trim()) {
+ return el.textContent.trim();
+ }
}
- }
- return null;
- });
+ return null;
+ });
+ } catch (evalErr) {
+ // Context can be destroyed if navigation happens mid-evaluate
+ log(`⚠️ Could not check for errors (${evalErr.message.substring(0, 50)}...), continuing...`, 'warning');
+ }
if (hasError) {
log(`⚠️ Error found on home page: ${hasError}`, 'warning');
// Don't fail - the export test can still check history page