Skip to content

Commit 107b4bb

Browse files
authored
[5.3][cypress] smart search index & purge (joomla#45127)
* test smart serach index & purge * afterEach
1 parent e773b6a commit 107b4bb

File tree

1 file changed

+28
-0
lines changed
  • tests/System/integration/administrator/components/com_finder

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
describe('Test in backend that the Smart Search', () => {
2+
beforeEach(() => {
3+
cy.doAdministratorLogin();
4+
});
5+
afterEach(() => {
6+
cy.task('queryDB', "DELETE FROM #__content WHERE title = 'Test article'");
7+
});
8+
9+
it('can index an article', () => {
10+
// Create a new article
11+
cy.visit('/administrator/index.php?option=com_content&task=article.add');
12+
cy.get('#jform_title').clear().type('Test article');
13+
cy.clickToolbarButton('Save & Close');
14+
// Visit the smart search page
15+
cy.visit('/administrator/index.php?option=com_finder&view=index');
16+
cy.contains('Test article').should('exist');
17+
});
18+
19+
it('can purge the index', () => {
20+
// Visit the smart search page
21+
cy.visit('/administrator/index.php?option=com_finder&view=index');
22+
cy.get('#toolbar-maintenance-group > button').click();
23+
// Click the "Clear Index" button
24+
cy.get('#maintenance-group-children-index-purge > button', { force: true }).click();
25+
cy.clickDialogConfirm(true);
26+
cy.checkForSystemMessage('All items have been deleted.');
27+
});
28+
});

0 commit comments

Comments
 (0)