@wordpress/e2e-tests 2.5.10 → 2.5.11

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": "2.5.10",
3
+ "version": "2.5.11",
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,7 +23,7 @@
23
23
  "node": ">=12"
24
24
  },
25
25
  "dependencies": {
26
- "@wordpress/e2e-test-utils": "^5.4.9",
26
+ "@wordpress/e2e-test-utils": "^5.4.10",
27
27
  "@wordpress/jest-console": "^4.1.1",
28
28
  "@wordpress/jest-puppeteer-axe": "^3.1.1",
29
29
  "@wordpress/scripts": "^19.2.2",
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "34b76b2f9397215e5afb8443f5b3073c83913102"
46
+ "gitHead": "3826b68f8c5b5026b318463af647f6fb19b534d2"
47
47
  }
@@ -197,6 +197,9 @@ describe( 'Cover', () => {
197
197
  await insertBlock( 'Image' );
198
198
  // Upload image and transform to the Cover block
199
199
  await upload( '.wp-block-image' );
200
+ // Click the block wrapper before trying to convert to make sure figcaption toolbar is not obscuring
201
+ // the block toolbar.
202
+ await page.click( '.wp-block-image' );
200
203
  await transformBlockTo( 'Cover' );
201
204
 
202
205
  // Get the block's background dim color and its opacity
@@ -103,8 +103,9 @@ describe( 'Image', () => {
103
103
  `<!-- wp:image {"id":\\d+,"sizeSlug":"full","linkDestination":"none"} -->\\s*<figure class="wp-block-image size-full"><img src="[^"]+\\/${ filename2 }\\.png" alt="" class="wp-image-\\d+"/></figure>\\s*<!-- \\/wp:image -->`
104
104
  );
105
105
  expect( await getEditedPostContent() ).toMatch( regex3 );
106
-
107
- await page.click( '.wp-block-image' );
106
+ // For some reason just clicking the block wrapper causes figcaption to get focus
107
+ // in puppeteer but not in live browser, so clicking on the image wrapper div here instead.
108
+ await page.click( '.wp-block-image > div' );
108
109
  await page.keyboard.press( 'Backspace' );
109
110
 
110
111
  expect( await getEditedPostContent() ).toBe( '' );
@@ -0,0 +1,13 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`RichText should remove highlighting element 1`] = `
4
+ "<!-- wp:paragraph -->
5
+ <p><mark style=\\"background-color:rgba(0, 0, 0, 0)\\" class=\\"has-inline-color has-cyan-bluish-gray-color\\">1</mark></p>
6
+ <!-- /wp:paragraph -->"
7
+ `;
8
+
9
+ exports[`RichText should remove highlighting element 2`] = `
10
+ "<!-- wp:paragraph -->
11
+ <p>1</p>
12
+ <!-- /wp:paragraph -->"
13
+ `;
@@ -0,0 +1,46 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import {
5
+ createNewPost,
6
+ getEditedPostContent,
7
+ clickBlockAppender,
8
+ pressKeyWithModifier,
9
+ clickBlockToolbarButton,
10
+ } from '@wordpress/e2e-test-utils';
11
+
12
+ describe( 'RichText', () => {
13
+ beforeEach( async () => {
14
+ await createNewPost();
15
+ } );
16
+
17
+ it( 'should remove highlighting element', async () => {
18
+ await clickBlockAppender();
19
+
20
+ // Add text and select to color.
21
+ await page.keyboard.type( '1' );
22
+ await pressKeyWithModifier( 'primary', 'a' );
23
+ await clickBlockToolbarButton( 'More' );
24
+
25
+ const button = await page.waitForXPath(
26
+ `//button[text()='Highlight']`
27
+ );
28
+ // Clicks may fail if the button is out of view. Assure it is before click.
29
+ await button.evaluate( ( element ) => element.scrollIntoView() );
30
+ await button.click();
31
+
32
+ // Use a color name with multiple words to ensure that it becomes
33
+ // active. Previously we had a broken regular expression.
34
+ const option = await page.waitForSelector(
35
+ '[aria-label="Color: Cyan bluish gray"]'
36
+ );
37
+
38
+ await option.click();
39
+
40
+ expect( await getEditedPostContent() ).toMatchSnapshot();
41
+
42
+ await option.click();
43
+
44
+ expect( await getEditedPostContent() ).toMatchSnapshot();
45
+ } );
46
+ } );
@@ -13,7 +13,7 @@ async function getDocumentSettingsTitle() {
13
13
  '.edit-site-document-actions__title'
14
14
  );
15
15
 
16
- return titleElement.evaluate( ( el ) => el.innerText );
16
+ return titleElement.evaluate( ( el ) => el.textContent );
17
17
  }
18
18
 
19
19
  async function getDocumentSettingsSecondaryTitle() {
@@ -21,7 +21,7 @@ async function getDocumentSettingsSecondaryTitle() {
21
21
  '.edit-site-document-actions__secondary-item'
22
22
  );
23
23
 
24
- return secondaryTitleElement.evaluate( ( el ) => el.innerText );
24
+ return secondaryTitleElement.evaluate( ( el ) => el.textContent );
25
25
  }
26
26
 
27
27
  describe( 'Document Settings', () => {
@@ -50,7 +50,7 @@ describe( 'Document Settings', () => {
50
50
  // Evaluate the document settings title
51
51
  const actual = await getDocumentSettingsTitle();
52
52
 
53
- expect( actual ).toEqual( 'Index' );
53
+ expect( actual ).toEqual( 'Editing template: Index' );
54
54
  } );
55
55
 
56
56
  describe( 'and a template part is clicked in the template', () => {
@@ -70,7 +70,7 @@ describe( 'Document Settings', () => {
70
70
  // Evaluate the document settings secondary title
71
71
  const actual = await getDocumentSettingsSecondaryTitle();
72
72
 
73
- expect( actual ).toEqual( 'Header' );
73
+ expect( actual ).toEqual( 'Editing template part: header' );
74
74
  } );
75
75
  } );
76
76
  } );
@@ -86,7 +86,7 @@ describe( 'Document Settings', () => {
86
86
  // Evaluate the document settings title
87
87
  const actual = await getDocumentSettingsTitle();
88
88
 
89
- expect( actual ).toEqual( 'header' );
89
+ expect( actual ).toEqual( 'Editing template part: header' );
90
90
  } );
91
91
  } );
92
92
  } );
@@ -77,12 +77,11 @@ describe( 'Settings sidebar', () => {
77
77
 
78
78
  expect( templateCardBeforeNavigation ).toMatchObject( {
79
79
  title: 'Index',
80
- description:
81
- 'The default template used when no other template is available. This is a required template in WordPress.',
80
+ description: 'Displays posts.',
82
81
  } );
83
82
  expect( templateCardAfterNavigation ).toMatchObject( {
84
83
  title: '404',
85
- description: 'Template shown when no content is found.',
84
+ description: 'Displays when no content is found.',
86
85
  } );
87
86
  } );
88
87
  } );