Add comprehensive testing framework for both single site and multisite WordPress environments
This commit is contained in:
26
cypress/e2e/single-site.cy.js
Normal file
26
cypress/e2e/single-site.cy.js
Normal file
@@ -0,0 +1,26 @@
|
||||
describe('WordPress Single Site Tests', () => {
|
||||
it('Can access the site', () => {
|
||||
cy.visit('/');
|
||||
cy.get('body').should('exist');
|
||||
});
|
||||
|
||||
it('Can login to the admin area', () => {
|
||||
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');
|
||||
});
|
||||
|
||||
it('Plugin is activated', () => {
|
||||
// Login first
|
||||
cy.visit('/wp-admin');
|
||||
cy.get('#user_login').type('admin');
|
||||
cy.get('#user_pass').type('password');
|
||||
cy.get('#wp-submit').click();
|
||||
|
||||
// Check plugins page
|
||||
cy.visit('/wp-admin/plugins.php');
|
||||
cy.contains('tr', 'WP Plugin Starter Template').should('contain', 'Deactivate');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user