@wordpress/e2e-test-utils-playwright 0.8.0 → 0.8.1
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.
|
@@ -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"}
|
|
@@ -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.8.
|
|
3
|
+
"version": "0.8.1",
|
|
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.37.
|
|
34
|
-
"@wordpress/keycodes": "^3.40.
|
|
35
|
-
"@wordpress/url": "^3.41.
|
|
33
|
+
"@wordpress/api-fetch": "^6.37.1",
|
|
34
|
+
"@wordpress/keycodes": "^3.40.1",
|
|
35
|
+
"@wordpress/url": "^3.41.1",
|
|
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": "bb1fbf87bb0f451744530fc6a85de2dff1263bed"
|
|
47
47
|
}
|