UNPKG

@wordpress/e2e-test-utils

Version:
44 lines (43 loc) 1.81 kB
var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var uninstall_plugin_exports = {}; __export(uninstall_plugin_exports, { uninstallPlugin: () => uninstallPlugin }); module.exports = __toCommonJS(uninstall_plugin_exports); var import_switch_user_to_admin = require("./switch-user-to-admin"); var import_switch_user_to_test = require("./switch-user-to-test"); var import_visit_admin_page = require("./visit-admin-page"); async function uninstallPlugin(slug) { await (0, import_switch_user_to_admin.switchUserToAdmin)(); await (0, import_visit_admin_page.visitAdminPage)("plugins.php"); const confirmPromise = new Promise((resolve) => { page.once("dialog", () => resolve()); }); await Promise.all([ confirmPromise, page.click(`tr[data-slug="${slug}"] .delete a`) ]); await page.waitForSelector(`tr[data-slug="${slug}"].deleted`); await (0, import_switch_user_to_test.switchUserToTest)(); } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { uninstallPlugin }); //# sourceMappingURL=uninstall-plugin.js.map