UNPKG

testplane

Version:

Tests framework based on mocha and wdio

25 lines 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.cleanupPageAnimations = exports.disableIframeAnimations = void 0; const types_1 = require("../../isomorphic/types"); const iframe_1 = require("./iframe"); async function disableIframeAnimations(browser, screenshooter) { await (0, iframe_1.runInEachDisplayedIframe)(browser, async () => { const result = await screenshooter.call("disableFrameAnimations", []); if ((0, types_1.isBrowserSideError)(result)) { throw new Error(`Disable animations failed with error type '${result.errorCode}' and error message: ${result.message}`); } }); } exports.disableIframeAnimations = disableIframeAnimations; async function cleanupPageAnimations(browser, screenshooter, isWebdriverProtocol) { await screenshooter.call("cleanupFrameAnimations", []); // https://github.com/webdriverio/webdriverio/issues/11396 if (isWebdriverProtocol) { await (0, iframe_1.runInEachDisplayedIframe)(browser, async () => { await screenshooter.call("cleanupFrameAnimations", []); }); } } exports.cleanupPageAnimations = cleanupPageAnimations; //# sourceMappingURL=animations.js.map