@wordpress/e2e-tests 3.0.9 → 3.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.
Files changed (63) hide show
  1. package/config/setup-performance-test.js +1 -1
  2. package/config/setup-test-framework.js +1 -1
  3. package/package.json +5 -5
  4. package/specs/editor/blocks/__snapshots__/navigation.test.js.snap +16 -16
  5. package/specs/editor/blocks/classic.test.js +2 -2
  6. package/specs/editor/blocks/cover.test.js +17 -17
  7. package/specs/editor/blocks/list.test.js +1 -1
  8. package/specs/editor/blocks/navigation.test.js +259 -52
  9. package/specs/editor/blocks/table.test.js +1 -1
  10. package/specs/editor/plugins/align-hook.test.js +10 -10
  11. package/specs/editor/plugins/block-context.test.js +1 -1
  12. package/specs/editor/plugins/block-directory-add.test.js +14 -14
  13. package/specs/editor/plugins/custom-post-types.test.js +1 -1
  14. package/specs/editor/plugins/custom-taxonomies.test.js +3 -3
  15. package/specs/editor/plugins/meta-attribute-block.test.js +1 -1
  16. package/specs/editor/plugins/meta-boxes.test.js +3 -3
  17. package/specs/editor/plugins/templates.test.js +1 -1
  18. package/specs/editor/plugins/wp-editor-meta-box.test.js +1 -1
  19. package/specs/editor/various/autosave.test.js +19 -19
  20. package/specs/editor/various/block-deletion.test.js +5 -5
  21. package/specs/editor/various/block-grouping.test.js +29 -12
  22. package/specs/editor/various/block-hierarchy-navigation.test.js +5 -5
  23. package/specs/editor/various/change-detection.test.js +3 -3
  24. package/specs/editor/various/compatibility-classic-editor.test.js +1 -1
  25. package/specs/editor/various/copy-cut-paste-whole-blocks.test.js +7 -7
  26. package/specs/editor/various/datepicker.test.js +1 -1
  27. package/specs/editor/various/duplicating-blocks.test.js +3 -3
  28. package/specs/editor/various/editor-modes.test.js +5 -5
  29. package/specs/editor/various/inserting-blocks.test.js +6 -6
  30. package/specs/editor/various/invalid-block.test.js +4 -4
  31. package/specs/editor/various/is-typing.test.js +8 -8
  32. package/specs/editor/various/keyboard-navigable-blocks.test.js +2 -2
  33. package/specs/editor/various/links.test.js +90 -90
  34. package/specs/editor/various/list-view.test.js +47 -1
  35. package/specs/editor/various/manage-reusable-blocks.test.js +5 -5
  36. package/specs/editor/various/multi-block-selection.test.js +2 -2
  37. package/specs/editor/various/navigable-toolbar.test.js +1 -1
  38. package/specs/editor/various/new-post-default-content.test.js +2 -2
  39. package/specs/editor/various/new-post.test.js +1 -1
  40. package/specs/editor/various/nux.test.js +11 -11
  41. package/specs/editor/various/popovers.test.js +3 -3
  42. package/specs/editor/various/post-editor-template-mode.test.js +12 -11
  43. package/specs/editor/various/preferences.test.js +1 -1
  44. package/specs/editor/various/preview.test.js +8 -4
  45. package/specs/editor/various/publish-button.test.js +2 -2
  46. package/specs/editor/various/publishing.test.js +50 -1
  47. package/specs/editor/various/reusable-blocks.test.js +31 -31
  48. package/specs/editor/various/rich-text.test.js +1 -1
  49. package/specs/editor/various/splitting-merging.test.js +6 -6
  50. package/specs/editor/various/style-variation.test.js +2 -2
  51. package/specs/editor/various/switch-to-draft.test.js +3 -1
  52. package/specs/editor/various/taxonomies.test.js +1 -1
  53. package/specs/editor/various/toolbar-roving-tabindex.test.js +1 -1
  54. package/specs/editor/various/writing-flow.test.js +20 -20
  55. package/specs/experiments/navigation-editor.test.js +168 -3
  56. package/specs/performance/post-editor.test.js +7 -7
  57. package/specs/performance/site-editor.test.js +1 -1
  58. package/specs/site-editor/document-settings.test.js +5 -5
  59. package/specs/site-editor/multi-entity-editing.test.js +1 -1
  60. package/specs/site-editor/multi-entity-saving.test.js +1 -1
  61. package/specs/site-editor/template-part.test.js +9 -8
  62. package/specs/widgets/customizing-widgets.test.js +10 -9
  63. package/specs/widgets/editing-widgets.test.js +8 -7
@@ -16,7 +16,7 @@ import {
16
16
  */
17
17
  const PUPPETEER_TIMEOUT = process.env.PUPPETEER_TIMEOUT;
18
18
 
19
- // The Jest timeout is increased because these tests are a bit slow
19
+ // The Jest timeout is increased because these tests are a bit slow.
20
20
  jest.setTimeout( PUPPETEER_TIMEOUT || 100000 );
21
21
 
22
22
  async function setupBrowser() {
@@ -65,7 +65,7 @@ const OBSERVED_CONSOLE_MESSAGE_TYPES = {
65
65
  */
66
66
  const pageEvents = [];
67
67
 
68
- // The Jest timeout is increased because these tests are a bit slow
68
+ // The Jest timeout is increased because these tests are a bit slow.
69
69
  jest.setTimeout( PUPPETEER_TIMEOUT || 100000 );
70
70
 
71
71
  // Retry failed tests at most 2 times in CI.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-tests",
3
- "version": "3.0.9",
3
+ "version": "3.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": ">=12"
24
24
  },
25
25
  "dependencies": {
26
- "@wordpress/e2e-test-utils": "^6.0.2",
26
+ "@wordpress/e2e-test-utils": "^7.0.0",
27
27
  "@wordpress/jest-console": "^5.0.1",
28
28
  "@wordpress/jest-puppeteer-axe": "^4.0.1",
29
- "@wordpress/scripts": "^22.1.0",
30
- "@wordpress/url": "^3.4.1",
29
+ "@wordpress/scripts": "^22.2.0",
30
+ "@wordpress/url": "^3.5.0",
31
31
  "chalk": "^4.0.0",
32
32
  "expect-puppeteer": "^4.4.0",
33
33
  "filenamify": "^4.2.0",
@@ -44,5 +44,5 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "bc1ccad6698ada7ea0096df8e55a188fcd3a1a26"
47
+ "gitHead": "c37fd7edbc3e379540d7b24fce75a6f640a434ae"
48
48
  }
@@ -1,20 +1,6 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`Navigation allows an empty navigation block to be created and manually populated using a mixture of internal and external links 1`] = `
4
- "<!-- wp:navigation-link {\\"label\\":\\"WP\\",\\"url\\":\\"https://wordpress.org\\",\\"kind\\":\\"custom\\",\\"isTopLevelLink\\":true} /-->
5
-
6
- <!-- wp:navigation-link {\\"label\\":\\"Contact\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"https://this/is/a/test/search/get-in-touch\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"
7
- `;
8
-
9
- exports[`Navigation allows pages to be created from the navigation block and their links added to menu 1`] = `"<!-- wp:navigation-link {\\"label\\":\\"A really long page name that will not exist\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"`;
10
-
11
- exports[`Navigation encodes URL when create block if needed 1`] = `
12
- "<!-- wp:navigation-link {\\"label\\":\\"wordpress.org/шеллы\\",\\"url\\":\\"https://wordpress.org/%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\\",\\"kind\\":\\"custom\\",\\"isTopLevelLink\\":true} /-->
13
-
14
- <!-- wp:navigation-link {\\"label\\":\\"お問い合わせ\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"https://this/is/a/test/search/%E3%81%8A%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"
15
- `;
16
-
17
- exports[`Navigation placeholder allows a navigation block to be created from existing menus 1`] = `
3
+ exports[`Navigation Placeholder placeholder actions allows a navigation block to be created from existing menus 1`] = `
18
4
  "<!-- wp:navigation-link {\\"label\\":\\"Home\\",\\"type\\":\\"custom\\",\\"url\\":\\"http://localhost:8889/\\",\\"kind\\":\\"custom\\"} /-->
19
5
 
20
6
  <!-- wp:navigation-submenu {\\"label\\":\\"About\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\"} -->
@@ -42,6 +28,20 @@ exports[`Navigation placeholder allows a navigation block to be created from exi
42
28
  <!-- /wp:navigation-submenu -->"
43
29
  `;
44
30
 
45
- exports[`Navigation placeholder creates an empty navigation block when the selected existing menu is also empty 1`] = `""`;
31
+ exports[`Navigation Placeholder placeholder actions creates an empty navigation block when the selected existing menu is also empty 1`] = `""`;
32
+
33
+ exports[`Navigation allows an empty navigation block to be created and manually populated using a mixture of internal and external links 1`] = `
34
+ "<!-- wp:navigation-link {\\"label\\":\\"WP\\",\\"url\\":\\"https://wordpress.org\\",\\"kind\\":\\"custom\\",\\"isTopLevelLink\\":true} /-->
35
+
36
+ <!-- wp:navigation-link {\\"label\\":\\"Contact\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"https://this/is/a/test/search/get-in-touch\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"
37
+ `;
38
+
39
+ exports[`Navigation allows pages to be created from the navigation block and their links added to menu 1`] = `"<!-- wp:navigation-link {\\"label\\":\\"A really long page name that will not exist\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"http://localhost:8889/?page_id=[number]\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"`;
40
+
41
+ exports[`Navigation encodes URL when create block if needed 1`] = `
42
+ "<!-- wp:navigation-link {\\"label\\":\\"wordpress.org/шеллы\\",\\"url\\":\\"https://wordpress.org/%D1%88%D0%B5%D0%BB%D0%BB%D1%8B\\",\\"kind\\":\\"custom\\",\\"isTopLevelLink\\":true} /-->
43
+
44
+ <!-- wp:navigation-link {\\"label\\":\\"お問い合わせ\\",\\"type\\":\\"page\\",\\"id\\":[number],\\"url\\":\\"https://this/is/a/test/search/%E3%81%8A%E5%95%8F%E3%81%84%E5%90%88%E3%82%8F%E3%81%9B\\",\\"kind\\":\\"post-type\\",\\"isTopLevelLink\\":true} /-->"
45
+ `;
46
46
 
47
47
  exports[`Navigation supports navigation blocks that have inner blocks within their markup and converts them to wp_navigation posts 1`] = `"<!-- wp:page-list /-->"`;
@@ -106,7 +106,7 @@ describe( 'Classic', () => {
106
106
  } );
107
107
 
108
108
  it( 'Should not fail after save/reload', async () => {
109
- // Might move to utils if this becomes useful enough for other tests
109
+ // Might move to utils if this becomes useful enough for other tests.
110
110
  const runWithoutCache = async ( cb ) => {
111
111
  try {
112
112
  await page.setCacheEnabled( false );
@@ -128,7 +128,7 @@ describe( 'Classic', () => {
128
128
  // Move focus away.
129
129
  await pressKeyWithModifier( 'shift', 'Tab' );
130
130
 
131
- // Save
131
+ // Save.
132
132
  await saveDraft();
133
133
 
134
134
  // Reload
@@ -43,21 +43,21 @@ describe( 'Cover', () => {
43
43
 
44
44
  it( 'can set overlay color using color picker on block placeholder', async () => {
45
45
  await insertBlock( 'Cover' );
46
- // Get the first color option from the block placeholder's color picker
46
+ // Get the first color option from the block placeholder's color picker.
47
47
  const colorPickerButton = await page.waitForSelector(
48
48
  '.wp-block-cover__placeholder-background-options .components-circular-option-picker__option-wrapper:first-child button'
49
49
  );
50
- // Get the RGB value of the picked color
50
+ // Get the RGB value of the picked color.
51
51
  const pickedColor = await colorPickerButton.evaluate(
52
52
  ( node ) => node.style.backgroundColor
53
53
  );
54
- // Create the block by clicking selected color button
54
+ // Create the block by clicking selected color button.
55
55
  await colorPickerButton.click();
56
- // Get the block's background dim element
56
+ // Get the block's background dim element.
57
57
  const backgroundDim = await page.waitForSelector(
58
58
  '.wp-block-cover .has-background-dim'
59
59
  );
60
- // Get the RGB value of the background dim
60
+ // Get the RGB value of the background dim.
61
61
  const dimColor = await backgroundDim.evaluate(
62
62
  ( node ) => node.style.backgroundColor
63
63
  );
@@ -67,9 +67,9 @@ describe( 'Cover', () => {
67
67
 
68
68
  it( 'can set background image using image upload on block placeholder', async () => {
69
69
  await insertBlock( 'Cover' );
70
- // Create the block using uploaded image
70
+ // Create the block using uploaded image.
71
71
  const sourceImageFilename = await upload( '.wp-block-cover' );
72
- // Get the block's background image URL
72
+ // Get the block's background image URL.
73
73
  const blockImage = await page.waitForSelector( '.wp-block-cover img' );
74
74
  const blockImageUrl = await blockImage.evaluate( ( el ) => el.src );
75
75
 
@@ -78,9 +78,9 @@ describe( 'Cover', () => {
78
78
 
79
79
  it( 'dims background image down by 50% by default', async () => {
80
80
  await insertBlock( 'Cover' );
81
- // Create the block using uploaded image
81
+ // Create the block using uploaded image.
82
82
  await upload( '.wp-block-cover' );
83
- // Get the block's background dim color and its opacity
83
+ // Get the block's background dim color and its opacity.
84
84
  const backgroundDim = await page.waitForSelector(
85
85
  '.wp-block-cover .has-background-dim'
86
86
  );
@@ -98,17 +98,17 @@ describe( 'Cover', () => {
98
98
 
99
99
  it( 'can have the title edited', async () => {
100
100
  await insertBlock( 'Cover' );
101
- // Click first color option from the block placeholder's color picker
101
+ // Click first color option from the block placeholder's color picker.
102
102
  const colorPickerButton = await page.waitForSelector(
103
103
  '.wp-block-cover__placeholder-background-options .components-circular-option-picker__option-wrapper:first-child button'
104
104
  );
105
105
  await colorPickerButton.click();
106
- // Click the title placeholder to put the cursor inside
106
+ // Click the title placeholder to put the cursor inside.
107
107
  const coverTitle = await page.waitForSelector(
108
108
  '.wp-block-cover .wp-block-paragraph'
109
109
  );
110
110
  await coverTitle.click();
111
- // Type the title
111
+ // Type the title.
112
112
  await page.keyboard.type( 'foo' );
113
113
  const coverTitleText = await coverTitle.evaluate(
114
114
  ( el ) => el.innerText
@@ -119,9 +119,9 @@ describe( 'Cover', () => {
119
119
 
120
120
  it( 'can be resized using drag & drop', async () => {
121
121
  await insertBlock( 'Cover' );
122
- // Close the inserter
122
+ // Close the inserter.
123
123
  await page.click( '.edit-post-header-toolbar__inserter-toggle' );
124
- // Open the sidebar
124
+ // Open the sidebar.
125
125
  await openDocumentSettingsSidebar();
126
126
  // Choose the first solid color as the background of the cover.
127
127
  await page.click(
@@ -140,7 +140,7 @@ describe( 'Cover', () => {
140
140
  )
141
141
  )[ 0 ];
142
142
 
143
- // Verify the height of the cover is not defined
143
+ // Verify the height of the cover is not defined.
144
144
  expect(
145
145
  await page.evaluate( ( { value } ) => value, heightInput )
146
146
  ).toBeFalsy();
@@ -195,7 +195,7 @@ describe( 'Cover', () => {
195
195
 
196
196
  it( 'dims the background image down by 50% when transformed from the Image block', async () => {
197
197
  await insertBlock( 'Image' );
198
- // Upload image and transform to the Cover block
198
+ // Upload image and transform to the Cover block.
199
199
  const filename = await upload( '.wp-block-image' );
200
200
  await page.waitForSelector(
201
201
  `.wp-block-image img[src$="${ filename }.png"]`
@@ -206,7 +206,7 @@ describe( 'Cover', () => {
206
206
  await page.focus( '.wp-block-image' );
207
207
  await transformBlockTo( 'Cover' );
208
208
 
209
- // Get the block's background dim color and its opacity
209
+ // Get the block's background dim color and its opacity.
210
210
  const backgroundDim = await page.waitForSelector(
211
211
  '.wp-block-cover .has-background-dim'
212
212
  );
@@ -118,7 +118,7 @@ describe( 'List', () => {
118
118
  await page.keyboard.press( 'ArrowDown' );
119
119
  await page.keyboard.press( 'Backspace' );
120
120
 
121
- // Expect list to be deleted
121
+ // Expect list to be deleted.
122
122
  expect( await getEditedPostContent() ).toMatchSnapshot();
123
123
  } );
124
124