File tree Expand file tree Collapse file tree 3 files changed +26
-14
lines changed
plugins/login-resources/src/components
qms-tests/sanity/tests/model Expand file tree Collapse file tree 3 files changed +26
-14
lines changed Original file line number Diff line number Diff line change 4545 export let withProviders: boolean = false
4646 export let subtitle: string | undefined = undefined
4747 export let signUpDisabled = false
48+ export let isLoading: boolean = false
4849
4950 const validate = makeSequential (async function validateAsync (language : string ): Promise <boolean > {
50- if (ignoreInitialValidation ) return true
51+ if (ignoreInitialValidation || isLoading ) return true
5152
5253 for (const field of fields ) {
5354 const v = object [field .name ]
Original file line number Diff line number Diff line change 4848 }
4949
5050 let status = OK
51+ let isLoading = false
5152
5253 const action = {
5354 i18n: login .string .LogIn ,
5455 func : async () => {
55- status = new Status (Severity .INFO , login .status .ConnectingToServer , {})
56- const [loginStatus, result] = await doLogin (object .username , object .password )
57- status = loginStatus
56+ isLoading = true
57+ try {
58+ status = new Status (Severity .INFO , login .status .ConnectingToServer , {})
59+ const [loginStatus, result] = await doLogin (object .username , object .password )
60+ status = loginStatus
5861
59- if (onLogin !== undefined ) {
60- void onLogin (result , status )
61- } else {
62- await doLoginNavigate (
63- result ,
64- (st ) => {
65- status = st
66- },
67- navigateUrl
68- )
62+ if (onLogin !== undefined ) {
63+ void onLogin (result , status )
64+ } else {
65+ await doLoginNavigate (
66+ result ,
67+ (st ) => {
68+ status = st
69+ },
70+ navigateUrl
71+ )
72+ }
73+ } finally {
74+ isLoading = false
6975 }
7076 }
7177 }
7985 {object }
8086 {action }
8187 {signUpDisabled }
88+ {isLoading }
8289 bottomActions ={[recoveryAction ]}
8390 ignoreInitialValidation
8491 withProviders
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ export class LoginPage {
2626 async login ( email : string , password : string ) : Promise < void > {
2727 await this . inputEmail . fill ( email )
2828 await this . inputPassword . fill ( password )
29+
30+ // Wait for form validation to complete
31+ await this . page . waitForTimeout ( 1000 )
32+
2933 expect ( await this . buttonLogin . isEnabled ( ) ) . toBe ( true )
3034 await this . buttonLogin . click ( )
3135 }
You can’t perform that action at this time.
0 commit comments