1
1
import { _electron , Page , test } from '@playwright/test' ;
2
+ import { sleepFor } from '../../session/utils/Promise' ;
2
3
import { beforeAllClean , forceCloseAllWindows } from './setup/beforeEach' ;
3
4
import { newUser } from './setup/new_user' ;
4
5
import { openAppAndWait } from './setup/open' ;
@@ -36,42 +37,40 @@ test.describe('Password checks', () => {
36
37
await clickOnTestIdWithText ( window , 'set-password-button' ) ;
37
38
// Enter password
38
39
await typeIntoInput ( window , 'password-input' , testPassword ) ;
39
- await window . keyboard . press ( 'Delete' ) ;
40
40
// Confirm password
41
41
await typeIntoInput ( window , 'password-input-confirm' , testPassword ) ;
42
- await window . keyboard . press ( 'Delete' ) ;
43
- // Click OK
44
- await clickOnMatchingText ( window , 'OK' ) ;
45
- // await window.keyboard.press('Enter');
42
+ // Click Done
43
+ await clickOnMatchingText ( window , 'Done' ) ;
46
44
// Check toast notification
47
45
await waitForTestIdWithText (
48
46
window ,
49
47
'session-toast' ,
50
- 'Your password has been set. Please keep it safe'
48
+ 'Your password has been set. Please keep it safe. '
51
49
) ;
50
+ // Click on settings tab
51
+ await sleepFor ( 300 ) ;
52
+ await clickOnTestIdWithText ( window , 'settings-section' ) ;
52
53
// Type password into input field
53
54
54
55
await typeIntoInput ( window , 'password-input' , testPassword ) ;
55
- // Click OK
56
- await clickOnMatchingText ( window , 'OK' ) ;
56
+
57
+ // Click Done
58
+ await clickOnMatchingText ( window , 'Done' ) ;
59
+ await clickOnTestIdWithText ( window , 'settings-section' ) ;
60
+
57
61
// Change password
58
- await clickOnMatchingText ( window , 'Change Password' ) ;
62
+ await clickOnTestIdWithText ( window , 'change-password-settings-button' , 'Change Password' ) ;
63
+
64
+ console . warn ( 'clicked Change Password' ) ;
59
65
// Enter old password
60
66
await typeIntoInput ( window , 'password-input' , testPassword ) ;
61
- await window . keyboard . press ( 'Delete' ) ;
62
67
// Enter new password
63
68
await typeIntoInput ( window , 'password-input-confirm' , newTestPassword ) ;
64
- await window . keyboard . press ( 'Delete' ) ;
65
- // await window.fill('#password-modal-input-confirm', newTestPassword);
66
69
await window . keyboard . press ( 'Tab' ) ;
67
70
// Confirm new password
68
71
await typeIntoInput ( window , 'password-input-reconfirm' , newTestPassword ) ;
69
- await window . keyboard . press ( 'Delete' ) ;
70
- // await window.fill('#password-modal-input-reconfirm', newTestPassword);
71
72
// Press enter on keyboard
72
73
await window . keyboard . press ( 'Enter' ) ;
73
- // Select OK
74
- await clickOnMatchingText ( window , 'OK' ) ;
75
74
// Check toast notification for 'changed password'
76
75
await waitForTestIdWithText (
77
76
window ,
@@ -92,36 +91,44 @@ test.describe('Password checks', () => {
92
91
await clickOnMatchingText ( window , 'Set Password' ) ;
93
92
// Enter password
94
93
await typeIntoInput ( window , 'password-input' , testPassword ) ;
95
- await window . keyboard . press ( 'Delete' ) ;
96
94
// Confirm password
97
95
await typeIntoInput ( window , 'password-input-confirm' , testPassword ) ;
98
- await window . keyboard . press ( 'Delete' ) ;
99
- // Click OK
96
+ // Click Done
100
97
await window . keyboard . press ( 'Enter' ) ;
98
+ // // Click on settings tab
99
+ await sleepFor ( 100 ) ;
100
+ await clickOnTestIdWithText ( window , 'settings-section' ) ;
101
+
101
102
// Type password into input field
103
+ await sleepFor ( 100 ) ;
102
104
await typeIntoInput ( window , 'password-input' , testPassword ) ;
103
- await window . keyboard . press ( 'Delete' ) ;
104
- // Click OK
105
- await clickOnMatchingText ( window , 'OK' ) ;
106
- // Navigate away from settings tab
105
+ // Click Done
106
+ await clickOnMatchingText ( window , 'Done' ) ;
107
+ await sleepFor ( 100 ) ;
108
+ await window . mouse . click ( 0 , 0 ) ;
107
109
await clickOnTestIdWithText ( window , 'message-section' ) ;
110
+ await sleepFor ( 100 ) ;
111
+
108
112
// // Click on settings tab
113
+ await sleepFor ( 1000 ) ;
109
114
await clickOnTestIdWithText ( window , 'settings-section' ) ;
110
115
// // Try with incorrect password
111
- await typeIntoInput ( window , 'password-input' , '0000' ) ;
112
- await window . keyboard . press ( 'Delete' ) ;
116
+ await typeIntoInput ( window , 'password-input' , '000000' ) ;
113
117
// Confirm
114
- await clickOnMatchingText ( window , 'OK ' ) ;
118
+ await clickOnMatchingText ( window , 'Done ' ) ;
115
119
// // invalid password banner showing?
116
120
await waitForMatchingText ( window , 'Invalid password' ) ;
117
121
// // Empty password
118
122
// // Navigate away from settings tab
123
+ await window . mouse . click ( 0 , 0 ) ;
124
+ await sleepFor ( 100 ) ;
119
125
await clickOnTestIdWithText ( window , 'message-section' ) ;
126
+ await sleepFor ( 100 ) ;
120
127
// // Click on settings tab
121
128
await clickOnTestIdWithText ( window , 'settings-section' ) ;
122
129
// // No password entered
123
- await clickOnMatchingText ( window , 'OK ' ) ;
130
+ await clickOnMatchingText ( window , 'Done ' ) ;
124
131
// // Banner should ask for password to be entered
125
- await waitForMatchingText ( window , 'Please enter your password' ) ;
132
+ await waitForMatchingText ( window , 'Enter password' ) ;
126
133
} ) ;
127
134
} ) ;
0 commit comments