@wordpress/e2e-tests 2.5.12 → 3.0.1-next.33ec3857e2.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/CHANGELOG.md +6 -0
- package/config/flaky-tests-reporter.js +2 -1
- package/package.json +10 -9
- package/specs/editor/blocks/__snapshots__/heading.test.js.snap +2 -2
- package/specs/editor/blocks/__snapshots__/navigation.test.js.snap +27 -59
- package/specs/editor/blocks/columns.test.js +1 -1
- package/specs/editor/blocks/cover.test.js +1 -1
- package/specs/editor/blocks/heading.test.js +15 -3
- package/specs/editor/blocks/image.test.js +1 -2
- package/specs/editor/blocks/navigation.test.js +264 -370
- package/specs/editor/blocks/preformatted.test.js +2 -1
- package/specs/editor/blocks/site-title.test.js +2 -31
- package/specs/editor/fixtures/menu-items-request-fixture.json +84 -0
- package/specs/editor/fixtures/menu-items-response-fixture.json +240 -144
- package/specs/editor/plugins/custom-post-types.test.js +4 -3
- package/specs/editor/various/adding-patterns.test.js +1 -1
- package/specs/editor/various/block-grouping.test.js +2 -18
- package/specs/editor/various/block-hierarchy-navigation.test.js +3 -3
- package/specs/editor/various/change-detection.test.js +5 -0
- package/specs/editor/various/editor-modes.test.js +7 -0
- package/specs/editor/various/font-size-picker.test.js +1 -7
- package/specs/editor/various/inserting-blocks.test.js +6 -2
- package/specs/editor/various/keyboard-navigable-blocks.test.js +6 -0
- package/specs/editor/various/list-view.test.js +2 -2
- package/specs/editor/various/navigable-toolbar.test.js +2 -2
- package/specs/editor/various/preview.test.js +1 -1
- package/specs/editor/various/reusable-blocks.test.js +1 -26
- package/specs/editor/various/writing-flow.test.js +8 -4
- package/specs/site-editor/document-settings.test.js +1 -1
- package/specs/site-editor/multi-entity-saving.test.js +108 -55
- package/specs/site-editor/template-part.test.js +88 -68
- package/specs/widgets/customizing-widgets.test.js +4 -0
@@ -2,9 +2,7 @@
|
|
2
2
|
* WordPress dependencies
|
3
3
|
*/
|
4
4
|
import {
|
5
|
-
createNewPost,
|
6
5
|
insertBlock,
|
7
|
-
disablePrePublishChecks,
|
8
6
|
trashAllPosts,
|
9
7
|
activateTheme,
|
10
8
|
getAllBlocks,
|
@@ -260,72 +258,94 @@ describe( 'Template Part', () => {
|
|
260
258
|
finalTemplateParts.length - initialTemplateParts.length
|
261
259
|
).toBe( 1 );
|
262
260
|
} );
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
'
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
261
|
+
describe( 'Template part placeholder', () => {
|
262
|
+
// Test constants for template part.
|
263
|
+
const testContent = 'some words...';
|
264
|
+
|
265
|
+
// Selectors
|
266
|
+
const entitiesSaveSelector =
|
267
|
+
'.editor-entities-saved-states__save-button';
|
268
|
+
const savePostSelector = '.edit-site-save-button__button';
|
269
|
+
const templatePartSelector = '*[data-type="core/template-part"]';
|
270
|
+
const activatedTemplatePartSelector = `${ templatePartSelector }.block-editor-block-list__layout`;
|
271
|
+
const createNewButtonSelector =
|
272
|
+
'//button[contains(text(), "New template part")]';
|
273
|
+
const chooseExistingButtonSelector =
|
274
|
+
'//button[contains(text(), "Choose existing")]';
|
275
|
+
const confirmTitleButtonSelector =
|
276
|
+
'.wp-block-template-part__placeholder-create-new__title-form .components-button.is-primary';
|
277
|
+
|
278
|
+
it( 'Should insert new template part on creation', async () => {
|
279
|
+
let siteEditorCanvas = canvas();
|
280
|
+
await awaitHeaderAndFooterLoad();
|
281
|
+
|
282
|
+
// Create new template part.
|
283
|
+
await insertBlock( 'Template Part' );
|
284
|
+
await siteEditorCanvas.waitForXPath(
|
285
|
+
chooseExistingButtonSelector
|
286
|
+
);
|
287
|
+
const [ createNewButton ] = await siteEditorCanvas.$x(
|
288
|
+
createNewButtonSelector
|
289
|
+
);
|
290
|
+
await createNewButton.click();
|
291
|
+
const confirmTitleButton = await page.waitForSelector(
|
292
|
+
confirmTitleButtonSelector
|
293
|
+
);
|
294
|
+
await page.keyboard.press( 'Tab' );
|
295
|
+
await page.keyboard.press( 'Tab' );
|
296
|
+
await page.keyboard.type( 'Create New' );
|
297
|
+
await confirmTitleButton.click();
|
298
|
+
|
299
|
+
const newTemplatePart = await siteEditorCanvas.waitForSelector(
|
300
|
+
activatedTemplatePartSelector
|
301
|
+
);
|
302
|
+
expect( newTemplatePart ).toBeTruthy();
|
303
|
+
|
304
|
+
// Finish creating template part, insert some text, and save.
|
305
|
+
await siteEditorCanvas.waitForSelector(
|
306
|
+
'.block-editor-button-block-appender'
|
307
|
+
);
|
308
|
+
await siteEditorCanvas.click(
|
309
|
+
'.block-editor-button-block-appender'
|
310
|
+
);
|
311
|
+
await page.waitForSelector(
|
312
|
+
'.editor-block-list-item-paragraph'
|
313
|
+
);
|
314
|
+
await page.click( '.editor-block-list-item-paragraph' );
|
315
|
+
await page.keyboard.type( testContent );
|
316
|
+
await page.click( savePostSelector );
|
317
|
+
await page.click( entitiesSaveSelector );
|
318
|
+
|
319
|
+
// Reload the page so as the new template part is available in the existing template parts.
|
320
|
+
await siteEditor.visit();
|
321
|
+
siteEditorCanvas = canvas();
|
322
|
+
await awaitHeaderAndFooterLoad();
|
323
|
+
// Try to insert the template part we created.
|
324
|
+
await insertBlock( 'Template Part' );
|
325
|
+
const chooseExistingButton = await siteEditorCanvas.waitForXPath(
|
326
|
+
chooseExistingButtonSelector
|
327
|
+
);
|
328
|
+
await chooseExistingButton.click();
|
329
|
+
await page.waitForSelector(
|
330
|
+
'.wp-block-template-part__selection-preview-container'
|
331
|
+
);
|
332
|
+
const preview = await page.waitForSelector(
|
333
|
+
'.wp-block-template-part__selection-preview-item[aria-label="Create New"]'
|
334
|
+
);
|
335
|
+
await preview.click();
|
336
|
+
// We now have the same template part two times in the page, so check accordingly.
|
337
|
+
const paragraphs = await siteEditorCanvas.$$eval(
|
338
|
+
'[data-type="core/template-part"] > p:first-child',
|
339
|
+
( options ) =>
|
340
|
+
options.map( ( option ) => option.textContent )
|
341
|
+
);
|
342
|
+
expect( paragraphs ).toHaveLength( 2 );
|
343
|
+
expect(
|
344
|
+
paragraphs.every(
|
345
|
+
( paragraph ) => paragraph === testContent
|
346
|
+
)
|
347
|
+
).toBeTruthy();
|
348
|
+
} );
|
329
349
|
} );
|
330
350
|
} );
|
331
351
|
} );
|
@@ -10,6 +10,7 @@ import {
|
|
10
10
|
clickBlockToolbarButton,
|
11
11
|
deleteAllWidgets,
|
12
12
|
createURL,
|
13
|
+
openTypographyToolsPanelMenu,
|
13
14
|
} from '@wordpress/e2e-test-utils';
|
14
15
|
|
15
16
|
/**
|
@@ -831,6 +832,9 @@ describe( 'Widgets Customizer', () => {
|
|
831
832
|
await showMoreSettingsButton.click();
|
832
833
|
|
833
834
|
// Change `drop cap` (Any change made in this section is sufficient; not required to be `drop cap`).
|
835
|
+
await openTypographyToolsPanelMenu();
|
836
|
+
await page.click( 'button[aria-label="Show Drop cap"]' );
|
837
|
+
|
834
838
|
const [ dropCapToggle ] = await page.$x(
|
835
839
|
"//label[contains(text(), 'Drop cap')]"
|
836
840
|
);
|