MOBILE-4616 behat: Fix split view selectors on behat

main
Pau Ferrer Ocaña 2024-08-24 00:10:40 +02:00
parent b2691e8b3c
commit 038dfd1e59
1 changed files with 6 additions and 7 deletions

View File

@ -46,6 +46,7 @@ export class TestingBehatDomUtilsService {
isElementVisible(element: HTMLElement, container?: HTMLElement): boolean {
if (element.getAttribute('aria-hidden') === 'true') {
if (
element.tagName === 'ION-ROUTER-OUTLET' &&
element === document.body.querySelector('ion-app > ion-router-outlet') &&
(document.body.querySelector('ion-toast.hydrated:not(.overlay-hidden)') ||
!document.body.querySelector(
@ -430,15 +431,13 @@ export class TestingBehatDomUtilsService {
if (!container.classList.contains('ion-page')) {
return false;
}
if (container.closest('ion-router-outlet.content-outlet')) {
splitViewContainer = container;
const pageContainers = Array.from(container.querySelectorAll<HTMLElement>('.ion-page:not(.ion-page-hidden)'));
const topContainer = pageContainers.find((page) => !page.closest('.ion-page.ion-page-hidden')) ?? null;
return true;
}
splitViewContainer = (topContainer || container).querySelector<HTMLElement>(
'core-split-view ion-router-outlet',
);
return !!splitViewContainer;
return false;
});
return splitViewContainer ? [splitViewContainer] : [];