From 69fca2f2698624cb8d3bfe057f5bb257df1b4aee Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Fri, 8 Mar 2024 12:09:14 +0100 Subject: [PATCH] MOBILE-3947 behat: Don't search elements in hidden containers --- src/testing/services/behat-dom.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/testing/services/behat-dom.ts b/src/testing/services/behat-dom.ts index 8d8fff76a..eda220953 100644 --- a/src/testing/services/behat-dom.ts +++ b/src/testing/services/behat-dom.ts @@ -376,6 +376,11 @@ export class TestingBehatDomUtilsService { containers = containers .filter(container => { + if (!this.isElementVisible(container)) { + // Ignore containers not visible. + return false; + } + if (container.tagName === 'ION-ALERT') { // For some reason, in Behat sometimes alerts aren't removed from DOM, the close animation doesn't finish. // Filter alerts with pointer-events none since that style is set before the close animation starts.