@wordpress/e2e-tests 6.0.0 → 6.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.
@@ -1,314 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import {
5
- clickBlockAppender,
6
- getEditedPostContent,
7
- createNewPost,
8
- pressKeyWithModifier,
9
- pressKeyTimes,
10
- openTypographyToolsPanelMenu,
11
- } from '@wordpress/e2e-test-utils';
12
-
13
- const openFontSizeSelectControl = async () => {
14
- const selectControlSelector =
15
- "//div[contains(@class, 'components-font-size-picker__controls')]//button[contains(@class, 'components-custom-select-control__button')]";
16
- const selectControl = await page.waitForXPath( selectControlSelector );
17
- return selectControl.click();
18
- };
19
-
20
- const FONT_SIZE_TOGGLE_GROUP_SELECTOR =
21
- "//div[contains(@class, 'components-font-size-picker__controls')]//div[contains(@class, 'components-toggle-group-control')]";
22
-
23
- // Click a button by its label - applies when ToggleGroupControl is used.
24
- const clickFontSizeButtonByLabel = async ( label ) => {
25
- const buttonSelector = `${ FONT_SIZE_TOGGLE_GROUP_SELECTOR }//button[@aria-label='${ label }']`;
26
- const button = await page.waitForXPath( buttonSelector );
27
- return button.click();
28
- };
29
-
30
- // Clicks the button to toggle between custom size input and the control for the presets.
31
- const toggleCustomInput = async ( showCustomInput ) => {
32
- const label = showCustomInput ? 'Set custom size' : 'Use size preset';
33
- const toggleButton = await page.waitForXPath(
34
- `//button[@aria-label='${ label }']`
35
- );
36
- return toggleButton.click();
37
- };
38
-
39
- const clickCustomInput = async () => {
40
- const customInput = await page.waitForXPath( "//input[@type='number']" );
41
- return customInput.click();
42
- };
43
-
44
- describe( 'Font Size Picker', () => {
45
- beforeEach( async () => {
46
- await createNewPost();
47
- } );
48
- describe( 'Common', () => {
49
- it( 'should apply a named font size using the font size input', async () => {
50
- // Create a paragraph block with some content.
51
- await clickBlockAppender();
52
- await page.keyboard.type( 'Paragraph to be made "small"' );
53
-
54
- await toggleCustomInput( true );
55
- await clickCustomInput();
56
- // This should be the "small" font-size of the editor defaults.
57
- await page.keyboard.type( '13' );
58
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
59
- "<!-- wp:paragraph {\\"fontSize\\":\\"small\\"} -->
60
- <p class=\\"has-small-font-size\\">Paragraph to be made \\"small\\"</p>
61
- <!-- /wp:paragraph -->"
62
- ` );
63
- } );
64
- it( 'should apply a custom font size using the font size input', async () => {
65
- // Create a paragraph block with some content.
66
- await clickBlockAppender();
67
- await page.keyboard.type( 'Paragraph to be made "small"' );
68
-
69
- await toggleCustomInput( true );
70
- await clickCustomInput();
71
- await page.keyboard.type( '23' );
72
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
73
- "<!-- wp:paragraph {\\"style\\":{\\"typography\\":{\\"fontSize\\":\\"23px\\"}}} -->
74
- <p style=\\"font-size:23px\\">Paragraph to be made \\"small\\"</p>
75
- <!-- /wp:paragraph -->"
76
- ` );
77
- } );
78
- it( 'should reset a custom font size using input field', async () => {
79
- // Create a paragraph block with some content.
80
- await clickBlockAppender();
81
- await page.keyboard.type( 'Paragraph reset - custom size' );
82
-
83
- await toggleCustomInput( true );
84
- await clickCustomInput();
85
- await page.keyboard.type( '23' );
86
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
87
- "<!-- wp:paragraph {\\"style\\":{\\"typography\\":{\\"fontSize\\":\\"23px\\"}}} -->
88
- <p style=\\"font-size:23px\\">Paragraph reset - custom size</p>
89
- <!-- /wp:paragraph -->"
90
- ` );
91
-
92
- await pressKeyTimes( 'Backspace', 2 );
93
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
94
- "<!-- wp:paragraph -->
95
- <p>Paragraph reset - custom size</p>
96
- <!-- /wp:paragraph -->"
97
- ` );
98
- } );
99
- } );
100
-
101
- // A different control is rendered based on the available font sizes number.
102
- describe( 'More font sizes', () => {
103
- beforeEach( async () => {
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
-
117
- wp.data.dispatch( 'core/block-editor' ).updateSettings(
118
- setDeep(
119
- wp.data.select( 'core/block-editor' ).getSettings(),
120
- [
121
- '__experimentalFeatures',
122
- 'typography',
123
- 'fontSizes',
124
- 'default',
125
- ],
126
- [
127
- {
128
- name: 'Tiny',
129
- slug: 'tiny',
130
- size: '11px',
131
- },
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
- ]
158
- )
159
- );
160
- } );
161
- } );
162
-
163
- it( 'should apply a named font size using the font size buttons', async () => {
164
- // Create a paragraph block with some content.
165
- await clickBlockAppender();
166
- await page.keyboard.type( 'Paragraph to be made "large"' );
167
-
168
- await openFontSizeSelectControl();
169
- await pressKeyTimes( 'ArrowDown', 4 );
170
- await page.keyboard.press( 'Enter' );
171
-
172
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
173
- "<!-- wp:paragraph {\\"fontSize\\":\\"large\\"} -->
174
- <p class=\\"has-large-font-size\\">Paragraph to be made \\"large\\"</p>
175
- <!-- /wp:paragraph -->"
176
- ` );
177
- } );
178
- it( 'should reset a named font size using the tools panel menu', async () => {
179
- // Create a paragraph block with some content.
180
- await clickBlockAppender();
181
- await page.keyboard.type(
182
- 'Paragraph with font size reset using tools panel menu'
183
- );
184
-
185
- await openFontSizeSelectControl();
186
- await pressKeyTimes( 'ArrowDown', 3 );
187
- await page.keyboard.press( 'Enter' );
188
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
189
- "<!-- wp:paragraph {\\"fontSize\\":\\"medium\\"} -->
190
- <p class=\\"has-medium-font-size\\">Paragraph with font size reset using tools panel menu</p>
191
- <!-- /wp:paragraph -->"
192
- ` );
193
-
194
- // Open Typography ToolsPanel, font size will be first in menu and gain focus.
195
- await openTypographyToolsPanelMenu();
196
-
197
- await page.keyboard.press( 'Enter' );
198
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
199
- "<!-- wp:paragraph -->
200
- <p>Paragraph with font size reset using tools panel menu</p>
201
- <!-- /wp:paragraph -->"
202
- ` );
203
- } );
204
-
205
- it( 'should reset a named font size using input field', async () => {
206
- // Create a paragraph block with some content.
207
- await clickBlockAppender();
208
- await page.keyboard.type(
209
- 'Paragraph with font size reset using input field'
210
- );
211
-
212
- await openFontSizeSelectControl();
213
- await pressKeyTimes( 'ArrowDown', 2 );
214
- await page.keyboard.press( 'Enter' );
215
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
216
- "<!-- wp:paragraph {\\"fontSize\\":\\"small\\"} -->
217
- <p class=\\"has-small-font-size\\">Paragraph with font size reset using input field</p>
218
- <!-- /wp:paragraph -->"
219
- ` );
220
-
221
- await toggleCustomInput( true );
222
- await clickCustomInput();
223
- await pressKeyWithModifier( 'primary', 'A' );
224
- await page.keyboard.press( 'Backspace' );
225
-
226
- // Disable reason: Wait for changes to apply.
227
- // eslint-disable-next-line no-restricted-syntax
228
- await page.waitForTimeout( 1000 );
229
-
230
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
231
- "<!-- wp:paragraph -->
232
- <p>Paragraph with font size reset using input field</p>
233
- <!-- /wp:paragraph -->"
234
- ` );
235
- } );
236
- } );
237
- describe( 'Few font sizes', () => {
238
- it( 'should apply a named font size using the font size buttons', async () => {
239
- // Create a paragraph block with some content.
240
- await clickBlockAppender();
241
- await page.keyboard.type( 'Paragraph to be made "large"' );
242
-
243
- await clickFontSizeButtonByLabel( 'Large' );
244
- const buttonSelector = `${ FONT_SIZE_TOGGLE_GROUP_SELECTOR }//button[@aria-checked='true']`;
245
- const [ activeButton ] = await page.$x( buttonSelector );
246
- const activeLabel = await page.evaluate(
247
- ( element ) => element?.getAttribute( 'aria-label' ),
248
- activeButton
249
- );
250
- expect( activeLabel ).toEqual( 'Large' );
251
-
252
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
253
- "<!-- wp:paragraph {\\"fontSize\\":\\"large\\"} -->
254
- <p class=\\"has-large-font-size\\">Paragraph to be made \\"large\\"</p>
255
- <!-- /wp:paragraph -->"
256
- ` );
257
- } );
258
-
259
- it( 'should reset a named font size using the tools panel menu', async () => {
260
- // Create a paragraph block with some content.
261
- await clickBlockAppender();
262
- await page.keyboard.type(
263
- 'Paragraph with font size reset using tools panel menu'
264
- );
265
-
266
- await clickFontSizeButtonByLabel( 'Small' );
267
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
268
- "<!-- wp:paragraph {\\"fontSize\\":\\"small\\"} -->
269
- <p class=\\"has-small-font-size\\">Paragraph with font size reset using tools panel menu</p>
270
- <!-- /wp:paragraph -->"
271
- ` );
272
-
273
- // Open Typography ToolsPanel, font size will be first in menu and gain focus.
274
- await openTypographyToolsPanelMenu();
275
-
276
- await page.keyboard.press( 'Enter' );
277
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
278
- "<!-- wp:paragraph -->
279
- <p>Paragraph with font size reset using tools panel menu</p>
280
- <!-- /wp:paragraph -->"
281
- ` );
282
- } );
283
-
284
- it( 'should reset a named font size using input field', async () => {
285
- // Create a paragraph block with some content.
286
- await clickBlockAppender();
287
- await page.keyboard.type(
288
- 'Paragraph with font size reset using input field'
289
- );
290
-
291
- await clickFontSizeButtonByLabel( 'Small' );
292
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
293
- "<!-- wp:paragraph {\\"fontSize\\":\\"small\\"} -->
294
- <p class=\\"has-small-font-size\\">Paragraph with font size reset using input field</p>
295
- <!-- /wp:paragraph -->"
296
- ` );
297
-
298
- await toggleCustomInput( true );
299
- await clickCustomInput();
300
- await pressKeyWithModifier( 'primary', 'A' );
301
- await page.keyboard.press( 'Backspace' );
302
-
303
- // Disable reason: Wait for changes to apply.
304
- // eslint-disable-next-line no-restricted-syntax
305
- await page.waitForTimeout( 1000 );
306
-
307
- expect( await getEditedPostContent() ).toMatchInlineSnapshot( `
308
- "<!-- wp:paragraph -->
309
- <p>Paragraph with font size reset using input field</p>
310
- <!-- /wp:paragraph -->"
311
- ` );
312
- } );
313
- } );
314
- } );
@@ -1,74 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import path from 'path';
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
- import { visitAdminPage } from '@wordpress/e2e-test-utils';
10
-
11
- describe( 'Managing reusable blocks', () => {
12
- /**
13
- * Returns a Promise which resolves to the number of post list entries on
14
- * the current page.
15
- *
16
- * @return {Promise} Promise resolving to number of post list entries.
17
- */
18
- async function getNumberOfEntries() {
19
- return page.evaluate(
20
- () => document.querySelectorAll( '.hentry' ).length
21
- );
22
- }
23
-
24
- beforeAll( async () => {
25
- await visitAdminPage( 'edit.php', 'post_type=wp_block' );
26
- } );
27
-
28
- it( 'Should import reusable blocks', async () => {
29
- const originalEntries = await getNumberOfEntries();
30
-
31
- // Import Reusable block.
32
- await page.waitForSelector( '.list-reusable-blocks__container' );
33
- const importButton = await page.$(
34
- '.list-reusable-blocks__container button'
35
- );
36
- await importButton.click();
37
-
38
- // Select the file to upload.
39
- const testReusableBlockFile = path.join(
40
- __dirname,
41
- '..',
42
- '..',
43
- '..',
44
- 'assets',
45
- 'greeting-reusable-block.json'
46
- );
47
- const input = await page.$( '.list-reusable-blocks-import-form input' );
48
- await input.uploadFile( testReusableBlockFile );
49
-
50
- // Submit the form.
51
- const button = await page.$(
52
- '.list-reusable-blocks-import-form__button'
53
- );
54
- await button.click();
55
-
56
- // Wait for the success notice.
57
- await page.waitForSelector( '.notice-success' );
58
- const noticeContent = await page.$eval(
59
- '.notice-success',
60
- ( element ) => element.textContent
61
- );
62
- expect( noticeContent ).toEqual(
63
- 'Reusable block imported successfully!'
64
- );
65
-
66
- // Refresh the page.
67
- await visitAdminPage( 'edit.php', 'post_type=wp_block' );
68
-
69
- const expectedEntries = originalEntries + 1;
70
- const actualEntries = await getNumberOfEntries();
71
-
72
- expect( actualEntries ).toBe( expectedEntries );
73
- } );
74
- } );
@@ -1,133 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import {
5
- setBrowserViewport,
6
- createNewPost,
7
- openDocumentSettingsSidebar,
8
- } from '@wordpress/e2e-test-utils';
9
-
10
- describe( 'Post visibility', () => {
11
- afterEach( async () => {
12
- await setBrowserViewport( 'large' );
13
- } );
14
- [ 'large', 'small' ].forEach( ( viewport ) => {
15
- it( `can be changed when the viewport is ${ viewport }`, async () => {
16
- await setBrowserViewport( viewport );
17
-
18
- await createNewPost();
19
-
20
- await openDocumentSettingsSidebar();
21
-
22
- await page.click( '*[aria-label^="Select visibility"]' );
23
-
24
- const [ privateLabel ] = await page.$x(
25
- '//label[text()="Private"]'
26
- );
27
- await privateLabel.click();
28
-
29
- await page.waitForXPath(
30
- '//*[text()="Would you like to privately publish this post now?"]'
31
- );
32
-
33
- const [ confirmButton ] = await page.$x(
34
- '//*[@role="dialog"]//button[text()="OK"]'
35
- );
36
- await confirmButton.click();
37
-
38
- const currentStatus = await page.evaluate( () => {
39
- return wp.data
40
- .select( 'core/editor' )
41
- .getEditedPostAttribute( 'status' );
42
- } );
43
-
44
- expect( currentStatus ).toBe( 'private' );
45
- } );
46
-
47
- it( `can be canceled when the viewport is ${ viewport }`, async () => {
48
- await setBrowserViewport( viewport );
49
-
50
- await createNewPost();
51
-
52
- await openDocumentSettingsSidebar();
53
-
54
- const initialStatus = await page.evaluate( () => {
55
- return wp.data
56
- .select( 'core/editor' )
57
- .getEditedPostAttribute( 'status' );
58
- } );
59
-
60
- await page.click( '*[aria-label^="Select visibility"]' );
61
-
62
- const [ privateLabel ] = await page.$x(
63
- '//label[text()="Private"]'
64
- );
65
- await privateLabel.click();
66
- await page.waitForXPath(
67
- '//*[text()="Would you like to privately publish this post now?"]'
68
- );
69
- const cancelButton = await page.waitForXPath(
70
- '//*[@role="dialog"][not(@id="wp-link-wrap")]//button[text()="Cancel"]'
71
- );
72
- await cancelButton.click();
73
-
74
- const currentStatus = await page.evaluate( () => {
75
- return wp.data
76
- .select( 'core/editor' )
77
- .getEditedPostAttribute( 'status' );
78
- } );
79
-
80
- expect( currentStatus ).toBe( initialStatus );
81
- } );
82
- } );
83
-
84
- it( 'visibility remains private even if the publish date is in the future', async () => {
85
- await createNewPost();
86
-
87
- // Enter a title for this post.
88
- await page.type( '.editor-post-title__input', 'Title' );
89
-
90
- await openDocumentSettingsSidebar();
91
-
92
- // Set a publish date for the next month.
93
- await page.click( '*[aria-label^="Change date"]' );
94
- await page.click( '*[aria-label="View next month"]' );
95
- await (
96
- await page.$x(
97
- '//*[@role="application"][@aria-label="Calendar"]//button[text()="15"]'
98
- )
99
- )[ 0 ].click();
100
-
101
- await page.click( '*[aria-label^="Select visibility"]' );
102
-
103
- const [ privateLabel ] = await page.$x( '//label[text()="Private"]' );
104
- await privateLabel.click();
105
-
106
- await page.waitForXPath(
107
- '//*[text()="Would you like to privately publish this post now?"]'
108
- );
109
-
110
- const [ confirmButton ] = await page.$x(
111
- '//*[@role="dialog"]//button[text()="OK"]'
112
- );
113
- await confirmButton.click();
114
-
115
- // Enter a title for this post.
116
- await page.type( '.editor-post-title__input', ' Changed' );
117
-
118
- // Wait for the button to be clickable before attempting to click.
119
- // This could cause errors when we try to click before changes are registered.
120
- await page.waitForSelector(
121
- '.editor-post-publish-button[aria-disabled="false"]'
122
- );
123
- await page.click( '.editor-post-publish-button' );
124
-
125
- const currentStatus = await page.evaluate( () => {
126
- return wp.data
127
- .select( 'core/editor' )
128
- .getEditedPostAttribute( 'status' );
129
- } );
130
-
131
- expect( currentStatus ).toBe( 'private' );
132
- } );
133
- } );
@@ -1,142 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import {
5
- createNewPost,
6
- pressKeyWithModifier,
7
- insertBlock,
8
- } from '@wordpress/e2e-test-utils';
9
-
10
- async function focusBlockToolbar() {
11
- await pressKeyWithModifier( 'alt', 'F10' );
12
- }
13
-
14
- async function expectLabelToHaveFocus( label ) {
15
- let ariaLabel = await page.evaluate( () =>
16
- document.activeElement.getAttribute( 'aria-label' )
17
- );
18
- // If the labels don't match, try pressing Up Arrow to focus the block wrapper in non-content editable block.
19
- if ( ariaLabel !== label ) {
20
- await page.keyboard.press( 'ArrowUp' );
21
- ariaLabel = await page.evaluate( () =>
22
- document.activeElement.getAttribute( 'aria-label' )
23
- );
24
- }
25
- await expect( ariaLabel ).toBe( label );
26
- }
27
-
28
- async function testBlockToolbarKeyboardNavigation(
29
- currentBlockLabel,
30
- currentBlockTitle
31
- ) {
32
- await focusBlockToolbar();
33
- await expectLabelToHaveFocus( currentBlockTitle );
34
- await page.keyboard.press( 'ArrowRight' );
35
- await expectLabelToHaveFocus( 'Move up' );
36
- await page.keyboard.press( 'Tab' );
37
- await expectLabelToHaveFocus( currentBlockLabel );
38
- await pressKeyWithModifier( 'shift', 'Tab' );
39
- await expectLabelToHaveFocus( 'Move up' );
40
- }
41
-
42
- async function wrapCurrentBlockWithGroup( currentBlockTitle ) {
43
- await page.click( `[aria-label="${ currentBlockTitle }"]` );
44
- await page.click( '.editor-block-list-item-group' );
45
- }
46
-
47
- async function testGroupKeyboardNavigation(
48
- currentBlockLabel,
49
- currentBlockTitle
50
- ) {
51
- await expectLabelToHaveFocus( 'Block: Group' );
52
- await page.keyboard.press( 'ArrowRight' );
53
- await expectLabelToHaveFocus( currentBlockLabel );
54
- await pressKeyWithModifier( 'shift', 'Tab' );
55
- await expectLabelToHaveFocus( 'Select Group' );
56
- await page.keyboard.press( 'ArrowRight' );
57
- await expectLabelToHaveFocus( currentBlockTitle );
58
- }
59
-
60
- describe( 'Toolbar roving tabindex', () => {
61
- beforeEach( async () => {
62
- await createNewPost();
63
- await insertBlock( 'Paragraph' );
64
- await page.keyboard.type( 'First block' );
65
- } );
66
-
67
- it( 'ensures paragraph block toolbar uses roving tabindex', async () => {
68
- await insertBlock( 'Paragraph' );
69
- await page.keyboard.type( 'Paragraph' );
70
- await testBlockToolbarKeyboardNavigation(
71
- 'Paragraph block',
72
- 'Paragraph'
73
- );
74
- await wrapCurrentBlockWithGroup( 'Paragraph' );
75
- await testGroupKeyboardNavigation( 'Paragraph block', 'Paragraph' );
76
- } );
77
-
78
- it( 'ensures heading block toolbar uses roving tabindex', async () => {
79
- await insertBlock( 'Heading' );
80
- await page.keyboard.type( 'Heading' );
81
- await testBlockToolbarKeyboardNavigation( 'Block: Heading', 'Heading' );
82
- await wrapCurrentBlockWithGroup( 'Heading' );
83
- await testGroupKeyboardNavigation( 'Block: Heading', 'Heading' );
84
- } );
85
-
86
- it( 'ensures list block toolbar uses roving tabindex', async () => {
87
- await insertBlock( 'List' );
88
- await page.keyboard.type( 'List' );
89
- await testBlockToolbarKeyboardNavigation( 'List text', 'Select List' );
90
- await page.click( `[aria-label="Select List"]` );
91
- await wrapCurrentBlockWithGroup( 'List' );
92
- await testGroupKeyboardNavigation( 'Block: List', 'List' );
93
- } );
94
-
95
- it( 'ensures image block toolbar uses roving tabindex', async () => {
96
- await insertBlock( 'Image' );
97
- await testBlockToolbarKeyboardNavigation( 'Block: Image', 'Image' );
98
- await wrapCurrentBlockWithGroup( 'Image' );
99
- await testGroupKeyboardNavigation( 'Block: Image', 'Image' );
100
- } );
101
-
102
- it( 'ensures table block toolbar uses roving tabindex', async () => {
103
- await insertBlock( 'Table' );
104
- await testBlockToolbarKeyboardNavigation( 'Block: Table', 'Table' );
105
- // Move focus to the first toolbar item.
106
- await page.keyboard.press( 'Home' );
107
- await expectLabelToHaveFocus( 'Table' );
108
- await page.click( '.blocks-table__placeholder-button' );
109
- await page.keyboard.press( 'Tab' );
110
- await testBlockToolbarKeyboardNavigation( 'Body cell text', 'Table' );
111
- await wrapCurrentBlockWithGroup( 'Table' );
112
- await testGroupKeyboardNavigation( 'Block: Table', 'Table' );
113
- } );
114
-
115
- it( 'ensures custom html block toolbar uses roving tabindex', async () => {
116
- await insertBlock( 'Custom HTML' );
117
- await testBlockToolbarKeyboardNavigation( 'HTML', 'Custom HTML' );
118
- await wrapCurrentBlockWithGroup( 'Custom HTML' );
119
- await testGroupKeyboardNavigation(
120
- 'Block: Custom HTML',
121
- 'Custom HTML'
122
- );
123
- } );
124
-
125
- it( 'ensures block toolbar remembers the last focused item', async () => {
126
- await insertBlock( 'Paragraph' );
127
- await page.keyboard.type( 'Paragraph' );
128
- await focusBlockToolbar();
129
- await page.keyboard.press( 'ArrowRight' );
130
- await expectLabelToHaveFocus( 'Move up' );
131
- await page.keyboard.press( 'Tab' );
132
- await pressKeyWithModifier( 'shift', 'Tab' );
133
- await expectLabelToHaveFocus( 'Move up' );
134
- } );
135
-
136
- it( 'can reach toolbar items with arrow keys after pressing alt+F10', async () => {
137
- await pressKeyWithModifier( 'alt', 'F10' );
138
- await page.keyboard.press( 'ArrowRight' );
139
- await page.keyboard.press( 'ArrowRight' );
140
- await expectLabelToHaveFocus( 'Bold' );
141
- } );
142
- } );