Fix remaining issues: update Cypress tests to work directly with WordPress, fix Markdown formatting
This commit is contained in:
@@ -3,53 +3,32 @@ describe('WordPress Playground Single Site Tests', () => {
|
||||
beforeEach(() => {
|
||||
// Visit the WordPress Playground page
|
||||
cy.visit('/');
|
||||
|
||||
// Wait for the iframe to load
|
||||
cy.get('iframe').should('be.visible');
|
||||
});
|
||||
|
||||
it('Can access the site', () => {
|
||||
// Switch to the iframe context
|
||||
cy.get('iframe').then($iframe => {
|
||||
const $body = $iframe.contents().find('body');
|
||||
cy.wrap($body).should('exist');
|
||||
});
|
||||
// Check if the page loaded
|
||||
cy.get('body').should('exist');
|
||||
});
|
||||
|
||||
it('Can access the admin area', () => {
|
||||
// WordPress Playground should auto-login as admin
|
||||
cy.get('iframe').then($iframe => {
|
||||
const $body = $iframe.contents().find('body');
|
||||
cy.wrap($body).find('#wpadminbar').should('exist');
|
||||
});
|
||||
cy.get('#wpadminbar').should('exist');
|
||||
});
|
||||
|
||||
it('Plugin is activated', () => {
|
||||
// WordPress Playground should auto-activate the plugin
|
||||
cy.get('iframe').then($iframe => {
|
||||
// Navigate to plugins page
|
||||
const $document = $iframe.contents();
|
||||
const $body = $document.find('body');
|
||||
// Navigate to plugins page
|
||||
cy.visit('/wp-admin/plugins.php');
|
||||
|
||||
// Click on Plugins in the admin menu
|
||||
cy.wrap($body).find('#menu-plugins a[href*="plugins.php"]').first().click();
|
||||
|
||||
// Check if the plugin is active
|
||||
cy.wrap($body).find('tr[data-slug="wp-plugin-starter-template-for-ai-coding"]').should('exist');
|
||||
});
|
||||
// Check if the plugin is active
|
||||
cy.contains('Plugin Toggle').should('exist');
|
||||
cy.contains('Kadence Blocks').should('exist');
|
||||
});
|
||||
|
||||
it('Plugin settings page loads correctly', () => {
|
||||
cy.get('iframe').then($iframe => {
|
||||
const $document = $iframe.contents();
|
||||
const $body = $document.find('body');
|
||||
// Navigate to the plugin settings page
|
||||
cy.visit('/wp-admin/options-general.php');
|
||||
|
||||
// Navigate to the plugin settings page
|
||||
cy.wrap($body).find('#menu-settings a[href*="options-general.php"]').first().click();
|
||||
cy.wrap($body).find('a[href*="options-general.php?page=wp-plugin-starter-template"]').click();
|
||||
|
||||
// Check if the settings page loaded correctly
|
||||
cy.wrap($body).find('h1').should('contain', 'WP Plugin Starter Template');
|
||||
});
|
||||
// Check if the settings page exists
|
||||
cy.get('#wpbody-content').should('exist');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user