Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return;
}
// Select all plugins
await page.click( '#cb-select-all-1' );
// Uncheck Site Kit
await page.click( 'input[type="checkbox"][value="google-site-kit/google-site-kit.php"]' );
// Bulk deactivate
await page.select( 'select#bulk-action-selector-bottom', 'deactivate-selected' );
await Promise.all( [
page.click( '#doaction2' ),
page.waitForNavigation(),
] );
await switchUserToTest();
}
const bulkSelector = await page.$( '#bulk-action-selector-top' );
if ( ! bulkSelector ) {
return;
}
// Select all posts.
await page.waitForSelector( '[id^=cb-select-all-]' );
await page.click( '[id^=cb-select-all-]' );
// Select the "bulk actions" > "trash" option.
await page.select( '#bulk-action-selector-bottom', 'trash' );
// Submit the form to send all draft/scheduled/published posts to the trash.
await page.click( '#doaction2' );
await page.waitForXPath(
'//*[contains(@class, "updated notice")]/p[contains(text(), "moved to the Trash.")]'
);
await switchUserToTest();
}
const bulkSelector = await page.$( '#bulk-action-selector-top' );
if ( ! bulkSelector ) {
return;
}
// Select all posts.
await page.waitForSelector( '#cb-select-all-1' );
await page.click( '#cb-select-all-1' );
// Select the "bulk actions" > "trash" option.
await page.select( '#bulk-action-selector-top', 'trash' );
// Submit the form to send all draft/scheduled/published posts to the trash.
await page.click( '#doaction' );
await page.waitForXPath(
'//*[contains(@class, "updated notice")]/p[contains(text(), "moved to the Trash.")]'
);
await switchUserToTest();
}
if ( ! bulkSelector ) {
return;
}
// Select all posts.
await page.waitForSelector( '#cb-select-all-1' );
await page.click( '#cb-select-all-1' );
// Select the "bulk actions" > "trash" option.
await page.select( '#bulk-action-selector-top', 'trash' );
// Submit the form to send all draft/scheduled/published posts to the trash.
await page.click( '#doaction' );
await page.waitForXPath(
'//*[contains(@class, "updated notice")]/p[contains(text(), "moved to the Trash.")]'
);
await switchUserToTest();
}
return;
}
await page.click( `[data-slug="${ slug }"]` );
await page.waitForSelector( '.theme-actions .delete-theme' );
await page.click( '.theme-actions .delete-theme' );
// Wait for the theme to be removed from the page.
// eslint-disable-next-line no-restricted-syntax
await page.waitFor(
( themeSlug ) =>
! document.querySelector( `[data-slug="${ themeSlug }"]` ),
slug,
);
await switchUserToTest();
}