@wordpress/e2e-test-utils-playwright 1.45.1-next.v.202605131032.0 → 1.47.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.
Files changed (138) hide show
  1. package/build/admin/index.js +3 -0
  2. package/build/admin/index.js.map +1 -1
  3. package/build/admin/visit-site-editor.js +1 -29
  4. package/build/admin/visit-site-editor.js.map +1 -1
  5. package/build/admin/wait-for-site-editor.js +41 -0
  6. package/build/admin/wait-for-site-editor.js.map +1 -0
  7. package/build/metrics/index.js +59 -3
  8. package/build/metrics/index.js.map +1 -1
  9. package/build/request-utils/index.js +2 -0
  10. package/build/request-utils/index.js.map +1 -1
  11. package/build/request-utils/preferences.js +34 -0
  12. package/build/request-utils/preferences.js.map +1 -1
  13. package/build-types/admin/index.d.ts +3 -0
  14. package/build-types/admin/index.d.ts.map +1 -1
  15. package/build-types/admin/visit-site-editor.d.ts.map +1 -1
  16. package/build-types/admin/wait-for-site-editor.d.ts +12 -0
  17. package/build-types/admin/wait-for-site-editor.d.ts.map +1 -0
  18. package/build-types/metrics/index.d.ts +22 -5
  19. package/build-types/metrics/index.d.ts.map +1 -1
  20. package/build-types/request-utils/index.d.ts +3 -1
  21. package/build-types/request-utils/index.d.ts.map +1 -1
  22. package/build-types/request-utils/preferences.d.ts +11 -0
  23. package/build-types/request-utils/preferences.d.ts.map +1 -1
  24. package/package.json +3 -4
  25. package/build/admin/create-new-post.cjs +0 -51
  26. package/build/admin/create-new-post.cjs.map +0 -7
  27. package/build/admin/edit-post.cjs +0 -40
  28. package/build/admin/edit-post.cjs.map +0 -7
  29. package/build/admin/get-page-error.cjs +0 -36
  30. package/build/admin/get-page-error.cjs.map +0 -7
  31. package/build/admin/index.cjs +0 -59
  32. package/build/admin/index.cjs.map +0 -7
  33. package/build/admin/visit-admin-page.cjs +0 -47
  34. package/build/admin/visit-admin-page.cjs.map +0 -7
  35. package/build/admin/visit-site-editor.cjs +0 -90
  36. package/build/admin/visit-site-editor.cjs.map +0 -7
  37. package/build/config.cjs +0 -45
  38. package/build/config.cjs.map +0 -7
  39. package/build/editor/click-block-options-menu-item.cjs +0 -34
  40. package/build/editor/click-block-options-menu-item.cjs.map +0 -7
  41. package/build/editor/click-block-toolbar-button.cjs +0 -38
  42. package/build/editor/click-block-toolbar-button.cjs.map +0 -7
  43. package/build/editor/get-blocks.cjs +0 -64
  44. package/build/editor/get-blocks.cjs.map +0 -7
  45. package/build/editor/get-edited-post-content.cjs +0 -36
  46. package/build/editor/get-edited-post-content.cjs.map +0 -7
  47. package/build/editor/index.cjs +0 -97
  48. package/build/editor/index.cjs.map +0 -7
  49. package/build/editor/insert-block.cjs +0 -55
  50. package/build/editor/insert-block.cjs.map +0 -7
  51. package/build/editor/open-document-settings-sidebar.cjs +0 -42
  52. package/build/editor/open-document-settings-sidebar.cjs.map +0 -7
  53. package/build/editor/preview.cjs +0 -42
  54. package/build/editor/preview.cjs.map +0 -7
  55. package/build/editor/publish-post.cjs +0 -47
  56. package/build/editor/publish-post.cjs.map +0 -7
  57. package/build/editor/save-draft.cjs +0 -34
  58. package/build/editor/save-draft.cjs.map +0 -7
  59. package/build/editor/select-blocks.cjs +0 -51
  60. package/build/editor/select-blocks.cjs.map +0 -7
  61. package/build/editor/set-content.cjs +0 -39
  62. package/build/editor/set-content.cjs.map +0 -7
  63. package/build/editor/set-is-fixed-toolbar.cjs +0 -36
  64. package/build/editor/set-is-fixed-toolbar.cjs.map +0 -7
  65. package/build/editor/set-preferences.cjs +0 -43
  66. package/build/editor/set-preferences.cjs.map +0 -7
  67. package/build/editor/show-block-toolbar.cjs +0 -35
  68. package/build/editor/show-block-toolbar.cjs.map +0 -7
  69. package/build/editor/site-editor.cjs +0 -51
  70. package/build/editor/site-editor.cjs.map +0 -7
  71. package/build/editor/switch-editor-tool.cjs +0 -47
  72. package/build/editor/switch-editor-tool.cjs.map +0 -7
  73. package/build/editor/switch-to-legacy-canvas.cjs +0 -39
  74. package/build/editor/switch-to-legacy-canvas.cjs.map +0 -7
  75. package/build/editor/transform-block-to.cjs +0 -46
  76. package/build/editor/transform-block-to.cjs.map +0 -7
  77. package/build/index.cjs +0 -51
  78. package/build/index.cjs.map +0 -7
  79. package/build/lighthouse/index.cjs +0 -96
  80. package/build/lighthouse/index.cjs.map +0 -7
  81. package/build/metrics/index.cjs +0 -309
  82. package/build/metrics/index.cjs.map +0 -7
  83. package/build/page-utils/drag-files.cjs +0 -143
  84. package/build/page-utils/drag-files.cjs.map +0 -7
  85. package/build/page-utils/emulate-network-conditions.cjs +0 -99
  86. package/build/page-utils/emulate-network-conditions.cjs.map +0 -7
  87. package/build/page-utils/index.cjs +0 -59
  88. package/build/page-utils/index.cjs.map +0 -7
  89. package/build/page-utils/is-current-url.cjs +0 -36
  90. package/build/page-utils/is-current-url.cjs.map +0 -7
  91. package/build/page-utils/keycodes.cjs +0 -55
  92. package/build/page-utils/keycodes.cjs.map +0 -7
  93. package/build/page-utils/press-keys.cjs +0 -165
  94. package/build/page-utils/press-keys.cjs.map +0 -7
  95. package/build/page-utils/set-browser-viewport.cjs +0 -39
  96. package/build/page-utils/set-browser-viewport.cjs.map +0 -7
  97. package/build/request-utils/blocks.cjs +0 -51
  98. package/build/request-utils/blocks.cjs.map +0 -7
  99. package/build/request-utils/comments.cjs +0 -66
  100. package/build/request-utils/comments.cjs.map +0 -7
  101. package/build/request-utils/gutenberg-experiments.cjs +0 -56
  102. package/build/request-utils/gutenberg-experiments.cjs.map +0 -7
  103. package/build/request-utils/index.cjs +0 -199
  104. package/build/request-utils/index.cjs.map +0 -7
  105. package/build/request-utils/login.cjs +0 -48
  106. package/build/request-utils/login.cjs.map +0 -7
  107. package/build/request-utils/media.cjs +0 -83
  108. package/build/request-utils/media.cjs.map +0 -7
  109. package/build/request-utils/menus.cjs +0 -128
  110. package/build/request-utils/menus.cjs.map +0 -7
  111. package/build/request-utils/pages.cjs +0 -66
  112. package/build/request-utils/pages.cjs.map +0 -7
  113. package/build/request-utils/patterns.cjs +0 -44
  114. package/build/request-utils/patterns.cjs.map +0 -7
  115. package/build/request-utils/plugins.cjs +0 -81
  116. package/build/request-utils/plugins.cjs.map +0 -7
  117. package/build/request-utils/posts.cjs +0 -56
  118. package/build/request-utils/posts.cjs.map +0 -7
  119. package/build/request-utils/preferences.cjs +0 -41
  120. package/build/request-utils/preferences.cjs.map +0 -7
  121. package/build/request-utils/records.cjs +0 -37
  122. package/build/request-utils/records.cjs.map +0 -7
  123. package/build/request-utils/rest.cjs +0 -174
  124. package/build/request-utils/rest.cjs.map +0 -7
  125. package/build/request-utils/site-settings.cjs +0 -45
  126. package/build/request-utils/site-settings.cjs.map +0 -7
  127. package/build/request-utils/templates.cjs +0 -68
  128. package/build/request-utils/templates.cjs.map +0 -7
  129. package/build/request-utils/themes.cjs +0 -92
  130. package/build/request-utils/themes.cjs.map +0 -7
  131. package/build/request-utils/users.cjs +0 -83
  132. package/build/request-utils/users.cjs.map +0 -7
  133. package/build/request-utils/widgets.cjs +0 -79
  134. package/build/request-utils/widgets.cjs.map +0 -7
  135. package/build/test.cjs +0 -136
  136. package/build/test.cjs.map +0 -7
  137. package/build/types.cjs +0 -19
  138. package/build/types.cjs.map +0 -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
@@ -1,7 +0,0 @@
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,46 +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/transform-block-to.ts
21
- var transform_block_to_exports = {};
22
- __export(transform_block_to_exports, {
23
- transformBlockTo: () => transformBlockTo
24
- });
25
- module.exports = __toCommonJS(transform_block_to_exports);
26
- async function transformBlockTo(name) {
27
- await this.page.waitForFunction(
28
- () => window?.wp?.blocks && window?.wp?.data
29
- );
30
- await this.page.evaluate(
31
- ([blockName]) => {
32
- const clientIds = window.wp.data.select("core/block-editor").getSelectedBlockClientIds();
33
- const blocks = window.wp.data.select("core/block-editor").getBlocksByClientId(clientIds);
34
- window.wp.data.dispatch("core/block-editor").replaceBlocks(
35
- clientIds,
36
- window.wp.blocks.switchToBlockType(blocks, blockName)
37
- );
38
- },
39
- [name]
40
- );
41
- }
42
- // Annotate the CommonJS export names for ESM import in node:
43
- 0 && (module.exports = {
44
- transformBlockTo
45
- });
46
- //# sourceMappingURL=transform-block-to.cjs.map
@@ -1,7 +0,0 @@
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.cjs DELETED
@@ -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/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- Admin: () => import_admin.Admin,
24
- Editor: () => import_editor.Editor,
25
- Lighthouse: () => import_lighthouse.Lighthouse,
26
- Metrics: () => import_metrics.Metrics,
27
- PageUtils: () => import_page_utils.PageUtils,
28
- RequestUtils: () => import_request_utils.RequestUtils,
29
- expect: () => import_test.expect,
30
- test: () => import_test.test
31
- });
32
- module.exports = __toCommonJS(index_exports);
33
- var import_admin = require("./admin/index.cjs");
34
- var import_editor = require("./editor/index.cjs");
35
- var import_page_utils = require("./page-utils/index.cjs");
36
- var import_request_utils = require("./request-utils/index.cjs");
37
- var import_metrics = require("./metrics/index.cjs");
38
- var import_lighthouse = require("./lighthouse/index.cjs");
39
- var import_test = require("./test.cjs");
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
- });
51
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export type * 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;AACA,mBAAsB;AACtB,oBAAuB;AACvB,wBAA0B;AAC1B,2BAA6B;AAC7B,qBAAwB;AACxB,wBAA2B;AAC3B,kBAA6B;",
6
- "names": []
7
- }
@@ -1,96 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // packages/e2e-test-utils-playwright/src/lighthouse/index.ts
31
- var lighthouse_exports = {};
32
- __export(lighthouse_exports, {
33
- Lighthouse: () => Lighthouse
34
- });
35
- module.exports = __toCommonJS(lighthouse_exports);
36
- var import_core = __toESM(require("lighthouse/core/index.cjs"));
37
- var Lighthouse = class {
38
- page;
39
- port;
40
- constructor({ page, port }) {
41
- this.page = page;
42
- this.port = port;
43
- }
44
- /**
45
- * Returns the Lighthouse report for the current URL.
46
- *
47
- * Runs several Lighthouse audits in a separate browser window and returns
48
- * the summary.
49
- */
50
- async getReport() {
51
- const audits = {
52
- "largest-contentful-paint": "LCP",
53
- "total-blocking-time": "TBT",
54
- interactive: "TTI",
55
- "cumulative-layout-shift": "CLS",
56
- "interaction-to-next-paint": "INP"
57
- };
58
- const report = await (0, import_core.default)(
59
- this.page.url(),
60
- { port: this.port },
61
- {
62
- extends: "lighthouse:default",
63
- settings: {
64
- // "provided" means no throttling.
65
- // TODO: Make configurable.
66
- throttlingMethod: "provided",
67
- // Default is "mobile".
68
- // See https://github.com/GoogleChrome/lighthouse/blob/main/docs/emulation.md
69
- // TODO: Make configurable.
70
- formFactor: "desktop",
71
- screenEmulation: {
72
- disabled: true
73
- },
74
- // Speeds up the report.
75
- disableFullPageScreenshot: true,
76
- // Only run certain audits to speed things up.
77
- onlyAudits: Object.keys(audits)
78
- }
79
- }
80
- );
81
- const result = {};
82
- if (!report) {
83
- return result;
84
- }
85
- const { lhr } = report;
86
- for (const [audit, acronym] of Object.entries(audits)) {
87
- result[acronym] = lhr.audits[audit]?.numericValue || 0;
88
- }
89
- return result;
90
- }
91
- };
92
- // Annotate the CommonJS export names for ESM import in node:
93
- 0 && (module.exports = {
94
- Lighthouse
95
- });
96
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/lighthouse/index.ts"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport type { Page } from '@playwright/test';\nimport lighthouse from 'lighthouse/core/index.cjs';\n\ntype LighthouseConstructorProps = {\n\tpage: Page;\n\tport: number;\n};\n\nexport class Lighthouse {\n\tpage: Page;\n\tport: number;\n\n\tconstructor( { page, port }: LighthouseConstructorProps ) {\n\t\tthis.page = page;\n\t\tthis.port = port;\n\t}\n\n\t/**\n\t * Returns the Lighthouse report for the current URL.\n\t *\n\t * Runs several Lighthouse audits in a separate browser window and returns\n\t * the summary.\n\t */\n\tasync getReport() {\n\t\t// From https://github.com/GoogleChrome/lighthouse/blob/36cac182a6c637b1671c57326d7c0241633d0076/core/config/default-config.js#L381-L446\n\t\tconst audits = {\n\t\t\t'largest-contentful-paint': 'LCP',\n\t\t\t'total-blocking-time': 'TBT',\n\t\t\tinteractive: 'TTI',\n\t\t\t'cumulative-layout-shift': 'CLS',\n\t\t\t'interaction-to-next-paint': 'INP',\n\t\t};\n\n\t\tconst report = await lighthouse(\n\t\t\tthis.page.url(),\n\t\t\t{ port: this.port },\n\t\t\t{\n\t\t\t\textends: 'lighthouse:default',\n\t\t\t\tsettings: {\n\t\t\t\t\t// \"provided\" means no throttling.\n\t\t\t\t\t// TODO: Make configurable.\n\t\t\t\t\tthrottlingMethod: 'provided',\n\t\t\t\t\t// Default is \"mobile\".\n\t\t\t\t\t// See https://github.com/GoogleChrome/lighthouse/blob/main/docs/emulation.md\n\t\t\t\t\t// TODO: Make configurable.\n\t\t\t\t\tformFactor: 'desktop',\n\t\t\t\t\tscreenEmulation: {\n\t\t\t\t\t\tdisabled: true,\n\t\t\t\t\t},\n\t\t\t\t\t// Speeds up the report.\n\t\t\t\t\tdisableFullPageScreenshot: true,\n\t\t\t\t\t// Only run certain audits to speed things up.\n\t\t\t\t\tonlyAudits: Object.keys( audits ),\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\n\t\tconst result: Record< string, number > = {};\n\n\t\tif ( ! report ) {\n\t\t\treturn result;\n\t\t}\n\n\t\tconst { lhr } = report;\n\n\t\tfor ( const [ audit, acronym ] of Object.entries( audits ) ) {\n\t\t\tresult[ acronym ] = lhr.audits[ audit ]?.numericValue || 0;\n\t\t}\n\n\t\treturn result;\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAuB;AAOhB,IAAM,aAAN,MAAiB;AAAA,EACvB;AAAA,EACA;AAAA,EAEA,YAAa,EAAE,MAAM,KAAK,GAAgC;AACzD,SAAK,OAAO;AACZ,SAAK,OAAO;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,YAAY;AAEjB,UAAM,SAAS;AAAA,MACd,4BAA4B;AAAA,MAC5B,uBAAuB;AAAA,MACvB,aAAa;AAAA,MACb,2BAA2B;AAAA,MAC3B,6BAA6B;AAAA,IAC9B;AAEA,UAAM,SAAS,UAAM,YAAAA;AAAA,MACpB,KAAK,KAAK,IAAI;AAAA,MACd,EAAE,MAAM,KAAK,KAAK;AAAA,MAClB;AAAA,QACC,SAAS;AAAA,QACT,UAAU;AAAA;AAAA;AAAA,UAGT,kBAAkB;AAAA;AAAA;AAAA;AAAA,UAIlB,YAAY;AAAA,UACZ,iBAAiB;AAAA,YAChB,UAAU;AAAA,UACX;AAAA;AAAA,UAEA,2BAA2B;AAAA;AAAA,UAE3B,YAAY,OAAO,KAAM,MAAO;AAAA,QACjC;AAAA,MACD;AAAA,IACD;AAEA,UAAM,SAAmC,CAAC;AAE1C,QAAK,CAAE,QAAS;AACf,aAAO;AAAA,IACR;AAEA,UAAM,EAAE,IAAI,IAAI;AAEhB,eAAY,CAAE,OAAO,OAAQ,KAAK,OAAO,QAAS,MAAO,GAAI;AAC5D,aAAQ,OAAQ,IAAI,IAAI,OAAQ,KAAM,GAAG,gBAAgB;AAAA,IAC1D;AAEA,WAAO;AAAA,EACR;AACD;",
6
- "names": ["lighthouse"]
7
- }