@wordpress/e2e-tests 3.0.9 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/setup-performance-test.js +1 -1
- package/config/setup-test-framework.js +1 -1
- package/package.json +5 -5
- package/specs/editor/blocks/__snapshots__/navigation.test.js.snap +16 -16
- package/specs/editor/blocks/classic.test.js +2 -2
- package/specs/editor/blocks/cover.test.js +17 -17
- package/specs/editor/blocks/list.test.js +1 -1
- package/specs/editor/blocks/navigation.test.js +259 -52
- package/specs/editor/blocks/table.test.js +1 -1
- package/specs/editor/plugins/align-hook.test.js +10 -10
- package/specs/editor/plugins/block-context.test.js +1 -1
- package/specs/editor/plugins/block-directory-add.test.js +14 -14
- package/specs/editor/plugins/custom-post-types.test.js +1 -1
- package/specs/editor/plugins/custom-taxonomies.test.js +3 -3
- package/specs/editor/plugins/meta-attribute-block.test.js +1 -1
- package/specs/editor/plugins/meta-boxes.test.js +3 -3
- package/specs/editor/plugins/templates.test.js +1 -1
- package/specs/editor/plugins/wp-editor-meta-box.test.js +1 -1
- package/specs/editor/various/autosave.test.js +19 -19
- package/specs/editor/various/block-deletion.test.js +5 -5
- package/specs/editor/various/block-grouping.test.js +29 -12
- package/specs/editor/various/block-hierarchy-navigation.test.js +5 -5
- package/specs/editor/various/change-detection.test.js +3 -3
- package/specs/editor/various/compatibility-classic-editor.test.js +1 -1
- package/specs/editor/various/copy-cut-paste-whole-blocks.test.js +7 -7
- package/specs/editor/various/datepicker.test.js +1 -1
- package/specs/editor/various/duplicating-blocks.test.js +3 -3
- package/specs/editor/various/editor-modes.test.js +5 -5
- package/specs/editor/various/inserting-blocks.test.js +6 -6
- package/specs/editor/various/invalid-block.test.js +4 -4
- package/specs/editor/various/is-typing.test.js +8 -8
- package/specs/editor/various/keyboard-navigable-blocks.test.js +2 -2
- package/specs/editor/various/links.test.js +90 -90
- package/specs/editor/various/list-view.test.js +47 -1
- package/specs/editor/various/manage-reusable-blocks.test.js +5 -5
- package/specs/editor/various/multi-block-selection.test.js +2 -2
- package/specs/editor/various/navigable-toolbar.test.js +1 -1
- package/specs/editor/various/new-post-default-content.test.js +2 -2
- package/specs/editor/various/new-post.test.js +1 -1
- package/specs/editor/various/nux.test.js +11 -11
- package/specs/editor/various/popovers.test.js +3 -3
- package/specs/editor/various/post-editor-template-mode.test.js +12 -11
- package/specs/editor/various/preferences.test.js +1 -1
- package/specs/editor/various/preview.test.js +8 -4
- package/specs/editor/various/publish-button.test.js +2 -2
- package/specs/editor/various/publishing.test.js +50 -1
- package/specs/editor/various/reusable-blocks.test.js +31 -31
- package/specs/editor/various/rich-text.test.js +1 -1
- package/specs/editor/various/splitting-merging.test.js +6 -6
- package/specs/editor/various/style-variation.test.js +2 -2
- package/specs/editor/various/switch-to-draft.test.js +3 -1
- package/specs/editor/various/taxonomies.test.js +1 -1
- package/specs/editor/various/toolbar-roving-tabindex.test.js +1 -1
- package/specs/editor/various/writing-flow.test.js +20 -20
- package/specs/experiments/navigation-editor.test.js +168 -3
- package/specs/performance/post-editor.test.js +7 -7
- package/specs/performance/site-editor.test.js +1 -1
- package/specs/site-editor/document-settings.test.js +5 -5
- package/specs/site-editor/multi-entity-editing.test.js +1 -1
- package/specs/site-editor/multi-entity-saving.test.js +1 -1
- package/specs/site-editor/template-part.test.js +9 -8
- package/specs/widgets/customizing-widgets.test.js +10 -9
- package/specs/widgets/editing-widgets.test.js +8 -7
@@ -86,7 +86,7 @@ describe( 'Meta boxes', () => {
|
|
86
86
|
await viewPostLinks[ 0 ].click();
|
87
87
|
await page.waitForNavigation();
|
88
88
|
|
89
|
-
// Retrieve the excerpt used as meta
|
89
|
+
// Retrieve the excerpt used as meta.
|
90
90
|
const metaExcerpt = await page.evaluate( () => {
|
91
91
|
return document
|
92
92
|
.querySelector( 'meta[property="gutenberg:hello"]' )
|
@@ -101,7 +101,7 @@ describe( 'Meta boxes', () => {
|
|
101
101
|
await page.keyboard.type( 'Excerpt from content.' );
|
102
102
|
await page.type( '.editor-post-title__input', 'A published post' );
|
103
103
|
|
104
|
-
// Open the excerpt panel
|
104
|
+
// Open the excerpt panel.
|
105
105
|
await openDocumentSettingsSidebar();
|
106
106
|
const excerptButton = await findSidebarPanelToggleButtonWithTitle(
|
107
107
|
'Excerpt'
|
@@ -126,7 +126,7 @@ describe( 'Meta boxes', () => {
|
|
126
126
|
await viewPostLinks[ 0 ].click();
|
127
127
|
await page.waitForNavigation();
|
128
128
|
|
129
|
-
// Retrieve the excerpt used as meta
|
129
|
+
// Retrieve the excerpt used as meta.
|
130
130
|
const metaExcerpt = await page.evaluate( () => {
|
131
131
|
return document
|
132
132
|
.querySelector( 'meta[property="gutenberg:hello"]' )
|
@@ -105,7 +105,7 @@ describe( 'templates', () => {
|
|
105
105
|
await page.reload();
|
106
106
|
await page.waitForSelector( '.edit-post-layout' );
|
107
107
|
|
108
|
-
// Wait a bit more for getEditedPostContent to be correct
|
108
|
+
// Wait a bit more for getEditedPostContent to be correct.
|
109
109
|
await page.waitForSelector(
|
110
110
|
'.block-editor-default-block-appender__content'
|
111
111
|
);
|
@@ -22,7 +22,7 @@ describe( 'WP Editor Meta Boxes', () => {
|
|
22
22
|
// Add title to enable valid non-empty post save.
|
23
23
|
await page.type( '.editor-post-title__input', 'Hello Meta' );
|
24
24
|
|
25
|
-
// Type something
|
25
|
+
// Type something.
|
26
26
|
await expect( page ).toClick( '#test_tinymce_id-html' );
|
27
27
|
await page.type( '#test_tinymce_id', 'Typing in a metabox' );
|
28
28
|
await page.click( '#test_tinymce_id-tmce' );
|
@@ -77,7 +77,7 @@ describe( 'autosave', () => {
|
|
77
77
|
|
78
78
|
it( 'should save to sessionStorage', async () => {
|
79
79
|
// Wait for the original timeout to kick in, it will schedule
|
80
|
-
// another run using the updated interval length of AUTOSAVE_INTERVAL_SECONDS
|
80
|
+
// another run using the updated interval length of AUTOSAVE_INTERVAL_SECONDS.
|
81
81
|
await sleep( 15 );
|
82
82
|
|
83
83
|
await clickBlockAppender();
|
@@ -86,7 +86,7 @@ describe( 'autosave', () => {
|
|
86
86
|
await sleep( 1 );
|
87
87
|
await page.keyboard.type( ' after save' );
|
88
88
|
|
89
|
-
// Wait long enough for local autosave to kick in
|
89
|
+
// Wait long enough for local autosave to kick in.
|
90
90
|
await sleep( AUTOSAVE_INTERVAL_SECONDS + 1 );
|
91
91
|
|
92
92
|
const id = await getCurrentPostId();
|
@@ -101,11 +101,11 @@ describe( 'autosave', () => {
|
|
101
101
|
await saveDraftWithKeyboard();
|
102
102
|
await page.keyboard.type( ' after save' );
|
103
103
|
|
104
|
-
// Trigger local autosave
|
104
|
+
// Trigger local autosave.
|
105
105
|
await page.evaluate( () =>
|
106
106
|
window.wp.data.dispatch( 'core/editor' ).autosave( { local: true } )
|
107
107
|
);
|
108
|
-
// Reload without saving on the server
|
108
|
+
// Reload without saving on the server.
|
109
109
|
await page.reload();
|
110
110
|
await page.waitForSelector( '.edit-post-layout' );
|
111
111
|
|
@@ -129,7 +129,7 @@ describe( 'autosave', () => {
|
|
129
129
|
await page.keyboard.type( 'before save' );
|
130
130
|
await saveDraft();
|
131
131
|
|
132
|
-
// Fake local autosave
|
132
|
+
// Fake local autosave.
|
133
133
|
await page.evaluate(
|
134
134
|
( postId ) =>
|
135
135
|
window.sessionStorage.setItem(
|
@@ -161,13 +161,13 @@ describe( 'autosave', () => {
|
|
161
161
|
} );
|
162
162
|
|
163
163
|
it( 'should clear local autosave after successful remote autosave', async () => {
|
164
|
-
// Edit, save draft, edit again
|
164
|
+
// Edit, save draft, edit again.
|
165
165
|
await clickBlockAppender();
|
166
166
|
await page.keyboard.type( 'before save' );
|
167
167
|
await saveDraftWithKeyboard();
|
168
168
|
await page.keyboard.type( ' after save' );
|
169
169
|
|
170
|
-
// Trigger local autosave
|
170
|
+
// Trigger local autosave.
|
171
171
|
await page.evaluate( () =>
|
172
172
|
window.wp.data.dispatch( 'core/editor' ).autosave( { local: true } )
|
173
173
|
);
|
@@ -175,7 +175,7 @@ describe( 'autosave', () => {
|
|
175
175
|
await page.evaluate( () => window.sessionStorage.length )
|
176
176
|
).toBeGreaterThanOrEqual( 1 );
|
177
177
|
|
178
|
-
// Trigger remote autosave
|
178
|
+
// Trigger remote autosave.
|
179
179
|
await page.evaluate( () =>
|
180
180
|
window.wp.data.dispatch( 'core/editor' ).autosave()
|
181
181
|
);
|
@@ -185,13 +185,13 @@ describe( 'autosave', () => {
|
|
185
185
|
} );
|
186
186
|
|
187
187
|
it( "shouldn't clear local autosave if remote autosave fails", async () => {
|
188
|
-
// Edit, save draft, edit again
|
188
|
+
// Edit, save draft, edit again.
|
189
189
|
await clickBlockAppender();
|
190
190
|
await page.keyboard.type( 'before save' );
|
191
191
|
await saveDraftWithKeyboard();
|
192
192
|
await page.keyboard.type( ' after save' );
|
193
193
|
|
194
|
-
// Trigger local autosave
|
194
|
+
// Trigger local autosave.
|
195
195
|
await page.evaluate( () =>
|
196
196
|
window.wp.data.dispatch( 'core/editor' ).autosave( { local: true } )
|
197
197
|
);
|
@@ -199,7 +199,7 @@ describe( 'autosave', () => {
|
|
199
199
|
await page.evaluate( () => window.sessionStorage.length )
|
200
200
|
).toBe( 1 );
|
201
201
|
|
202
|
-
// Bring network down and attempt to autosave remotely
|
202
|
+
// Bring network down and attempt to autosave remotely.
|
203
203
|
toggleOfflineMode( true );
|
204
204
|
await page.evaluate( () =>
|
205
205
|
window.wp.data.dispatch( 'core/editor' ).autosave()
|
@@ -210,13 +210,13 @@ describe( 'autosave', () => {
|
|
210
210
|
} );
|
211
211
|
|
212
212
|
it( 'should clear local autosave after successful save', async () => {
|
213
|
-
// Edit, save draft, edit again
|
213
|
+
// Edit, save draft, edit again.
|
214
214
|
await clickBlockAppender();
|
215
215
|
await page.keyboard.type( 'before save' );
|
216
216
|
await saveDraftWithKeyboard();
|
217
217
|
await page.keyboard.type( ' after save' );
|
218
218
|
|
219
|
-
// Trigger local autosave
|
219
|
+
// Trigger local autosave.
|
220
220
|
await page.evaluate( () =>
|
221
221
|
window.wp.data.dispatch( 'core/editor' ).autosave( { local: true } )
|
222
222
|
);
|
@@ -231,13 +231,13 @@ describe( 'autosave', () => {
|
|
231
231
|
} );
|
232
232
|
|
233
233
|
it( "shouldn't clear local autosave if save fails", async () => {
|
234
|
-
// Edit, save draft, edit again
|
234
|
+
// Edit, save draft, edit again.
|
235
235
|
await clickBlockAppender();
|
236
236
|
await page.keyboard.type( 'before save' );
|
237
237
|
await saveDraftWithKeyboard();
|
238
238
|
await page.keyboard.type( ' after save' );
|
239
239
|
|
240
|
-
// Trigger local autosave
|
240
|
+
// Trigger local autosave.
|
241
241
|
await page.evaluate( () =>
|
242
242
|
window.wp.data.dispatch( 'core/editor' ).autosave( { local: true } )
|
243
243
|
);
|
@@ -245,7 +245,7 @@ describe( 'autosave', () => {
|
|
245
245
|
await page.evaluate( () => window.sessionStorage.length )
|
246
246
|
).toBeGreaterThanOrEqual( 1 );
|
247
247
|
|
248
|
-
// Bring network down and attempt to save
|
248
|
+
// Bring network down and attempt to save.
|
249
249
|
toggleOfflineMode( true );
|
250
250
|
saveDraftWithKeyboard();
|
251
251
|
expect(
|
@@ -261,12 +261,12 @@ describe( 'autosave', () => {
|
|
261
261
|
await page.click( '[data-type="core/paragraph"]' );
|
262
262
|
await page.keyboard.type( ' after publish' );
|
263
263
|
|
264
|
-
// Trigger remote autosave
|
264
|
+
// Trigger remote autosave.
|
265
265
|
await page.evaluate( () =>
|
266
266
|
window.wp.data.dispatch( 'core/editor' ).autosave()
|
267
267
|
);
|
268
268
|
|
269
|
-
// Force conflicting local autosave
|
269
|
+
// Force conflicting local autosave.
|
270
270
|
await page.evaluate( () =>
|
271
271
|
window.wp.data.dispatch( 'core/editor' ).autosave( { local: true } )
|
272
272
|
);
|
@@ -307,7 +307,7 @@ describe( 'autosave', () => {
|
|
307
307
|
await page.keyboard.type( 'before save' );
|
308
308
|
await saveDraft();
|
309
309
|
|
310
|
-
// Fake local autosave
|
310
|
+
// Fake local autosave.
|
311
311
|
await page.evaluate(
|
312
312
|
( postId ) =>
|
313
313
|
window.sessionStorage.setItem(
|
@@ -15,7 +15,7 @@ import {
|
|
15
15
|
const addThreeParagraphsToNewPost = async () => {
|
16
16
|
await createNewPost();
|
17
17
|
|
18
|
-
// Add demo content
|
18
|
+
// Add demo content.
|
19
19
|
await clickBlockAppender();
|
20
20
|
await page.keyboard.type( 'First paragraph' );
|
21
21
|
await page.keyboard.press( 'Enter' );
|
@@ -40,7 +40,7 @@ const clickOnBlockSettingsMenuRemoveBlockButton = async () => {
|
|
40
40
|
( btns ) => btns.length
|
41
41
|
);
|
42
42
|
|
43
|
-
// Limit by the number of buttons available
|
43
|
+
// Limit by the number of buttons available.
|
44
44
|
while ( --numButtons ) {
|
45
45
|
await page.keyboard.press( 'Tab' );
|
46
46
|
|
@@ -50,14 +50,14 @@ const clickOnBlockSettingsMenuRemoveBlockButton = async () => {
|
|
50
50
|
);
|
51
51
|
} );
|
52
52
|
|
53
|
-
// Stop looping once we find the button
|
53
|
+
// Stop looping once we find the button.
|
54
54
|
if ( isRemoveButton ) {
|
55
55
|
await pressKeyTimes( 'Enter', 1 );
|
56
56
|
break;
|
57
57
|
}
|
58
58
|
}
|
59
59
|
|
60
|
-
// Makes failures more explicit
|
60
|
+
// Makes failures more explicit.
|
61
61
|
await expect( isRemoveButton ).toBe( true );
|
62
62
|
};
|
63
63
|
|
@@ -66,7 +66,7 @@ describe( 'block deletion -', () => {
|
|
66
66
|
|
67
67
|
describe( 'deleting the third block using the Remove Block menu item', () => {
|
68
68
|
it( 'results in two remaining blocks and positions the caret at the end of the second block', async () => {
|
69
|
-
// The blocks can't be empty to trigger the toolbar
|
69
|
+
// The blocks can't be empty to trigger the toolbar.
|
70
70
|
await page.keyboard.type( 'Paragraph to remove' );
|
71
71
|
await clickOnBlockSettingsMenuRemoveBlockButton();
|
72
72
|
|
@@ -39,13 +39,13 @@ async function insertBlocksOfMultipleTypes() {
|
|
39
39
|
|
40
40
|
describe( 'Block Grouping', () => {
|
41
41
|
beforeEach( async () => {
|
42
|
-
// Posts are auto-removed at the end of each test run
|
42
|
+
// Posts are auto-removed at the end of each test run.
|
43
43
|
await createNewPost();
|
44
44
|
} );
|
45
45
|
|
46
46
|
describe( 'Group creation', () => {
|
47
47
|
it( 'creates a group from multiple blocks of the same type via block transforms', async () => {
|
48
|
-
// Creating test blocks
|
48
|
+
// Creating test blocks.
|
49
49
|
await insertBlocksOfSameType();
|
50
50
|
|
51
51
|
// Multiselect via keyboard.
|
@@ -58,7 +58,7 @@ describe( 'Block Grouping', () => {
|
|
58
58
|
} );
|
59
59
|
|
60
60
|
it( 'creates a group from multiple blocks of different types via block transforms', async () => {
|
61
|
-
// Creating test blocks
|
61
|
+
// Creating test blocks.
|
62
62
|
await insertBlocksOfMultipleTypes();
|
63
63
|
|
64
64
|
// Multiselect via keyboard.
|
@@ -71,7 +71,7 @@ describe( 'Block Grouping', () => {
|
|
71
71
|
} );
|
72
72
|
|
73
73
|
it( 'creates a group from multiple blocks of the same type via options toolbar', async () => {
|
74
|
-
// Creating test blocks
|
74
|
+
// Creating test blocks.
|
75
75
|
await insertBlocksOfSameType();
|
76
76
|
|
77
77
|
// Multiselect via keyboard.
|
@@ -85,18 +85,18 @@ describe( 'Block Grouping', () => {
|
|
85
85
|
} );
|
86
86
|
|
87
87
|
it( 'groups and ungroups multiple blocks of different types via options toolbar', async () => {
|
88
|
-
// Creating test blocks
|
88
|
+
// Creating test blocks.
|
89
89
|
await insertBlocksOfMultipleTypes();
|
90
90
|
await pressKeyWithModifier( 'primary', 'a' );
|
91
91
|
await pressKeyWithModifier( 'primary', 'a' );
|
92
92
|
|
93
|
-
// Group
|
93
|
+
// Group.
|
94
94
|
await clickBlockToolbarButton( 'Options' );
|
95
95
|
await clickMenuItem( 'Group' );
|
96
96
|
|
97
97
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
98
98
|
|
99
|
-
// UnGroup
|
99
|
+
// UnGroup.
|
100
100
|
await clickBlockToolbarButton( 'Options' );
|
101
101
|
await clickMenuItem( 'Ungroup' );
|
102
102
|
|
@@ -140,24 +140,41 @@ describe( 'Block Grouping', () => {
|
|
140
140
|
// Make sure the paragraph in reusable block exists.
|
141
141
|
expect( await getParagraphText() ).toEqual( paragraphText );
|
142
142
|
} );
|
143
|
+
it( 'should group another Group block via options toolbar', async () => {
|
144
|
+
await insertBlock( 'Paragraph' );
|
145
|
+
await page.keyboard.type( '1' );
|
146
|
+
await clickBlockToolbarButton( 'Options' );
|
147
|
+
await clickMenuItem( 'Group' );
|
148
|
+
await clickBlockToolbarButton( 'Options' );
|
149
|
+
await clickMenuItem( 'Group' );
|
150
|
+
expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
|
151
|
+
"<!-- wp:group -->
|
152
|
+
<div class=\\"wp-block-group\\"><!-- wp:group -->
|
153
|
+
<div class=\\"wp-block-group\\"><!-- wp:paragraph -->
|
154
|
+
<p>1</p>
|
155
|
+
<!-- /wp:paragraph --></div>
|
156
|
+
<!-- /wp:group --></div>
|
157
|
+
<!-- /wp:group -->"
|
158
|
+
` );
|
159
|
+
} );
|
143
160
|
} );
|
144
161
|
|
145
162
|
describe( 'Grouping Block availability', () => {
|
146
163
|
beforeEach( async () => {
|
147
|
-
// Disable the Group block
|
164
|
+
// Disable the Group block.
|
148
165
|
await page.evaluate( () => {
|
149
166
|
const { dispatch } = wp.data;
|
150
167
|
dispatch( 'core/edit-post' ).hideBlockTypes( [ 'core/group' ] );
|
151
168
|
} );
|
152
169
|
|
153
|
-
// Create a Group
|
170
|
+
// Create a Group.
|
154
171
|
await insertBlocksOfMultipleTypes();
|
155
172
|
await pressKeyWithModifier( 'primary', 'a' );
|
156
173
|
await pressKeyWithModifier( 'primary', 'a' );
|
157
174
|
} );
|
158
175
|
|
159
176
|
afterAll( async () => {
|
160
|
-
// Re-enable the Group block
|
177
|
+
// Re-enable the Group block.
|
161
178
|
await page.evaluate( () => {
|
162
179
|
const { dispatch } = wp.data;
|
163
180
|
dispatch( 'core/edit-post' ).showBlockTypes( [ 'core/group' ] );
|
@@ -239,14 +256,14 @@ describe( 'Block Grouping', () => {
|
|
239
256
|
} );
|
240
257
|
|
241
258
|
it( 'should use registered grouping block for grouping interactions', async () => {
|
242
|
-
// Set custom Block as the Block to use for Grouping
|
259
|
+
// Set custom Block as the Block to use for Grouping.
|
243
260
|
await page.evaluate( () => {
|
244
261
|
window.wp.blocks.setGroupingBlockName(
|
245
262
|
'test/alternative-group-block'
|
246
263
|
);
|
247
264
|
} );
|
248
265
|
|
249
|
-
// Creating test blocks
|
266
|
+
// Creating test blocks.
|
250
267
|
await insertBlocksOfSameType();
|
251
268
|
|
252
269
|
// Multiselect via keyboard.
|
@@ -129,7 +129,7 @@ describe( 'Navigating the block hierarchy', () => {
|
|
129
129
|
await page.keyboard.press( 'Enter' );
|
130
130
|
await page.waitForSelector( '.is-selected[data-type="core/column"]' );
|
131
131
|
|
132
|
-
// Insert text in the last column block
|
132
|
+
// Insert text in the last column block.
|
133
133
|
await page.keyboard.press( 'ArrowDown' ); // Navigate to inserter.
|
134
134
|
await page.keyboard.press( 'Enter' ); // Activate inserter.
|
135
135
|
await page.keyboard.type( 'Paragraph' );
|
@@ -165,7 +165,7 @@ describe( 'Navigating the block hierarchy', () => {
|
|
165
165
|
} );
|
166
166
|
|
167
167
|
it( 'should select the wrapper div for a group', async () => {
|
168
|
-
// Insert a group block
|
168
|
+
// Insert a group block.
|
169
169
|
await insertBlock( 'Group' );
|
170
170
|
|
171
171
|
// Insert some random blocks.
|
@@ -178,13 +178,13 @@ describe( 'Navigating the block hierarchy', () => {
|
|
178
178
|
await page.keyboard.type( 'just a paragraph' );
|
179
179
|
await insertBlock( 'Separator' );
|
180
180
|
|
181
|
-
// Check the Group block content
|
181
|
+
// Check the Group block content.
|
182
182
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
183
183
|
|
184
|
-
// Unselect the blocks
|
184
|
+
// Unselect the blocks.
|
185
185
|
await page.click( '.editor-post-title' );
|
186
186
|
|
187
|
-
// Try selecting the group block using the Outline
|
187
|
+
// Try selecting the group block using the Outline.
|
188
188
|
await page.click( '.edit-post-header-toolbar__list-view-toggle' );
|
189
189
|
const groupMenuItem = (
|
190
190
|
await page.$x(
|
@@ -320,13 +320,13 @@ describe( 'Change detection', () => {
|
|
320
320
|
await clickBlockAppender();
|
321
321
|
await page.keyboard.type( 'Paragraph' );
|
322
322
|
|
323
|
-
// Save
|
323
|
+
// Save.
|
324
324
|
await saveDraft();
|
325
325
|
|
326
326
|
// Verify that the title is empty.
|
327
327
|
const title = await page.$eval(
|
328
328
|
'.editor-post-title__input',
|
329
|
-
// Trim padding non-breaking space
|
329
|
+
// Trim padding non-breaking space.
|
330
330
|
( element ) => element.textContent.trim()
|
331
331
|
);
|
332
332
|
expect( title ).toBe( '' );
|
@@ -339,7 +339,7 @@ describe( 'Change detection', () => {
|
|
339
339
|
// Enter title.
|
340
340
|
await page.type( '.editor-post-title__input', 'Hello World' );
|
341
341
|
|
342
|
-
// Save
|
342
|
+
// Save.
|
343
343
|
await saveDraft();
|
344
344
|
const postId = await page.evaluate( () =>
|
345
345
|
window.wp.data.select( 'core/editor' ).getCurrentPostId()
|
@@ -28,7 +28,7 @@ describe( 'Compatibility with classic editor', () => {
|
|
28
28
|
await viewPostLinks[ 0 ].click();
|
29
29
|
await page.waitForNavigation();
|
30
30
|
|
31
|
-
// Check the the content doesn't contain <p> tags
|
31
|
+
// Check the the content doesn't contain <p> tags.
|
32
32
|
await page.waitForSelector( '.entry-content' );
|
33
33
|
const content = await page.$eval( '.entry-content', ( element ) =>
|
34
34
|
element.innerHTML.trim()
|
@@ -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
|