@wordpress/e2e-test-utils-playwright 0.3.2 → 0.5.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 +9 -2
- package/build/admin/create-new-post.js.map +1 -1
- package/build/editor/site-editor.js +3 -5
- package/build/editor/site-editor.js.map +1 -1
- package/build/request-utils/posts.js.map +1 -1
- package/build-types/admin/create-new-post.d.ts +3 -1
- package/build-types/admin/create-new-post.d.ts.map +1 -1
- package/build-types/editor/site-editor.d.ts.map +1 -1
- package/build-types/request-utils/posts.d.ts +1 -0
- package/build-types/request-utils/posts.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -15,8 +15,9 @@ 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.
|
|
18
19
|
*/
|
|
19
|
-
async function createNewPost({ postType, title, content, excerpt, showWelcomeGuide = false, } = {}) {
|
|
20
|
+
async function createNewPost({ postType, title, content, excerpt, showWelcomeGuide = false, legacyCanvas = false, } = {}) {
|
|
20
21
|
const query = (0, url_1.addQueryArgs)('', {
|
|
21
22
|
post_type: postType,
|
|
22
23
|
post_title: title,
|
|
@@ -24,7 +25,13 @@ async function createNewPost({ postType, title, content, excerpt, showWelcomeGui
|
|
|
24
25
|
excerpt,
|
|
25
26
|
}).slice(1);
|
|
26
27
|
await this.visitAdminPage('post-new.php', query);
|
|
27
|
-
|
|
28
|
+
const canvasReadyLocator = legacyCanvas
|
|
29
|
+
? this.page.locator('.edit-post-layout')
|
|
30
|
+
: this.page
|
|
31
|
+
.frameLocator('[name=editor-canvas]')
|
|
32
|
+
.locator('body > *')
|
|
33
|
+
.first();
|
|
34
|
+
await canvasReadyLocator.waitFor();
|
|
28
35
|
await this.page.evaluate((welcomeGuide) => {
|
|
29
36
|
window.wp.data
|
|
30
37
|
.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;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,aAAa,CAAE,EACpC,QAAQ,EACR,KAAK,EACL,OAAO,EACP,OAAO,EACP,gBAAgB,GAAG,KAAK,EACxB,YAAY,GAAG,KAAK,GACpB,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,MAAM,kBAAkB,GAAG,YAAY;QACtC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAE,mBAAmB,CAAE;QAC1C,CAAC,CAAC,IAAI,CAAC,IAAI;aACR,YAAY,CAAE,sBAAsB,CAAE;aACtC,OAAO,CAAE,UAAU,CAAE;aACrB,KAAK,EAAE,CAAC;IAEZ,MAAM,kBAAkB,CAAC,OAAO,EAAE,CAAC;IAEnC,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;AAnCD,sCAmCC"}
|
|
@@ -19,12 +19,10 @@ async function saveSiteEditorEntities() {
|
|
|
19
19
|
await savePanel
|
|
20
20
|
.getByRole('button', { name: 'Save', exact: true })
|
|
21
21
|
.click();
|
|
22
|
-
// A role selector cannot be used here because it needs to check that the `is-busy` class is not present.
|
|
23
22
|
await this.page
|
|
24
|
-
.
|
|
25
|
-
.
|
|
26
|
-
|
|
27
|
-
});
|
|
23
|
+
.getByRole('button', { name: 'Dismiss this notice' })
|
|
24
|
+
.getByText('Site updated.')
|
|
25
|
+
.waitFor();
|
|
28
26
|
}
|
|
29
27
|
exports.saveSiteEditorEntities = saveSiteEditorEntities;
|
|
30
28
|
//# sourceMappingURL=site-editor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-editor.js","sourceRoot":"","sources":["../../src/editor/site-editor.ts"],"names":[],"mappings":";;;AAKA;;;;GAIG;AACI,KAAK,UAAU,sBAAsB;IAC3C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAE,QAAQ,EAAE;QACnD,IAAI,EAAE,gBAAgB;KACtB,CAAE,CAAC;IACJ,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAE,CAAC;IAE1E,oCAAoC;IACpC,MAAM,YAAY;SAChB,SAAS,CAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAE;SACpD,KAAK,EAAE,CAAC;IAEV,4CAA4C;IAC5C,MAAM,SAAS;SACb,SAAS,CAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAE;SACpD,KAAK,EAAE,CAAC;IAEV,
|
|
1
|
+
{"version":3,"file":"site-editor.js","sourceRoot":"","sources":["../../src/editor/site-editor.ts"],"names":[],"mappings":";;;AAKA;;;;GAIG;AACI,KAAK,UAAU,sBAAsB;IAC3C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAE,QAAQ,EAAE;QACnD,IAAI,EAAE,gBAAgB;KACtB,CAAE,CAAC;IACJ,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAE,CAAC;IAE1E,oCAAoC;IACpC,MAAM,YAAY;SAChB,SAAS,CAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAE;SACpD,KAAK,EAAE,CAAC;IAEV,4CAA4C;IAC5C,MAAM,SAAS;SACb,SAAS,CAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAE;SACpD,KAAK,EAAE,CAAC;IAEV,MAAM,IAAI,CAAC,IAAI;SACb,SAAS,CAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAE;SACtD,SAAS,CAAE,eAAe,CAAE;SAC5B,OAAO,EAAE,CAAC;AACb,CAAC;AApBD,wDAoBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/request-utils/posts.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/request-utils/posts.ts"],"names":[],"mappings":";;;AAoBA;;;;GAIG;AACI,KAAK,UAAU,cAAc;IACnC,kBAAkB;IAClB,uEAAuE;IACvE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAY;QACxC,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE;YACP,QAAQ,EAAE,GAAG;YACb,yBAAyB;YACzB,MAAM,EAAE,4CAA4C;SACpD;KACD,CAAE,CAAC;IAEJ,+BAA+B;IAC/B,0EAA0E;IAC1E,kDAAkD;IAClD,MAAM,OAAO,CAAC,GAAG,CAChB,KAAK,CAAC,GAAG,CAAE,CAAE,IAAI,EAAG,EAAE,CACrB,IAAI,CAAC,IAAI,CAAE;QACV,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,gBAAiB,IAAI,CAAC,EAAG,EAAE;QACjC,MAAM,EAAE;YACP,KAAK,EAAE,IAAI;SACX;KACD,CAAE,CACH,CACD,CAAC;AACH,CAAC;AA1BD,wCA0BC;AAED;;;;;GAKG;AACI,KAAK,UAAU,UAAU,CAE/B,OAA0B;IAE1B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAU;QACrC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE;KACtB,CAAE,CAAC;IAEJ,OAAO,IAAI,CAAC;AACb,CAAC;AAXD,gCAWC"}
|
|
@@ -8,12 +8,14 @@
|
|
|
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.
|
|
11
12
|
*/
|
|
12
|
-
export function createNewPost(this: any, { postType, title, content, excerpt, showWelcomeGuide, }?: {
|
|
13
|
+
export function createNewPost(this: any, { postType, title, content, excerpt, showWelcomeGuide, legacyCanvas, }?: {
|
|
13
14
|
postType?: string | undefined;
|
|
14
15
|
title?: string | undefined;
|
|
15
16
|
content?: string | undefined;
|
|
16
17
|
excerpt?: string | undefined;
|
|
17
18
|
showWelcomeGuide?: boolean | undefined;
|
|
19
|
+
legacyCanvas?: boolean | undefined;
|
|
18
20
|
}): Promise<void>;
|
|
19
21
|
//# 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;;;;;;;;;;;GAWG;AACH;IAP4B,QAAQ;IACR,KAAK;IACL,OAAO;IACP,OAAO;IACP,gBAAgB;IAChB,YAAY;kBAqCvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-editor.d.ts","sourceRoot":"","sources":["../../src/editor/site-editor.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"site-editor.d.ts","sourceRoot":"","sources":["../../src/editor/site-editor.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAE,IAAI,EAAE,MAAM,iBAoBzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../src/request-utils/posts.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,IAAI;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"posts.d.ts","sourceRoot":"","sources":["../../src/request-utils/posts.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,IAAI;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;IAC/D,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAE,IAAI,EAAE,YAAY,iBA0BvD;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAC/B,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,iBAAiB,iBAS1B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/e2e-test-utils-playwright",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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.34.0",
|
|
34
|
+
"@wordpress/keycodes": "^3.37.0",
|
|
35
|
+
"@wordpress/url": "^3.38.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": "bcd13d59b22553b3c9dc5869077bff1e864cf9f5"
|
|
47
47
|
}
|