UNPKG

cypress-cucumber-steps

Version:
39 lines 1.28 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.When_I_find_closest_element = When_I_find_closest_element; var cypress_cucumber_preprocessor_1 = require("@badeball/cypress-cucumber-preprocessor"); var utils_1 = require("../utils"); /** * When I find closest element: * * ```gherkin * When I find closest element {string} * ``` * * Get the first DOM element that matches the selector (whether it be itself or one of its ancestors). * * The querying behavior matches exactly how [`.closest()`](https://api.jquery.com/closest/) works in jQuery. * * @example * * Find the closest element with the class `banner`: * * ```gherkin * When I find closest element ".banner" * ``` * * @remarks * * A preceding step like {@link When_I_find_element_by_label_text | "When I find element by label text"} is required. For example: * * ```gherkin * When I find element by label text "Text" * And I find closest element "form" * And I submit * ``` */ function When_I_find_closest_element(selector) { (0, utils_1.setCypressElement)((0, utils_1.getCypressElement)().closest(selector)); } (0, cypress_cucumber_preprocessor_1.When)('I find closest element {string}', When_I_find_closest_element); //# sourceMappingURL=closest.js.map