@wordpress/e2e-tests 3.0.2 → 3.0.3

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 (43) hide show
  1. package/README.md +31 -19
  2. package/config/is-gutenberg-plugin.js +6 -0
  3. package/jest.config.js +1 -1
  4. package/jest.performance.config.js +1 -1
  5. package/mu-plugins/enable-templates-ui.php +24 -0
  6. package/package.json +7 -7
  7. package/plugins/plugins-api/error-boundary.js +11 -0
  8. package/plugins/plugins-error-boundary.php +27 -0
  9. package/specs/editor/blocks/__snapshots__/image.test.js.snap +6 -6
  10. package/specs/editor/blocks/__snapshots__/navigation.test.js.snap +0 -2
  11. package/specs/editor/blocks/cover.test.js +7 -3
  12. package/specs/editor/blocks/gallery.test.js +6 -1
  13. package/specs/editor/blocks/heading.test.js +1 -11
  14. package/specs/editor/blocks/navigation.test.js +0 -50
  15. package/specs/editor/plugins/__snapshots__/plugins-api.test.js.snap +2 -2
  16. package/specs/editor/plugins/block-variations.test.js +2 -2
  17. package/specs/editor/plugins/plugins-api.test.js +30 -0
  18. package/specs/editor/plugins/templates.test.js +1 -7
  19. package/specs/editor/various/__snapshots__/inserting-blocks.test.js.snap +1 -1
  20. package/specs/editor/various/__snapshots__/keep-styles-on-block-transforms.test.js.snap +35 -0
  21. package/specs/editor/various/fullscreen-mode.test.js +1 -1
  22. package/specs/editor/various/keep-styles-on-block-transforms.test.js +81 -0
  23. package/specs/editor/various/post-visibility.test.js +54 -0
  24. package/specs/editor/various/style-variation.test.js +9 -5
  25. package/specs/performance/site-editor.test.js +2 -3
  26. package/specs/site-editor/document-settings.test.js +8 -10
  27. package/specs/site-editor/multi-entity-editing.test.js +12 -14
  28. package/specs/site-editor/multi-entity-saving.test.js +3 -9
  29. package/specs/site-editor/settings-sidebar.test.js +3 -8
  30. package/specs/site-editor/site-editor-export.test.js +8 -9
  31. package/specs/site-editor/site-editor-inserter.test.js +6 -8
  32. package/specs/site-editor/style-variations.test.js +211 -0
  33. package/specs/site-editor/template-part.test.js +5 -10
  34. package/specs/site-editor/template-revert.test.js +18 -28
  35. package/themes/style-variations/block-templates/index.html +11 -0
  36. package/themes/style-variations/index.php +0 -0
  37. package/themes/style-variations/style.css +15 -0
  38. package/themes/style-variations/styles/pink.json +33 -0
  39. package/themes/style-variations/styles/yellow.json +12 -0
  40. package/themes/style-variations/theme.json +8 -0
  41. package/config/gutenberg-phase.js +0 -9
  42. package/specs/editor/various/__snapshots__/style-variation.test.js.snap +0 -7
  43. package/specs/site-editor/utils.js +0 -153
package/README.md CHANGED
@@ -18,31 +18,38 @@ The following commands are available on the Gutenberg repo:
18
18
  {
19
19
  "test-e2e": "wp-scripts test-e2e --config packages/e2e-tests/jest.config.js",
20
20
  "test-e2e:debug": "wp-scripts --inspect-brk test-e2e --config packages/e2e-tests/jest.config.js --puppeteer-devtools",
21
- "test-e2e:watch": "npm run test-e2e -- --watch",
21
+ "test-e2e:watch": "npm run test-e2e -- --watch"
22
22
  }
23
23
  ```
24
24
 
25
25
  ### Run all available tests
26
+
26
27
  ```bash
27
28
  npm run test-e2e
28
29
  ```
30
+
29
31
  ### Run all available tests and listen for changes.
32
+
30
33
  ```bash
31
34
  npm run test-e2e:watch
32
35
  ```
33
36
 
34
37
  ### Run a specific test file
38
+
35
39
  ```bash
36
40
  npm run test-e2e -- packages/e2e-test/<path_to_test_file>
37
41
  # Or, in order to watch for changes:
38
42
  npm run test-e2e:watch -- packages/e2e-test/<path_to_test_file>
39
43
  ```
44
+
40
45
  ### Debugging
41
46
 
42
47
  Makes e2e tests available to debug in a Chrome Browser.
48
+
43
49
  ```bash
44
50
  npm run test-e2e:debug
45
51
  ```
52
+
46
53
  After running the command, tests will be available for debugging in Chrome by going to chrome://inspect/#devices and clicking `inspect` under the path to `/test-e2e.js`.
47
54
 
48
55
  #### Debugging in `vscode`
@@ -51,27 +58,32 @@ Debugging in a Chrome browser can be replaced with `vscode`'s debugger by adding
51
58
 
52
59
  ```json
53
60
  {
54
- "type": "node",
55
- "request": "launch",
56
- "name": "Debug current e2e test",
57
- "program": "${workspaceFolder}/node_modules/@wordpress/scripts/bin/wp-scripts.js",
58
- "args": [
59
- "test-e2e",
60
- "--config=${workspaceFolder}/packages/e2e-tests/jest.config.js",
61
- "--verbose=true",
62
- "--runInBand",
63
- "--watch",
64
- "${file}"
65
- ],
66
- "console": "integratedTerminal",
67
- "internalConsoleOptions": "neverOpen",
68
- "trace": "all"
69
- }
61
+ "type": "node",
62
+ "request": "launch",
63
+ "name": "Debug current e2e test",
64
+ "program": "${workspaceFolder}/node_modules/@wordpress/scripts/bin/wp-scripts.js",
65
+ "args": [
66
+ "test-e2e",
67
+ "--config=${workspaceFolder}/packages/e2e-tests/jest.config.js",
68
+ "--verbose=true",
69
+ "--runInBand",
70
+ "--watch",
71
+ "${file}"
72
+ ],
73
+ "console": "integratedTerminal",
74
+ "internalConsoleOptions": "neverOpen",
75
+ "trace": "all"
76
+ }
70
77
  ```
71
78
 
72
79
  This will run jest, targetting the spec file currently open in the editor. `vscode`'s debugger can now be used to add breakpoints and inspect tests as you would in Chrome DevTools.
73
80
 
74
-
75
81
  **Note**: This package requires Node.js 12.0.0 or later. It is not compatible with older versions.
76
82
 
77
- <br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
83
+ ## Contributing to this package
84
+
85
+ This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/) and used by [WordPress](https://make.wordpress.org/core/) as well as other software projects.
86
+
87
+ To find out more about contributing to this package or Gutenberg as a whole, please read the project's main [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).
88
+
89
+ <br /><br /><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
@@ -0,0 +1,6 @@
1
+ global.process.env = {
2
+ ...global.process.env,
3
+ // Inject the `IS_GUTENBERG_PLUGIN` global, used for feature flagging.
4
+ // eslint-disable-next-line @wordpress/is-gutenberg-plugin
5
+ IS_GUTENBERG_PLUGIN: process.env.npm_package_config_IS_GUTENBERG_PLUGIN,
6
+ };
package/jest.config.js CHANGED
@@ -6,7 +6,7 @@ const baseConfig = require( '@wordpress/scripts/config/jest-e2e.config' );
6
6
  module.exports = {
7
7
  ...baseConfig,
8
8
  testMatch: [ '<rootDir>/specs/**/*.test.js' ],
9
- setupFiles: [ '<rootDir>/config/gutenberg-phase.js' ],
9
+ setupFiles: [ '<rootDir>/config/is-gutenberg-plugin.js' ],
10
10
  setupFilesAfterEnv: [
11
11
  '<rootDir>/config/setup-test-framework.js',
12
12
  '@wordpress/jest-console',
@@ -1,7 +1,7 @@
1
1
  module.exports = {
2
2
  ...require( '@wordpress/scripts/config/jest-e2e.config' ),
3
3
  testMatch: [ '**/performance/*.test.js' ],
4
- setupFiles: [ '<rootDir>/config/gutenberg-phase.js' ],
4
+ setupFiles: [ '<rootDir>/config/is-gutenberg-plugin.js' ],
5
5
  setupFilesAfterEnv: [
6
6
  '<rootDir>/config/setup-performance-test.js',
7
7
  '@wordpress/jest-console',
@@ -0,0 +1,24 @@
1
+ <?php
2
+ /**
3
+ * Plugin Name: Gutenberg Test Plugin, Enable Templates UI
4
+ * Plugin URI: https://github.com/WordPress/gutenberg
5
+ * Author: Gutenberg Team
6
+ *
7
+ * @package gutenberg-test-enable-templates-ui
8
+ */
9
+
10
+ /**
11
+ * Enable Templates & Template Parts post type UI during e2e testing.
12
+ */
13
+ add_filter(
14
+ 'register_post_type_args',
15
+ static function( $args, $name ) {
16
+ if ( in_array( $name, array( 'wp_template', 'wp_template_part' ), true ) ) {
17
+ $args['show_ui'] = wp_is_block_theme();
18
+ }
19
+
20
+ return $args;
21
+ },
22
+ 20,
23
+ 2
24
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-tests",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "End-To-End (E2E) tests for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -23,11 +23,11 @@
23
23
  "node": ">=12"
24
24
  },
25
25
  "dependencies": {
26
- "@wordpress/e2e-test-utils": "^6.0.0",
27
- "@wordpress/jest-console": "^5.0.0",
28
- "@wordpress/jest-puppeteer-axe": "^4.0.0",
29
- "@wordpress/scripts": "^20.0.2",
30
- "@wordpress/url": "^3.4.0",
26
+ "@wordpress/e2e-test-utils": "^6.0.1",
27
+ "@wordpress/jest-console": "^5.0.1",
28
+ "@wordpress/jest-puppeteer-axe": "^4.0.1",
29
+ "@wordpress/scripts": "^21.0.0",
30
+ "@wordpress/url": "^3.4.1",
31
31
  "chalk": "^4.0.0",
32
32
  "expect-puppeteer": "^4.4.0",
33
33
  "filenamify": "^4.2.0",
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "18622e5a81938848395e5a79eb4664a5fdd8f3c3"
47
+ "gitHead": "2e4922861e49f5a090f9dc52056165092cfba163"
48
48
  }
@@ -0,0 +1,11 @@
1
+ ( function () {
2
+ const registerPlugin = wp.plugins.registerPlugin;
3
+
4
+ function MyErrorPlugin() {
5
+ throw new Error('Whoops!');
6
+ }
7
+
8
+ registerPlugin( 'my-error-plugin', {
9
+ render: MyErrorPlugin,
10
+ } );
11
+ } )();
@@ -0,0 +1,27 @@
1
+ <?php
2
+ /**
3
+ * Plugin Name: Gutenberg Test Plugin, Plugins Error Boundary
4
+ * Plugin URI: https://github.com/WordPress/gutenberg
5
+ * Author: Gutenberg Team
6
+ *
7
+ * @package gutenberg-test-plugin-plugins-error-boundary
8
+ */
9
+
10
+ /**
11
+ * Registers custom scripts for the plugin error boundary.
12
+ */
13
+ function enqueue_plugins_error_boundary_plugin_scripts() {
14
+ wp_enqueue_script(
15
+ 'gutenberg-test-plugin-plugins-error-boundary',
16
+ plugins_url( 'plugins-api/error-boundary.js', __FILE__ ),
17
+ array(
18
+ 'wp-edit-post',
19
+ 'wp-element',
20
+ 'wp-i18n',
21
+ 'wp-plugins',
22
+ ),
23
+ filemtime( plugin_dir_path( __FILE__ ) . 'plugins-api/error-boundary.js' ),
24
+ true
25
+ );
26
+ }
27
+ add_action( 'init', 'enqueue_plugins_error_boundary_plugin_scripts' );
@@ -1,16 +1,16 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Image allows changing aspect ratio using the crop tools 1`] = `"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAIQAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAAAChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0AAAB3AAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAFgAAAAcAHMAUgBHAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhZWiAAAAAAAABvogAAOPUAAAOQWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAJKAAAA+EAAC2z3BhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABYWVogAAAAAAAA9tYAAQAAAADTLW1sdWMAAAAAAAAAAQAAAAxlblVTAAAAIAAAABwARwBvAG8AZwBsAGUAIABJAG4AYwAuACAAMgAwADEANv/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C2z3BhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABYWVogAAAAAAAA9tYAAQAAAADTLW1sdWMAAAAAAAAAAQAAAAxlblVTAAAAIAAAABwARwBvAG8AZwBsAGUAIABJAG4AYwAuACAAMgAwADEANv/bAEMAAwICAgICAwICAgMDAwMEBgQEBAQECAYGBQYJCAoKCQgJCQoMDwwKCw4LCQkNEQ0ODxAQERAKDBITEhATDxAQEP/bAEMBAwMDBAMECAQECBALCQsQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEP/AABEIAAoACgMBIgACEQEDEQH/xAAVAAEBAAAAAAAAAAAAAAAAAAAJB//EACAQAAADCQEAAAAAAAAAAAAAAAAEBQEDBgk1OHR3srX/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AlMlS6eKdfnvRTgrytVTuQ86aChkqXTxTr896KcFeVqqdyHnTQH//2Q=="`;
4
4
 
5
- exports[`Image allows changing aspect ratio using the crop tools 2`] = `"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gIoSUNDX1BST0ZJTEUAAQEAAAIYAAAAAAIQAABtbnRyUkdCIFhZWiAAAAAAAAAAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAAAChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0AAAB3AAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAFgAAAAcAHMAUgBHAEIAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAAHRyWFlaAAABZAAAABRnWFlaAAABeAAAABRiWFlaAAABjAAAABRyVFJDAAABoAAAAChnVFJDAAABoAAAAChiVFJDAAABoAAAACh3dHB0AAAByAAAABRjcHJ0AAAB3AAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAFgAAAAcAHMAUgBHAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhZWiAAAAAAAABvogAAOPUAAAOQWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAJKAAAA+EAAC2z3BhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABYWVogAAAAAAAA9tYAAQAAAADTLW1sdWMAAAAAAAAAAQAAAAxlblVTAAAAIAAAABwARwBvAG8AZwBsAGUAIABJAG4AYwAuACAAMgAwADEANv/bAEMAAwICAgICAwICAgMDAwMEBgQEBAQECAYGBQYJCAoKCQgJCQoMDwwKCw4LCQkNEQ0ODxAQERAKDBITEhATDxAQEP/bAEMBAwMDBAMECAQECBALCQsQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEP/AABEIAAUABQMBIgACEQEDEQH/xAAVAAEBAAAAAAAAAAAAAAAAAAAACP/EABoQAQABBQAAAAAAAAAAAAAAAAAEBwk4hbX/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8Aqm1xgnTLddiaAD//2Q=="`;
14
14
 
15
15
  exports[`Image should drag and drop files into media placeholder 1`] = `
16
16
  "<!-- wp:image -->
@@ -42,8 +42,6 @@ exports[`Navigation placeholder allows a navigation block to be created from exi
42
42
  <!-- /wp:navigation-submenu -->"
43
43
  `;
44
44
 
45
- exports[`Navigation placeholder allows a navigation block to be created using existing pages 1`] = `"<!-- wp:page-list /-->"`;
46
-
47
45
  exports[`Navigation placeholder creates an empty navigation block when the selected existing menu is also empty 1`] = `""`;
48
46
 
49
47
  exports[`Navigation supports navigation blocks that have inner blocks within their markup and converts them to wp_navigation posts 1`] = `"<!-- wp:page-list /-->"`;
@@ -196,10 +196,14 @@ describe( 'Cover', () => {
196
196
  it( 'dims the background image down by 50% when transformed from the Image block', async () => {
197
197
  await insertBlock( 'Image' );
198
198
  // Upload image and transform to the Cover block
199
- await upload( '.wp-block-image' );
200
- // Click the block wrapper before trying to convert to make sure figcaption toolbar is not obscuring
199
+ const filename = await upload( '.wp-block-image' );
200
+ await page.waitForSelector(
201
+ `.wp-block-image img[src$="${ filename }.png"]`
202
+ );
203
+
204
+ // Focus the block wrapper before trying to convert to make sure figcaption toolbar is not obscuring
201
205
  // the block toolbar.
202
- await page.click( '.wp-block-image' );
206
+ await page.focus( '.wp-block-image' );
203
207
  await transformBlockTo( 'Cover' );
204
208
 
205
209
  // Get the block's background dim color and its opacity
@@ -57,8 +57,13 @@ describe( 'Gallery', () => {
57
57
 
58
58
  await insertBlock( 'Gallery' );
59
59
  await upload( '.wp-block-gallery input[type="file"]' );
60
+ await page.waitForSelector( '.wp-block-gallery .wp-block-image' );
60
61
 
61
- await page.click( '.wp-block-gallery>.blocks-gallery-caption' );
62
+ // The newly added image gets the focus, so refocus parent Gallery
63
+ // block before trying to edit caption.
64
+ await clickButton( 'Gallery' );
65
+
66
+ await page.click( '.wp-block-gallery .blocks-gallery-caption' );
62
67
  await page.keyboard.type( galleryCaption );
63
68
 
64
69
  expect( await getEditedPostContent() ).toMatch(
@@ -10,14 +10,12 @@ import {
10
10
 
11
11
  describe( 'Heading', () => {
12
12
  const COLOR_ITEM_SELECTOR =
13
- '.block-editor-panel-color-gradient-settings__item';
13
+ '.block-editor-panel-color-gradient-settings__dropdown';
14
14
  const CUSTOM_COLOR_BUTTON_X_SELECTOR = `.components-color-palette__custom-color`;
15
15
  const CUSTOM_COLOR_DETAILS_BUTTON_SELECTOR =
16
16
  '.components-color-picker button[aria-label="Show detailed inputs"]';
17
17
  const COLOR_INPUT_FIELD_SELECTOR =
18
18
  '.components-color-picker .components-input-control__input';
19
- const COLOR_PANEL_TOGGLE_X_SELECTOR =
20
- "//button[./span[contains(text(),'Color')]]";
21
19
 
22
20
  beforeEach( async () => {
23
21
  await createNewPost();
@@ -73,10 +71,6 @@ describe( 'Heading', () => {
73
71
  it( 'should correctly apply custom colors', async () => {
74
72
  await clickBlockAppender();
75
73
  await page.keyboard.type( '### Heading' );
76
- const colorPanelToggle = await page.waitForXPath(
77
- COLOR_PANEL_TOGGLE_X_SELECTOR
78
- );
79
- await colorPanelToggle.click();
80
74
 
81
75
  const textColorButton = await page.waitForSelector(
82
76
  COLOR_ITEM_SELECTOR
@@ -101,10 +95,6 @@ describe( 'Heading', () => {
101
95
  it( 'should correctly apply named colors', async () => {
102
96
  await clickBlockAppender();
103
97
  await page.keyboard.type( '## Heading' );
104
- const [ colorPanelToggle ] = await page.$x(
105
- COLOR_PANEL_TOGGLE_X_SELECTOR
106
- );
107
- await colorPanelToggle.click();
108
98
 
109
99
  const textColorButton = await page.waitForSelector(
110
100
  COLOR_ITEM_SELECTOR
@@ -124,7 +124,6 @@ async function selectClassicMenu( optionText ) {
124
124
  const PLACEHOLDER_ACTIONS_CLASS = 'wp-block-navigation-placeholder__actions';
125
125
  const PLACEHOLDER_ACTIONS_XPATH = `//*[contains(@class, '${ PLACEHOLDER_ACTIONS_CLASS }')]`;
126
126
  const START_EMPTY_XPATH = `${ PLACEHOLDER_ACTIONS_XPATH }//button[text()='Start empty']`;
127
- const ADD_ALL_PAGES_XPATH = `${ PLACEHOLDER_ACTIONS_XPATH }//button[text()='Add all pages']`;
128
127
  const SELECT_MENU_XPATH = `${ PLACEHOLDER_ACTIONS_XPATH }//button[text()='Select menu']`;
129
128
 
130
129
  /**
@@ -154,24 +153,6 @@ async function deleteAll( endpoints ) {
154
153
  }
155
154
  }
156
155
 
157
- /**
158
- * Create a set of pages using the REST API.
159
- *
160
- * @param {Array} pages An array of page objects.
161
- */
162
- async function createPages( pages ) {
163
- for ( const page of pages ) {
164
- await rest( {
165
- method: 'POST',
166
- path: PAGES_ENDPOINT,
167
- data: {
168
- status: 'publish',
169
- ...page,
170
- },
171
- } );
172
- }
173
- }
174
-
175
156
  /**
176
157
  * Replace unique ids in nav block content, since these won't be consistent
177
158
  * between test runs.
@@ -257,37 +238,6 @@ describe( 'Navigation', () => {
257
238
  } );
258
239
 
259
240
  describe( 'placeholder', () => {
260
- it( 'allows a navigation block to be created using existing pages', async () => {
261
- await createPages( [
262
- {
263
- title: 'About',
264
- menu_order: 0,
265
- },
266
- {
267
- title: 'Contact Us',
268
- menu_order: 1,
269
- },
270
- {
271
- title: 'FAQ',
272
- menu_order: 2,
273
- },
274
- ] );
275
-
276
- await createNewPost();
277
-
278
- // Add the navigation block.
279
- await insertBlock( 'Navigation' );
280
- const allPagesButton = await page.waitForXPath(
281
- ADD_ALL_PAGES_XPATH
282
- );
283
- await allPagesButton.click();
284
-
285
- // Wait for the page list block to be present
286
- await page.waitForSelector( 'ul[aria-label="Block: Page List"]' );
287
-
288
- expect( await getNavigationMenuRawContent() ).toMatchSnapshot();
289
- } );
290
-
291
241
  it( 'allows a navigation block to be created from existing menus', async () => {
292
242
  await createClassicMenu( { name: 'Test Menu 1' } );
293
243
  await createClassicMenu(
@@ -2,6 +2,6 @@
2
2
 
3
3
  exports[`Using Plugins API Document Setting Custom Panel Should render a custom panel inside Document Setting sidebar 1`] = `"My Custom Panel"`;
4
4
 
5
- exports[`Using Plugins API Sidebar Medium screen Should open plugins sidebar using More Menu item and render content 1`] = `"<div class=\\"components-panel__header interface-complementary-area-header__small\\"><span class=\\"interface-complementary-area-header__small-title\\">(no title)</span><button type=\\"button\\" class=\\"components-button has-icon\\" aria-label=\\"Close plugin\\"><svg width=\\"24\\" height=\\"24\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" role=\\"img\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z\\"></path></svg></button></div><div class=\\"components-panel__header interface-complementary-area-header\\" tabindex=\\"-1\\"><strong>Plugin sidebar title</strong><button type=\\"button\\" aria-pressed=\\"true\\" aria-expanded=\\"true\\" class=\\"components-button interface-complementary-area__pin-unpin-item is-pressed has-icon\\" aria-label=\\"Unpin from toolbar\\"><svg width=\\"24\\" height=\\"24\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" role=\\"img\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z\\"></path></svg></button><button type=\\"button\\" class=\\"components-button has-icon\\" aria-label=\\"Close plugin\\"><svg width=\\"24\\" height=\\"24\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" role=\\"img\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z\\"></path></svg></button></div><div class=\\"components-panel\\"><div class=\\"components-panel__body sidebar-title-plugin-panel is-opened\\"><div class=\\"components-panel__row\\"><label for=\\"title-plain-text\\">Title:</label><textarea class=\\"block-editor-plain-text\\" id=\\"title-plain-text\\" placeholder=\\"(no title)\\" rows=\\"1\\" style=\\"overflow: hidden; overflow-wrap: break-word; resize: none; height: 18px;\\"></textarea></div><div class=\\"components-panel__row\\"><button type=\\"button\\" class=\\"components-button is-primary\\">Reset</button></div></div></div>"`;
5
+ exports[`Using Plugins API Sidebar Medium screen Should open plugins sidebar using More Menu item and render content 1`] = `"<div class=\\"components-panel__header interface-complementary-area-header__small\\"><span class=\\"interface-complementary-area-header__small-title\\">(no title)</span><button type=\\"button\\" class=\\"components-button has-icon\\" aria-label=\\"Close plugin\\"><svg width=\\"24\\" height=\\"24\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z\\"></path></svg></button></div><div class=\\"components-panel__header interface-complementary-area-header\\" tabindex=\\"-1\\"><strong>Plugin sidebar title</strong><button type=\\"button\\" aria-pressed=\\"true\\" aria-expanded=\\"true\\" class=\\"components-button interface-complementary-area__pin-unpin-item is-pressed has-icon\\" aria-label=\\"Unpin from toolbar\\"><svg width=\\"24\\" height=\\"24\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z\\"></path></svg></button><button type=\\"button\\" class=\\"components-button has-icon\\" aria-label=\\"Close plugin\\"><svg width=\\"24\\" height=\\"24\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z\\"></path></svg></button></div><div class=\\"components-panel\\"><div class=\\"components-panel__body sidebar-title-plugin-panel is-opened\\"><div class=\\"components-panel__row\\"><label for=\\"title-plain-text\\">Title:</label><textarea class=\\"block-editor-plain-text\\" id=\\"title-plain-text\\" placeholder=\\"(no title)\\" rows=\\"1\\" style=\\"overflow: hidden; overflow-wrap: break-word; resize: none; height: 18px;\\"></textarea></div><div class=\\"components-panel__row\\"><button type=\\"button\\" class=\\"components-button is-primary\\">Reset</button></div></div></div>"`;
6
6
 
7
- exports[`Using Plugins API Sidebar Should open plugins sidebar using More Menu item and render content 1`] = `"<div class=\\"components-panel__header interface-complementary-area-header__small\\"><span class=\\"interface-complementary-area-header__small-title\\">(no title)</span><button type=\\"button\\" class=\\"components-button has-icon\\" aria-label=\\"Close plugin\\"><svg width=\\"24\\" height=\\"24\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" role=\\"img\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z\\"></path></svg></button></div><div class=\\"components-panel__header interface-complementary-area-header\\" tabindex=\\"-1\\"><strong>Plugin sidebar title</strong><button type=\\"button\\" aria-pressed=\\"true\\" aria-expanded=\\"true\\" class=\\"components-button interface-complementary-area__pin-unpin-item is-pressed has-icon\\" aria-label=\\"Unpin from toolbar\\"><svg width=\\"24\\" height=\\"24\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" role=\\"img\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z\\"></path></svg></button><button type=\\"button\\" class=\\"components-button has-icon\\" aria-label=\\"Close plugin\\"><svg width=\\"24\\" height=\\"24\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" role=\\"img\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z\\"></path></svg></button></div><div class=\\"components-panel\\"><div class=\\"components-panel__body sidebar-title-plugin-panel is-opened\\"><div class=\\"components-panel__row\\"><label for=\\"title-plain-text\\">Title:</label><textarea class=\\"block-editor-plain-text\\" id=\\"title-plain-text\\" placeholder=\\"(no title)\\" rows=\\"1\\" style=\\"overflow: hidden; overflow-wrap: break-word; resize: none; height: 18px;\\"></textarea></div><div class=\\"components-panel__row\\"><button type=\\"button\\" class=\\"components-button is-primary\\">Reset</button></div></div></div>"`;
7
+ exports[`Using Plugins API Sidebar Should open plugins sidebar using More Menu item and render content 1`] = `"<div class=\\"components-panel__header interface-complementary-area-header__small\\"><span class=\\"interface-complementary-area-header__small-title\\">(no title)</span><button type=\\"button\\" class=\\"components-button has-icon\\" aria-label=\\"Close plugin\\"><svg width=\\"24\\" height=\\"24\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z\\"></path></svg></button></div><div class=\\"components-panel__header interface-complementary-area-header\\" tabindex=\\"-1\\"><strong>Plugin sidebar title</strong><button type=\\"button\\" aria-pressed=\\"true\\" aria-expanded=\\"true\\" class=\\"components-button interface-complementary-area__pin-unpin-item is-pressed has-icon\\" aria-label=\\"Unpin from toolbar\\"><svg width=\\"24\\" height=\\"24\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z\\"></path></svg></button><button type=\\"button\\" class=\\"components-button has-icon\\" aria-label=\\"Close plugin\\"><svg width=\\"24\\" height=\\"24\\" xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" aria-hidden=\\"true\\" focusable=\\"false\\"><path d=\\"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z\\"></path></svg></button></div><div class=\\"components-panel\\"><div class=\\"components-panel__body sidebar-title-plugin-panel is-opened\\"><div class=\\"components-panel__row\\"><label for=\\"title-plain-text\\">Title:</label><textarea class=\\"block-editor-plain-text\\" id=\\"title-plain-text\\" placeholder=\\"(no title)\\" rows=\\"1\\" style=\\"overflow: hidden; overflow-wrap: break-word; resize: none; height: 18px;\\"></textarea></div><div class=\\"components-panel__row\\"><button type=\\"button\\" class=\\"components-button is-primary\\">Reset</button></div></div></div>"`;
@@ -104,7 +104,7 @@ describe( 'Block variations', () => {
104
104
  'Display block breadcrumbs',
105
105
  true
106
106
  );
107
- await toggleMoreMenu();
107
+ await toggleMoreMenu( 'close' );
108
108
  } );
109
109
 
110
110
  afterEach( async () => {
@@ -113,7 +113,7 @@ describe( 'Block variations', () => {
113
113
  'Display block breadcrumbs',
114
114
  false
115
115
  );
116
- await toggleMoreMenu();
116
+ await toggleMoreMenu( 'close' );
117
117
  } );
118
118
 
119
119
  const getActiveBreadcrumb = async () =>
@@ -156,4 +156,34 @@ describe( 'Using Plugins API', () => {
156
156
  expect( pluginDocumentSettingsText ).toMatchSnapshot();
157
157
  } );
158
158
  } );
159
+
160
+ describe( 'Error Boundary', () => {
161
+ beforeAll( async () => {
162
+ await activatePlugin(
163
+ 'gutenberg-test-plugin-plugins-error-boundary'
164
+ );
165
+ } );
166
+
167
+ afterAll( async () => {
168
+ await deactivatePlugin(
169
+ 'gutenberg-test-plugin-plugins-error-boundary'
170
+ );
171
+ } );
172
+
173
+ it( 'Should create notice using plugin error boundary callback', async () => {
174
+ const noticeContent = await page.waitForSelector(
175
+ '.is-error .components-notice__content'
176
+ );
177
+ expect(
178
+ await page.evaluate(
179
+ ( _noticeContent ) => _noticeContent.firstChild.nodeValue,
180
+ noticeContent
181
+ )
182
+ ).toEqual(
183
+ 'The "my-error-plugin" plugin has encountered an error and cannot be rendered.'
184
+ );
185
+
186
+ expect( console ).toHaveErrored();
187
+ } );
188
+ } );
159
189
  } );
@@ -3,7 +3,6 @@
3
3
  */
4
4
  import {
5
5
  activatePlugin,
6
- clickBlockAppender,
7
6
  createNewPost,
8
7
  deactivatePlugin,
9
8
  getEditedPostContent,
@@ -100,12 +99,7 @@ describe( 'templates', () => {
100
99
  // Remove the default block template to verify that it's not
101
100
  // re-added after saving and reloading the editor.
102
101
  await page.type( '.editor-post-title__input', 'My Image Format' );
103
- await clickBlockAppender();
104
- await page.keyboard.press( 'Backspace' );
105
- // Wait for the selection to update.
106
- await page.evaluate(
107
- () => new Promise( window.requestAnimationFrame )
108
- );
102
+ await page.click( '.wp-block-image' );
109
103
  await page.keyboard.press( 'Backspace' );
110
104
  await saveDraft();
111
105
  await page.reload();
@@ -89,7 +89,7 @@ exports[`Inserting blocks inserts a block in proper place after having clicked \
89
89
  <!-- /wp:paragraph -->
90
90
 
91
91
  <!-- wp:cover {\\"isDark\\":false} -->
92
- <div class=\\"wp-block-cover is-light\\"><span aria-hidden=\\"true\\" class=\\"has-background-dim-100 wp-block-cover__gradient-background has-background-dim\\"></span><div class=\\"wp-block-cover__inner-container\\"></div></div>
92
+ <div class=\\"wp-block-cover is-light\\"><span aria-hidden=\\"true\\" class=\\"wp-block-cover__background has-background-dim-100 has-background-dim\\"></span><div class=\\"wp-block-cover__inner-container\\"></div></div>
93
93
  <!-- /wp:cover -->
94
94
 
95
95
  <!-- wp:heading -->
@@ -0,0 +1,35 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Keep styles on block transforms Should keep colors during a transform 1`] = `
4
+ "<!-- wp:paragraph {\\"textColor\\":\\"luminous-vivid-orange\\"} -->
5
+ <p class=\\"has-luminous-vivid-orange-color has-text-color\\">Heading</p>
6
+ <!-- /wp:paragraph -->"
7
+ `;
8
+
9
+ exports[`Keep styles on block transforms Should keep the font size during a transform from multiple blocks into a single one 1`] = `
10
+ "<!-- wp:list {\\"fontSize\\":\\"large\\"} -->
11
+ <ul class=\\"has-large-font-size\\"><li>Line 1 to be made large</li><li>Line 2 to be made large</li><li>Line 3 to be made large</li></ul>
12
+ <!-- /wp:list -->"
13
+ `;
14
+
15
+ exports[`Keep styles on block transforms Should keep the font size during a transform from multiple blocks into multiple blocks 1`] = `
16
+ "<!-- wp:heading {\\"fontSize\\":\\"large\\"} -->
17
+ <h2 class=\\"has-large-font-size\\" id=\\"line-1-to-be-made-large\\">Line 1 to be made large</h2>
18
+ <!-- /wp:heading -->
19
+
20
+ <!-- wp:heading {\\"fontSize\\":\\"large\\"} -->
21
+ <h2 class=\\"has-large-font-size\\" id=\\"line-2-to-be-made-large\\">Line 2 to be made large</h2>
22
+ <!-- /wp:heading -->
23
+
24
+ <!-- wp:heading {\\"fontSize\\":\\"large\\"} -->
25
+ <h2 class=\\"has-large-font-size\\" id=\\"line-3-to-be-made-large\\">Line 3 to be made large</h2>
26
+ <!-- /wp:heading -->"
27
+ `;
28
+
29
+ exports[`Keep styles on block transforms Should not include styles in the group block when grouping a block 1`] = `
30
+ "<!-- wp:group -->
31
+ <div class=\\"wp-block-group\\"><!-- wp:paragraph {\\"fontSize\\":\\"large\\"} -->
32
+ <p class=\\"has-large-font-size\\">Line 1 to be made large</p>
33
+ <!-- /wp:paragraph --></div>
34
+ <!-- /wp:group -->"
35
+ `;
@@ -14,7 +14,7 @@ describe( 'Fullscreen Mode', () => {
14
14
 
15
15
  it( 'should open the fullscreen mode from the more menu', async () => {
16
16
  await clickOnMoreMenuItem( 'Fullscreen mode' );
17
- await toggleMoreMenu();
17
+ await toggleMoreMenu( 'close' );
18
18
 
19
19
  const isFullscreenEnabled = await page.$eval( 'body', ( body ) => {
20
20
  return body.classList.contains( 'is-fullscreen-mode' );