From 9cb941d09d6b2da4a9610cee693909c6410bd0bc Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Sat, 25 Mar 2023 12:18:33 +0000 Subject: [PATCH 1/3] fix Javascript world error --- test/source/browser/controllable.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/source/browser/controllable.ts b/test/source/browser/controllable.ts index 0750b44fd43..bad9d4f8bf4 100644 --- a/test/source/browser/controllable.ts +++ b/test/source/browser/controllable.ts @@ -330,9 +330,12 @@ abstract class ControllableBase { } catch (e) { this.log(`wait_and_click(i${i}):6:err(${String(e)}):${selector}`); if ( - e.message === 'Node is either not visible or not an HTMLElement' || - e.message === 'Node is either not clickable or not an HTMLElement' || - e.message === 'Node is detached from document' + [ + 'Node is either not visible or not an HTMLElement', + 'Node is either not clickable or not an HTMLElement', + 'Node is detached from document', + 'Argument should belong to the same JavaScript world as target object', + ].includes(e.message) ) { // maybe the node just re-rendered? if (!retryErrs || i === 3) { From 016950c3027a48c0f435088c950e61a064147080 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Sat, 25 Mar 2023 12:41:50 +0000 Subject: [PATCH 2/3] try #2 --- test/source/browser/controllable.ts | 9 +++------ test/source/tests/page-recipe/oauth-page-recipe.ts | 1 + 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/source/browser/controllable.ts b/test/source/browser/controllable.ts index bad9d4f8bf4..a4ae4184edb 100644 --- a/test/source/browser/controllable.ts +++ b/test/source/browser/controllable.ts @@ -330,12 +330,9 @@ abstract class ControllableBase { } catch (e) { this.log(`wait_and_click(i${i}):6:err(${String(e)}):${selector}`); if ( - [ - 'Node is either not visible or not an HTMLElement', - 'Node is either not clickable or not an HTMLElement', - 'Node is detached from document', - 'Argument should belong to the same JavaScript world as target object', - ].includes(e.message) + ['Node is either not visible or not an HTMLElement', 'Node is either not clickable or not an HTMLElement', 'Node is detached from document'].includes( + e.message + ) ) { // maybe the node just re-rendered? if (!retryErrs || i === 3) { diff --git a/test/source/tests/page-recipe/oauth-page-recipe.ts b/test/source/tests/page-recipe/oauth-page-recipe.ts index c3e13e2ab74..f9016531617 100644 --- a/test/source/tests/page-recipe/oauth-page-recipe.ts +++ b/test/source/tests/page-recipe/oauth-page-recipe.ts @@ -126,6 +126,7 @@ export class OauthPageRecipe extends PageRecipe { // no need to await the API call because it's not crucial to always save it, can mostly skip errors if (action === 'close') { await oauthPage.close(); + return; } else if (action === 'deny') { throw new Error('tests.handle_gmail_oauth options.deny.true not implemented'); } else { From 6e38289db3b7ab6974c29e9d2d06e261160ee5cb Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Sat, 25 Mar 2023 12:49:30 +0000 Subject: [PATCH 3/3] try number 3 --- test/source/tests/page-recipe/oauth-page-recipe.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/source/tests/page-recipe/oauth-page-recipe.ts b/test/source/tests/page-recipe/oauth-page-recipe.ts index f9016531617..734654180cc 100644 --- a/test/source/tests/page-recipe/oauth-page-recipe.ts +++ b/test/source/tests/page-recipe/oauth-page-recipe.ts @@ -126,7 +126,6 @@ export class OauthPageRecipe extends PageRecipe { // no need to await the API call because it's not crucial to always save it, can mostly skip errors if (action === 'close') { await oauthPage.close(); - return; } else if (action === 'deny') { throw new Error('tests.handle_gmail_oauth options.deny.true not implemented'); } else { @@ -134,7 +133,11 @@ export class OauthPageRecipe extends PageRecipe { } } catch (e) { const eStr = String(e); - if (!eStr.includes('Execution context was destroyed') && !eStr.includes('Cannot find context with specified id')) { + if ( + !eStr.includes('Execution context was destroyed') && + !eStr.includes('Cannot find context with specified id') && + !eStr.includes('Argument should belong to the same JavaScript world as target object') + ) { throw e; // not a known retriable error } // t.log(`Attempting to retry google auth:${action} on the same window for ${email} because: ${eStr}`);