UNPKG

@wordpress/e2e-test-utils

Version:
27 lines (25 loc) 827 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getOption = getOption; var _switchUserToAdmin = require("./switch-user-to-admin"); var _visitAdminPage = require("./visit-admin-page"); var _switchUserToTest = require("./switch-user-to-test"); /** * Internal dependencies */ /** * Returns a site option, from the options admin page. * * @param {string} setting The option, used to get the option by id. * @return {string} The value of the option. */ async function getOption(setting) { await (0, _switchUserToAdmin.switchUserToAdmin)(); await (0, _visitAdminPage.visitAdminPage)('options.php'); const value = await page.$eval(`#${setting}`, element => element.value); await (0, _switchUserToTest.switchUserToTest)(); return value; } //# sourceMappingURL=get-option.js.map