Skip to content

Commit

Permalink
[cypress] + com_actionlogs (#43531)
Browse files Browse the repository at this point in the history
* cy-actionlogs

* cs

* cs

* test

* test

* noresult

* cs

* simplify

* cs

* Update tests/System/integration/administrator/components/com_actionlogs/Actionlogs.cy.js

Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>

* Update tests/System/integration/administrator/components/com_actionlogs/Actionlogs.cy.js

Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>

* desc

* enabled-as-default

---------

Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>
  • Loading branch information
alikon and laoneo authored Jun 24, 2024
1 parent bf940f3 commit b805d80
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
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');
});
});

0 comments on commit b805d80

Please sign in to comment.