@wordpress/e2e-test-utils-playwright 0.3.0 → 0.3.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.
@@ -25,25 +25,14 @@ async function createNewPost({ postType, title, content, excerpt, showWelcomeGui
25
25
  }).slice(1);
26
26
  await this.visitAdminPage('post-new.php', query);
27
27
  await this.page.waitForSelector('.edit-post-layout');
28
- const isWelcomeGuideActive = await this.page.evaluate(() => window.wp.data
29
- .select('core/edit-post')
30
- .isFeatureActive('welcomeGuide'));
31
- const isFullscreenMode = await this.page.evaluate(() => window.wp.data
32
- .select('core/edit-post')
33
- .isFeatureActive('fullscreenMode'));
34
- if (showWelcomeGuide !== isWelcomeGuideActive) {
35
- await this.page.evaluate(() => window.wp.data
36
- .dispatch('core/edit-post')
37
- .toggleFeature('welcomeGuide'));
38
- await this.page.reload();
39
- await this.page.waitForSelector('.edit-post-layout');
40
- }
41
- if (isFullscreenMode) {
42
- await this.page.evaluate(() => window.wp.data
43
- .dispatch('core/edit-post')
44
- .toggleFeature('fullscreenMode'));
45
- await this.page.waitForSelector('body:not(.is-fullscreen-mode)');
46
- }
28
+ await this.page.evaluate((welcomeGuide) => {
29
+ window.wp.data
30
+ .dispatch('core/preferences')
31
+ .set('core/edit-post', 'welcomeGuide', welcomeGuide);
32
+ window.wp.data
33
+ .dispatch('core/preferences')
34
+ .set('core/edit-post', 'fullscreenMode', false);
35
+ }, showWelcomeGuide);
47
36
  }
48
37
  exports.createNewPost = createNewPost;
49
38
  //# sourceMappingURL=create-new-post.js.map
@@ -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;;;;;;;;;;GAUG;AACI,KAAK,UAAU,aAAa,CAAE,EACpC,QAAQ,EACR,KAAK,EACL,OAAO,EACP,OAAO,EACP,gBAAgB,GAAG,KAAK,GACxB,GAAG,EAAE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,CAAE,CACnC,CAAC;QAEF,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAE,+BAA+B,CAAE,CAAC;KACnE;AACF,CAAC;AAjDD,sCAiDC"}
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;IACnD,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAE,mBAAmB,CAAE,CAAC;IAEvD,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;AA1BD,sCA0BC"}
@@ -9,11 +9,9 @@ exports.setIsFixedToolbar = void 0;
9
9
  */
10
10
  async function setIsFixedToolbar(isFixed) {
11
11
  await this.page.evaluate((_isFixed) => {
12
- const { select, dispatch } = window.wp.data;
13
- const isCurrentlyFixed = select('core/edit-post').isFeatureActive('fixedToolbar');
14
- if (isCurrentlyFixed !== _isFixed) {
15
- dispatch('core/edit-post').toggleFeature('fixedToolbar');
16
- }
12
+ window.wp.data
13
+ .dispatch('core/preferences')
14
+ .set('core/edit-post', 'fixedToolbar', _isFixed);
17
15
  }, isFixed);
18
16
  }
19
17
  exports.setIsFixedToolbar = setIsFixedToolbar;
@@ -1 +1 @@
1
- {"version":3,"file":"set-is-fixed-toolbar.js","sourceRoot":"","sources":["../../src/editor/set-is-fixed-toolbar.ts"],"names":[],"mappings":";;;AAKA;;;;;GAKG;AACI,KAAK,UAAU,iBAAiB,CAAgB,OAAgB;IACtE,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAE,QAAQ,EAAG,EAAE;QACxC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;QAC5C,MAAM,gBAAgB,GACrB,MAAM,CAAE,gBAAgB,CAAE,CAAC,eAAe,CAAE,cAAc,CAAE,CAAC;QAC9D,IAAK,gBAAgB,KAAK,QAAQ,EAAG;YACpC,QAAQ,CAAE,gBAAgB,CAAE,CAAC,aAAa,CAAE,cAAc,CAAE,CAAC;SAC7D;IACF,CAAC,EAAE,OAAO,CAAE,CAAC;AACd,CAAC;AATD,8CASC"}
1
+ {"version":3,"file":"set-is-fixed-toolbar.js","sourceRoot":"","sources":["../../src/editor/set-is-fixed-toolbar.ts"],"names":[],"mappings":";;;AAKA;;;;;GAKG;AACI,KAAK,UAAU,iBAAiB,CAAgB,OAAgB;IACtE,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAE,QAAQ,EAAG,EAAE;QACxC,MAAM,CAAC,EAAE,CAAC,IAAI;aACZ,QAAQ,CAAE,kBAAkB,CAAE;aAC9B,GAAG,CAAE,gBAAgB,EAAE,cAAc,EAAE,QAAQ,CAAE,CAAC;IACrD,CAAC,EAAE,OAAO,CAAE,CAAC;AACd,CAAC;AAND,8CAMC"}
@@ -1 +1 @@
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;kBAmD3C"}
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;kBA4B3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"set-is-fixed-toolbar.d.ts","sourceRoot":"","sources":["../../src/editor/set-is-fixed-toolbar.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,iBAStE"}
1
+ {"version":3,"file":"set-is-fixed-toolbar.d.ts","sourceRoot":"","sources":["../../src/editor/set-is-fixed-toolbar.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,iBAMtE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/e2e-test-utils-playwright",
3
- "version": "0.3.0",
3
+ "version": "0.3.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.32.0",
34
- "@wordpress/keycodes": "^3.35.0",
35
- "@wordpress/url": "^3.36.0",
33
+ "@wordpress/api-fetch": "^6.32.1",
34
+ "@wordpress/keycodes": "^3.35.1",
35
+ "@wordpress/url": "^3.36.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": "a92f606309b1541b834ff9b0a76ed2a466fc45ed"
46
+ "gitHead": "ce5639111c30763dbdf07f40eeb136ea6030ecf1"
47
47
  }