From 3b5d57e02b53f60fca5d12f5270d6d86b5606db7 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 4 Oct 2021 17:13:40 +0200 Subject: [PATCH] MOBILE-3833 behat: use ngZone Using changeDetector caused some flaky tests throwing errors trying to use undefined variables. ngZone seems to work better. --- tests/behat/behat_app.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/behat/behat_app.php b/tests/behat/behat_app.php index 25c857562..54ebb3d91 100644 --- a/tests/behat/behat_app.php +++ b/tests/behat/behat_app.php @@ -849,7 +849,7 @@ class behat_app extends behat_base { ); // Trigger Angular change detection - $session->executeScript($this->islegacy ? 'appRef.tick();' : 'changeDetector.detectChanges();'); + $session->executeScript($this->islegacy ? 'appRef.tick();' : 'ngZone.run(() => {});'); } /** @@ -862,7 +862,7 @@ class behat_app extends behat_base { $this->spin( function() use ($session) { - $session->executeScript($this->islegacy ? 'appRef.tick();' : 'changeDetector.detectChanges();'); + $session->executeScript($this->islegacy ? 'appRef.tick();' : 'ngZone.run(() => {});'); $nodes = $this->find_all('css', 'core-loading ion-spinner');