@@ -3,6 +3,7 @@ import { AccountPage } from "./account-page"
3
3
import { camelCase } from "lodash"
4
4
5
5
export class ProfilePage extends AccountPage {
6
+ profileWrapper : Locator
6
7
accountNameEditor : Locator
7
8
accountEmailEditor : Locator
8
9
accountPhoneEditor : Locator
@@ -21,6 +22,24 @@ export class ProfilePage extends AccountPage {
21
22
passwordSaveButton : Locator
22
23
billingAddressSaveButton : Locator
23
24
25
+ savedName : Locator
26
+ savedEmail : Locator
27
+ savedPhone : Locator
28
+ savedPassword : Locator
29
+ savedBillingAddress : Locator
30
+
31
+ nameSuccessMessage : Locator
32
+ emailSuccessMessage : Locator
33
+ phoneSuccessMessage : Locator
34
+ passwordSuccessMessage : Locator
35
+ billingAddressSuccessMessage : Locator
36
+
37
+ nameErrorMessage : Locator
38
+ emailErrorMessage : Locator
39
+ phoneErrorMessage : Locator
40
+ passwordErrorMessage : Locator
41
+ billingAddressErrorMessage : Locator
42
+
24
43
emailInput : Locator
25
44
firstNameInput : Locator
26
45
lastNameInput : Locator
@@ -43,6 +62,7 @@ export class ProfilePage extends AccountPage {
43
62
44
63
constructor ( page : Page ) {
45
64
super ( page )
65
+ this . profileWrapper = page . getByTestId ( "profile-page-wrapper" )
46
66
this . accountNameEditor = this . container . getByTestId ( "account-name-editor" )
47
67
this . accountEmailEditor = this . container . getByTestId ( "account-email-editor" )
48
68
this . accountPhoneEditor = this . container . getByTestId ( "account-phone-editor" )
@@ -69,6 +89,32 @@ export class ProfilePage extends AccountPage {
69
89
this . billingAddressSaveButton =
70
90
this . accountBillingAddressEditor . getByTestId ( "save-button" )
71
91
92
+ this . savedName = this . accountNameEditor . getByTestId ( "current-info" )
93
+ this . savedEmail = this . accountEmailEditor . getByTestId ( "current-info" )
94
+ this . savedPhone = this . accountPhoneEditor . getByTestId ( "current-info" )
95
+ this . savedPassword = this . accountPasswordEditor . getByTestId ( "current-info" )
96
+ this . savedBillingAddress =
97
+ this . accountBillingAddressEditor . getByTestId ( "current-info" )
98
+ this . nameSuccessMessage =
99
+ this . accountNameEditor . getByTestId ( "success-message" )
100
+ this . emailSuccessMessage =
101
+ this . accountEmailEditor . getByTestId ( "success-message" )
102
+ this . phoneSuccessMessage =
103
+ this . accountPhoneEditor . getByTestId ( "success-message" )
104
+ this . passwordSuccessMessage =
105
+ this . accountPasswordEditor . getByTestId ( "success-message" )
106
+ this . billingAddressSuccessMessage =
107
+ this . accountBillingAddressEditor . getByTestId ( "success-message" )
108
+ this . nameErrorMessage = this . accountNameEditor . getByTestId ( "error-message" )
109
+ this . emailErrorMessage =
110
+ this . accountEmailEditor . getByTestId ( "error-message" )
111
+ this . phoneErrorMessage =
112
+ this . accountPhoneEditor . getByTestId ( "error-message" )
113
+ this . passwordErrorMessage =
114
+ this . accountPasswordEditor . getByTestId ( "error-message" )
115
+ this . billingAddressErrorMessage =
116
+ this . accountBillingAddressEditor . getByTestId ( "error-message" )
117
+
72
118
this . firstNameInput = page . getByTestId ( "first-name-input" )
73
119
this . lastNameInput = page . getByTestId ( "last-name-input" )
74
120
this . emailInput = page . getByTestId ( "email-input" )
@@ -111,4 +157,10 @@ export class ProfilePage extends AccountPage {
111
157
}
112
158
return o
113
159
}
160
+
161
+ async goto ( ) {
162
+ super . goto ( )
163
+ await this . profileLink . click ( )
164
+ await this . profileWrapper . waitFor ( { state : "visible" } )
165
+ }
114
166
}
0 commit comments