@wordpress/e2e-test-utils-playwright 1.36.1-next.738bb1424.0 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/admin/create-new-post.js +48 -28
- package/build/admin/create-new-post.js.map +7 -1
- package/build/admin/edit-post.js +37 -17
- package/build/admin/edit-post.js.map +7 -1
- package/build/admin/get-page-error.js +33 -23
- package/build/admin/get-page-error.js.map +7 -1
- package/build/admin/index.js +58 -36
- package/build/admin/index.js.map +7 -1
- package/build/admin/visit-admin-page.js +44 -29
- package/build/admin/visit-admin-page.js.map +7 -1
- package/build/admin/visit-site-editor.js +73 -64
- package/build/admin/visit-site-editor.js.map +7 -1
- package/build/config.js +43 -11
- package/build/config.js.map +7 -1
- package/build/editor/click-block-options-menu-item.js +31 -14
- package/build/editor/click-block-options-menu-item.js.map +7 -1
- package/build/editor/click-block-toolbar-button.js +35 -13
- package/build/editor/click-block-toolbar-button.js.map +7 -1
- package/build/editor/get-blocks.js +61 -43
- package/build/editor/get-blocks.js.map +7 -1
- package/build/editor/get-edited-post-content.js +33 -12
- package/build/editor/get-edited-post-content.js.map +7 -1
- package/build/editor/index.js +96 -74
- package/build/editor/index.js.map +7 -1
- package/build/editor/insert-block.js +52 -21
- package/build/editor/insert-block.js.map +7 -1
- package/build/editor/open-document-settings-sidebar.js +39 -24
- package/build/editor/open-document-settings-sidebar.js.map +7 -1
- package/build/editor/preview.js +39 -18
- package/build/editor/preview.js.map +7 -1
- package/build/editor/publish-post.js +44 -42
- package/build/editor/publish-post.js.map +7 -1
- package/build/editor/save-draft.js +31 -15
- package/build/editor/save-draft.js.map +7 -1
- package/build/editor/select-blocks.js +48 -25
- package/build/editor/select-blocks.js.map +7 -1
- package/build/editor/set-content.js +36 -14
- package/build/editor/set-content.js.map +7 -1
- package/build/editor/set-is-fixed-toolbar.js +33 -15
- package/build/editor/set-is-fixed-toolbar.js.map +7 -1
- package/build/editor/set-preferences.js +40 -18
- package/build/editor/set-preferences.js.map +7 -1
- package/build/editor/show-block-toolbar.js +32 -16
- package/build/editor/show-block-toolbar.js.map +7 -1
- package/build/editor/site-editor.js +48 -41
- package/build/editor/site-editor.js.map +7 -1
- package/build/editor/switch-editor-tool.js +44 -30
- package/build/editor/switch-editor-tool.js.map +7 -1
- package/build/editor/switch-to-legacy-canvas.js +35 -14
- package/build/editor/switch-to-legacy-canvas.js.map +7 -1
- package/build/editor/transform-block-to.js +43 -21
- package/build/editor/transform-block-to.js.map +7 -1
- package/build/index.js +53 -18
- package/build/index.js.map +7 -1
- package/build/lighthouse/index.js +93 -55
- package/build/lighthouse/index.js.map +7 -1
- package/build/metrics/index.js +302 -251
- package/build/metrics/index.js.map +7 -1
- package/build/page-utils/drag-files.js +136 -112
- package/build/page-utils/drag-files.js.map +7 -1
- package/build/page-utils/emulate-network-conditions.js +95 -67
- package/build/page-utils/emulate-network-conditions.js.map +7 -1
- package/build/page-utils/index.js +58 -36
- package/build/page-utils/index.js.map +7 -1
- package/build/page-utils/is-current-url.js +33 -18
- package/build/page-utils/is-current-url.js.map +7 -1
- package/build/page-utils/keycodes.js +53 -39
- package/build/page-utils/keycodes.js.map +7 -1
- package/build/page-utils/press-keys.js +153 -130
- package/build/page-utils/press-keys.js.map +7 -1
- package/build/page-utils/set-browser-viewport.js +35 -42
- package/build/page-utils/set-browser-viewport.js.map +7 -1
- package/build/request-utils/blocks.js +51 -40
- package/build/request-utils/blocks.js.map +7 -1
- package/build/request-utils/comments.js +59 -45
- package/build/request-utils/comments.js.map +7 -1
- package/build/request-utils/gutenberg-experiments.js +63 -38
- package/build/request-utils/gutenberg-experiments.js.map +7 -1
- package/build/request-utils/index.js +191 -155
- package/build/request-utils/index.js.map +7 -1
- package/build/request-utils/login.js +45 -18
- package/build/request-utils/login.js.map +7 -1
- package/build/request-utils/media.js +74 -64
- package/build/request-utils/media.js.map +7 -1
- package/build/request-utils/menus.js +121 -109
- package/build/request-utils/menus.js.map +7 -1
- package/build/request-utils/pages.js +63 -50
- package/build/request-utils/pages.js.map +7 -1
- package/build/request-utils/patterns.js +41 -24
- package/build/request-utils/patterns.js.map +7 -1
- package/build/request-utils/plugins.js +70 -74
- package/build/request-utils/plugins.js.map +7 -1
- package/build/request-utils/posts.js +55 -41
- package/build/request-utils/posts.js.map +7 -1
- package/build/request-utils/preferences.js +38 -17
- package/build/request-utils/preferences.js.map +7 -1
- package/build/request-utils/rest.js +155 -129
- package/build/request-utils/rest.js.map +7 -1
- package/build/request-utils/site-settings.js +40 -28
- package/build/request-utils/site-settings.js.map +7 -1
- package/build/request-utils/templates.js +60 -46
- package/build/request-utils/templates.js.map +7 -1
- package/build/request-utils/themes.js +80 -53
- package/build/request-utils/themes.js.map +7 -1
- package/build/request-utils/users.js +74 -72
- package/build/request-utils/users.js.map +7 -1
- package/build/request-utils/widgets.js +73 -55
- package/build/request-utils/widgets.js.map +7 -1
- package/build/test.js +130 -146
- package/build/test.js.map +7 -1
- package/build/types.js +18 -2
- package/build/types.js.map +7 -1
- package/build-types/index.d.ts +1 -1
- package/build-types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/build/admin/create-new-post.cjs +0 -51
- package/build/admin/create-new-post.cjs.map +0 -7
- package/build/admin/edit-post.cjs +0 -40
- package/build/admin/edit-post.cjs.map +0 -7
- package/build/admin/get-page-error.cjs +0 -36
- package/build/admin/get-page-error.cjs.map +0 -7
- package/build/admin/index.cjs +0 -59
- package/build/admin/index.cjs.map +0 -7
- package/build/admin/visit-admin-page.cjs +0 -47
- package/build/admin/visit-admin-page.cjs.map +0 -7
- package/build/admin/visit-site-editor.cjs +0 -77
- package/build/admin/visit-site-editor.cjs.map +0 -7
- package/build/config.cjs +0 -45
- package/build/config.cjs.map +0 -7
- package/build/editor/click-block-options-menu-item.cjs +0 -34
- package/build/editor/click-block-options-menu-item.cjs.map +0 -7
- package/build/editor/click-block-toolbar-button.cjs +0 -38
- package/build/editor/click-block-toolbar-button.cjs.map +0 -7
- package/build/editor/get-blocks.cjs +0 -64
- package/build/editor/get-blocks.cjs.map +0 -7
- package/build/editor/get-edited-post-content.cjs +0 -36
- package/build/editor/get-edited-post-content.cjs.map +0 -7
- package/build/editor/index.cjs +0 -97
- package/build/editor/index.cjs.map +0 -7
- package/build/editor/insert-block.cjs +0 -55
- package/build/editor/insert-block.cjs.map +0 -7
- package/build/editor/open-document-settings-sidebar.cjs +0 -42
- package/build/editor/open-document-settings-sidebar.cjs.map +0 -7
- package/build/editor/preview.cjs +0 -42
- package/build/editor/preview.cjs.map +0 -7
- package/build/editor/publish-post.cjs +0 -47
- package/build/editor/publish-post.cjs.map +0 -7
- package/build/editor/save-draft.cjs +0 -34
- package/build/editor/save-draft.cjs.map +0 -7
- package/build/editor/select-blocks.cjs +0 -51
- package/build/editor/select-blocks.cjs.map +0 -7
- package/build/editor/set-content.cjs +0 -39
- package/build/editor/set-content.cjs.map +0 -7
- package/build/editor/set-is-fixed-toolbar.cjs +0 -36
- package/build/editor/set-is-fixed-toolbar.cjs.map +0 -7
- package/build/editor/set-preferences.cjs +0 -43
- package/build/editor/set-preferences.cjs.map +0 -7
- package/build/editor/show-block-toolbar.cjs +0 -35
- package/build/editor/show-block-toolbar.cjs.map +0 -7
- package/build/editor/site-editor.cjs +0 -51
- package/build/editor/site-editor.cjs.map +0 -7
- package/build/editor/switch-editor-tool.cjs +0 -47
- package/build/editor/switch-editor-tool.cjs.map +0 -7
- package/build/editor/switch-to-legacy-canvas.cjs +0 -39
- package/build/editor/switch-to-legacy-canvas.cjs.map +0 -7
- package/build/editor/transform-block-to.cjs +0 -46
- package/build/editor/transform-block-to.cjs.map +0 -7
- package/build/index.cjs +0 -51
- package/build/index.cjs.map +0 -7
- package/build/lighthouse/index.cjs +0 -96
- package/build/lighthouse/index.cjs.map +0 -7
- package/build/metrics/index.cjs +0 -309
- package/build/metrics/index.cjs.map +0 -7
- package/build/page-utils/drag-files.cjs +0 -143
- package/build/page-utils/drag-files.cjs.map +0 -7
- package/build/page-utils/emulate-network-conditions.cjs +0 -99
- package/build/page-utils/emulate-network-conditions.cjs.map +0 -7
- package/build/page-utils/index.cjs +0 -59
- package/build/page-utils/index.cjs.map +0 -7
- package/build/page-utils/is-current-url.cjs +0 -36
- package/build/page-utils/is-current-url.cjs.map +0 -7
- package/build/page-utils/keycodes.cjs +0 -55
- package/build/page-utils/keycodes.cjs.map +0 -7
- package/build/page-utils/press-keys.cjs +0 -165
- package/build/page-utils/press-keys.cjs.map +0 -7
- package/build/page-utils/set-browser-viewport.cjs +0 -39
- package/build/page-utils/set-browser-viewport.cjs.map +0 -7
- package/build/request-utils/blocks.cjs +0 -56
- package/build/request-utils/blocks.cjs.map +0 -7
- package/build/request-utils/comments.cjs +0 -66
- package/build/request-utils/comments.cjs.map +0 -7
- package/build/request-utils/gutenberg-experiments.cjs +0 -66
- package/build/request-utils/gutenberg-experiments.cjs.map +0 -7
- package/build/request-utils/index.cjs +0 -194
- package/build/request-utils/index.cjs.map +0 -7
- package/build/request-utils/login.cjs +0 -48
- package/build/request-utils/login.cjs.map +0 -7
- package/build/request-utils/media.cjs +0 -83
- package/build/request-utils/media.cjs.map +0 -7
- package/build/request-utils/menus.cjs +0 -132
- package/build/request-utils/menus.cjs.map +0 -7
- package/build/request-utils/pages.cjs +0 -71
- package/build/request-utils/pages.cjs.map +0 -7
- package/build/request-utils/patterns.cjs +0 -44
- package/build/request-utils/patterns.cjs.map +0 -7
- package/build/request-utils/plugins.cjs +0 -81
- package/build/request-utils/plugins.cjs.map +0 -7
- package/build/request-utils/posts.cjs +0 -61
- package/build/request-utils/posts.cjs.map +0 -7
- package/build/request-utils/preferences.cjs +0 -41
- package/build/request-utils/preferences.cjs.map +0 -7
- package/build/request-utils/rest.cjs +0 -174
- package/build/request-utils/rest.cjs.map +0 -7
- package/build/request-utils/site-settings.cjs +0 -45
- package/build/request-utils/site-settings.cjs.map +0 -7
- package/build/request-utils/templates.cjs +0 -68
- package/build/request-utils/templates.cjs.map +0 -7
- package/build/request-utils/themes.cjs +0 -89
- package/build/request-utils/themes.cjs.map +0 -7
- package/build/request-utils/users.cjs +0 -83
- package/build/request-utils/users.cjs.map +0 -7
- package/build/request-utils/widgets.cjs +0 -79
- package/build/request-utils/widgets.cjs.map +0 -7
- package/build/test.cjs +0 -136
- package/build/test.cjs.map +0 -7
- package/build/types.cjs +0 -19
- package/build/types.cjs.map +0 -7
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/open-document-settings-sidebar.ts
|
|
21
|
-
var open_document_settings_sidebar_exports = {};
|
|
22
|
-
__export(open_document_settings_sidebar_exports, {
|
|
23
|
-
openDocumentSettingsSidebar: () => openDocumentSettingsSidebar
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(open_document_settings_sidebar_exports);
|
|
26
|
-
async function openDocumentSettingsSidebar() {
|
|
27
|
-
const toggleButton = this.page.getByRole("region", { name: "Editor top bar" }).getByRole("button", {
|
|
28
|
-
name: "Settings",
|
|
29
|
-
exact: true,
|
|
30
|
-
disabled: false
|
|
31
|
-
});
|
|
32
|
-
const isClosed = await toggleButton.getAttribute("aria-expanded") === "false";
|
|
33
|
-
if (isClosed) {
|
|
34
|
-
await toggleButton.click();
|
|
35
|
-
await this.page.getByRole("region", { name: "Editor settings" }).getByRole("button", { name: "Close Settings" }).waitFor();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
openDocumentSettingsSidebar
|
|
41
|
-
});
|
|
42
|
-
//# sourceMappingURL=open-document-settings-sidebar.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/open-document-settings-sidebar.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Clicks on the button in the header which opens Document Settings sidebar when\n * it is closed.\n *\n * @param this\n */\nexport async function openDocumentSettingsSidebar( this: Editor ) {\n\tconst toggleButton = this.page\n\t\t.getByRole( 'region', { name: 'Editor top bar' } )\n\t\t.getByRole( 'button', {\n\t\t\tname: 'Settings',\n\t\t\texact: true,\n\t\t\tdisabled: false,\n\t\t} );\n\n\tconst isClosed =\n\t\t( await toggleButton.getAttribute( 'aria-expanded' ) ) === 'false';\n\n\tif ( isClosed ) {\n\t\tawait toggleButton.click();\n\t\tawait this.page\n\t\t\t.getByRole( 'region', { name: 'Editor settings' } )\n\t\t\t.getByRole( 'button', { name: 'Close Settings' } )\n\t\t\t.waitFor();\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,8BAA4C;AACjE,QAAM,eAAe,KAAK,KACxB,UAAW,UAAU,EAAE,MAAM,iBAAiB,CAAE,EAChD,UAAW,UAAU;AAAA,IACrB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,EACX,CAAE;AAEH,QAAM,WACH,MAAM,aAAa,aAAc,eAAgB,MAAQ;AAE5D,MAAK,UAAW;AACf,UAAM,aAAa,MAAM;AACzB,UAAM,KAAK,KACT,UAAW,UAAU,EAAE,MAAM,kBAAkB,CAAE,EACjD,UAAW,UAAU,EAAE,MAAM,iBAAiB,CAAE,EAChD,QAAQ;AAAA,EACX;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/build/editor/preview.cjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/preview.ts
|
|
21
|
-
var preview_exports = {};
|
|
22
|
-
__export(preview_exports, {
|
|
23
|
-
openPreviewPage: () => openPreviewPage
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(preview_exports);
|
|
26
|
-
async function openPreviewPage() {
|
|
27
|
-
const editorTopBar = this.page.locator(
|
|
28
|
-
'role=region[name="Editor top bar"i]'
|
|
29
|
-
);
|
|
30
|
-
const previewButton = editorTopBar.locator('role=button[name="View"i]');
|
|
31
|
-
await previewButton.click();
|
|
32
|
-
const [previewPage] = await Promise.all([
|
|
33
|
-
this.context.waitForEvent("page"),
|
|
34
|
-
this.page.click('role=menuitem[name="Preview in new tab"i]')
|
|
35
|
-
]);
|
|
36
|
-
return previewPage;
|
|
37
|
-
}
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
openPreviewPage
|
|
41
|
-
});
|
|
42
|
-
//# sourceMappingURL=preview.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/preview.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { Page } from '@playwright/test';\n\n/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Opens the preview page of an edited post.\n *\n * @param this\n *\n * @return preview page.\n */\nexport async function openPreviewPage( this: Editor ): Promise< Page > {\n\tconst editorTopBar = this.page.locator(\n\t\t'role=region[name=\"Editor top bar\"i]'\n\t);\n\tconst previewButton = editorTopBar.locator( 'role=button[name=\"View\"i]' );\n\n\tawait previewButton.click();\n\n\tconst [ previewPage ] = await Promise.all( [\n\t\tthis.context.waitForEvent( 'page' ),\n\t\tthis.page.click( 'role=menuitem[name=\"Preview in new tab\"i]' ),\n\t] );\n\n\treturn previewPage;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBA,eAAsB,kBAAiD;AACtE,QAAM,eAAe,KAAK,KAAK;AAAA,IAC9B;AAAA,EACD;AACA,QAAM,gBAAgB,aAAa,QAAS,2BAA4B;AAExE,QAAM,cAAc,MAAM;AAE1B,QAAM,CAAE,WAAY,IAAI,MAAM,QAAQ,IAAK;AAAA,IAC1C,KAAK,QAAQ,aAAc,MAAO;AAAA,IAClC,KAAK,KAAK,MAAO,2CAA4C;AAAA,EAC9D,CAAE;AAEF,SAAO;AACR;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/publish-post.ts
|
|
21
|
-
var publish_post_exports = {};
|
|
22
|
-
__export(publish_post_exports, {
|
|
23
|
-
publishPost: () => publishPost
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(publish_post_exports);
|
|
26
|
-
async function publishPost() {
|
|
27
|
-
const saveButton = this.page.getByRole("region", { name: "Editor top bar" }).getByRole("button", { name: "Save", exact: true });
|
|
28
|
-
const publishButton = this.page.getByRole("region", { name: "Editor top bar" }).getByRole("button", { name: "Publish", exact: true });
|
|
29
|
-
const buttonToClick = await saveButton.isVisible() ? saveButton : publishButton;
|
|
30
|
-
await buttonToClick.click();
|
|
31
|
-
const entitiesSaveButton = this.page.getByRole("region", { name: "Editor publish" }).getByRole("button", { name: "Save", exact: true });
|
|
32
|
-
const isEntitiesSavePanelVisible = await entitiesSaveButton.isVisible();
|
|
33
|
-
if (isEntitiesSavePanelVisible) {
|
|
34
|
-
await entitiesSaveButton.click();
|
|
35
|
-
}
|
|
36
|
-
await this.page.getByRole("region", {
|
|
37
|
-
name: "Editor publish"
|
|
38
|
-
}).getByRole("button", { name: "Publish", exact: true }).click();
|
|
39
|
-
await this.page.getByRole("button", { name: "Dismiss this notice" }).filter({ hasText: "published" }).waitFor();
|
|
40
|
-
const postId = new URL(this.page.url()).searchParams.get("post");
|
|
41
|
-
return typeof postId === "string" ? parseInt(postId, 10) : null;
|
|
42
|
-
}
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
publishPost
|
|
46
|
-
});
|
|
47
|
-
//# sourceMappingURL=publish-post.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/publish-post.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Publishes the post, resolving once the request is complete (once a notice\n * is displayed).\n *\n * @param this\n */\nexport async function publishPost( this: Editor ) {\n\t// If we have changes in other entities, the label is `Save` instead of `Publish`.\n\tconst saveButton = this.page\n\t\t.getByRole( 'region', { name: 'Editor top bar' } )\n\t\t.getByRole( 'button', { name: 'Save', exact: true } );\n\tconst publishButton = this.page\n\t\t.getByRole( 'region', { name: 'Editor top bar' } )\n\t\t.getByRole( 'button', { name: 'Publish', exact: true } );\n\tconst buttonToClick = ( await saveButton.isVisible() )\n\t\t? saveButton\n\t\t: publishButton;\n\tawait buttonToClick.click();\n\n\tconst entitiesSaveButton = this.page\n\t\t.getByRole( 'region', { name: 'Editor publish' } )\n\t\t.getByRole( 'button', { name: 'Save', exact: true } );\n\tconst isEntitiesSavePanelVisible = await entitiesSaveButton.isVisible();\n\n\t// Save any entities.\n\tif ( isEntitiesSavePanelVisible ) {\n\t\t// Handle saving entities.\n\t\tawait entitiesSaveButton.click();\n\t}\n\n\t// Handle saving just the post.\n\tawait this.page\n\t\t.getByRole( 'region', {\n\t\t\tname: 'Editor publish',\n\t\t} )\n\t\t.getByRole( 'button', { name: 'Publish', exact: true } )\n\t\t.click();\n\n\tawait this.page\n\t\t.getByRole( 'button', { name: 'Dismiss this notice' } )\n\t\t.filter( { hasText: 'published' } )\n\t\t.waitFor();\n\tconst postId = new URL( this.page.url() ).searchParams.get( 'post' );\n\n\treturn typeof postId === 'string' ? parseInt( postId, 10 ) : null;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,cAA4B;AAEjD,QAAM,aAAa,KAAK,KACtB,UAAW,UAAU,EAAE,MAAM,iBAAiB,CAAE,EAChD,UAAW,UAAU,EAAE,MAAM,QAAQ,OAAO,KAAK,CAAE;AACrD,QAAM,gBAAgB,KAAK,KACzB,UAAW,UAAU,EAAE,MAAM,iBAAiB,CAAE,EAChD,UAAW,UAAU,EAAE,MAAM,WAAW,OAAO,KAAK,CAAE;AACxD,QAAM,gBAAkB,MAAM,WAAW,UAAU,IAChD,aACA;AACH,QAAM,cAAc,MAAM;AAE1B,QAAM,qBAAqB,KAAK,KAC9B,UAAW,UAAU,EAAE,MAAM,iBAAiB,CAAE,EAChD,UAAW,UAAU,EAAE,MAAM,QAAQ,OAAO,KAAK,CAAE;AACrD,QAAM,6BAA6B,MAAM,mBAAmB,UAAU;AAGtE,MAAK,4BAA6B;AAEjC,UAAM,mBAAmB,MAAM;AAAA,EAChC;AAGA,QAAM,KAAK,KACT,UAAW,UAAU;AAAA,IACrB,MAAM;AAAA,EACP,CAAE,EACD,UAAW,UAAU,EAAE,MAAM,WAAW,OAAO,KAAK,CAAE,EACtD,MAAM;AAER,QAAM,KAAK,KACT,UAAW,UAAU,EAAE,MAAM,sBAAsB,CAAE,EACrD,OAAQ,EAAE,SAAS,YAAY,CAAE,EACjC,QAAQ;AACV,QAAM,SAAS,IAAI,IAAK,KAAK,KAAK,IAAI,CAAE,EAAE,aAAa,IAAK,MAAO;AAEnE,SAAO,OAAO,WAAW,WAAW,SAAU,QAAQ,EAAG,IAAI;AAC9D;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/save-draft.ts
|
|
21
|
-
var save_draft_exports = {};
|
|
22
|
-
__export(save_draft_exports, {
|
|
23
|
-
saveDraft: () => saveDraft
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(save_draft_exports);
|
|
26
|
-
async function saveDraft() {
|
|
27
|
-
await this.page.getByRole("region", { name: "Editor top bar" }).getByRole("button", { name: "Save draft" }).click();
|
|
28
|
-
await this.page.getByRole("button", { name: "Dismiss this notice" }).filter({ hasText: "Draft saved" }).waitFor();
|
|
29
|
-
}
|
|
30
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
-
0 && (module.exports = {
|
|
32
|
-
saveDraft
|
|
33
|
-
});
|
|
34
|
-
//# sourceMappingURL=save-draft.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/save-draft.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Saves the post as a draft, resolving once the request is complete (once a notice\n * is displayed).\n */\nexport async function saveDraft( this: Editor ) {\n\tawait this.page\n\t\t.getByRole( 'region', { name: 'Editor top bar' } )\n\t\t.getByRole( 'button', { name: 'Save draft' } )\n\t\t.click();\n\n\tawait this.page\n\t\t.getByRole( 'button', { name: 'Dismiss this notice' } )\n\t\t.filter( { hasText: 'Draft saved' } )\n\t\t.waitFor();\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,eAAsB,YAA0B;AAC/C,QAAM,KAAK,KACT,UAAW,UAAU,EAAE,MAAM,iBAAiB,CAAE,EAChD,UAAW,UAAU,EAAE,MAAM,aAAa,CAAE,EAC5C,MAAM;AAER,QAAM,KAAK,KACT,UAAW,UAAU,EAAE,MAAM,sBAAsB,CAAE,EACrD,OAAQ,EAAE,SAAS,cAAc,CAAE,EACnC,QAAQ;AACX;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/select-blocks.ts
|
|
21
|
-
var select_blocks_exports = {};
|
|
22
|
-
__export(select_blocks_exports, {
|
|
23
|
-
selectBlocks: () => selectBlocks
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(select_blocks_exports);
|
|
26
|
-
async function selectBlocks(startSelectorOrLocator, endSelectorOrLocator) {
|
|
27
|
-
const startBlock = typeof startSelectorOrLocator === "string" ? this.canvas.locator(startSelectorOrLocator) : startSelectorOrLocator;
|
|
28
|
-
const endBlock = typeof endSelectorOrLocator === "string" ? this.canvas.locator(endSelectorOrLocator) : endSelectorOrLocator;
|
|
29
|
-
const startClientId = await startBlock.getAttribute("data-block");
|
|
30
|
-
const endClientId = await endBlock?.getAttribute("data-block");
|
|
31
|
-
if (endClientId) {
|
|
32
|
-
await this.page.evaluate(
|
|
33
|
-
([startId, endId]) => {
|
|
34
|
-
wp.data.dispatch("core/block-editor").multiSelect(startId, endId);
|
|
35
|
-
},
|
|
36
|
-
[startClientId, endClientId]
|
|
37
|
-
);
|
|
38
|
-
} else {
|
|
39
|
-
await this.page.evaluate(
|
|
40
|
-
([clientId]) => {
|
|
41
|
-
wp.data.dispatch("core/block-editor").selectBlock(clientId);
|
|
42
|
-
},
|
|
43
|
-
[startClientId]
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
-
0 && (module.exports = {
|
|
49
|
-
selectBlocks
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=select-blocks.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/select-blocks.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { Locator } from '@playwright/test';\n\n/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\nexport async function selectBlocks(\n\tthis: Editor,\n\tstartSelectorOrLocator: string | Locator,\n\tendSelectorOrLocator?: string | Locator\n) {\n\tconst startBlock =\n\t\ttypeof startSelectorOrLocator === 'string'\n\t\t\t? this.canvas.locator( startSelectorOrLocator )\n\t\t\t: startSelectorOrLocator;\n\n\tconst endBlock =\n\t\ttypeof endSelectorOrLocator === 'string'\n\t\t\t? this.canvas.locator( endSelectorOrLocator )\n\t\t\t: endSelectorOrLocator;\n\n\tconst startClientId = await startBlock.getAttribute( 'data-block' );\n\tconst endClientId = await endBlock?.getAttribute( 'data-block' );\n\n\tif ( endClientId ) {\n\t\tawait this.page.evaluate(\n\t\t\t( [ startId, endId ] ) => {\n\t\t\t\t// @ts-ignore\n\t\t\t\twp.data\n\t\t\t\t\t.dispatch( 'core/block-editor' )\n\t\t\t\t\t.multiSelect( startId, endId );\n\t\t\t},\n\t\t\t[ startClientId, endClientId ]\n\t\t);\n\t} else {\n\t\tawait this.page.evaluate(\n\t\t\t( [ clientId ] ) => {\n\t\t\t\t// @ts-ignore\n\t\t\t\twp.data.dispatch( 'core/block-editor' ).selectBlock( clientId );\n\t\t\t},\n\t\t\t[ startClientId ]\n\t\t);\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,eAAsB,aAErB,wBACA,sBACC;AACD,QAAM,aACL,OAAO,2BAA2B,WAC/B,KAAK,OAAO,QAAS,sBAAuB,IAC5C;AAEJ,QAAM,WACL,OAAO,yBAAyB,WAC7B,KAAK,OAAO,QAAS,oBAAqB,IAC1C;AAEJ,QAAM,gBAAgB,MAAM,WAAW,aAAc,YAAa;AAClE,QAAM,cAAc,MAAM,UAAU,aAAc,YAAa;AAE/D,MAAK,aAAc;AAClB,UAAM,KAAK,KAAK;AAAA,MACf,CAAE,CAAE,SAAS,KAAM,MAAO;AAEzB,WAAG,KACD,SAAU,mBAAoB,EAC9B,YAAa,SAAS,KAAM;AAAA,MAC/B;AAAA,MACA,CAAE,eAAe,WAAY;AAAA,IAC9B;AAAA,EACD,OAAO;AACN,UAAM,KAAK,KAAK;AAAA,MACf,CAAE,CAAE,QAAS,MAAO;AAEnB,WAAG,KAAK,SAAU,mBAAoB,EAAE,YAAa,QAAS;AAAA,MAC/D;AAAA,MACA,CAAE,aAAc;AAAA,IACjB;AAAA,EACD;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/set-content.ts
|
|
21
|
-
var set_content_exports = {};
|
|
22
|
-
__export(set_content_exports, {
|
|
23
|
-
setContent: () => setContent
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(set_content_exports);
|
|
26
|
-
async function setContent(html) {
|
|
27
|
-
await this.page.waitForFunction(
|
|
28
|
-
() => window?.wp?.blocks && window?.wp?.data
|
|
29
|
-
);
|
|
30
|
-
await this.page.evaluate((_html) => {
|
|
31
|
-
const blocks = window.wp.blocks.parse(_html);
|
|
32
|
-
window.wp.data.dispatch("core/block-editor").resetBlocks(blocks);
|
|
33
|
-
}, html);
|
|
34
|
-
}
|
|
35
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
-
0 && (module.exports = {
|
|
37
|
-
setContent
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=set-content.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/set-content.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Set the content of the editor.\n *\n * @param this\n * @param html Serialized block HTML.\n */\nasync function setContent( this: Editor, html: string ) {\n\tawait this.page.waitForFunction(\n\t\t() => window?.wp?.blocks && window?.wp?.data\n\t);\n\n\tawait this.page.evaluate( ( _html ) => {\n\t\tconst blocks = window.wp.blocks.parse( _html );\n\n\t\twindow.wp.data.dispatch( 'core/block-editor' ).resetBlocks( blocks );\n\t}, html );\n}\n\nexport { setContent };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAe,WAA0B,MAAe;AACvD,QAAM,KAAK,KAAK;AAAA,IACf,MAAM,QAAQ,IAAI,UAAU,QAAQ,IAAI;AAAA,EACzC;AAEA,QAAM,KAAK,KAAK,SAAU,CAAE,UAAW;AACtC,UAAM,SAAS,OAAO,GAAG,OAAO,MAAO,KAAM;AAE7C,WAAO,GAAG,KAAK,SAAU,mBAAoB,EAAE,YAAa,MAAO;AAAA,EACpE,GAAG,IAAK;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/set-is-fixed-toolbar.ts
|
|
21
|
-
var set_is_fixed_toolbar_exports = {};
|
|
22
|
-
__export(set_is_fixed_toolbar_exports, {
|
|
23
|
-
setIsFixedToolbar: () => setIsFixedToolbar
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(set_is_fixed_toolbar_exports);
|
|
26
|
-
async function setIsFixedToolbar(isFixed) {
|
|
27
|
-
await this.page.waitForFunction(() => window?.wp?.data);
|
|
28
|
-
await this.page.evaluate((_isFixed) => {
|
|
29
|
-
window.wp.data.dispatch("core/preferences").set("core", "fixedToolbar", _isFixed);
|
|
30
|
-
}, isFixed);
|
|
31
|
-
}
|
|
32
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
-
0 && (module.exports = {
|
|
34
|
-
setIsFixedToolbar
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=set-is-fixed-toolbar.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/set-is-fixed-toolbar.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Toggles the fixed toolbar option.\n *\n * @param this\n * @param isFixed Boolean value true/false for on/off.\n */\nexport async function setIsFixedToolbar( this: Editor, isFixed: boolean ) {\n\tawait this.page.waitForFunction( () => window?.wp?.data );\n\n\tawait this.page.evaluate( ( _isFixed ) => {\n\t\twindow.wp.data\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core', 'fixedToolbar', _isFixed );\n\t}, isFixed );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,kBAAiC,SAAmB;AACzE,QAAM,KAAK,KAAK,gBAAiB,MAAM,QAAQ,IAAI,IAAK;AAExD,QAAM,KAAK,KAAK,SAAU,CAAE,aAAc;AACzC,WAAO,GAAG,KACR,SAAU,kBAAmB,EAC7B,IAAK,QAAQ,gBAAgB,QAAS;AAAA,EACzC,GAAG,OAAQ;AACZ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/set-preferences.ts
|
|
21
|
-
var set_preferences_exports = {};
|
|
22
|
-
__export(set_preferences_exports, {
|
|
23
|
-
setPreferences: () => setPreferences
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(set_preferences_exports);
|
|
26
|
-
async function setPreferences(context, preferences) {
|
|
27
|
-
await this.page.waitForFunction(() => window?.wp?.data);
|
|
28
|
-
await this.page.evaluate(
|
|
29
|
-
async (props) => {
|
|
30
|
-
for (const [key, value] of Object.entries(
|
|
31
|
-
props.preferences
|
|
32
|
-
)) {
|
|
33
|
-
await window.wp.data.dispatch("core/preferences").set(props.context, key, value);
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{ context, preferences }
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
setPreferences
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=set-preferences.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/set-preferences.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\ntype PreferencesContext =\n\t| 'core/edit-post'\n\t| 'core/edit-site'\n\t| 'core/customize-widgets';\n\n/**\n * Set the preferences of the editor.\n *\n * @param this\n * @param context Context to set preferences for.\n * @param preferences Preferences to set.\n */\nexport async function setPreferences(\n\tthis: Editor,\n\tcontext: PreferencesContext,\n\tpreferences: Record< string, any >\n) {\n\tawait this.page.waitForFunction( () => window?.wp?.data );\n\n\tawait this.page.evaluate(\n\t\tasync ( props ) => {\n\t\t\tfor ( const [ key, value ] of Object.entries(\n\t\t\t\tprops.preferences\n\t\t\t) ) {\n\t\t\t\tawait window.wp.data\n\t\t\t\t\t.dispatch( 'core/preferences' )\n\t\t\t\t\t.set( props.context, key, value );\n\t\t\t}\n\t\t},\n\t\t{ context, preferences }\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBA,eAAsB,eAErB,SACA,aACC;AACD,QAAM,KAAK,KAAK,gBAAiB,MAAM,QAAQ,IAAI,IAAK;AAExD,QAAM,KAAK,KAAK;AAAA,IACf,OAAQ,UAAW;AAClB,iBAAY,CAAE,KAAK,KAAM,KAAK,OAAO;AAAA,QACpC,MAAM;AAAA,MACP,GAAI;AACH,cAAM,OAAO,GAAG,KACd,SAAU,kBAAmB,EAC7B,IAAK,MAAM,SAAS,KAAK,KAAM;AAAA,MAClC;AAAA,IACD;AAAA,IACA,EAAE,SAAS,YAAY;AAAA,EACxB;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/show-block-toolbar.ts
|
|
21
|
-
var show_block_toolbar_exports = {};
|
|
22
|
-
__export(show_block_toolbar_exports, {
|
|
23
|
-
showBlockToolbar: () => showBlockToolbar
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(show_block_toolbar_exports);
|
|
26
|
-
async function showBlockToolbar() {
|
|
27
|
-
await this.page.mouse.move(50, 50);
|
|
28
|
-
await this.page.mouse.move(75, 75);
|
|
29
|
-
await this.page.mouse.move(100, 100);
|
|
30
|
-
}
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
showBlockToolbar
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=show-block-toolbar.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/show-block-toolbar.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * The block toolbar is not always visible while typing.\n * Call this function to reveal it.\n *\n * @param this\n */\nexport async function showBlockToolbar( this: Editor ) {\n\t// Move the mouse to disable the isTyping mode. We need at least three\n\t// mousemove events for it to work across windows (iframe). With three\n\t// moves, it's a guarantee that at least two will be in the same window.\n\t// Two events are required for the flag to be unset.\n\tawait this.page.mouse.move( 50, 50 );\n\tawait this.page.mouse.move( 75, 75 );\n\tawait this.page.mouse.move( 100, 100 );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,mBAAiC;AAKtD,QAAM,KAAK,KAAK,MAAM,KAAM,IAAI,EAAG;AACnC,QAAM,KAAK,KAAK,MAAM,KAAM,IAAI,EAAG;AACnC,QAAM,KAAK,KAAK,MAAM,KAAM,KAAK,GAAI;AACtC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/site-editor.ts
|
|
21
|
-
var site_editor_exports = {};
|
|
22
|
-
__export(site_editor_exports, {
|
|
23
|
-
saveSiteEditorEntities: () => saveSiteEditorEntities
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(site_editor_exports);
|
|
26
|
-
async function saveSiteEditorEntities(options = {}) {
|
|
27
|
-
const editorTopBar = this.page.getByRole("region", {
|
|
28
|
-
name: "Editor top bar"
|
|
29
|
-
});
|
|
30
|
-
const saveButton = editorTopBar.getByRole("button", {
|
|
31
|
-
name: "Save",
|
|
32
|
-
exact: true
|
|
33
|
-
});
|
|
34
|
-
const publishButton = editorTopBar.getByRole("button", {
|
|
35
|
-
name: "Publish"
|
|
36
|
-
});
|
|
37
|
-
const publishButtonIsVisible = !await saveButton.isVisible();
|
|
38
|
-
const buttonToClick = publishButtonIsVisible ? publishButton : saveButton;
|
|
39
|
-
await buttonToClick.click();
|
|
40
|
-
if (!options.isOnlyCurrentEntityDirty) {
|
|
41
|
-
await this.page.getByRole("region", {
|
|
42
|
-
name: /(Editor publish|Save panel)/
|
|
43
|
-
}).getByRole("button", { name: "Save", exact: true }).click();
|
|
44
|
-
}
|
|
45
|
-
await this.page.getByRole("button", { name: "Dismiss this notice" }).getByText(/(updated|published)\./).first().waitFor();
|
|
46
|
-
}
|
|
47
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
-
0 && (module.exports = {
|
|
49
|
-
saveSiteEditorEntities
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=site-editor.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/site-editor.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\ninterface Options {\n\t// If the only dirty entity is the current one, skip opening the save panel.\n\tisOnlyCurrentEntityDirty?: boolean;\n}\n\n/**\n * Save entities in the site editor. Assumes the editor is in a dirty state.\n *\n * @param this\n * @param options\n */\nexport async function saveSiteEditorEntities(\n\tthis: Editor,\n\toptions: Options = {}\n) {\n\tconst editorTopBar = this.page.getByRole( 'region', {\n\t\tname: 'Editor top bar',\n\t} );\n\n\t// If we have changes in a single entity which can be published the label is `Publish`.\n\tconst saveButton = editorTopBar.getByRole( 'button', {\n\t\tname: 'Save',\n\t\texact: true,\n\t} );\n\tconst publishButton = editorTopBar.getByRole( 'button', {\n\t\tname: 'Publish',\n\t} );\n\tconst publishButtonIsVisible = ! ( await saveButton.isVisible() );\n\t// First Save button in the top bar.\n\tconst buttonToClick = publishButtonIsVisible ? publishButton : saveButton;\n\tawait buttonToClick.click();\n\n\tif ( ! options.isOnlyCurrentEntityDirty ) {\n\t\t// Second Save button in the entities panel.\n\t\tawait this.page\n\t\t\t.getByRole( 'region', {\n\t\t\t\tname: /(Editor publish|Save panel)/,\n\t\t\t} )\n\t\t\t.getByRole( 'button', { name: 'Save', exact: true } )\n\t\t\t.click();\n\t}\n\t// The text in the notice can be different based on the edited entity, whether\n\t// we are saving multiple entities and whether we publish or update. So for now,\n\t// we locate it based on the last part.\n\tawait this.page\n\t\t.getByRole( 'button', { name: 'Dismiss this notice' } )\n\t\t.getByText( /(updated|published)\\./ )\n\t\t.first()\n\t\t.waitFor();\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,eAAsB,uBAErB,UAAmB,CAAC,GACnB;AACD,QAAM,eAAe,KAAK,KAAK,UAAW,UAAU;AAAA,IACnD,MAAM;AAAA,EACP,CAAE;AAGF,QAAM,aAAa,aAAa,UAAW,UAAU;AAAA,IACpD,MAAM;AAAA,IACN,OAAO;AAAA,EACR,CAAE;AACF,QAAM,gBAAgB,aAAa,UAAW,UAAU;AAAA,IACvD,MAAM;AAAA,EACP,CAAE;AACF,QAAM,yBAAyB,CAAI,MAAM,WAAW,UAAU;AAE9D,QAAM,gBAAgB,yBAAyB,gBAAgB;AAC/D,QAAM,cAAc,MAAM;AAE1B,MAAK,CAAE,QAAQ,0BAA2B;AAEzC,UAAM,KAAK,KACT,UAAW,UAAU;AAAA,MACrB,MAAM;AAAA,IACP,CAAE,EACD,UAAW,UAAU,EAAE,MAAM,QAAQ,OAAO,KAAK,CAAE,EACnD,MAAM;AAAA,EACT;AAIA,QAAM,KAAK,KACT,UAAW,UAAU,EAAE,MAAM,sBAAsB,CAAE,EACrD,UAAW,uBAAwB,EACnC,MAAM,EACN,QAAQ;AACX;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/switch-editor-tool.ts
|
|
21
|
-
var switch_editor_tool_exports = {};
|
|
22
|
-
__export(switch_editor_tool_exports, {
|
|
23
|
-
switchEditorTool: () => switchEditorTool
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(switch_editor_tool_exports);
|
|
26
|
-
async function switchEditorTool(label) {
|
|
27
|
-
const toolsToolbar = this.page.getByRole("toolbar", {
|
|
28
|
-
name: "Document tools"
|
|
29
|
-
});
|
|
30
|
-
await toolsToolbar.getByRole("button", {
|
|
31
|
-
name: "Tools"
|
|
32
|
-
}).click();
|
|
33
|
-
const menu = this.page.getByRole("menu", {
|
|
34
|
-
name: "Tools"
|
|
35
|
-
});
|
|
36
|
-
await menu.getByRole("menuitemradio", {
|
|
37
|
-
name: label
|
|
38
|
-
}).click();
|
|
39
|
-
await toolsToolbar.getByRole("button", {
|
|
40
|
-
name: "Tools"
|
|
41
|
-
}).click();
|
|
42
|
-
}
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
switchEditorTool
|
|
46
|
-
});
|
|
47
|
-
//# sourceMappingURL=switch-editor-tool.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/switch-editor-tool.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Switch the editor tool being used.\n *\n * @param this\n * @param label The text string of the button label.\n */\nexport async function switchEditorTool( this: Editor, label: string ) {\n\tconst toolsToolbar = this.page.getByRole( 'toolbar', {\n\t\tname: 'Document tools',\n\t} );\n\tawait toolsToolbar\n\t\t.getByRole( 'button', {\n\t\t\tname: 'Tools',\n\t\t} )\n\t\t.click();\n\tconst menu = this.page.getByRole( 'menu', {\n\t\tname: 'Tools',\n\t} );\n\tawait menu\n\t\t.getByRole( 'menuitemradio', {\n\t\t\tname: label,\n\t\t} )\n\t\t.click();\n\tawait toolsToolbar\n\t\t.getByRole( 'button', {\n\t\t\tname: 'Tools',\n\t\t} )\n\t\t.click();\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,iBAAgC,OAAgB;AACrE,QAAM,eAAe,KAAK,KAAK,UAAW,WAAW;AAAA,IACpD,MAAM;AAAA,EACP,CAAE;AACF,QAAM,aACJ,UAAW,UAAU;AAAA,IACrB,MAAM;AAAA,EACP,CAAE,EACD,MAAM;AACR,QAAM,OAAO,KAAK,KAAK,UAAW,QAAQ;AAAA,IACzC,MAAM;AAAA,EACP,CAAE;AACF,QAAM,KACJ,UAAW,iBAAiB;AAAA,IAC5B,MAAM;AAAA,EACP,CAAE,EACD,MAAM;AACR,QAAM,aACJ,UAAW,UAAU;AAAA,IACrB,MAAM;AAAA,EACP,CAAE,EACD,MAAM;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/switch-to-legacy-canvas.ts
|
|
21
|
-
var switch_to_legacy_canvas_exports = {};
|
|
22
|
-
__export(switch_to_legacy_canvas_exports, {
|
|
23
|
-
switchToLegacyCanvas: () => switchToLegacyCanvas
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(switch_to_legacy_canvas_exports);
|
|
26
|
-
async function switchToLegacyCanvas() {
|
|
27
|
-
await this.page.waitForFunction(() => window?.wp?.blocks);
|
|
28
|
-
await this.page.evaluate(() => {
|
|
29
|
-
window.wp.blocks.registerBlockType("test/v2", {
|
|
30
|
-
apiVersion: "2",
|
|
31
|
-
title: "test"
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
-
0 && (module.exports = {
|
|
37
|
-
switchToLegacyCanvas
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=switch-to-legacy-canvas.cjs.map
|