-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
tests/System/integration/administrator/components/com_actionlogs/Actionlogs.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters