mirror of
https://github.com/nasa/openmct.git
synced 2025-01-03 03:46:42 +00:00
413cb13edf
* extract zoom logic to functions and update test * Refactor other tests to use new button zoom fns * e2e:ci ++exampleImagery * try polling * try wait for animations * code review comments * fix syntax
19 lines
561 B
JavaScript
19 lines
561 B
JavaScript
/**
|
|
* Wait for all animations within the given element and subtrees to finish
|
|
* See: https://github.com/microsoft/playwright/issues/15660#issuecomment-1184911658
|
|
* @param {import('@playwright/test').Locator} locator
|
|
*/
|
|
function waitForAnimations(locator) {
|
|
return locator
|
|
.evaluate((element) =>
|
|
Promise.all(
|
|
element
|
|
.getAnimations({ subtree: true })
|
|
.map((animation) => animation.finished)));
|
|
}
|
|
|
|
// eslint-disable-next-line no-undef
|
|
module.exports = {
|
|
waitForAnimations
|
|
};
|