@o3r/testing
Version:
The module provides testing (e2e, unit test) utilities to help you build your own E2E pipeline integrating visual testing.
100 lines • 5.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.O3rComponentFixture = void 0;
var index_1 = require("../errors/index");
/**
* Mock for Component fixture class.
* This class is used for fixture compilation purpose.
*/
var O3rComponentFixture = /** @class */ (function () {
function O3rComponentFixture(_element) {
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
}
/**
* Throws an exception if the element is undefined.
* Otherwise returns the element.
* @param _element ElementProfile to test
* @param _timeout specific timeout that will throw when reach
*/
O3rComponentFixture.prototype.throwOnUndefinedElement = function (_element, _timeout) {
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
};
/**
* Throws an exception if the element is undefined.
* Otherwise returns the element.
* @param _element ElementProfile to test
* @param _timeout specific timeout that will throw when reach
*/
O3rComponentFixture.prototype.throwOnUndefined = function (_element, _timeout) {
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
};
O3rComponentFixture.prototype.queryWithOptions = function (_selector, _elementConstructor, _options) {
if (_options === void 0) { _options = {}; }
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
};
/**
* Get text from the element associated to the given selector, or undefined if the element is not found or not visible
* @param _selector Selector to access the element
* @param _options Options supported
* @param _options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
* @param _options.index index Select the element associated to the index
* @param _options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present
* @param _options.timeout Duration to wait for the element to be present before it throws
*/
O3rComponentFixture.prototype.getText = function (_selector, _options) {
if (_options === void 0) { _options = {}; }
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
};
/**
* Check if the element associated to the given selector is visible
* @param _selector Selector to access the element
* @param _options Options supported
* @param _options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
* @param _options.index index Select the element associated to the index
* @param _options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present
* @param _options.timeout Duration to wait for the element to be present before it throws
*/
O3rComponentFixture.prototype.isVisible = function (_selector, _options) {
if (_options === void 0) { _options = {}; }
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
};
/**
* Click on the element associated to the given selector if it exists and is visible
* @param _selector Selector to access the element
* @param _options Options supported
* @param _options.elementConstructor Constructor that will be used to create the Element, defaults to O3rElement
* @param _options.index index Select the element associated to the index
* @param _options.shouldThrowIfNotPresent If set to true the function will throw if the element is not present
* @param _options.timeout Duration to wait for the element to be present before it throws
*/
O3rComponentFixture.prototype.click = function (_selector, _options) {
if (_options === void 0) { _options = {}; }
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
};
/** @inheritdoc */
O3rComponentFixture.prototype.query = function (_selector, _returnType) {
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
};
/** @inheritdoc */
O3rComponentFixture.prototype.queryAll = function (_selector, _returnType, _groupType, _timeout) {
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
};
/** @inheritdoc */
O3rComponentFixture.prototype.getElement = function () {
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
};
/** @inheritdoc */
O3rComponentFixture.prototype.getSubComponents = function () {
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
};
/** @inheritDoc */
O3rComponentFixture.prototype.queryNotPresent = function (_selector, _timeout) {
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
};
O3rComponentFixture.prototype.queryNth = function (_selector, _index, _returnType) {
throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation');
};
return O3rComponentFixture;
}());
exports.O3rComponentFixture = O3rComponentFixture;
//# sourceMappingURL=component-fixture.js.map