Fix code quality issues: add ESLint config to Cypress files, update documentation, improve HTML accessibility
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
/* eslint-env mocha, jquery, cypress */
|
||||
describe('WordPress Playground Multisite Tests', () => {
|
||||
beforeEach(() => {
|
||||
// Visit the WordPress Playground page
|
||||
cy.visit('/multisite.html');
|
||||
|
||||
|
||||
// Wait for the iframe to load
|
||||
cy.get('iframe').should('be.visible');
|
||||
});
|
||||
@@ -29,13 +30,13 @@ describe('WordPress Playground Multisite Tests', () => {
|
||||
// Navigate to network plugins page
|
||||
const $document = $iframe.contents();
|
||||
const $body = $document.find('body');
|
||||
|
||||
|
||||
// Click on Network Admin in the admin bar
|
||||
cy.wrap($body).find('#wpadminbar #wp-admin-bar-network-admin a').click();
|
||||
|
||||
|
||||
// Click on Plugins in the network admin menu
|
||||
cy.wrap($body).find('#menu-plugins a[href*="plugins.php"]').first().click();
|
||||
|
||||
|
||||
// Check if the plugin is network active
|
||||
cy.wrap($body).find('tr[data-slug="wp-plugin-starter-template-for-ai-coding"]').should('exist');
|
||||
cy.wrap($body).find('tr[data-slug="wp-plugin-starter-template-for-ai-coding"] .network_active').should('exist');
|
||||
@@ -46,11 +47,11 @@ describe('WordPress Playground Multisite Tests', () => {
|
||||
cy.get('iframe').then($iframe => {
|
||||
const $document = $iframe.contents();
|
||||
const $body = $document.find('body');
|
||||
|
||||
|
||||
// Navigate to the network settings page
|
||||
cy.wrap($body).find('#wpadminbar #wp-admin-bar-network-admin a').click();
|
||||
cy.wrap($body).find('#menu-settings a[href*="settings.php"]').first().click();
|
||||
|
||||
|
||||
// Check if the network settings page loaded correctly
|
||||
cy.wrap($body).find('h1').should('contain', 'Network Settings');
|
||||
});
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/* eslint-env mocha, jquery, cypress */
|
||||
describe('WordPress Playground Single Site Tests', () => {
|
||||
beforeEach(() => {
|
||||
// Visit the WordPress Playground page
|
||||
cy.visit('/index.html');
|
||||
|
||||
|
||||
// Wait for the iframe to load
|
||||
cy.get('iframe').should('be.visible');
|
||||
});
|
||||
@@ -29,10 +30,10 @@ describe('WordPress Playground Single Site Tests', () => {
|
||||
// Navigate to plugins page
|
||||
const $document = $iframe.contents();
|
||||
const $body = $document.find('body');
|
||||
|
||||
|
||||
// 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');
|
||||
});
|
||||
@@ -42,11 +43,11 @@ describe('WordPress Playground Single Site Tests', () => {
|
||||
cy.get('iframe').then($iframe => {
|
||||
const $document = $iframe.contents();
|
||||
const $body = $document.find('body');
|
||||
|
||||
|
||||
// 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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user