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

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

29 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 export const installPlugin = (slug) => {
2 cy.visitAdminPage(
3 'plugin-install.php',
4 's=' + encodeURIComponent(slug) + '&tab=search&type=term',
5 );
6 cy.get(`.plugin-card-${slug}`).then((card) => {
7 const activeButton =
8 '<button type="button" class="button button-disabled" disabled="disabled">Active</button>';
9 if (card.html().includes(activeButton)) return;
10 if (card.html().includes('Install Now')) {
11 cy.get(
12 `.plugin-card-${slug} a[href*="${slug}"].install-now`,
13 ).click();
14 }
15 cy.get(`.plugin-card-${slug} a[href*="${slug}"].activate-now`).click();
16 });
17 };
18
19 export const uninstallPlugin = (slug) => {
20 cy.visitAdminPage('plugins.php');
21 cy.get(`tr[data-slug=${slug}]`).then((plugin) => {
22 // If active, deactivate first
23 if (plugin.html().includes(`deactivate-${slug}`)) {
24 cy.get(`#deactivate-${slug}`).click({ force: true });
25 }
26 cy.get(`#delete-${slug}`).click({ force: true });
27 });
28 };
29