@wordpress/e2e-tests 6.3.5 → 6.5.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 +4 -0
- package/config/setup-performance-test.js +14 -7
- package/jest.config.js +4 -0
- package/package.json +7 -7
- package/specs/editor/blocks/pullquote.test.js +3 -3
- package/specs/editor/plugins/__snapshots__/align-hook.test.js.snap +11 -11
- package/specs/editor/plugins/__snapshots__/container-blocks.test.js.snap +14 -14
- package/specs/editor/plugins/__snapshots__/cpt-locking.test.js.snap +29 -29
- package/specs/editor/plugins/__snapshots__/iframed-inline-styles.test.js.snap +1 -1
- package/specs/editor/plugins/__snapshots__/iframed-masonry-block.test.js.snap +1 -1
- package/specs/editor/plugins/__snapshots__/inner-blocks-render-appender.test.js.snap +5 -5
- package/specs/editor/plugins/__snapshots__/plugins-api.test.js.snap +2 -2
- package/specs/editor/various/__snapshots__/adding-patterns.test.js.snap +4 -4
- package/specs/editor/various/__snapshots__/block-grouping.test.js.snap +21 -21
- package/specs/editor/various/__snapshots__/block-hierarchy-navigation.test.js.snap +12 -12
- package/specs/editor/various/__snapshots__/embedding.test.js.snap +19 -19
- package/specs/editor/various/__snapshots__/inserting-blocks.test.js.snap +8 -8
- package/specs/editor/various/__snapshots__/keep-styles-on-block-transforms.test.js.snap +11 -11
- package/specs/editor/various/__snapshots__/links.test.js.snap +9 -9
- package/specs/editor/various/__snapshots__/multi-block-selection.test.js.snap +17 -17
- package/specs/editor/various/__snapshots__/rich-text.test.js.snap +5 -5
- package/specs/editor/various/block-grouping.test.js +3 -3
- package/specs/editor/various/format-library/__snapshots__/text-color.test.js.snap +1 -1
- package/specs/editor/various/links.test.js +50 -16
- package/specs/editor/various/multi-block-selection.test.js +2 -2
- package/specs/performance/front-end-block-theme.test.js +48 -12
- package/specs/performance/front-end-classic-theme.test.js +50 -13
- package/specs/performance/post-editor.test.js +45 -28
- package/specs/performance/site-editor.test.js +69 -42
- package/specs/performance/utils.js +12 -1
- package/specs/widgets/editing-widgets.test.js +20 -15
- package/specs/editor/blocks/__snapshots__/heading.test.js.snap +0 -51
- package/specs/editor/blocks/__snapshots__/navigation.test.js.snap +0 -47
- package/specs/editor/blocks/heading.test.js +0 -113
- package/specs/editor/blocks/navigation.test.js +0 -1723
- package/specs/editor/blocks/query.test.js +0 -66
- package/specs/editor/various/__snapshots__/block-deletion.test.js.snap +0 -111
- package/specs/editor/various/__snapshots__/list-view.test.js.snap +0 -15
- package/specs/editor/various/block-deletion.test.js +0 -209
- package/specs/editor/various/list-view.test.js +0 -330
- package/specs/editor/various/switch-to-draft.test.js +0 -254
@@ -384,6 +384,11 @@ describe( 'Widgets screen', () => {
|
|
384
384
|
|
385
385
|
describe( 'Function widgets', () => {
|
386
386
|
async function addMarquee( nbExpectedMarquees ) {
|
387
|
+
const [ firstWidgetArea ] = await findAll( {
|
388
|
+
role: 'document',
|
389
|
+
name: 'Block: Widget Area',
|
390
|
+
} );
|
391
|
+
await firstWidgetArea.focus();
|
387
392
|
const marqueeBlock = await getBlockInGlobalInserter(
|
388
393
|
'Marquee Greeting'
|
389
394
|
);
|
@@ -463,19 +468,19 @@ describe( 'Widgets screen', () => {
|
|
463
468
|
await saveWidgets();
|
464
469
|
let editedSerializedWidgetAreas = await getSerializedWidgetAreas();
|
465
470
|
await expect( editedSerializedWidgetAreas ).toMatchInlineSnapshot( `
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
471
|
+
{
|
472
|
+
"sidebar-1": "<marquee>Howdy</marquee>",
|
473
|
+
}
|
474
|
+
` );
|
470
475
|
|
471
476
|
await page.reload();
|
472
477
|
|
473
478
|
editedSerializedWidgetAreas = await getSerializedWidgetAreas();
|
474
479
|
await expect( editedSerializedWidgetAreas ).toMatchInlineSnapshot( `
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
480
|
+
{
|
481
|
+
"sidebar-1": "<marquee>Howdy</marquee>",
|
482
|
+
}
|
483
|
+
` );
|
479
484
|
|
480
485
|
await addMarquee( 2 );
|
481
486
|
|
@@ -493,10 +498,10 @@ describe( 'Widgets screen', () => {
|
|
493
498
|
await saveWidgets();
|
494
499
|
editedSerializedWidgetAreas = await getSerializedWidgetAreas();
|
495
500
|
await expect( editedSerializedWidgetAreas ).toMatchInlineSnapshot( `
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
501
|
+
{
|
502
|
+
"sidebar-1": "<marquee>Howdy</marquee>",
|
503
|
+
}
|
504
|
+
` );
|
500
505
|
|
501
506
|
await page.reload();
|
502
507
|
const marqueesAfter = await findAll( {
|
@@ -825,11 +830,11 @@ describe( 'Widgets screen', () => {
|
|
825
830
|
|
826
831
|
const serializedWidgetAreas = await getSerializedWidgetAreas();
|
827
832
|
expect( serializedWidgetAreas ).toMatchInlineSnapshot( `
|
828
|
-
|
829
|
-
"sidebar-1": "<div class
|
833
|
+
{
|
834
|
+
"sidebar-1": "<div class="widget widget_block widget_text"><div class="widget-content">
|
830
835
|
<p>First Paragraph</p>
|
831
836
|
</div></div>
|
832
|
-
<div class
|
837
|
+
<div class="widget widget_block widget_text"><div class="widget-content">
|
833
838
|
<p>Second Paragraph</p>
|
834
839
|
</div></div>",
|
835
840
|
}
|
@@ -1,51 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`Heading can be created by prefixing existing content with number signs and a space 1`] = `
|
4
|
-
"<!-- wp:heading {\\"level\\":4} -->
|
5
|
-
<h4 class=\\"wp-block-heading\\">4</h4>
|
6
|
-
<!-- /wp:heading -->"
|
7
|
-
`;
|
8
|
-
|
9
|
-
exports[`Heading can be created by prefixing number sign and a space 1`] = `
|
10
|
-
"<!-- wp:heading {\\"level\\":3} -->
|
11
|
-
<h3 class=\\"wp-block-heading\\">3</h3>
|
12
|
-
<!-- /wp:heading -->"
|
13
|
-
`;
|
14
|
-
|
15
|
-
exports[`Heading should correctly apply named colors 1`] = `
|
16
|
-
"<!-- wp:heading {\\"textColor\\":\\"luminous-vivid-orange\\"} -->
|
17
|
-
<h2 class=\\"wp-block-heading has-luminous-vivid-orange-color has-text-color\\">Heading</h2>
|
18
|
-
<!-- /wp:heading -->"
|
19
|
-
`;
|
20
|
-
|
21
|
-
exports[`Heading should create a paragraph block above when pressing enter at the start 1`] = `
|
22
|
-
"<!-- wp:paragraph -->
|
23
|
-
<p></p>
|
24
|
-
<!-- /wp:paragraph -->
|
25
|
-
|
26
|
-
<!-- wp:heading -->
|
27
|
-
<h2 class=\\"wp-block-heading\\">a</h2>
|
28
|
-
<!-- /wp:heading -->"
|
29
|
-
`;
|
30
|
-
|
31
|
-
exports[`Heading should create a paragraph block below when pressing enter at the end 1`] = `
|
32
|
-
"<!-- wp:heading -->
|
33
|
-
<h2 class=\\"wp-block-heading\\">a</h2>
|
34
|
-
<!-- /wp:heading -->
|
35
|
-
|
36
|
-
<!-- wp:paragraph -->
|
37
|
-
<p></p>
|
38
|
-
<!-- /wp:paragraph -->"
|
39
|
-
`;
|
40
|
-
|
41
|
-
exports[`Heading should not work with the list input rule 1`] = `
|
42
|
-
"<!-- wp:heading -->
|
43
|
-
<h2 class=\\"wp-block-heading\\">1. H</h2>
|
44
|
-
<!-- /wp:heading -->"
|
45
|
-
`;
|
46
|
-
|
47
|
-
exports[`Heading should work with the format input rules 1`] = `
|
48
|
-
"<!-- wp:heading -->
|
49
|
-
<h2 class=\\"wp-block-heading\\"><code>code</code></h2>
|
50
|
-
<!-- /wp:heading -->"
|
51
|
-
`;
|
@@ -1,47 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`Navigation Creating and restarting converts uncontrolled inner blocks to an entity when modifications are made to the blocks 1`] = `"<!-- wp:navigation-link {\\"label\\":\\"A Test Page\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} /-->"`;
|
4
|
-
|
5
|
-
exports[`Navigation Placeholder menu selector actions allows a navigation block to be created from existing menus 1`] = `
|
6
|
-
"<!-- wp:navigation-link {\\"label\\":\\"Home\\",\\"type\\":\\"custom\\",\\"url\\":\\"http://localhost:8889/\\",\\"kind\\":\\"custom\\"} /-->
|
7
|
-
|
8
|
-
<!-- wp:navigation-submenu {\\"label\\":\\"About\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} -->
|
9
|
-
<!-- wp:navigation-link {\\"label\\":\\"Our team\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} /-->
|
10
|
-
<!-- /wp:navigation-submenu -->
|
11
|
-
|
12
|
-
<!-- wp:navigation-submenu {\\"label\\":\\"Shop\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} -->
|
13
|
-
<!-- wp:navigation-submenu {\\"label\\":\\"Winter apparel\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} -->
|
14
|
-
<!-- wp:navigation-link {\\"label\\":\\"Chunky socks\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} /-->
|
15
|
-
|
16
|
-
<!-- wp:navigation-link {\\"label\\":\\"Hideous hats\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} /-->
|
17
|
-
|
18
|
-
<!-- wp:navigation-link {\\"label\\":\\"Glorious gloves\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} /-->
|
19
|
-
|
20
|
-
<!-- wp:navigation-link {\\"label\\":\\"Jazzy Jumpers\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} /-->
|
21
|
-
<!-- /wp:navigation-submenu -->
|
22
|
-
<!-- /wp:navigation-submenu -->
|
23
|
-
|
24
|
-
<!-- wp:navigation-link {\\"label\\":\\"Shipping\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} /-->
|
25
|
-
|
26
|
-
<!-- wp:navigation-link {\\"label\\":\\"Contact Us\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} /-->
|
27
|
-
|
28
|
-
<!-- wp:navigation-submenu {\\"label\\":\\"WordPress.org\\",\\"type\\":\\"custom\\",\\"url\\":\\"https://wordpress.org\\",\\"kind\\":\\"custom\\"} -->
|
29
|
-
<!-- wp:navigation-link {\\"label\\":\\"Google\\",\\"type\\":\\"custom\\",\\"url\\":\\"https://google.com\\",\\"kind\\":\\"custom\\"} /-->
|
30
|
-
<!-- /wp:navigation-submenu -->"
|
31
|
-
`;
|
32
|
-
|
33
|
-
exports[`Navigation Placeholder menu selector actions creates an empty navigation block when the selected existing menu is also empty 1`] = `""`;
|
34
|
-
|
35
|
-
exports[`Navigation allows an empty navigation block to be created and manually populated using a mixture of internal and external links 1`] = `
|
36
|
-
"<!-- wp:navigation-link {\\"label\\":\\"WP\\",\\"url\\":\\"https://wordpress.org\\",\\"kind\\":\\"custom\\",\\"isTopLevelLink\\":true} /-->
|
37
|
-
|
38
|
-
<!-- wp:navigation-link {\\"label\\":\\"Contact\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"https://this/is/a/test/search/get-in-touch\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"
|
39
|
-
`;
|
40
|
-
|
41
|
-
exports[`Navigation allows pages to be created from the navigation block and their links added to menu 1`] = `"<!-- wp:navigation-link {\\"label\\":\\"A really long page name that will not exist\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"`;
|
42
|
-
|
43
|
-
exports[`Navigation encodes URL when create block if needed 1`] = `
|
44
|
-
"<!-- wp:navigation-link {\\"label\\":\\"wordpress.org/шеллы\\",\\"url\\":\\"https://wordpress.org/%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\\",\\"kind\\":\\"custom\\",\\"isTopLevelLink\\":true} /-->
|
45
|
-
|
46
|
-
<!-- wp:navigation-link {\\"label\\":\\"お問い合わせ\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"https://this/is/a/test/search/%E3%81%8A%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"
|
47
|
-
`;
|
@@ -1,113 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* WordPress dependencies
|
3
|
-
*/
|
4
|
-
import {
|
5
|
-
clickBlockAppender,
|
6
|
-
createNewPost,
|
7
|
-
getEditedPostContent,
|
8
|
-
pressKeyWithModifier,
|
9
|
-
} from '@wordpress/e2e-test-utils';
|
10
|
-
|
11
|
-
describe( 'Heading', () => {
|
12
|
-
const COLOR_ITEM_SELECTOR =
|
13
|
-
'.block-editor-panel-color-gradient-settings__dropdown';
|
14
|
-
const CUSTOM_COLOR_BUTTON_X_SELECTOR = `.components-color-palette__custom-color`;
|
15
|
-
const COLOR_INPUT_FIELD_SELECTOR =
|
16
|
-
'.components-color-picker .components-input-control__input';
|
17
|
-
|
18
|
-
beforeEach( async () => {
|
19
|
-
await createNewPost();
|
20
|
-
} );
|
21
|
-
|
22
|
-
it( 'can be created by prefixing number sign and a space', async () => {
|
23
|
-
await clickBlockAppender();
|
24
|
-
await page.keyboard.type( '### 3' );
|
25
|
-
|
26
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
27
|
-
} );
|
28
|
-
|
29
|
-
it( 'can be created by prefixing existing content with number signs and a space', async () => {
|
30
|
-
await clickBlockAppender();
|
31
|
-
await page.keyboard.type( '4' );
|
32
|
-
await page.keyboard.press( 'ArrowLeft' );
|
33
|
-
await page.keyboard.type( '#### ' );
|
34
|
-
|
35
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
36
|
-
} );
|
37
|
-
|
38
|
-
it( 'should not work with the list input rule', async () => {
|
39
|
-
await clickBlockAppender();
|
40
|
-
await page.keyboard.type( '## 1. H' );
|
41
|
-
|
42
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
43
|
-
} );
|
44
|
-
|
45
|
-
it( 'should work with the format input rules', async () => {
|
46
|
-
await clickBlockAppender();
|
47
|
-
await page.keyboard.type( '## `code`' );
|
48
|
-
|
49
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
50
|
-
} );
|
51
|
-
|
52
|
-
it( 'should create a paragraph block above when pressing enter at the start', async () => {
|
53
|
-
await page.keyboard.press( 'Enter' );
|
54
|
-
await page.keyboard.type( '## a' );
|
55
|
-
await page.keyboard.press( 'ArrowLeft' );
|
56
|
-
await page.keyboard.press( 'Enter' );
|
57
|
-
|
58
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
59
|
-
} );
|
60
|
-
|
61
|
-
it( 'should create a paragraph block below when pressing enter at the end', async () => {
|
62
|
-
await page.keyboard.press( 'Enter' );
|
63
|
-
await page.keyboard.type( '## a' );
|
64
|
-
await page.keyboard.press( 'Enter' );
|
65
|
-
|
66
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
67
|
-
} );
|
68
|
-
|
69
|
-
it( 'should correctly apply custom colors', async () => {
|
70
|
-
await clickBlockAppender();
|
71
|
-
await page.keyboard.type( '### Heading' );
|
72
|
-
|
73
|
-
const textColorButton = await page.waitForSelector(
|
74
|
-
COLOR_ITEM_SELECTOR
|
75
|
-
);
|
76
|
-
await textColorButton.click();
|
77
|
-
|
78
|
-
const customTextColorButton = await page.waitForSelector(
|
79
|
-
CUSTOM_COLOR_BUTTON_X_SELECTOR
|
80
|
-
);
|
81
|
-
|
82
|
-
await customTextColorButton.click();
|
83
|
-
await page.waitForSelector( COLOR_INPUT_FIELD_SELECTOR );
|
84
|
-
await page.click( COLOR_INPUT_FIELD_SELECTOR );
|
85
|
-
await pressKeyWithModifier( 'primary', 'A' );
|
86
|
-
await page.keyboard.type( '4b7f4d' );
|
87
|
-
await page.keyboard.press( 'Enter' );
|
88
|
-
expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
|
89
|
-
"<!-- wp:heading {\\"level\\":3,\\"style\\":{\\"color\\":{\\"text\\":\\"#4b7f4d\\"}}} -->
|
90
|
-
<h3 class=\\"wp-block-heading has-text-color\\" style=\\"color:#4b7f4d\\">Heading</h3>
|
91
|
-
<!-- /wp:heading -->"
|
92
|
-
` );
|
93
|
-
} );
|
94
|
-
|
95
|
-
it( 'should correctly apply named colors', async () => {
|
96
|
-
await clickBlockAppender();
|
97
|
-
await page.keyboard.type( '## Heading' );
|
98
|
-
|
99
|
-
const textColorButton = await page.waitForSelector(
|
100
|
-
COLOR_ITEM_SELECTOR
|
101
|
-
);
|
102
|
-
await textColorButton.click();
|
103
|
-
|
104
|
-
const colorButtonSelector = `//button[@aria-label='Color: Luminous vivid orange']`;
|
105
|
-
const [ colorButton ] = await page.$x( colorButtonSelector );
|
106
|
-
await colorButton.click();
|
107
|
-
await page.waitForXPath(
|
108
|
-
`${ colorButtonSelector }[@aria-pressed='true']`
|
109
|
-
);
|
110
|
-
await page.click( 'h2[data-type="core/heading"]' );
|
111
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
112
|
-
} );
|
113
|
-
} );
|