Skip to content

Commit 0b5bb2b

Browse files
Adding direct logout test. (#40394)
* add cypress test * test desc. change * test desc. change * a * Update tests/System/integration/site/components/com_users/Logout.cy.js Co-authored-by: Allon Moritz <[email protected]> * Adding code into a .then block * remove space * disable the logout assert when no menu item --------- Co-authored-by: Allon Moritz <[email protected]>
1 parent 302ea40 commit 0b5bb2b

File tree

1 file changed

+24
-0
lines changed
  • tests/System/integration/site/components/com_users

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
describe('Test in frontend that the users logout view', () => {
2+
it('can log out the user without a menu item', () => {
3+
// Make sure we are really logged in
4+
cy.doFrontendLogin(null, null, false);
5+
cy.visit('/index.php?option=com_users&view=login&layout=logout&task=user.menulogout');
6+
7+
cy.contains(`Hi ${Cypress.env('name')}`).should('not.exist');
8+
// This is disabled for now as it looks like cypress has an issue after redirect with the session
9+
// cy.get('#system-message-container').should('contain.text', 'You have been logged out.');
10+
});
11+
12+
it('can log out the user in a menu item', () => {
13+
cy.db_createMenuItem({ title: 'Automated logout', link: 'index.php?option=com_users&view=login&layout=logout&task=user.menulogout' })
14+
.then(() => {
15+
// Make sure we are really logged in
16+
cy.doFrontendLogin(null, null, false);
17+
cy.visit('/');
18+
cy.get('a:contains(Automated logout)').click();
19+
20+
cy.contains(`Hi ${Cypress.env('name')}`).should('not.exist');
21+
cy.get('#system-message-container').should('contain.text', 'You have been logged out.');
22+
});
23+
});
24+
});

0 commit comments

Comments
 (0)