UNPKG

@o3r/testing

Version:

The module provides testing (e2e, unit test) utilities to help you build your own E2E pipeline integrating visual testing.

95 lines 4.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.O3rComponentFixture = void 0; const index_1 = require("../errors/index"); /** * Mock for Component fixture class. * This class is used for fixture compilation purpose. */ class O3rComponentFixture { constructor(_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 */ throwOnUndefinedElement(_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 */ throwOnUndefined(_element, _timeout) { throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation'); } queryWithOptions(_selector, _elementConstructor, _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 */ getText(_selector, _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 */ isVisible(_selector, _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 */ click(_selector, _options = {}) { throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation'); } /** @inheritdoc */ query(_selector, _returnType) { throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation'); } /** @inheritdoc */ queryAll(_selector, _returnType, _groupType, _timeout) { throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation'); } /** @inheritdoc */ getElement() { throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation'); } /** @inheritdoc */ getSubComponents() { throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation'); } /** @inheritDoc */ queryNotPresent(_selector, _timeout) { throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation'); } queryNth(_selector, _index, _returnType) { throw new index_1.TranspilationPurposeOnlyError('Should target a proper implementation'); } } exports.O3rComponentFixture = O3rComponentFixture; //# sourceMappingURL=component-fixture.js.map