From d7593ab5c1347aee0306e472fd1ec29b599c4554 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Thu, 6 May 2021 13:06:25 +0200 Subject: [PATCH] MOBILE-3320 runtime: Ignore invalid nodes in find --- tests/behat/app_behat_runtime.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/behat/app_behat_runtime.js b/tests/behat/app_behat_runtime.js index 9a0e4bff2..1a244c42f 100644 --- a/tests/behat/app_behat_runtime.js +++ b/tests/behat/app_behat_runtime.js @@ -292,7 +292,13 @@ if (currentNode.shadowRoot) { for (const childNode of currentNode.shadowRoot.childNodes) { - if (!childNode) { + if ( + !(childNode instanceof HTMLElement) || ( + childNode instanceof HTMLStyleElement || + childNode instanceof HTMLLinkElement || + childNode instanceof HTMLScriptElement + ) + ) { continue; }