e2ed
Version:
E2E testing framework over Playwright
22 lines (21 loc) • 864 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.waitForTimeout = void 0;
const internal_1 = require("../../constants/internal");
const step_1 = require("../../step");
const getDurationWithUnits_1 = require("../../utils/getDurationWithUnits");
const promise_1 = require("../../utils/promise");
/**
* Waits for timeout in `delayInMs` milliseconds.
*/
const waitForTimeout = async (delayInMs) => {
const delayWithUnits = (0, getDurationWithUnits_1.getDurationWithUnits)(delayInMs);
await (0, step_1.step)(`Wait for ${delayWithUnits}`, async () => {
await (0, promise_1.getTimeoutPromise)(delayInMs);
}, {
payload: { delayWithUnits },
timeout: delayInMs + internal_1.ADDITIONAL_STEP_TIMEOUT,
type: 7 /* LogEventType.InternalCore */,
});
};
exports.waitForTimeout = waitForTimeout;