@mattermost/playwright-lib 10.6.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/README.md +214 -0
  2. package/dist/asset/mattermost-icon_128x128.png +0 -0
  3. package/dist/browser_context.d.ts +17 -0
  4. package/dist/browser_context.js +71 -0
  5. package/dist/browser_context.js.map +1 -0
  6. package/dist/constant.d.ts +3 -0
  7. package/dist/constant.js +8 -0
  8. package/dist/constant.js.map +1 -0
  9. package/dist/file.d.ts +42 -0
  10. package/dist/file.js +74 -0
  11. package/dist/file.js.map +1 -0
  12. package/dist/flag.d.ts +7 -0
  13. package/dist/flag.js +76 -0
  14. package/dist/flag.js.map +1 -0
  15. package/dist/global_setup.d.ts +3 -0
  16. package/dist/global_setup.js +173 -0
  17. package/dist/global_setup.js.map +1 -0
  18. package/dist/index.d.ts +9 -0
  19. package/dist/index.js +47 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/mock_browser_api.d.ts +31 -0
  22. package/dist/mock_browser_api.js +71 -0
  23. package/dist/mock_browser_api.js.map +1 -0
  24. package/dist/server/channel.d.ts +12 -0
  25. package/dist/server/channel.js +25 -0
  26. package/dist/server/channel.js.map +1 -0
  27. package/dist/server/client.d.ts +16 -0
  28. package/dist/server/client.js +39 -0
  29. package/dist/server/client.js.map +1 -0
  30. package/dist/server/default_config.d.ts +2 -0
  31. package/dist/server/default_config.js +755 -0
  32. package/dist/server/default_config.js.map +1 -0
  33. package/dist/server/index.d.ts +7 -0
  34. package/dist/server/init.d.ts +23 -0
  35. package/dist/server/init.js +73 -0
  36. package/dist/server/init.js.map +1 -0
  37. package/dist/server/post.d.ts +2 -0
  38. package/dist/server/post.js +31 -0
  39. package/dist/server/post.js.map +1 -0
  40. package/dist/server/team.d.ts +2 -0
  41. package/dist/server/team.js +18 -0
  42. package/dist/server/team.js.map +1 -0
  43. package/dist/server/user.d.ts +3 -0
  44. package/dist/server/user.js +33 -0
  45. package/dist/server/user.js.map +1 -0
  46. package/dist/test_action.d.ts +4 -0
  47. package/dist/test_action.js +24 -0
  48. package/dist/test_action.js.map +1 -0
  49. package/dist/test_config.d.ts +20 -0
  50. package/dist/test_config.js +82 -0
  51. package/dist/test_config.js.map +1 -0
  52. package/dist/test_fixture.d.ts +72 -0
  53. package/dist/test_fixture.js +172 -0
  54. package/dist/test_fixture.js.map +1 -0
  55. package/dist/types.d.ts +91 -0
  56. package/dist/ui/components/channels/app_bar.d.ts +7 -0
  57. package/dist/ui/components/channels/app_bar.js +20 -0
  58. package/dist/ui/components/channels/app_bar.js.map +1 -0
  59. package/dist/ui/components/channels/center_view.d.ts +52 -0
  60. package/dist/ui/components/channels/center_view.js +124 -0
  61. package/dist/ui/components/channels/center_view.js.map +1 -0
  62. package/dist/ui/components/channels/delete_post_confirmation_dialog.d.ts +11 -0
  63. package/dist/ui/components/channels/delete_post_confirmation_dialog.js +35 -0
  64. package/dist/ui/components/channels/delete_post_confirmation_dialog.js.map +1 -0
  65. package/dist/ui/components/channels/delete_post_modal.d.ts +8 -0
  66. package/dist/ui/components/channels/delete_post_modal.js +26 -0
  67. package/dist/ui/components/channels/delete_post_modal.js.map +1 -0
  68. package/dist/ui/components/channels/emoji_gif_picker.d.ts +16 -0
  69. package/dist/ui/components/channels/emoji_gif_picker.js +50 -0
  70. package/dist/ui/components/channels/emoji_gif_picker.js.map +1 -0
  71. package/dist/ui/components/channels/find_channels_modal.d.ts +8 -0
  72. package/dist/ui/components/channels/find_channels_modal.js +22 -0
  73. package/dist/ui/components/channels/find_channels_modal.js.map +1 -0
  74. package/dist/ui/components/channels/generic_confirm_modal.d.ts +16 -0
  75. package/dist/ui/components/channels/generic_confirm_modal.js +40 -0
  76. package/dist/ui/components/channels/generic_confirm_modal.js.map +1 -0
  77. package/dist/ui/components/channels/header.d.ts +6 -0
  78. package/dist/ui/components/channels/header.js +18 -0
  79. package/dist/ui/components/channels/header.js.map +1 -0
  80. package/dist/ui/components/channels/message_priority.d.ts +18 -0
  81. package/dist/ui/components/channels/message_priority.js +66 -0
  82. package/dist/ui/components/channels/message_priority.js.map +1 -0
  83. package/dist/ui/components/channels/post.d.ts +29 -0
  84. package/dist/ui/components/channels/post.js +63 -0
  85. package/dist/ui/components/channels/post.js.map +1 -0
  86. package/dist/ui/components/channels/post_create.d.ts +41 -0
  87. package/dist/ui/components/channels/post_create.js +118 -0
  88. package/dist/ui/components/channels/post_create.js.map +1 -0
  89. package/dist/ui/components/channels/post_dot_menu.d.ts +20 -0
  90. package/dist/ui/components/channels/post_dot_menu.js +47 -0
  91. package/dist/ui/components/channels/post_dot_menu.js.map +1 -0
  92. package/dist/ui/components/channels/post_edit.d.ts +21 -0
  93. package/dist/ui/components/channels/post_edit.js +76 -0
  94. package/dist/ui/components/channels/post_edit.js.map +1 -0
  95. package/dist/ui/components/channels/post_menu.d.ts +26 -0
  96. package/dist/ui/components/channels/post_menu.js +54 -0
  97. package/dist/ui/components/channels/post_menu.js.map +1 -0
  98. package/dist/ui/components/channels/post_reminder_menu.d.ts +11 -0
  99. package/dist/ui/components/channels/post_reminder_menu.js +29 -0
  100. package/dist/ui/components/channels/post_reminder_menu.js.map +1 -0
  101. package/dist/ui/components/channels/restore_post_confirmation_dialog.d.ts +10 -0
  102. package/dist/ui/components/channels/restore_post_confirmation_dialog.js +30 -0
  103. package/dist/ui/components/channels/restore_post_confirmation_dialog.js.map +1 -0
  104. package/dist/ui/components/channels/scheduled_draft_menu.d.ts +8 -0
  105. package/dist/ui/components/channels/scheduled_draft_menu.js +23 -0
  106. package/dist/ui/components/channels/scheduled_draft_menu.js.map +1 -0
  107. package/dist/ui/components/channels/scheduled_draft_modal.d.ts +20 -0
  108. package/dist/ui/components/channels/scheduled_draft_modal.js +84 -0
  109. package/dist/ui/components/channels/scheduled_draft_modal.js.map +1 -0
  110. package/dist/ui/components/channels/search_popover.d.ts +15 -0
  111. package/dist/ui/components/channels/search_popover.js +43 -0
  112. package/dist/ui/components/channels/search_popover.js.map +1 -0
  113. package/dist/ui/components/channels/settings/notification_settings.d.ts +13 -0
  114. package/dist/ui/components/channels/settings/notification_settings.js +41 -0
  115. package/dist/ui/components/channels/settings/notification_settings.js.map +1 -0
  116. package/dist/ui/components/channels/settings/settings_modal.d.ts +11 -0
  117. package/dist/ui/components/channels/settings/settings_modal.js +32 -0
  118. package/dist/ui/components/channels/settings/settings_modal.js.map +1 -0
  119. package/dist/ui/components/channels/sidebar_left.d.ts +24 -0
  120. package/dist/ui/components/channels/sidebar_left.js +54 -0
  121. package/dist/ui/components/channels/sidebar_left.js.map +1 -0
  122. package/dist/ui/components/channels/sidebar_right.d.ts +38 -0
  123. package/dist/ui/components/channels/sidebar_right.js +87 -0
  124. package/dist/ui/components/channels/sidebar_right.js.map +1 -0
  125. package/dist/ui/components/channels/thread_footer.d.ts +11 -0
  126. package/dist/ui/components/channels/thread_footer.js +27 -0
  127. package/dist/ui/components/channels/thread_footer.js.map +1 -0
  128. package/dist/ui/components/channels/user_profile_popover.d.ts +7 -0
  129. package/dist/ui/components/channels/user_profile_popover.js +21 -0
  130. package/dist/ui/components/channels/user_profile_popover.js.map +1 -0
  131. package/dist/ui/components/footer.d.ts +11 -0
  132. package/dist/ui/components/footer.js +28 -0
  133. package/dist/ui/components/footer.js.map +1 -0
  134. package/dist/ui/components/global_header.d.ts +15 -0
  135. package/dist/ui/components/global_header.js +46 -0
  136. package/dist/ui/components/global_header.js.map +1 -0
  137. package/dist/ui/components/index.d.ts +73 -0
  138. package/dist/ui/components/index.js +77 -0
  139. package/dist/ui/components/index.js.map +1 -0
  140. package/dist/ui/components/main_header.d.ts +8 -0
  141. package/dist/ui/components/main_header.js +22 -0
  142. package/dist/ui/components/main_header.js.map +1 -0
  143. package/dist/ui/components/system_console/navbar.d.ts +6 -0
  144. package/dist/ui/components/system_console/navbar.js +18 -0
  145. package/dist/ui/components/system_console/navbar.js.map +1 -0
  146. package/dist/ui/components/system_console/sections/system_users/column_toggle_menu.d.ts +22 -0
  147. package/dist/ui/components/system_console/sections/system_users/column_toggle_menu.js +47 -0
  148. package/dist/ui/components/system_console/sections/system_users/column_toggle_menu.js.map +1 -0
  149. package/dist/ui/components/system_console/sections/system_users/feature_discovery.d.ts +10 -0
  150. package/dist/ui/components/system_console/sections/system_users/feature_discovery.js +24 -0
  151. package/dist/ui/components/system_console/sections/system_users/feature_discovery.js.map +1 -0
  152. package/dist/ui/components/system_console/sections/system_users/filter_menu.d.ts +21 -0
  153. package/dist/ui/components/system_console/sections/system_users/filter_menu.js +42 -0
  154. package/dist/ui/components/system_console/sections/system_users/filter_menu.js.map +1 -0
  155. package/dist/ui/components/system_console/sections/system_users/filter_popover.d.ts +30 -0
  156. package/dist/ui/components/system_console/sections/system_users/filter_popover.js +61 -0
  157. package/dist/ui/components/system_console/sections/system_users/filter_popover.js.map +1 -0
  158. package/dist/ui/components/system_console/sections/system_users/mobile_security.d.ts +23 -0
  159. package/dist/ui/components/system_console/sections/system_users/mobile_security.js +56 -0
  160. package/dist/ui/components/system_console/sections/system_users/mobile_security.js.map +1 -0
  161. package/dist/ui/components/system_console/sections/system_users/system_users.d.ts +58 -0
  162. package/dist/ui/components/system_console/sections/system_users/system_users.js +114 -0
  163. package/dist/ui/components/system_console/sections/system_users/system_users.js.map +1 -0
  164. package/dist/ui/components/system_console/sidebar.d.ts +17 -0
  165. package/dist/ui/components/system_console/sidebar.js +37 -0
  166. package/dist/ui/components/system_console/sidebar.js.map +1 -0
  167. package/dist/ui/pages/channels.d.ts +31 -0
  168. package/dist/ui/pages/channels.js +79 -0
  169. package/dist/ui/pages/channels.js.map +1 -0
  170. package/dist/ui/pages/drafts.d.ts +30 -0
  171. package/dist/ui/pages/drafts.js +114 -0
  172. package/dist/ui/pages/drafts.js.map +1 -0
  173. package/dist/ui/pages/index.d.ts +19 -0
  174. package/dist/ui/pages/index.js +34 -0
  175. package/dist/ui/pages/index.js.map +1 -0
  176. package/dist/ui/pages/landing_login.d.ts +11 -0
  177. package/dist/ui/pages/landing_login.js +36 -0
  178. package/dist/ui/pages/landing_login.js.map +1 -0
  179. package/dist/ui/pages/login.d.ts +25 -0
  180. package/dist/ui/pages/login.js +62 -0
  181. package/dist/ui/pages/login.js.map +1 -0
  182. package/dist/ui/pages/reset_password.d.ts +15 -0
  183. package/dist/ui/pages/reset_password.js +44 -0
  184. package/dist/ui/pages/reset_password.js.map +1 -0
  185. package/dist/ui/pages/scheduled_draft.d.ts +38 -0
  186. package/dist/ui/pages/scheduled_draft.js +144 -0
  187. package/dist/ui/pages/scheduled_draft.js.map +1 -0
  188. package/dist/ui/pages/signup.d.ts +31 -0
  189. package/dist/ui/pages/signup.js +78 -0
  190. package/dist/ui/pages/signup.js.map +1 -0
  191. package/dist/ui/pages/system_console.d.ts +26 -0
  192. package/dist/ui/pages/system_console.js +64 -0
  193. package/dist/ui/pages/system_console.js.map +1 -0
  194. package/dist/util.d.ts +29 -0
  195. package/dist/util.js +51 -0
  196. package/dist/util.js.map +1 -0
  197. package/dist/visual/index.d.ts +3 -0
  198. package/dist/visual/index.js +37 -0
  199. package/dist/visual/index.js.map +1 -0
  200. package/dist/visual/percy.d.ts +2 -0
  201. package/dist/visual/percy.js +23 -0
  202. package/dist/visual/percy.js.map +1 -0
  203. package/package.json +68 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post_dot_menu.js","sources":["../../../../src/ui/components/channels/post_dot_menu.ts"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {Locator, expect} from '@playwright/test';\n\nexport default class PostDotMenu {\n readonly container: Locator;\n\n readonly replyMenuItem;\n readonly forwardMenuItem;\n readonly followMessageMenuItem;\n readonly markAsUnreadMenuItem;\n readonly remindMenuItem;\n readonly saveMenuItem;\n readonly removeFromSavedMenuItem;\n readonly pinToChannelMenuItem;\n readonly unpinFromChannelMenuItem;\n readonly moveThreadMenuItem;\n readonly copyLinkMenuItem;\n readonly editMenuItem;\n readonly copyTextMenuItem;\n readonly deleteMenuItem;\n\n constructor(container: Locator) {\n this.container = container;\n\n const getMenuItem = (hasText: string) => container.getByRole('menuitem').filter({hasText});\n\n this.replyMenuItem = getMenuItem('Reply');\n this.forwardMenuItem = getMenuItem('Forward');\n this.followMessageMenuItem = getMenuItem('Follow message');\n this.markAsUnreadMenuItem = getMenuItem('Mark as Unread');\n this.remindMenuItem = getMenuItem('Remind');\n this.saveMenuItem = getMenuItem('Save');\n this.removeFromSavedMenuItem = getMenuItem('Remove from Saved');\n this.pinToChannelMenuItem = getMenuItem('Pin to Channel');\n this.unpinFromChannelMenuItem = getMenuItem('Unpin from Channel');\n this.moveThreadMenuItem = getMenuItem('Move Thread');\n this.copyLinkMenuItem = getMenuItem('Copy Link');\n this.editMenuItem = getMenuItem('Edit');\n this.copyTextMenuItem = getMenuItem('Copy Text');\n this.deleteMenuItem = getMenuItem('Delete');\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAIc,MAAO,WAAW,CAAA;AACnB,IAAA,SAAS;AAET,IAAA,aAAa;AACb,IAAA,eAAe;AACf,IAAA,qBAAqB;AACrB,IAAA,oBAAoB;AACpB,IAAA,cAAc;AACd,IAAA,YAAY;AACZ,IAAA,uBAAuB;AACvB,IAAA,oBAAoB;AACpB,IAAA,wBAAwB;AACxB,IAAA,kBAAkB;AAClB,IAAA,gBAAgB;AAChB,IAAA,YAAY;AACZ,IAAA,gBAAgB;AAChB,IAAA,cAAc;AAEvB,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;QAE1B,MAAM,WAAW,GAAG,CAAC,OAAe,KAAK,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAC,OAAO,EAAC,CAAC;AAE1F,QAAA,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC,OAAO,CAAC;AACzC,QAAA,IAAI,CAAC,eAAe,GAAG,WAAW,CAAC,SAAS,CAAC;AAC7C,QAAA,IAAI,CAAC,qBAAqB,GAAG,WAAW,CAAC,gBAAgB,CAAC;AAC1D,QAAA,IAAI,CAAC,oBAAoB,GAAG,WAAW,CAAC,gBAAgB,CAAC;AACzD,QAAA,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC,QAAQ,CAAC;AAC3C,QAAA,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC;AACvC,QAAA,IAAI,CAAC,uBAAuB,GAAG,WAAW,CAAC,mBAAmB,CAAC;AAC/D,QAAA,IAAI,CAAC,oBAAoB,GAAG,WAAW,CAAC,gBAAgB,CAAC;AACzD,QAAA,IAAI,CAAC,wBAAwB,GAAG,WAAW,CAAC,oBAAoB,CAAC;AACjE,QAAA,IAAI,CAAC,kBAAkB,GAAG,WAAW,CAAC,aAAa,CAAC;AACpD,QAAA,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC,WAAW,CAAC;AAChD,QAAA,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC;AACvC,QAAA,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC,WAAW,CAAC;AAChD,QAAA,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC,QAAQ,CAAC;;AAG/C,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;;AAEjD;;;;"}
@@ -0,0 +1,21 @@
1
+ import { Locator } from '@playwright/test';
2
+ import DeletePostConfirmationDialog from './delete_post_confirmation_dialog';
3
+ import RestorePostConfirmationDialog from './restore_post_confirmation_dialog';
4
+ export default class ChannelsPostEdit {
5
+ readonly container: Locator;
6
+ readonly input: Locator;
7
+ readonly attachmentButton: Locator;
8
+ readonly emojiButton: Locator;
9
+ readonly sendMessageButton: Locator;
10
+ readonly deleteConfirmationDialog: DeletePostConfirmationDialog;
11
+ readonly restorePostConfirmationDialog: RestorePostConfirmationDialog;
12
+ constructor(container: Locator);
13
+ toBeVisible(): Promise<void>;
14
+ toNotBeVisible(): Promise<void>;
15
+ writeMessage(message: string): Promise<void>;
16
+ addFiles(files: string[]): Promise<void>;
17
+ removeFile(fileName: string): Promise<void>;
18
+ sendMessage(): Promise<void>;
19
+ postMessage(message: string): Promise<void>;
20
+ toContainText(text: string): Promise<void>;
21
+ }
@@ -0,0 +1,76 @@
1
+ 'use strict';
2
+
3
+ var path = require('node:path');
4
+ var test = require('@playwright/test');
5
+ var delete_post_confirmation_dialog = require('./delete_post_confirmation_dialog.js');
6
+ var restore_post_confirmation_dialog = require('./restore_post_confirmation_dialog.js');
7
+ var file = require('../../../file.js');
8
+
9
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
10
+ // See LICENSE.txt for license information.
11
+ class ChannelsPostEdit {
12
+ container;
13
+ input;
14
+ attachmentButton;
15
+ emojiButton;
16
+ sendMessageButton;
17
+ deleteConfirmationDialog;
18
+ restorePostConfirmationDialog;
19
+ constructor(container) {
20
+ this.container = container;
21
+ this.input = container.getByTestId('edit_textbox');
22
+ this.attachmentButton = container.locator('#fileUploadButton');
23
+ this.emojiButton = container.getByLabel('select an emoji');
24
+ this.sendMessageButton = container.locator('.save');
25
+ this.deleteConfirmationDialog = new delete_post_confirmation_dialog(container.page().locator('#deletePostModal'));
26
+ this.restorePostConfirmationDialog = new restore_post_confirmation_dialog(container.page().locator('#restorePostModal'));
27
+ }
28
+ async toBeVisible() {
29
+ await test.expect(this.container).toBeVisible();
30
+ await this.input.waitFor();
31
+ await test.expect(this.input).toBeVisible();
32
+ }
33
+ async toNotBeVisible() {
34
+ await test.expect(this.input).not.toBeVisible();
35
+ }
36
+ async writeMessage(message) {
37
+ await this.input.waitFor();
38
+ await test.expect(this.input).toBeVisible();
39
+ await this.input.clear();
40
+ await this.input.fill(message);
41
+ }
42
+ async addFiles(files) {
43
+ const filePaths = files.map((file$1) => path.join(file.assetPath, file$1));
44
+ this.container.page().once('filechooser', async (fileChooser) => {
45
+ await fileChooser.setFiles(filePaths);
46
+ });
47
+ await this.attachmentButton.click();
48
+ }
49
+ async removeFile(fileName) {
50
+ const files = await this.container.locator(`.file-preview`).all();
51
+ for (let i = 0; i < files.length; i++) {
52
+ const textContent = await files[i].textContent();
53
+ if (textContent?.includes(fileName)) {
54
+ const removeButton = files[i].locator('.icon-close');
55
+ await removeButton.click();
56
+ break;
57
+ }
58
+ }
59
+ }
60
+ async sendMessage() {
61
+ await this.input.scrollIntoViewIfNeeded();
62
+ await test.expect(this.sendMessageButton).toBeVisible();
63
+ await test.expect(this.sendMessageButton).toBeEnabled();
64
+ await this.sendMessageButton.click();
65
+ }
66
+ async postMessage(message) {
67
+ await this.writeMessage(message);
68
+ await this.sendMessage();
69
+ }
70
+ async toContainText(text) {
71
+ await test.expect(this.container).toContainText(text);
72
+ }
73
+ }
74
+
75
+ module.exports = ChannelsPostEdit;
76
+ //# sourceMappingURL=post_edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post_edit.js","sources":["../../../../src/ui/components/channels/post_edit.ts"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport path from 'node:path';\n\nimport {Locator, expect} from '@playwright/test';\n\nimport DeletePostConfirmationDialog from './delete_post_confirmation_dialog';\nimport RestorePostConfirmationDialog from './restore_post_confirmation_dialog';\n\nimport {assetPath} from '@/file';\n\nexport default class ChannelsPostEdit {\n readonly container: Locator;\n readonly input;\n\n readonly attachmentButton;\n readonly emojiButton;\n readonly sendMessageButton;\n readonly deleteConfirmationDialog;\n readonly restorePostConfirmationDialog;\n\n constructor(container: Locator) {\n this.container = container;\n\n this.input = container.getByTestId('edit_textbox');\n\n this.attachmentButton = container.locator('#fileUploadButton');\n this.emojiButton = container.getByLabel('select an emoji');\n this.sendMessageButton = container.locator('.save');\n this.deleteConfirmationDialog = new DeletePostConfirmationDialog(container.page().locator('#deletePostModal'));\n this.restorePostConfirmationDialog = new RestorePostConfirmationDialog(\n container.page().locator('#restorePostModal'),\n );\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n\n await this.input.waitFor();\n await expect(this.input).toBeVisible();\n }\n\n async toNotBeVisible() {\n await expect(this.input).not.toBeVisible();\n }\n\n async writeMessage(message: string) {\n await this.input.waitFor();\n await expect(this.input).toBeVisible();\n\n await this.input.clear();\n await this.input.fill(message);\n }\n\n async addFiles(files: string[]) {\n const filePaths = files.map((file) => path.join(assetPath, file));\n this.container.page().once('filechooser', async (fileChooser) => {\n await fileChooser.setFiles(filePaths);\n });\n\n await this.attachmentButton.click();\n }\n\n async removeFile(fileName: string) {\n const files = await this.container.locator(`.file-preview`).all();\n\n for (let i = 0; i < files.length; i++) {\n const textContent = await files[i].textContent();\n if (textContent?.includes(fileName)) {\n const removeButton = files[i].locator('.icon-close');\n await removeButton.click();\n break;\n }\n }\n }\n\n async sendMessage() {\n await this.input.scrollIntoViewIfNeeded();\n\n await expect(this.sendMessageButton).toBeVisible();\n await expect(this.sendMessageButton).toBeEnabled();\n\n await this.sendMessageButton.click();\n }\n\n async postMessage(message: string) {\n await this.writeMessage(message);\n await this.sendMessage();\n }\n\n async toContainText(text: string) {\n await expect(this.container).toContainText(text);\n }\n}\n"],"names":["DeletePostConfirmationDialog","RestorePostConfirmationDialog","expect","file","assetPath"],"mappings":"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"}
@@ -0,0 +1,26 @@
1
+ import { Locator } from '@playwright/test';
2
+ export default class PostMenu {
3
+ readonly container: Locator;
4
+ readonly plusOneEmojiButton: Locator;
5
+ readonly grinningEmojiButton: Locator;
6
+ readonly whiteCheckMarkEmojiButton: Locator;
7
+ readonly addReactionButton: Locator;
8
+ readonly saveButton: Locator;
9
+ readonly replyButton: Locator;
10
+ readonly actionsButton: Locator;
11
+ readonly dotMenuButton: Locator;
12
+ constructor(container: Locator);
13
+ toBeVisible(): Promise<void>;
14
+ /**
15
+ * Clicks on the reply button from the post menu.
16
+ */
17
+ reply(): Promise<void>;
18
+ /**
19
+ * Clicks on the dot menu button from the post menu.
20
+ */
21
+ openDotMenu(): Promise<void>;
22
+ /**
23
+ * Clicks on dot menu button.
24
+ */
25
+ clickOnDotMenu(): Promise<void>;
26
+ }
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
5
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
+ // See LICENSE.txt for license information.
7
+ class PostMenu {
8
+ container;
9
+ plusOneEmojiButton;
10
+ grinningEmojiButton;
11
+ whiteCheckMarkEmojiButton;
12
+ addReactionButton;
13
+ saveButton;
14
+ replyButton;
15
+ actionsButton;
16
+ dotMenuButton;
17
+ constructor(container) {
18
+ this.container = container;
19
+ this.plusOneEmojiButton = container.getByRole('button', { name: '+1 emoji' });
20
+ this.grinningEmojiButton = container.getByRole('button', { name: 'grinning emoji' });
21
+ this.whiteCheckMarkEmojiButton = container.getByRole('button', { name: 'white check mark emoji' });
22
+ this.addReactionButton = container.getByRole('button', { name: 'add reaction' });
23
+ this.saveButton = container.getByRole('button', { name: 'save' });
24
+ this.actionsButton = container.getByRole('button', { name: 'actions' });
25
+ this.replyButton = container.getByRole('button', { name: 'reply' });
26
+ this.dotMenuButton = container.getByRole('button', { name: 'more' });
27
+ }
28
+ async toBeVisible() {
29
+ await test.expect(this.container).toBeVisible();
30
+ }
31
+ /**
32
+ * Clicks on the reply button from the post menu.
33
+ */
34
+ async reply() {
35
+ await this.replyButton.waitFor();
36
+ await this.replyButton.click();
37
+ }
38
+ /**
39
+ * Clicks on the dot menu button from the post menu.
40
+ */
41
+ async openDotMenu() {
42
+ await this.dotMenuButton.waitFor();
43
+ await this.dotMenuButton.click();
44
+ }
45
+ /**
46
+ * Clicks on dot menu button.
47
+ */
48
+ async clickOnDotMenu() {
49
+ await this.dotMenuButton.click();
50
+ }
51
+ }
52
+
53
+ module.exports = PostMenu;
54
+ //# sourceMappingURL=post_menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post_menu.js","sources":["../../../../src/ui/components/channels/post_menu.ts"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {Locator, expect} from '@playwright/test';\n\nexport default class PostMenu {\n readonly container: Locator;\n\n readonly plusOneEmojiButton;\n readonly grinningEmojiButton;\n readonly whiteCheckMarkEmojiButton;\n readonly addReactionButton;\n readonly saveButton;\n readonly replyButton;\n readonly actionsButton;\n readonly dotMenuButton;\n\n constructor(container: Locator) {\n this.container = container;\n\n this.plusOneEmojiButton = container.getByRole('button', {name: '+1 emoji'});\n this.grinningEmojiButton = container.getByRole('button', {name: 'grinning emoji'});\n this.whiteCheckMarkEmojiButton = container.getByRole('button', {name: 'white check mark emoji'});\n this.addReactionButton = container.getByRole('button', {name: 'add reaction'});\n this.saveButton = container.getByRole('button', {name: 'save'});\n this.actionsButton = container.getByRole('button', {name: 'actions'});\n this.replyButton = container.getByRole('button', {name: 'reply'});\n this.dotMenuButton = container.getByRole('button', {name: 'more'});\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n\n /**\n * Clicks on the reply button from the post menu.\n */\n async reply() {\n await this.replyButton.waitFor();\n await this.replyButton.click();\n }\n\n /**\n * Clicks on the dot menu button from the post menu.\n */\n async openDotMenu() {\n await this.dotMenuButton.waitFor();\n await this.dotMenuButton.click();\n }\n\n /**\n * Clicks on dot menu button.\n */\n async clickOnDotMenu() {\n await this.dotMenuButton.click();\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAIc,MAAO,QAAQ,CAAA;AAChB,IAAA,SAAS;AAET,IAAA,kBAAkB;AAClB,IAAA,mBAAmB;AACnB,IAAA,yBAAyB;AACzB,IAAA,iBAAiB;AACjB,IAAA,UAAU;AACV,IAAA,WAAW;AACX,IAAA,aAAa;AACb,IAAA,aAAa;AAEtB,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;AAE1B,QAAA,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAC;AAC3E,QAAA,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAC,CAAC;AAClF,QAAA,IAAI,CAAC,yBAAyB,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,wBAAwB,EAAC,CAAC;AAChG,QAAA,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,cAAc,EAAC,CAAC;AAC9E,QAAA,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;AAC/D,QAAA,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,SAAS,EAAC,CAAC;AACrE,QAAA,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;AACjE,QAAA,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;AAGtE,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;;AAG9C;;AAEG;AACH,IAAA,MAAM,KAAK,GAAA;AACP,QAAA,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;AAChC,QAAA,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE;;AAGlC;;AAEG;AACH,IAAA,MAAM,WAAW,GAAA;AACb,QAAA,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;AAClC,QAAA,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;;AAGpC;;AAEG;AACH,IAAA,MAAM,cAAc,GAAA;AAChB,QAAA,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;;AAEvC;;;;"}
@@ -0,0 +1,11 @@
1
+ import { Locator } from '@playwright/test';
2
+ export default class PostReminderMenu {
3
+ readonly container: Locator;
4
+ readonly thirtyMinsMenuItem: Locator;
5
+ readonly oneHourMenuItem: Locator;
6
+ readonly twoHoursMenuItem: Locator;
7
+ readonly tomorrowMenuItem: Locator;
8
+ readonly customMenuItem: Locator;
9
+ constructor(container: Locator);
10
+ toBeVisible(): Promise<void>;
11
+ }
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
5
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
+ // See LICENSE.txt for license information.
7
+ class PostReminderMenu {
8
+ container;
9
+ thirtyMinsMenuItem;
10
+ oneHourMenuItem;
11
+ twoHoursMenuItem;
12
+ tomorrowMenuItem;
13
+ customMenuItem;
14
+ constructor(container) {
15
+ this.container = container;
16
+ const getMenuItem = (hasText) => container.getByRole('menuitem').filter({ hasText });
17
+ this.thirtyMinsMenuItem = getMenuItem('30 mins');
18
+ this.oneHourMenuItem = getMenuItem('1 hour');
19
+ this.twoHoursMenuItem = getMenuItem('2 hours');
20
+ this.tomorrowMenuItem = getMenuItem('Tomorrow');
21
+ this.customMenuItem = getMenuItem('Custom');
22
+ }
23
+ async toBeVisible() {
24
+ await test.expect(this.container).toBeVisible();
25
+ }
26
+ }
27
+
28
+ module.exports = PostReminderMenu;
29
+ //# sourceMappingURL=post_reminder_menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post_reminder_menu.js","sources":["../../../../src/ui/components/channels/post_reminder_menu.ts"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {Locator, expect} from '@playwright/test';\n\nexport default class PostReminderMenu {\n readonly container: Locator;\n\n readonly thirtyMinsMenuItem;\n readonly oneHourMenuItem;\n readonly twoHoursMenuItem;\n readonly tomorrowMenuItem;\n readonly customMenuItem;\n\n constructor(container: Locator) {\n this.container = container;\n\n const getMenuItem = (hasText: string) => container.getByRole('menuitem').filter({hasText});\n\n this.thirtyMinsMenuItem = getMenuItem('30 mins');\n this.oneHourMenuItem = getMenuItem('1 hour');\n this.twoHoursMenuItem = getMenuItem('2 hours');\n this.tomorrowMenuItem = getMenuItem('Tomorrow');\n this.customMenuItem = getMenuItem('Custom');\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAIc,MAAO,gBAAgB,CAAA;AACxB,IAAA,SAAS;AAET,IAAA,kBAAkB;AAClB,IAAA,eAAe;AACf,IAAA,gBAAgB;AAChB,IAAA,gBAAgB;AAChB,IAAA,cAAc;AAEvB,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;QAE1B,MAAM,WAAW,GAAG,CAAC,OAAe,KAAK,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAC,OAAO,EAAC,CAAC;AAE1F,QAAA,IAAI,CAAC,kBAAkB,GAAG,WAAW,CAAC,SAAS,CAAC;AAChD,QAAA,IAAI,CAAC,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC;AAC5C,QAAA,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC,SAAS,CAAC;AAC9C,QAAA,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC,UAAU,CAAC;AAC/C,QAAA,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC,QAAQ,CAAC;;AAG/C,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;;AAEjD;;;;"}
@@ -0,0 +1,10 @@
1
+ import { Locator } from '@playwright/test';
2
+ export default class RestorePostConfirmationDialog {
3
+ readonly container: Locator;
4
+ readonly cancelButton: Locator;
5
+ readonly confirmButton: Locator;
6
+ constructor(container: Locator);
7
+ toBeVisible(): Promise<void>;
8
+ notToBeVisible(): Promise<void>;
9
+ confirmRestore(): Promise<void>;
10
+ }
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
5
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
+ // See LICENSE.txt for license information.
7
+ class RestorePostConfirmationDialog {
8
+ container;
9
+ cancelButton;
10
+ confirmButton;
11
+ constructor(container) {
12
+ this.container = container;
13
+ this.cancelButton = container.locator('button.btn.btn-tertiary');
14
+ this.confirmButton = container.locator('button.GenericModal__button.btn.btn-primary.confirm');
15
+ }
16
+ async toBeVisible() {
17
+ await test.expect(this.container).toBeVisible();
18
+ await test.expect(this.cancelButton).toBeVisible();
19
+ await test.expect(this.confirmButton).toBeVisible();
20
+ }
21
+ async notToBeVisible() {
22
+ await test.expect(this.container).not.toBeVisible();
23
+ }
24
+ async confirmRestore() {
25
+ await this.confirmButton.click();
26
+ }
27
+ }
28
+
29
+ module.exports = RestorePostConfirmationDialog;
30
+ //# sourceMappingURL=restore_post_confirmation_dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restore_post_confirmation_dialog.js","sources":["../../../../src/ui/components/channels/restore_post_confirmation_dialog.ts"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {Locator, expect} from '@playwright/test';\n\nexport default class RestorePostConfirmationDialog {\n readonly container: Locator;\n\n readonly cancelButton;\n readonly confirmButton;\n\n constructor(container: Locator) {\n this.container = container;\n\n this.cancelButton = container.locator('button.btn.btn-tertiary');\n this.confirmButton = container.locator('button.GenericModal__button.btn.btn-primary.confirm');\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n await expect(this.cancelButton).toBeVisible();\n await expect(this.confirmButton).toBeVisible();\n }\n\n async notToBeVisible() {\n await expect(this.container).not.toBeVisible();\n }\n\n async confirmRestore() {\n await this.confirmButton.click();\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAIc,MAAO,6BAA6B,CAAA;AACrC,IAAA,SAAS;AAET,IAAA,YAAY;AACZ,IAAA,aAAa;AAEtB,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;QAE1B,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,yBAAyB,CAAC;QAChE,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,qDAAqD,CAAC;;AAGjG,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;QAC1C,MAAMA,WAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE;QAC7C,MAAMA,WAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE;;AAGlD,IAAA,MAAM,cAAc,GAAA;QAChB,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE;;AAGlD,IAAA,MAAM,cAAc,GAAA;AAChB,QAAA,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;;AAEvC;;;;"}
@@ -0,0 +1,8 @@
1
+ import { Locator } from '@playwright/test';
2
+ export default class ScheduledDraftMenu {
3
+ readonly container: Locator;
4
+ readonly scheduleDraftMessageCustomTimeOption: Locator;
5
+ constructor(container: Locator);
6
+ toBeVisible(): Promise<void>;
7
+ selectCustomTime(): Promise<void>;
8
+ }
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
5
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
+ // See LICENSE.txt for license information.
7
+ class ScheduledDraftMenu {
8
+ container;
9
+ scheduleDraftMessageCustomTimeOption;
10
+ constructor(container) {
11
+ this.container = container;
12
+ this.scheduleDraftMessageCustomTimeOption = container.getByText('Choose a custom time');
13
+ }
14
+ async toBeVisible() {
15
+ await test.expect(this.container).toBeVisible();
16
+ }
17
+ async selectCustomTime() {
18
+ await this.scheduleDraftMessageCustomTimeOption.click();
19
+ }
20
+ }
21
+
22
+ module.exports = ScheduledDraftMenu;
23
+ //# sourceMappingURL=scheduled_draft_menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduled_draft_menu.js","sources":["../../../../src/ui/components/channels/scheduled_draft_menu.ts"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {Locator, expect} from '@playwright/test';\n\nexport default class ScheduledDraftMenu {\n readonly container: Locator;\n\n readonly scheduleDraftMessageCustomTimeOption;\n\n constructor(container: Locator) {\n this.container = container;\n\n this.scheduleDraftMessageCustomTimeOption = container.getByText('Choose a custom time');\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n\n async selectCustomTime() {\n await this.scheduleDraftMessageCustomTimeOption.click();\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAIc,MAAO,kBAAkB,CAAA;AAC1B,IAAA,SAAS;AAET,IAAA,oCAAoC;AAE7C,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;QAE1B,IAAI,CAAC,oCAAoC,GAAG,SAAS,CAAC,SAAS,CAAC,sBAAsB,CAAC;;AAG3F,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;;AAG9C,IAAA,MAAM,gBAAgB,GAAA;AAClB,QAAA,MAAM,IAAI,CAAC,oCAAoC,CAAC,KAAK,EAAE;;AAE9D;;;;"}
@@ -0,0 +1,20 @@
1
+ import { Locator } from '@playwright/test';
2
+ export default class ScheduledDraftModal {
3
+ readonly container: Locator;
4
+ readonly confirmButton: Locator;
5
+ readonly dateInput: Locator;
6
+ readonly timeLocator: Locator;
7
+ readonly timeDropdownOptions: Locator;
8
+ constructor(container: Locator);
9
+ toBeVisible(): Promise<void>;
10
+ getDaySuffix(day: number): string;
11
+ dateLocator(day: number, month: string, dayOfWeek: string): Locator;
12
+ selectDay(dayFromToday?: number): Promise<void>;
13
+ confirm(): Promise<void>;
14
+ /**
15
+ * Selecting the First time option from the dropdown for
16
+ * scheduled_post_job to send the drafts out
17
+ */
18
+ selectTime(): Promise<void>;
19
+ getPacificDate(): Date;
20
+ }
@@ -0,0 +1,84 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
5
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
+ // See LICENSE.txt for license information.
7
+ class ScheduledDraftModal {
8
+ container;
9
+ confirmButton;
10
+ dateInput;
11
+ timeLocator;
12
+ timeDropdownOptions;
13
+ constructor(container) {
14
+ this.container = container;
15
+ this.confirmButton = container.locator('button.confirm');
16
+ this.dateInput = container.locator('div.Input_wrapper');
17
+ this.timeLocator = container.locator('div.dateTime__input');
18
+ this.timeDropdownOptions = container.locator('ul.dropdown-menu .MenuItem');
19
+ }
20
+ async toBeVisible() {
21
+ await test.expect(this.container).toBeVisible();
22
+ }
23
+ getDaySuffix(day) {
24
+ if (day > 3 && day < 21)
25
+ return 'th';
26
+ switch (day % 10) {
27
+ case 1:
28
+ return 'st';
29
+ case 2:
30
+ return 'nd';
31
+ case 3:
32
+ return 'rd';
33
+ default:
34
+ return 'th';
35
+ }
36
+ }
37
+ dateLocator(day, month, dayOfWeek) {
38
+ const daySuffix = this.getDaySuffix(day);
39
+ return this.container.locator(`button[aria-label*='${day}${daySuffix} ${month} (${dayOfWeek})']`);
40
+ }
41
+ async selectDay(dayFromToday = 0) {
42
+ await this.dateInput.click();
43
+ const pacificDate = this.getPacificDate();
44
+ const originDate = new Date(pacificDate.getTime());
45
+ // If dayFromToday is provided, add days to the current date
46
+ if (dayFromToday) {
47
+ pacificDate.setDate(pacificDate.getDate() + dayFromToday);
48
+ }
49
+ const day = pacificDate.getDate();
50
+ const month = pacificDate.toLocaleString('default', { month: 'long' });
51
+ const dayOfWeek = pacificDate.toLocaleDateString('en-US', { weekday: 'long' });
52
+ const dl = this.dateLocator(day, month, dayOfWeek);
53
+ // If the date is not visible and the month has changed, click the next month button
54
+ if (!(await dl.isVisible()) && pacificDate.getMonth() !== originDate.getMonth()) {
55
+ this.container.locator('button[aria-label="Go to next month"]').click();
56
+ }
57
+ await dl.click();
58
+ }
59
+ async confirm() {
60
+ await this.confirmButton.isVisible();
61
+ await this.confirmButton.click();
62
+ }
63
+ /**
64
+ * Selecting the First time option from the dropdown for
65
+ * scheduled_post_job to send the drafts out
66
+ */
67
+ async selectTime() {
68
+ await this.timeLocator.click();
69
+ const timeButton = this.timeDropdownOptions.nth(2);
70
+ await test.expect(timeButton).toBeVisible();
71
+ await timeButton.click();
72
+ }
73
+ getPacificDate() {
74
+ const currentDate = new Date();
75
+ // Convert the current date to Pacific Time
76
+ const utcTime = currentDate.getTime() + currentDate.getTimezoneOffset() * 60000;
77
+ const pacificOffset = -7 * 60; // Pacific Daylight Time (UTC-07:00)
78
+ const pacificTime = new Date(utcTime + pacificOffset * 60000);
79
+ return pacificTime;
80
+ }
81
+ }
82
+
83
+ module.exports = ScheduledDraftModal;
84
+ //# sourceMappingURL=scheduled_draft_modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduled_draft_modal.js","sources":["../../../../src/ui/components/channels/scheduled_draft_modal.ts"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {Locator, expect} from '@playwright/test';\n\nexport default class ScheduledDraftModal {\n readonly container: Locator;\n\n readonly confirmButton;\n readonly dateInput;\n readonly timeLocator;\n readonly timeDropdownOptions;\n\n constructor(container: Locator) {\n this.container = container;\n\n this.confirmButton = container.locator('button.confirm');\n this.dateInput = container.locator('div.Input_wrapper');\n this.timeLocator = container.locator('div.dateTime__input');\n this.timeDropdownOptions = container.locator('ul.dropdown-menu .MenuItem');\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n\n getDaySuffix(day: number): string {\n if (day > 3 && day < 21) return 'th';\n switch (day % 10) {\n case 1:\n return 'st';\n case 2:\n return 'nd';\n case 3:\n return 'rd';\n default:\n return 'th';\n }\n }\n\n dateLocator(day: number, month: string, dayOfWeek: string) {\n const daySuffix = this.getDaySuffix(day);\n return this.container.locator(`button[aria-label*='${day}${daySuffix} ${month} (${dayOfWeek})']`);\n }\n\n async selectDay(dayFromToday: number = 0) {\n await this.dateInput.click();\n\n const pacificDate = this.getPacificDate();\n const originDate = new Date(pacificDate.getTime());\n\n // If dayFromToday is provided, add days to the current date\n if (dayFromToday) {\n pacificDate.setDate(pacificDate.getDate() + dayFromToday);\n }\n\n const day = pacificDate.getDate();\n const month = pacificDate.toLocaleString('default', {month: 'long'});\n const dayOfWeek = pacificDate.toLocaleDateString('en-US', {weekday: 'long'});\n\n const dl = this.dateLocator(day, month, dayOfWeek);\n\n // If the date is not visible and the month has changed, click the next month button\n if (!(await dl.isVisible()) && pacificDate.getMonth() !== originDate.getMonth()) {\n this.container.locator('button[aria-label=\"Go to next month\"]').click();\n }\n await dl.click();\n }\n\n async confirm() {\n await this.confirmButton.isVisible();\n await this.confirmButton.click();\n }\n\n /**\n * Selecting the First time option from the dropdown for\n * scheduled_post_job to send the drafts out\n */\n async selectTime() {\n await this.timeLocator.click();\n const timeButton = this.timeDropdownOptions.nth(2);\n await expect(timeButton).toBeVisible();\n await timeButton.click();\n }\n\n getPacificDate(): Date {\n const currentDate = new Date();\n // Convert the current date to Pacific Time\n const utcTime = currentDate.getTime() + currentDate.getTimezoneOffset() * 60000;\n const pacificOffset = -7 * 60; // Pacific Daylight Time (UTC-07:00)\n const pacificTime = new Date(utcTime + pacificOffset * 60000);\n\n return pacificTime;\n }\n}\n"],"names":["expect"],"mappings":"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"}
@@ -0,0 +1,15 @@
1
+ import { Locator } from '@playwright/test';
2
+ export default class SearchPopover {
3
+ readonly container: Locator;
4
+ readonly messagesButton: Locator;
5
+ readonly filesButton: Locator;
6
+ readonly searchInput: Locator;
7
+ readonly searchBoxClose: Locator;
8
+ readonly selectedSuggestion: Locator;
9
+ readonly searchHints: Locator;
10
+ readonly clearButton: Locator;
11
+ constructor(container: Locator);
12
+ clearIfPossible(): Promise<boolean>;
13
+ toBeVisible(): Promise<void>;
14
+ getSelectedSuggestion(): Locator;
15
+ }
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
5
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
+ // See LICENSE.txt for license information.
7
+ class SearchPopover {
8
+ container;
9
+ messagesButton;
10
+ filesButton;
11
+ searchInput;
12
+ searchBoxClose;
13
+ selectedSuggestion;
14
+ searchHints;
15
+ clearButton;
16
+ constructor(container) {
17
+ this.container = container;
18
+ this.messagesButton = container.getByRole('button', { name: 'Messages' });
19
+ this.filesButton = container.getByRole('button', { name: 'Files' });
20
+ this.searchInput = container.getByLabel('Search messages');
21
+ this.searchBoxClose = container.getByTestId('searchBoxClose');
22
+ this.selectedSuggestion = container.locator('.suggestion--selected').locator('.suggestion-list__main');
23
+ this.searchHints = container.locator('#searchHints');
24
+ this.clearButton = container.locator('.input-clear-x');
25
+ }
26
+ // clearIfPossible clears the search input if the clear button is visible. Returns true if the clear button was clicked.
27
+ async clearIfPossible() {
28
+ if (await this.clearButton.isVisible()) {
29
+ await this.clearButton.click();
30
+ return true;
31
+ }
32
+ return false;
33
+ }
34
+ async toBeVisible() {
35
+ await test.expect(this.container).toBeVisible();
36
+ }
37
+ getSelectedSuggestion() {
38
+ return this.searchHints.locator('.suggestion--selected');
39
+ }
40
+ }
41
+
42
+ module.exports = SearchPopover;
43
+ //# sourceMappingURL=search_popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search_popover.js","sources":["../../../../src/ui/components/channels/search_popover.ts"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {Locator, expect} from '@playwright/test';\n\nexport default class SearchPopover {\n readonly container: Locator;\n\n readonly messagesButton;\n readonly filesButton;\n readonly searchInput;\n readonly searchBoxClose;\n readonly selectedSuggestion;\n readonly searchHints;\n readonly clearButton;\n\n constructor(container: Locator) {\n this.container = container;\n\n this.messagesButton = container.getByRole('button', {name: 'Messages'});\n this.filesButton = container.getByRole('button', {name: 'Files'});\n this.searchInput = container.getByLabel('Search messages');\n this.searchBoxClose = container.getByTestId('searchBoxClose');\n this.selectedSuggestion = container.locator('.suggestion--selected').locator('.suggestion-list__main');\n this.searchHints = container.locator('#searchHints');\n this.clearButton = container.locator('.input-clear-x');\n }\n\n // clearIfPossible clears the search input if the clear button is visible. Returns true if the clear button was clicked.\n async clearIfPossible() {\n if (await this.clearButton.isVisible()) {\n await this.clearButton.click();\n return true;\n }\n return false;\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n\n getSelectedSuggestion() {\n return this.searchHints.locator('.suggestion--selected');\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAIc,MAAO,aAAa,CAAA;AACrB,IAAA,SAAS;AAET,IAAA,cAAc;AACd,IAAA,WAAW;AACX,IAAA,WAAW;AACX,IAAA,cAAc;AACd,IAAA,kBAAkB;AAClB,IAAA,WAAW;AACX,IAAA,WAAW;AAEpB,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;AAE1B,QAAA,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAC;AACvE,QAAA,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;QACjE,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,UAAU,CAAC,iBAAiB,CAAC;QAC1D,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,WAAW,CAAC,gBAAgB,CAAC;AAC7D,QAAA,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,OAAO,CAAC,wBAAwB,CAAC;QACtG,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC;QACpD,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC;;;AAI1D,IAAA,MAAM,eAAe,GAAA;QACjB,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE;AACpC,YAAA,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE;AAC9B,YAAA,OAAO,IAAI;;AAEf,QAAA,OAAO,KAAK;;AAGhB,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;;IAG9C,qBAAqB,GAAA;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,uBAAuB,CAAC;;AAE/D;;;;"}
@@ -0,0 +1,13 @@
1
+ import { Locator } from '@playwright/test';
2
+ type NotificationSettingsSection = 'keysWithHighlight' | 'keysWithNotification';
3
+ export default class NotificationsSettings {
4
+ readonly container: Locator;
5
+ readonly keysWithHighlightDesc: Locator;
6
+ constructor(container: Locator);
7
+ toBeVisible(): Promise<void>;
8
+ expandSection(section: NotificationSettingsSection): Promise<void>;
9
+ verifySectionIsExpanded(section: NotificationSettingsSection): Promise<void>;
10
+ getKeywordsInput(): Promise<Locator>;
11
+ save(): Promise<void>;
12
+ }
13
+ export {};
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
5
+ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
+ // See LICENSE.txt for license information.
7
+ class NotificationsSettings {
8
+ container;
9
+ keysWithHighlightDesc;
10
+ constructor(container) {
11
+ this.container = container;
12
+ this.keysWithHighlightDesc = container.locator('#keywordsAndHighlightDesc');
13
+ }
14
+ async toBeVisible() {
15
+ await test.expect(this.container).toBeVisible();
16
+ }
17
+ async expandSection(section) {
18
+ if (section === 'keysWithHighlight') {
19
+ await this.container.getByText('Keywords That Get Highlighted (without notifications)').click();
20
+ await this.verifySectionIsExpanded('keysWithHighlight');
21
+ }
22
+ }
23
+ async verifySectionIsExpanded(section) {
24
+ await test.expect(this.container.locator(`#${section}Edit`)).not.toBeVisible();
25
+ if (section === 'keysWithHighlight') {
26
+ await test.expect(this.container.getByText('Enter non case-sensitive keywords, press Tab or use commas to separate them:')).toBeVisible();
27
+ await test.expect(this.container.getByText('These keywords will be shown to you with a highlight when anyone sends a message that includes them.')).toBeVisible();
28
+ }
29
+ }
30
+ async getKeywordsInput() {
31
+ await test.expect(this.container.locator('input')).toBeVisible();
32
+ return this.container.locator('input');
33
+ }
34
+ async save() {
35
+ await test.expect(this.container.getByText('Save')).toBeVisible();
36
+ await this.container.getByText('Save').click();
37
+ }
38
+ }
39
+
40
+ module.exports = NotificationsSettings;
41
+ //# sourceMappingURL=notification_settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification_settings.js","sources":["../../../../../src/ui/components/channels/settings/notification_settings.ts"],"sourcesContent":["// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {Locator, expect} from '@playwright/test';\n\ntype NotificationSettingsSection = 'keysWithHighlight' | 'keysWithNotification';\n\nexport default class NotificationsSettings {\n readonly container: Locator;\n readonly keysWithHighlightDesc: Locator;\n\n constructor(container: Locator) {\n this.container = container;\n this.keysWithHighlightDesc = container.locator('#keywordsAndHighlightDesc');\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n\n async expandSection(section: NotificationSettingsSection) {\n if (section === 'keysWithHighlight') {\n await this.container.getByText('Keywords That Get Highlighted (without notifications)').click();\n await this.verifySectionIsExpanded('keysWithHighlight');\n }\n }\n\n async verifySectionIsExpanded(section: NotificationSettingsSection) {\n await expect(this.container.locator(`#${section}Edit`)).not.toBeVisible();\n\n if (section === 'keysWithHighlight') {\n await expect(\n this.container.getByText(\n 'Enter non case-sensitive keywords, press Tab or use commas to separate them:',\n ),\n ).toBeVisible();\n await expect(\n this.container.getByText(\n 'These keywords will be shown to you with a highlight when anyone sends a message that includes them.',\n ),\n ).toBeVisible();\n }\n }\n\n async getKeywordsInput() {\n await expect(this.container.locator('input')).toBeVisible();\n return this.container.locator('input');\n }\n\n async save() {\n await expect(this.container.getByText('Save')).toBeVisible();\n await this.container.getByText('Save').click();\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAMc,MAAO,qBAAqB,CAAA;AAC7B,IAAA,SAAS;AACT,IAAA,qBAAqB;AAE9B,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;QAC1B,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC,OAAO,CAAC,2BAA2B,CAAC;;AAG/E,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;;IAG9C,MAAM,aAAa,CAAC,OAAoC,EAAA;AACpD,QAAA,IAAI,OAAO,KAAK,mBAAmB,EAAE;YACjC,MAAM,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,uDAAuD,CAAC,CAAC,KAAK,EAAE;AAC/F,YAAA,MAAM,IAAI,CAAC,uBAAuB,CAAC,mBAAmB,CAAC;;;IAI/D,MAAM,uBAAuB,CAAC,OAAoC,EAAA;AAC9D,QAAA,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA,CAAA,EAAI,OAAO,CAAA,IAAA,CAAM,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE;AAEzE,QAAA,IAAI,OAAO,KAAK,mBAAmB,EAAE;AACjC,YAAA,MAAMA,WAAM,CACR,IAAI,CAAC,SAAS,CAAC,SAAS,CACpB,8EAA8E,CACjF,CACJ,CAAC,WAAW,EAAE;AACf,YAAA,MAAMA,WAAM,CACR,IAAI,CAAC,SAAS,CAAC,SAAS,CACpB,sGAAsG,CACzG,CACJ,CAAC,WAAW,EAAE;;;AAIvB,IAAA,MAAM,gBAAgB,GAAA;AAClB,QAAA,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,EAAE;QAC3D,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC;;AAG1C,IAAA,MAAM,IAAI,GAAA;AACN,QAAA,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,EAAE;QAC5D,MAAM,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE;;AAErD;;;;"}
@@ -0,0 +1,11 @@
1
+ import { Locator } from '@playwright/test';
2
+ import NotificationsSettings from './notification_settings';
3
+ export default class SettingsModal {
4
+ readonly container: Locator;
5
+ readonly notificationsSettingsTab: Locator;
6
+ readonly notificationsSettings: NotificationsSettings;
7
+ constructor(container: Locator);
8
+ toBeVisible(): Promise<void>;
9
+ openNotificationsTab(): Promise<void>;
10
+ closeModal(): Promise<void>;
11
+ }