MOBILE-3320 behat: Trigger change detection once

Doing it multiple times seems to cause some internal race conditions in Angular that result in flaky tests
main
Noel De Martin 2021-06-21 10:36:26 +02:00
parent e9bd8c7bbe
commit d614cf426d
1 changed files with 2 additions and 5 deletions

View File

@ -793,11 +793,8 @@ class behat_app extends behat_base {
new ExpectationException('Forced cron tasks in the app took too long to complete', $session)
);
// Trigger Angular change detection multiple times in case some changes have
// side-effects that result in further pending operations.
for ($ticks = 5; $ticks > 0; $ticks--) {
$session->executeScript($this->islegacy ? 'appRef.tick();' : 'changeDetector.detectChanges();');
}
// Trigger Angular change detection
$session->executeScript($this->islegacy ? 'appRef.tick();' : 'changeDetector.detectChanges();');
}
/**