@@ -25,9 +25,8 @@ test('Requested feedback', async ({ page }) => {
25
25
26
26
await new RequestFeedbackPage ( page ) . gotoAndRequest ( [ Persona . Bernard , Persona . Charles ] , feedbackDetails . message ) ;
27
27
28
- // See the personas in the success page
29
- await expect ( page . getByText ( Persona . Bernard ) ) . toBeVisible ( ) ;
30
- await expect ( page . getByText ( Persona . Charles ) ) . toBeVisible ( ) ;
28
+ await expect ( page . getByText ( Persona . Bernard ) , 'Recipient should be visible in the success page' ) . toBeVisible ( ) ;
29
+ await expect ( page . getByText ( Persona . Charles ) , 'Recipient should be visible in the success page' ) . toBeVisible ( ) ;
31
30
32
31
const alfredHistoryPage = new FeedbackHistoryPage ( page ) ;
33
32
await alfredHistoryPage . goto ( 'sentRequest' ) ;
@@ -36,15 +35,15 @@ test('Requested feedback', async ({ page }) => {
36
35
const charlesDetailsLink = await alfredHistoryPage . findDetailsLink ( Persona . Charles ) ;
37
36
38
37
// See the personas in the history page
39
- await expect ( bernardDetailsLink ) . toBeVisible ( ) ;
40
- await expect ( charlesDetailsLink ) . toBeVisible ( ) ;
38
+ await expect ( bernardDetailsLink , 'Expected giver should be visible in the history page' ) . toBeVisible ( ) ;
39
+ await expect ( charlesDetailsLink , 'Expected giver should be visible in the history page' ) . toBeVisible ( ) ;
41
40
42
41
// Let's focus on Bernard
43
42
await bernardDetailsLink . click ( ) ;
44
43
45
44
await new FeedbackHistoryDetailsPage ( page ) . matchPending ( 'sentRequest' , Persona . Bernard , feedbackDetails . message ) ;
46
45
47
- await new UserMenuPage ( page ) . logout ( ) ;
46
+ await new UserMenuPage ( page ) . signOut ( ) ;
48
47
49
48
// ====== Bernard replies to Alfred request ======
50
49
@@ -54,7 +53,10 @@ test('Requested feedback', async ({ page }) => {
54
53
await bernardHistoryPage . goto ( 'receivedRequest' ) ;
55
54
56
55
const alfredDetailsLink = await bernardHistoryPage . findDetailsLink ( Persona . Alfred ) ;
57
- await expect ( alfredDetailsLink ) . toBeVisible ( ) ;
56
+ await expect (
57
+ alfredDetailsLink ,
58
+ 'Feedback receiver should be visible in the page "Répondre aux demandes de feedZback"' ,
59
+ ) . toBeVisible ( ) ;
58
60
await alfredDetailsLink . click ( ) ;
59
61
60
62
await new FeedbackHistoryDetailsPage ( page ) . matchPending ( 'receivedRequest' , Persona . Alfred , feedbackDetails . message ) ;
@@ -63,13 +65,12 @@ test('Requested feedback', async ({ page }) => {
63
65
64
66
await new GiveRequestedFeedbackPage ( page ) . give ( Persona . Alfred , feedbackDetails ) ;
65
67
66
- // See the persona in the success page
67
- await expect ( page . getByText ( Persona . Alfred ) ) . toBeVisible ( ) ;
68
+ await expect ( page . getByText ( Persona . Alfred ) , 'Feedback receiver should be visible in the success page' ) . toBeVisible ( ) ;
68
69
await page . getByRole ( 'button' , { name : 'Consulter le feedZback' } ) . click ( ) ;
69
70
70
71
await new FeedbackHistoryDetailsPage ( page ) . matchDone ( 'given' , Persona . Alfred , feedbackDetails ) ;
71
72
72
- await new UserMenuPage ( page ) . logout ( ) ;
73
+ await new UserMenuPage ( page ) . signOut ( ) ;
73
74
74
75
// ====== Alfred has received feedback from Bernard ======
75
76
@@ -79,29 +80,29 @@ test('Requested feedback', async ({ page }) => {
79
80
await alfredHistoryPage2 . goto ( 'received' ) ;
80
81
81
82
const bernardDetailsLink2 = await alfredHistoryPage2 . findDetailsLink ( Persona . Bernard ) ;
82
- await expect ( bernardDetailsLink2 ) . toBeVisible ( ) ;
83
+ await expect ( bernardDetailsLink2 , 'Feedback giver should be visible in the history page' ) . toBeVisible ( ) ;
83
84
await bernardDetailsLink2 . click ( ) ;
84
85
85
86
await new FeedbackHistoryDetailsPage ( page ) . matchDone ( 'received' , Persona . Bernard , feedbackDetails ) ;
86
87
87
88
// ====== Alfred sets Daniel as its manager ======
88
89
89
90
await new SettingsPage ( page ) . gotoAndSetManager ( Persona . Daniel ) ;
90
- await new UserMenuPage ( page ) . logout ( ) ;
91
+ await new UserMenuPage ( page ) . signOut ( ) ;
91
92
92
93
// ====== Daniel can now view the feedbacks that Alfred has shared with him ======
93
94
94
95
await new SignInPage ( page ) . gotoAndSignIn ( Persona . Daniel ) ;
95
96
96
- await expect ( page . getByRole ( 'link' , { name : 'Manager' } ) ) . toBeVisible ( ) ;
97
+ await expect ( page . getByRole ( 'link' , { name : 'Manager' } ) , 'Manager link should be visible' ) . toBeVisible ( ) ;
97
98
98
99
const managerPage = new ManagerPage ( page ) ;
99
100
managerPage . goto ( ) ;
100
101
managerPage . selectManaged ( Persona . Alfred ) ;
101
102
102
103
// View the feedback sent by Bernard
103
104
const bernardDetailsLink3 = await managerPage . findGiverDetailsLink ( Persona . Bernard ) ;
104
- await expect ( bernardDetailsLink3 ) . toBeVisible ( ) ;
105
+ await expect ( bernardDetailsLink3 , 'Shared feedback (done) link should be visible' ) . toBeVisible ( ) ;
105
106
await bernardDetailsLink3 . click ( ) ;
106
107
await managerPage . matchDoneFeedback ( Persona . Bernard , Persona . Alfred , feedbackDetails ) ;
107
108
@@ -111,7 +112,7 @@ test('Requested feedback', async ({ page }) => {
111
112
112
113
// View the feedback expected from Charles
113
114
const charlesDetailsLink2 = await managerPage . findGiverDetailsLink ( Persona . Charles ) ;
114
- await expect ( charlesDetailsLink2 ) . toBeVisible ( ) ;
115
+ await expect ( charlesDetailsLink2 , 'Shared feedback (pending) link should be visible' ) . toBeVisible ( ) ;
115
116
await charlesDetailsLink2 . click ( ) ;
116
117
await managerPage . matchPendingFeedback ( Persona . Charles , Persona . Alfred , feedbackDetails . message ) ;
117
118
} ) ;
0 commit comments