@wordpress/e2e-tests 7.15.1-next.f8d8eceb.0 → 7.16.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
+ ## 7.16.0 (2023-11-02)
6
+
5
7
  ## 7.15.0 (2023-10-18)
6
8
 
7
9
  ## 7.14.0 (2023-10-05)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-tests",
3
- "version": "7.15.1-next.f8d8eceb.0",
3
+ "version": "7.16.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": "^10.15.1-next.f8d8eceb.0",
27
- "@wordpress/jest-console": "^7.15.1-next.f8d8eceb.0",
28
- "@wordpress/jest-puppeteer-axe": "^6.15.1-next.f8d8eceb.0",
29
- "@wordpress/scripts": "^26.15.1-next.f8d8eceb.0",
30
- "@wordpress/url": "^3.45.1-next.f8d8eceb.0",
26
+ "@wordpress/e2e-test-utils": "^10.16.0",
27
+ "@wordpress/jest-console": "^7.16.0",
28
+ "@wordpress/jest-puppeteer-axe": "^6.16.0",
29
+ "@wordpress/scripts": "^26.16.0",
30
+ "@wordpress/url": "^3.46.0",
31
31
  "chalk": "^4.0.0",
32
32
  "expect-puppeteer": "^4.4.0",
33
33
  "filenamify": "^4.2.0",
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "8d8fd197e202b8104ffb1cb83048efd0a6c3faf4"
48
+ "gitHead": "2a00e87b57b9c27ed2b9b0fd8d423ef3cada72c1"
49
49
  }
@@ -54,7 +54,7 @@ function gutenberg_test_register_context_blocks() {
54
54
  $block->context['postType'],
55
55
  );
56
56
 
57
- return implode( ',', $ordered_context );
57
+ return '<p>' . implode( ',', $ordered_context ) . '</p>';
58
58
  },
59
59
  'editor_script_handles' => array( 'gutenberg-test-block-context' ),
60
60
  )
@@ -1,84 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import {
5
- activatePlugin,
6
- createNewPost,
7
- deactivatePlugin,
8
- insertBlock,
9
- saveDraft,
10
- openPreviewPage,
11
- } from '@wordpress/e2e-test-utils';
12
-
13
- describe( 'Block context', () => {
14
- beforeAll( async () => {
15
- await activatePlugin( 'gutenberg-test-block-context' );
16
- } );
17
-
18
- beforeEach( async () => {
19
- await createNewPost();
20
- } );
21
-
22
- afterAll( async () => {
23
- await deactivatePlugin( 'gutenberg-test-block-context' );
24
- } );
25
-
26
- test( 'Block context propagates to inner blocks', async () => {
27
- await insertBlock( 'Test Context Provider' );
28
-
29
- // Inserting the context provider block should select the first inner
30
- // block of the template. Verify the contents of the consumer.
31
- let innerBlockText = await page.evaluate(
32
- () => document.activeElement.textContent
33
- );
34
- expect( innerBlockText ).toBe( 'The record ID is: 0' );
35
-
36
- // Change the attribute value associated with the context.
37
- await page.keyboard.press( 'ArrowUp' );
38
- await page.keyboard.type( '123' );
39
-
40
- // Verify propagated context changes.
41
- await page.keyboard.press( 'ArrowDown' );
42
- innerBlockText = await page.evaluate(
43
- () => document.activeElement.textContent
44
- );
45
- expect( innerBlockText ).toBe( 'The record ID is: 123' );
46
- } );
47
-
48
- test( 'Block context is reflected in the preview', async () => {
49
- await insertBlock( 'Test Context Provider' );
50
- const editorPage = page;
51
- const previewPage = await openPreviewPage( editorPage );
52
- await previewPage.waitForSelector( '.entry-content' );
53
-
54
- // Check default context values are populated.
55
- let content = await previewPage.$eval(
56
- '.entry-content',
57
- ( contentWrapper ) => contentWrapper.textContent.trim()
58
- );
59
- expect( content ).toMatch( /^0,\d+,post$/ );
60
-
61
- // Return to editor to change context value to non-default.
62
- await editorPage.bringToFront();
63
- await editorPage.focus(
64
- '[data-type="gutenberg/test-context-provider"] input'
65
- );
66
- await editorPage.keyboard.press( 'ArrowRight' );
67
- await editorPage.keyboard.type( '123' );
68
- await editorPage.waitForSelector( '.editor-post-save-draft' ); // Not entirely clear why it's asynchronous, but likely React scheduling prioritizing keyboard event and deferring the UI update.
69
- await saveDraft();
70
-
71
- // Check non-default context values are populated.
72
- await previewPage.bringToFront();
73
- await previewPage.reload();
74
- content = await previewPage.$eval(
75
- '.entry-content',
76
- ( contentWrapper ) => contentWrapper.textContent.trim()
77
- );
78
- expect( content ).toMatch( /^123,\d+,post$/ );
79
-
80
- // Clean up.
81
- await editorPage.bringToFront();
82
- await previewPage.close();
83
- } );
84
- } );