@wordpress/e2e-tests 3.1.1 → 4.0.2

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 (44) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +2 -0
  3. package/config/flaky-tests-reporter.js +1 -0
  4. package/package.json +10 -8
  5. package/specs/editor/blocks/__snapshots__/buttons.test.js.snap +8 -0
  6. package/specs/editor/blocks/__snapshots__/navigation.test.js.snap +2 -2
  7. package/specs/editor/blocks/__snapshots__/separator.test.js.snap +1 -1
  8. package/specs/editor/blocks/buttons.test.js +10 -0
  9. package/specs/editor/blocks/columns.test.js +3 -3
  10. package/specs/editor/blocks/gallery.test.js +36 -6
  11. package/specs/editor/blocks/heading.test.js +1 -1
  12. package/specs/editor/blocks/navigation.test.js +370 -72
  13. package/specs/editor/blocks/query.test.js +13 -3
  14. package/specs/editor/plugins/annotations.test.js +63 -67
  15. package/specs/editor/various/__snapshots__/block-deletion.test.js.snap +20 -12
  16. package/specs/editor/various/__snapshots__/block-editor-keyboard-shortcuts.test.js.snap +26 -0
  17. package/specs/editor/various/__snapshots__/block-hierarchy-navigation.test.js.snap +1 -1
  18. package/specs/editor/various/__snapshots__/multi-block-selection.test.js.snap +122 -6
  19. package/specs/editor/various/__snapshots__/writing-flow.test.js.snap +6 -6
  20. package/specs/editor/various/autosave.test.js +3 -3
  21. package/specs/editor/various/block-deletion.test.js +1 -0
  22. package/specs/editor/various/block-editor-keyboard-shortcuts.test.js +3 -5
  23. package/specs/editor/various/block-hierarchy-navigation.test.js +10 -16
  24. package/specs/editor/various/block-locking.test.js +120 -0
  25. package/specs/editor/various/keyboard-navigable-blocks.test.js +23 -0
  26. package/specs/editor/various/list-view.test.js +139 -7
  27. package/specs/editor/various/multi-block-selection.test.js +153 -9
  28. package/specs/editor/various/toolbar-roving-tabindex.test.js +10 -4
  29. package/specs/editor/various/writing-flow.test.js +10 -5
  30. package/specs/experiments/blocks/comments-query.test.js +139 -0
  31. package/specs/experiments/navigation-editor.test.js +126 -121
  32. package/specs/performance/post-editor.test.js +4 -6
  33. package/specs/site-editor/global-styles-sidebar.test.js +42 -0
  34. package/specs/site-editor/iframe-rendering-mode.test.js +31 -0
  35. package/specs/site-editor/site-editor-export.test.js +2 -2
  36. package/specs/site-editor/style-variations.test.js +9 -7
  37. package/specs/site-editor/template-part.test.js +3 -1
  38. package/specs/editor/various/__snapshots__/copy-cut-paste-whole-blocks.test.js.snap +0 -125
  39. package/specs/editor/various/__snapshots__/post-editor-template-mode.test.js.snap +0 -27
  40. package/specs/editor/various/copy-cut-paste-whole-blocks.test.js +0 -187
  41. package/specs/editor/various/new-post.test.js +0 -99
  42. package/specs/editor/various/post-editor-template-mode.test.js +0 -377
  43. package/specs/site-editor/document-settings.test.js +0 -90
  44. package/specs/widgets/customizing-widgets.test.js +0 -913
@@ -17,7 +17,7 @@ const clickOnBlockSettingsMenuItem = async ( buttonLabel ) => {
17
17
 
18
18
  const ANNOTATIONS_SELECTOR = '.annotation-text-e2e-tests';
19
19
 
20
- describe( 'Using Plugins API', () => {
20
+ describe( 'Annotations', () => {
21
21
  beforeAll( async () => {
22
22
  await activatePlugin( 'gutenberg-test-plugin-plugins-api' );
23
23
  } );
@@ -97,96 +97,92 @@ describe( 'Using Plugins API', () => {
97
97
  }, htmlContent[ 0 ] );
98
98
  }
99
99
 
100
- describe( 'Annotations', () => {
101
- it( 'Allows a block to be annotated', async () => {
102
- await page.keyboard.type(
103
- 'Title' + '\n' + 'Paragraph to annotate'
104
- );
100
+ it( 'allows a block to be annotated', async () => {
101
+ await page.keyboard.type( 'Title' + '\n' + 'Paragraph to annotate' );
105
102
 
106
- await clickOnMoreMenuItem( 'Annotations Sidebar' );
103
+ await clickOnMoreMenuItem( 'Annotations Sidebar' );
107
104
 
108
- let annotations = await page.$$( ANNOTATIONS_SELECTOR );
109
- expect( annotations ).toHaveLength( 0 );
105
+ let annotations = await page.$$( ANNOTATIONS_SELECTOR );
106
+ expect( annotations ).toHaveLength( 0 );
110
107
 
111
- await annotateFirstBlock( 9, 13 );
108
+ await annotateFirstBlock( 9, 13 );
112
109
 
113
- annotations = await page.$$( ANNOTATIONS_SELECTOR );
114
- expect( annotations ).toHaveLength( 1 );
110
+ annotations = await page.$$( ANNOTATIONS_SELECTOR );
111
+ expect( annotations ).toHaveLength( 1 );
115
112
 
116
- const text = await getAnnotatedText();
117
- expect( text ).toBe( ' to ' );
113
+ const text = await getAnnotatedText();
114
+ expect( text ).toBe( ' to ' );
118
115
 
119
- await clickOnBlockSettingsMenuItem( 'Edit as HTML' );
116
+ await clickOnBlockSettingsMenuItem( 'Edit as HTML' );
120
117
 
121
- const htmlContent = await page.$$(
122
- '.block-editor-block-list__block-html-textarea'
123
- );
124
- const html = await page.evaluate( ( el ) => {
125
- return el.innerHTML;
126
- }, htmlContent[ 0 ] );
118
+ const htmlContent = await page.$$(
119
+ '.block-editor-block-list__block-html-textarea'
120
+ );
121
+ const html = await page.evaluate( ( el ) => {
122
+ return el.innerHTML;
123
+ }, htmlContent[ 0 ] );
127
124
 
128
- // There should be no <mark> tags in the raw content.
129
- expect( html ).toBe( '&lt;p&gt;Paragraph to annotate&lt;/p&gt;' );
130
- } );
125
+ // There should be no <mark> tags in the raw content.
126
+ expect( html ).toBe( '&lt;p&gt;Paragraph to annotate&lt;/p&gt;' );
127
+ } );
131
128
 
132
- it( 'Keeps the cursor in the same location when applying annotation', async () => {
133
- await page.keyboard.type( 'Title' + '\n' + 'ABC' );
134
- await clickOnMoreMenuItem( 'Annotations Sidebar' );
129
+ it( 'keeps the cursor in the same location when applying annotation', async () => {
130
+ await page.keyboard.type( 'Title' + '\n' + 'ABC' );
131
+ await clickOnMoreMenuItem( 'Annotations Sidebar' );
135
132
 
136
- await annotateFirstBlock( 1, 2 );
133
+ await annotateFirstBlock( 1, 2 );
137
134
 
138
- // The selection should still be at the end, so test that by typing:
139
- await page.keyboard.type( 'D' );
135
+ // The selection should still be at the end, so test that by typing:
136
+ await page.keyboard.type( 'D' );
140
137
 
141
- await removeAnnotations();
142
- const htmlContent = await page.$$( '.wp-block-paragraph' );
143
- const html = await page.evaluate( ( el ) => {
144
- return el.innerHTML;
145
- }, htmlContent[ 0 ] );
138
+ await removeAnnotations();
139
+ const htmlContent = await page.$$( '.wp-block-paragraph' );
140
+ const html = await page.evaluate( ( el ) => {
141
+ return el.innerHTML;
142
+ }, htmlContent[ 0 ] );
146
143
 
147
- expect( html ).toBe( 'ABCD' );
148
- } );
144
+ expect( html ).toBe( 'ABCD' );
145
+ } );
149
146
 
150
- it( 'Moves when typing before it', async () => {
151
- await page.keyboard.type( 'Title' + '\n' + 'ABC' );
152
- await clickOnMoreMenuItem( 'Annotations Sidebar' );
147
+ it( 'moves when typing before it', async () => {
148
+ await page.keyboard.type( 'Title' + '\n' + 'ABC' );
149
+ await clickOnMoreMenuItem( 'Annotations Sidebar' );
153
150
 
154
- await annotateFirstBlock( 1, 2 );
151
+ await annotateFirstBlock( 1, 2 );
155
152
 
156
- await page.keyboard.press( 'ArrowLeft' );
157
- await page.keyboard.press( 'ArrowLeft' );
158
- await page.keyboard.press( 'ArrowLeft' );
159
- await page.keyboard.press( 'ArrowLeft' );
153
+ await page.keyboard.press( 'ArrowLeft' );
154
+ await page.keyboard.press( 'ArrowLeft' );
155
+ await page.keyboard.press( 'ArrowLeft' );
156
+ await page.keyboard.press( 'ArrowLeft' );
160
157
 
161
- // Put an 1 after the A, it should not be annotated.
162
- await page.keyboard.type( '1' );
158
+ // Put an 1 after the A, it should not be annotated.
159
+ await page.keyboard.type( '1' );
163
160
 
164
- const annotatedText = await getAnnotatedText();
165
- expect( annotatedText ).toBe( 'B' );
161
+ const annotatedText = await getAnnotatedText();
162
+ expect( annotatedText ).toBe( 'B' );
166
163
 
167
- await removeAnnotations();
168
- const blockText = await getRichTextInnerHTML();
169
- expect( blockText ).toBe( 'A1BC' );
170
- } );
164
+ await removeAnnotations();
165
+ const blockText = await getRichTextInnerHTML();
166
+ expect( blockText ).toBe( 'A1BC' );
167
+ } );
171
168
 
172
- it( 'Grows when typing inside it', async () => {
173
- await page.keyboard.type( 'Title' + '\n' + 'ABC' );
174
- await clickOnMoreMenuItem( 'Annotations Sidebar' );
169
+ it( 'grows when typing inside it', async () => {
170
+ await page.keyboard.type( 'Title' + '\n' + 'ABC' );
171
+ await clickOnMoreMenuItem( 'Annotations Sidebar' );
175
172
 
176
- await annotateFirstBlock( 1, 2 );
173
+ await annotateFirstBlock( 1, 2 );
177
174
 
178
- await page.keyboard.press( 'ArrowLeft' );
179
- await page.keyboard.press( 'ArrowLeft' );
175
+ await page.keyboard.press( 'ArrowLeft' );
176
+ await page.keyboard.press( 'ArrowLeft' );
180
177
 
181
- // Put an 1 after the A, it should not be annotated.
182
- await page.keyboard.type( '2' );
178
+ // Put an 1 after the A, it should not be annotated.
179
+ await page.keyboard.type( '2' );
183
180
 
184
- const annotatedText = await getAnnotatedText();
185
- expect( annotatedText ).toBe( 'B2' );
181
+ const annotatedText = await getAnnotatedText();
182
+ expect( annotatedText ).toBe( 'B2' );
186
183
 
187
- await removeAnnotations();
188
- const blockText = await getRichTextInnerHTML();
189
- expect( blockText ).toBe( 'AB2C' );
190
- } );
184
+ await removeAnnotations();
185
+ const blockText = await getRichTextInnerHTML();
186
+ expect( blockText ).toBe( 'AB2C' );
191
187
  } );
192
188
  } );
@@ -1,26 +1,34 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`block deletion - deleting the third block using backspace in an empty block results in two remaining blocks and positions the caret at the end of the second block 1`] = `
3
+ exports[`block deletion - deleting the third and fourth blocks using backspace with multi-block selection results in two remaining blocks and positions the caret at the end of the second block 1`] = `
4
4
  "<!-- wp:paragraph -->
5
5
  <p>First paragraph</p>
6
6
  <!-- /wp:paragraph -->
7
7
 
8
8
  <!-- wp:paragraph -->
9
9
  <p>Second paragraph</p>
10
+ <!-- /wp:paragraph -->
11
+
12
+ <!-- wp:paragraph -->
13
+ <p></p>
10
14
  <!-- /wp:paragraph -->"
11
15
  `;
12
16
 
13
- exports[`block deletion - deleting the third block using backspace in an empty block results in two remaining blocks and positions the caret at the end of the second block 2`] = `
17
+ exports[`block deletion - deleting the third and fourth blocks using backspace with multi-block selection results in two remaining blocks and positions the caret at the end of the second block 2`] = `
14
18
  "<!-- wp:paragraph -->
15
19
  <p>First paragraph</p>
16
20
  <!-- /wp:paragraph -->
17
21
 
18
22
  <!-- wp:paragraph -->
19
- <p>Second paragraph - caret was here</p>
20
- <!-- /wp:paragraph -->"
23
+ <p>Second paragraph</p>
24
+ <!-- /wp:paragraph -->
25
+
26
+ <!-- wp:list -->
27
+ <ul><li>caret was here</li></ul>
28
+ <!-- /wp:list -->"
21
29
  `;
22
30
 
23
- exports[`block deletion - deleting the third block using backspace with block wrapper selection results in three remaining blocks and positions the caret at the end of the third block 1`] = `
31
+ exports[`block deletion - deleting the third block using backspace in an empty block results in two remaining blocks and positions the caret at the end of the second block 1`] = `
24
32
  "<!-- wp:paragraph -->
25
33
  <p>First paragraph</p>
26
34
  <!-- /wp:paragraph -->
@@ -30,7 +38,7 @@ exports[`block deletion - deleting the third block using backspace with block wr
30
38
  <!-- /wp:paragraph -->"
31
39
  `;
32
40
 
33
- exports[`block deletion - deleting the third block using backspace with block wrapper selection results in three remaining blocks and positions the caret at the end of the third block 2`] = `
41
+ exports[`block deletion - deleting the third block using backspace in an empty block results in two remaining blocks and positions the caret at the end of the second block 2`] = `
34
42
  "<!-- wp:paragraph -->
35
43
  <p>First paragraph</p>
36
44
  <!-- /wp:paragraph -->
@@ -40,7 +48,7 @@ exports[`block deletion - deleting the third block using backspace with block wr
40
48
  <!-- /wp:paragraph -->"
41
49
  `;
42
50
 
43
- exports[`block deletion - deleting the third block using the Remove Block menu item results in two remaining blocks and positions the caret at the end of the second block 1`] = `
51
+ exports[`block deletion - deleting the third block using backspace with block wrapper selection results in three remaining blocks and positions the caret at the end of the third block 1`] = `
44
52
  "<!-- wp:paragraph -->
45
53
  <p>First paragraph</p>
46
54
  <!-- /wp:paragraph -->
@@ -50,7 +58,7 @@ exports[`block deletion - deleting the third block using the Remove Block menu i
50
58
  <!-- /wp:paragraph -->"
51
59
  `;
52
60
 
53
- exports[`block deletion - deleting the third block using the Remove Block menu item results in two remaining blocks and positions the caret at the end of the second block 2`] = `
61
+ exports[`block deletion - deleting the third block using backspace with block wrapper selection results in three remaining blocks and positions the caret at the end of the third block 2`] = `
54
62
  "<!-- wp:paragraph -->
55
63
  <p>First paragraph</p>
56
64
  <!-- /wp:paragraph -->
@@ -60,7 +68,7 @@ exports[`block deletion - deleting the third block using the Remove Block menu i
60
68
  <!-- /wp:paragraph -->"
61
69
  `;
62
70
 
63
- exports[`block deletion - deleting the third block using the Remove Block shortcut results in two remaining blocks and positions the caret at the end of the second block 1`] = `
71
+ exports[`block deletion - deleting the third block using the Remove Block menu item results in two remaining blocks and positions the caret at the end of the second block 1`] = `
64
72
  "<!-- wp:paragraph -->
65
73
  <p>First paragraph</p>
66
74
  <!-- /wp:paragraph -->
@@ -70,7 +78,7 @@ exports[`block deletion - deleting the third block using the Remove Block shortc
70
78
  <!-- /wp:paragraph -->"
71
79
  `;
72
80
 
73
- exports[`block deletion - deleting the third block using the Remove Block shortcut results in two remaining blocks and positions the caret at the end of the second block 2`] = `
81
+ exports[`block deletion - deleting the third block using the Remove Block menu item results in two remaining blocks and positions the caret at the end of the second block 2`] = `
74
82
  "<!-- wp:paragraph -->
75
83
  <p>First paragraph</p>
76
84
  <!-- /wp:paragraph -->
@@ -80,7 +88,7 @@ exports[`block deletion - deleting the third block using the Remove Block shortc
80
88
  <!-- /wp:paragraph -->"
81
89
  `;
82
90
 
83
- exports[`block deletion - deleting the third and fourth blocks using backspace with multi-block selection results in two remaining blocks and positions the caret at the end of the second block 1`] = `
91
+ exports[`block deletion - deleting the third block using the Remove Block shortcut results in two remaining blocks and positions the caret at the end of the second block 1`] = `
84
92
  "<!-- wp:paragraph -->
85
93
  <p>First paragraph</p>
86
94
  <!-- /wp:paragraph -->
@@ -90,7 +98,7 @@ exports[`block deletion - deleting the third and fourth blocks using backspace w
90
98
  <!-- /wp:paragraph -->"
91
99
  `;
92
100
 
93
- exports[`block deletion - deleting the third and fourth blocks using backspace with multi-block selection results in two remaining blocks and positions the caret at the end of the second block 2`] = `
101
+ exports[`block deletion - deleting the third block using the Remove Block shortcut results in two remaining blocks and positions the caret at the end of the second block 2`] = `
94
102
  "<!-- wp:paragraph -->
95
103
  <p>First paragraph</p>
96
104
  <!-- /wp:paragraph -->
@@ -125,3 +125,29 @@ exports[`block editor keyboard shortcuts test shortcuts handling through portals
125
125
  <p>3rd</p>
126
126
  <!-- /wp:paragraph -->"
127
127
  `;
128
+
129
+ exports[`block editor keyboard shortcuts test shortcuts handling through portals in the same tree should propagate properly and duplicate selected blocks 1`] = `
130
+ "<!-- wp:paragraph -->
131
+ <p>1st</p>
132
+ <!-- /wp:paragraph -->
133
+
134
+ <!-- wp:paragraph -->
135
+ <p>2nd</p>
136
+ <!-- /wp:paragraph -->
137
+
138
+ <!-- wp:paragraph -->
139
+ <p>3rd</p>
140
+ <!-- /wp:paragraph -->
141
+
142
+ <!-- wp:paragraph -->
143
+ <p>1st</p>
144
+ <!-- /wp:paragraph -->
145
+
146
+ <!-- wp:paragraph -->
147
+ <p>2nd</p>
148
+ <!-- /wp:paragraph -->
149
+
150
+ <!-- wp:paragraph -->
151
+ <p>3rd</p>
152
+ <!-- /wp:paragraph -->"
153
+ `;
@@ -57,7 +57,7 @@ exports[`Navigating the block hierarchy should select the wrapper div for a grou
57
57
  <!-- /wp:paragraph -->
58
58
 
59
59
  <!-- wp:separator -->
60
- <hr class=\\"wp-block-separator\\"/>
60
+ <hr class=\\"wp-block-separator has-alpha-channel-opacity\\"/>
61
61
  <!-- /wp:separator --></div>
62
62
  <!-- /wp:group -->"
63
63
  `;
@@ -6,7 +6,11 @@ exports[`Multi-block selection should allow selecting outer edge if there is no
6
6
  <!-- /wp:paragraph -->"
7
7
  `;
8
8
 
9
- exports[`Multi-block selection should always expand single line selection 1`] = `""`;
9
+ exports[`Multi-block selection should always expand single line selection 1`] = `
10
+ "<!-- wp:paragraph -->
11
+ <p>2</p>
12
+ <!-- /wp:paragraph -->"
13
+ `;
10
14
 
11
15
  exports[`Multi-block selection should clear selection when clicking next to blocks 1`] = `
12
16
  "<!-- wp:paragraph -->
@@ -70,6 +74,26 @@ exports[`Multi-block selection should cut and paste 2`] = `
70
74
  <!-- /wp:paragraph -->"
71
75
  `;
72
76
 
77
+ exports[`Multi-block selection should forward delete across blocks 1`] = `
78
+ "<!-- wp:paragraph -->
79
+ <p>1[</p>
80
+ <!-- /wp:paragraph -->
81
+
82
+ <!-- wp:paragraph -->
83
+ <p>.</p>
84
+ <!-- /wp:paragraph -->
85
+
86
+ <!-- wp:heading -->
87
+ <h2>]2</h2>
88
+ <!-- /wp:heading -->"
89
+ `;
90
+
91
+ exports[`Multi-block selection should forward delete across blocks 2`] = `
92
+ "<!-- wp:heading -->
93
+ <h2>1&amp;2</h2>
94
+ <!-- /wp:heading -->"
95
+ `;
96
+
73
97
  exports[`Multi-block selection should gradually multi-select 1`] = `
74
98
  "<!-- wp:columns -->
75
99
  <div class=\\"wp-block-columns\\"><!-- wp:column -->
@@ -94,6 +118,50 @@ exports[`Multi-block selection should gradually multi-select 2`] = `
94
118
  <!-- /wp:columns -->"
95
119
  `;
96
120
 
121
+ exports[`Multi-block selection should handle Enter across blocks 1`] = `
122
+ "<!-- wp:paragraph -->
123
+ <p>1[</p>
124
+ <!-- /wp:paragraph -->
125
+
126
+ <!-- wp:paragraph -->
127
+ <p>.</p>
128
+ <!-- /wp:paragraph -->
129
+
130
+ <!-- wp:heading -->
131
+ <h2>]2</h2>
132
+ <!-- /wp:heading -->"
133
+ `;
134
+
135
+ exports[`Multi-block selection should handle Enter across blocks 2`] = `
136
+ "<!-- wp:paragraph -->
137
+ <p>1</p>
138
+ <!-- /wp:paragraph -->
139
+
140
+ <!-- wp:paragraph -->
141
+ <p>&amp;</p>
142
+ <!-- /wp:paragraph -->
143
+
144
+ <!-- wp:heading -->
145
+ <h2>2</h2>
146
+ <!-- /wp:heading -->"
147
+ `;
148
+
149
+ exports[`Multi-block selection should merge into quote with correct selection 1`] = `
150
+ "<!-- wp:quote -->
151
+ <blockquote class=\\"wp-block-quote\\"><p>1[</p></blockquote>
152
+ <!-- /wp:quote -->
153
+
154
+ <!-- wp:paragraph -->
155
+ <p>]2</p>
156
+ <!-- /wp:paragraph -->"
157
+ `;
158
+
159
+ exports[`Multi-block selection should merge into quote with correct selection 2`] = `
160
+ "<!-- wp:quote -->
161
+ <blockquote class=\\"wp-block-quote\\"><p>1</p><p>&amp;2</p></blockquote>
162
+ <!-- /wp:quote -->"
163
+ `;
164
+
97
165
  exports[`Multi-block selection should multi-select from within the list block 1`] = `
98
166
  "<!-- wp:paragraph -->
99
167
  <p>1</p>
@@ -124,25 +192,41 @@ exports[`Multi-block selection should only trigger multi-selection when at the e
124
192
  <!-- /wp:paragraph -->"
125
193
  `;
126
194
 
127
- exports[`Multi-block selection should place the caret at the end of last pasted paragraph (paste mid-block) 1`] = `
195
+ exports[`Multi-block selection should partially select with shift + click 1`] = `
128
196
  "<!-- wp:paragraph -->
129
- <p>first paragra</p>
197
+ <p><strong>1</strong>[</p>
130
198
  <!-- /wp:paragraph -->
131
199
 
132
200
  <!-- wp:paragraph -->
201
+ <p>]2</p>
202
+ <!-- /wp:paragraph -->"
203
+ `;
204
+
205
+ exports[`Multi-block selection should partially select with shift + click 2`] = `
206
+ "<!-- wp:paragraph -->
207
+ <p><strong>1</strong>&amp;2</p>
208
+ <!-- /wp:paragraph -->"
209
+ `;
210
+
211
+ exports[`Multi-block selection should place the caret at the end of last pasted paragraph (paste mid-block) 1`] = `
212
+ "<!-- wp:paragraph -->
133
213
  <p>first paragraph</p>
134
214
  <!-- /wp:paragraph -->
135
215
 
136
216
  <!-- wp:paragraph -->
137
- <p>second paragrap</p>
217
+ <p>second paragr</p>
138
218
  <!-- /wp:paragraph -->
139
219
 
140
220
  <!-- wp:paragraph -->
141
- <p>ph</p>
221
+ <p>first paragraph</p>
142
222
  <!-- /wp:paragraph -->
143
223
 
144
224
  <!-- wp:paragraph -->
145
- <p>second paragraph</p>
225
+ <p>second paragrap</p>
226
+ <!-- /wp:paragraph -->
227
+
228
+ <!-- wp:paragraph -->
229
+ <p>aph</p>
146
230
  <!-- /wp:paragraph -->"
147
231
  `;
148
232
 
@@ -198,6 +282,22 @@ exports[`Multi-block selection should select all from empty selection 1`] = `
198
282
 
199
283
  exports[`Multi-block selection should select all from empty selection 2`] = `""`;
200
284
 
285
+ exports[`Multi-block selection should select separator (single element block) 1`] = `
286
+ "<!-- wp:separator -->
287
+ <hr class=\\"wp-block-separator has-alpha-channel-opacity\\"/>
288
+ <!-- /wp:separator -->
289
+
290
+ <!-- wp:paragraph -->
291
+ <p>a</p>
292
+ <!-- /wp:paragraph -->"
293
+ `;
294
+
295
+ exports[`Multi-block selection should select separator (single element block) 2`] = `
296
+ "<!-- wp:paragraph -->
297
+ <p>&amp;</p>
298
+ <!-- /wp:paragraph -->"
299
+ `;
300
+
201
301
  exports[`Multi-block selection should set attributes for multiple paragraphs 1`] = `
202
302
  "<!-- wp:paragraph {\\"align\\":\\"center\\"} -->
203
303
  <p class=\\"has-text-align-center\\">1</p>
@@ -217,3 +317,19 @@ exports[`Multi-block selection should use selection direction to determine verti
217
317
  <p>3</p>
218
318
  <!-- /wp:paragraph -->"
219
319
  `;
320
+
321
+ exports[`Multi-block selection should write over selection 1`] = `
322
+ "<!-- wp:paragraph -->
323
+ <p>1[</p>
324
+ <!-- /wp:paragraph -->
325
+
326
+ <!-- wp:paragraph -->
327
+ <p>]2</p>
328
+ <!-- /wp:paragraph -->"
329
+ `;
330
+
331
+ exports[`Multi-block selection should write over selection 2`] = `
332
+ "<!-- wp:paragraph -->
333
+ <p>1...2</p>
334
+ <!-- /wp:paragraph -->"
335
+ `;
@@ -278,6 +278,12 @@ exports[`Writing Flow should not prematurely multi-select 1`] = `
278
278
  <!-- /wp:paragraph -->"
279
279
  `;
280
280
 
281
+ exports[`Writing Flow should only consider the content as one tab stop 1`] = `
282
+ "<!-- wp:table -->
283
+ <figure class=\\"wp-block-table\\"><table><tbody><tr><td></td><td>2</td></tr><tr><td></td><td></td></tr></tbody></table></figure>
284
+ <!-- /wp:table -->"
285
+ `;
286
+
281
287
  exports[`Writing Flow should preserve horizontal position when navigating vertically between blocks 1`] = `
282
288
  "<!-- wp:paragraph -->
283
289
  <p>abc</p>
@@ -297,9 +303,3 @@ exports[`Writing Flow should remember initial vertical position 1`] = `
297
303
  <p><br>2</p>
298
304
  <!-- /wp:paragraph -->"
299
305
  `;
300
-
301
- exports[`Writing Flow should only consider the content as one tab stop 1`] = `
302
- "<!-- wp:table -->
303
- <figure class=\\"wp-block-table\\"><table><tbody><tr><td></td><td>2</td></tr><tr><td></td><td></td></tr></tbody></table></figure>
304
- <!-- /wp:table -->"
305
- `;
@@ -56,9 +56,9 @@ async function getCurrentPostId() {
56
56
 
57
57
  async function setLocalAutosaveInterval( value ) {
58
58
  return page.evaluate( ( _value ) => {
59
- window.wp.data
60
- .dispatch( 'core/edit-post' )
61
- .__experimentalUpdateLocalAutosaveInterval( _value );
59
+ window.wp.data.dispatch( 'core/editor' ).updateEditorSettings( {
60
+ localAutosaveInterval: _value,
61
+ } );
62
62
  }, value );
63
63
  }
64
64
 
@@ -192,6 +192,7 @@ describe( 'deleting all blocks', () => {
192
192
  // Add and remove a block.
193
193
  await insertBlock( 'Image' );
194
194
  await page.waitForSelector( 'figure[data-type="core/image"]' );
195
+ await page.keyboard.press( 'ArrowUp' );
195
196
  await page.keyboard.press( 'Backspace' );
196
197
 
197
198
  // Verify there is no selected block.
@@ -76,16 +76,14 @@ describe( 'block editor keyboard shortcuts', () => {
76
76
  await pressKeyWithModifier( 'primary', 'a' );
77
77
  await pressKeyWithModifier( 'primary', 'a' );
78
78
  } );
79
- it( 'should propagate properly and delete selected blocks', async () => {
79
+ it( 'should propagate properly and duplicate selected blocks', async () => {
80
80
  await clickBlockToolbarButton( 'Options' );
81
81
  const label = 'Duplicate';
82
82
  await page.$x(
83
83
  `//div[@role="menu"]//span[contains(concat(" ", @class, " "), " components-menu-item__item ")][contains(text(), "${ label }")]`
84
84
  );
85
- await page.keyboard.press( 'Delete' );
86
- expect( await getEditedPostContent() ).toMatchInlineSnapshot(
87
- `""`
88
- );
85
+ await pressKeyWithModifier( 'primaryShift', 'd' );
86
+ expect( await getEditedPostContent() ).toMatchSnapshot();
89
87
  } );
90
88
  it( 'should prevent deleting multiple selected blocks from inputs', async () => {
91
89
  await clickBlockToolbarButton( 'Options' );
@@ -8,6 +8,7 @@ import {
8
8
  pressKeyTimes,
9
9
  pressKeyWithModifier,
10
10
  openDocumentSettingsSidebar,
11
+ getListViewBlocks,
11
12
  } from '@wordpress/e2e-test-utils';
12
13
 
13
14
  async function openListViewSidebar() {
@@ -49,12 +50,11 @@ describe( 'Navigating the block hierarchy', () => {
49
50
 
50
51
  // Navigate to the columns blocks.
51
52
  await page.click( '.edit-post-header-toolbar__list-view-toggle' );
52
- const columnsBlockMenuItem = (
53
- await page.$x(
54
- "//a[contains(@class,'block-editor-list-view-block-select-button') and contains(text(), 'Columns')]"
55
- )
53
+
54
+ const firstColumnsBlockMenuItem = (
55
+ await getListViewBlocks( 'Columns' )
56
56
  )[ 0 ];
57
- await columnsBlockMenuItem.click();
57
+ await firstColumnsBlockMenuItem.click();
58
58
 
59
59
  // Tweak the columns count.
60
60
  await openDocumentSettingsSidebar();
@@ -73,12 +73,10 @@ describe( 'Navigating the block hierarchy', () => {
73
73
  );
74
74
 
75
75
  // Navigate to the last column block.
76
- const lastColumnsBlockMenuItem = (
77
- await page.$x(
78
- "//a[contains(@class,'block-editor-list-view-block-select-button') and contains(text(), 'Column')]"
79
- )
80
- )[ 3 ];
81
- await lastColumnsBlockMenuItem.click();
76
+ const lastColumnBlockMenuItem = (
77
+ await getListViewBlocks( 'Column' )
78
+ )[ 2 ];
79
+ await lastColumnBlockMenuItem.click();
82
80
 
83
81
  // Insert text in the last column block.
84
82
  await page.keyboard.press( 'ArrowDown' ); // Navigate to inserter.
@@ -186,11 +184,7 @@ describe( 'Navigating the block hierarchy', () => {
186
184
 
187
185
  // Try selecting the group block using the Outline.
188
186
  await page.click( '.edit-post-header-toolbar__list-view-toggle' );
189
- const groupMenuItem = (
190
- await page.$x(
191
- "//a[contains(@class,'block-editor-list-view-block-select-button') and contains(text(), 'Group')]"
192
- )
193
- )[ 0 ];
187
+ const groupMenuItem = ( await getListViewBlocks( 'Group' ) )[ 0 ];
194
188
  await groupMenuItem.click();
195
189
 
196
190
  // The group block's wrapper should be selected.