@wordpress/e2e-tests 5.1.1 → 5.2.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 +2 -0
- package/package.json +7 -7
- package/specs/editor/blocks/pullquote.test.js +47 -0
- package/specs/editor/plugins/cpt-locking.test.js +3 -0
- package/specs/editor/plugins/inner-blocks-allowed-blocks.test.js +0 -1
- package/specs/editor/various/a11y.test.js +1 -1
- package/specs/editor/various/block-switcher.test.js +0 -5
- package/specs/editor/various/splitting-merging.test.js +1 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wordpress/e2e-tests",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.2.0",
|
4
4
|
"description": "End-To-End (E2E) tests for WordPress.",
|
5
5
|
"author": "The WordPress Contributors",
|
6
6
|
"license": "GPL-2.0-or-later",
|
@@ -23,11 +23,11 @@
|
|
23
23
|
"node": ">=14"
|
24
24
|
},
|
25
25
|
"dependencies": {
|
26
|
-
"@wordpress/e2e-test-utils": "^8.
|
27
|
-
"@wordpress/jest-console": "^6.
|
28
|
-
"@wordpress/jest-puppeteer-axe": "^5.
|
29
|
-
"@wordpress/scripts": "^24.
|
30
|
-
"@wordpress/url": "^3.
|
26
|
+
"@wordpress/e2e-test-utils": "^8.2.0",
|
27
|
+
"@wordpress/jest-console": "^6.1.0",
|
28
|
+
"@wordpress/jest-puppeteer-axe": "^5.1.0",
|
29
|
+
"@wordpress/scripts": "^24.2.0",
|
30
|
+
"@wordpress/url": "^3.19.0",
|
31
31
|
"chalk": "^4.0.0",
|
32
32
|
"expect-puppeteer": "^4.4.0",
|
33
33
|
"filenamify": "^4.2.0",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"publishConfig": {
|
47
47
|
"access": "public"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "23e136283fa1d3b8d9d8b33869f871ad5eb77726"
|
50
50
|
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
/**
|
2
|
+
* WordPress dependencies
|
3
|
+
*/
|
4
|
+
import {
|
5
|
+
clickBlockAppender,
|
6
|
+
getEditedPostContent,
|
7
|
+
createNewPost,
|
8
|
+
transformBlockTo,
|
9
|
+
} from '@wordpress/e2e-test-utils';
|
10
|
+
|
11
|
+
describe( 'Quote', () => {
|
12
|
+
beforeEach( async () => {
|
13
|
+
await createNewPost();
|
14
|
+
} );
|
15
|
+
|
16
|
+
it( 'can be created by converting a quote and converted back to quote', async () => {
|
17
|
+
await clickBlockAppender();
|
18
|
+
await page.keyboard.type( 'test' );
|
19
|
+
await transformBlockTo( 'Quote' );
|
20
|
+
|
21
|
+
expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
|
22
|
+
"<!-- wp:quote -->
|
23
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
24
|
+
<p>test</p>
|
25
|
+
<!-- /wp:paragraph --></blockquote>
|
26
|
+
<!-- /wp:quote -->"
|
27
|
+
` );
|
28
|
+
|
29
|
+
await transformBlockTo( 'Pullquote' );
|
30
|
+
|
31
|
+
expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
|
32
|
+
"<!-- wp:pullquote -->
|
33
|
+
<figure class=\\"wp-block-pullquote\\"><blockquote><p>test</p></blockquote></figure>
|
34
|
+
<!-- /wp:pullquote -->"
|
35
|
+
` );
|
36
|
+
|
37
|
+
await transformBlockTo( 'Quote' );
|
38
|
+
|
39
|
+
expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
|
40
|
+
"<!-- wp:quote -->
|
41
|
+
<blockquote class=\\"wp-block-quote\\"><!-- wp:paragraph -->
|
42
|
+
<p>test</p>
|
43
|
+
<!-- /wp:paragraph --></blockquote>
|
44
|
+
<!-- /wp:quote -->"
|
45
|
+
` );
|
46
|
+
} );
|
47
|
+
} );
|
@@ -121,6 +121,9 @@ describe( 'cpt locking', () => {
|
|
121
121
|
|
122
122
|
it( 'should not allow blocks to be inserted in inner blocks', async () => {
|
123
123
|
await page.click( 'button[aria-label="Two columns; equal split"]' );
|
124
|
+
await page.evaluate(
|
125
|
+
() => new Promise( window.requestIdleCallback )
|
126
|
+
);
|
124
127
|
expect(
|
125
128
|
await page.$(
|
126
129
|
'.wp-block-column .block-editor-button-block-appender'
|
@@ -77,7 +77,6 @@ describe( 'Allowed Blocks Setting on InnerBlocks', () => {
|
|
77
77
|
await insertButton.click();
|
78
78
|
// Select the list wrapper so the image is inserable.
|
79
79
|
await page.keyboard.press( 'ArrowUp' );
|
80
|
-
await page.keyboard.press( 'ArrowUp' );
|
81
80
|
await insertBlock( 'Image' );
|
82
81
|
await closeGlobalBlockInserter();
|
83
82
|
await page.waitForSelector( '.product[data-number-of-children="2"]' );
|
@@ -5,7 +5,7 @@ import { createNewPost, pressKeyWithModifier } from '@wordpress/e2e-test-utils';
|
|
5
5
|
|
6
6
|
function isCloseButtonFocused() {
|
7
7
|
return page.$eval( ':focus', ( focusedElement ) => {
|
8
|
-
return focusedElement.getAttribute( 'aria-label' ) === 'Close
|
8
|
+
return focusedElement.getAttribute( 'aria-label' ) === 'Close';
|
9
9
|
} );
|
10
10
|
}
|
11
11
|
|
@@ -19,7 +19,6 @@ describe( 'Block Switcher', () => {
|
|
19
19
|
await insertBlock( 'List' );
|
20
20
|
await page.keyboard.type( 'List content' );
|
21
21
|
await page.keyboard.press( 'ArrowUp' );
|
22
|
-
await page.keyboard.press( 'ArrowUp' );
|
23
22
|
await pressKeyWithModifier( 'alt', 'F10' );
|
24
23
|
|
25
24
|
// Verify the block switcher exists.
|
@@ -47,7 +46,6 @@ describe( 'Block Switcher', () => {
|
|
47
46
|
await insertBlock( 'List' );
|
48
47
|
await page.keyboard.type( 'List content' );
|
49
48
|
await page.keyboard.press( 'ArrowUp' );
|
50
|
-
await page.keyboard.press( 'ArrowUp' );
|
51
49
|
await pressKeyWithModifier( 'alt', 'F10' );
|
52
50
|
|
53
51
|
// Verify the block switcher exists.
|
@@ -81,7 +79,6 @@ describe( 'Block Switcher', () => {
|
|
81
79
|
await insertBlock( 'List' );
|
82
80
|
await page.keyboard.type( 'List content' );
|
83
81
|
await page.keyboard.press( 'ArrowUp' );
|
84
|
-
await page.keyboard.press( 'ArrowUp' );
|
85
82
|
await pressKeyWithModifier( 'alt', 'F10' );
|
86
83
|
|
87
84
|
// Verify the block switcher exists.
|
@@ -96,7 +93,6 @@ describe( 'Block Switcher', () => {
|
|
96
93
|
await insertBlock( 'List' );
|
97
94
|
await page.keyboard.type( 'List content' );
|
98
95
|
await page.keyboard.press( 'ArrowUp' );
|
99
|
-
await page.keyboard.press( 'ArrowUp' );
|
100
96
|
await insertBlock( 'Heading' );
|
101
97
|
await page.keyboard.type( 'I am a header' );
|
102
98
|
await page.keyboard.down( 'Shift' );
|
@@ -110,7 +106,6 @@ describe( 'Block Switcher', () => {
|
|
110
106
|
await insertBlock( 'List' );
|
111
107
|
await page.keyboard.type( 'List content' );
|
112
108
|
await page.keyboard.press( 'ArrowUp' );
|
113
|
-
await page.keyboard.press( 'ArrowUp' );
|
114
109
|
await insertBlock( 'Heading' );
|
115
110
|
await page.keyboard.type( 'I am a header' );
|
116
111
|
await page.keyboard.press( 'Enter' );
|
@@ -235,7 +235,7 @@ describe( 'splitting and merging blocks', () => {
|
|
235
235
|
await page.keyboard.type( 'item 1' );
|
236
236
|
await page.keyboard.press( 'Enter' );
|
237
237
|
await page.keyboard.type( 'item 2' );
|
238
|
-
await pressKeyTimes( 'ArrowUp',
|
238
|
+
await pressKeyTimes( 'ArrowUp', 3 );
|
239
239
|
await page.keyboard.press( 'Delete' );
|
240
240
|
// Carret should be in the first block and at the proper position.
|
241
241
|
await page.keyboard.type( '-' );
|
@@ -257,7 +257,6 @@ describe( 'splitting and merging blocks', () => {
|
|
257
257
|
await page.keyboard.press( 'Enter' );
|
258
258
|
await page.keyboard.type( 'item 2' );
|
259
259
|
await page.keyboard.press( 'ArrowUp' );
|
260
|
-
await page.keyboard.press( 'ArrowUp' );
|
261
260
|
await pressKeyTimes( 'ArrowLeft', 6 );
|
262
261
|
await page.keyboard.press( 'Backspace' );
|
263
262
|
// Carret should be in the first block and at the proper position.
|