@mattermost/playwright-lib 10.7.0-0 → 10.7.0-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 (75) hide show
  1. package/dist/browser_context.js +14 -21
  2. package/dist/constant.js +3 -6
  3. package/dist/file.js +20 -20
  4. package/dist/flag.d.ts +2 -0
  5. package/dist/flag.js +49 -38
  6. package/dist/flag.js.map +1 -1
  7. package/dist/global_setup.js +14 -49
  8. package/dist/global_setup.js.map +1 -1
  9. package/dist/index.js +9 -42
  10. package/dist/mock_browser_api.js +2 -8
  11. package/dist/server/channel.js +3 -9
  12. package/dist/server/client.js +10 -16
  13. package/dist/server/default_config.js +9 -15
  14. package/dist/server/init.js +29 -36
  15. package/dist/server/plugins.d.ts +1 -1
  16. package/dist/server/plugins.js +13 -14
  17. package/dist/server/plugins.js.map +1 -1
  18. package/dist/server/post.js +3 -9
  19. package/dist/server/team.js +3 -9
  20. package/dist/server/user.js +8 -15
  21. package/dist/test_action.js +3 -14
  22. package/dist/test_config.js +4 -30
  23. package/dist/test_fixture.d.ts +2 -1
  24. package/dist/test_fixture.js +50 -68
  25. package/dist/test_fixture.js.map +1 -1
  26. package/dist/ui/components/channels/app_bar.js +3 -9
  27. package/dist/ui/components/channels/center_view.js +22 -28
  28. package/dist/ui/components/channels/delete_post_confirmation_dialog.js +8 -14
  29. package/dist/ui/components/channels/delete_post_modal.js +4 -10
  30. package/dist/ui/components/channels/emoji_gif_picker.js +9 -15
  31. package/dist/ui/components/channels/find_channels_modal.js +3 -9
  32. package/dist/ui/components/channels/generic_confirm_modal.js +5 -11
  33. package/dist/ui/components/channels/header.js +3 -9
  34. package/dist/ui/components/channels/message_priority.js +14 -20
  35. package/dist/ui/components/channels/post.js +10 -16
  36. package/dist/ui/components/channels/post_create.js +23 -29
  37. package/dist/ui/components/channels/post_dot_menu.js +3 -9
  38. package/dist/ui/components/channels/post_edit.js +16 -22
  39. package/dist/ui/components/channels/post_menu.js +3 -9
  40. package/dist/ui/components/channels/post_reminder_menu.js +3 -9
  41. package/dist/ui/components/channels/restore_post_confirmation_dialog.js +6 -12
  42. package/dist/ui/components/channels/scheduled_draft_menu.js +3 -9
  43. package/dist/ui/components/channels/scheduled_draft_modal.js +4 -10
  44. package/dist/ui/components/channels/search_popover.js +3 -9
  45. package/dist/ui/components/channels/settings/notification_settings.js +8 -14
  46. package/dist/ui/components/channels/settings/settings_modal.js +7 -13
  47. package/dist/ui/components/channels/sidebar_left.js +8 -14
  48. package/dist/ui/components/channels/sidebar_right.js +20 -26
  49. package/dist/ui/components/channels/thread_footer.js +3 -9
  50. package/dist/ui/components/channels/user_profile_popover.js +3 -9
  51. package/dist/ui/components/footer.js +3 -9
  52. package/dist/ui/components/global_header.js +7 -13
  53. package/dist/ui/components/index.js +72 -74
  54. package/dist/ui/components/main_header.js +3 -9
  55. package/dist/ui/components/system_console/navbar.js +3 -9
  56. package/dist/ui/components/system_console/sections/system_users/column_toggle_menu.js +4 -10
  57. package/dist/ui/components/system_console/sections/system_users/feature_discovery.js +4 -10
  58. package/dist/ui/components/system_console/sections/system_users/filter_menu.js +3 -9
  59. package/dist/ui/components/system_console/sections/system_users/filter_popover.js +8 -14
  60. package/dist/ui/components/system_console/sections/system_users/mobile_security.js +3 -9
  61. package/dist/ui/components/system_console/sections/system_users/system_users.js +10 -16
  62. package/dist/ui/components/system_console/sidebar.js +4 -10
  63. package/dist/ui/pages/channels.js +18 -24
  64. package/dist/ui/pages/drafts.js +17 -23
  65. package/dist/ui/pages/index.js +17 -30
  66. package/dist/ui/pages/landing_login.js +5 -11
  67. package/dist/ui/pages/login.js +8 -14
  68. package/dist/ui/pages/reset_password.js +9 -15
  69. package/dist/ui/pages/scheduled_draft.js +19 -25
  70. package/dist/ui/pages/signup.js +11 -17
  71. package/dist/ui/pages/system_console.js +16 -22
  72. package/dist/util.js +8 -19
  73. package/dist/visual/index.js +14 -20
  74. package/dist/visual/percy.js +4 -10
  75. package/package.json +1 -1
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class PostDotMenu {
3
+ import { expect } from '@playwright/test';
4
+ export default class PostDotMenu {
8
5
  container;
9
6
  replyMenuItem;
10
7
  forwardMenuItem;
@@ -39,9 +36,6 @@ class PostDotMenu {
39
36
  this.deleteMenuItem = getMenuItem('Delete');
40
37
  }
41
38
  async toBeVisible() {
42
- await test.expect(this.container).toBeVisible();
39
+ await expect(this.container).toBeVisible();
43
40
  }
44
41
  }
45
-
46
- module.exports = PostDotMenu;
47
- //# sourceMappingURL=post_dot_menu.js.map
@@ -1,14 +1,11 @@
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
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
10
2
  // See LICENSE.txt for license information.
11
- class ChannelsPostEdit {
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 {
12
9
  container;
13
10
  input;
14
11
  attachmentButton;
@@ -22,25 +19,25 @@ class ChannelsPostEdit {
22
19
  this.attachmentButton = container.locator('#fileUploadButton');
23
20
  this.emojiButton = container.getByLabel('select an emoji');
24
21
  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'));
22
+ this.deleteConfirmationDialog = new DeletePostConfirmationDialog(container.page().locator('#deletePostModal'));
23
+ this.restorePostConfirmationDialog = new RestorePostConfirmationDialog(container.page().locator('#restorePostModal'));
27
24
  }
28
25
  async toBeVisible() {
29
- await test.expect(this.container).toBeVisible();
26
+ await expect(this.container).toBeVisible();
30
27
  await this.input.waitFor();
31
- await test.expect(this.input).toBeVisible();
28
+ await expect(this.input).toBeVisible();
32
29
  }
33
30
  async toNotBeVisible() {
34
- await test.expect(this.input).not.toBeVisible();
31
+ await expect(this.input).not.toBeVisible();
35
32
  }
36
33
  async writeMessage(message) {
37
34
  await this.input.waitFor();
38
- await test.expect(this.input).toBeVisible();
35
+ await expect(this.input).toBeVisible();
39
36
  await this.input.clear();
40
37
  await this.input.fill(message);
41
38
  }
42
39
  async addFiles(files) {
43
- const filePaths = files.map((file$1) => path.join(file.assetPath, file$1));
40
+ const filePaths = files.map((file) => path.join(assetPath, file));
44
41
  this.container.page().once('filechooser', async (fileChooser) => {
45
42
  await fileChooser.setFiles(filePaths);
46
43
  });
@@ -59,8 +56,8 @@ class ChannelsPostEdit {
59
56
  }
60
57
  async sendMessage() {
61
58
  await this.input.scrollIntoViewIfNeeded();
62
- await test.expect(this.sendMessageButton).toBeVisible();
63
- await test.expect(this.sendMessageButton).toBeEnabled();
59
+ await expect(this.sendMessageButton).toBeVisible();
60
+ await expect(this.sendMessageButton).toBeEnabled();
64
61
  await this.sendMessageButton.click();
65
62
  }
66
63
  async postMessage(message) {
@@ -68,9 +65,6 @@ class ChannelsPostEdit {
68
65
  await this.sendMessage();
69
66
  }
70
67
  async toContainText(text) {
71
- await test.expect(this.container).toContainText(text);
68
+ await expect(this.container).toContainText(text);
72
69
  }
73
70
  }
74
-
75
- module.exports = ChannelsPostEdit;
76
- //# sourceMappingURL=post_edit.js.map
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class PostMenu {
3
+ import { expect } from '@playwright/test';
4
+ export default class PostMenu {
8
5
  container;
9
6
  plusOneEmojiButton;
10
7
  grinningEmojiButton;
@@ -26,7 +23,7 @@ class PostMenu {
26
23
  this.dotMenuButton = container.getByRole('button', { name: 'more' });
27
24
  }
28
25
  async toBeVisible() {
29
- await test.expect(this.container).toBeVisible();
26
+ await expect(this.container).toBeVisible();
30
27
  }
31
28
  /**
32
29
  * Clicks on the reply button from the post menu.
@@ -49,6 +46,3 @@ class PostMenu {
49
46
  await this.dotMenuButton.click();
50
47
  }
51
48
  }
52
-
53
- module.exports = PostMenu;
54
- //# sourceMappingURL=post_menu.js.map
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class PostReminderMenu {
3
+ import { expect } from '@playwright/test';
4
+ export default class PostReminderMenu {
8
5
  container;
9
6
  thirtyMinsMenuItem;
10
7
  oneHourMenuItem;
@@ -21,9 +18,6 @@ class PostReminderMenu {
21
18
  this.customMenuItem = getMenuItem('Custom');
22
19
  }
23
20
  async toBeVisible() {
24
- await test.expect(this.container).toBeVisible();
21
+ await expect(this.container).toBeVisible();
25
22
  }
26
23
  }
27
-
28
- module.exports = PostReminderMenu;
29
- //# sourceMappingURL=post_reminder_menu.js.map
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class RestorePostConfirmationDialog {
3
+ import { expect } from '@playwright/test';
4
+ export default class RestorePostConfirmationDialog {
8
5
  container;
9
6
  cancelButton;
10
7
  confirmButton;
@@ -14,17 +11,14 @@ class RestorePostConfirmationDialog {
14
11
  this.confirmButton = container.locator('button.GenericModal__button.btn.btn-primary.confirm');
15
12
  }
16
13
  async toBeVisible() {
17
- await test.expect(this.container).toBeVisible();
18
- await test.expect(this.cancelButton).toBeVisible();
19
- await test.expect(this.confirmButton).toBeVisible();
14
+ await expect(this.container).toBeVisible();
15
+ await expect(this.cancelButton).toBeVisible();
16
+ await expect(this.confirmButton).toBeVisible();
20
17
  }
21
18
  async notToBeVisible() {
22
- await test.expect(this.container).not.toBeVisible();
19
+ await expect(this.container).not.toBeVisible();
23
20
  }
24
21
  async confirmRestore() {
25
22
  await this.confirmButton.click();
26
23
  }
27
24
  }
28
-
29
- module.exports = RestorePostConfirmationDialog;
30
- //# sourceMappingURL=restore_post_confirmation_dialog.js.map
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class ScheduledDraftMenu {
3
+ import { expect } from '@playwright/test';
4
+ export default class ScheduledDraftMenu {
8
5
  container;
9
6
  scheduleDraftMessageCustomTimeOption;
10
7
  constructor(container) {
@@ -12,12 +9,9 @@ class ScheduledDraftMenu {
12
9
  this.scheduleDraftMessageCustomTimeOption = container.getByText('Choose a custom time');
13
10
  }
14
11
  async toBeVisible() {
15
- await test.expect(this.container).toBeVisible();
12
+ await expect(this.container).toBeVisible();
16
13
  }
17
14
  async selectCustomTime() {
18
15
  await this.scheduleDraftMessageCustomTimeOption.click();
19
16
  }
20
17
  }
21
-
22
- module.exports = ScheduledDraftMenu;
23
- //# sourceMappingURL=scheduled_draft_menu.js.map
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class ScheduledDraftModal {
3
+ import { expect } from '@playwright/test';
4
+ export default class ScheduledDraftModal {
8
5
  container;
9
6
  confirmButton;
10
7
  dateInput;
@@ -18,7 +15,7 @@ class ScheduledDraftModal {
18
15
  this.timeDropdownOptions = container.locator('ul.dropdown-menu .MenuItem');
19
16
  }
20
17
  async toBeVisible() {
21
- await test.expect(this.container).toBeVisible();
18
+ await expect(this.container).toBeVisible();
22
19
  }
23
20
  getDaySuffix(day) {
24
21
  if (day > 3 && day < 21)
@@ -67,7 +64,7 @@ class ScheduledDraftModal {
67
64
  async selectTime() {
68
65
  await this.timeLocator.click();
69
66
  const timeButton = this.timeDropdownOptions.nth(2);
70
- await test.expect(timeButton).toBeVisible();
67
+ await expect(timeButton).toBeVisible();
71
68
  await timeButton.click();
72
69
  }
73
70
  getPacificDate() {
@@ -79,6 +76,3 @@ class ScheduledDraftModal {
79
76
  return pacificTime;
80
77
  }
81
78
  }
82
-
83
- module.exports = ScheduledDraftModal;
84
- //# sourceMappingURL=scheduled_draft_modal.js.map
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class SearchPopover {
3
+ import { expect } from '@playwright/test';
4
+ export default class SearchPopover {
8
5
  container;
9
6
  messagesButton;
10
7
  filesButton;
@@ -32,12 +29,9 @@ class SearchPopover {
32
29
  return false;
33
30
  }
34
31
  async toBeVisible() {
35
- await test.expect(this.container).toBeVisible();
32
+ await expect(this.container).toBeVisible();
36
33
  }
37
34
  getSelectedSuggestion() {
38
35
  return this.searchHints.locator('.suggestion--selected');
39
36
  }
40
37
  }
41
-
42
- module.exports = SearchPopover;
43
- //# sourceMappingURL=search_popover.js.map
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class NotificationsSettings {
3
+ import { expect } from '@playwright/test';
4
+ export default class NotificationsSettings {
8
5
  container;
9
6
  keysWithHighlightDesc;
10
7
  constructor(container) {
@@ -12,7 +9,7 @@ class NotificationsSettings {
12
9
  this.keysWithHighlightDesc = container.locator('#keywordsAndHighlightDesc');
13
10
  }
14
11
  async toBeVisible() {
15
- await test.expect(this.container).toBeVisible();
12
+ await expect(this.container).toBeVisible();
16
13
  }
17
14
  async expandSection(section) {
18
15
  if (section === 'keysWithHighlight') {
@@ -21,21 +18,18 @@ class NotificationsSettings {
21
18
  }
22
19
  }
23
20
  async verifySectionIsExpanded(section) {
24
- await test.expect(this.container.locator(`#${section}Edit`)).not.toBeVisible();
21
+ await expect(this.container.locator(`#${section}Edit`)).not.toBeVisible();
25
22
  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();
23
+ await expect(this.container.getByText('Enter non case-sensitive keywords, press Tab or use commas to separate them:')).toBeVisible();
24
+ await expect(this.container.getByText('These keywords will be shown to you with a highlight when anyone sends a message that includes them.')).toBeVisible();
28
25
  }
29
26
  }
30
27
  async getKeywordsInput() {
31
- await test.expect(this.container.locator('input')).toBeVisible();
28
+ await expect(this.container.locator('input')).toBeVisible();
32
29
  return this.container.locator('input');
33
30
  }
34
31
  async save() {
35
- await test.expect(this.container.getByText('Save')).toBeVisible();
32
+ await expect(this.container.getByText('Save')).toBeVisible();
36
33
  await this.container.getByText('Save').click();
37
34
  }
38
35
  }
39
-
40
- module.exports = NotificationsSettings;
41
- //# sourceMappingURL=notification_settings.js.map
@@ -1,32 +1,26 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
- var notification_settings = require('./notification_settings.js');
5
-
6
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
7
2
  // See LICENSE.txt for license information.
8
- class SettingsModal {
3
+ import { expect } from '@playwright/test';
4
+ import NotificationsSettings from './notification_settings';
5
+ export default class SettingsModal {
9
6
  container;
10
7
  notificationsSettingsTab;
11
8
  notificationsSettings;
12
9
  constructor(container) {
13
10
  this.container = container;
14
11
  this.notificationsSettingsTab = container.locator('#notificationsButton');
15
- this.notificationsSettings = new notification_settings(container.locator('#notificationsSettings'));
12
+ this.notificationsSettings = new NotificationsSettings(container.locator('#notificationsSettings'));
16
13
  }
17
14
  async toBeVisible() {
18
- await test.expect(this.container).toBeVisible();
15
+ await expect(this.container).toBeVisible();
19
16
  }
20
17
  async openNotificationsTab() {
21
- await test.expect(this.notificationsSettingsTab).toBeVisible();
18
+ await expect(this.notificationsSettingsTab).toBeVisible();
22
19
  await this.notificationsSettingsTab.click();
23
20
  await this.notificationsSettings.toBeVisible();
24
21
  }
25
22
  async closeModal() {
26
23
  await this.container.getByLabel('Close').click();
27
- await test.expect(this.container).not.toBeVisible();
24
+ await expect(this.container).not.toBeVisible();
28
25
  }
29
26
  }
30
-
31
- module.exports = SettingsModal;
32
- //# sourceMappingURL=settings_modal.js.map
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class ChannelsSidebarLeft {
3
+ import { expect } from '@playwright/test';
4
+ export default class ChannelsSidebarLeft {
8
5
  container;
9
6
  findChannelButton;
10
7
  scheduledDraftCountonLHS;
@@ -14,14 +11,14 @@ class ChannelsSidebarLeft {
14
11
  this.scheduledDraftCountonLHS = container.locator('span.scheduledPostBadge');
15
12
  }
16
13
  async toBeVisible() {
17
- await test.expect(this.container).toBeVisible();
14
+ await expect(this.container).toBeVisible();
18
15
  }
19
16
  async assertNoPendingScheduledDraft() {
20
- await test.expect(this.scheduledDraftCountonLHS).not.toBeVisible();
17
+ await expect(this.scheduledDraftCountonLHS).not.toBeVisible();
21
18
  }
22
19
  async assertscheduledDraftCountLHS(count) {
23
- await test.expect(this.scheduledDraftCountonLHS).toBeVisible();
24
- await test.expect(this.scheduledDraftCountonLHS).toHaveText(count);
20
+ await expect(this.scheduledDraftCountonLHS).toBeVisible();
21
+ await expect(this.scheduledDraftCountonLHS).toHaveText(count);
25
22
  }
26
23
  /**
27
24
  * Clicks on the sidebar channel link with the given name.
@@ -39,16 +36,13 @@ class ChannelsSidebarLeft {
39
36
  async draftsVisible() {
40
37
  const draftSidebarLink = this.container.getByText('Drafts', { exact: true });
41
38
  await draftSidebarLink.waitFor();
42
- await test.expect(draftSidebarLink).toBeVisible();
39
+ await expect(draftSidebarLink).toBeVisible();
43
40
  }
44
41
  /**
45
42
  * Verifies 'Drafts' as a sidebar link does not exist in LHS.
46
43
  */
47
44
  async draftsNotVisible() {
48
45
  const channel = this.container.getByText('Drafts', { exact: true });
49
- await test.expect(channel).not.toBeVisible();
46
+ await expect(channel).not.toBeVisible();
50
47
  }
51
48
  }
52
-
53
- module.exports = ChannelsSidebarLeft;
54
- //# sourceMappingURL=sidebar_left.js.map
@@ -1,13 +1,10 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
- var post_create = require('./post_create.js');
5
- var post_edit = require('./post_edit.js');
6
- var post = require('./post.js');
7
-
8
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
9
2
  // See LICENSE.txt for license information.
10
- class ChannelsSidebarRight {
3
+ import { expect } from '@playwright/test';
4
+ import ChannelsPostCreate from './post_create';
5
+ import ChannelsPostEdit from './post_edit';
6
+ import ChannelsPost from './post';
7
+ export default class ChannelsSidebarRight {
11
8
  container;
12
9
  closeButton;
13
10
  postCreate;
@@ -27,37 +24,37 @@ class ChannelsSidebarRight {
27
24
  this.scheduledDraftSeeAllLink = container.locator('a:has-text("See all")');
28
25
  this.scheduledDraftChannelInfoMessageText = container.locator('span:has-text("Message scheduled for")');
29
26
  this.rhsPostBody = container.locator('.post-message__text');
30
- this.postCreate = new post_create(container.getByTestId('comment-create'), true);
27
+ this.postCreate = new ChannelsPostCreate(container.getByTestId('comment-create'), true);
31
28
  this.closeButton = container.locator('.sidebar--right__close');
32
29
  this.editTextbox = container.locator('#edit_textbox');
33
- this.postEdit = new post_edit(container.locator('.post-edit__container'));
30
+ this.postEdit = new ChannelsPostEdit(container.locator('.post-edit__container'));
34
31
  this.currentVersionEditedPosttext = (postID) => container.locator(`#rhsPostMessageText_${postID} p`);
35
32
  this.restorePreviousPostVersionIcon = container.locator('button[aria-label="Select to restore an old message."]');
36
33
  }
37
34
  async toBeVisible() {
38
- await test.expect(this.container).toBeVisible();
35
+ await expect(this.container).toBeVisible();
39
36
  }
40
37
  /**
41
38
  * Returns the RHS post by post id
42
39
  * @param postId Just the ID without the prefix
43
40
  */
44
41
  async getPostById(postId) {
45
- const post$1 = this.container.locator(`[id="rhsPost_${postId}"]`);
46
- await post$1.waitFor();
47
- return new post(post$1);
42
+ const post = this.container.locator(`[id="rhsPost_${postId}"]`);
43
+ await post.waitFor();
44
+ return new ChannelsPost(post);
48
45
  }
49
46
  /**
50
47
  * Return the last post in the RHS
51
48
  */
52
49
  async getLastPost() {
53
- const post$1 = this.container.getByTestId('rhsPostView').last();
54
- await post$1.waitFor();
55
- return new post(post$1);
50
+ const post = this.container.getByTestId('rhsPostView').last();
51
+ await post.waitFor();
52
+ return new ChannelsPost(post);
56
53
  }
57
54
  async getFirstPost() {
58
- const post$1 = this.container.getByTestId('rhsPostView').first();
59
- await post$1.waitFor();
60
- return new post(post$1);
55
+ const post = this.container.getByTestId('rhsPostView').first();
56
+ await post.waitFor();
57
+ return new ChannelsPost(post);
61
58
  }
62
59
  /**
63
60
  * Closes the RHS
@@ -65,23 +62,20 @@ class ChannelsSidebarRight {
65
62
  async close() {
66
63
  await this.closeButton.waitFor();
67
64
  await this.closeButton.click();
68
- await test.expect(this.container).not.toBeVisible();
65
+ await expect(this.container).not.toBeVisible();
69
66
  }
70
67
  async clickOnSeeAllscheduledDrafts() {
71
68
  await this.scheduledDraftSeeAllLink.isVisible();
72
69
  await this.scheduledDraftSeeAllLink.click();
73
70
  }
74
71
  async toContainText(text) {
75
- await test.expect(this.container).toContainText(text);
72
+ await expect(this.container).toContainText(text);
76
73
  }
77
74
  async verifyCurrentVersionPostMessage(postID, postMessageContent) {
78
- test.expect(await this.currentVersionEditedPosttext(postID).textContent()).toBe(postMessageContent);
75
+ expect(await this.currentVersionEditedPosttext(postID).textContent()).toBe(postMessageContent);
79
76
  }
80
77
  async restorePreviousPostVersion() {
81
78
  await this.restorePreviousPostVersionIcon.isVisible();
82
79
  await this.restorePreviousPostVersionIcon.click();
83
80
  }
84
81
  }
85
-
86
- module.exports = ChannelsSidebarRight;
87
- //# sourceMappingURL=sidebar_right.js.map
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class ThreadFooter {
3
+ import { expect } from '@playwright/test';
4
+ export default class ThreadFooter {
8
5
  container;
9
6
  replyButton;
10
7
  constructor(container) {
@@ -12,7 +9,7 @@ class ThreadFooter {
12
9
  this.replyButton = container.locator('.ReplyButton');
13
10
  }
14
11
  async toBeVisible() {
15
- await test.expect(this.container).toBeVisible();
12
+ await expect(this.container).toBeVisible();
16
13
  }
17
14
  /**
18
15
  * Clicks on the reply button in the thread footer to open the thread in RHS.
@@ -22,6 +19,3 @@ class ThreadFooter {
22
19
  await this.replyButton.click();
23
20
  }
24
21
  }
25
-
26
- module.exports = ThreadFooter;
27
- //# sourceMappingURL=thread_footer.js.map
@@ -1,21 +1,15 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class UserProfilePopover {
3
+ import { expect } from '@playwright/test';
4
+ export default class UserProfilePopover {
8
5
  container;
9
6
  constructor(container) {
10
7
  this.container = container;
11
8
  }
12
9
  async toBeVisible() {
13
- await test.expect(this.container).toBeVisible();
10
+ await expect(this.container).toBeVisible();
14
11
  }
15
12
  async close() {
16
13
  await this.container.getByLabel('Close user profile popover').click();
17
14
  }
18
15
  }
19
-
20
- module.exports = UserProfilePopover;
21
- //# sourceMappingURL=user_profile_popover.js.map
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class Footer {
3
+ import { expect } from '@playwright/test';
4
+ export default class Footer {
8
5
  container;
9
6
  copyright;
10
7
  aboutLink;
@@ -20,9 +17,6 @@ class Footer {
20
17
  this.helpLink = container.locator('text=Help');
21
18
  }
22
19
  async toBeVisible() {
23
- await test.expect(this.copyright).toBeVisible();
20
+ await expect(this.copyright).toBeVisible();
24
21
  }
25
22
  }
26
-
27
- module.exports = Footer;
28
- //# sourceMappingURL=footer.js.map
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
- var test = require('@playwright/test');
4
-
5
1
  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
6
2
  // See LICENSE.txt for license information.
7
- class GlobalHeader {
3
+ import { expect } from '@playwright/test';
4
+ export default class GlobalHeader {
8
5
  container;
9
6
  accountMenuButton;
10
7
  productSwitchMenu;
@@ -20,29 +17,26 @@ class GlobalHeader {
20
17
  this.searchBox = container.locator('#searchFormContainer');
21
18
  }
22
19
  async toBeVisible(name) {
23
- await test.expect(this.container.getByRole('heading', { name })).toBeVisible();
20
+ await expect(this.container.getByRole('heading', { name })).toBeVisible();
24
21
  }
25
22
  async switchProduct(name) {
26
23
  await this.productSwitchMenu.click();
27
24
  await this.container.getByRole('link', { name }).click();
28
25
  }
29
26
  async openSettings() {
30
- await test.expect(this.settingsButton).toBeVisible();
27
+ await expect(this.settingsButton).toBeVisible();
31
28
  await this.settingsButton.click();
32
29
  }
33
30
  async openRecentMentions() {
34
- await test.expect(this.recentMentionsButton).toBeVisible();
31
+ await expect(this.recentMentionsButton).toBeVisible();
35
32
  await this.recentMentionsButton.click();
36
33
  }
37
34
  async openSearch() {
38
- await test.expect(this.searchBox).toBeVisible();
35
+ await expect(this.searchBox).toBeVisible();
39
36
  await this.searchBox.click();
40
37
  }
41
38
  async closeSearch() {
42
- await test.expect(this.searchBox).toBeVisible();
39
+ await expect(this.searchBox).toBeVisible();
43
40
  await this.searchBox.getByTestId('searchBoxClose').click();
44
41
  }
45
42
  }
46
-
47
- module.exports = GlobalHeader;
48
- //# sourceMappingURL=global_header.js.map