UNPKG

playwright-pom-materials

Version:

Playwright POM materials

34 lines (33 loc) 1.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RetryAttemptOptionsDefault = exports.RetryUntilTimeoutOptionsDefault = void 0; class RetryOptionsDefaultBase { constructor(base) { this.base = base; } asObject() { return Object.assign({}, this.base); } } class RetryUntilTimeoutOptionsDefault extends RetryOptionsDefaultBase { constructor(timeoutFn, intervalFn, base) { super(base); this.timeoutFn = timeoutFn; this.intervalFn = intervalFn; } asObject() { return Object.assign(Object.assign({}, super.asObject()), { timeout: this.timeoutFn(), interval: this.intervalFn() }); } } exports.RetryUntilTimeoutOptionsDefault = RetryUntilTimeoutOptionsDefault; class RetryAttemptOptionsDefault extends RetryOptionsDefaultBase { constructor(maxAttemptsFn, intervalFn, base) { super(base); this.maxAttemptsFn = maxAttemptsFn; this.intervalFn = intervalFn; } asObject() { return Object.assign(Object.assign({}, super.asObject()), { maxAttempts: this.maxAttemptsFn(), interval: this.intervalFn() }); } } exports.RetryAttemptOptionsDefault = RetryAttemptOptionsDefault;