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 during page.evaluate() in export test

LearningCircuit7ac4aef1bfd8
diff --git a/tests/ui_tests/test_export_functionality.js b/tests/ui_tests/test_export_functionality.js
index 2c2b4ef663..1e5ee12c15 100644
--- a/tests/ui_tests/test_export_functionality.js
+++ b/tests/ui_tests/test_export_functionality.js
@@ -165,19 +165,26 @@ async function createResearchAndWait(page) {
urlWithoutParams === `${BASE_URL}/`;
// If we stayed on home page, verify no error message is shown
+ // NOTE: Wrap in try-catch because page might navigate during evaluate()
+ // which causes "Execution context was destroyed" error
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();
+ try {
+ 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();
+ }
}
+ return null;
+ });
+ if (hasError) {
+ log(`⚠️ Error found on home page: ${hasError}`, 'warning');
+ // Don't fail - the export test can still check history page
}
- return null;
- });
- if (hasError) {
- log(`⚠️ Error found on home page: ${hasError}`, 'warning');
- // Don't fail - the export test can still check history page
+ } catch (evalErr) {
+ // Page navigated during evaluate - this is fine, research started
+ log(`ℹ️ Page navigated during check (research started)`, 'info');
}
}