@wordpress/e2e-test-utils
Version:
End-To-End (E2E) test utils for WordPress.
24 lines (23 loc) • 826 B
JavaScript
/**
* Internal dependencies
*/
import { openDocumentSettingsSidebar } from './open-document-settings-sidebar';
import { clickButton } from './click-button';
/**
* Opens the template editor with a newly created template.
*
* @param {string} name Name of the template.
*/
export async function createNewTemplate(name) {
await openDocumentSettingsSidebar();
await 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 clickButton('Create');
await page.waitForSelector('iframe[name="editor-canvas"]');
}
//# sourceMappingURL=create-new-template.js.map