I'm trying to run the original Joomla Cypress tests here:

After Joomla gets successfully installed I always get this message when the next test starts:

CypressError: This session already exists. You may not create a new session with a previously used identifier. If you want to create a new session with a different setup function, please call `cy.session()` with a unique identifier other than **["admin","adminadminadmin","back"]**.

      at Context.session (
      at wrapped (
  From Your Spec Code:
          at Context.eval(webpack:///./tests/System/support/commands.js:57:12)

I'm using the same Helper Functions Joomla uses for Backend Login:

This is the command Joomla uses for picking up the session:

Cypress.Commands.overwrite('doAdministratorLogin', (originalFn, username, password, useSnapshot = true) => {
  // Ensure there are valid credentials
  const user = username ?? Cypress.env('username');
  const pw = password ?? Cypress.env('password');

  // Do normal login when no snapshot should be used
  if (!useSnapshot) {
    // Clear the session data

    // Call the normal function
    return originalFn(user, pw);

  // Do login through the session
  return cy.session([user, pw, 'back'], () => originalFn(user, pw), { cacheAcrossSpecs: true });

So i minimized everything like seen here:

describe('First Admin Login', () => {
    it('First Admin Login', () => {
        cy.doAdministratorLogin('admin', 'adminadminadmin', false);
    it('Second Admin Login (session based)', () => {

The second admin login always fails like described above.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.