@wordpress/e2e-tests 5.5.0 → 5.6.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 CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.6.0 (2022-11-16)
6
+
5
7
  ## 5.5.0 (2022-11-02)
6
8
 
7
9
  ## 5.4.0 (2022-10-19)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-tests",
3
- "version": "5.5.0",
3
+ "version": "5.6.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.5.0",
27
- "@wordpress/jest-console": "^6.4.0",
28
- "@wordpress/jest-puppeteer-axe": "^5.4.0",
29
- "@wordpress/scripts": "^24.5.0",
30
- "@wordpress/url": "^3.22.0",
26
+ "@wordpress/e2e-test-utils": "^8.6.0",
27
+ "@wordpress/jest-console": "^6.5.0",
28
+ "@wordpress/jest-puppeteer-axe": "^5.5.0",
29
+ "@wordpress/scripts": "^24.6.0",
30
+ "@wordpress/url": "^3.23.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": "511f4cc1f0138641bc4394bc1cf36e833109c791"
49
+ "gitHead": "7ac04f446242452d3cb24372f9ca58f0cae97715"
50
50
  }
@@ -127,7 +127,9 @@ describe( 'Cover', () => {
127
127
  );
128
128
 
129
129
  // Select the cover block.By default the child paragraph gets selected.
130
- await page.click( '.edit-post-header-toolbar__list-view-toggle' );
130
+ await page.click(
131
+ '.edit-post-header-toolbar__document-overview-toggle'
132
+ );
131
133
  await page.click(
132
134
  '.block-editor-list-view-block__contents-container a'
133
135
  );
@@ -49,7 +49,9 @@ describe( 'Navigating the block hierarchy', () => {
49
49
  await page.keyboard.type( 'First column' );
50
50
 
51
51
  // Navigate to the columns blocks.
52
- await page.click( '.edit-post-header-toolbar__list-view-toggle' );
52
+ await page.click(
53
+ '.edit-post-header-toolbar__document-overview-toggle'
54
+ );
53
55
 
54
56
  const firstColumnsBlockMenuItem = (
55
57
  await getListViewBlocks( 'Columns' )
@@ -165,7 +167,10 @@ describe( 'Navigating the block hierarchy', () => {
165
167
  it( 'should select the wrapper div for a group', async () => {
166
168
  // Insert a group block.
167
169
  await insertBlock( 'Group' );
168
-
170
+ // Select the default, selected Group layout from the variation picker.
171
+ await page.click(
172
+ 'button[aria-label="Group: Gather blocks in a container."]'
173
+ );
169
174
  // Insert some random blocks.
170
175
  // The last block shouldn't be a textual block.
171
176
  await page.click( '.block-list-appender .block-editor-inserter' );
@@ -183,7 +188,9 @@ describe( 'Navigating the block hierarchy', () => {
183
188
  await page.click( '.editor-post-title' );
184
189
 
185
190
  // Try selecting the group block using the Outline.
186
- await page.click( '.edit-post-header-toolbar__list-view-toggle' );
191
+ await page.click(
192
+ '.edit-post-header-toolbar__document-overview-toggle'
193
+ );
187
194
  const groupMenuItem = ( await getListViewBlocks( 'Group' ) )[ 0 ];
188
195
  await groupMenuItem.click();
189
196
 
@@ -102,51 +102,59 @@ describe( 'Font Size Picker', () => {
102
102
  describe( 'More font sizes', () => {
103
103
  beforeEach( async () => {
104
104
  await page.evaluate( () => {
105
+ // set a deep `path[]` property in object `obj` to `value`, immutably
106
+ function setDeep( obj, path, value ) {
107
+ function doSet( o, i ) {
108
+ if ( i < path.length ) {
109
+ const key = path[ i ];
110
+ return { ...o, [ key ]: doSet( o[ key ], i + 1 ) };
111
+ }
112
+ return value;
113
+ }
114
+ return doSet( obj, 0 );
115
+ }
116
+
105
117
  wp.data.dispatch( 'core/block-editor' ).updateSettings(
106
- // eslint-disable-next-line no-undef
107
- lodash.merge(
118
+ setDeep(
108
119
  wp.data.select( 'core/block-editor' ).getSettings(),
109
- {
110
- __experimentalFeatures: {
111
- typography: {
112
- fontSizes: {
113
- default: [
114
- {
115
- name: 'Tiny',
116
- slug: 'tiny',
117
- size: '11px',
118
- },
119
- ,
120
- {
121
- name: 'Small',
122
- slug: 'small',
123
- size: '13px',
124
- },
125
- {
126
- name: 'Medium',
127
- slug: 'medium',
128
- size: '20px',
129
- },
130
- {
131
- name: 'Large',
132
- slug: 'large',
133
- size: '36px',
134
- },
135
- {
136
- name: 'Extra Large',
137
- slug: 'x-large',
138
- size: '42px',
139
- },
140
- {
141
- name: 'Huge',
142
- slug: 'huge',
143
- size: '48px',
144
- },
145
- ],
146
- },
147
- },
120
+ [
121
+ '__experimentalFeatures',
122
+ 'typography',
123
+ 'fontSizes',
124
+ 'default',
125
+ ],
126
+ [
127
+ {
128
+ name: 'Tiny',
129
+ slug: 'tiny',
130
+ size: '11px',
148
131
  },
149
- }
132
+ {
133
+ name: 'Small',
134
+ slug: 'small',
135
+ size: '13px',
136
+ },
137
+ {
138
+ name: 'Medium',
139
+ slug: 'medium',
140
+ size: '20px',
141
+ },
142
+ {
143
+ name: 'Large',
144
+ slug: 'large',
145
+ size: '36px',
146
+ },
147
+ {
148
+ name: 'Extra Large',
149
+ slug: 'x-large',
150
+ size: '42px',
151
+ },
152
+ {
153
+ name: 'Huge',
154
+ slug: 'huge',
155
+ size: '48px',
156
+ },
157
+ ]
150
158
  )
151
159
  );
152
160
  } );
@@ -158,7 +166,7 @@ describe( 'Font Size Picker', () => {
158
166
  await page.keyboard.type( 'Paragraph to be made "large"' );
159
167
 
160
168
  await openFontSizeSelectControl();
161
- await pressKeyTimes( 'ArrowDown', 5 );
169
+ await pressKeyTimes( 'ArrowDown', 4 );
162
170
  await page.keyboard.press( 'Enter' );
163
171
 
164
172
  expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
@@ -175,7 +183,7 @@ describe( 'Font Size Picker', () => {
175
183
  );
176
184
 
177
185
  await openFontSizeSelectControl();
178
- await pressKeyTimes( 'ArrowDown', 4 );
186
+ await pressKeyTimes( 'ArrowDown', 3 );
179
187
  await page.keyboard.press( 'Enter' );
180
188
  expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
181
189
  "<!-- wp:paragraph {\\"fontSize\\":\\"medium\\"} -->
@@ -202,7 +210,7 @@ describe( 'Font Size Picker', () => {
202
210
  );
203
211
 
204
212
  await openFontSizeSelectControl();
205
- await pressKeyTimes( 'ArrowDown', 3 );
213
+ await pressKeyTimes( 'ArrowDown', 2 );
206
214
  await page.keyboard.press( 'Enter' );
207
215
  expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
208
216
  "<!-- wp:paragraph {\\"fontSize\\":\\"small\\"} -->
@@ -277,6 +277,10 @@ describe( 'Inserting blocks', () => {
277
277
  // Check for regression of https://github.com/WordPress/gutenberg/issues/24403
278
278
  it( 'inserts a block in proper place after having clicked `Browse All` from block appender', async () => {
279
279
  await insertBlock( 'Group' );
280
+ // Select the default, selected Group layout from the variation picker.
281
+ await page.click(
282
+ 'button[aria-label="Group: Gather blocks in a container."]'
283
+ );
280
284
  await insertBlock( 'Paragraph' );
281
285
  await page.keyboard.type( 'Paragraph after group' );
282
286
  // Click the Group first to make the appender inside it clickable.
@@ -295,6 +299,10 @@ describe( 'Inserting blocks', () => {
295
299
  const INSERTER_SEARCH_SELECTOR =
296
300
  '.block-editor-inserter__search input,.block-editor-inserter__search-input,input.block-editor-inserter__search';
297
301
  await insertBlock( 'Group' );
302
+ // Select the default, selected Group layout from the variation picker.
303
+ await page.click(
304
+ 'button[aria-label="Group: Gather blocks in a container."]'
305
+ );
298
306
  await insertBlock( 'Paragraph' );
299
307
  await page.keyboard.type( 'Text' );
300
308
  // Click the Group first to make the appender inside it clickable.
@@ -223,7 +223,10 @@ describe( 'Order of block keyboard navigation', () => {
223
223
  it( 'allows the block wrapper to gain focus for a group block instead of the first element', async () => {
224
224
  // Insert a group block.
225
225
  await insertBlock( 'Group' );
226
-
226
+ // Select the default, selected Group layout from the variation picker.
227
+ await page.click(
228
+ 'button[aria-label="Group: Gather blocks in a container."]'
229
+ );
227
230
  // If active label matches, that means focus did not change from group block wrapper.
228
231
  await expect( await getActiveLabel() ).toBe( 'Block: Group' );
229
232
  } );
@@ -399,6 +399,11 @@ describe( 'Multi-block selection', () => {
399
399
  );
400
400
  await page.keyboard.press( 'Enter' );
401
401
 
402
+ // Select the default, selected Group layout from the variation picker.
403
+ await page.click(
404
+ 'button[aria-label="Group: Gather blocks in a container."]'
405
+ );
406
+
402
407
  const groupAppender = await page.waitForSelector(
403
408
  '.block-editor-button-block-appender'
404
409
  );