UNPKG

@serenity-js/web

Version:

Serenity/JS Screenplay Pattern library offering a flexible, web driver-agnostic approach for interacting with web-based user interfaces and components, suitable for various testing contexts

26 lines 1.44 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isActive = isActive; const assertions_1 = require("@serenity-js/assertions"); const core_1 = require("@serenity-js/core"); const isElementActive = core_1.Expectation.define('isActive', 'become active', (actual) => actual.isActive()); /** * [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) that an element is "active", which means it resolves to `true` when: * - the element [is present](https://serenity-js.org/api/assertions/function/isPresent/) in the [DOM](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model) * - [`PageElement.isActive`](https://serenity-js.org/api/web/class/PageElement/#isActive) resolves to `true` * * If the above conditions are not met, the expectation resolves to `false`. * * ## Learn more * - [`PageElement.isActive`](https://serenity-js.org/api/web/class/PageElement/#isActive) * - [`Expectation`](https://serenity-js.org/api/core/class/Expectation/) * - [`Check`](https://serenity-js.org/api/core/class/Check/) * - [`Ensure`](https://serenity-js.org/api/assertions/class/Ensure/) * - [`Wait`](https://serenity-js.org/api/core/class/Wait/) * * @group Expectations */ function isActive() { return core_1.Expectation.to('become active').soThatActual((0, assertions_1.and)((0, assertions_1.isPresent)(), isElementActive())); } //# sourceMappingURL=isActive.js.map