Merge pull request #3908 from NoelDeMartin/MOBILE-3947

MOBILE-3947 behat: Fix close popup step
main
Pau Ferrer Ocaña 2024-01-23 11:45:31 +01:00 committed by GitHub
commit 9e22fb7d1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 4 deletions

View File

@ -190,10 +190,15 @@ export class TestingBehatRuntimeService {
closePopup(): string {
this.log('Action - Close popup');
const backdrops = Array
.from(document.querySelectorAll('ion-popover, ion-modal'))
.map(popover => popover.shadowRoot?.querySelector('ion-backdrop'))
.filter(backdrop => !!backdrop);
const backdrops = [
...Array
.from(document.querySelectorAll('ion-popover, ion-modal'))
.map(popover => popover.shadowRoot?.querySelector('ion-backdrop'))
.filter(backdrop => !!backdrop),
...Array
.from(document.querySelectorAll('ion-backdrop'))
.filter(backdrop => !!backdrop.offsetParent),
];
if (!backdrops.length) {
return 'ERROR: Could not find backdrop';