@mattermost/playwright-lib 10.7.0-1 → 10.7.0-2

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 (79) 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.d.ts +2 -2
  5. package/dist/flag.js +77 -35
  6. package/dist/flag.js.map +1 -1
  7. package/dist/global_setup.js +24 -14
  8. package/dist/global_setup.js.map +1 -1
  9. package/dist/index.js +42 -9
  10. package/dist/mock_browser_api.js +8 -2
  11. package/dist/server/channel.js +9 -3
  12. package/dist/server/client.js +16 -10
  13. package/dist/server/default_config.js +15 -9
  14. package/dist/server/index.d.ts +0 -1
  15. package/dist/server/init.js +36 -29
  16. package/dist/server/post.js +9 -3
  17. package/dist/server/team.js +9 -3
  18. package/dist/server/user.js +15 -8
  19. package/dist/test_action.js +14 -3
  20. package/dist/test_config.js +30 -4
  21. package/dist/test_fixture.d.ts +2 -2
  22. package/dist/test_fixture.js +68 -49
  23. package/dist/test_fixture.js.map +1 -1
  24. package/dist/ui/components/channels/app_bar.js +9 -3
  25. package/dist/ui/components/channels/center_view.js +28 -22
  26. package/dist/ui/components/channels/delete_post_confirmation_dialog.js +14 -8
  27. package/dist/ui/components/channels/delete_post_modal.js +10 -4
  28. package/dist/ui/components/channels/emoji_gif_picker.js +15 -9
  29. package/dist/ui/components/channels/find_channels_modal.js +9 -3
  30. package/dist/ui/components/channels/generic_confirm_modal.js +11 -5
  31. package/dist/ui/components/channels/header.js +9 -3
  32. package/dist/ui/components/channels/message_priority.js +20 -14
  33. package/dist/ui/components/channels/post.js +16 -10
  34. package/dist/ui/components/channels/post_create.js +29 -23
  35. package/dist/ui/components/channels/post_dot_menu.js +9 -3
  36. package/dist/ui/components/channels/post_edit.js +22 -16
  37. package/dist/ui/components/channels/post_menu.js +9 -3
  38. package/dist/ui/components/channels/post_reminder_menu.js +9 -3
  39. package/dist/ui/components/channels/restore_post_confirmation_dialog.js +12 -6
  40. package/dist/ui/components/channels/scheduled_draft_menu.js +9 -3
  41. package/dist/ui/components/channels/scheduled_draft_modal.js +10 -4
  42. package/dist/ui/components/channels/search_popover.js +9 -3
  43. package/dist/ui/components/channels/settings/notification_settings.js +14 -8
  44. package/dist/ui/components/channels/settings/settings_modal.js +13 -7
  45. package/dist/ui/components/channels/sidebar_left.js +14 -8
  46. package/dist/ui/components/channels/sidebar_right.js +26 -20
  47. package/dist/ui/components/channels/thread_footer.js +9 -3
  48. package/dist/ui/components/channels/user_profile_popover.js +9 -3
  49. package/dist/ui/components/footer.js +9 -3
  50. package/dist/ui/components/global_header.js +13 -7
  51. package/dist/ui/components/index.js +74 -72
  52. package/dist/ui/components/main_header.js +9 -3
  53. package/dist/ui/components/system_console/navbar.js +9 -3
  54. package/dist/ui/components/system_console/sections/system_users/column_toggle_menu.js +10 -4
  55. package/dist/ui/components/system_console/sections/system_users/feature_discovery.js +10 -4
  56. package/dist/ui/components/system_console/sections/system_users/filter_menu.js +9 -3
  57. package/dist/ui/components/system_console/sections/system_users/filter_popover.js +14 -8
  58. package/dist/ui/components/system_console/sections/system_users/mobile_security.js +9 -3
  59. package/dist/ui/components/system_console/sections/system_users/system_users.js +16 -10
  60. package/dist/ui/components/system_console/sidebar.js +10 -4
  61. package/dist/ui/pages/channels.js +24 -18
  62. package/dist/ui/pages/drafts.js +23 -17
  63. package/dist/ui/pages/index.js +30 -17
  64. package/dist/ui/pages/landing_login.js +11 -5
  65. package/dist/ui/pages/login.js +14 -8
  66. package/dist/ui/pages/reset_password.js +15 -9
  67. package/dist/ui/pages/scheduled_draft.js +25 -19
  68. package/dist/ui/pages/signup.js +17 -11
  69. package/dist/ui/pages/system_console.js +22 -16
  70. package/dist/util.js +19 -8
  71. package/dist/visual/index.js +20 -14
  72. package/dist/visual/percy.js +10 -4
  73. package/package.json +1 -1
  74. package/dist/server/index.js +0 -10
  75. package/dist/server/plugins.d.ts +0 -2
  76. package/dist/server/plugins.js +0 -30
  77. package/dist/server/plugins.js.map +0 -1
  78. package/dist/tsconfig.tsbuildinfo +0 -1
  79. package/dist/types.js +0 -3
@@ -1,13 +1,16 @@
1
+ 'use strict';
2
+
3
+ var test = require('@playwright/test');
4
+ var header = require('./header.js');
5
+ var post_create = require('./post_create.js');
6
+ var post_edit = require('./post_edit.js');
7
+ var post = require('./post.js');
8
+ var util = require('../../../util.js');
9
+ var asyncWaitUntil = require('async-wait-until');
10
+
1
11
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
2
12
  // See LICENSE.txt for license information.
3
- import { expect } from '@playwright/test';
4
- import ChannelsHeader from './header';
5
- import ChannelsPostCreate from './post_create';
6
- import ChannelsPostEdit from './post_edit';
7
- import ChannelsPost from './post';
8
- import { duration } from '@/util';
9
- import { waitUntil } from '@/test_action';
10
- export default class ChannelsCenterView {
13
+ class ChannelsCenterView {
11
14
  container;
12
15
  header;
13
16
  postCreate;
@@ -23,10 +26,10 @@ export default class ChannelsCenterView {
23
26
  constructor(container) {
24
27
  this.container = container;
25
28
  this.scheduledDraftChannelInfoMessageLocator = 'span:has-text("Message scheduled for")';
26
- this.header = new ChannelsHeader(this.container.locator('.channel-header'));
27
- this.postCreate = new ChannelsPostCreate(container.getByTestId('post-create'));
28
- this.scheduledDraftOptions = new ChannelsPostCreate(container.locator('#dropdown_send_post_options'));
29
- this.postEdit = new ChannelsPostEdit(container.locator('.post-edit__container'));
29
+ this.header = new header(this.container.locator('.channel-header'));
30
+ this.postCreate = new post_create(container.getByTestId('post-create'));
31
+ this.scheduledDraftOptions = new post_create(container.locator('#dropdown_send_post_options'));
32
+ this.postEdit = new post_edit(container.locator('.post-edit__container'));
30
33
  this.postBoxIndicator = container.locator('div.postBoxIndicator');
31
34
  this.scheduledDraftChannelIcon = container.locator('#create_post i.icon-draft-indicator');
32
35
  this.scheduledDraftChannelInfoMessage = container.locator('div.ScheduledPostIndicator span');
@@ -35,7 +38,7 @@ export default class ChannelsCenterView {
35
38
  this.editedPostIcon = (postID) => container.locator(`#postEdited_${postID}`);
36
39
  }
37
40
  async toBeVisible() {
38
- await expect(this.container).toBeVisible();
41
+ await test.expect(this.container).toBeVisible();
39
42
  await this.postCreate.toBeVisible();
40
43
  }
41
44
  /**
@@ -51,7 +54,7 @@ export default class ChannelsCenterView {
51
54
  async getFirstPost() {
52
55
  const firstPost = this.container.getByTestId('postView').first();
53
56
  await firstPost.waitFor();
54
- return new ChannelsPost(firstPost);
57
+ return new post(firstPost);
55
58
  }
56
59
  /**
57
60
  * Return the last post in the Center
@@ -59,7 +62,7 @@ export default class ChannelsCenterView {
59
62
  async getLastPost() {
60
63
  const lastPost = this.container.getByTestId('postView').last();
61
64
  await lastPost.waitFor();
62
- return new ChannelsPost(lastPost);
65
+ return new post(lastPost);
63
66
  }
64
67
  /**
65
68
  * Return the ID of the last post in the Center
@@ -79,7 +82,7 @@ export default class ChannelsCenterView {
79
82
  async getNthPost(index) {
80
83
  const nthPost = this.container.getByTestId('postView').nth(index);
81
84
  await nthPost.waitFor();
82
- return new ChannelsPost(nthPost);
85
+ return new post(nthPost);
83
86
  }
84
87
  /**
85
88
  * Returns the Center post by post's id
@@ -88,17 +91,17 @@ export default class ChannelsCenterView {
88
91
  async getPostById(id) {
89
92
  const postById = this.container.locator(`[id="post_${id}"]`);
90
93
  await postById.waitFor();
91
- return new ChannelsPost(postById);
94
+ return new post(postById);
92
95
  }
93
- async waitUntilLastPostContains(text, timeout = duration.ten_sec) {
94
- await waitUntil(async () => {
96
+ async waitUntilLastPostContains(text, timeout = util.duration.ten_sec) {
97
+ await asyncWaitUntil.waitUntil(async () => {
95
98
  const post = await this.getLastPost();
96
99
  const content = await post.container.textContent();
97
100
  return content?.includes(text);
98
101
  }, { timeout });
99
102
  }
100
- async waitUntilPostWithIdContains(id, text, timeout = duration.ten_sec) {
101
- await waitUntil(async () => {
103
+ async waitUntilPostWithIdContains(id, text, timeout = util.duration.ten_sec) {
104
+ await asyncWaitUntil.waitUntil(async () => {
102
105
  const post = await this.getPostById(id);
103
106
  const content = await post.container.textContent();
104
107
  return content?.includes(text);
@@ -108,7 +111,7 @@ export default class ChannelsCenterView {
108
111
  await this.postBoxIndicator.isVisible();
109
112
  await this.scheduledDraftChannelIcon.isVisible();
110
113
  const messageLocator = this.scheduledDraftChannelInfoMessage.first();
111
- await expect(messageLocator).toContainText('Message scheduled for');
114
+ await test.expect(messageLocator).toContainText('Message scheduled for');
112
115
  }
113
116
  async clickOnLastEditedPost(postID) {
114
117
  if (postID) {
@@ -116,3 +119,6 @@ export default class ChannelsCenterView {
116
119
  }
117
120
  }
118
121
  }
122
+
123
+ module.exports = ChannelsCenterView;
124
+ //# sourceMappingURL=center_view.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 DeletePostConfirmationDialog {
7
+ class DeletePostConfirmationDialog {
5
8
  container;
6
9
  cancelButton;
7
10
  confirmButton;
@@ -11,14 +14,14 @@ export default class DeletePostConfirmationDialog {
11
14
  this.confirmButton = container.locator('button#deletePostModalButton');
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();
20
- await expect(this.cancelButton).not.toBeVisible();
21
- await expect(this.confirmButton).not.toBeVisible();
22
+ await test.expect(this.container).not.toBeVisible();
23
+ await test.expect(this.cancelButton).not.toBeVisible();
24
+ await test.expect(this.confirmButton).not.toBeVisible();
22
25
  }
23
26
  async cancelDeletion() {
24
27
  await this.cancelButton.click();
@@ -27,3 +30,6 @@ export default class DeletePostConfirmationDialog {
27
30
  await this.confirmButton.click();
28
31
  }
29
32
  }
33
+
34
+ module.exports = DeletePostConfirmationDialog;
35
+ //# sourceMappingURL=delete_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 DeletePostModal {
7
+ class DeletePostModal {
5
8
  container;
6
9
  confirmButton;
7
10
  constructor(container) {
@@ -9,12 +12,15 @@ export default class DeletePostModal {
9
12
  this.confirmButton = container.locator('#deletePostModalButton');
10
13
  }
11
14
  async toBeVisible() {
12
- await expect(this.container).toBeVisible();
15
+ await test.expect(this.container).toBeVisible();
13
16
  }
14
17
  async confirm() {
15
18
  await this.confirmButton.waitFor();
16
19
  await this.confirmButton.click();
17
20
  // Wait for the modal to disappear
18
- await expect(this.container).not.toBeVisible();
21
+ await test.expect(this.container).not.toBeVisible();
19
22
  }
20
23
  }
24
+
25
+ module.exports = DeletePostModal;
26
+ //# sourceMappingURL=delete_post_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 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