@wordpress/e2e-tests 4.3.0 → 4.6.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 (52) hide show
  1. package/config/flaky-tests-reporter.js +3 -3
  2. package/package.json +6 -6
  3. package/specs/editor/blocks/cover.test.js +10 -14
  4. package/specs/editor/blocks/heading.test.js +1 -5
  5. package/specs/editor/blocks/navigation.test.js +72 -23
  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-inline-styles.test.js +1 -0
  9. package/specs/editor/plugins/iframed-masonry-block.test.js +3 -2
  10. package/specs/editor/plugins/inner-blocks-allowed-blocks.test.js +3 -1
  11. package/specs/editor/various/__snapshots__/inserting-blocks.test.js.snap +1 -1
  12. package/specs/editor/various/datepicker.test.js +30 -18
  13. package/specs/editor/various/embedding.test.js +2 -4
  14. package/specs/editor/various/links.test.js +2 -3
  15. package/specs/editor/various/navigable-toolbar.test.js +2 -3
  16. package/specs/editor/various/post-visibility.test.js +1 -1
  17. package/specs/editor/various/publishing.test.js +4 -2
  18. package/specs/editor/various/scheduling.test.js +2 -2
  19. package/specs/editor/various/sidebar.test.js +4 -6
  20. package/specs/editor/various/switch-to-draft.test.js +1 -1
  21. package/specs/editor/various/taxonomies.test.js +8 -7
  22. package/specs/editor/various/writing-flow.test.js +19 -0
  23. package/specs/experiments/navigation-editor.test.js +4 -6
  24. package/specs/performance/post-editor.test.js +10 -14
  25. package/specs/performance/site-editor.test.js +2 -5
  26. package/specs/widgets/editing-widgets.test.js +12 -8
  27. package/specs/editor/blocks/__snapshots__/buttons.test.js.snap +0 -33
  28. package/specs/editor/blocks/__snapshots__/code.test.js.snap +0 -14
  29. package/specs/editor/blocks/__snapshots__/html.test.js.snap +0 -8
  30. package/specs/editor/blocks/__snapshots__/preformatted.test.js.snap +0 -24
  31. package/specs/editor/blocks/__snapshots__/separator.test.js.snap +0 -7
  32. package/specs/editor/blocks/__snapshots__/spacer.test.js.snap +0 -13
  33. package/specs/editor/blocks/__snapshots__/table.test.js.snap +0 -61
  34. package/specs/editor/blocks/buttons.test.js +0 -95
  35. package/specs/editor/blocks/code.test.js +0 -48
  36. package/specs/editor/blocks/html.test.js +0 -31
  37. package/specs/editor/blocks/preformatted.test.js +0 -62
  38. package/specs/editor/blocks/separator.test.js +0 -22
  39. package/specs/editor/blocks/spacer.test.js +0 -48
  40. package/specs/editor/blocks/table.test.js +0 -296
  41. package/specs/editor/various/__snapshots__/rtl.test.js.snap +0 -63
  42. package/specs/editor/various/preview.test.js +0 -425
  43. package/specs/editor/various/rtl.test.js +0 -129
  44. package/specs/site-editor/style-variations.test.js +0 -213
  45. package/specs/site-editor/template-part.test.js +0 -346
  46. package/specs/site-editor/template-revert.test.js +0 -209
  47. package/themes/style-variations/block-templates/index.html +0 -11
  48. package/themes/style-variations/index.php +0 -0
  49. package/themes/style-variations/style.css +0 -15
  50. package/themes/style-variations/styles/pink.json +0 -33
  51. package/themes/style-variations/styles/yellow.json +0 -12
  52. package/themes/style-variations/theme.json +0 -8
@@ -1,209 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import {
5
- insertBlock,
6
- activateTheme,
7
- deleteAllTemplates,
8
- visitSiteEditor,
9
- getCurrentSiteEditorContent,
10
- } from '@wordpress/e2e-test-utils';
11
-
12
- const assertSaveButtonIsDisabled = async () =>
13
- page.waitForSelector(
14
- '.edit-site-save-button__button[aria-disabled="true"]'
15
- );
16
-
17
- const assertSaveButtonIsEnabled = async () =>
18
- page.waitForSelector(
19
- '.edit-site-save-button__button[aria-disabled="false"]'
20
- );
21
-
22
- const clickButtonInNotice = async () => {
23
- const selector = '.components-snackbar button';
24
- await page.waitForSelector( selector );
25
- await page.click( selector );
26
- };
27
-
28
- const clickUndoInHeaderToolbar = async () =>
29
- page.click( '.edit-site-header__toolbar button[aria-label="Undo"]' );
30
-
31
- const clickRedoInHeaderToolbar = async () => {
32
- await page.waitForSelector(
33
- '.edit-site-header__toolbar button[aria-label="Redo"][aria-disabled="false"]'
34
- );
35
- return page.click( '.edit-site-header__toolbar button[aria-label="Redo"]' );
36
- };
37
-
38
- const undoRevertInHeaderToolbar = async () => {
39
- await clickUndoInHeaderToolbar();
40
- await assertSaveButtonIsEnabled();
41
- };
42
-
43
- const undoRevertInNotice = async () => {
44
- await clickButtonInNotice();
45
- await assertSaveButtonIsEnabled();
46
- };
47
-
48
- const addDummyText = async () => {
49
- await insertBlock( 'Paragraph' );
50
- await page.keyboard.type( 'Test' );
51
- };
52
-
53
- const save = async () => {
54
- await page.click( '.edit-site-save-button__button' );
55
- await page.click( '.editor-entities-saved-states__save-button' );
56
- await page.waitForSelector(
57
- '.edit-site-save-button__button:not(.is-busy)'
58
- );
59
- };
60
-
61
- const revertTemplate = async () => {
62
- await page.click( '.edit-site-document-actions__get-info' );
63
- await page.click( '.edit-site-template-details__revert-button' );
64
- await page.waitForXPath(
65
- '//*[contains(@class, "components-snackbar") and contains(text(), "Template reverted")]'
66
- );
67
- await assertSaveButtonIsEnabled();
68
- };
69
-
70
- describe( 'Template Revert', () => {
71
- beforeAll( async () => {
72
- await activateTheme( 'emptytheme' );
73
- await deleteAllTemplates( 'wp_template' );
74
- await deleteAllTemplates( 'wp_template_part' );
75
- } );
76
- afterAll( async () => {
77
- await deleteAllTemplates( 'wp_template' );
78
- await deleteAllTemplates( 'wp_template_part' );
79
- await activateTheme( 'twentytwentyone' );
80
- } );
81
- beforeEach( async () => {
82
- await deleteAllTemplates( 'wp_template' );
83
- await visitSiteEditor();
84
- } );
85
-
86
- it( 'should delete the template after saving the reverted template', async () => {
87
- await addDummyText();
88
- await save();
89
- await revertTemplate();
90
- await save();
91
-
92
- await page.click( '.edit-site-document-actions__get-info' );
93
-
94
- // The revert button isn't visible anymore.
95
- expect(
96
- await page.$( '.edit-site-template-details__revert-button' )
97
- ).toBeNull();
98
- } );
99
-
100
- it( 'should show the original content after revert', async () => {
101
- const contentBefore = await getCurrentSiteEditorContent();
102
-
103
- await addDummyText();
104
- await save();
105
- await revertTemplate();
106
- await save();
107
-
108
- const contentAfter = await getCurrentSiteEditorContent();
109
- expect( contentBefore ).toBe( contentAfter );
110
- } );
111
-
112
- it( 'should show the original content after revert and page reload', async () => {
113
- const contentBefore = await getCurrentSiteEditorContent();
114
-
115
- await addDummyText();
116
- await save();
117
- await revertTemplate();
118
- await save();
119
- await visitSiteEditor();
120
-
121
- const contentAfter = await getCurrentSiteEditorContent();
122
- expect( contentBefore ).toBe( contentAfter );
123
- } );
124
-
125
- it( 'should show the edited content after revert and clicking undo in the header toolbar', async () => {
126
- await addDummyText();
127
- await save();
128
- const contentBefore = await getCurrentSiteEditorContent();
129
-
130
- await revertTemplate();
131
- await save();
132
- await undoRevertInHeaderToolbar();
133
-
134
- const contentAfter = await getCurrentSiteEditorContent();
135
- expect( contentBefore ).toBe( contentAfter );
136
- } );
137
-
138
- it( 'should show the edited content after revert and clicking undo in the notice', async () => {
139
- await addDummyText();
140
- await save();
141
- const contentBefore = await getCurrentSiteEditorContent();
142
-
143
- await revertTemplate();
144
- await save();
145
- await undoRevertInNotice();
146
-
147
- const contentAfter = await getCurrentSiteEditorContent();
148
- expect( contentBefore ).toBe( contentAfter );
149
- } );
150
-
151
- it( 'should show the original content after revert, clicking undo then redo in the header toolbar', async () => {
152
- const contentBefore = await getCurrentSiteEditorContent();
153
-
154
- await addDummyText();
155
- await save();
156
- await revertTemplate();
157
- await save();
158
- await undoRevertInHeaderToolbar();
159
- await clickRedoInHeaderToolbar();
160
-
161
- const contentAfter = await getCurrentSiteEditorContent();
162
- expect( contentBefore ).toBe( contentAfter );
163
- } );
164
-
165
- it( 'should show the original content after revert, clicking undo in the notice then undo in the header toolbar', async () => {
166
- const contentBefore = await getCurrentSiteEditorContent();
167
-
168
- await addDummyText();
169
- await save();
170
- await revertTemplate();
171
- await save();
172
- await undoRevertInNotice();
173
- await undoRevertInHeaderToolbar();
174
-
175
- const contentAfter = await getCurrentSiteEditorContent();
176
- expect( contentBefore ).toBe( contentAfter );
177
- } );
178
-
179
- it( 'should show the edited content after revert, clicking undo in the header toolbar, save and reload', async () => {
180
- await addDummyText();
181
- await save();
182
- const contentBefore = await getCurrentSiteEditorContent();
183
-
184
- await revertTemplate();
185
- await save();
186
- await clickUndoInHeaderToolbar();
187
- await save();
188
- await assertSaveButtonIsDisabled();
189
- await visitSiteEditor();
190
-
191
- const contentAfter = await getCurrentSiteEditorContent();
192
- expect( contentBefore ).toBe( contentAfter );
193
- } );
194
-
195
- it( 'should show the edited content after revert, clicking undo in the notice and reload', async () => {
196
- await addDummyText();
197
- await save();
198
- const contentBefore = await getCurrentSiteEditorContent();
199
-
200
- await revertTemplate();
201
- await save();
202
- await undoRevertInNotice();
203
- await save();
204
- await visitSiteEditor();
205
-
206
- const contentAfter = await getCurrentSiteEditorContent();
207
- expect( contentBefore ).toBe( contentAfter );
208
- } );
209
- } );
@@ -1,11 +0,0 @@
1
- <!-- wp:query {"queryId":1,"query":{"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","sticky":""}} -->
2
- <div class="wp-block-query">
3
- <!-- wp:post-template -->
4
- <!-- wp:post-title {"isLink":true} /-->
5
- <!-- wp:post-excerpt /-->
6
- <!-- /wp:post-template -->
7
- </div>
8
- <!-- /wp:query -->
9
- <!-- wp:paragraph -->
10
- <p>My awesome paragraph</p>
11
- <!-- /wp:paragraph -->
File without changes
@@ -1,15 +0,0 @@
1
- /*
2
- Theme Name: Style variations
3
- Theme URI: https://github.com/wordpress/theme-experiments/
4
- Author: the WordPress team
5
- Description: Style variations test theme.
6
- Requires at least: 5.3
7
- Tested up to: 5.5
8
- Requires PHP: 5.6
9
- Version: 1.0
10
- License: GNU General Public License v2 or later
11
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
- Text Domain: style-variations
13
- Style variations WordPress Theme, (C) 2021 WordPress.org
14
- Style variations is distributed under the terms of the GNU GPL.
15
- */
@@ -1,33 +0,0 @@
1
- {
2
- "version": 2,
3
- "settings": {
4
- "color": {
5
- "palette": [
6
- {
7
- "slug": "foreground",
8
- "color": "#4a074a",
9
- "name": "Foreground"
10
- },
11
- {
12
- "slug": "background",
13
- "color": "#ca69d3",
14
- "name": "Background"
15
- },
16
- {
17
- "slug": "awesome-pink",
18
- "color": "#cc00ffc4",
19
- "name": "Awesome pink"
20
- }
21
- ]
22
- }
23
- },
24
- "styles": {
25
- "color": {
26
- "background": "var(--wp--preset--color--background)",
27
- "text": "var(--wp--preset--color--foreground)"
28
- },
29
- "typography": {
30
- "fontSize": "var(--wp--preset--font-size--medium)"
31
- }
32
- }
33
- }
@@ -1,12 +0,0 @@
1
- {
2
- "version": 2,
3
- "styles": {
4
- "color": {
5
- "background": "#ffef0b",
6
- "text": "#191911"
7
- },
8
- "typography": {
9
- "fontSize": "15px"
10
- }
11
- }
12
- }
@@ -1,8 +0,0 @@
1
- {
2
- "version": 2,
3
- "styles": {
4
- "color": {
5
- "background": "red"
6
- }
7
- }
8
- }