testplane
Version:
Tests framework based on mocha and wdio
22 lines (20 loc) • 1.3 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.VerticalOverflowError = exports.getVerticalOverflowErrorMessage = void 0;
const getVerticalOverflowErrorMessage = (readableCaptureAreaDescr, captureArea, viewport) => {
return `Could not capture ${readableCaptureAreaDescr}, because it is larger than viewport height.
Tried to capture region: left=${captureArea.left}, top=${captureArea.top}, width=${captureArea.width}, height=${captureArea.height}
Viewport size: ${viewport.width}, ${viewport.height}
If you want to capture the entire area, set "compositeImage" option to true in the config file or assertView command options.
If you want to capture only the visible part and crop the rest, set "compositeImage" option to false and "allowViewportOverflow" to true.`;
};
exports.getVerticalOverflowErrorMessage = getVerticalOverflowErrorMessage;
class VerticalOverflowError extends Error {
constructor(readableCaptureAreaDescr, captureArea, viewport) {
const message = (0, exports.getVerticalOverflowErrorMessage)(readableCaptureAreaDescr, captureArea, viewport);
super(message);
this.name = this.constructor.name;
}
}
exports.VerticalOverflowError = VerticalOverflowError;
//# sourceMappingURL=vertical-overflow-error.js.map