@@ -14,17 +14,33 @@ export class ChannelPage {
14
14
readonly channelTab = ( ) : Locator => this . page . getByRole ( 'link' , { name : 'Channels' } ) . getByRole ( 'button' )
15
15
readonly channelTable = ( ) : Locator => this . page . getByRole ( 'table' )
16
16
readonly channel = ( channel : string ) : Locator => this . page . getByRole ( 'button' , { name : channel } )
17
+ readonly channelNameOnDetail = ( channel : string ) : Locator =>
18
+ this . page
19
+ . locator ( 'span.labelOnPanel' , { hasText : 'Name' } )
20
+ . locator ( 'xpath=following-sibling::div[1]' )
21
+ . locator ( 'button' , { hasText : channel } )
22
+
17
23
readonly chooseChannel = ( channel : string ) : Locator => this . page . getByRole ( 'button' , { name : channel } )
18
- readonly closePopupWindow = ( ) : Locator => this . page . locator ( '.root > div > .antiButton' ) . first ( )
24
+ readonly closePopupWindow = ( ) : Locator => this . page . locator ( '.notifyPopup button[data-id="btnNotifyClose"]' )
19
25
readonly openAddMemberToChannel = ( userName : string ) : Locator => this . page . getByRole ( 'button' , { name : userName } )
20
26
readonly addMemberToChannelButton = ( userName : string ) : Locator => this . page . getByText ( userName )
21
27
readonly joinChannelButton = ( ) : Locator => this . page . getByRole ( 'button' , { name : 'Join' } )
22
- readonly addEmojiButton = ( ) : Locator => this . page . locator ( '.root > button' ) . first ( )
28
+ readonly addEmojiButton = ( ) : Locator =>
29
+ this . page . locator ( '.activityMessage-actionPopup > button[data-id$="AddReactionAction"]' )
30
+
23
31
readonly selectEmoji = ( emoji : string ) : Locator => this . page . getByText ( emoji )
24
- readonly saveMessageButton = ( ) : Locator => this . page . locator ( '.root > button:nth-child(2)' )
25
- readonly pinMessageButton = ( ) : Locator => this . page . locator ( '.root > button:nth-child(3)' )
26
- readonly replyButton = ( ) : Locator => this . page . locator ( '.root > button:nth-child(4)' )
27
- readonly openMoreButton = ( ) : Locator => this . page . locator ( '.root > button:nth-child(5)' )
32
+ readonly saveMessageButton = ( ) : Locator =>
33
+ this . page . locator ( '.activityMessage-actionPopup > button[data-id$="SaveForLaterAction"]' )
34
+
35
+ readonly pinMessageButton = ( ) : Locator =>
36
+ this . page . locator ( '.activityMessage-actionPopup > button[data-id$="PinMessageAction"]' )
37
+
38
+ readonly replyButton = ( ) : Locator =>
39
+ this . page . locator ( '.activityMessage-actionPopup > button[data-id$="ReplyToThreadAction"]' )
40
+
41
+ readonly openMoreButton = ( ) : Locator =>
42
+ this . page . locator ( '.activityMessage-actionPopup > button[data-id="btnMoreActions"]' )
43
+
28
44
readonly messageSaveMarker = ( ) : Locator => this . page . locator ( '.saveMarker' )
29
45
readonly saveMessageTab = ( ) : Locator => this . page . getByRole ( 'button' , { name : 'Saved' } )
30
46
readonly pinnedMessageButton = ( ) : Locator => this . page . getByRole ( 'button' , { name : 'pinned' } )
@@ -36,7 +52,7 @@ export class ChannelPage {
36
52
readonly deleteMessageButton = ( ) : Locator => this . page . getByRole ( 'button' , { name : 'Delete' } )
37
53
readonly updateButton = ( ) : Locator => this . page . getByRole ( 'button' , { name : 'Update' } )
38
54
readonly openChannelDetails = ( ) : Locator => this . page . locator ( '.hulyHeader-buttonsGroup > .antiButton' )
39
- readonly changeChannelNameConfirm = ( ) : Locator => this . page . locator ( '.ml-2 > .antiButton ' )
55
+ readonly changeChannelNameConfirm = ( ) : Locator => this . page . locator ( '.selectPopup button ' )
40
56
readonly privateOrPublicChangeButton = ( change : string , autoJoin : boolean ) : Locator =>
41
57
this . page
42
58
. locator ( 'span.labelOnPanel' , { hasText : autoJoin ? 'Auto join' : 'Private' } )
@@ -64,7 +80,7 @@ export class ChannelPage {
64
80
}
65
81
66
82
async changeChannelName ( channel : string ) : Promise < void > {
67
- await this . channel ( channel ) . nth ( 2 ) . click ( )
83
+ await this . channelNameOnDetail ( channel ) . click ( )
68
84
await this . page . keyboard . type ( 'New Channel Name' )
69
85
await this . changeChannelNameConfirm ( ) . click ( )
70
86
}
0 commit comments