Update to version 0.1.5 with testing setup, multisite compatibility, and npm scripts
This commit is contained in:
27
tests/e2e/cypress/integration/basic.spec.js
Normal file
27
tests/e2e/cypress/integration/basic.spec.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Basic e2e test for the plugin.
|
||||
*/
|
||||
describe('Plugin Basic Tests', () => {
|
||||
before(() => {
|
||||
cy.login();
|
||||
});
|
||||
|
||||
it('Should activate the plugin', () => {
|
||||
cy.visit('/wp-admin/plugins.php');
|
||||
cy.contains('WP Plugin Starter Template').should('exist');
|
||||
|
||||
// Check if plugin is not active, then activate it
|
||||
cy.get('tr[data-slug="wp-plugin-starter-template-for-ai-coding"]')
|
||||
.then(($tr) => {
|
||||
if ($tr.hasClass('inactive')) {
|
||||
cy.wrap($tr).find('.activate a').click();
|
||||
cy.contains('Plugin activated.').should('exist');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('Should have the plugin settings page', () => {
|
||||
cy.visit('/wp-admin/options-general.php?page=wp-plugin-starter-template');
|
||||
cy.contains('WP Plugin Starter Template Settings').should('exist');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user