Fix WordPress Playground tests: improve login handling, implement CodeRabbit suggestions

This commit is contained in:
2025-04-22 21:45:54 +01:00
parent ef60ce0c9d
commit 771cc96da8
4 changed files with 73 additions and 14 deletions

View File

@@ -14,8 +14,17 @@ describe('WordPress Playground Multisite Tests', () => {
// Visit the network admin dashboard
cy.visit('/wp-admin/network/');
// Fill in the login form if needed
cy.get('body').then(($body) => {
if ($body.hasClass('login')) {
cy.get('#user_login').type('admin');
cy.get('#user_pass').type('password');
cy.get('#wp-submit').click();
}
});
// Check if we're logged in to the network admin
cy.get('body').should('have.class', 'wp-admin');
cy.get('#wpadminbar').should('exist');
});
it('Plugin is network activated', () => {