@mattermost/playwright-lib 10.6.0 → 10.6.1

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 (72) hide show
  1. package/dist/browser_context.js +21 -14
  2. package/dist/constant.js +6 -3
  3. package/dist/file.js +20 -20
  4. package/dist/flag.js +38 -26
  5. package/dist/global_setup.js +33 -22
  6. package/dist/index.d.ts +0 -1
  7. package/dist/index.js +42 -10
  8. package/dist/index.js.map +1 -1
  9. package/dist/mock_browser_api.js +8 -2
  10. package/dist/server/channel.js +9 -3
  11. package/dist/server/client.js +16 -10
  12. package/dist/server/default_config.js +15 -9
  13. package/dist/server/init.js +36 -29
  14. package/dist/server/post.js +9 -3
  15. package/dist/server/team.js +9 -3
  16. package/dist/server/user.js +15 -8
  17. package/dist/test_action.js +14 -3
  18. package/dist/test_config.js +30 -4
  19. package/dist/test_fixture.js +66 -47
  20. package/dist/ui/components/channels/app_bar.js +9 -3
  21. package/dist/ui/components/channels/center_view.js +28 -22
  22. package/dist/ui/components/channels/delete_post_confirmation_dialog.js +14 -8
  23. package/dist/ui/components/channels/delete_post_modal.js +10 -4
  24. package/dist/ui/components/channels/emoji_gif_picker.js +15 -9
  25. package/dist/ui/components/channels/find_channels_modal.js +9 -3
  26. package/dist/ui/components/channels/generic_confirm_modal.js +11 -5
  27. package/dist/ui/components/channels/header.js +9 -3
  28. package/dist/ui/components/channels/message_priority.js +20 -14
  29. package/dist/ui/components/channels/post.js +16 -10
  30. package/dist/ui/components/channels/post_create.js +29 -23
  31. package/dist/ui/components/channels/post_dot_menu.js +9 -3
  32. package/dist/ui/components/channels/post_edit.js +22 -16
  33. package/dist/ui/components/channels/post_menu.js +9 -3
  34. package/dist/ui/components/channels/post_reminder_menu.js +9 -3
  35. package/dist/ui/components/channels/restore_post_confirmation_dialog.js +12 -6
  36. package/dist/ui/components/channels/scheduled_draft_menu.js +9 -3
  37. package/dist/ui/components/channels/scheduled_draft_modal.js +10 -4
  38. package/dist/ui/components/channels/search_popover.js +9 -3
  39. package/dist/ui/components/channels/settings/notification_settings.js +14 -8
  40. package/dist/ui/components/channels/settings/settings_modal.js +13 -7
  41. package/dist/ui/components/channels/sidebar_left.js +14 -8
  42. package/dist/ui/components/channels/sidebar_right.js +26 -20
  43. package/dist/ui/components/channels/thread_footer.js +9 -3
  44. package/dist/ui/components/channels/user_profile_popover.js +9 -3
  45. package/dist/ui/components/footer.js +9 -3
  46. package/dist/ui/components/global_header.js +13 -7
  47. package/dist/ui/components/index.js +74 -72
  48. package/dist/ui/components/main_header.js +9 -3
  49. package/dist/ui/components/system_console/navbar.js +9 -3
  50. package/dist/ui/components/system_console/sections/system_users/column_toggle_menu.js +10 -4
  51. package/dist/ui/components/system_console/sections/system_users/feature_discovery.js +10 -4
  52. package/dist/ui/components/system_console/sections/system_users/filter_menu.js +9 -3
  53. package/dist/ui/components/system_console/sections/system_users/filter_popover.js +14 -8
  54. package/dist/ui/components/system_console/sections/system_users/mobile_security.js +9 -3
  55. package/dist/ui/components/system_console/sections/system_users/system_users.js +16 -10
  56. package/dist/ui/components/system_console/sidebar.js +10 -4
  57. package/dist/ui/pages/channels.js +24 -18
  58. package/dist/ui/pages/drafts.js +23 -17
  59. package/dist/ui/pages/index.js +30 -17
  60. package/dist/ui/pages/landing_login.js +11 -5
  61. package/dist/ui/pages/login.js +14 -8
  62. package/dist/ui/pages/reset_password.js +15 -9
  63. package/dist/ui/pages/scheduled_draft.js +25 -19
  64. package/dist/ui/pages/signup.js +17 -11
  65. package/dist/ui/pages/system_console.js +22 -16
  66. package/dist/util.js +19 -8
  67. package/dist/visual/index.js +20 -14
  68. package/dist/visual/percy.js +10 -4
  69. package/package.json +1 -1
  70. package/dist/server/index.js +0 -9
  71. package/dist/tsconfig.tsbuildinfo +0 -1
  72. package/dist/types.js +0 -3
@@ -1,7 +1,10 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
1
5
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
6
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- export default class EmojiGifPicker {
7
+ class EmojiGifPicker {
5
8
  container;
6
9
  gifTab;
7
10
  gifSearchInput;
@@ -13,23 +16,23 @@ export default class EmojiGifPicker {
13
16
  this.gifPickerItems = container.locator('.gif-picker__items');
14
17
  }
15
18
  async toBeVisible() {
16
- await expect(this.container).toBeVisible();
19
+ await test.expect(this.container).toBeVisible();
17
20
  }
18
21
  async openGifTab() {
19
- await expect(this.gifTab).toBeVisible();
22
+ await test.expect(this.gifTab).toBeVisible();
20
23
  await this.gifTab.click({ force: true });
21
- await expect(this.gifSearchInput).toBeVisible();
22
- await expect(this.gifPickerItems).toBeVisible();
24
+ await test.expect(this.gifSearchInput).toBeVisible();
25
+ await test.expect(this.gifPickerItems).toBeVisible();
23
26
  }
24
27
  async searchGif(name) {
25
28
  await this.gifSearchInput.fill(name);
26
- await expect(this.gifSearchInput).toHaveValue(name);
29
+ await test.expect(this.gifSearchInput).toHaveValue(name);
27
30
  }
28
31
  async getNthGif(n) {
29
- await expect(this.gifPickerItems).toBeVisible();
32
+ await test.expect(this.gifPickerItems).toBeVisible();
30
33
  await this.gifPickerItems.locator('img').nth(n).waitFor();
31
34
  const nthGif = this.gifPickerItems.locator('img').nth(n);
32
- await expect(nthGif).toBeVisible();
35
+ await test.expect(nthGif).toBeVisible();
33
36
  const nthGifSrc = await nthGif.getAttribute('src');
34
37
  const nthGifAlt = await nthGif.getAttribute('alt');
35
38
  if (!nthGifSrc || !nthGifAlt) {
@@ -42,3 +45,6 @@ export default class EmojiGifPicker {
42
45
  };
43
46
  }
44
47
  }
48
+
49
+ module.exports = EmojiGifPicker;
50
+ //# sourceMappingURL=emoji_gif_picker.js.map
@@ -1,7 +1,10 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
1
5
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
6
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- export default class FindChannelsModal {
7
+ class FindChannelsModal {
5
8
  container;
6
9
  input;
7
10
  searchList;
@@ -11,6 +14,9 @@ export default class FindChannelsModal {
11
14
  this.searchList = container.locator('.suggestion-list__item');
12
15
  }
13
16
  async toBeVisible() {
14
- await expect(this.container).toBeVisible();
17
+ await test.expect(this.container).toBeVisible();
15
18
  }
16
19
  }
20
+
21
+ module.exports = FindChannelsModal;
22
+ //# sourceMappingURL=find_channels_modal.js.map
@@ -1,13 +1,16 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
1
5
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
6
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
7
  /**
5
8
  * This is the generic confirm modal that is used in the app.
6
9
  * It has optional cancel button, optional checkbox and confirm button along with title and message body.
7
10
  * It can present in different parts of the app such as channel, system console, etc and hence its constructor
8
11
  * should be able to accept the page object of the app and an optional id to uniquely identify the modal.
9
12
  */
10
- export default class GenericConfirmModal {
13
+ class GenericConfirmModal {
11
14
  container;
12
15
  confirmButton;
13
16
  cancelButton;
@@ -17,18 +20,21 @@ export default class GenericConfirmModal {
17
20
  this.cancelButton = container.locator('#cancelModalButton');
18
21
  }
19
22
  async toBeVisible() {
20
- await expect(this.container).toBeVisible();
23
+ await test.expect(this.container).toBeVisible();
21
24
  }
22
25
  async confirm() {
23
26
  await this.confirmButton.waitFor();
24
27
  await this.confirmButton.click();
25
28
  // Wait for the modal to disappear
26
- await expect(this.container).not.toBeVisible();
29
+ await test.expect(this.container).not.toBeVisible();
27
30
  }
28
31
  async cancel() {
29
32
  await this.cancelButton.waitFor();
30
33
  await this.cancelButton.click();
31
34
  // Wait for the modal to disappear
32
- await expect(this.container).not.toBeVisible();
35
+ await test.expect(this.container).not.toBeVisible();
33
36
  }
34
37
  }
38
+
39
+ module.exports = GenericConfirmModal;
40
+ //# sourceMappingURL=generic_confirm_modal.js.map
@@ -1,12 +1,18 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
1
5
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
6
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- export default class ChannelsHeader {
7
+ class ChannelsHeader {
5
8
  container;
6
9
  constructor(container) {
7
10
  this.container = container;
8
11
  }
9
12
  async toBeVisible() {
10
- await expect(this.container).toBeVisible();
13
+ await test.expect(this.container).toBeVisible();
11
14
  }
12
15
  }
16
+
17
+ module.exports = ChannelsHeader;
18
+ //# sourceMappingURL=header.js.map
@@ -1,7 +1,10 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
1
5
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
6
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- export default class MessagePriority {
7
+ class MessagePriority {
5
8
  container;
6
9
  priorityIcon;
7
10
  priorityMenu;
@@ -26,35 +29,38 @@ export default class MessagePriority {
26
29
  }
27
30
  async verifyPriorityIconVisible() {
28
31
  await this.priorityIcon.waitFor({ state: 'visible' });
29
- await expect(this.priorityIcon).toBeVisible();
32
+ await test.expect(this.priorityIcon).toBeVisible();
30
33
  }
31
34
  async verifyStandardPrioritySelected() {
32
- await expect(this.priorityMenu).toBeVisible();
33
- await expect(this.standardPriorityOption).toHaveAttribute('aria-checked', 'true');
35
+ await test.expect(this.priorityMenu).toBeVisible();
36
+ await test.expect(this.standardPriorityOption).toHaveAttribute('aria-checked', 'true');
34
37
  }
35
38
  async verifyPriorityMenuVisible() {
36
- await expect(this.priorityMenu).toBeVisible();
39
+ await test.expect(this.priorityMenu).toBeVisible();
37
40
  // Look for beta text in header
38
- await expect(this.priorityMenu.locator('text=Message Priority')).toBeVisible();
41
+ await test.expect(this.priorityMenu.locator('text=Message Priority')).toBeVisible();
39
42
  }
40
43
  async closePriorityMenu() {
41
44
  await this.priorityMenu.press('Escape');
42
- await expect(this.priorityMenu).not.toBeVisible();
45
+ await test.expect(this.priorityMenu).not.toBeVisible();
43
46
  }
44
47
  async verifyNoPriorityLabel(postText) {
45
48
  const post = this.container.locator(`text=${postText}`);
46
- await expect(post).toBeVisible();
49
+ await test.expect(post).toBeVisible();
47
50
  // Verify no priority label exists
48
51
  const priorityLabel = post.locator('[data-testid="post-priority-label"]');
49
- await expect(priorityLabel).toHaveCount(0);
52
+ await test.expect(priorityLabel).toHaveCount(0);
50
53
  }
51
54
  async verifyPriorityDialog() {
52
- await expect(this.priorityDialog).toBeVisible();
53
- await expect(this.dialogHeader).toHaveText('Message priority');
55
+ await test.expect(this.priorityDialog).toBeVisible();
56
+ await test.expect(this.dialogHeader).toHaveText('Message priority');
54
57
  }
55
58
  async verifyStandardOptionSelected() {
56
59
  const standardOption = this.priorityDialog.getByRole('menuitemradio', { name: 'Standard' });
57
- await expect(standardOption).toBeVisible();
58
- await expect(standardOption.locator('svg.StyledCheckIcon-dFKfoY')).toBeVisible();
60
+ await test.expect(standardOption).toBeVisible();
61
+ await test.expect(standardOption.locator('svg.StyledCheckIcon-dFKfoY')).toBeVisible();
59
62
  }
60
63
  }
64
+
65
+ module.exports = MessagePriority;
66
+ //# sourceMappingURL=message_priority.js.map
@@ -1,9 +1,12 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+ var post_menu = require('./post_menu.js');
5
+ var thread_footer = require('./thread_footer.js');
6
+
1
7
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
8
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- import PostMenu from './post_menu';
5
- import ThreadFooter from './thread_footer';
6
- export default class ChannelsPost {
9
+ class ChannelsPost {
7
10
  container;
8
11
  body;
9
12
  profileIcon;
@@ -15,11 +18,11 @@ export default class ChannelsPost {
15
18
  this.body = container.locator('.post__body');
16
19
  this.profileIcon = container.locator('.profile-icon');
17
20
  this.removePostButton = container.locator('.post__remove');
18
- this.postMenu = new PostMenu(container.locator('.post-menu'));
19
- this.threadFooter = new ThreadFooter(container.locator('.ThreadFooter'));
21
+ this.postMenu = new post_menu(container.locator('.post-menu'));
22
+ this.threadFooter = new thread_footer(container.locator('.ThreadFooter'));
20
23
  }
21
24
  async toBeVisible() {
22
- await expect(this.container).toBeVisible();
25
+ await test.expect(this.container).toBeVisible();
23
26
  }
24
27
  /**
25
28
  * Hover over the post. Can be used for post menu to appear.
@@ -29,7 +32,7 @@ export default class ChannelsPost {
29
32
  }
30
33
  async getId() {
31
34
  const id = await this.container.getAttribute('id');
32
- expect(id, 'No post ID found.').toBeTruthy();
35
+ test.expect(id, 'No post ID found.').toBeTruthy();
33
36
  return (id || '').substring('post_'.length);
34
37
  }
35
38
  async getProfileImage(username) {
@@ -41,7 +44,7 @@ export default class ChannelsPost {
41
44
  */
42
45
  async remove() {
43
46
  // Verify the post is a deleted post
44
- await expect(this.container).toContainText(/\(message deleted\)/);
47
+ await test.expect(this.container).toContainText(/\(message deleted\)/);
45
48
  // Hover over the post and click on the remove post button
46
49
  await this.container.hover();
47
50
  await this.removePostButton.waitFor();
@@ -52,6 +55,9 @@ export default class ChannelsPost {
52
55
  * @param text Text to be verified in the post
53
56
  */
54
57
  async toContainText(text) {
55
- await expect(this.container).toContainText(text);
58
+ await test.expect(this.container).toContainText(text);
56
59
  }
57
60
  }
61
+
62
+ module.exports = ChannelsPost;
63
+ //# sourceMappingURL=post.js.map
@@ -1,11 +1,14 @@
1
+ 'use strict';
2
+
3
+ var path = require('node:path');
4
+ var test = require('@playwright/test');
5
+ var util = require('../../../util.js');
6
+ var file = require('../../../file.js');
7
+ var asyncWaitUntil = require('async-wait-until');
8
+
1
9
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
10
  // See LICENSE.txt for license information.
3
- import path from 'node:path';
4
- import { expect } from '@playwright/test';
5
- import { duration } from '@/util';
6
- import { assetPath } from '@/file';
7
- import { waitUntil } from '@/test_action';
8
- export default class ChannelsPostCreate {
11
+ class ChannelsPostCreate {
9
12
  container;
10
13
  input;
11
14
  attachmentButton;
@@ -32,9 +35,9 @@ export default class ChannelsPostCreate {
32
35
  this.filePreview = container.locator('.file-preview__container');
33
36
  }
34
37
  async toBeVisible() {
35
- await expect(this.container).toBeVisible();
38
+ await test.expect(this.container).toBeVisible();
36
39
  await this.input.waitFor();
37
- await expect(this.input).toBeVisible();
40
+ await test.expect(this.input).toBeVisible();
38
41
  }
39
42
  /**
40
43
  * It just writes the message in the input and doesn't send it
@@ -42,42 +45,42 @@ export default class ChannelsPostCreate {
42
45
  */
43
46
  async writeMessage(message) {
44
47
  await this.input.waitFor();
45
- await expect(this.input).toBeVisible();
48
+ await test.expect(this.input).toBeVisible();
46
49
  await this.input.fill(message);
47
50
  }
48
51
  /**
49
52
  * Returns the value of the message input
50
53
  */
51
54
  async getInputValue() {
52
- await expect(this.input).toBeVisible();
55
+ await test.expect(this.input).toBeVisible();
53
56
  return await this.input.inputValue();
54
57
  }
55
58
  /**
56
59
  * Sends the message already written in the input
57
60
  */
58
61
  async sendMessage() {
59
- await expect(this.input).toBeVisible();
62
+ await test.expect(this.input).toBeVisible();
60
63
  const messageInputValue = await this.getInputValue();
61
- expect(messageInputValue).not.toBe('');
62
- await expect(this.sendMessageButton).toBeVisible();
63
- await expect(this.sendMessageButton).toBeEnabled();
64
+ test.expect(messageInputValue).not.toBe('');
65
+ await test.expect(this.sendMessageButton).toBeVisible();
66
+ await test.expect(this.sendMessageButton).toBeEnabled();
64
67
  await this.sendMessageButton.click();
65
68
  }
66
69
  /**
67
70
  * Click on Scheduled Draft button to open options
68
71
  */
69
72
  async clickOnScheduleDraftDropdownButton() {
70
- await expect(this.input).toBeVisible();
71
- await expect(this.scheduleDraftMessageButton).toBeVisible();
72
- await expect(this.scheduleDraftMessageButton).toBeEnabled();
73
+ await test.expect(this.input).toBeVisible();
74
+ await test.expect(this.scheduleDraftMessageButton).toBeVisible();
75
+ await test.expect(this.scheduleDraftMessageButton).toBeEnabled();
73
76
  await this.scheduleDraftMessageButton.click();
74
77
  }
75
78
  /**
76
79
  * Opens the message priority menu
77
80
  */
78
81
  async openPriorityMenu() {
79
- await expect(this.priorityButton).toBeVisible();
80
- await expect(this.priorityButton).toBeEnabled();
82
+ await test.expect(this.priorityButton).toBeVisible();
83
+ await test.expect(this.priorityButton).toBeEnabled();
81
84
  await this.priorityButton.click();
82
85
  }
83
86
  /**
@@ -86,7 +89,7 @@ export default class ChannelsPostCreate {
86
89
  async postMessage(message, files) {
87
90
  await this.writeMessage(message);
88
91
  if (files) {
89
- const filePaths = files.map((file) => path.join(assetPath, file));
92
+ const filePaths = files.map((file$1) => path.join(file.assetPath, file$1));
90
93
  this.container.page().once('filechooser', async (fileChooser) => {
91
94
  await fileChooser.setFiles(filePaths);
92
95
  });
@@ -98,11 +101,11 @@ export default class ChannelsPostCreate {
98
101
  await this.sendMessage();
99
102
  }
100
103
  async openEmojiPicker() {
101
- await expect(this.emojiButton).toBeVisible();
104
+ await test.expect(this.emojiButton).toBeVisible();
102
105
  await this.emojiButton.click();
103
106
  }
104
- async waitUntilFilePreviewContains(files, timeout = duration.ten_sec) {
105
- await waitUntil(async () => {
107
+ async waitUntilFilePreviewContains(files, timeout = util.duration.ten_sec) {
108
+ await asyncWaitUntil.waitUntil(async () => {
106
109
  const previews = this.filePreview.locator('.file-preview');
107
110
  const details = this.filePreview.locator('.post-image__details');
108
111
  const [previewsCount, detailsCount] = await Promise.all([previews.count(), details.count()]);
@@ -110,3 +113,6 @@ export default class ChannelsPostCreate {
110
113
  }, { timeout });
111
114
  }
112
115
  }
116
+
117
+ module.exports = ChannelsPostCreate;
118
+ //# sourceMappingURL=post_create.js.map
@@ -1,7 +1,10 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
1
5
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
6
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- export default class PostDotMenu {
7
+ class PostDotMenu {
5
8
  container;
6
9
  replyMenuItem;
7
10
  forwardMenuItem;
@@ -36,6 +39,9 @@ export default class PostDotMenu {
36
39
  this.deleteMenuItem = getMenuItem('Delete');
37
40
  }
38
41
  async toBeVisible() {
39
- await expect(this.container).toBeVisible();
42
+ await test.expect(this.container).toBeVisible();
40
43
  }
41
44
  }
45
+
46
+ module.exports = PostDotMenu;
47
+ //# sourceMappingURL=post_dot_menu.js.map
@@ -1,11 +1,14 @@
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
+
1
9
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
10
  // See LICENSE.txt for license information.
3
- import path from 'node:path';
4
- import { expect } from '@playwright/test';
5
- import DeletePostConfirmationDialog from './delete_post_confirmation_dialog';
6
- import RestorePostConfirmationDialog from './restore_post_confirmation_dialog';
7
- import { assetPath } from '@/file';
8
- export default class ChannelsPostEdit {
11
+ class ChannelsPostEdit {
9
12
  container;
10
13
  input;
11
14
  attachmentButton;
@@ -19,25 +22,25 @@ export default class ChannelsPostEdit {
19
22
  this.attachmentButton = container.locator('#fileUploadButton');
20
23
  this.emojiButton = container.getByLabel('select an emoji');
21
24
  this.sendMessageButton = container.locator('.save');
22
- this.deleteConfirmationDialog = new DeletePostConfirmationDialog(container.page().locator('#deletePostModal'));
23
- this.restorePostConfirmationDialog = new RestorePostConfirmationDialog(container.page().locator('#restorePostModal'));
25
+ this.deleteConfirmationDialog = new delete_post_confirmation_dialog(container.page().locator('#deletePostModal'));
26
+ this.restorePostConfirmationDialog = new restore_post_confirmation_dialog(container.page().locator('#restorePostModal'));
24
27
  }
25
28
  async toBeVisible() {
26
- await expect(this.container).toBeVisible();
29
+ await test.expect(this.container).toBeVisible();
27
30
  await this.input.waitFor();
28
- await expect(this.input).toBeVisible();
31
+ await test.expect(this.input).toBeVisible();
29
32
  }
30
33
  async toNotBeVisible() {
31
- await expect(this.input).not.toBeVisible();
34
+ await test.expect(this.input).not.toBeVisible();
32
35
  }
33
36
  async writeMessage(message) {
34
37
  await this.input.waitFor();
35
- await expect(this.input).toBeVisible();
38
+ await test.expect(this.input).toBeVisible();
36
39
  await this.input.clear();
37
40
  await this.input.fill(message);
38
41
  }
39
42
  async addFiles(files) {
40
- const filePaths = files.map((file) => path.join(assetPath, file));
43
+ const filePaths = files.map((file$1) => path.join(file.assetPath, file$1));
41
44
  this.container.page().once('filechooser', async (fileChooser) => {
42
45
  await fileChooser.setFiles(filePaths);
43
46
  });
@@ -56,8 +59,8 @@ export default class ChannelsPostEdit {
56
59
  }
57
60
  async sendMessage() {
58
61
  await this.input.scrollIntoViewIfNeeded();
59
- await expect(this.sendMessageButton).toBeVisible();
60
- await expect(this.sendMessageButton).toBeEnabled();
62
+ await test.expect(this.sendMessageButton).toBeVisible();
63
+ await test.expect(this.sendMessageButton).toBeEnabled();
61
64
  await this.sendMessageButton.click();
62
65
  }
63
66
  async postMessage(message) {
@@ -65,6 +68,9 @@ export default class ChannelsPostEdit {
65
68
  await this.sendMessage();
66
69
  }
67
70
  async toContainText(text) {
68
- await expect(this.container).toContainText(text);
71
+ await test.expect(this.container).toContainText(text);
69
72
  }
70
73
  }
74
+
75
+ module.exports = ChannelsPostEdit;
76
+ //# sourceMappingURL=post_edit.js.map
@@ -1,7 +1,10 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
1
5
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
6
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- export default class PostMenu {
7
+ class PostMenu {
5
8
  container;
6
9
  plusOneEmojiButton;
7
10
  grinningEmojiButton;
@@ -23,7 +26,7 @@ export default class PostMenu {
23
26
  this.dotMenuButton = container.getByRole('button', { name: 'more' });
24
27
  }
25
28
  async toBeVisible() {
26
- await expect(this.container).toBeVisible();
29
+ await test.expect(this.container).toBeVisible();
27
30
  }
28
31
  /**
29
32
  * Clicks on the reply button from the post menu.
@@ -46,3 +49,6 @@ export default class PostMenu {
46
49
  await this.dotMenuButton.click();
47
50
  }
48
51
  }
52
+
53
+ module.exports = PostMenu;
54
+ //# sourceMappingURL=post_menu.js.map
@@ -1,7 +1,10 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
1
5
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
6
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- export default class PostReminderMenu {
7
+ class PostReminderMenu {
5
8
  container;
6
9
  thirtyMinsMenuItem;
7
10
  oneHourMenuItem;
@@ -18,6 +21,9 @@ export default class PostReminderMenu {
18
21
  this.customMenuItem = getMenuItem('Custom');
19
22
  }
20
23
  async toBeVisible() {
21
- await expect(this.container).toBeVisible();
24
+ await test.expect(this.container).toBeVisible();
22
25
  }
23
26
  }
27
+
28
+ module.exports = PostReminderMenu;
29
+ //# sourceMappingURL=post_reminder_menu.js.map
@@ -1,7 +1,10 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
1
5
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
6
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- export default class RestorePostConfirmationDialog {
7
+ class RestorePostConfirmationDialog {
5
8
  container;
6
9
  cancelButton;
7
10
  confirmButton;
@@ -11,14 +14,17 @@ export default class RestorePostConfirmationDialog {
11
14
  this.confirmButton = container.locator('button.GenericModal__button.btn.btn-primary.confirm');
12
15
  }
13
16
  async toBeVisible() {
14
- await expect(this.container).toBeVisible();
15
- await expect(this.cancelButton).toBeVisible();
16
- await expect(this.confirmButton).toBeVisible();
17
+ await test.expect(this.container).toBeVisible();
18
+ await test.expect(this.cancelButton).toBeVisible();
19
+ await test.expect(this.confirmButton).toBeVisible();
17
20
  }
18
21
  async notToBeVisible() {
19
- await expect(this.container).not.toBeVisible();
22
+ await test.expect(this.container).not.toBeVisible();
20
23
  }
21
24
  async confirmRestore() {
22
25
  await this.confirmButton.click();
23
26
  }
24
27
  }
28
+
29
+ module.exports = RestorePostConfirmationDialog;
30
+ //# sourceMappingURL=restore_post_confirmation_dialog.js.map
@@ -1,7 +1,10 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
1
5
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
6
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- export default class ScheduledDraftMenu {
7
+ class ScheduledDraftMenu {
5
8
  container;
6
9
  scheduleDraftMessageCustomTimeOption;
7
10
  constructor(container) {
@@ -9,9 +12,12 @@ export default class ScheduledDraftMenu {
9
12
  this.scheduleDraftMessageCustomTimeOption = container.getByText('Choose a custom time');
10
13
  }
11
14
  async toBeVisible() {
12
- await expect(this.container).toBeVisible();
15
+ await test.expect(this.container).toBeVisible();
13
16
  }
14
17
  async selectCustomTime() {
15
18
  await this.scheduleDraftMessageCustomTimeOption.click();
16
19
  }
17
20
  }
21
+
22
+ module.exports = ScheduledDraftMenu;
23
+ //# sourceMappingURL=scheduled_draft_menu.js.map
@@ -1,7 +1,10 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
1
5
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
6
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- export default class ScheduledDraftModal {
7
+ class ScheduledDraftModal {
5
8
  container;
6
9
  confirmButton;
7
10
  dateInput;
@@ -15,7 +18,7 @@ export default class ScheduledDraftModal {
15
18
  this.timeDropdownOptions = container.locator('ul.dropdown-menu .MenuItem');
16
19
  }
17
20
  async toBeVisible() {
18
- await expect(this.container).toBeVisible();
21
+ await test.expect(this.container).toBeVisible();
19
22
  }
20
23
  getDaySuffix(day) {
21
24
  if (day > 3 && day < 21)
@@ -64,7 +67,7 @@ export default class ScheduledDraftModal {
64
67
  async selectTime() {
65
68
  await this.timeLocator.click();
66
69
  const timeButton = this.timeDropdownOptions.nth(2);
67
- await expect(timeButton).toBeVisible();
70
+ await test.expect(timeButton).toBeVisible();
68
71
  await timeButton.click();
69
72
  }
70
73
  getPacificDate() {
@@ -76,3 +79,6 @@ export default class ScheduledDraftModal {
76
79
  return pacificTime;
77
80
  }
78
81
  }
82
+
83
+ module.exports = ScheduledDraftModal;
84
+ //# sourceMappingURL=scheduled_draft_modal.js.map
@@ -1,7 +1,10 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+
1
5
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
6
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- export default class SearchPopover {
7
+ class SearchPopover {
5
8
  container;
6
9
  messagesButton;
7
10
  filesButton;
@@ -29,9 +32,12 @@ export default class SearchPopover {
29
32
  return false;
30
33
  }
31
34
  async toBeVisible() {
32
- await expect(this.container).toBeVisible();
35
+ await test.expect(this.container).toBeVisible();
33
36
  }
34
37
  getSelectedSuggestion() {
35
38
  return this.searchHints.locator('.suggestion--selected');
36
39
  }
37
40
  }
41
+
42
+ module.exports = SearchPopover;
43
+ //# sourceMappingURL=search_popover.js.map