From 173105e8e8c0d0847a993c5c3481d0a19cd7b001 Mon Sep 17 00:00:00 2001 From: Charvi Date: Fri, 24 Mar 2023 01:08:39 +0530 Subject: [PATCH 1/8] add cypress banner test --- .../site/components/com_banner/banner.cy.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/System/integration/site/components/com_banner/banner.cy.js diff --git a/tests/System/integration/site/components/com_banner/banner.cy.js b/tests/System/integration/site/components/com_banner/banner.cy.js new file mode 100644 index 0000000000000..db6b9a562d8a9 --- /dev/null +++ b/tests/System/integration/site/components/com_banner/banner.cy.js @@ -0,0 +1,17 @@ +describe('Test that the front page', () => { + it('can display banners', () => { + cy.db_createBanner({ custombannercode: 'automated test banner 1',type: 1}) + .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 2' ,type: 1})) + .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 3' ,type: 1})) + .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 4' ,type: 1})) + .then(() => cy.db_createModule({ title: 'automated test',module: 'mod_banners',position: 'sidebar-right',params:'{"count":5}'})) + .then(() => { + cy.visit('/joomla-cms/'); + + cy.contains('automated test banner 1'); + cy.contains('automated test banner 2'); + cy.contains('automated test banner 3'); + cy.contains('automated test banner 4'); + }); +}); + }); \ No newline at end of file From c3187e9cb642a25de479102265131377cb25572d Mon Sep 17 00:00:00 2001 From: Charvi Date: Fri, 24 Mar 2023 02:04:41 +0530 Subject: [PATCH 2/8] add cypress banner test to modules --- .../site/modules/mod_banners/Banners.cy.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/System/integration/site/modules/mod_banners/Banners.cy.js diff --git a/tests/System/integration/site/modules/mod_banners/Banners.cy.js b/tests/System/integration/site/modules/mod_banners/Banners.cy.js new file mode 100644 index 0000000000000..28ec51139cd18 --- /dev/null +++ b/tests/System/integration/site/modules/mod_banners/Banners.cy.js @@ -0,0 +1,17 @@ +describe('Test that the front page', () => { + it('can display banners', () => { + cy.db_createBanner({ custombannercode: 'automated test banner 1',type: 1}) + .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 2' ,type: 1})) + .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 3' ,type: 1})) + .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 4' ,type: 1})) + .then(() => cy.db_createModule({ title: 'automated test',module: 'mod_banners',params:'{"count":5}'})) + .then(() => { + cy.visit('/joomla-cms/'); + + cy.contains('automated test banner 1'); + cy.contains('automated test banner 2'); + cy.contains('automated test banner 3'); + cy.contains('automated test banner 4'); + }); +}); + }); \ No newline at end of file From 2f9e64556f0feacb86bc4c43b8023e8c3f631d1a Mon Sep 17 00:00:00 2001 From: Charvi Mehra <121369234+charvimehradu@users.noreply.github.com> Date: Fri, 24 Mar 2023 02:06:56 +0530 Subject: [PATCH 3/8] Delete banner.cy.js --- .../site/components/com_banner/banner.cy.js | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 tests/System/integration/site/components/com_banner/banner.cy.js diff --git a/tests/System/integration/site/components/com_banner/banner.cy.js b/tests/System/integration/site/components/com_banner/banner.cy.js deleted file mode 100644 index db6b9a562d8a9..0000000000000 --- a/tests/System/integration/site/components/com_banner/banner.cy.js +++ /dev/null @@ -1,17 +0,0 @@ -describe('Test that the front page', () => { - it('can display banners', () => { - cy.db_createBanner({ custombannercode: 'automated test banner 1',type: 1}) - .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 2' ,type: 1})) - .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 3' ,type: 1})) - .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 4' ,type: 1})) - .then(() => cy.db_createModule({ title: 'automated test',module: 'mod_banners',position: 'sidebar-right',params:'{"count":5}'})) - .then(() => { - cy.visit('/joomla-cms/'); - - cy.contains('automated test banner 1'); - cy.contains('automated test banner 2'); - cy.contains('automated test banner 3'); - cy.contains('automated test banner 4'); - }); -}); - }); \ No newline at end of file From 6fe65533bc1beae24c3dde2813c5b0e366d166a7 Mon Sep 17 00:00:00 2001 From: Charvi Date: Fri, 24 Mar 2023 02:40:09 +0530 Subject: [PATCH 4/8] code fix --- .../site/modules/mod_banners/Banners.cy.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/System/integration/site/modules/mod_banners/Banners.cy.js b/tests/System/integration/site/modules/mod_banners/Banners.cy.js index 28ec51139cd18..51052666da440 100644 --- a/tests/System/integration/site/modules/mod_banners/Banners.cy.js +++ b/tests/System/integration/site/modules/mod_banners/Banners.cy.js @@ -1,17 +1,17 @@ describe('Test that the front page', () => { - it('can display banners', () => { - cy.db_createBanner({ custombannercode: 'automated test banner 1',type: 1}) - .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 2' ,type: 1})) - .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 3' ,type: 1})) - .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 4' ,type: 1})) - .then(() => cy.db_createModule({ title: 'automated test',module: 'mod_banners',params:'{"count":5}'})) - .then(() => { - cy.visit('/joomla-cms/'); + it('can display banners', () => { + cy.db_createBanner({ custombannercode: 'automated test banner 1', type: 1 }) + .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 2', type: 1 })) + .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 3', type: 1 })) + .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 4', type: 1 })) + .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'); - }); + cy.contains('automated test banner 1'); + cy.contains('automated test banner 2'); + cy.contains('automated test banner 3'); + cy.contains('automated test banner 4'); + }); + }); }); - }); \ No newline at end of file From 5c26e01e4a55b3c8f1dbe78a8da6b2a1457d56eb Mon Sep 17 00:00:00 2001 From: Charvi Date: Fri, 24 Mar 2023 03:06:11 +0530 Subject: [PATCH 5/8] fix2 --- tests/System/integration/site/modules/mod_banners/Banners.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/System/integration/site/modules/mod_banners/Banners.cy.js b/tests/System/integration/site/modules/mod_banners/Banners.cy.js index 51052666da440..832baec728b25 100644 --- a/tests/System/integration/site/modules/mod_banners/Banners.cy.js +++ b/tests/System/integration/site/modules/mod_banners/Banners.cy.js @@ -4,7 +4,7 @@ describe('Test that the front page', () => { .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 2', type: 1 })) .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 3', type: 1 })) .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 4', type: 1 })) - .then(() => cy.db_createModule({ title: 'automated test', module: 'mod_banners',params: '{"count":5 }'})) + .then(() => cy.db_createModule({ title: 'automated test', module: 'mod_banners', params: '{"count":5 }' })) .then(() => { cy.visit('/'); From 219b7d1193db00c4377c72861af90b2597a50211 Mon Sep 17 00:00:00 2001 From: Charvi Date: Fri, 24 Mar 2023 03:16:07 +0530 Subject: [PATCH 6/8] fix3 type:1 set as default --- .../site/modules/mod_banners/Default.cy.js | 17 +++++++++++++++++ tests/System/support/commands/db.js | 1 + 2 files changed, 18 insertions(+) create mode 100644 tests/System/integration/site/modules/mod_banners/Default.cy.js diff --git a/tests/System/integration/site/modules/mod_banners/Default.cy.js b/tests/System/integration/site/modules/mod_banners/Default.cy.js new file mode 100644 index 0000000000000..22e0e27c3c555 --- /dev/null +++ b/tests/System/integration/site/modules/mod_banners/Default.cy.js @@ -0,0 +1,17 @@ +describe('Test that the front page', () => { + 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'); + }); + }); +}); diff --git a/tests/System/support/commands/db.js b/tests/System/support/commands/db.js index 3f03c65054a3f..f460d17edb2a5 100644 --- a/tests/System/support/commands/db.js +++ b/tests/System/support/commands/db.js @@ -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', From f84ebe575aa1f41da9e18d52a99cdcdb3d968095 Mon Sep 17 00:00:00 2001 From: Charvi Date: Fri, 24 Mar 2023 03:18:51 +0530 Subject: [PATCH 7/8] fix4 --- tests/System/integration/site/modules/mod_banners/Default.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/System/integration/site/modules/mod_banners/Default.cy.js b/tests/System/integration/site/modules/mod_banners/Default.cy.js index 22e0e27c3c555..7275d0b2a67a6 100644 --- a/tests/System/integration/site/modules/mod_banners/Default.cy.js +++ b/tests/System/integration/site/modules/mod_banners/Default.cy.js @@ -1,4 +1,4 @@ -describe('Test that the front page', () => { +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' })) From 37a24e61eb4cffe4f9efb68183d762d9b73f4174 Mon Sep 17 00:00:00 2001 From: Charvi Mehra <121369234+charvimehradu@users.noreply.github.com> Date: Fri, 24 Mar 2023 03:19:50 +0530 Subject: [PATCH 8/8] Delete Banners.cy.js --- .../site/modules/mod_banners/Banners.cy.js | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 tests/System/integration/site/modules/mod_banners/Banners.cy.js diff --git a/tests/System/integration/site/modules/mod_banners/Banners.cy.js b/tests/System/integration/site/modules/mod_banners/Banners.cy.js deleted file mode 100644 index 832baec728b25..0000000000000 --- a/tests/System/integration/site/modules/mod_banners/Banners.cy.js +++ /dev/null @@ -1,17 +0,0 @@ -describe('Test that the front page', () => { - it('can display banners', () => { - cy.db_createBanner({ custombannercode: 'automated test banner 1', type: 1 }) - .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 2', type: 1 })) - .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 3', type: 1 })) - .then(() => cy.db_createBanner({ custombannercode: 'automated test banner 4', type: 1 })) - .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'); - }); - }); -});