Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add iWaitForTheBatchProcessToFinish detecting when the batch process is finished #104

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/behat/bootstrap/TideCommonTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,17 @@ public function findMenuItemMatchingText(string $text): void {
}
}

/**
* Wait for the Batch API to finish.
*
* Wait until the id="updateprogress" element is gone,
* or timeout after the given duration.
*
* @Given /^I wait for the batch process to finish for (\d+) seconds$/
*/
public function iWaitForTheBatchProcessToFinish(int $seconds): void {
$durationInMilliseconds = $seconds * 1000;
$this->getSession()->wait($durationInMilliseconds, 'jQuery("#updateprogress").length === 0');
}

}