1- import { TEST_ADMIN_PASSWORD , TEST_ADMIN_USER , TEST_ENTITY_PUBLICATION } from 'cypress/support/e2e' ;
21import { testA11y } from 'cypress/support/utils' ;
32
43const page = {
@@ -37,7 +36,7 @@ const page = {
3736
3837describe ( 'Login Modal' , ( ) => {
3938 it ( 'should login when clicking button & stay on same page' , ( ) => {
40- const ENTITYPAGE = '/entities/publication/' . concat ( TEST_ENTITY_PUBLICATION ) ;
39+ const ENTITYPAGE = '/entities/publication/' . concat ( Cypress . env ( 'DSPACE_TEST_ENTITY_PUBLICATION' ) ) ;
4140 cy . visit ( ENTITYPAGE ) ;
4241
4342 // Login menu should exist
@@ -47,7 +46,7 @@ describe('Login Modal', () => {
4746 page . openLoginMenu ( ) ;
4847 cy . get ( '.form-login' ) . should ( 'be.visible' ) ;
4948
50- page . submitLoginAndPasswordByPressingButton ( TEST_ADMIN_USER , TEST_ADMIN_PASSWORD ) ;
49+ page . submitLoginAndPasswordByPressingButton ( Cypress . env ( 'DSPACE_TEST_ADMIN_USER' ) , Cypress . env ( 'DSPACE_TEST_ADMIN_PASSWORD' ) ) ;
5150 cy . get ( 'ds-log-in' ) . should ( 'not.exist' ) ;
5251
5352 // Verify we are still on the same page
@@ -67,7 +66,7 @@ describe('Login Modal', () => {
6766 cy . get ( '.form-login' ) . should ( 'be.visible' ) ;
6867
6968 // Login, and the <ds-log-in> tag should no longer exist
70- page . submitLoginAndPasswordByPressingEnter ( TEST_ADMIN_USER , TEST_ADMIN_PASSWORD ) ;
69+ page . submitLoginAndPasswordByPressingEnter ( Cypress . env ( 'DSPACE_TEST_ADMIN_USER' ) , Cypress . env ( 'DSPACE_TEST_ADMIN_PASSWORD' ) ) ;
7170 cy . get ( '.form-login' ) . should ( 'not.exist' ) ;
7271
7372 // Verify we are still on homepage
@@ -81,7 +80,7 @@ describe('Login Modal', () => {
8180
8281 it ( 'should support logout' , ( ) => {
8382 // First authenticate & access homepage
84- cy . login ( TEST_ADMIN_USER , TEST_ADMIN_PASSWORD ) ;
83+ cy . login ( Cypress . env ( 'DSPACE_TEST_ADMIN_USER' ) , Cypress . env ( 'DSPACE_TEST_ADMIN_PASSWORD' ) ) ;
8584 cy . visit ( '/' ) ;
8685
8786 // Verify ds-log-in tag doesn't exist, but ds-log-out tag does exist
@@ -140,7 +139,7 @@ describe('Login Modal', () => {
140139 testA11y ( 'ds-log-in' ) ;
141140
142141 // Now login
143- page . submitLoginAndPasswordByPressingButton ( TEST_ADMIN_USER , TEST_ADMIN_PASSWORD ) ;
142+ page . submitLoginAndPasswordByPressingButton ( Cypress . env ( 'DSPACE_TEST_ADMIN_USER' ) , Cypress . env ( 'DSPACE_TEST_ADMIN_PASSWORD' ) ) ;
144143 cy . get ( 'ds-log-in' ) . should ( 'not.exist' ) ;
145144
146145 // Open user menu, verify user menu accesibility
0 commit comments