11/// <reference types="cypress" /> 
22
3- import  {  elSelector ,   withLang  }  from  '@@/cypress/utils' 
3+ import  {  withLang  }  from  '@@/cypress/utils' 
44import  {  EDataTest ,  EDataTestClass  }  from  '@/enums/EDataTest' 
55
66describe ( 'user sign-in, sign-up and logout' ,  ( )  =>  { 
@@ -20,9 +20,12 @@ describe('user sign-in, sign-up and logout', () => {
2020        cy 
2121            . el ( EDataTest . landing_sign_in_button ) . click ( ) 
2222            // To make close button unfocused 
23-             . elByClass ( EDataTestClass . app_card_content ) . should ( 'be.visible' ) . click ( ) 
23+             . elByClass ( EDataTestClass . app_dialog ) . should ( 'be.visible' ) . click ( ) 
2424            . get ( 'html' ) . toMatchSnapshot ( 'Sign in modal' ) 
25-             . get ( `${ elSelector ( EDataTest . authentication_modal ) }  ) . click ( ) 
25+             . elByClass ( EDataTestClass . app_dialog ) . within ( ( )  =>  { 
26+                 cy . elByClass ( EDataTestClass . app_close_button ) . click ( ) 
27+             } ) 
28+ 
2629
2730            . authWithoutSession ( ) 
2831            . elByClass ( EDataTestClass . app_notifications ) . should ( 'be.visible' ) . and ( 'contain' ,  'successful_authorization' ) 
@@ -53,7 +56,9 @@ describe('user sign-in, sign-up and logout', () => {
5356            . toMatchSnapshotForEl ( EDataTestClass . app_notifications ,  'Sign in error notification' ) 
5457        cy 
5558            . el ( EDataTest . authentication_modal_error ) . should ( 'be.visible' ) . contains ( errorMessageInvalidEmail ) 
56-             . get ( `${ elSelector ( EDataTest . authentication_modal ) }  ) . click ( ) 
59+             . elByClass ( EDataTestClass . app_dialog ) . within ( ( )  =>  { 
60+                 cy . elByClass ( EDataTestClass . app_close_button ) . click ( ) 
61+             } ) 
5762
5863        cy . authWithoutSession ( { 
5964            username : '' , 
@@ -68,7 +73,9 @@ describe('user sign-in, sign-up and logout', () => {
6873            . and ( 'contain' ,  errorMessageInvalidEmail ) 
6974        cy 
7075            . el ( EDataTest . authentication_modal_error ) . should ( 'be.visible' ) . contains ( errorMessageInvalidEmail ) 
71-             . get ( `${ elSelector ( EDataTest . authentication_modal ) }  ) . click ( ) 
76+             . elByClass ( EDataTestClass . app_dialog ) . within ( ( )  =>  { 
77+                 cy . elByClass ( EDataTestClass . app_close_button ) . click ( ) 
78+             } ) 
7279
7380        cy . authWithoutSession ( { 
7481@@ -83,7 +90,9 @@ describe('user sign-in, sign-up and logout', () => {
8390            . and ( 'contain' ,  errorMessageInvalidCredential ) 
8491        cy 
8592            . el ( EDataTest . authentication_modal_error ) . should ( 'be.visible' ) . contains ( errorMessageInvalidCredential ) 
86-             . get ( `${ elSelector ( EDataTest . authentication_modal ) }  ) . click ( ) 
93+             . elByClass ( EDataTestClass . app_dialog ) . within ( ( )  =>  { 
94+                 cy . elByClass ( EDataTestClass . app_close_button ) . click ( ) 
95+             } ) 
8796
8897        cy . authWithoutSession ( { 
8998@@ -98,16 +107,20 @@ describe('user sign-in, sign-up and logout', () => {
98107            . and ( 'contain' ,  errorMessageMissingPassword ) 
99108        cy 
100109            . el ( EDataTest . authentication_modal_error ) . should ( 'be.visible' ) . contains ( errorMessageMissingPassword ) 
101-             . get ( `${ elSelector ( EDataTest . authentication_modal ) }  ) . click ( ) 
110+             . elByClass ( EDataTestClass . app_dialog ) . within ( ( )  =>  { 
111+                 cy . elByClass ( EDataTestClass . app_close_button ) . click ( ) 
112+             } ) 
102113    } ) 
103114
104115    it ( 'should display sign-up error for existing use' ,  ( )  =>  { 
105116        cy 
106117            . el ( EDataTest . landing_sign_up_button ) . click ( ) 
107118            // To make close button unfocused 
108-             . elByClass ( EDataTestClass . app_card_content ) . should ( 'be.visible' ) . click ( ) 
119+             . elByClass ( EDataTestClass . app_dialog ) . should ( 'be.visible' ) . click ( ) 
109120            . get ( 'html' ) . toMatchSnapshot ( 'Sign up modal' ) 
110-             . get ( `${ elSelector ( EDataTest . authentication_modal ) }  ) . click ( ) 
121+             . elByClass ( EDataTestClass . app_dialog ) . within ( ( )  =>  { 
122+                 cy . elByClass ( EDataTestClass . app_close_button ) . click ( ) 
123+             } ) 
111124
112125            . authWithoutSession ( { 
113126                ...( Cypress . env ( 'testUser' )  ??  { } ) , 
0 commit comments