@wordpress/e2e-tests 4.4.0 → 4.7.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 (49) hide show
  1. package/config/flaky-tests-reporter.js +2 -3
  2. package/package.json +6 -6
  3. package/specs/editor/blocks/cover.test.js +10 -14
  4. package/specs/editor/blocks/gallery.test.js +1 -1
  5. package/specs/editor/blocks/navigation.test.js +15 -50
  6. package/specs/editor/plugins/cpt-locking.test.js +2 -3
  7. package/specs/editor/plugins/iframed-block.test.js +3 -2
  8. package/specs/editor/plugins/iframed-masonry-block.test.js +3 -2
  9. package/specs/editor/plugins/inner-blocks-allowed-blocks.test.js +3 -1
  10. package/specs/editor/plugins/meta-boxes.test.js +1 -1
  11. package/specs/editor/various/compatibility-classic-editor.test.js +1 -1
  12. package/specs/editor/various/datepicker.test.js +12 -12
  13. package/specs/editor/various/embedding.test.js +2 -4
  14. package/specs/editor/various/links.test.js +5 -6
  15. package/specs/editor/various/multi-block-selection.test.js +0 -2
  16. package/specs/editor/various/navigable-toolbar.test.js +2 -3
  17. package/specs/editor/various/post-visibility.test.js +4 -4
  18. package/specs/editor/various/publishing.test.js +4 -2
  19. package/specs/editor/various/scheduling.test.js +2 -2
  20. package/specs/editor/various/{sidebar-permalink-panel.test.js → sidebar-permalink.test.js} +9 -19
  21. package/specs/editor/various/sidebar.test.js +4 -6
  22. package/specs/editor/various/taxonomies.test.js +8 -7
  23. package/specs/editor/various/typewriter.test.js +2 -2
  24. package/specs/experiments/navigation-editor.test.js +4 -6
  25. package/specs/performance/post-editor.test.js +10 -14
  26. package/specs/performance/site-editor.test.js +2 -5
  27. package/specs/widgets/editing-widgets.test.js +12 -8
  28. package/specs/editor/blocks/__snapshots__/buttons.test.js.snap +0 -33
  29. package/specs/editor/blocks/__snapshots__/list.test.js.snap +0 -337
  30. package/specs/editor/blocks/__snapshots__/spacer.test.js.snap +0 -13
  31. package/specs/editor/blocks/__snapshots__/table.test.js.snap +0 -61
  32. package/specs/editor/blocks/buttons.test.js +0 -95
  33. package/specs/editor/blocks/comments.test.js +0 -131
  34. package/specs/editor/blocks/list.test.js +0 -542
  35. package/specs/editor/blocks/spacer.test.js +0 -48
  36. package/specs/editor/blocks/table.test.js +0 -296
  37. package/specs/editor/plugins/__snapshots__/format-api.test.js.snap +0 -7
  38. package/specs/editor/plugins/format-api.test.js +0 -36
  39. package/specs/editor/various/__snapshots__/rtl.test.js.snap +0 -63
  40. package/specs/editor/various/block-mover.test.js +0 -42
  41. package/specs/editor/various/preview.test.js +0 -425
  42. package/specs/editor/various/rtl.test.js +0 -129
  43. package/specs/site-editor/style-variations.test.js +0 -213
  44. package/themes/style-variations/block-templates/index.html +0 -11
  45. package/themes/style-variations/index.php +0 -0
  46. package/themes/style-variations/style.css +0 -15
  47. package/themes/style-variations/styles/pink.json +0 -33
  48. package/themes/style-variations/styles/yellow.json +0 -12
  49. package/themes/style-variations/theme.json +0 -8
@@ -1,95 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import {
5
- insertBlock,
6
- getEditedPostContent,
7
- createNewPost,
8
- pressKeyWithModifier,
9
- clickBlockAppender,
10
- } from '@wordpress/e2e-test-utils';
11
-
12
- describe( 'Buttons', () => {
13
- beforeEach( async () => {
14
- await createNewPost();
15
- } );
16
-
17
- it( 'has focus on button content', async () => {
18
- await insertBlock( 'Buttons' );
19
- await page.keyboard.type( 'Content' );
20
-
21
- expect( await getEditedPostContent() ).toMatchSnapshot();
22
- } );
23
-
24
- it( 'has focus on button content (slash inserter)', async () => {
25
- await clickBlockAppender();
26
- await page.keyboard.type( '/buttons' );
27
- await page.keyboard.press( 'Enter' );
28
- await page.keyboard.type( 'Content' );
29
-
30
- expect( await getEditedPostContent() ).toMatchSnapshot();
31
- } );
32
-
33
- it( 'dismisses link editor when escape is pressed', async () => {
34
- // Regression: https://github.com/WordPress/gutenberg/pull/19885
35
- await insertBlock( 'Buttons' );
36
- await pressKeyWithModifier( 'primary', 'k' );
37
- await page.waitForFunction(
38
- () => !! document.activeElement.closest( '.block-editor-url-input' )
39
- );
40
- await page.keyboard.press( 'Escape' );
41
- await page.waitForFunction(
42
- () =>
43
- document.activeElement ===
44
- document.querySelector( '.block-editor-rich-text__editable' )
45
- );
46
- await page.keyboard.type( 'WordPress' );
47
-
48
- expect( await getEditedPostContent() ).toMatchSnapshot();
49
- } );
50
-
51
- it( 'moves focus from the link editor back to the button when escape is pressed after the URL has been submitted', async () => {
52
- // Regression: https://github.com/WordPress/gutenberg/issues/34307
53
- await insertBlock( 'Buttons' );
54
- await pressKeyWithModifier( 'primary', 'k' );
55
- await page.waitForFunction(
56
- () => !! document.activeElement.closest( '.block-editor-url-input' )
57
- );
58
- await page.keyboard.type( 'https://example.com' );
59
- await page.keyboard.press( 'Enter' );
60
- await page.waitForFunction(
61
- () =>
62
- document.activeElement ===
63
- document.querySelector(
64
- '.block-editor-link-control a[href="https://example.com"]'
65
- )
66
- );
67
- await page.keyboard.press( 'Escape' );
68
-
69
- // Focus should move from the link control to the button block's text.
70
- await page.waitForFunction(
71
- () =>
72
- document.activeElement ===
73
- document.querySelector( '[aria-label="Button text"]' )
74
- );
75
-
76
- // The link control should still be visible when a URL is set.
77
- const linkControl = await page.$( '.block-editor-link-control' );
78
- expect( linkControl ).toBeTruthy();
79
- } );
80
-
81
- it( 'can jump to the link editor using the keyboard shortcut', async () => {
82
- await insertBlock( 'Buttons' );
83
- await page.keyboard.type( 'WordPress' );
84
- await pressKeyWithModifier( 'primary', 'k' );
85
- await page.keyboard.type( 'https://www.wordpress.org/' );
86
- await page.keyboard.press( 'Enter' );
87
- // Make sure that the dialog is still opened, and that focus is retained
88
- // within (focusing on the link preview).
89
- await page.waitForSelector(
90
- ':focus.block-editor-link-control__search-item-title'
91
- );
92
-
93
- expect( await getEditedPostContent() ).toMatchSnapshot();
94
- } );
95
- } );
@@ -1,131 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import {
5
- activateTheme,
6
- createNewPost,
7
- insertBlock,
8
- pressKeyTimes,
9
- publishPost,
10
- setOption,
11
- trashAllComments,
12
- } from '@wordpress/e2e-test-utils';
13
-
14
- describe( 'Comments', () => {
15
- let previousPageComments,
16
- previousCommentsPerPage,
17
- previousDefaultCommentsPage;
18
- beforeAll( async () => {
19
- await activateTheme( 'emptytheme' );
20
- previousPageComments = await setOption( 'page_comments', '1' );
21
- previousCommentsPerPage = await setOption( 'comments_per_page', '1' );
22
- previousDefaultCommentsPage = await setOption(
23
- 'default_comments_page',
24
- 'newest'
25
- );
26
- } );
27
- it( 'We show no results message if there are no comments', async () => {
28
- await trashAllComments();
29
- await createNewPost();
30
- await insertBlock( 'Comments' );
31
- await page.waitForXPath( '//p[contains(text(), "No results found.")]' );
32
- } );
33
- it( 'Pagination links are working as expected', async () => {
34
- await createNewPost();
35
- await insertBlock( 'Comments' );
36
- await publishPost();
37
- // Visit the post that was just published.
38
- await page.click(
39
- '.post-publish-panel__postpublish-buttons .is-primary'
40
- );
41
-
42
- // TODO: We can extract this into a util once we find we need it elsewhere.
43
- // Create three comments for that post.
44
- for ( let i = 0; i < 3; i++ ) {
45
- await page.waitForSelector( 'textarea#comment' );
46
- await page.click( 'textarea#comment' );
47
- await page.type(
48
- `textarea#comment`,
49
- `This is an automated comment - ${ i }`
50
- );
51
- await pressKeyTimes( 'Tab', 1 );
52
- await Promise.all( [
53
- page.keyboard.press( 'Enter' ),
54
- page.waitForNavigation( { waitUntil: 'networkidle0' } ),
55
- ] );
56
- }
57
-
58
- // We check that there is a previous comments page link.
59
- expect(
60
- await page.$( '.wp-block-comments-pagination-previous' )
61
- ).not.toBeNull();
62
- expect(
63
- await page.$( '.wp-block-comments-pagination-next' )
64
- ).toBeNull();
65
-
66
- await Promise.all( [
67
- page.click( '.wp-block-comments-pagination-previous' ),
68
- page.waitForNavigation( { waitUntil: 'networkidle0' } ),
69
- ] );
70
-
71
- // We check that there are a previous and a next link.
72
- expect(
73
- await page.$( '.wp-block-comments-pagination-previous' )
74
- ).not.toBeNull();
75
- expect(
76
- await page.$( '.wp-block-comments-pagination-next' )
77
- ).not.toBeNull();
78
-
79
- await Promise.all( [
80
- page.click( '.wp-block-comments-pagination-previous' ),
81
- page.waitForNavigation( { waitUntil: 'networkidle0' } ),
82
- ] );
83
-
84
- // We check that there is only have a next link
85
- expect(
86
- await page.$( '.wp-block-comments-pagination-previous' )
87
- ).toBeNull();
88
- expect(
89
- await page.$( '.wp-block-comments-pagination-next' )
90
- ).not.toBeNull();
91
- } );
92
- it( 'Pagination links are not appearing if break comments is not enabled', async () => {
93
- await setOption( 'page_comments', '0' );
94
- await createNewPost();
95
- await insertBlock( 'Comments' );
96
- await publishPost();
97
- // Visit the post that was just published.
98
- await page.click(
99
- '.post-publish-panel__postpublish-buttons .is-primary'
100
- );
101
-
102
- // Create three comments for that post.
103
- for ( let i = 0; i < 3; i++ ) {
104
- await page.waitForSelector( 'textarea#comment' );
105
- await page.click( 'textarea#comment' );
106
- await page.type(
107
- `textarea#comment`,
108
- `This is an automated comment - ${ i }`
109
- );
110
- await pressKeyTimes( 'Tab', 1 );
111
- await Promise.all( [
112
- page.keyboard.press( 'Enter' ),
113
- page.waitForNavigation( { waitUntil: 'networkidle0' } ),
114
- ] );
115
- }
116
- // We check that there are no comments page link.
117
- expect(
118
- await page.$( '.wp-block-comments-pagination-previous' )
119
- ).toBeNull();
120
- expect(
121
- await page.$( '.wp-block-comments-pagination-next' )
122
- ).toBeNull();
123
- } );
124
- afterAll( async () => {
125
- await trashAllComments();
126
- await activateTheme( 'twentytwentyone' );
127
- await setOption( 'page_comments', previousPageComments );
128
- await setOption( 'comments_per_page', previousCommentsPerPage );
129
- await setOption( 'default_comments_page', previousDefaultCommentsPage );
130
- } );
131
- } );