Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cypress] + com_actionlogs #43531

Merged
merged 16 commits into from
Jun 24, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
describe('Test in backend that the action logs', () => {
beforeEach(() => {
cy.db_enableExtension('1', 'plg_actionlog_joomla');
cy.doAdministratorLogin();
cy.visit('/administrator/index.php?option=com_actionlogs&view=actionlogs');
});

it('have a title', () => {
cy.get('h1.page-title').should('contain.text', 'User Actions Log');
});

it('can display no results', () => {
cy.task('queryDB', 'TRUNCATE #__action_logs');
cy.reload();
cy.get('div.alert.alert-info').should('contain.text', 'No Matching Results');
});

it('can display a list of actions', () => {
cy.doAdministratorLogout();
cy.doAdministratorLogin();
cy.visit('/administrator/index.php?option=com_actionlogs&view=actionlogs');
cy.contains('User ci-admin logged in to admin');
cy.task('queryDB', 'TRUNCATE #__action_logs');
});

it('have an export button', () => {
cy.get('#toolbar-download1').click();
cy.get('#system-message-container').contains('There are no User Action logs to export').should('exist');
});

it('can clear logs', () => {
cy.get('#toolbar-delete1').click();
cy.on('window:confirm', () => true);
cy.get('#system-message-container').contains('All User Action logs have been deleted').should('exist');
});

it('can delete selected logs', () => {
cy.get('#toolbar-delete').click();
cy.on('window:confirm', () => true);
cy.get('#system-message-container').contains('Please first make a selection from the list').should('exist');
cy.log('Make a selection first');
cy.doAdministratorLogout();
cy.doAdministratorLogin();
cy.visit('/administrator/index.php?option=com_actionlogs&view=actionlogs');
cy.checkAllResults();
cy.get('#toolbar-delete').click();
cy.on('window:confirm', () => true);
cy.get('#system-message-container').contains('logs deleted').should('exist');
cy.task('queryDB', 'TRUNCATE #__action_logs');
});
});
1 change: 1 addition & 0 deletions tests/System/integration/api/com_plugins/Plugins.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ describe('Test that plugins API endpoint', () => {
.its('enabled')
.should('equal', 0));
});
cy.db_enableExtension('1', 'plg_actionlog_joomla');
});
});