From 284e4034ebc31491681c8cd972cb8c94ef19d96b Mon Sep 17 00:00:00 2001 From: alikon Date: Sat, 8 Jun 2024 09:52:35 +0200 Subject: [PATCH 1/3] cy.cache --- .../components/com_cache/Default.cy.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/System/integration/administrator/components/com_cache/Default.cy.js diff --git a/tests/System/integration/administrator/components/com_cache/Default.cy.js b/tests/System/integration/administrator/components/com_cache/Default.cy.js new file mode 100644 index 0000000000000..75dbdbe8c3f6e --- /dev/null +++ b/tests/System/integration/administrator/components/com_cache/Default.cy.js @@ -0,0 +1,29 @@ +describe('Test in backend that the cache', () => { + beforeEach(() => { + cy.doAdministratorLogin(); + cy.visit('/administrator/index.php?option=com_cache&view=cache'); + }); + + it('have a title', () => { + cy.get('h1.page-title').should('contain.text', 'Maintenance: Clear Cache'); + }); + + it('can display message', () => { + cy.get('div.alert.alert-info').should('contain.text', 'Select the Clear Expired Cache button'); + }); + + it('can display a list of chached items', () => { + cy.get('tr.row0').should('contain.text', '_media_version'); + }); + + it('can clear expired cache', () => { + cy.get('#toolbar-delete2').click(); + cy.on('window:confirm', () => true); + cy.get('#system-message-container').contains('Expired cached items have been cleared').should('exist'); + }); + + it('can delete all', () => { + cy.get('#toolbar-delete1').click(); + cy.get('#system-message-container').contains('All cache group(s) have been cleared').should('exist'); + }); +}); From 07eca7d6358ef97ad8dfdf7f7294c21155ce8d71 Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Tue, 18 Jun 2024 09:30:47 +0200 Subject: [PATCH 2/3] Update tests/System/integration/administrator/components/com_cache/Default.cy.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Heiko Lübbe --- .../administrator/components/com_cache/Default.cy.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/System/integration/administrator/components/com_cache/Default.cy.js b/tests/System/integration/administrator/components/com_cache/Default.cy.js index 75dbdbe8c3f6e..d454c720bd397 100644 --- a/tests/System/integration/administrator/components/com_cache/Default.cy.js +++ b/tests/System/integration/administrator/components/com_cache/Default.cy.js @@ -19,6 +19,12 @@ describe('Test in backend that the cache', () => { it('can clear expired cache', () => { cy.get('#toolbar-delete2').click(); cy.on('window:confirm', () => true); + // Starting with Joomla 5.1 check if the 'Yes' button exists and click it if present + cy.get('body').then(($body) => { + if ($body.find('div.buttons-holder button[data-button-ok]').length > 0) { + cy.get('div.buttons-holder button[data-button-ok]').click(); + } + }); cy.get('#system-message-container').contains('Expired cached items have been cleared').should('exist'); }); From 3908874dce78d921e1aaa9041f5a2979704a952c Mon Sep 17 00:00:00 2001 From: Nicola Galgano Date: Wed, 19 Jun 2024 08:37:47 +0200 Subject: [PATCH 3/3] 4.4-only --- .../administrator/components/com_cache/Default.cy.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/System/integration/administrator/components/com_cache/Default.cy.js b/tests/System/integration/administrator/components/com_cache/Default.cy.js index d454c720bd397..75dbdbe8c3f6e 100644 --- a/tests/System/integration/administrator/components/com_cache/Default.cy.js +++ b/tests/System/integration/administrator/components/com_cache/Default.cy.js @@ -19,12 +19,6 @@ describe('Test in backend that the cache', () => { it('can clear expired cache', () => { cy.get('#toolbar-delete2').click(); cy.on('window:confirm', () => true); - // Starting with Joomla 5.1 check if the 'Yes' button exists and click it if present - cy.get('body').then(($body) => { - if ($body.find('div.buttons-holder button[data-button-ok]').length > 0) { - cy.get('div.buttons-holder button[data-button-ok]').click(); - } - }); cy.get('#system-message-container').contains('Expired cached items have been cleared').should('exist'); });