@wordpress/e2e-test-utils
Version:
End-To-End (E2E) test utils for WordPress.
30 lines (28 loc) • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createNewTemplate = createNewTemplate;
var _openDocumentSettingsSidebar = require("./open-document-settings-sidebar");
var _clickButton = require("./click-button");
/**
* Internal dependencies
*/
/**
* Opens the template editor with a newly created template.
*
* @param {string} name Name of the template.
*/
async function createNewTemplate(name) {
await (0, _openDocumentSettingsSidebar.openDocumentSettingsSidebar)();
await (0, _clickButton.clickButton)('Page');
await page.click('button[aria-label^="Select template"]');
await page.waitForSelector('button[aria-label="Add template"]');
await page.click('button[aria-label="Add template"]');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.type(name);
await (0, _clickButton.clickButton)('Create');
await page.waitForSelector('iframe[name="editor-canvas"]');
}
//# sourceMappingURL=create-new-template.js.map