@wordpress/e2e-tests 4.6.0 → 4.9.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/README.md +8 -8
- package/package.json +7 -7
- package/plugins/cpt-locking.php +28 -4
- package/specs/editor/blocks/__snapshots__/quote.test.js.snap +37 -131
- package/specs/editor/blocks/gallery.test.js +1 -1
- package/specs/editor/blocks/navigation.test.js +3 -38
- package/specs/editor/blocks/quote.test.js +42 -91
- package/specs/editor/plugins/__snapshots__/cpt-locking.test.js.snap +24 -8
- package/specs/editor/plugins/__snapshots__/inner-blocks-render-appender.test.js.snap +6 -2
- package/specs/editor/plugins/__snapshots__/templates.test.js.snap +6 -2
- package/specs/editor/plugins/block-variations.test.js +2 -0
- package/specs/editor/plugins/cpt-locking.test.js +3 -3
- package/specs/editor/plugins/inner-blocks-render-appender.test.js +3 -0
- package/specs/editor/plugins/meta-boxes.test.js +1 -1
- package/specs/editor/various/__snapshots__/multi-block-selection.test.js.snap +0 -16
- package/specs/editor/various/__snapshots__/rich-text.test.js.snap +12 -0
- package/specs/editor/various/__snapshots__/writing-flow.test.js.snap +3 -3
- package/specs/editor/various/block-editor-keyboard-shortcuts.test.js +1 -1
- package/specs/editor/various/block-switcher.test.js +1 -3
- package/specs/editor/various/compatibility-classic-editor.test.js +1 -1
- package/specs/editor/various/links.test.js +3 -3
- package/specs/editor/various/multi-block-selection.test.js +2 -29
- package/specs/editor/various/post-visibility.test.js +4 -4
- package/specs/editor/various/reusable-blocks.test.js +4 -2
- package/specs/editor/various/rich-text.test.js +17 -0
- package/specs/editor/various/scheduling.test.js +2 -2
- package/specs/editor/various/{sidebar-permalink-panel.test.js → sidebar-permalink.test.js} +9 -19
- package/specs/editor/various/typewriter.test.js +2 -2
- package/specs/editor/various/writing-flow.test.js +74 -1
- package/specs/site-editor/multi-entity-saving.test.js +3 -3
- package/specs/editor/blocks/__snapshots__/group.test.js.snap +0 -21
- package/specs/editor/blocks/__snapshots__/list.test.js.snap +0 -337
- package/specs/editor/blocks/comments.test.js +0 -131
- package/specs/editor/blocks/group.test.js +0 -43
- package/specs/editor/blocks/list.test.js +0 -542
- package/specs/editor/blocks/missing.test.js +0 -44
- package/specs/editor/plugins/__snapshots__/deprecated-node-matcher.test.js.snap +0 -13
- package/specs/editor/plugins/__snapshots__/format-api.test.js.snap +0 -7
- package/specs/editor/plugins/__snapshots__/hooks-api.test.js.snap +0 -3
- package/specs/editor/plugins/deprecated-node-matcher.test.js +0 -44
- package/specs/editor/plugins/format-api.test.js +0 -36
- package/specs/editor/plugins/hooks-api.test.js +0 -44
- package/specs/editor/various/__snapshots__/convert-block-type.test.js.snap +0 -13
- package/specs/editor/various/block-mover.test.js +0 -42
- package/specs/editor/various/convert-block-type.test.js +0 -32
@@ -10,7 +10,9 @@ exports[`cpt locking template_lock all should insert line breaks when using ente
|
|
10
10
|
<!-- /wp:paragraph -->
|
11
11
|
|
12
12
|
<!-- wp:quote -->
|
13
|
-
<blockquote class=\\"wp-block-quote\\"
|
13
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
14
|
+
<p></p>
|
15
|
+
<!-- /wp:paragraph --></blockquote>
|
14
16
|
<!-- /wp:quote -->
|
15
17
|
|
16
18
|
<!-- wp:columns -->
|
@@ -28,7 +30,9 @@ exports[`cpt locking template_lock all should not error when deleting the cotent
|
|
28
30
|
<!-- /wp:paragraph -->
|
29
31
|
|
30
32
|
<!-- wp:quote -->
|
31
|
-
<blockquote class=\\"wp-block-quote\\"
|
33
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
34
|
+
<p></p>
|
35
|
+
<!-- /wp:paragraph --></blockquote>
|
32
36
|
<!-- /wp:quote -->
|
33
37
|
|
34
38
|
<!-- wp:columns -->
|
@@ -43,7 +47,9 @@ exports[`cpt locking template_lock all unlocked group should allow blocks to be
|
|
43
47
|
<!-- /wp:paragraph -->
|
44
48
|
|
45
49
|
<!-- wp:quote -->
|
46
|
-
<blockquote class=\\"wp-block-quote\\"
|
50
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
51
|
+
<p></p>
|
52
|
+
<!-- /wp:paragraph --></blockquote>
|
47
53
|
<!-- /wp:quote --></div>
|
48
54
|
<!-- /wp:group -->"
|
49
55
|
`;
|
@@ -51,7 +57,9 @@ exports[`cpt locking template_lock all unlocked group should allow blocks to be
|
|
51
57
|
exports[`cpt locking template_lock all unlocked group should allow blocks to be removed 1`] = `
|
52
58
|
"<!-- wp:group {\\"templateLock\\":false} -->
|
53
59
|
<div class=\\"wp-block-group\\"><!-- wp:quote -->
|
54
|
-
<blockquote class=\\"wp-block-quote\\"
|
60
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
61
|
+
<p></p>
|
62
|
+
<!-- /wp:paragraph --></blockquote>
|
55
63
|
<!-- /wp:quote --></div>
|
56
64
|
<!-- /wp:group -->"
|
57
65
|
`;
|
@@ -66,7 +74,9 @@ exports[`cpt locking template_lock false should allow blocks to be inserted 1`]
|
|
66
74
|
<!-- /wp:paragraph -->
|
67
75
|
|
68
76
|
<!-- wp:quote -->
|
69
|
-
<blockquote class=\\"wp-block-quote\\"
|
77
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
78
|
+
<p></p>
|
79
|
+
<!-- /wp:paragraph --></blockquote>
|
70
80
|
<!-- /wp:quote -->
|
71
81
|
|
72
82
|
<!-- wp:columns -->
|
@@ -88,7 +98,9 @@ exports[`cpt locking template_lock false should allow blocks to be moved 1`] = `
|
|
88
98
|
<!-- /wp:image -->
|
89
99
|
|
90
100
|
<!-- wp:quote -->
|
91
|
-
<blockquote class=\\"wp-block-quote\\"
|
101
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
102
|
+
<p></p>
|
103
|
+
<!-- /wp:paragraph --></blockquote>
|
92
104
|
<!-- /wp:quote -->
|
93
105
|
|
94
106
|
<!-- wp:columns -->
|
@@ -102,7 +114,9 @@ exports[`cpt locking template_lock false should allow blocks to be removed 1`] =
|
|
102
114
|
<!-- /wp:image -->
|
103
115
|
|
104
116
|
<!-- wp:quote -->
|
105
|
-
<blockquote class=\\"wp-block-quote\\"
|
117
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
118
|
+
<p></p>
|
119
|
+
<!-- /wp:paragraph --></blockquote>
|
106
120
|
<!-- /wp:quote -->
|
107
121
|
|
108
122
|
<!-- wp:columns -->
|
@@ -120,7 +134,9 @@ exports[`cpt locking template_lock insert should allow blocks to be moved 1`] =
|
|
120
134
|
<!-- /wp:image -->
|
121
135
|
|
122
136
|
<!-- wp:quote -->
|
123
|
-
<blockquote class=\\"wp-block-quote\\"
|
137
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
138
|
+
<p></p>
|
139
|
+
<!-- /wp:paragraph --></blockquote>
|
124
140
|
<!-- /wp:quote -->
|
125
141
|
|
126
142
|
<!-- wp:columns -->
|
@@ -3,7 +3,9 @@
|
|
3
3
|
exports[`RenderAppender prop of InnerBlocks Users can customize the appender and can still insert blocks using exposed components 1`] = `
|
4
4
|
"<!-- wp:test/inner-blocks-render-appender -->
|
5
5
|
<div style=\\"outline:1px solid gray;padding:5px\\" class=\\"wp-block-test-inner-blocks-render-appender\\"><!-- wp:quote -->
|
6
|
-
<blockquote class=\\"wp-block-quote\\"
|
6
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
7
|
+
<p></p>
|
8
|
+
<!-- /wp:paragraph --></blockquote>
|
7
9
|
<!-- /wp:quote --></div>
|
8
10
|
<!-- /wp:test/inner-blocks-render-appender -->"
|
9
11
|
`;
|
@@ -11,7 +13,9 @@ exports[`RenderAppender prop of InnerBlocks Users can customize the appender and
|
|
11
13
|
exports[`RenderAppender prop of InnerBlocks Users can dynamically customize the appender 1`] = `
|
12
14
|
"<!-- wp:test/inner-blocks-render-appender-dynamic -->
|
13
15
|
<div style=\\"outline:1px solid gray;padding:5px\\" class=\\"wp-block-test-inner-blocks-render-appender-dynamic\\"><!-- wp:quote -->
|
14
|
-
<blockquote class=\\"wp-block-quote\\"
|
16
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
17
|
+
<p></p>
|
18
|
+
<!-- /wp:paragraph --></blockquote>
|
15
19
|
<!-- /wp:quote -->
|
16
20
|
|
17
21
|
<!-- wp:video -->
|
@@ -10,7 +10,9 @@ exports[`templates Using a CPT with a predefined template Should add a custom po
|
|
10
10
|
<!-- /wp:paragraph -->
|
11
11
|
|
12
12
|
<!-- wp:quote -->
|
13
|
-
<blockquote class=\\"wp-block-quote\\"
|
13
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
14
|
+
<p></p>
|
15
|
+
<!-- /wp:paragraph --></blockquote>
|
14
16
|
<!-- /wp:quote -->
|
15
17
|
|
16
18
|
<!-- wp:columns -->
|
@@ -36,7 +38,9 @@ exports[`templates Using a CPT with a predefined template Should respect user ed
|
|
36
38
|
<!-- /wp:paragraph -->
|
37
39
|
|
38
40
|
<!-- wp:quote -->
|
39
|
-
<blockquote class=\\"wp-block-quote\\"
|
41
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
42
|
+
<p></p>
|
43
|
+
<!-- /wp:paragraph --></blockquote>
|
40
44
|
<!-- /wp:quote -->
|
41
45
|
|
42
46
|
<!-- wp:columns -->
|
@@ -148,6 +148,8 @@ describe( 'Block variations', () => {
|
|
148
148
|
|
149
149
|
it( 'should show block information when no matching variation is found', async () => {
|
150
150
|
await insertBlock( 'Large Quote' );
|
151
|
+
// Select the quote block.
|
152
|
+
await page.keyboard.press( 'ArrowDown' );
|
151
153
|
const breadcrumb = await getActiveBreadcrumb();
|
152
154
|
expect( breadcrumb ).toEqual( 'Quote' );
|
153
155
|
const navigationItem = await getFirstNavigationItem();
|
@@ -49,12 +49,12 @@ describe( 'cpt locking', () => {
|
|
49
49
|
|
50
50
|
const shouldAllowBlocksToBeMoved = async () => {
|
51
51
|
await page.click(
|
52
|
-
'.block-editor-rich-text__editable[data-type="core/paragraph"]'
|
52
|
+
'div > .block-editor-rich-text__editable[data-type="core/paragraph"]'
|
53
53
|
);
|
54
54
|
expect( await page.$( 'button[aria-label="Move up"]' ) ).not.toBeNull();
|
55
55
|
await page.click( 'button[aria-label="Move up"]' );
|
56
56
|
await page.type(
|
57
|
-
'.block-editor-rich-text__editable[data-type="core/paragraph"]',
|
57
|
+
'div > .block-editor-rich-text__editable[data-type="core/paragraph"]',
|
58
58
|
'p1'
|
59
59
|
);
|
60
60
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
@@ -193,7 +193,7 @@ describe( 'cpt locking', () => {
|
|
193
193
|
|
194
194
|
it( 'should allow blocks to be removed', async () => {
|
195
195
|
await page.type(
|
196
|
-
'.block-editor-rich-text__editable[data-type="core/paragraph"]',
|
196
|
+
'div > .block-editor-rich-text__editable[data-type="core/paragraph"]',
|
197
197
|
'p1'
|
198
198
|
);
|
199
199
|
await clickBlockToolbarButton( 'Options' );
|
@@ -98,6 +98,9 @@ describe( 'RenderAppender prop of InnerBlocks', () => {
|
|
98
98
|
// Insert a quote block.
|
99
99
|
await quoteButton.click();
|
100
100
|
|
101
|
+
// Select the quote block.
|
102
|
+
await page.keyboard.press( 'ArrowDown' );
|
103
|
+
|
101
104
|
// Verify if the custom block appender text changed as expected.
|
102
105
|
await page.waitForXPath(
|
103
106
|
`//*[contains(@class, "${ DYNAMIC_APPENDER_SELECTOR }")]/span[contains(@class, "single-blocks-appender")][contains(text(), "Single Blocks Appender")]`
|
@@ -59,7 +59,7 @@ describe( 'Meta boxes', () => {
|
|
59
59
|
await viewPostLinks[ 0 ].click();
|
60
60
|
await page.waitForNavigation();
|
61
61
|
|
62
|
-
// Check the
|
62
|
+
// Check the dynamic block appears.
|
63
63
|
const latestPostsBlock = await page.waitForSelector(
|
64
64
|
'.wp-block-latest-posts'
|
65
65
|
);
|
@@ -146,22 +146,6 @@ exports[`Multi-block selection should handle Enter across blocks 2`] = `
|
|
146
146
|
<!-- /wp:heading -->"
|
147
147
|
`;
|
148
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>&2</p></blockquote>
|
162
|
-
<!-- /wp:quote -->"
|
163
|
-
`;
|
164
|
-
|
165
149
|
exports[`Multi-block selection should multi-select from within the list block 1`] = `
|
166
150
|
"<!-- wp:paragraph -->
|
167
151
|
<p>1</p>
|
@@ -178,6 +178,18 @@ exports[`RichText should transform backtick to code 2`] = `
|
|
178
178
|
<!-- /wp:paragraph -->"
|
179
179
|
`;
|
180
180
|
|
181
|
+
exports[`RichText should transform when typing backtick over selection 1`] = `
|
182
|
+
"<!-- wp:paragraph -->
|
183
|
+
<p>A <code>selection</code> test.</p>
|
184
|
+
<!-- /wp:paragraph -->"
|
185
|
+
`;
|
186
|
+
|
187
|
+
exports[`RichText should transform when typing backtick over selection 2`] = `
|
188
|
+
"<!-- wp:paragraph -->
|
189
|
+
<p>A \`selection\` test.</p>
|
190
|
+
<!-- /wp:paragraph -->"
|
191
|
+
`;
|
192
|
+
|
181
193
|
exports[`RichText should undo backtick transform with backspace 1`] = `
|
182
194
|
"<!-- wp:paragraph -->
|
183
195
|
<p>\`a\`</p>
|
@@ -207,9 +207,9 @@ exports[`Writing Flow should navigate empty paragraphs 1`] = `
|
|
207
207
|
`;
|
208
208
|
|
209
209
|
exports[`Writing Flow should not create extra line breaks in multiline value 1`] = `
|
210
|
-
"<!-- wp:
|
211
|
-
<
|
212
|
-
<!-- /wp:
|
210
|
+
"<!-- wp:list -->
|
211
|
+
<ul><li></li></ul>
|
212
|
+
<!-- /wp:list -->"
|
213
213
|
`;
|
214
214
|
|
215
215
|
exports[`Writing Flow should not delete surrounding space when deleting a selected word 1`] = `
|
@@ -87,7 +87,7 @@ describe( 'block editor keyboard shortcuts', () => {
|
|
87
87
|
} );
|
88
88
|
it( 'should prevent deleting multiple selected blocks from inputs', async () => {
|
89
89
|
await clickBlockToolbarButton( 'Options' );
|
90
|
-
await clickMenuItem( '
|
90
|
+
await clickMenuItem( 'Create Reusable block' );
|
91
91
|
const reusableBlockNameInputSelector =
|
92
92
|
'.reusable-blocks-menu-items__convert-modal .components-text-control__input';
|
93
93
|
const nameInput = await page.waitForSelector(
|
@@ -28,9 +28,8 @@ describe( 'Block Switcher', () => {
|
|
28
28
|
expect.arrayContaining( [
|
29
29
|
'Group',
|
30
30
|
'Paragraph',
|
31
|
-
'Quote',
|
32
31
|
'Heading',
|
33
|
-
'
|
32
|
+
'Quote',
|
34
33
|
'Columns',
|
35
34
|
'Table of Contents',
|
36
35
|
] )
|
@@ -56,7 +55,6 @@ describe( 'Block Switcher', () => {
|
|
56
55
|
expect.arrayContaining( [
|
57
56
|
'Group',
|
58
57
|
'Paragraph',
|
59
|
-
'Pullquote',
|
60
58
|
'Heading',
|
61
59
|
'Table of Contents',
|
62
60
|
] )
|
@@ -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
|
31
|
+
// Check 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()
|
@@ -392,7 +392,7 @@ describe( 'Links', () => {
|
|
392
392
|
await page.waitForSelector( '.block-editor-link-control__search-item' );
|
393
393
|
await page.keyboard.press( 'ArrowDown' );
|
394
394
|
|
395
|
-
// Expect the
|
395
|
+
// Expect the escape key to dismiss the popover when the autocomplete suggestion list is open.
|
396
396
|
await page.keyboard.press( 'Escape' );
|
397
397
|
expect(
|
398
398
|
await page.$(
|
@@ -417,7 +417,7 @@ describe( 'Links', () => {
|
|
417
417
|
)
|
418
418
|
).not.toBeNull();
|
419
419
|
|
420
|
-
// Expect the
|
420
|
+
// Expect the escape key to dismiss the popover normally.
|
421
421
|
await page.keyboard.press( 'Escape' );
|
422
422
|
expect(
|
423
423
|
await page.$(
|
@@ -440,7 +440,7 @@ describe( 'Links', () => {
|
|
440
440
|
await page.keyboard.press( 'Tab' );
|
441
441
|
await page.keyboard.press( 'Tab' );
|
442
442
|
|
443
|
-
// Expect the
|
443
|
+
// Expect the escape key to dismiss the popover normally.
|
444
444
|
await page.keyboard.press( 'Escape' );
|
445
445
|
expect(
|
446
446
|
await page.$(
|
@@ -108,7 +108,6 @@ describe( 'Multi-block selection', () => {
|
|
108
108
|
await pressKeyWithModifier( 'primary', 'a' );
|
109
109
|
await pressKeyWithModifier( 'primary', 'a' );
|
110
110
|
|
111
|
-
await testNativeSelection();
|
112
111
|
expect( await getSelectedFlatIndices() ).toEqual( [ 1, 2, 3 ] );
|
113
112
|
|
114
113
|
// TODO: It would be great to do this test by spying on `wp.a11y.speak`,
|
@@ -420,7 +419,6 @@ describe( 'Multi-block selection', () => {
|
|
420
419
|
await page.mouse.move( coord2.x, coord2.y, { steps: 10 } );
|
421
420
|
await page.mouse.up();
|
422
421
|
|
423
|
-
await testNativeSelection();
|
424
422
|
expect( await getSelectedFlatIndices() ).toEqual( [ 1, 2 ] );
|
425
423
|
} );
|
426
424
|
|
@@ -720,9 +718,8 @@ describe( 'Multi-block selection', () => {
|
|
720
718
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
721
719
|
|
722
720
|
// Clear the selected block.
|
723
|
-
|
724
|
-
|
725
|
-
await page.mouse.click( box.x - 1, box.y );
|
721
|
+
await page.keyboard.press( 'Escape' );
|
722
|
+
await page.keyboard.press( 'Escape' );
|
726
723
|
|
727
724
|
await pressKeyWithModifier( 'primary', 'a' );
|
728
725
|
|
@@ -908,30 +905,6 @@ describe( 'Multi-block selection', () => {
|
|
908
905
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
909
906
|
} );
|
910
907
|
|
911
|
-
it( 'should merge into quote with correct selection', async () => {
|
912
|
-
await clickBlockAppender();
|
913
|
-
await page.keyboard.type( '> 1[' );
|
914
|
-
await page.keyboard.press( 'Enter' );
|
915
|
-
await page.keyboard.press( 'Enter' );
|
916
|
-
await page.keyboard.type( ']2' );
|
917
|
-
await page.keyboard.press( 'ArrowLeft' );
|
918
|
-
// Select everything between [].
|
919
|
-
await pressKeyWithModifier( 'shift', 'ArrowLeft' );
|
920
|
-
await pressKeyWithModifier( 'shift', 'ArrowLeft' );
|
921
|
-
await pressKeyWithModifier( 'shift', 'ArrowLeft' );
|
922
|
-
|
923
|
-
// Test setup.
|
924
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
925
|
-
|
926
|
-
await page.keyboard.press( 'Backspace' );
|
927
|
-
|
928
|
-
// Ensure selection is in the correct place.
|
929
|
-
await page.keyboard.type( '&' );
|
930
|
-
|
931
|
-
// Expect two blocks with "&" in between.
|
932
|
-
expect( await getEditedPostContent() ).toMatchSnapshot();
|
933
|
-
} );
|
934
|
-
|
935
908
|
it( 'should select separator (single element block)', async () => {
|
936
909
|
await clickBlockAppender();
|
937
910
|
await page.keyboard.type( '/hr' );
|
@@ -19,7 +19,7 @@ describe( 'Post visibility', () => {
|
|
19
19
|
|
20
20
|
await openDocumentSettingsSidebar();
|
21
21
|
|
22
|
-
await page.click( '
|
22
|
+
await page.click( '*[aria-label^="Select visibility"]' );
|
23
23
|
|
24
24
|
const [ privateLabel ] = await page.$x(
|
25
25
|
'//label[text()="Private"]'
|
@@ -57,7 +57,7 @@ describe( 'Post visibility', () => {
|
|
57
57
|
.getEditedPostAttribute( 'status' );
|
58
58
|
} );
|
59
59
|
|
60
|
-
await page.click( '
|
60
|
+
await page.click( '*[aria-label^="Select visibility"]' );
|
61
61
|
|
62
62
|
const [ privateLabel ] = await page.$x(
|
63
63
|
'//label[text()="Private"]'
|
@@ -90,7 +90,7 @@ describe( 'Post visibility', () => {
|
|
90
90
|
await openDocumentSettingsSidebar();
|
91
91
|
|
92
92
|
// Set a publish date for the next month.
|
93
|
-
await page.click( '
|
93
|
+
await page.click( '*[aria-label^="Change date"]' );
|
94
94
|
await page.click(
|
95
95
|
'*[aria-label="Move forward to switch to the next month."]'
|
96
96
|
);
|
@@ -100,7 +100,7 @@ describe( 'Post visibility', () => {
|
|
100
100
|
)
|
101
101
|
)[ 0 ].click();
|
102
102
|
|
103
|
-
await page.click( '
|
103
|
+
await page.click( '*[aria-label^="Select visibility"]' );
|
104
104
|
|
105
105
|
const [ privateLabel ] = await page.$x( '//label[text()="Private"]' );
|
106
106
|
await privateLabel.click();
|
@@ -192,7 +192,7 @@ describe( 'Reusable blocks', () => {
|
|
192
192
|
|
193
193
|
// Convert block to a reusable block.
|
194
194
|
await clickBlockToolbarButton( 'Options' );
|
195
|
-
await clickMenuItem( '
|
195
|
+
await clickMenuItem( 'Create Reusable block' );
|
196
196
|
|
197
197
|
// Set title.
|
198
198
|
const nameInput = await page.waitForSelector(
|
@@ -364,6 +364,8 @@ describe( 'Reusable blocks', () => {
|
|
364
364
|
'.block-editor-block-list__block[aria-label="Block: Quote"]'
|
365
365
|
);
|
366
366
|
await quoteBlock.click();
|
367
|
+
// Select the quote block.
|
368
|
+
await page.keyboard.press( 'ArrowDown' );
|
367
369
|
await openDocumentSettingsSidebar();
|
368
370
|
await page.waitForXPath(
|
369
371
|
'//*[@role="region"][@aria-label="Editor settings"]//button[.="Styles"]'
|
@@ -371,7 +373,7 @@ describe( 'Reusable blocks', () => {
|
|
371
373
|
|
372
374
|
// Convert to reusable.
|
373
375
|
await clickBlockToolbarButton( 'Options' );
|
374
|
-
await clickMenuItem( '
|
376
|
+
await clickMenuItem( 'Create Reusable block' );
|
375
377
|
const nameInput = await page.waitForSelector(
|
376
378
|
reusableBlockNameInputSelector
|
377
379
|
);
|
@@ -148,6 +148,23 @@ describe( 'RichText', () => {
|
|
148
148
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
149
149
|
} );
|
150
150
|
|
151
|
+
it( 'should transform when typing backtick over selection', async () => {
|
152
|
+
await clickBlockAppender();
|
153
|
+
await page.keyboard.type( 'A selection test.' );
|
154
|
+
await page.keyboard.press( 'Home' );
|
155
|
+
await page.keyboard.press( 'ArrowRight' );
|
156
|
+
await page.keyboard.press( 'ArrowRight' );
|
157
|
+
await pressKeyWithModifier( 'shiftAlt', 'ArrowRight' );
|
158
|
+
await page.keyboard.type( '`' );
|
159
|
+
|
160
|
+
expect( await getEditedPostContent() ).toMatchSnapshot();
|
161
|
+
|
162
|
+
// Should undo the transform.
|
163
|
+
await pressKeyWithModifier( 'primary', 'z' );
|
164
|
+
|
165
|
+
expect( await getEditedPostContent() ).toMatchSnapshot();
|
166
|
+
} );
|
167
|
+
|
151
168
|
it( 'should only mutate text data on input', async () => {
|
152
169
|
await clickBlockAppender();
|
153
170
|
await page.keyboard.type( '1' );
|
@@ -39,7 +39,7 @@ describe( 'Scheduling', () => {
|
|
39
39
|
expect( await getPublishButtonText() ).toBe( 'Publish' );
|
40
40
|
|
41
41
|
// Open the datepicker.
|
42
|
-
await page.click( '
|
42
|
+
await page.click( '*[aria-label^="Change date"]' );
|
43
43
|
|
44
44
|
// Change the publishing date to a year in the future.
|
45
45
|
await page.click( '.components-datetime__time-field-year' );
|
@@ -56,7 +56,7 @@ describe( 'Scheduling', () => {
|
|
56
56
|
it( 'Should keep date time UI focused when the previous and next month buttons are clicked', async () => {
|
57
57
|
await createNewPost();
|
58
58
|
|
59
|
-
await page.click( '
|
59
|
+
await page.click( '*[aria-label^="Change date"]' );
|
60
60
|
await page.click(
|
61
61
|
'*[aria-label="Move backward to switch to the previous month."]'
|
62
62
|
);
|
@@ -5,17 +5,16 @@ import {
|
|
5
5
|
activatePlugin,
|
6
6
|
createNewPost,
|
7
7
|
deactivatePlugin,
|
8
|
-
findSidebarPanelWithTitle,
|
9
8
|
publishPost,
|
10
9
|
} from '@wordpress/e2e-test-utils';
|
11
10
|
|
12
|
-
const
|
11
|
+
const urlButtonSelector = '*[aria-label^="Change URL"]';
|
13
12
|
|
14
13
|
// This tests are not together with the remaining sidebar tests,
|
15
|
-
// because we need to publish/save a post, to correctly test the permalink
|
14
|
+
// because we need to publish/save a post, to correctly test the permalink row.
|
16
15
|
// The sidebar test suit enforces that focus is never lost, but during save operations
|
17
16
|
// the focus is lost and a new element is focused once the save is completed.
|
18
|
-
describe( 'Sidebar Permalink
|
17
|
+
describe( 'Sidebar Permalink', () => {
|
19
18
|
beforeAll( async () => {
|
20
19
|
await activatePlugin( 'gutenberg-test-custom-post-types' );
|
21
20
|
} );
|
@@ -24,39 +23,30 @@ describe( 'Sidebar Permalink Panel', () => {
|
|
24
23
|
await deactivatePlugin( 'gutenberg-test-custom-post-types' );
|
25
24
|
} );
|
26
25
|
|
27
|
-
it( 'should
|
28
|
-
await createNewPost();
|
29
|
-
await page.evaluate( () => {
|
30
|
-
const { removeEditorPanel } = wp.data.dispatch( 'core/edit-post' );
|
31
|
-
removeEditorPanel( 'post-link' );
|
32
|
-
} );
|
33
|
-
expect( await page.$x( permalinkPanelXPath ) ).toEqual( [] );
|
34
|
-
} );
|
35
|
-
|
36
|
-
it( 'should not render link panel when post is publicly queryable but not public', async () => {
|
26
|
+
it( 'should not render URL when post is publicly queryable but not public', async () => {
|
37
27
|
await createNewPost( { postType: 'public_q_not_public' } );
|
38
28
|
await page.keyboard.type( 'aaaaa' );
|
39
29
|
await publishPost();
|
40
30
|
// Start editing again.
|
41
31
|
await page.type( '.editor-post-title__input', ' (Updated)' );
|
42
|
-
expect( await page.$
|
32
|
+
expect( await page.$( urlButtonSelector ) ).toBeNull();
|
43
33
|
} );
|
44
34
|
|
45
|
-
it( 'should not render
|
35
|
+
it( 'should not render URL when post is public but not publicly queryable', async () => {
|
46
36
|
await createNewPost( { postType: 'not_public_q_public' } );
|
47
37
|
await page.keyboard.type( 'aaaaa' );
|
48
38
|
await publishPost();
|
49
39
|
// Start editing again.
|
50
40
|
await page.type( '.editor-post-title__input', ' (Updated)' );
|
51
|
-
expect( await page.$
|
41
|
+
expect( await page.$( urlButtonSelector ) ).toBeNull();
|
52
42
|
} );
|
53
43
|
|
54
|
-
it( 'should render
|
44
|
+
it( 'should render URL when post is public and publicly queryable', async () => {
|
55
45
|
await createNewPost( { postType: 'public_q_public' } );
|
56
46
|
await page.keyboard.type( 'aaaaa' );
|
57
47
|
await publishPost();
|
58
48
|
// Start editing again.
|
59
49
|
await page.type( '.editor-post-title__input', ' (Updated)' );
|
60
|
-
expect( await
|
50
|
+
expect( await page.$( urlButtonSelector ) ).not.toBeNull();
|
61
51
|
} );
|
62
52
|
} );
|
@@ -31,7 +31,7 @@ describe( 'TypeWriter', () => {
|
|
31
31
|
|
32
32
|
expect( await getCaretPosition() ).toBeGreaterThan( initialPosition );
|
33
33
|
|
34
|
-
// Create blocks until the
|
34
|
+
// Create blocks until the typewriter effect kicks in.
|
35
35
|
while (
|
36
36
|
await page.evaluate(
|
37
37
|
() =>
|
@@ -173,7 +173,7 @@ describe( 'TypeWriter', () => {
|
|
173
173
|
|
174
174
|
let count = 0;
|
175
175
|
|
176
|
-
// Create blocks until the
|
176
|
+
// Create blocks until the typewriter effect kicks in, create at
|
177
177
|
// least 10 blocks to properly test the .
|
178
178
|
while (
|
179
179
|
( await page.evaluate(
|
@@ -282,7 +282,7 @@ describe( 'Writing Flow', () => {
|
|
282
282
|
} );
|
283
283
|
|
284
284
|
it( 'should not create extra line breaks in multiline value', async () => {
|
285
|
-
await insertBlock( '
|
285
|
+
await insertBlock( 'List' );
|
286
286
|
await page.keyboard.type( 'a' );
|
287
287
|
await page.keyboard.press( 'Backspace' );
|
288
288
|
expect( await getEditedPostContent() ).toMatchSnapshot();
|
@@ -753,4 +753,77 @@ describe( 'Writing Flow', () => {
|
|
753
753
|
);
|
754
754
|
expect( paragraphs ).toEqual( [ 'first', 'second' ] );
|
755
755
|
} );
|
756
|
+
|
757
|
+
it( 'should move to the start of the first line on ArrowUp', async () => {
|
758
|
+
await page.keyboard.press( 'Enter' );
|
759
|
+
await page.keyboard.type( 'a' );
|
760
|
+
|
761
|
+
async function getHeight() {
|
762
|
+
return await page.evaluate(
|
763
|
+
() => document.activeElement.offsetHeight
|
764
|
+
);
|
765
|
+
}
|
766
|
+
|
767
|
+
const height = await getHeight();
|
768
|
+
|
769
|
+
// Keep typing until the height of the element increases. We need two
|
770
|
+
// lines.
|
771
|
+
while ( height === ( await getHeight() ) ) {
|
772
|
+
await page.keyboard.type( 'a' );
|
773
|
+
}
|
774
|
+
|
775
|
+
// Move to the start of the second line.
|
776
|
+
await page.keyboard.press( 'ArrowLeft' );
|
777
|
+
// Move to the start of the first line.
|
778
|
+
await page.keyboard.press( 'ArrowUp' );
|
779
|
+
// Insert a "." for testing.
|
780
|
+
await page.keyboard.type( '.' );
|
781
|
+
|
782
|
+
// Expect the "." to be added at the start of the paragraph.
|
783
|
+
expect(
|
784
|
+
await page.evaluate( () =>
|
785
|
+
document.activeElement.getAttribute( 'data-type' )
|
786
|
+
)
|
787
|
+
).toBe( 'core/paragraph' );
|
788
|
+
expect(
|
789
|
+
await page.evaluate( () => document.activeElement.textContent )
|
790
|
+
).toMatch( /^\.a+$/ );
|
791
|
+
} );
|
792
|
+
|
793
|
+
it( 'should vertically move the caret from corner to corner', async () => {
|
794
|
+
await page.keyboard.press( 'Enter' );
|
795
|
+
await page.keyboard.type( 'a' );
|
796
|
+
|
797
|
+
async function getHeight() {
|
798
|
+
return await page.evaluate(
|
799
|
+
() => document.activeElement.offsetHeight
|
800
|
+
);
|
801
|
+
}
|
802
|
+
|
803
|
+
const height = await getHeight();
|
804
|
+
|
805
|
+
// Keep typing until the height of the element increases. We need two
|
806
|
+
// lines.
|
807
|
+
while ( height === ( await getHeight() ) ) {
|
808
|
+
await page.keyboard.type( 'a' );
|
809
|
+
}
|
810
|
+
|
811
|
+
// Create a new paragraph.
|
812
|
+
await page.keyboard.press( 'Enter' );
|
813
|
+
// Move to the start of the first line.
|
814
|
+
await page.keyboard.press( 'ArrowUp' );
|
815
|
+
// Insert a "." for testing.
|
816
|
+
await page.keyboard.type( '.' );
|
817
|
+
|
818
|
+
// Expect the "." to be added at the start of the second line.
|
819
|
+
// It should not be added to the first line!
|
820
|
+
expect(
|
821
|
+
await page.evaluate( () =>
|
822
|
+
document.activeElement.getAttribute( 'data-type' )
|
823
|
+
)
|
824
|
+
).toBe( 'core/paragraph' );
|
825
|
+
expect(
|
826
|
+
await page.evaluate( () => document.activeElement.textContent )
|
827
|
+
).toMatch( /^a+\.a$/ );
|
828
|
+
} );
|
756
829
|
} );
|