UNPKG

@wordpress/e2e-test-utils

Version:
24 lines (22 loc) 710 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.switchUserToAdmin = switchUserToAdmin; var _getCurrentUser = require("./get-current-user"); var _loginUser = require("./login-user"); var _config = require("./shared/config"); /** * Internal dependencies */ /** * Switches the current user to the admin user (if the user * running the test is not already the admin user). */ async function switchUserToAdmin() { if ((await (0, _getCurrentUser.getCurrentUser)()) === _config.WP_ADMIN_USER.username) { return; } await (0, _loginUser.loginUser)(_config.WP_ADMIN_USER.username, _config.WP_ADMIN_USER.password); } //# sourceMappingURL=switch-user-to-admin.js.map