@@ -18,26 +18,22 @@ test.describe.serial('message-composer', () => {
1818 test . beforeEach ( async ( { page } ) => {
1919 poHomeChannel = new HomeChannel ( page ) ;
2020
21- await page . goto ( '/home' ) ;
21+ await poHomeChannel . gotoChannel ( targetChannel ) ;
2222 } ) ;
2323
2424 test ( 'should have all formatters and the main actions visible on toolbar' , async ( ) => {
25- await poHomeChannel . navbar . openChat ( targetChannel ) ;
2625 await poHomeChannel . content . sendMessage ( 'hello composer' ) ;
2726
2827 await expect ( poHomeChannel . composer . allPrimaryActions ) . toHaveCount ( 12 ) ;
2928 } ) ;
3029
3130 test ( 'should have only the main formatter and the main action' , async ( { page } ) => {
3231 await page . setViewportSize ( { width : 768 , height : 600 } ) ;
33- await poHomeChannel . navbar . openChat ( targetChannel ) ;
3432
3533 await expect ( poHomeChannel . composer . allPrimaryActions ) . toHaveCount ( 6 ) ;
3634 } ) ;
3735
3836 test ( 'should navigate on toolbar using arrow keys' , async ( { page } ) => {
39- await poHomeChannel . navbar . openChat ( targetChannel ) ;
40-
4137 await page . keyboard . press ( 'Tab' ) ;
4238 await page . keyboard . press ( 'ArrowRight' ) ;
4339 await page . keyboard . press ( 'ArrowRight' ) ;
@@ -48,8 +44,6 @@ test.describe.serial('message-composer', () => {
4844 } ) ;
4945
5046 test ( 'should move the focus away from toolbar using tab key' , async ( { page } ) => {
51- await poHomeChannel . navbar . openChat ( targetChannel ) ;
52-
5347 await page . keyboard . press ( 'Tab' ) ;
5448 await page . keyboard . press ( 'Tab' ) ;
5549
@@ -58,7 +52,6 @@ test.describe.serial('message-composer', () => {
5852
5953 test ( 'should add a link to the selected text' , async ( { page } ) => {
6054 const url = faker . internet . url ( ) ;
61- await poHomeChannel . navbar . openChat ( targetChannel ) ;
6255
6356 await page . keyboard . type ( 'hello composer' ) ;
6457 await page . keyboard . press ( 'Control+A' ) ; // on Windows and Linux
@@ -71,7 +64,6 @@ test.describe.serial('message-composer', () => {
7164 } ) ;
7265
7366 test ( 'should select popup item and not send the message when pressing enter' , async ( { page } ) => {
74- await poHomeChannel . navbar . openChat ( targetChannel ) ;
7567 await poHomeChannel . content . sendMessage ( 'hello composer' ) ;
7668
7769 await test . step ( 'mention popup' , async ( ) => {
@@ -106,7 +98,6 @@ test.describe.serial('message-composer', () => {
10698 } ) ;
10799
108100 test ( 'should list popup items correctly' , async ( { page } ) => {
109- await poHomeChannel . navbar . openChat ( targetChannel ) ;
110101 await poHomeChannel . content . sendMessage ( 'hello composer' ) ;
111102
112103 await test . step ( 'mention popup' , async ( ) => {
@@ -117,7 +108,6 @@ test.describe.serial('message-composer', () => {
117108 } ) ;
118109
119110 test ( 'should close mention popup when canceling a message edit via "Cancel" button' , async ( { page } ) => {
120- await poHomeChannel . navbar . openChat ( targetChannel ) ;
121111 await poHomeChannel . content . sendMessage ( 'hello composer' ) ;
122112
123113 await test . step ( 'expect to edit last message' , async ( ) => {
@@ -145,7 +135,6 @@ test.describe.serial('message-composer', () => {
145135 } ) ;
146136
147137 test ( 'should close mention popup when canceling a message edit via keyboard' , async ( { page } ) => {
148- await poHomeChannel . navbar . openChat ( targetChannel ) ;
149138 await poHomeChannel . content . sendMessage ( 'hello composer' ) ;
150139
151140 await test . step ( 'expect to edit last message' , async ( ) => {
@@ -174,8 +163,6 @@ test.describe.serial('message-composer', () => {
174163
175164 test . describe ( 'audio recorder' , ( ) => {
176165 test ( 'should open audio recorder' , async ( ) => {
177- await poHomeChannel . navbar . openChat ( targetChannel ) ;
178-
179166 await test . step ( 'should be able to record an audio with text content in composer ' , async ( ) => {
180167 await poHomeChannel . composer . inputMessage . fill ( 'this is a message with audio message' ) ;
181168 await expect ( poHomeChannel . composer . btnAudioMessage ) . toBeEnabled ( ) ;
@@ -186,7 +173,6 @@ test.describe.serial('message-composer', () => {
186173 } ) ;
187174
188175 test ( 'should stop recording when clicking on cancel' , async ( ) => {
189- await poHomeChannel . navbar . openChat ( targetChannel ) ;
190176 await poHomeChannel . composer . btnAudioMessage . click ( ) ;
191177 await expect ( poHomeChannel . audioRecorder ) . toBeVisible ( ) ;
192178
@@ -195,7 +181,6 @@ test.describe.serial('message-composer', () => {
195181 } ) ;
196182
197183 test ( 'should attach file to the composer when clicking on "Finish recording"' , async ( { page } ) => {
198- await poHomeChannel . navbar . openChat ( targetChannel ) ;
199184 await poHomeChannel . composer . btnAudioMessage . click ( ) ;
200185 await expect ( poHomeChannel . audioRecorder ) . toBeVisible ( ) ;
201186
0 commit comments