Skip to content
17 changes: 17 additions & 0 deletions tests/System/integration/site/modules/mod_banners/Default.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
describe('Test that the banner module', () => {
it('can display banners', () => {
cy.db_createBanner({ custombannercode: 'automated test banner 1' })
.then(() => cy.db_createBanner({ custombannercode: 'automated test banner 2' }))
.then(() => cy.db_createBanner({ custombannercode: 'automated test banner 3' }))
.then(() => cy.db_createBanner({ custombannercode: 'automated test banner 4' }))
.then(() => cy.db_createModule({ title: 'automated test', module: 'mod_banners', params: '{"count":5 }' }))
.then(() => {
cy.visit('/');

cy.contains('automated test banner 1');
cy.contains('automated test banner 2');
cy.contains('automated test banner 3');
cy.contains('automated test banner 4');
});
});
});
1 change: 1 addition & 0 deletions tests/System/support/commands/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Cypress.Commands.add('db_createBanner', (banner) => {
alias: 'test-banner',
catid: 3,
state: 1,
type: 1,
language: '*',
created: '2023-01-01 20:00:00',
modified: '2023-01-01 20:00:00',
Expand Down