@wordpress/e2e-test-utils-playwright 0.21.0 → 0.23.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/editor/site-editor.js +8 -5
- package/build/editor/site-editor.js.map +1 -1
- package/build/request-utils/themes.js +8 -1
- package/build/request-utils/themes.js.map +1 -1
- package/build-types/editor/site-editor.d.ts +6 -1
- package/build-types/editor/site-editor.d.ts.map +1 -1
- package/build-types/request-utils/themes.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -5,8 +5,9 @@ exports.saveSiteEditorEntities = void 0;
|
|
|
5
5
|
* Save entities in the site editor. Assumes the editor is in a dirty state.
|
|
6
6
|
*
|
|
7
7
|
* @param this
|
|
8
|
+
* @param options
|
|
8
9
|
*/
|
|
9
|
-
async function saveSiteEditorEntities() {
|
|
10
|
+
async function saveSiteEditorEntities(options = {}) {
|
|
10
11
|
const editorTopBar = this.page.getByRole('region', {
|
|
11
12
|
name: 'Editor top bar',
|
|
12
13
|
});
|
|
@@ -15,10 +16,12 @@ async function saveSiteEditorEntities() {
|
|
|
15
16
|
await editorTopBar
|
|
16
17
|
.getByRole('button', { name: 'Save', exact: true })
|
|
17
18
|
.click();
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
if (!options.isOnlyCurrentEntityDirty) {
|
|
20
|
+
// Second Save button in the entities panel.
|
|
21
|
+
await savePanel
|
|
22
|
+
.getByRole('button', { name: 'Save', exact: true })
|
|
23
|
+
.click();
|
|
24
|
+
}
|
|
22
25
|
await this.page
|
|
23
26
|
.getByRole('button', { name: 'Dismiss this notice' })
|
|
24
27
|
.getByText('Site updated.')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"site-editor.js","sourceRoot":"","sources":["../../src/editor/site-editor.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"site-editor.js","sourceRoot":"","sources":["../../src/editor/site-editor.ts"],"names":[],"mappings":";;;AAUA;;;;;GAKG;AACI,KAAK,UAAU,sBAAsB,CAE3C,UAAmB,EAAE;IAErB,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,IAAK,CAAE,OAAO,CAAC,wBAAwB,EAAG;QACzC,4CAA4C;QAC5C,MAAM,SAAS;aACb,SAAS,CAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAE;aACpD,KAAK,EAAE,CAAC;KACV;IACD,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;AAxBD,wDAwBC"}
|
|
@@ -7,7 +7,14 @@ async function activateTheme(themeSlug) {
|
|
|
7
7
|
let response = await this.request.get(THEMES_URL);
|
|
8
8
|
const html = await response.text();
|
|
9
9
|
const optionalFolder = '([a-z0-9-]+%2F)?';
|
|
10
|
-
|
|
10
|
+
// The `optionalFolder` regex part matches paths with a folder,
|
|
11
|
+
// so it will return the first match, which might contain a folder.
|
|
12
|
+
// First try to honor the included theme slug, that is, without a folder.
|
|
13
|
+
let matchGroup = html.match(`action=activate&stylesheet=${encodeURIComponent(themeSlug)}&_wpnonce=[a-z0-9]+`);
|
|
14
|
+
// If the theme is not found, try to match the theme slug with a folder.
|
|
15
|
+
if (!matchGroup) {
|
|
16
|
+
matchGroup = html.match(`action=activate&stylesheet=${optionalFolder}${encodeURIComponent(themeSlug)}&_wpnonce=[a-z0-9]+`);
|
|
17
|
+
}
|
|
11
18
|
if (!matchGroup) {
|
|
12
19
|
if (html.includes(`data-slug="${themeSlug}"`)) {
|
|
13
20
|
// The theme is already activated.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../src/request-utils/themes.ts"],"names":[],"mappings":";;;AAIA,sCAAwC;AAExC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAE,qBAAqB,EAAE,oBAAW,CAAE,CAAC,IAAI,CAAC;AAEtE,KAAK,UAAU,aAAa,CAE3B,SAAiB;IAEjB,IAAI,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAE,UAAU,CAAE,CAAC;IACpD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,cAAc,GAAG,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../src/request-utils/themes.ts"],"names":[],"mappings":";;;AAIA,sCAAwC;AAExC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAE,qBAAqB,EAAE,oBAAW,CAAE,CAAC,IAAI,CAAC;AAEtE,KAAK,UAAU,aAAa,CAE3B,SAAiB;IAEjB,IAAI,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAE,UAAU,CAAE,CAAC;IACpD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,cAAc,GAAG,kBAAkB,CAAC;IAE1C,+DAA+D;IAC/D,mEAAmE;IACnE,yEAAyE;IACzE,IAAI,UAAU,GAAG,IAAI,CAAC,KAAK,CAC1B,kCAAmC,kBAAkB,CACpD,SAAS,CACR,yBAAyB,CAC3B,CAAC;IAEF,wEAAwE;IACxE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AAmB,CAAC;AAC5B,CAAC;AAuBA,8EAAiC;AArBlC;;;;;GAKG;AACH,KAAK,UAAU,6BAA6B,CAE3C,QAAyB;IAEzB,qCAAqC;IACrC,OAAO,MAAM,IAAI,CAAC,IAAI,CAAgC;QACrD,IAAI,EAAE,wBAAyB,QAAS,YAAY;QACpD,MAAM,EAAE;YACP,QAAQ,EAAE,GAAG;SACb;KACD,CAAE,CAAC;AACL,CAAC;AAKA,sEAA6B"}
|
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import type { Editor } from './index';
|
|
5
|
+
interface Options {
|
|
6
|
+
isOnlyCurrentEntityDirty?: boolean;
|
|
7
|
+
}
|
|
5
8
|
/**
|
|
6
9
|
* Save entities in the site editor. Assumes the editor is in a dirty state.
|
|
7
10
|
*
|
|
8
11
|
* @param this
|
|
12
|
+
* @param options
|
|
9
13
|
*/
|
|
10
|
-
export declare function saveSiteEditorEntities(this: Editor): Promise<void>;
|
|
14
|
+
export declare function saveSiteEditorEntities(this: Editor, options?: Options): Promise<void>;
|
|
15
|
+
export {};
|
|
11
16
|
//# sourceMappingURL=site-editor.d.ts.map
|
|
@@ -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
|
|
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,UAAU,OAAO;IAEhB,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC3C,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,OAAY,iBAsBrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/request-utils/themes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAK5C,iBAAe,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,GACf,OAAO,CAAE,IAAI,CAAE,
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/request-utils/themes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAK5C,iBAAe,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,GACf,OAAO,CAAE,IAAI,CAAE,CAuCjB;AAGD,iBAAe,iCAAiC,CAAE,IAAI,EAAE,YAAY,mBAwBnE;AAED;;;;;GAKG;AACH,iBAAe,6BAA6B,CAC3C,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,MAAM,GAAG,MAAM,qCASzB;AAED,OAAO,EACN,aAAa,EACb,iCAAiC,EACjC,6BAA6B,GAC7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/e2e-test-utils-playwright",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.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.52.0",
|
|
34
|
+
"@wordpress/keycodes": "^3.55.0",
|
|
35
|
+
"@wordpress/url": "^3.56.0",
|
|
36
36
|
"change-case": "^4.1.2",
|
|
37
37
|
"form-data": "^4.0.0",
|
|
38
38
|
"get-port": "^5.1.1",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "ac2b13783c28f959770cf029a797a712f59e1958"
|
|
50
50
|
}
|