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 / commands.js

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

57 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { BLOCK_CONTAINER } from '../constants';
2 import {
3 addBlock,
4 closeWelcomeGuide,
5 openBlockInserter,
6 closeBlockInserter,
7 saveDraft,
8 setPostContent,
9 wpDataSelect,
10 } from './gutenberg';
11 import { login, logout } from './login-logout';
12 import {
13 visitPageEditor,
14 visitAdminPage,
15 visitToLoginPage,
16 } from './navigate-pages';
17 import { installPlugin, uninstallPlugin } from './plugins';
18
19 // Port more commands from WP here:
20 // https://github.com/WordPress/gutenberg/tree/trunk/packages/e2e-test-utils/src
21
22 // Getting around
23 Cypress.Commands.add('visitLoginPage', (query) => visitToLoginPage(query));
24 Cypress.Commands.add('visitAdminPage', (path, query) =>
25 visitAdminPage(path, query),
26 );
27 Cypress.Commands.add('visitNewPageEditor', (query, skipWelcomeGuide) =>
28 visitPageEditor(query, skipWelcomeGuide),
29 );
30
31 // Login logout
32 Cypress.Commands.add('loginUser', (username, password) =>
33 login(username, password),
34 );
35 Cypress.Commands.add('logoutUser', () => logout());
36
37 // Gutenberg
38 Cypress.Commands.add('closeWelcomeGuide', () => closeWelcomeGuide());
39 Cypress.Commands.add('saveDraft', () => saveDraft());
40 Cypress.Commands.add('openBlockInserter', () => openBlockInserter());
41 Cypress.Commands.add('closeBlockInserter', () => closeBlockInserter());
42 Cypress.Commands.add('addBlock', (slug) => addBlock(slug));
43 Cypress.Commands.add('setPostContent', (content) => setPostContent(content));
44 Cypress.Commands.add('getPostContent', (addon = '') => {
45 return cy.get(`${BLOCK_CONTAINER} ${addon}`);
46 });
47 Cypress.Commands.add('getCurrentPostObject', () => {
48 cy.wpDataSelect('core/editor', 'getCurrentPost');
49 });
50 Cypress.Commands.add('wpDataSelect', (store, selector, ...parameters) =>
51 wpDataSelect(store, selector, ...parameters),
52 );
53
54 // Manage plugins
55 Cypress.Commands.add('installPlugin', (slug) => installPlugin(slug));
56 Cypress.Commands.add('uninstallPlugin', (slug) => uninstallPlugin(slug));
57