Skip to content

Commit

Permalink
Merge pull request #3908 from NoelDeMartin/MOBILE-3947
Browse files Browse the repository at this point in the history
MOBILE-3947 behat: Fix close popup step
  • Loading branch information
crazyserver authored Jan 23, 2024
2 parents 984e503 + ab0cff0 commit 9e22fb7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/testing/services/behat-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 9e22fb7

Please sign in to comment.