From 6690f03bde065d7da8663acb10b2c8c90cfc2c72 Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Tue, 30 Jan 2024 13:45:31 +0100 Subject: [PATCH] Commented out the `login-modal.cy.ts` because the CLARIN-DSpace has different login --- cypress/e2e/login-modal.cy.ts | 203 +++++++++++++++++----------------- 1 file changed, 102 insertions(+), 101 deletions(-) diff --git a/cypress/e2e/login-modal.cy.ts b/cypress/e2e/login-modal.cy.ts index d29c13c2f96..e86aa6843ed 100644 --- a/cypress/e2e/login-modal.cy.ts +++ b/cypress/e2e/login-modal.cy.ts @@ -35,104 +35,105 @@ const page = { } }; -describe('Login Modal', () => { - it('should login when clicking button & stay on same page', () => { - const ENTITYPAGE = '/entities/publication/'.concat(TEST_ENTITY_PUBLICATION); - cy.visit(ENTITYPAGE); - - // Login menu should exist - cy.get('ds-log-in').should('exist'); - - // Login, and the tag should no longer exist - page.openLoginMenu(); - cy.get('.form-login').should('be.visible'); - - page.submitLoginAndPasswordByPressingButton(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD); - cy.get('ds-log-in').should('not.exist'); - - // Verify we are still on the same page - cy.url().should('include', ENTITYPAGE); - - // Open user menu, verify user menu & logout button now available - page.openUserMenu(); - cy.get('ds-user-menu').should('be.visible'); - cy.get('ds-log-out').should('be.visible'); - }); - - it('should login when clicking enter key & stay on same page', () => { - cy.visit('/home'); - - // Open login menu in header & verify tag is visible - page.openLoginMenu(); - cy.get('.form-login').should('be.visible'); - - // Login, and the tag should no longer exist - page.submitLoginAndPasswordByPressingEnter(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD); - cy.get('.form-login').should('not.exist'); - - // Verify we are still on homepage - cy.url().should('include', '/home'); - - // Open user menu, verify user menu & logout button now available - page.openUserMenu(); - cy.get('ds-user-menu').should('be.visible'); - cy.get('ds-log-out').should('be.visible'); - }); - - it('should support logout', () => { - // First authenticate & access homepage - cy.login(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD); - cy.visit('/'); - - // Verify ds-log-in tag doesn't exist, but ds-log-out tag does exist - cy.get('ds-log-in').should('not.exist'); - cy.get('ds-log-out').should('exist'); - - // Click logout button - page.openUserMenu(); - page.submitLogoutByPressingButton(); - - // Verify ds-log-in tag now exists - cy.get('ds-log-in').should('exist'); - cy.get('ds-log-out').should('not.exist'); - }); - - it('should allow new user registration', () => { - cy.visit('/'); - - page.openLoginMenu(); - - // Registration link should be visible - cy.get('ds-themed-navbar [data-test="register"]').should('be.visible'); - - // Click registration link & you should go to registration page - cy.get('ds-themed-navbar [data-test="register"]').click(); - cy.location('pathname').should('eq', '/register'); - cy.get('ds-register-email').should('exist'); - }); - - it('should allow forgot password', () => { - cy.visit('/'); - - page.openLoginMenu(); - - // Forgot password link should be visible - cy.get('ds-themed-navbar [data-test="forgot"]').should('be.visible'); - - // Click link & you should go to Forgot Password page - cy.get('ds-themed-navbar [data-test="forgot"]').click(); - cy.location('pathname').should('eq', '/forgot'); - cy.get('ds-forgot-email').should('exist'); - }); - - it('should pass accessibility tests', () => { - cy.visit('/'); - - page.openLoginMenu(); - - cy.get('ds-log-in').should('exist'); - - // Analyze for accessibility issues - testA11y('ds-log-in'); - }); -}); +// CLARIN - CLARIN-DSpace7.x has different login +// describe('Login Modal', () => { +// it('should login when clicking button & stay on same page', () => { +// const ENTITYPAGE = '/entities/publication/'.concat(TEST_ENTITY_PUBLICATION); +// cy.visit(ENTITYPAGE); +// +// // Login menu should exist +// cy.get('ds-log-in').should('exist'); +// +// // Login, and the tag should no longer exist +// page.openLoginMenu(); +// cy.get('.form-login').should('be.visible'); +// +// page.submitLoginAndPasswordByPressingButton(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD); +// cy.get('ds-log-in').should('not.exist'); +// +// // Verify we are still on the same page +// cy.url().should('include', ENTITYPAGE); +// +// // Open user menu, verify user menu & logout button now available +// page.openUserMenu(); +// cy.get('ds-user-menu').should('be.visible'); +// cy.get('ds-log-out').should('be.visible'); +// }); +// +// it('should login when clicking enter key & stay on same page', () => { +// cy.visit('/home'); +// +// // Open login menu in header & verify tag is visible +// page.openLoginMenu(); +// cy.get('.form-login').should('be.visible'); +// +// // Login, and the tag should no longer exist +// page.submitLoginAndPasswordByPressingEnter(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD); +// cy.get('.form-login').should('not.exist'); +// +// // Verify we are still on homepage +// cy.url().should('include', '/home'); +// +// // Open user menu, verify user menu & logout button now available +// page.openUserMenu(); +// cy.get('ds-user-menu').should('be.visible'); +// cy.get('ds-log-out').should('be.visible'); +// }); +// +// it('should support logout', () => { +// // First authenticate & access homepage +// cy.login(TEST_ADMIN_USER, TEST_ADMIN_PASSWORD); +// cy.visit('/'); +// +// // Verify ds-log-in tag doesn't exist, but ds-log-out tag does exist +// cy.get('ds-log-in').should('not.exist'); +// cy.get('ds-log-out').should('exist'); +// +// // Click logout button +// page.openUserMenu(); +// page.submitLogoutByPressingButton(); +// +// // Verify ds-log-in tag now exists +// cy.get('ds-log-in').should('exist'); +// cy.get('ds-log-out').should('not.exist'); +// }); +// +// it('should allow new user registration', () => { +// cy.visit('/'); +// +// page.openLoginMenu(); +// +// // Registration link should be visible +// cy.get('ds-themed-navbar [data-test="register"]').should('be.visible'); +// +// // Click registration link & you should go to registration page +// cy.get('ds-themed-navbar [data-test="register"]').click(); +// cy.location('pathname').should('eq', '/register'); +// cy.get('ds-register-email').should('exist'); +// }); +// +// it('should allow forgot password', () => { +// cy.visit('/'); +// +// page.openLoginMenu(); +// +// // Forgot password link should be visible +// cy.get('ds-themed-navbar [data-test="forgot"]').should('be.visible'); +// +// // Click link & you should go to Forgot Password page +// cy.get('ds-themed-navbar [data-test="forgot"]').click(); +// cy.location('pathname').should('eq', '/forgot'); +// cy.get('ds-forgot-email').should('exist'); +// }); +// +// it('should pass accessibility tests', () => { +// cy.visit('/'); +// +// page.openLoginMenu(); +// +// cy.get('ds-log-in').should('exist'); +// +// // Analyze for accessibility issues +// testA11y('ds-log-in'); +// }); +// });