@wordpress/e2e-test-utils-playwright 0.8.0 → 0.9.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/build/admin/create-new-post.js +11 -7
- package/build/admin/create-new-post.js.map +1 -1
- package/build/admin/visit-site-editor.js +2 -2
- package/build/admin/visit-site-editor.js.map +1 -1
- package/build-types/admin/create-new-post.d.ts +1 -3
- package/build-types/admin/create-new-post.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -15,9 +15,8 @@ const url_1 = require("@wordpress/url");
|
|
|
15
15
|
* @param {string} [object.content] Content of the new post.
|
|
16
16
|
* @param {string} [object.excerpt] Excerpt of the new post.
|
|
17
17
|
* @param {boolean} [object.showWelcomeGuide] Whether to show the welcome guide.
|
|
18
|
-
* @param {boolean} [object.legacyCanvas] Whether the non-iframed editor canvas is awaited.
|
|
19
18
|
*/
|
|
20
|
-
async function createNewPost({ postType, title, content, excerpt, showWelcomeGuide = false,
|
|
19
|
+
async function createNewPost({ postType, title, content, excerpt, showWelcomeGuide = false, } = {}) {
|
|
21
20
|
const query = (0, url_1.addQueryArgs)('', {
|
|
22
21
|
post_type: postType,
|
|
23
22
|
post_title: title,
|
|
@@ -25,13 +24,18 @@ async function createNewPost({ postType, title, content, excerpt, showWelcomeGui
|
|
|
25
24
|
excerpt,
|
|
26
25
|
}).slice(1);
|
|
27
26
|
await this.visitAdminPage('post-new.php', query);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
// Wait for both iframed and non-iframed canvas and resolve once the
|
|
28
|
+
// currently available one is ready. To make this work, we need an inner
|
|
29
|
+
// legacy canvas selector that is unavailable directly when the canvas is
|
|
30
|
+
// iframed.
|
|
31
|
+
await Promise.any([
|
|
32
|
+
this.page.locator('.wp-block-post-content').waitFor(),
|
|
33
|
+
this.page
|
|
31
34
|
.frameLocator('[name=editor-canvas]')
|
|
32
35
|
.locator('body > *')
|
|
33
|
-
.first()
|
|
34
|
-
|
|
36
|
+
.first()
|
|
37
|
+
.waitFor(),
|
|
38
|
+
]);
|
|
35
39
|
await this.page.evaluate((welcomeGuide) => {
|
|
36
40
|
window.wp.data
|
|
37
41
|
.dispatch('core/preferences')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-post.js","sourceRoot":"","sources":["../../src/admin/create-new-post.js"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,wCAA8C;AAE9C
|
|
1
|
+
{"version":3,"file":"create-new-post.js","sourceRoot":"","sources":["../../src/admin/create-new-post.js"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,wCAA8C;AAE9C;;;;;;;;;;GAUG;AACI,KAAK,UAAU,aAAa,CAAE,EACpC,QAAQ,EACR,KAAK,EACL,OAAO,EACP,OAAO,EACP,gBAAgB,GAAG,KAAK,GACxB,GAAG,EAAE;IACL,MAAM,KAAK,GAAG,IAAA,kBAAY,EAAE,EAAE,EAAE;QAC/B,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,KAAK;QACjB,OAAO;QACP,OAAO;KACP,CAAE,CAAC,KAAK,CAAE,CAAC,CAAE,CAAC;IAEf,MAAM,IAAI,CAAC,cAAc,CAAE,cAAc,EAAE,KAAK,CAAE,CAAC;IAEnD,oEAAoE;IACpE,wEAAwE;IACxE,yEAAyE;IACzE,WAAW;IACX,MAAM,OAAO,CAAC,GAAG,CAAE;QAClB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAE,wBAAwB,CAAE,CAAC,OAAO,EAAE;QACvD,IAAI,CAAC,IAAI;aACP,YAAY,CAAE,sBAAsB,CAAE;aACtC,OAAO,CAAE,UAAU,CAAE;aACrB,KAAK,EAAE;aACP,OAAO,EAAE;KACX,CAAE,CAAC;IAEJ,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAE,YAAY,EAAG,EAAE;QAC5C,MAAM,CAAC,EAAE,CAAC,IAAI;aACZ,QAAQ,CAAE,kBAAkB,CAAE;aAC9B,GAAG,CAAE,gBAAgB,EAAE,cAAc,EAAE,YAAY,CAAE,CAAC;QAExD,MAAM,CAAC,EAAE,CAAC,IAAI;aACZ,QAAQ,CAAE,kBAAkB,CAAE;aAC9B,GAAG,CAAE,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,CAAE,CAAC;IACpD,CAAC,EAAE,gBAAgB,CAAE,CAAC;AACvB,CAAC;AAtCD,sCAsCC"}
|
|
@@ -43,9 +43,9 @@ async function visitSiteEditor(query, skipWelcomeGuide = true) {
|
|
|
43
43
|
.locator('body > *')
|
|
44
44
|
.first()
|
|
45
45
|
.waitFor();
|
|
46
|
-
// TODO: Ideally the content underneath the
|
|
46
|
+
// TODO: Ideally the content underneath the canvas loader should be marked inert until it's ready.
|
|
47
47
|
await this.page
|
|
48
|
-
.locator('.edit-site-canvas-
|
|
48
|
+
.locator('.edit-site-canvas-loader')
|
|
49
49
|
// Bigger timeout is needed for larger entities, for example the large
|
|
50
50
|
// post html fixture that we load for performance tests, which often
|
|
51
51
|
// doesn't make it under the default 10 seconds.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visit-site-editor.js","sourceRoot":"","sources":["../../src/admin/visit-site-editor.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,wCAA8C;AAY9C,MAAM,eAAe,GAAG,gCAAgC,CAAC;AAEzD;;;;;;;;GAQG;AACI,KAAK,UAAU,eAAe,CAEpC,KAA4B,EAC5B,gBAAgB,GAAG,IAAI;IAEvB,MAAM,IAAI,GAAG,IAAA,kBAAY,EAAE,EAAE,EAAE;QAC9B,GAAG,KAAK;KACR,CAAE,CAAC,KAAK,CAAE,CAAC,CAAE,CAAC;IAEf,MAAM,IAAI,CAAC,cAAc,CAAE,iBAAiB,EAAE,IAAI,CAAE,CAAC;IAErD,IAAK,gBAAgB,EAAG;QACvB,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAE,GAAG,EAAE;YAC9B,MAAM,CAAC,EAAE,CAAC,IAAI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,EAAE;YAC9B,MAAM,CAAC,EAAE,CAAC,IAAI;iBACZ,QAAQ,CAAE,kBAAkB,CAAE;iBAC9B,GAAG,CAAE,gBAAgB,EAAE,cAAc,EAAE,KAAK,CAAE,CAAC;YAEjD,MAAM,CAAC,EAAE,CAAC,IAAI;iBACZ,QAAQ,CAAE,kBAAkB,CAAE;iBAC9B,GAAG,CAAE,gBAAgB,EAAE,oBAAoB,EAAE,KAAK,CAAE,CAAC;YAEvD,MAAM,CAAC,EAAE,CAAC,IAAI;iBACZ,QAAQ,CAAE,kBAAkB,CAAE;iBAC9B,GAAG,CAAE,gBAAgB,EAAE,kBAAkB,EAAE,KAAK,CAAE,CAAC;YAErD,MAAM,CAAC,EAAE,CAAC,IAAI;iBACZ,QAAQ,CAAE,kBAAkB,CAAE;iBAC9B,GAAG,CAAE,gBAAgB,EAAE,sBAAsB,EAAE,KAAK,CAAE,CAAC;QAC1D,CAAC,CAAE,CAAC;KACJ;IAED,sDAAsD;IACtD,wDAAwD;IACxD,MAAM,IAAI,CAAC,IAAI;SACb,YAAY,CAAE,eAAe,CAAE;SAC/B,OAAO,CAAE,UAAU,CAAE;SACrB,KAAK,EAAE;SACP,OAAO,EAAE,CAAC;IAEZ,kGAAkG;IAClG,MAAM,IAAI,CAAC,IAAI;SACb,OAAO,CAAE,0BAA0B,CAAE;QACtC,sEAAsE;QACtE,oEAAoE;QACpE,gDAAgD;SAC/C,OAAO,CAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,CAAE,CAAC;AACnD,CAAC;AA9CD,0CA8CC"}
|
|
@@ -8,14 +8,12 @@
|
|
|
8
8
|
* @param {string} [object.content] Content of the new post.
|
|
9
9
|
* @param {string} [object.excerpt] Excerpt of the new post.
|
|
10
10
|
* @param {boolean} [object.showWelcomeGuide] Whether to show the welcome guide.
|
|
11
|
-
* @param {boolean} [object.legacyCanvas] Whether the non-iframed editor canvas is awaited.
|
|
12
11
|
*/
|
|
13
|
-
export function createNewPost(this: any, { postType, title, content, excerpt, showWelcomeGuide,
|
|
12
|
+
export function createNewPost(this: any, { postType, title, content, excerpt, showWelcomeGuide, }?: {
|
|
14
13
|
postType?: string | undefined;
|
|
15
14
|
title?: string | undefined;
|
|
16
15
|
content?: string | undefined;
|
|
17
16
|
excerpt?: string | undefined;
|
|
18
17
|
showWelcomeGuide?: boolean | undefined;
|
|
19
|
-
legacyCanvas?: boolean | undefined;
|
|
20
18
|
}): Promise<void>;
|
|
21
19
|
//# sourceMappingURL=create-new-post.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-new-post.d.ts","sourceRoot":"","sources":["../../src/admin/create-new-post.js"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"create-new-post.d.ts","sourceRoot":"","sources":["../../src/admin/create-new-post.js"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH;IAN4B,QAAQ;IACR,KAAK;IACL,OAAO;IACP,OAAO;IACP,gBAAgB;kBAwC3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/e2e-test-utils-playwright",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "End-To-End (E2E) test utils for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"main": "./build/index.js",
|
|
31
31
|
"types": "./build-types",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@wordpress/api-fetch": "^6.
|
|
34
|
-
"@wordpress/keycodes": "^3.
|
|
35
|
-
"@wordpress/url": "^3.
|
|
33
|
+
"@wordpress/api-fetch": "^6.38.0",
|
|
34
|
+
"@wordpress/keycodes": "^3.41.0",
|
|
35
|
+
"@wordpress/url": "^3.42.0",
|
|
36
36
|
"change-case": "^4.1.2",
|
|
37
37
|
"form-data": "^4.0.0",
|
|
38
38
|
"mime": "^3.0.0"
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "5eac1734bcdca2301fdd37ec8cfe2a45e722a2c4"
|
|
47
47
|
}
|