@wordpress/e2e-tests 3.0.7 → 3.0.10-next.a55ed9455a.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 (74) hide show
  1. package/config/setup-performance-test.js +1 -1
  2. package/config/setup-test-framework.js +1 -1
  3. package/package.json +7 -7
  4. package/specs/editor/blocks/__snapshots__/heading.test.js.snap +8 -8
  5. package/specs/editor/blocks/__snapshots__/navigation.test.js.snap +16 -16
  6. package/specs/editor/blocks/__snapshots__/quote.test.js.snap +10 -10
  7. package/specs/editor/blocks/classic.test.js +2 -2
  8. package/specs/editor/blocks/cover.test.js +17 -17
  9. package/specs/editor/blocks/image.test.js +4 -3
  10. package/specs/editor/blocks/list.test.js +1 -1
  11. package/specs/editor/blocks/navigation.test.js +392 -65
  12. package/specs/editor/blocks/table.test.js +1 -1
  13. package/specs/editor/plugins/align-hook.test.js +10 -10
  14. package/specs/editor/plugins/block-context.test.js +1 -1
  15. package/specs/editor/plugins/block-directory-add.test.js +14 -14
  16. package/specs/editor/plugins/custom-post-types.test.js +1 -1
  17. package/specs/editor/plugins/custom-taxonomies.test.js +3 -3
  18. package/specs/editor/plugins/meta-attribute-block.test.js +1 -1
  19. package/specs/editor/plugins/meta-boxes.test.js +3 -3
  20. package/specs/editor/plugins/templates.test.js +1 -1
  21. package/specs/editor/plugins/wp-editor-meta-box.test.js +1 -1
  22. package/specs/editor/various/__snapshots__/block-grouping.test.js.snap +4 -4
  23. package/specs/editor/various/__snapshots__/inserting-blocks.test.js.snap +2 -2
  24. package/specs/editor/various/__snapshots__/keep-styles-on-block-transforms.test.js.snap +3 -3
  25. package/specs/editor/various/autosave.test.js +19 -19
  26. package/specs/editor/various/block-deletion.test.js +5 -5
  27. package/specs/editor/various/block-grouping.test.js +29 -12
  28. package/specs/editor/various/block-hierarchy-navigation.test.js +5 -5
  29. package/specs/editor/various/change-detection.test.js +3 -3
  30. package/specs/editor/various/compatibility-classic-editor.test.js +1 -1
  31. package/specs/editor/various/copy-cut-paste-whole-blocks.test.js +7 -7
  32. package/specs/editor/various/datepicker.test.js +1 -1
  33. package/specs/editor/various/duplicating-blocks.test.js +3 -3
  34. package/specs/editor/various/editor-modes.test.js +5 -5
  35. package/specs/editor/various/inserting-blocks.test.js +6 -6
  36. package/specs/editor/various/invalid-block.test.js +4 -4
  37. package/specs/editor/various/is-typing.test.js +8 -8
  38. package/specs/editor/various/keyboard-navigable-blocks.test.js +2 -2
  39. package/specs/editor/various/links.test.js +90 -90
  40. package/specs/editor/various/list-view.test.js +142 -1
  41. package/specs/editor/various/manage-reusable-blocks.test.js +5 -5
  42. package/specs/editor/various/multi-block-selection.test.js +86 -2
  43. package/specs/editor/various/navigable-toolbar.test.js +1 -1
  44. package/specs/editor/various/new-post-default-content.test.js +2 -2
  45. package/specs/editor/various/new-post.test.js +1 -1
  46. package/specs/editor/various/nux.test.js +11 -11
  47. package/specs/editor/various/popovers.test.js +3 -3
  48. package/specs/editor/various/post-editor-template-mode.test.js +189 -11
  49. package/specs/editor/various/post-visibility.test.js +1 -1
  50. package/specs/editor/various/preferences.test.js +1 -1
  51. package/specs/editor/various/preview.test.js +8 -4
  52. package/specs/editor/various/publish-button.test.js +2 -2
  53. package/specs/editor/various/publishing.test.js +50 -1
  54. package/specs/editor/various/reusable-blocks.test.js +31 -31
  55. package/specs/editor/various/rich-text.test.js +1 -1
  56. package/specs/editor/various/splitting-merging.test.js +6 -6
  57. package/specs/editor/various/style-variation.test.js +2 -2
  58. package/specs/editor/various/switch-to-draft.test.js +256 -0
  59. package/specs/editor/various/taxonomies.test.js +1 -1
  60. package/specs/editor/various/toolbar-roving-tabindex.test.js +1 -1
  61. package/specs/editor/various/writing-flow.test.js +85 -20
  62. package/specs/experiments/navigation-editor.test.js +168 -3
  63. package/specs/performance/post-editor.test.js +7 -7
  64. package/specs/performance/site-editor.test.js +6 -7
  65. package/specs/site-editor/document-settings.test.js +8 -8
  66. package/specs/site-editor/multi-entity-editing.test.js +6 -6
  67. package/specs/site-editor/multi-entity-saving.test.js +5 -4
  68. package/specs/site-editor/settings-sidebar.test.js +5 -5
  69. package/specs/site-editor/site-editor-export.test.js +3 -3
  70. package/specs/site-editor/site-editor-inserter.test.js +3 -3
  71. package/specs/site-editor/template-part.test.js +27 -26
  72. package/specs/site-editor/template-revert.test.js +12 -22
  73. package/specs/widgets/customizing-widgets.test.js +14 -9
  74. package/specs/widgets/editing-widgets.test.js +8 -7
@@ -94,14 +94,14 @@ describe( 'Copy/cut/paste of whole blocks', () => {
94
94
  } );
95
95
 
96
96
  it( 'should handle paste events once', async () => {
97
- // Add group block with paragraph
97
+ // Add group block with paragraph.
98
98
  await insertBlock( 'Group' );
99
99
  await page.click( '.block-editor-button-block-appender' );
100
100
  await page.click( '.editor-block-list-item-paragraph' );
101
101
  await page.keyboard.type( 'P' );
102
102
  await page.keyboard.press( 'ArrowLeft' );
103
103
  await page.keyboard.press( 'ArrowLeft' );
104
- // Cut group
104
+ // Cut group.
105
105
  await pressKeyWithModifier( 'primary', 'x' );
106
106
  expect( await getEditedPostContent() ).toMatchSnapshot();
107
107
 
@@ -126,10 +126,10 @@ describe( 'Copy/cut/paste of whole blocks', () => {
126
126
  } );
127
127
  } );
128
128
 
129
- // Paste
129
+ // Paste.
130
130
  await pressKeyWithModifier( 'primary', 'v' );
131
131
 
132
- // Blocks should only be modified once, not twice with new clientIds on a single paste action
132
+ // Blocks should only be modified once, not twice with new clientIds on a single paste action.
133
133
  const blocksUpdated = await page.evaluate(
134
134
  () => window.e2eTestPasteOnce
135
135
  );
@@ -139,14 +139,14 @@ describe( 'Copy/cut/paste of whole blocks', () => {
139
139
  } );
140
140
 
141
141
  it( 'can copy group onto non textual element (image, spacer)', async () => {
142
- // Add group block with paragraph
142
+ // Add group block with paragraph.
143
143
  await insertBlock( 'Group' );
144
144
  await page.click( '.block-editor-button-block-appender' );
145
145
  await page.click( '.editor-block-list-item-paragraph' );
146
146
  await page.keyboard.type( 'P' );
147
147
  await page.keyboard.press( 'ArrowLeft' );
148
148
  await page.keyboard.press( 'ArrowLeft' );
149
- // Cut group
149
+ // Cut group.
150
150
  await pressKeyWithModifier( 'primary', 'x' );
151
151
  expect( await getEditedPostContent() ).toMatchSnapshot();
152
152
 
@@ -154,7 +154,7 @@ describe( 'Copy/cut/paste of whole blocks', () => {
154
154
 
155
155
  // Insert a non textual element (a spacer)
156
156
  await insertBlock( 'Spacer' );
157
- // Spacer is focused
157
+ // Spacer is focused.
158
158
  await page.evaluate( () => {
159
159
  window.e2eTestPasteOnce = [];
160
160
  let oldBlocks = wp.data.select( 'core/block-editor' ).getBlocks();
@@ -125,7 +125,7 @@ describe.each( [ [ 'UTC-10' ], [ 'UTC' ], [ 'UTC+10' ] ] )(
125
125
  // Open the datepicker.
126
126
  await page.click( '.edit-post-post-schedule__toggle' );
127
127
 
128
- // Clear the date
128
+ // Clear the date.
129
129
  await page.click( '.components-datetime__date-reset-button' );
130
130
 
131
131
  const publishingDate = await getPublishingDate();
@@ -21,7 +21,7 @@ describe( 'Duplicating blocks', () => {
21
21
 
22
22
  // Select the test we just typed
23
23
  // This doesn't do anything but we previously had a duplicationi bug
24
- // When the selection was not collapsed
24
+ // When the selection was not collapsed.
25
25
  await pressKeyWithModifier( 'primary', 'a' );
26
26
 
27
27
  await clickBlockToolbarButton( 'Options' );
@@ -36,10 +36,10 @@ describe( 'Duplicating blocks', () => {
36
36
 
37
37
  // Select the test we just typed
38
38
  // This doesn't do anything but we previously had a duplicationi bug
39
- // When the selection was not collapsed
39
+ // When the selection was not collapsed.
40
40
  await pressKeyWithModifier( 'primary', 'a' );
41
41
 
42
- // Duplicate using the keyboard shortccut
42
+ // Duplicate using the keyboard shortccut.
43
43
  await pressKeyWithModifier( 'primaryShift', 'd' );
44
44
 
45
45
  expect( await getEditedPostContent() ).toMatchSnapshot();
@@ -97,14 +97,14 @@ describe( 'Editing modes (visual/HTML)', () => {
97
97
  } );
98
98
 
99
99
  it( 'the code editor should unselect blocks and disable the inserter', async () => {
100
- // The paragraph block should be selected
100
+ // The paragraph block should be selected.
101
101
  const title = await page.$eval(
102
102
  '.block-editor-block-card__title',
103
103
  ( element ) => element.innerText
104
104
  );
105
105
  expect( title ).toBe( 'Paragraph' );
106
106
 
107
- // The Block inspector should be active
107
+ // The Block inspector should be active.
108
108
  let blockInspectorTab = await page.$(
109
109
  '.edit-post-sidebar__panel-tab.is-active[data-label="Block"]'
110
110
  );
@@ -112,20 +112,20 @@ describe( 'Editing modes (visual/HTML)', () => {
112
112
 
113
113
  await switchEditorModeTo( 'Code' );
114
114
 
115
- // The Block inspector should not be active anymore
115
+ // The Block inspector should not be active anymore.
116
116
  blockInspectorTab = await page.$(
117
117
  '.edit-post-sidebar__panel-tab.is-active[data-label="Block"]'
118
118
  );
119
119
  expect( blockInspectorTab ).toBeNull();
120
120
 
121
- // No block is selected
121
+ // No block is selected.
122
122
  await page.click( '.edit-post-sidebar__panel-tab[data-label="Block"]' );
123
123
  const noBlocksElement = await page.$(
124
124
  '.block-editor-block-inspector__no-blocks'
125
125
  );
126
126
  expect( noBlocksElement ).not.toBeNull();
127
127
 
128
- // The inserter is disabled
128
+ // The inserter is disabled.
129
129
  const disabledInserter = await page.$(
130
130
  '.edit-post-header-toolbar__inserter-toggle:disabled, .edit-post-header-toolbar__inserter-toggle[aria-disabled="true"]'
131
131
  );
@@ -77,7 +77,7 @@ describe( 'Inserting blocks', () => {
77
77
  ).not.toBeNull();
78
78
  await page.keyboard.type( 'Paragraph block' );
79
79
 
80
- // Using the slash command
80
+ // Using the slash command.
81
81
  await page.keyboard.press( 'Enter' );
82
82
  await page.keyboard.type( '/quote' );
83
83
  await page.waitForXPath(
@@ -105,7 +105,7 @@ describe( 'Inserting blocks', () => {
105
105
  await page.keyboard.press( 'Backspace' );
106
106
  expect( await getEditedPostContent() ).toMatchSnapshot();
107
107
 
108
- // Using the regular inserter
108
+ // Using the regular inserter.
109
109
  await insertBlock( 'Preformatted' );
110
110
  await page.keyboard.type( 'Pre block' );
111
111
  await page.keyboard.press( 'Enter' );
@@ -130,7 +130,7 @@ describe( 'Inserting blocks', () => {
130
130
  await page.click( '.editor-post-title__input' );
131
131
  await closeGlobalBlockInserter();
132
132
 
133
- // Using the between inserter
133
+ // Using the between inserter.
134
134
  const insertionPoint = await page.$( '[data-type="core/quote"]' );
135
135
  const rect = await insertionPoint.boundingBox();
136
136
  await page.mouse.move( rect.x + rect.width / 2, rect.y - 10, {
@@ -198,7 +198,7 @@ describe( 'Inserting blocks', () => {
198
198
  'components-search-control__input'
199
199
  );
200
200
 
201
- // Tab to the block list
201
+ // Tab to the block list.
202
202
  await page.keyboard.press( 'Tab' );
203
203
 
204
204
  // Expect the block list to be the active element.
@@ -209,7 +209,7 @@ describe( 'Inserting blocks', () => {
209
209
  'block-editor-block-types-list__item'
210
210
  );
211
211
 
212
- // Try using the up arrow key
212
+ // Try using the up arrow key.
213
213
  await page.keyboard.press( 'ArrowUp' );
214
214
 
215
215
  // Expect the block list to still be the active element.
@@ -284,7 +284,7 @@ describe( 'Inserting blocks', () => {
284
284
  await page.keyboard.type( 'Third paragraph' );
285
285
  expect( await getEditedPostContent() ).toMatchSnapshot();
286
286
 
287
- // Using the between inserter
287
+ // Using the between inserter.
288
288
  const insertionPoint = await page.$( '[data-type="core/heading"]' );
289
289
  const rect = await insertionPoint.boundingBox();
290
290
  await page.mouse.move( rect.x + rect.width / 2, rect.y - 10, {
@@ -15,13 +15,13 @@ describe( 'invalid blocks', () => {
15
15
  } );
16
16
 
17
17
  it( 'Should show an invalid block message with clickable options', async () => {
18
- // Create an empty paragraph with the focus in the block
18
+ // Create an empty paragraph with the focus in the block.
19
19
  await clickBlockAppender();
20
20
  await page.keyboard.type( 'hello' );
21
21
 
22
22
  await clickBlockToolbarButton( 'Options' );
23
23
 
24
- // Change to HTML mode and close the options
24
+ // Change to HTML mode and close the options.
25
25
  await clickMenuItem( 'Edit as HTML' );
26
26
 
27
27
  // Focus on the textarea and enter an invalid paragraph
@@ -33,14 +33,14 @@ describe( 'invalid blocks', () => {
33
33
  // Takes the focus away from the block so the invalid warning is triggered
34
34
  await page.click( '.editor-post-save-draft' );
35
35
 
36
- // Click on the 'three-dots' menu toggle
36
+ // Click on the 'three-dots' menu toggle.
37
37
  await page.click(
38
38
  '.block-editor-warning__actions button[aria-label="More options"]'
39
39
  );
40
40
 
41
41
  await clickMenuItem( 'Resolve' );
42
42
 
43
- // Check we get the resolve modal with the appropriate contents
43
+ // Check we get the resolve modal with the appropriate contents.
44
44
  const htmlBlockContent = await page.$eval(
45
45
  '.block-editor-block-compare__html',
46
46
  ( node ) => node.textContent
@@ -17,17 +17,17 @@ describe( 'isTyping', () => {
17
17
 
18
18
  await clickBlockAppender();
19
19
 
20
- // Type in a paragraph
20
+ // Type in a paragraph.
21
21
  await page.keyboard.type( 'Type' );
22
22
 
23
23
  // Toolbar is hidden
24
24
  let blockToolbar = await page.$( blockToolbarSelector );
25
25
  expect( blockToolbar ).toBe( null );
26
26
 
27
- // Moving the mouse shows the toolbar
27
+ // Moving the mouse shows the toolbar.
28
28
  await showBlockToolbar();
29
29
 
30
- // Toolbar is visible
30
+ // Toolbar is visible.
31
31
  blockToolbar = await page.$( blockToolbarSelector );
32
32
  expect( blockToolbar ).not.toBe( null );
33
33
 
@@ -40,7 +40,7 @@ describe( 'isTyping', () => {
40
40
  } );
41
41
 
42
42
  it( 'should not close the dropdown when typing in it', async () => {
43
- // Adds a Dropdown with an input to all blocks
43
+ // Adds a Dropdown with an input to all blocks.
44
44
  await page.evaluate( () => {
45
45
  const { Dropdown, ToolbarButton, Fill } = wp.components;
46
46
  const { createElement: el, Fragment } = wp.element;
@@ -82,19 +82,19 @@ describe( 'isTyping', () => {
82
82
 
83
83
  await clickBlockAppender();
84
84
 
85
- // Type in a paragraph
85
+ // Type in a paragraph.
86
86
  await page.keyboard.type( 'Type' );
87
87
 
88
- // Show Toolbar
88
+ // Show Toolbar.
89
89
  await showBlockToolbar();
90
90
 
91
- // Open the dropdown
91
+ // Open the dropdown.
92
92
  await page.click( '.dropdown-open' );
93
93
 
94
94
  // Type inside the dropdown's input
95
95
  await page.type( '.dropdown-input', 'Random' );
96
96
 
97
- // The input should still be visible
97
+ // The input should still be visible.
98
98
  const input = await page.$( '.dropdown-input' );
99
99
  expect( input ).not.toBe( null );
100
100
  } );
@@ -20,7 +20,7 @@ async function getActiveLabel() {
20
20
  }
21
21
 
22
22
  const navigateToContentEditorTop = async () => {
23
- // Use 'Ctrl+`' to return to the top of the editor
23
+ // Use 'Ctrl+`' to return to the top of the editor.
24
24
  await pressKeyWithModifier( 'ctrl', '`' );
25
25
  await pressKeyWithModifier( 'ctrl', '`' );
26
26
  };
@@ -81,7 +81,7 @@ describe( 'Order of block keyboard navigation', () => {
81
81
  it( 'permits tabbing through paragraph blocks in the expected order', async () => {
82
82
  const paragraphBlocks = [ 'Paragraph 0', 'Paragraph 1', 'Paragraph 2' ];
83
83
 
84
- // create 3 paragraphs blocks with some content
84
+ // Create 3 paragraphs blocks with some content.
85
85
  for ( const paragraphBlock of paragraphBlocks ) {
86
86
  await insertBlock( 'Paragraph' );
87
87
  await page.keyboard.type( paragraphBlock );