@wordpress/e2e-test-utils-playwright 1.32.0 → 1.32.1-next.b8c8708f3.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 +46 -28
- package/build/admin/create-new-post.js.map +7 -1
- package/build/admin/edit-post.js +35 -17
- package/build/admin/edit-post.js.map +7 -1
- package/build/admin/get-page-error.js +30 -22
- package/build/admin/get-page-error.js.map +7 -1
- package/build/admin/index.js +54 -34
- package/build/admin/index.js.map +7 -1
- package/build/admin/visit-admin-page.js +42 -29
- package/build/admin/visit-admin-page.js.map +7 -1
- package/build/admin/visit-site-editor.js +71 -64
- package/build/admin/visit-site-editor.js.map +7 -1
- package/build/config.js +40 -10
- package/build/config.js.map +7 -1
- package/build/editor/click-block-options-menu-item.js +29 -14
- package/build/editor/click-block-options-menu-item.js.map +7 -1
- package/build/editor/click-block-toolbar-button.js +33 -13
- package/build/editor/click-block-toolbar-button.js.map +7 -1
- package/build/editor/get-blocks.js +59 -43
- package/build/editor/get-blocks.js.map +7 -1
- package/build/editor/get-edited-post-content.js +31 -12
- package/build/editor/get-edited-post-content.js.map +7 -1
- package/build/editor/index.js +92 -72
- package/build/editor/index.js.map +7 -1
- package/build/editor/insert-block.js +50 -21
- package/build/editor/insert-block.js.map +7 -1
- package/build/editor/open-document-settings-sidebar.js +37 -24
- package/build/editor/open-document-settings-sidebar.js.map +7 -1
- package/build/editor/preview.js +37 -18
- package/build/editor/preview.js.map +7 -1
- package/build/editor/publish-post.js +42 -42
- package/build/editor/publish-post.js.map +7 -1
- package/build/editor/save-draft.js +29 -15
- package/build/editor/save-draft.js.map +7 -1
- package/build/editor/select-blocks.js +46 -25
- package/build/editor/select-blocks.js.map +7 -1
- package/build/editor/set-content.js +34 -14
- package/build/editor/set-content.js.map +7 -1
- package/build/editor/set-is-fixed-toolbar.js +31 -15
- package/build/editor/set-is-fixed-toolbar.js.map +7 -1
- package/build/editor/set-preferences.js +38 -18
- package/build/editor/set-preferences.js.map +7 -1
- package/build/editor/show-block-toolbar.js +30 -16
- package/build/editor/show-block-toolbar.js.map +7 -1
- package/build/editor/site-editor.js +46 -41
- package/build/editor/site-editor.js.map +7 -1
- package/build/editor/switch-editor-tool.js +42 -30
- package/build/editor/switch-editor-tool.js.map +7 -1
- package/build/editor/switch-to-legacy-canvas.js +33 -14
- package/build/editor/switch-to-legacy-canvas.js.map +7 -1
- package/build/editor/transform-block-to.js +41 -21
- package/build/editor/transform-block-to.js.map +7 -1
- package/build/index.js +50 -32
- package/build/index.js.map +7 -1
- package/build/lighthouse/index.js +89 -53
- package/build/lighthouse/index.js.map +7 -1
- package/build/metrics/index.js +298 -249
- package/build/metrics/index.js.map +7 -1
- package/build/page-utils/drag-files.js +134 -112
- package/build/page-utils/drag-files.js.map +7 -1
- package/build/page-utils/emulate-network-conditions.js +92 -66
- package/build/page-utils/emulate-network-conditions.js.map +7 -1
- package/build/page-utils/index.js +54 -34
- package/build/page-utils/index.js.map +7 -1
- package/build/page-utils/is-current-url.js +31 -18
- package/build/page-utils/is-current-url.js.map +7 -1
- package/build/page-utils/keycodes.js +51 -39
- package/build/page-utils/keycodes.js.map +7 -1
- package/build/page-utils/press-keys.js +148 -127
- package/build/page-utils/press-keys.js.map +7 -1
- package/build/page-utils/set-browser-viewport.js +32 -41
- package/build/page-utils/set-browser-viewport.js.map +7 -1
- package/build/request-utils/blocks.js +49 -40
- package/build/request-utils/blocks.js.map +7 -1
- package/build/request-utils/comments.js +57 -45
- package/build/request-utils/comments.js.map +7 -1
- package/build/request-utils/gutenberg-experiments.js +48 -26
- package/build/request-utils/gutenberg-experiments.js.map +7 -1
- package/build/request-utils/index.js +187 -153
- package/build/request-utils/index.js.map +7 -1
- package/build/request-utils/login.js +43 -18
- package/build/request-utils/login.js.map +7 -1
- package/build/request-utils/media.js +72 -64
- package/build/request-utils/media.js.map +7 -1
- package/build/request-utils/menus.js +119 -109
- package/build/request-utils/menus.js.map +7 -1
- package/build/request-utils/pages.js +60 -49
- package/build/request-utils/pages.js.map +7 -1
- package/build/request-utils/patterns.js +39 -24
- package/build/request-utils/patterns.js.map +7 -1
- package/build/request-utils/plugins.js +68 -74
- package/build/request-utils/plugins.js.map +7 -1
- package/build/request-utils/posts.js +52 -39
- package/build/request-utils/posts.js.map +7 -1
- package/build/request-utils/preferences.js +36 -17
- package/build/request-utils/preferences.js.map +7 -1
- package/build/request-utils/rest.js +153 -129
- package/build/request-utils/rest.js.map +7 -1
- package/build/request-utils/site-settings.js +38 -28
- package/build/request-utils/site-settings.js.map +7 -1
- package/build/request-utils/templates.js +57 -45
- package/build/request-utils/templates.js.map +7 -1
- package/build/request-utils/themes.js +78 -53
- package/build/request-utils/themes.js.map +7 -1
- package/build/request-utils/users.js +72 -72
- package/build/request-utils/users.js.map +7 -1
- package/build/request-utils/widgets.js +71 -55
- package/build/request-utils/widgets.js.map +7 -1
- package/build/test.js +128 -146
- package/build/test.js.map +7 -1
- package/build/types.js +16 -2
- package/build/types.js.map +7 -1
- package/package.json +6 -2
|
@@ -1,21 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
var set_preferences_exports = {};
|
|
20
|
+
__export(set_preferences_exports, {
|
|
21
|
+
setPreferences: () => setPreferences
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(set_preferences_exports);
|
|
11
24
|
async function setPreferences(context, preferences) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
await this.page.waitForFunction(() => window?.wp?.data);
|
|
26
|
+
await this.page.evaluate(
|
|
27
|
+
async (props) => {
|
|
28
|
+
for (const [key, value] of Object.entries(
|
|
29
|
+
props.preferences
|
|
30
|
+
)) {
|
|
31
|
+
await window.wp.data.dispatch("core/preferences").set(props.context, key, value);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{ context, preferences }
|
|
35
|
+
);
|
|
20
36
|
}
|
|
21
|
-
|
|
37
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
+
0 && (module.exports = {
|
|
39
|
+
setPreferences
|
|
40
|
+
});
|
|
41
|
+
//# sourceMappingURL=set-preferences.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
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,19 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
var show_block_toolbar_exports = {};
|
|
20
|
+
__export(show_block_toolbar_exports, {
|
|
21
|
+
showBlockToolbar: () => showBlockToolbar
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(show_block_toolbar_exports);
|
|
10
24
|
async function showBlockToolbar() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// Two events are required for the flag to be unset.
|
|
15
|
-
await this.page.mouse.move(50, 50);
|
|
16
|
-
await this.page.mouse.move(75, 75);
|
|
17
|
-
await this.page.mouse.move(100, 100);
|
|
25
|
+
await this.page.mouse.move(50, 50);
|
|
26
|
+
await this.page.mouse.move(75, 75);
|
|
27
|
+
await this.page.mouse.move(100, 100);
|
|
18
28
|
}
|
|
19
|
-
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
showBlockToolbar
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=show-block-toolbar.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
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,44 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
var site_editor_exports = {};
|
|
20
|
+
__export(site_editor_exports, {
|
|
21
|
+
saveSiteEditorEntities: () => saveSiteEditorEntities
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(site_editor_exports);
|
|
10
24
|
async function saveSiteEditorEntities(options = {}) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
await
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
name: /(Editor publish|Save panel)/,
|
|
31
|
-
})
|
|
32
|
-
.getByRole('button', { name: 'Save', exact: true })
|
|
33
|
-
.click();
|
|
34
|
-
}
|
|
35
|
-
// The text in the notice can be different based on the edited entity, whether
|
|
36
|
-
// we are saving multiple entities and whether we publish or update. So for now,
|
|
37
|
-
// we locate it based on the last part.
|
|
38
|
-
await this.page
|
|
39
|
-
.getByRole('button', { name: 'Dismiss this notice' })
|
|
40
|
-
.getByText(/(updated|published)\./)
|
|
41
|
-
.first()
|
|
42
|
-
.waitFor();
|
|
25
|
+
const editorTopBar = this.page.getByRole("region", {
|
|
26
|
+
name: "Editor top bar"
|
|
27
|
+
});
|
|
28
|
+
const saveButton = editorTopBar.getByRole("button", {
|
|
29
|
+
name: "Save",
|
|
30
|
+
exact: true
|
|
31
|
+
});
|
|
32
|
+
const publishButton = editorTopBar.getByRole("button", {
|
|
33
|
+
name: "Publish"
|
|
34
|
+
});
|
|
35
|
+
const publishButtonIsVisible = !await saveButton.isVisible();
|
|
36
|
+
const buttonToClick = publishButtonIsVisible ? publishButton : saveButton;
|
|
37
|
+
await buttonToClick.click();
|
|
38
|
+
if (!options.isOnlyCurrentEntityDirty) {
|
|
39
|
+
await this.page.getByRole("region", {
|
|
40
|
+
name: /(Editor publish|Save panel)/
|
|
41
|
+
}).getByRole("button", { name: "Save", exact: true }).click();
|
|
42
|
+
}
|
|
43
|
+
await this.page.getByRole("button", { name: "Dismiss this notice" }).getByText(/(updated|published)\./).first().waitFor();
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
saveSiteEditorEntities
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=site-editor.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
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,33 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
var switch_editor_tool_exports = {};
|
|
20
|
+
__export(switch_editor_tool_exports, {
|
|
21
|
+
switchEditorTool: () => switchEditorTool
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(switch_editor_tool_exports);
|
|
10
24
|
async function switchEditorTool(label) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.click();
|
|
27
|
-
await toolsToolbar
|
|
28
|
-
.getByRole('button', {
|
|
29
|
-
name: 'Tools',
|
|
30
|
-
})
|
|
31
|
-
.click();
|
|
25
|
+
const toolsToolbar = this.page.getByRole("toolbar", {
|
|
26
|
+
name: "Document tools"
|
|
27
|
+
});
|
|
28
|
+
await toolsToolbar.getByRole("button", {
|
|
29
|
+
name: "Tools"
|
|
30
|
+
}).click();
|
|
31
|
+
const menu = this.page.getByRole("menu", {
|
|
32
|
+
name: "Tools"
|
|
33
|
+
});
|
|
34
|
+
await menu.getByRole("menuitemradio", {
|
|
35
|
+
name: label
|
|
36
|
+
}).click();
|
|
37
|
+
await toolsToolbar.getByRole("button", {
|
|
38
|
+
name: "Tools"
|
|
39
|
+
}).click();
|
|
32
40
|
}
|
|
33
|
-
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
switchEditorTool
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=switch-editor-tool.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
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,18 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
+
var switch_to_legacy_canvas_exports = {};
|
|
20
|
+
__export(switch_to_legacy_canvas_exports, {
|
|
21
|
+
switchToLegacyCanvas: () => switchToLegacyCanvas
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(switch_to_legacy_canvas_exports);
|
|
9
24
|
async function switchToLegacyCanvas() {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
});
|
|
25
|
+
await this.page.waitForFunction(() => window?.wp?.blocks);
|
|
26
|
+
await this.page.evaluate(() => {
|
|
27
|
+
window.wp.blocks.registerBlockType("test/v2", {
|
|
28
|
+
apiVersion: "2",
|
|
29
|
+
title: "test"
|
|
16
30
|
});
|
|
31
|
+
});
|
|
17
32
|
}
|
|
18
|
-
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
switchToLegacyCanvas
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=switch-to-legacy-canvas.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/switch-to-legacy-canvas.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Switches to legacy (non-iframed) canvas.\n *\n * @param this\n */\nexport async function switchToLegacyCanvas( this: Editor ) {\n\tawait this.page.waitForFunction( () => window?.wp?.blocks );\n\n\tawait this.page.evaluate( () => {\n\t\twindow.wp.blocks.registerBlockType( 'test/v2', {\n\t\t\tapiVersion: '2',\n\t\t\ttitle: 'test',\n\t\t} );\n\t} );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,eAAsB,uBAAqC;AAC1D,QAAM,KAAK,KAAK,gBAAiB,MAAM,QAAQ,IAAI,MAAO;AAE1D,QAAM,KAAK,KAAK,SAAU,MAAM;AAC/B,WAAO,GAAG,OAAO,kBAAmB,WAAW;AAAA,MAC9C,YAAY;AAAA,MACZ,OAAO;AAAA,IACR,CAAE;AAAA,EACH,CAAE;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,24 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
+
var transform_block_to_exports = {};
|
|
20
|
+
__export(transform_block_to_exports, {
|
|
21
|
+
transformBlockTo: () => transformBlockTo
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(transform_block_to_exports);
|
|
10
24
|
async function transformBlockTo(name) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
25
|
+
await this.page.waitForFunction(
|
|
26
|
+
() => window?.wp?.blocks && window?.wp?.data
|
|
27
|
+
);
|
|
28
|
+
await this.page.evaluate(
|
|
29
|
+
([blockName]) => {
|
|
30
|
+
const clientIds = window.wp.data.select("core/block-editor").getSelectedBlockClientIds();
|
|
31
|
+
const blocks = window.wp.data.select("core/block-editor").getBlocksByClientId(clientIds);
|
|
32
|
+
window.wp.data.dispatch("core/block-editor").replaceBlocks(
|
|
33
|
+
clientIds,
|
|
34
|
+
window.wp.blocks.switchToBlockType(blocks, blockName)
|
|
35
|
+
);
|
|
36
|
+
},
|
|
37
|
+
[name]
|
|
38
|
+
);
|
|
23
39
|
}
|
|
24
|
-
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
transformBlockTo
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=transform-block-to.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/transform-block-to.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Clicks the default block appender.\n *\n * @param this\n * @param name Block name.\n */\nexport async function transformBlockTo( this: Editor, name: string ) {\n\tawait this.page.waitForFunction(\n\t\t() => window?.wp?.blocks && window?.wp?.data\n\t);\n\n\tawait this.page.evaluate(\n\t\t( [ blockName ] ) => {\n\t\t\tconst clientIds = window.wp.data\n\t\t\t\t.select( 'core/block-editor' )\n\t\t\t\t.getSelectedBlockClientIds();\n\t\t\tconst blocks = window.wp.data\n\t\t\t\t.select( 'core/block-editor' )\n\t\t\t\t.getBlocksByClientId( clientIds );\n\t\t\twindow.wp.data\n\t\t\t\t.dispatch( 'core/block-editor' )\n\t\t\t\t.replaceBlocks(\n\t\t\t\t\tclientIds,\n\t\t\t\t\twindow.wp.blocks.switchToBlockType( blocks, blockName )\n\t\t\t\t);\n\t\t},\n\t\t[ name ]\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,iBAAgC,MAAe;AACpE,QAAM,KAAK,KAAK;AAAA,IACf,MAAM,QAAQ,IAAI,UAAU,QAAQ,IAAI;AAAA,EACzC;AAEA,QAAM,KAAK,KAAK;AAAA,IACf,CAAE,CAAE,SAAU,MAAO;AACpB,YAAM,YAAY,OAAO,GAAG,KAC1B,OAAQ,mBAAoB,EAC5B,0BAA0B;AAC5B,YAAM,SAAS,OAAO,GAAG,KACvB,OAAQ,mBAAoB,EAC5B,oBAAqB,SAAU;AACjC,aAAO,GAAG,KACR,SAAU,mBAAoB,EAC9B;AAAA,QACA;AAAA,QACA,OAAO,GAAG,OAAO,kBAAmB,QAAQ,SAAU;AAAA,MACvD;AAAA,IACF;AAAA,IACA,CAAE,IAAK;AAAA,EACR;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/index.js
CHANGED
|
@@ -1,34 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
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 });
|
|
15
9
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var index_exports = {};
|
|
21
|
+
__export(index_exports, {
|
|
22
|
+
Admin: () => import_admin.Admin,
|
|
23
|
+
Editor: () => import_editor.Editor,
|
|
24
|
+
Lighthouse: () => import_lighthouse.Lighthouse,
|
|
25
|
+
Metrics: () => import_metrics.Metrics,
|
|
26
|
+
PageUtils: () => import_page_utils.PageUtils,
|
|
27
|
+
RequestUtils: () => import_request_utils.RequestUtils,
|
|
28
|
+
expect: () => import_test.expect,
|
|
29
|
+
test: () => import_test.test
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(index_exports);
|
|
32
|
+
__reExport(index_exports, require("./types"), module.exports);
|
|
33
|
+
var import_admin = require("./admin");
|
|
34
|
+
var import_editor = require("./editor");
|
|
35
|
+
var import_page_utils = require("./page-utils");
|
|
36
|
+
var import_request_utils = require("./request-utils");
|
|
37
|
+
var import_metrics = require("./metrics");
|
|
38
|
+
var import_lighthouse = require("./lighthouse");
|
|
39
|
+
var import_test = require("./test");
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
Admin,
|
|
43
|
+
Editor,
|
|
44
|
+
Lighthouse,
|
|
45
|
+
Metrics,
|
|
46
|
+
PageUtils,
|
|
47
|
+
RequestUtils,
|
|
48
|
+
expect,
|
|
49
|
+
test,
|
|
50
|
+
...require("./types")
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './types';\nexport { Admin } from './admin';\nexport { Editor } from './editor';\nexport { PageUtils } from './page-utils';\nexport { RequestUtils } from './request-utils';\nexport { Metrics } from './metrics';\nexport { Lighthouse } from './lighthouse';\nexport { test, expect } from './test';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,oBAAd;AACA,mBAAsB;AACtB,oBAAuB;AACvB,wBAA0B;AAC1B,2BAA6B;AAC7B,qBAAwB;AACxB,wBAA2B;AAC3B,kBAA6B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|