PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.1.0
Code Block Pro – Beautiful Syntax Highlighting v1.1.0
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / cypress / support / gutenberg.js

gutenberg.js in Code Block Pro – Beautiful Syntax Highlighting 1.1.0, at cypress/support/gutenberg.js

52 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 export const closeWelcomeGuide = () => {
2 cy.window().then((win) => {
3 if (
4 win.wp.data.select('core/edit-post').isFeatureActive('welcomeGuide')
5 ) {
6 win.wp.data
7 .dispatch('core/edit-post')
8 .toggleFeature('welcomeGuide');
9 }
10 });
11 };
12
13 export const saveDraft = () => {
14 cy.get('body').then((body) => {
15 if (body.find('.editor-post-save-draft').length > 0) {
16 cy.get('.editor-post-save-draft').click();
17 cy.get('.editor-post-saved-state.is-saved');
18 }
19 });
20 };
21
22 export const setPostContent = (content) => {
23 cy.window().then((win) => {
24 const { dispatch } = win.wp.data;
25 const blocks = win.wp.blocks.parse(content);
26 dispatch('core/block-editor').resetBlocks(blocks);
27 });
28 };
29 export const openBlockInserter = () => {
30 cy.get('button[aria-label="Toggle block inserter"]').then((button) => {
31 if (button.attr('aria-pressed') === 'false') {
32 button.click();
33 }
34 });
35 };
36 export const closeBlockInserter = () => {
37 cy.get('button[aria-label="Toggle block inserter"]').then((button) => {
38 if (button.attr('aria-pressed') === 'true') {
39 button.click();
40 }
41 });
42 };
43 export const addBlock = (slug) => {
44 cy.openBlockInserter();
45 cy.get(`button[class*="${slug}"]`).click();
46 };
47 export const wpDataSelect = (store, selector, ...parameters) => {
48 cy.window().then((win) => {
49 return win.wp.data.select(store)[selector](...parameters);
50 });
51 };
52