MOBILE-4616 behat: Fix split view selectors on behat
parent
b2691e8b3c
commit
038dfd1e59
|
@ -46,6 +46,7 @@ export class TestingBehatDomUtilsService {
|
||||||
isElementVisible(element: HTMLElement, container?: HTMLElement): boolean {
|
isElementVisible(element: HTMLElement, container?: HTMLElement): boolean {
|
||||||
if (element.getAttribute('aria-hidden') === 'true') {
|
if (element.getAttribute('aria-hidden') === 'true') {
|
||||||
if (
|
if (
|
||||||
|
element.tagName === 'ION-ROUTER-OUTLET' &&
|
||||||
element === document.body.querySelector('ion-app > ion-router-outlet') &&
|
element === document.body.querySelector('ion-app > ion-router-outlet') &&
|
||||||
(document.body.querySelector('ion-toast.hydrated:not(.overlay-hidden)') ||
|
(document.body.querySelector('ion-toast.hydrated:not(.overlay-hidden)') ||
|
||||||
!document.body.querySelector(
|
!document.body.querySelector(
|
||||||
|
@ -430,15 +431,13 @@ export class TestingBehatDomUtilsService {
|
||||||
if (!container.classList.contains('ion-page')) {
|
if (!container.classList.contains('ion-page')) {
|
||||||
return false;
|
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)'));
|
return true;
|
||||||
const topContainer = pageContainers.find((page) => !page.closest('.ion-page.ion-page-hidden')) ?? null;
|
}
|
||||||
|
|
||||||
splitViewContainer = (topContainer || container).querySelector<HTMLElement>(
|
return false;
|
||||||
'core-split-view ion-router-outlet',
|
|
||||||
);
|
|
||||||
|
|
||||||
return !!splitViewContainer;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return splitViewContainer ? [splitViewContainer] : [];
|
return splitViewContainer ? [splitViewContainer] : [];
|
||||||
|
|
Loading…
Reference in New Issue