Fix code quality issues and improve test framework

This commit is contained in:
2025-04-21 21:23:23 +01:00
parent ed160ed51b
commit 051bc763f8
11 changed files with 155 additions and 75 deletions

View File

@@ -0,0 +1,20 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
/**
* Custom command to login as admin
*/
Cypress.Commands.add('loginAsAdmin', () => {
cy.visit('/wp-admin');
cy.get('#user_login').type('admin');
cy.get('#user_pass').type('password');
cy.get('#wp-submit').click();
cy.get('body.wp-admin').should('exist');
});