@wordpress/e2e-tests 4.0.2 → 4.0.3
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wordpress/e2e-tests",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.3",
|
4
4
|
"description": "End-To-End (E2E) tests for WordPress.",
|
5
5
|
"author": "The WordPress Contributors",
|
6
6
|
"license": "GPL-2.0-or-later",
|
@@ -26,7 +26,7 @@
|
|
26
26
|
"@wordpress/e2e-test-utils": "^7.2.1",
|
27
27
|
"@wordpress/jest-console": "^5.0.3",
|
28
28
|
"@wordpress/jest-puppeteer-axe": "^4.0.3",
|
29
|
-
"@wordpress/scripts": "^22.4.
|
29
|
+
"@wordpress/scripts": "^22.4.2",
|
30
30
|
"@wordpress/url": "^3.7.1",
|
31
31
|
"chalk": "^4.0.0",
|
32
32
|
"expect-puppeteer": "^4.4.0",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"publishConfig": {
|
47
47
|
"access": "public"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "37e930b93fbba88fa024a91eb527a90f855c97f3"
|
50
50
|
}
|
@@ -1429,5 +1429,43 @@ describe( 'Navigation', () => {
|
|
1429
1429
|
'//*[contains(@class, "components-snackbar")]/*[text()="Navigation Menu successfully created."]'
|
1430
1430
|
);
|
1431
1431
|
} );
|
1432
|
+
|
1433
|
+
it( 'should always focus select menu button after item selection', async () => {
|
1434
|
+
// Create some navigation menus to work with.
|
1435
|
+
await createNavigationMenu( {
|
1436
|
+
title: 'Example Navigation',
|
1437
|
+
content:
|
1438
|
+
'<!-- wp:navigation-link {"label":"WordPress","type":"custom","url":"http://www.wordpress.org/","kind":"custom","isTopLevelLink":true} /-->',
|
1439
|
+
} );
|
1440
|
+
await createNavigationMenu( {
|
1441
|
+
title: 'Second Example Navigation',
|
1442
|
+
content:
|
1443
|
+
'<!-- wp:navigation-link {"label":"WordPress","type":"custom","url":"http://www.wordpress.org/","kind":"custom","isTopLevelLink":true} /-->',
|
1444
|
+
} );
|
1445
|
+
|
1446
|
+
// Create new post.
|
1447
|
+
await createNewPost();
|
1448
|
+
|
1449
|
+
// Insert new block and wait for the insert to complete.
|
1450
|
+
await insertBlock( 'Navigation' );
|
1451
|
+
await waitForBlock( 'Navigation' );
|
1452
|
+
await page.waitForXPath( START_EMPTY_XPATH );
|
1453
|
+
|
1454
|
+
// Change menus via the select menu toolbar button.
|
1455
|
+
const selectMenuDropdown = await page.waitForSelector(
|
1456
|
+
'[aria-label="Select Menu"]'
|
1457
|
+
);
|
1458
|
+
await selectMenuDropdown.click();
|
1459
|
+
const exampleNavigationOption = await page.waitForXPath(
|
1460
|
+
'//span[contains(text(), "Second Example Navigation")]'
|
1461
|
+
);
|
1462
|
+
await exampleNavigationOption.click();
|
1463
|
+
|
1464
|
+
// Once the options are closed, does select menu button receive focus?
|
1465
|
+
const selectMenuDropdown2 = await page.waitForSelector(
|
1466
|
+
'[aria-label="Select Menu"]'
|
1467
|
+
);
|
1468
|
+
await expect( selectMenuDropdown2 ).toHaveFocus();
|
1469
|
+
} );
|
1432
1470
|
} );
|
1433
1471
|
} );
|
@@ -9,6 +9,7 @@ import {
|
|
9
9
|
pressKeyWithModifier,
|
10
10
|
insertBlock,
|
11
11
|
clickBlockToolbarButton,
|
12
|
+
openDocumentSettingsSidebar,
|
12
13
|
} from '@wordpress/e2e-test-utils';
|
13
14
|
|
14
15
|
const getActiveBlockName = async () =>
|
@@ -701,7 +702,7 @@ describe( 'Writing Flow', () => {
|
|
701
702
|
).toBe( 'Table' );
|
702
703
|
} );
|
703
704
|
|
704
|
-
it( '
|
705
|
+
it( 'should unselect all blocks when hitting double escape', async () => {
|
705
706
|
// Add demo content.
|
706
707
|
await page.keyboard.press( 'Enter' );
|
707
708
|
await page.keyboard.type( 'Random Paragraph' );
|
@@ -720,4 +721,33 @@ describe( 'Writing Flow', () => {
|
|
720
721
|
activeBlockName = await getActiveBlockName();
|
721
722
|
expect( activeBlockName ).toBe( undefined );
|
722
723
|
} );
|
724
|
+
|
725
|
+
// Checks for regressions of https://github.com/WordPress/gutenberg/issues/40091.
|
726
|
+
it( 'does not deselect the block when selecting text outside the editor canvas', async () => {
|
727
|
+
await page.keyboard.press( 'Enter' );
|
728
|
+
await page.keyboard.type( 'Random Paragraph' );
|
729
|
+
await openDocumentSettingsSidebar();
|
730
|
+
const blockDescription = await page.waitForSelector(
|
731
|
+
'.block-editor-block-card__description'
|
732
|
+
);
|
733
|
+
const boundingBox = await blockDescription.boundingBox();
|
734
|
+
const startPosition = {
|
735
|
+
x: boundingBox.x + 10,
|
736
|
+
y: boundingBox.y + 8,
|
737
|
+
};
|
738
|
+
const endPosition = {
|
739
|
+
x: startPosition.x + 50,
|
740
|
+
y: startPosition.y,
|
741
|
+
};
|
742
|
+
|
743
|
+
await page.mouse.move( startPosition.x, startPosition.y );
|
744
|
+
await page.mouse.down();
|
745
|
+
await page.mouse.move( endPosition.x, endPosition.y );
|
746
|
+
await page.mouse.up();
|
747
|
+
|
748
|
+
const selectedParagraph = await page.waitForSelector(
|
749
|
+
'.wp-block-paragraph.is-selected'
|
750
|
+
);
|
751
|
+
expect( selectedParagraph ).toBeDefined();
|
752
|
+
} );
|
723
753
|
} );
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/**
|
2
|
+
* WordPress dependencies
|
3
|
+
*/
|
4
|
+
import {
|
5
|
+
insertBlock,
|
6
|
+
activateTheme,
|
7
|
+
setOption,
|
8
|
+
visitSiteEditor,
|
9
|
+
openSiteEditorNavigationPanel,
|
10
|
+
navigateSiteEditorBackToRoot,
|
11
|
+
deleteAllTemplates,
|
12
|
+
canvas,
|
13
|
+
} from '@wordpress/e2e-test-utils';
|
14
|
+
|
15
|
+
describe( 'Post Comments Form', () => {
|
16
|
+
beforeAll( async () => {
|
17
|
+
await activateTheme( 'emptytheme' );
|
18
|
+
await deleteAllTemplates( 'wp_template' );
|
19
|
+
} );
|
20
|
+
|
21
|
+
describe( 'placeholder', () => {
|
22
|
+
it( 'displays in site editor even when comments are closed by default', async () => {
|
23
|
+
await setOption( 'default_comment_status', 'closed' );
|
24
|
+
|
25
|
+
// Navigate to "Singular" post template
|
26
|
+
await visitSiteEditor();
|
27
|
+
await openSiteEditorNavigationPanel();
|
28
|
+
await navigateSiteEditorBackToRoot();
|
29
|
+
await expect( page ).toClick(
|
30
|
+
'.components-navigation__item-title',
|
31
|
+
{ text: /templates/i }
|
32
|
+
);
|
33
|
+
await expect( page ).toClick( '.components-heading > a', {
|
34
|
+
text: /singular/i,
|
35
|
+
} );
|
36
|
+
|
37
|
+
// Insert post comments form
|
38
|
+
await insertBlock( 'Post Comments Form' );
|
39
|
+
|
40
|
+
// Ensure the placeholder is there
|
41
|
+
await expect( canvas() ).toMatchElement(
|
42
|
+
'.wp-block-post-comments-form .comment-form'
|
43
|
+
);
|
44
|
+
} );
|
45
|
+
} );
|
46
|
+
} );
|