@wordpress/e2e-tests 6.0.0 → 6.1.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
+ ## 6.1.0 (2023-01-02)
6
+
5
7
  ## 6.0.0 (2022-12-14)
6
8
 
7
9
  ### Breaking Changes
@@ -0,0 +1,77 @@
1
+ <!-- wp:columns {"align":"full"} -->
2
+ <div class="wp-block-columns alignfull"><!-- wp:column -->
3
+ <div class="wp-block-column"><!-- wp:heading {"level":3} -->
4
+ <h3 class="wp-block-heading">Heading</h3>
5
+ <!-- /wp:heading -->
6
+
7
+ <!-- wp:paragraph -->
8
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
9
+ <!-- /wp:paragraph -->
10
+
11
+ <!-- wp:list -->
12
+ <ul><!-- wp:list-item -->
13
+ <li>one</li>
14
+ <!-- /wp:list-item -->
15
+
16
+ <!-- wp:list-item -->
17
+ <li>two</li>
18
+ <!-- /wp:list-item -->
19
+
20
+ <!-- wp:list-item -->
21
+ <li>three</li>
22
+ <!-- /wp:list-item --></ul>
23
+ <!-- /wp:list --></div>
24
+ <!-- /wp:column -->
25
+
26
+ <!-- wp:column -->
27
+ <div class="wp-block-column"><!-- wp:heading {"level":3} -->
28
+ <h3 class="wp-block-heading">Heading</h3>
29
+ <!-- /wp:heading -->
30
+
31
+ <!-- wp:paragraph -->
32
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
33
+ <!-- /wp:paragraph -->
34
+
35
+ <!-- wp:list -->
36
+ <ul><!-- wp:list-item -->
37
+ <li>one</li>
38
+ <!-- /wp:list-item -->
39
+
40
+ <!-- wp:list-item -->
41
+ <li>two</li>
42
+ <!-- /wp:list-item -->
43
+
44
+ <!-- wp:list-item -->
45
+ <li>three</li>
46
+ <!-- /wp:list-item --></ul>
47
+ <!-- /wp:list --></div>
48
+ <!-- /wp:column -->
49
+
50
+ <!-- wp:column -->
51
+ <div class="wp-block-column"><!-- wp:heading {"level":3} -->
52
+ <h3 class="wp-block-heading">Heading</h3>
53
+ <!-- /wp:heading -->
54
+
55
+ <!-- wp:paragraph -->
56
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
57
+ <!-- /wp:paragraph -->
58
+
59
+ <!-- wp:list -->
60
+ <ul><!-- wp:list-item -->
61
+ <li>one</li>
62
+ <!-- /wp:list-item -->
63
+
64
+ <!-- wp:list-item -->
65
+ <li>two</li>
66
+ <!-- /wp:list-item -->
67
+
68
+ <!-- wp:list-item -->
69
+ <li>three</li>
70
+ <!-- /wp:list-item --></ul>
71
+ <!-- /wp:list --></div>
72
+ <!-- /wp:column --></div>
73
+ <!-- /wp:columns -->
74
+
75
+ <!-- wp:paragraph -->
76
+ <p></p>
77
+ <!-- /wp:paragraph -->
@@ -36,6 +36,7 @@ class PerformanceReporter {
36
36
  firstContentfulPaint,
37
37
  firstBlock,
38
38
  type,
39
+ typeContainer,
39
40
  focus,
40
41
  listViewOpen,
41
42
  inserterOpen,
@@ -68,7 +69,7 @@ Average time to first block: ${ success(
68
69
  if ( type && type.length ) {
69
70
  // eslint-disable-next-line no-console
70
71
  console.log( `
71
- ${ title( 'Typing Performance:' ) }
72
+ ${ title( 'Typing:' ) }
72
73
  Average time to type character: ${ success( round( average( type ) ) + 'ms' ) }
73
74
  Slowest time to type character: ${ success(
74
75
  round( Math.max( ...type ) ) + 'ms'
@@ -78,10 +79,25 @@ Fastest time to type character: ${ success(
78
79
  ) }` );
79
80
  }
80
81
 
82
+ if ( typeContainer && typeContainer.length ) {
83
+ // eslint-disable-next-line no-console
84
+ console.log( `
85
+ ${ title( 'Typing within a container:' ) }
86
+ Average time to type within a container: ${ success(
87
+ round( average( typeContainer ) ) + 'ms'
88
+ ) }
89
+ Slowest time to type within a container: ${ success(
90
+ round( Math.max( ...typeContainer ) ) + 'ms'
91
+ ) }
92
+ Fastest time to type within a container: ${ success(
93
+ round( Math.min( ...typeContainer ) ) + 'ms'
94
+ ) }` );
95
+ }
96
+
81
97
  if ( focus && focus.length ) {
82
98
  // eslint-disable-next-line no-console
83
99
  console.log( `
84
- ${ title( 'Block Selection Performance:' ) }
100
+ ${ title( 'Block Selection:' ) }
85
101
  Average time to select a block: ${ success( round( average( focus ) ) + 'ms' ) }
86
102
  Slowest time to select a block: ${ success(
87
103
  round( Math.max( ...focus ) ) + 'ms'
@@ -94,7 +110,7 @@ Fastest time to select a block: ${ success(
94
110
  if ( listViewOpen && listViewOpen.length ) {
95
111
  // eslint-disable-next-line no-console
96
112
  console.log( `
97
- ${ title( 'Opening List View Performance:' ) }
113
+ ${ title( 'Opening List View:' ) }
98
114
  Average time to open list view: ${ success(
99
115
  round( average( listViewOpen ) ) + 'ms'
100
116
  ) }
@@ -109,7 +125,7 @@ Fastest time to open list view: ${ success(
109
125
  if ( inserterOpen && inserterOpen.length ) {
110
126
  // eslint-disable-next-line no-console
111
127
  console.log( `
112
- ${ title( 'Opening Global Inserter Performance:' ) }
128
+ ${ title( 'Opening Global Inserter:' ) }
113
129
  Average time to open global inserter: ${ success(
114
130
  round( average( inserterOpen ) ) + 'ms'
115
131
  ) }
@@ -124,7 +140,7 @@ Fastest time to open global inserter: ${ success(
124
140
  if ( inserterSearch && inserterSearch.length ) {
125
141
  // eslint-disable-next-line no-console
126
142
  console.log( `
127
- ${ title( 'Inserter Search Performance:' ) }
143
+ ${ title( 'Inserter Search:' ) }
128
144
  Average time to type the inserter search input: ${ success(
129
145
  round( average( inserterSearch ) ) + 'ms'
130
146
  ) }
@@ -139,7 +155,7 @@ Fastest time to type the inserter search input: ${ success(
139
155
  if ( inserterHover && inserterHover.length ) {
140
156
  // eslint-disable-next-line no-console
141
157
  console.log( `
142
- ${ title( 'Inserter Block Item Hover Performance:' ) }
158
+ ${ title( 'Inserter Block Item Hover:' ) }
143
159
  Average time to move mouse between two block item in the inserter: ${ success(
144
160
  round( average( inserterHover ) ) + 'ms'
145
161
  ) }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-tests",
3
- "version": "6.0.0",
3
+ "version": "6.1.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": "^9.0.0",
27
- "@wordpress/jest-console": "^6.6.0",
28
- "@wordpress/jest-puppeteer-axe": "^5.6.0",
29
- "@wordpress/scripts": "^25.0.0",
30
- "@wordpress/url": "^3.24.0",
26
+ "@wordpress/e2e-test-utils": "^9.1.0",
27
+ "@wordpress/jest-console": "^6.7.0",
28
+ "@wordpress/jest-puppeteer-axe": "^5.7.0",
29
+ "@wordpress/scripts": "^25.1.0",
30
+ "@wordpress/url": "^3.25.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": "1eb65aabe6738097f4c062e78f69ae8f05879848"
49
+ "gitHead": "200bee7b06b15f6fa655e25b6ab69cbd6b49a357"
50
50
  }
@@ -166,7 +166,7 @@ const matchUrl = ( reqUrl, urls ) => {
166
166
  };
167
167
 
168
168
  describe( 'adding blocks from block directory', () => {
169
- beforeEach( async () => {
169
+ beforeAll( async () => {
170
170
  await createNewPost();
171
171
  } );
172
172
 
@@ -16,7 +16,9 @@ describe( 'a11y', () => {
16
16
 
17
17
  it( 'tabs header bar', async () => {
18
18
  await pressKeyWithModifier( 'ctrl', '`' );
19
-
19
+ await pressKeyWithModifier( 'ctrl', '`' );
20
+ await pressKeyWithModifier( 'ctrl', '`' );
21
+ await pressKeyWithModifier( 'ctrl', '`' );
20
22
  await page.keyboard.press( 'Tab' );
21
23
 
22
24
  const isFocusedToggle = await page.$eval(
@@ -111,16 +111,14 @@ describe( 'Navigating the block hierarchy', () => {
111
111
 
112
112
  // Move focus to the sidebar area.
113
113
  await pressKeyWithModifier( 'ctrl', '`' );
114
- await pressKeyWithModifier( 'ctrl', '`' );
115
- await pressKeyWithModifier( 'ctrl', '`' );
116
114
  await tabToColumnsControl();
117
115
 
118
116
  // Tweak the columns count by increasing it by one.
119
117
  await page.keyboard.press( 'ArrowRight' );
120
118
 
121
119
  // Navigate to the third column in the columns block.
122
- await pressKeyWithModifier( 'ctrl', '`' );
123
- await pressKeyWithModifier( 'ctrl', '`' );
120
+ await pressKeyWithModifier( 'ctrlShift', '`' );
121
+ await pressKeyWithModifier( 'ctrlShift', '`' );
124
122
  await pressKeyTimes( 'Tab', 4 );
125
123
  await pressKeyTimes( 'ArrowDown', 4 );
126
124
  await page.waitForSelector(
@@ -22,9 +22,7 @@ describe( 'Editing modes (visual/HTML)', () => {
22
22
 
23
23
  it( 'should switch between visual and HTML modes', async () => {
24
24
  // This block should be in "visual" mode by default.
25
- let visualBlock = await page.$$(
26
- '.block-editor-block-list__layout .block-editor-block-list__block.rich-text'
27
- );
25
+ let visualBlock = await page.$$( '[data-block].rich-text' );
28
26
  expect( visualBlock ).toHaveLength( 1 );
29
27
 
30
28
  // Change editing mode from "Visual" to "HTML".
@@ -33,7 +31,7 @@ describe( 'Editing modes (visual/HTML)', () => {
33
31
 
34
32
  // Wait for the block to be converted to HTML editing mode.
35
33
  const htmlBlock = await page.$$(
36
- '.block-editor-block-list__layout .block-editor-block-list__block .block-editor-block-list__block-html-textarea'
34
+ '[data-block] .block-editor-block-list__block-html-textarea'
37
35
  );
38
36
  expect( htmlBlock ).toHaveLength( 1 );
39
37
 
@@ -42,9 +40,7 @@ describe( 'Editing modes (visual/HTML)', () => {
42
40
  await clickMenuItem( 'Edit visually' );
43
41
 
44
42
  // This block should be in "visual" mode by default.
45
- visualBlock = await page.$$(
46
- '.block-editor-block-list__layout .block-editor-block-list__block.rich-text'
47
- );
43
+ visualBlock = await page.$$( '[data-block].rich-text' );
48
44
  expect( visualBlock ).toHaveLength( 1 );
49
45
  } );
50
46
 
@@ -23,6 +23,9 @@ const navigateToContentEditorTop = async () => {
23
23
  // Use 'Ctrl+`' to return to the top of the editor.
24
24
  await pressKeyWithModifier( 'ctrl', '`' );
25
25
  await pressKeyWithModifier( 'ctrl', '`' );
26
+ await pressKeyWithModifier( 'ctrl', '`' );
27
+ await pressKeyWithModifier( 'ctrl', '`' );
28
+ await pressKeyWithModifier( 'ctrl', '`' );
26
29
  };
27
30
 
28
31
  const tabThroughParagraphBlock = async ( paragraphText ) => {
@@ -36,6 +39,10 @@ const tabThroughParagraphBlock = async ( paragraphText ) => {
36
39
 
37
40
  await page.keyboard.press( 'Tab' );
38
41
  await expect( await getActiveLabel() ).toBe( 'Open document settings' );
42
+
43
+ // Need to shift+tab here to end back in the block. If not, we'll be in the next region and it will only require 4 region jumps instead of 5.
44
+ await pressKeyWithModifier( 'shift', 'Tab' );
45
+ await expect( await getActiveLabel() ).toBe( 'Paragraph block' );
39
46
  };
40
47
 
41
48
  const tabThroughBlockToolbar = async () => {
@@ -96,8 +96,6 @@ describe( 'Sidebar', () => {
96
96
 
97
97
  // Region navigate to Sidebar.
98
98
  await pressKeyWithModifier( 'ctrl', '`' );
99
- await pressKeyWithModifier( 'ctrl', '`' );
100
- await pressKeyWithModifier( 'ctrl', '`' );
101
99
 
102
100
  // Tab lands at first (presumed selected) option "Post".
103
101
  await page.keyboard.press( 'Tab' );
@@ -15,6 +15,7 @@ import {
15
15
  closeGlobalBlockInserter,
16
16
  openListView,
17
17
  closeListView,
18
+ canvas,
18
19
  } from '@wordpress/e2e-test-utils';
19
20
 
20
21
  /**
@@ -32,6 +33,34 @@ import {
32
33
 
33
34
  jest.setTimeout( 1000000 );
34
35
 
36
+ async function loadHtmlIntoTheBlockEditor( html ) {
37
+ await page.evaluate( ( _html ) => {
38
+ const { parse } = window.wp.blocks;
39
+ const { dispatch } = window.wp.data;
40
+ const blocks = parse( _html );
41
+
42
+ blocks.forEach( ( block ) => {
43
+ if ( block.name === 'core/image' ) {
44
+ delete block.attributes.id;
45
+ delete block.attributes.url;
46
+ }
47
+ } );
48
+
49
+ dispatch( 'core/block-editor' ).resetBlocks( blocks );
50
+ }, html );
51
+ }
52
+
53
+ async function load1000Paragraphs() {
54
+ await page.evaluate( () => {
55
+ const { createBlock } = window.wp.blocks;
56
+ const { dispatch } = window.wp.data;
57
+ const blocks = Array.from( { length: 1000 } ).map( () =>
58
+ createBlock( 'core/paragraph' )
59
+ );
60
+ dispatch( 'core/block-editor' ).resetBlocks( blocks );
61
+ } );
62
+ }
63
+
35
64
  describe( 'Post Editor Performance', () => {
36
65
  const results = {
37
66
  serverResponse: [],
@@ -41,6 +70,7 @@ describe( 'Post Editor Performance', () => {
41
70
  firstContentfulPaint: [],
42
71
  firstBlock: [],
43
72
  type: [],
73
+ typeContainer: [],
44
74
  focus: [],
45
75
  listViewOpen: [],
46
76
  inserterOpen: [],
@@ -50,29 +80,6 @@ describe( 'Post Editor Performance', () => {
50
80
  const traceFile = __dirname + '/trace.json';
51
81
  let traceResults;
52
82
 
53
- beforeAll( async () => {
54
- const html = readFile(
55
- join( __dirname, '../../assets/large-post.html' )
56
- );
57
-
58
- await createNewPost();
59
- await page.evaluate( ( _html ) => {
60
- const { parse } = window.wp.blocks;
61
- const { dispatch } = window.wp.data;
62
- const blocks = parse( _html );
63
-
64
- blocks.forEach( ( block ) => {
65
- if ( block.name === 'core/image' ) {
66
- delete block.attributes.id;
67
- delete block.attributes.url;
68
- }
69
- } );
70
-
71
- dispatch( 'core/block-editor' ).resetBlocks( blocks );
72
- }, html );
73
- await saveDraft();
74
- } );
75
-
76
83
  afterAll( async () => {
77
84
  const resultsFilename = basename( __filename, '.js' ) + '.results.json';
78
85
  writeFileSync(
@@ -83,6 +90,7 @@ describe( 'Post Editor Performance', () => {
83
90
  } );
84
91
 
85
92
  beforeEach( async () => {
93
+ await createNewPost();
86
94
  // Disable auto-save to avoid impacting the metrics.
87
95
  await page.evaluate( () => {
88
96
  window.wp.data.dispatch( 'core/editor' ).updateEditorSettings( {
@@ -93,11 +101,17 @@ describe( 'Post Editor Performance', () => {
93
101
  } );
94
102
 
95
103
  it( 'Loading', async () => {
96
- // Measuring loading time.
104
+ await loadHtmlIntoTheBlockEditor(
105
+ readFile( join( __dirname, '../../assets/large-post.html' ) )
106
+ );
107
+ await saveDraft();
97
108
  let i = 5;
98
109
  while ( i-- ) {
99
110
  await page.reload();
100
- await page.waitForSelector( '.wp-block' );
111
+ await page.waitForSelector( '.edit-post-layout', {
112
+ timeout: 120000,
113
+ } );
114
+ await canvas().waitForSelector( '.wp-block', { timeout: 120000 } );
101
115
  const {
102
116
  serverResponse,
103
117
  firstPaint,
@@ -117,7 +131,9 @@ describe( 'Post Editor Performance', () => {
117
131
  } );
118
132
 
119
133
  it( 'Typing', async () => {
120
- // Measuring typing performance.
134
+ await loadHtmlIntoTheBlockEditor(
135
+ readFile( join( __dirname, '../../assets/large-post.html' ) )
136
+ );
121
137
  await insertBlock( 'Paragraph' );
122
138
  let i = 20;
123
139
  await page.tracing.start( {
@@ -151,18 +167,59 @@ describe( 'Post Editor Performance', () => {
151
167
  }
152
168
  } );
153
169
 
154
- it( 'Selecting blocks', async () => {
155
- // Measuring block selection performance.
156
- await createNewPost();
157
- await page.evaluate( () => {
158
- const { createBlock } = window.wp.blocks;
159
- const { dispatch } = window.wp.data;
160
- const blocks = Array.from( { length: 1000 } ).map( () =>
161
- createBlock( 'core/paragraph' )
162
- );
163
- dispatch( 'core/block-editor' ).resetBlocks( blocks );
170
+ it( 'Typing within containers', async () => {
171
+ await loadHtmlIntoTheBlockEditor(
172
+ readFile(
173
+ join(
174
+ __dirname,
175
+ '../../assets/small-post-with-containers.html'
176
+ )
177
+ )
178
+ );
179
+ // Select the block where we type in
180
+ await canvas().waitForSelector( 'p[aria-label="Paragraph block"]' );
181
+ await canvas().click( 'p[aria-label="Paragraph block"]' );
182
+ // Ignore firsted typed character because it's different
183
+ // It probably deserves a dedicated metric.
184
+ // (isTyping triggers so it's slower)
185
+ await page.keyboard.type( 'x' );
186
+
187
+ let i = 10;
188
+ await page.tracing.start( {
189
+ path: traceFile,
190
+ screenshots: false,
191
+ categories: [ 'devtools.timeline' ],
164
192
  } );
165
- const paragraphs = await page.$$( '.wp-block' );
193
+
194
+ while ( i-- ) {
195
+ // Wait for the browser to be idle before starting the monitoring.
196
+ // eslint-disable-next-line no-restricted-syntax
197
+ await page.waitForTimeout( 500 );
198
+ await page.keyboard.type( 'x' );
199
+ }
200
+ // eslint-disable-next-line no-restricted-syntax
201
+ await page.waitForTimeout( 500 );
202
+ await page.tracing.stop();
203
+ traceResults = JSON.parse( readFile( traceFile ) );
204
+ const [ keyDownEvents, keyPressEvents, keyUpEvents ] =
205
+ getTypingEventDurations( traceResults );
206
+ if (
207
+ keyDownEvents.length === keyPressEvents.length &&
208
+ keyPressEvents.length === keyUpEvents.length
209
+ ) {
210
+ // The first character typed triggers a longer time (isTyping change)
211
+ // It can impact the stability of the metric, so we exclude it.
212
+ for ( let j = 1; j < keyDownEvents.length; j++ ) {
213
+ results.typeContainer.push(
214
+ keyDownEvents[ j ] + keyPressEvents[ j ] + keyUpEvents[ j ]
215
+ );
216
+ }
217
+ }
218
+ } );
219
+
220
+ it( 'Selecting blocks', async () => {
221
+ await load1000Paragraphs();
222
+ const paragraphs = await canvas().$$( '.wp-block' );
166
223
  await page.tracing.start( {
167
224
  path: traceFile,
168
225
  screenshots: false,
@@ -182,8 +239,7 @@ describe( 'Post Editor Performance', () => {
182
239
  } );
183
240
 
184
241
  it( 'Opening persistent list view', async () => {
185
- // Measure time to open inserter.
186
- await page.waitForSelector( '.edit-post-layout' );
242
+ await load1000Paragraphs();
187
243
  for ( let j = 0; j < 10; j++ ) {
188
244
  await page.tracing.start( {
189
245
  path: traceFile,
@@ -202,8 +258,7 @@ describe( 'Post Editor Performance', () => {
202
258
  } );
203
259
 
204
260
  it( 'Opening the inserter', async () => {
205
- // Measure time to open inserter.
206
- await page.waitForSelector( '.edit-post-layout' );
261
+ await load1000Paragraphs();
207
262
  for ( let j = 0; j < 10; j++ ) {
208
263
  await page.tracing.start( {
209
264
  path: traceFile,
@@ -225,8 +280,7 @@ describe( 'Post Editor Performance', () => {
225
280
  function sum( arr ) {
226
281
  return arr.reduce( ( a, b ) => a + b, 0 );
227
282
  }
228
-
229
- // Measure time to search the inserter and get results.
283
+ await load1000Paragraphs();
230
284
  await openGlobalBlockInserter();
231
285
  for ( let j = 0; j < 10; j++ ) {
232
286
  // Wait for the browser to be idle before starting the monitoring.
@@ -258,7 +312,7 @@ describe( 'Post Editor Performance', () => {
258
312
  } );
259
313
 
260
314
  it( 'Hovering Inserter Items', async () => {
261
- // Measure inserter hover performance.
315
+ await load1000Paragraphs();
262
316
  const paragraphBlockItem =
263
317
  '.block-editor-inserter__menu .editor-block-list-item-paragraph';
264
318
  const headingBlockItem =
@@ -51,6 +51,7 @@ describe( 'Site Editor Performance', () => {
51
51
  firstContentfulPaint: [],
52
52
  firstBlock: [],
53
53
  type: [],
54
+ typeContainer: [],
54
55
  focus: [],
55
56
  inserterOpen: [],
56
57
  inserterHover: [],
@@ -15,6 +15,7 @@ import {
15
15
  visitSiteEditor,
16
16
  enterEditMode,
17
17
  deleteAllTemplates,
18
+ canvas,
18
19
  } from '@wordpress/e2e-test-utils';
19
20
 
20
21
  describe( 'Multi-entity save flow', () => {
@@ -94,8 +95,8 @@ describe( 'Multi-entity save flow', () => {
94
95
  it( 'Save flow should work as expected.', async () => {
95
96
  await createNewPost();
96
97
  // Edit the page some.
97
- await page.waitForSelector( '.editor-post-title' );
98
- await page.click( '.editor-post-title' );
98
+ await canvas().waitForSelector( '.editor-post-title' );
99
+ await canvas().click( '.editor-post-title' );
99
100
  await page.keyboard.type( 'Test Post...' );
100
101
  await page.keyboard.press( 'Enter' );
101
102
 
@@ -110,8 +111,8 @@ describe( 'Multi-entity save flow', () => {
110
111
 
111
112
  // Add a reusable block and edit it.
112
113
  await createReusableBlock( 'Hi!', 'Test' );
113
- await page.waitForSelector( 'p[data-type="core/paragraph"]' );
114
- await page.click( 'p[data-type="core/paragraph"]' );
114
+ await canvas().waitForSelector( 'p[data-type="core/paragraph"]' );
115
+ await canvas().click( 'p[data-type="core/paragraph"]' );
115
116
  await page.keyboard.type( 'Oh!' );
116
117
 
117
118
  // Should trigger multi-entity save button once template part edited.
@@ -169,7 +170,7 @@ describe( 'Multi-entity save flow', () => {
169
170
  } );
170
171
 
171
172
  // Update the post.
172
- await page.click( '.editor-post-title' );
173
+ await canvas().click( '.editor-post-title' );
173
174
  await page.keyboard.type( '...more title!' );
174
175
 
175
176
  // Verify update button is enabled.
@@ -182,9 +183,9 @@ describe( 'Multi-entity save flow', () => {
182
183
  await assertExistence( saveA11ySelector, false );
183
184
 
184
185
  // Update reusable block again.
185
- await page.click( 'p[data-type="core/paragraph"]' );
186
+ await canvas().click( 'p[data-type="core/paragraph"]' );
186
187
  // We need to click again due to the clickthrough overlays in reusable blocks.
187
- await page.click( 'p[data-type="core/paragraph"]' );
188
+ await canvas().click( 'p[data-type="core/paragraph"]' );
188
189
  await page.keyboard.type( 'R!' );
189
190
 
190
191
  // Multi-entity saving should be enabled.
@@ -203,19 +204,19 @@ describe( 'Multi-entity save flow', () => {
203
204
  );
204
205
  const editableSiteTitleSelector =
205
206
  '.wp-block-site-title a[contenteditable="true"]';
206
- await page.waitForSelector( editableSiteTitleSelector );
207
- await page.focus( editableSiteTitleSelector );
207
+ await canvas().waitForSelector( editableSiteTitleSelector );
208
+ await canvas().focus( editableSiteTitleSelector );
208
209
  await page.keyboard.type( '...' );
209
210
 
210
211
  await insertBlock( 'Site Tagline' );
211
212
  // Wait for the placeholder.
212
- await page.waitForXPath(
213
+ await canvas().waitForXPath(
213
214
  '//span[@data-rich-text-placeholder="Write site tagline…"]'
214
215
  );
215
216
  const editableSiteTagLineSelector =
216
217
  '.wp-block-site-tagline[contenteditable="true"]';
217
- await page.waitForSelector( editableSiteTagLineSelector );
218
- await page.focus( editableSiteTagLineSelector );
218
+ await canvas().waitForSelector( editableSiteTagLineSelector );
219
+ await canvas().focus( editableSiteTagLineSelector );
219
220
  await page.keyboard.type( 'Just another WordPress site' );
220
221
 
221
222
  await clickButton( 'Publish' );