@mattermost/playwright-lib 10.7.0 → 11.3.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.
- package/dist/browser_context.d.ts +4 -2
- package/dist/browser_context.js +24 -4
- package/dist/browser_context.js.map +1 -1
- package/dist/constant.d.ts +2 -0
- package/dist/constant.js +5 -0
- package/dist/constant.js.map +1 -1
- package/dist/file.js +2 -1
- package/dist/file.js.map +1 -1
- package/dist/flag.js +1 -1
- package/dist/flag.js.map +1 -1
- package/dist/global_setup.js +26 -4
- package/dist/global_setup.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +93 -3
- package/dist/index.js.map +1 -1
- package/dist/mock_browser_api.js.map +1 -1
- package/dist/server/channel.js.map +1 -1
- package/dist/server/client.d.ts +6 -0
- package/dist/server/client.js +6 -0
- package/dist/server/client.js.map +1 -1
- package/dist/server/default_config.d.ts +1 -0
- package/dist/server/default_config.js +100 -29
- package/dist/server/default_config.js.map +1 -1
- package/dist/server/index.d.ts +3 -3
- package/dist/server/init.d.ts +9 -8
- package/dist/server/init.js +3 -11
- package/dist/server/init.js.map +1 -1
- package/dist/server/post.js.map +1 -1
- package/dist/server/team.d.ts +8 -1
- package/dist/server/team.js +13 -2
- package/dist/server/team.js.map +1 -1
- package/dist/server/user.d.ts +9 -2
- package/dist/server/user.js +36 -2
- package/dist/server/user.js.map +1 -1
- package/dist/test_action.d.ts +9 -0
- package/dist/test_action.js +39 -2
- package/dist/test_action.js.map +1 -1
- package/dist/test_config.js +1 -1
- package/dist/test_config.js.map +1 -1
- package/dist/test_fixture.d.ts +10 -3
- package/dist/test_fixture.js +19 -4
- package/dist/test_fixture.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/ui/components/channels/app_bar.js.map +1 -1
- package/dist/ui/components/channels/center_view.d.ts +17 -13
- package/dist/ui/components/channels/center_view.js +55 -25
- package/dist/ui/components/channels/center_view.js.map +1 -1
- package/dist/ui/components/channels/channel_settings/channel_settings_modal.d.ts +17 -0
- package/dist/ui/components/channels/channel_settings/channel_settings_modal.js +49 -0
- package/dist/ui/components/channels/channel_settings/channel_settings_modal.js.map +1 -0
- package/dist/ui/components/channels/channel_settings/configuration_settings.d.ts +11 -0
- package/dist/ui/components/channels/channel_settings/configuration_settings.js +48 -0
- package/dist/ui/components/channels/channel_settings/configuration_settings.js.map +1 -0
- package/dist/ui/components/channels/{scheduled_draft_menu.d.ts → channel_settings/info_settings.d.ts} +1 -3
- package/dist/ui/components/channels/channel_settings/info_settings.js +18 -0
- package/dist/ui/components/channels/channel_settings/info_settings.js.map +1 -0
- package/dist/ui/components/channels/delete_post_confirmation_dialog.js.map +1 -1
- package/dist/ui/components/channels/delete_post_modal.js.map +1 -1
- package/dist/ui/components/channels/delete_scheduled_post_modal.d.ts +10 -0
- package/dist/ui/components/channels/delete_scheduled_post_modal.js +26 -0
- package/dist/ui/components/channels/delete_scheduled_post_modal.js.map +1 -0
- package/dist/ui/components/channels/draft_post.d.ts +16 -0
- package/dist/ui/components/channels/draft_post.js +39 -0
- package/dist/ui/components/channels/draft_post.js.map +1 -0
- package/dist/ui/components/channels/emoji_gif_picker.d.ts +2 -0
- package/dist/ui/components/channels/emoji_gif_picker.js +6 -0
- package/dist/ui/components/channels/emoji_gif_picker.js.map +1 -1
- package/dist/ui/components/channels/find_channels_modal.js.map +1 -1
- package/dist/ui/components/channels/flag_post_confirmation_dialog.d.ts +24 -0
- package/dist/ui/components/channels/flag_post_confirmation_dialog.js +74 -0
- package/dist/ui/components/channels/flag_post_confirmation_dialog.js.map +1 -0
- package/dist/ui/components/channels/generic_confirm_modal.js.map +1 -1
- package/dist/ui/components/channels/header.d.ts +2 -0
- package/dist/ui/components/channels/header.js +6 -0
- package/dist/ui/components/channels/header.js.map +1 -1
- package/dist/ui/components/channels/invite_people_modal.d.ts +6 -0
- package/dist/ui/components/channels/invite_people_modal.js +18 -0
- package/dist/ui/components/channels/invite_people_modal.js.map +1 -0
- package/dist/ui/components/channels/message_priority.d.ts +0 -1
- package/dist/ui/components/channels/message_priority.js +2 -7
- package/dist/ui/components/channels/message_priority.js.map +1 -1
- package/dist/ui/components/channels/post.d.ts +7 -0
- package/dist/ui/components/channels/post.js +18 -0
- package/dist/ui/components/channels/post.js.map +1 -1
- package/dist/ui/components/channels/post_create.d.ts +1 -5
- package/dist/ui/components/channels/post_create.js +3 -12
- package/dist/ui/components/channels/post_create.js.map +1 -1
- package/dist/ui/components/channels/post_dot_menu.d.ts +2 -0
- package/dist/ui/components/channels/post_dot_menu.js +5 -0
- package/dist/ui/components/channels/post_dot_menu.js.map +1 -1
- package/dist/ui/components/channels/post_edit.js.map +1 -1
- package/dist/ui/components/channels/post_menu.js.map +1 -1
- package/dist/ui/components/channels/post_reminder_menu.js.map +1 -1
- package/dist/ui/components/channels/profile_modal.d.ts +27 -0
- package/dist/ui/components/channels/profile_modal.js +66 -0
- package/dist/ui/components/channels/profile_modal.js.map +1 -0
- package/dist/ui/components/channels/restore_post_confirmation_dialog.js.map +1 -1
- package/dist/ui/components/channels/schedule_message_menu.d.ts +12 -0
- package/dist/ui/components/channels/schedule_message_menu.js +31 -0
- package/dist/ui/components/channels/schedule_message_menu.js.map +1 -0
- package/dist/ui/components/channels/schedule_message_modal.d.ts +20 -0
- package/dist/ui/components/channels/schedule_message_modal.js +91 -0
- package/dist/ui/components/channels/schedule_message_modal.js.map +1 -0
- package/dist/ui/components/channels/scheduled_draft_modal.js.map +1 -1
- package/dist/ui/components/channels/scheduled_post.d.ts +20 -0
- package/dist/ui/components/channels/scheduled_post.js +47 -0
- package/dist/ui/components/channels/scheduled_post.js.map +1 -0
- package/dist/ui/components/channels/scheduled_post_indicator.d.ts +12 -0
- package/dist/ui/components/channels/scheduled_post_indicator.js +32 -0
- package/dist/ui/components/channels/scheduled_post_indicator.js.map +1 -0
- package/dist/ui/components/channels/{search_popover.d.ts → search_box.d.ts} +1 -1
- package/dist/ui/components/channels/{search_popover.js → search_box.js} +4 -3
- package/dist/ui/components/channels/search_box.js.map +1 -0
- package/dist/ui/components/channels/send_message_now_modal.d.ts +10 -0
- package/dist/ui/components/channels/send_message_now_modal.js +26 -0
- package/dist/ui/components/channels/send_message_now_modal.js.map +1 -0
- package/dist/ui/components/channels/settings/advanced_settings.d.ts +15 -0
- package/dist/ui/components/channels/settings/advanced_settings.js +35 -0
- package/dist/ui/components/channels/settings/advanced_settings.js.map +1 -0
- package/dist/ui/components/channels/settings/display_settings.d.ts +27 -0
- package/dist/ui/components/channels/settings/display_settings.js +77 -0
- package/dist/ui/components/channels/settings/display_settings.js.map +1 -0
- package/dist/ui/components/channels/settings/{notification_settings.d.ts → notifications_settings.d.ts} +12 -0
- package/dist/ui/components/channels/settings/{notification_settings.js → notifications_settings.js} +23 -1
- package/dist/ui/components/channels/settings/notifications_settings.js.map +1 -0
- package/dist/ui/components/channels/settings/settings_modal.d.ts +19 -4
- package/dist/ui/components/channels/settings/settings_modal.js +48 -7
- package/dist/ui/components/channels/settings/settings_modal.js.map +1 -1
- package/dist/ui/components/channels/settings/sidebar_settings.d.ts +12 -0
- package/dist/ui/components/channels/settings/sidebar_settings.js +28 -0
- package/dist/ui/components/channels/settings/sidebar_settings.js.map +1 -0
- package/dist/ui/components/channels/sidebar_left.d.ts +16 -3
- package/dist/ui/components/channels/sidebar_left.js +26 -9
- package/dist/ui/components/channels/sidebar_left.js.map +1 -1
- package/dist/ui/components/channels/sidebar_right.d.ts +3 -2
- package/dist/ui/components/channels/sidebar_right.js +6 -6
- package/dist/ui/components/channels/sidebar_right.js.map +1 -1
- package/dist/ui/components/channels/team_menu.d.ts +19 -0
- package/dist/ui/components/channels/team_menu.js +51 -0
- package/dist/ui/components/channels/team_menu.js.map +1 -0
- package/dist/ui/components/channels/team_settings/team_settings_modal.d.ts +6 -0
- package/dist/ui/components/channels/team_settings/team_settings_modal.js +18 -0
- package/dist/ui/components/channels/team_settings/team_settings_modal.js.map +1 -0
- package/dist/ui/components/channels/thread_footer.js.map +1 -1
- package/dist/ui/components/channels/user_profile_popover.js.map +1 -1
- package/dist/ui/components/footer.js.map +1 -1
- package/dist/ui/components/global_header.d.ts +7 -2
- package/dist/ui/components/global_header.js +13 -1
- package/dist/ui/components/global_header.js.map +1 -1
- package/dist/ui/components/index.d.ts +33 -5
- package/dist/ui/components/index.js +90 -10
- package/dist/ui/components/index.js.map +1 -1
- package/dist/ui/components/main_header.js.map +1 -1
- package/dist/ui/components/system_console/navbar.js.map +1 -1
- package/dist/ui/components/system_console/sections/site_configuration/notifications.d.ts +24 -0
- package/dist/ui/components/system_console/sections/site_configuration/notifications.js +63 -0
- package/dist/ui/components/system_console/sections/site_configuration/notifications.js.map +1 -0
- package/dist/ui/components/system_console/sections/system_users/column_toggle_menu.js.map +1 -1
- package/dist/ui/components/system_console/sections/system_users/feature_discovery.js.map +1 -1
- package/dist/ui/components/system_console/sections/system_users/filter_menu.js.map +1 -1
- package/dist/ui/components/system_console/sections/system_users/filter_popover.js.map +1 -1
- package/dist/ui/components/system_console/sections/system_users/mobile_security.d.ts +29 -2
- package/dist/ui/components/system_console/sections/system_users/mobile_security.js +75 -1
- package/dist/ui/components/system_console/sections/system_users/mobile_security.js.map +1 -1
- package/dist/ui/components/system_console/sections/system_users/system_users.js.map +1 -1
- package/dist/ui/components/system_console/sidebar.js.map +1 -1
- package/dist/ui/components/user_account_menu.d.ts +13 -0
- package/dist/ui/components/user_account_menu.js +32 -0
- package/dist/ui/components/user_account_menu.js.map +1 -0
- package/dist/ui/pages/channels.d.ts +46 -11
- package/dist/ui/pages/channels.js +119 -12
- package/dist/ui/pages/channels.js.map +1 -1
- package/dist/ui/pages/content_review_dm.d.ts +44 -0
- package/dist/ui/pages/content_review_dm.js +154 -0
- package/dist/ui/pages/content_review_dm.js.map +1 -0
- package/dist/ui/pages/drafts.d.ts +9 -25
- package/dist/ui/pages/drafts.js +25 -94
- package/dist/ui/pages/drafts.js.map +1 -1
- package/dist/ui/pages/index.d.ts +9 -5
- package/dist/ui/pages/index.js +10 -5
- package/dist/ui/pages/index.js.map +1 -1
- package/dist/ui/pages/landing_login.js.map +1 -1
- package/dist/ui/pages/login.d.ts +2 -2
- package/dist/ui/pages/login.js +1 -1
- package/dist/ui/pages/login.js.map +1 -1
- package/dist/ui/pages/reset_password.d.ts +2 -2
- package/dist/ui/pages/reset_password.js +1 -1
- package/dist/ui/pages/reset_password.js.map +1 -1
- package/dist/ui/pages/scheduled_posts.d.ts +23 -0
- package/dist/ui/pages/scheduled_posts.js +63 -0
- package/dist/ui/pages/scheduled_posts.js.map +1 -0
- package/dist/ui/pages/signup.d.ts +2 -2
- package/dist/ui/pages/signup.js +1 -1
- package/dist/ui/pages/signup.js.map +1 -1
- package/dist/ui/pages/system_console.d.ts +16 -14
- package/dist/ui/pages/system_console.js +10 -1
- package/dist/ui/pages/system_console.js.map +1 -1
- package/dist/ui/pages/threads.d.ts +13 -0
- package/dist/ui/pages/threads.js +44 -0
- package/dist/ui/pages/threads.js.map +1 -0
- package/dist/util.d.ts +17 -4
- package/dist/util.js +65 -5
- package/dist/util.js.map +1 -1
- package/dist/visual/index.js +9 -3
- package/dist/visual/index.js.map +1 -1
- package/dist/visual/percy.js.map +1 -1
- package/package.json +16 -17
- package/dist/ui/components/channels/scheduled_draft_menu.js +0 -23
- package/dist/ui/components/channels/scheduled_draft_menu.js.map +0 -1
- package/dist/ui/components/channels/search_popover.js.map +0 -1
- package/dist/ui/components/channels/settings/notification_settings.js.map +0 -1
- package/dist/ui/pages/scheduled_draft.d.ts +0 -38
- package/dist/ui/pages/scheduled_draft.js +0 -144
- package/dist/ui/pages/scheduled_draft.js.map +0 -1
|
@@ -0,0 +1,66 @@
|
|
|
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 ProfileModal {
|
|
8
|
+
container;
|
|
9
|
+
profileSettingsButton;
|
|
10
|
+
securityButton;
|
|
11
|
+
profileSettingsTab;
|
|
12
|
+
securityTab;
|
|
13
|
+
closeButton;
|
|
14
|
+
saveButton;
|
|
15
|
+
cancelButton;
|
|
16
|
+
constructor(container) {
|
|
17
|
+
this.container = container;
|
|
18
|
+
this.profileSettingsButton = container.locator('#profileButton');
|
|
19
|
+
this.securityButton = container.locator('#securityButton');
|
|
20
|
+
this.profileSettingsTab = new ProfileSettingsTab(container.getByRole('tabpanel', { name: 'Profile Settings' }));
|
|
21
|
+
this.securityTab = new SecurityTab(container.getByRole('tabpanel', { name: 'Security' }));
|
|
22
|
+
this.closeButton = container.getByRole('button', { name: 'Close' });
|
|
23
|
+
this.saveButton = container.locator('button:has-text("Save")');
|
|
24
|
+
this.cancelButton = container.locator('button:has-text("Cancel")');
|
|
25
|
+
}
|
|
26
|
+
async toBeVisible() {
|
|
27
|
+
await test.expect(this.container).toBeVisible();
|
|
28
|
+
}
|
|
29
|
+
async openProfileSettingsTab() {
|
|
30
|
+
await test.expect(this.profileSettingsButton).toBeVisible();
|
|
31
|
+
await this.profileSettingsButton.click();
|
|
32
|
+
await this.profileSettingsTab.toBeVisible();
|
|
33
|
+
return this.profileSettingsTab;
|
|
34
|
+
}
|
|
35
|
+
async openSecurityTab() {
|
|
36
|
+
await test.expect(this.securityButton).toBeVisible();
|
|
37
|
+
await this.securityButton.click();
|
|
38
|
+
await this.securityTab.toBeVisible();
|
|
39
|
+
return this.securityTab;
|
|
40
|
+
}
|
|
41
|
+
async closeModal() {
|
|
42
|
+
await this.closeButton.click();
|
|
43
|
+
await test.expect(this.container).not.toBeVisible();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
class ProfileSettingsTab {
|
|
47
|
+
container;
|
|
48
|
+
constructor(container) {
|
|
49
|
+
this.container = container;
|
|
50
|
+
}
|
|
51
|
+
async toBeVisible() {
|
|
52
|
+
await test.expect(this.container).toBeVisible();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class SecurityTab {
|
|
56
|
+
container;
|
|
57
|
+
constructor(container) {
|
|
58
|
+
this.container = container;
|
|
59
|
+
}
|
|
60
|
+
async toBeVisible() {
|
|
61
|
+
await test.expect(this.container).toBeVisible();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
module.exports = ProfileModal;
|
|
66
|
+
//# sourceMappingURL=profile_modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile_modal.js","sources":["../../../../src/ui/components/channels/profile_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 ProfileModal {\n readonly container: Locator;\n\n readonly profileSettingsButton;\n readonly securityButton;\n\n readonly profileSettingsTab;\n readonly securityTab;\n\n readonly closeButton;\n readonly saveButton;\n readonly cancelButton;\n\n constructor(container: Locator) {\n this.container = container;\n\n this.profileSettingsButton = container.locator('#profileButton');\n this.securityButton = container.locator('#securityButton');\n\n this.profileSettingsTab = new ProfileSettingsTab(container.getByRole('tabpanel', {name: 'Profile Settings'}));\n this.securityTab = new SecurityTab(container.getByRole('tabpanel', {name: 'Security'}));\n\n this.closeButton = container.getByRole('button', {name: 'Close'});\n this.saveButton = container.locator('button:has-text(\"Save\")');\n this.cancelButton = container.locator('button:has-text(\"Cancel\")');\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n\n async openProfileSettingsTab() {\n await expect(this.profileSettingsButton).toBeVisible();\n await this.profileSettingsButton.click();\n\n await this.profileSettingsTab.toBeVisible();\n\n return this.profileSettingsTab;\n }\n\n async openSecurityTab() {\n await expect(this.securityButton).toBeVisible();\n await this.securityButton.click();\n\n await this.securityTab.toBeVisible();\n\n return this.securityTab;\n }\n\n async closeModal() {\n await this.closeButton.click();\n await expect(this.container).not.toBeVisible();\n }\n}\n\nclass ProfileSettingsTab {\n readonly container: Locator;\n\n constructor(container: Locator) {\n this.container = container;\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n}\n\nclass SecurityTab {\n readonly container: Locator;\n\n constructor(container: Locator) {\n this.container = container;\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAIc,MAAO,YAAY,CAAA;AACpB,IAAA,SAAS;AAET,IAAA,qBAAqB;AACrB,IAAA,cAAc;AAEd,IAAA,kBAAkB;AAClB,IAAA,WAAW;AAEX,IAAA,WAAW;AACX,IAAA,UAAU;AACV,IAAA,YAAY;AAErB,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;QAE1B,IAAI,CAAC,qBAAqB,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAChE,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,OAAO,CAAC,iBAAiB,CAAC;AAE1D,QAAA,IAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,EAAC,IAAI,EAAE,kBAAkB,EAAC,CAAC,CAAC;AAC7G,QAAA,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAC,CAAC;AAEvF,QAAA,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,yBAAyB,CAAC;QAC9D,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,2BAA2B,CAAC;IACtE;AAEA,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE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","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
|
|
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;IACjG;AAEA,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;IAClD;AAEA,IAAA,MAAM,cAAc,GAAA;QAChB,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE;IAClD;AAEA,IAAA,MAAM,cAAc,GAAA;AAChB,QAAA,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;IACpC;AACH;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Locator } from '@playwright/test';
|
|
2
|
+
export default class ScheduleMessageMenu {
|
|
3
|
+
readonly container: Locator;
|
|
4
|
+
readonly tomorrowMenuItem: Locator;
|
|
5
|
+
readonly mondayMenuItem: Locator;
|
|
6
|
+
readonly nextMondayMenuItem: Locator;
|
|
7
|
+
readonly recentlyUsedCustomTimeMenuItem: Locator;
|
|
8
|
+
readonly customTimeMenuItem: Locator;
|
|
9
|
+
constructor(container: Locator);
|
|
10
|
+
toBeVisible(): Promise<void>;
|
|
11
|
+
selectCustomTime(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 ScheduleMessageMenu {
|
|
8
|
+
container;
|
|
9
|
+
tomorrowMenuItem;
|
|
10
|
+
mondayMenuItem;
|
|
11
|
+
nextMondayMenuItem;
|
|
12
|
+
recentlyUsedCustomTimeMenuItem;
|
|
13
|
+
customTimeMenuItem;
|
|
14
|
+
constructor(container) {
|
|
15
|
+
this.container = container;
|
|
16
|
+
this.tomorrowMenuItem = container.getByTestId('scheduling_time_tomorrow_9_am');
|
|
17
|
+
this.mondayMenuItem = container.getByTestId('scheduling_time_monday_9_am');
|
|
18
|
+
this.nextMondayMenuItem = container.getByTestId('scheduling_time_next_monday_9_am');
|
|
19
|
+
this.recentlyUsedCustomTimeMenuItem = container.getByTestId('recently_used_custom_time');
|
|
20
|
+
this.customTimeMenuItem = container.getByText('Choose a custom time');
|
|
21
|
+
}
|
|
22
|
+
async toBeVisible() {
|
|
23
|
+
await test.expect(this.container).toBeVisible();
|
|
24
|
+
}
|
|
25
|
+
async selectCustomTime() {
|
|
26
|
+
await this.customTimeMenuItem.click();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = ScheduleMessageMenu;
|
|
31
|
+
//# sourceMappingURL=schedule_message_menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule_message_menu.js","sources":["../../../../src/ui/components/channels/schedule_message_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 ScheduleMessageMenu {\n readonly container: Locator;\n\n readonly tomorrowMenuItem;\n readonly mondayMenuItem;\n readonly nextMondayMenuItem;\n readonly recentlyUsedCustomTimeMenuItem;\n readonly customTimeMenuItem;\n\n constructor(container: Locator) {\n this.container = container;\n\n this.tomorrowMenuItem = container.getByTestId('scheduling_time_tomorrow_9_am');\n this.mondayMenuItem = container.getByTestId('scheduling_time_monday_9_am');\n this.nextMondayMenuItem = container.getByTestId('scheduling_time_next_monday_9_am');\n this.recentlyUsedCustomTimeMenuItem = container.getByTestId('recently_used_custom_time');\n this.customTimeMenuItem = 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.customTimeMenuItem.click();\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAIc,MAAO,mBAAmB,CAAA;AAC3B,IAAA,SAAS;AAET,IAAA,gBAAgB;AAChB,IAAA,cAAc;AACd,IAAA,kBAAkB;AAClB,IAAA,8BAA8B;AAC9B,IAAA,kBAAkB;AAE3B,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;QAE1B,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC,WAAW,CAAC,+BAA+B,CAAC;QAC9E,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,WAAW,CAAC,6BAA6B,CAAC;QAC1E,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC,WAAW,CAAC,kCAAkC,CAAC;QACnF,IAAI,CAAC,8BAA8B,GAAG,SAAS,CAAC,WAAW,CAAC,2BAA2B,CAAC;QACxF,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC,SAAS,CAAC,sBAAsB,CAAC;IACzE;AAEA,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;IAC9C;AAEA,IAAA,MAAM,gBAAgB,GAAA;AAClB,QAAA,MAAM,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE;IACzC;AACH;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Locator } from '@playwright/test';
|
|
2
|
+
export default class ScheduleMessageModal {
|
|
3
|
+
readonly container: Locator;
|
|
4
|
+
readonly dateButton: Locator;
|
|
5
|
+
readonly timeButton: Locator;
|
|
6
|
+
readonly timeOptionDropdown: Locator;
|
|
7
|
+
readonly closeButton: Locator;
|
|
8
|
+
readonly scheduleButton: Locator;
|
|
9
|
+
readonly cancelButton: Locator;
|
|
10
|
+
constructor(container: Locator);
|
|
11
|
+
toBeVisible(): Promise<void>;
|
|
12
|
+
getDaySuffix(day: number): string;
|
|
13
|
+
dateLocator(day: number, month: string, dayOfWeek: string): Locator;
|
|
14
|
+
selectDate(dayFromToday?: number): Promise<string>;
|
|
15
|
+
selectTime(optionIndex?: number): Promise<string | null>;
|
|
16
|
+
scheduleMessage(dayFromToday?: number, timeOptionIndex?: number): Promise<{
|
|
17
|
+
selectedDate: string;
|
|
18
|
+
selectedTime: string | null;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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 ScheduleMessageModal {
|
|
8
|
+
container;
|
|
9
|
+
dateButton;
|
|
10
|
+
timeButton;
|
|
11
|
+
timeOptionDropdown;
|
|
12
|
+
closeButton;
|
|
13
|
+
scheduleButton;
|
|
14
|
+
cancelButton;
|
|
15
|
+
constructor(container) {
|
|
16
|
+
this.container = container;
|
|
17
|
+
this.dateButton = container.getByRole('button', { name: /Date/ });
|
|
18
|
+
this.timeButton = container.getByTestId('time_button');
|
|
19
|
+
this.timeOptionDropdown = container.getByLabel('Choose a time');
|
|
20
|
+
this.closeButton = container.getByRole('button', { name: 'Close' });
|
|
21
|
+
this.scheduleButton = container.locator('button:has-text("Schedule")');
|
|
22
|
+
this.cancelButton = container.locator('button:has-text("Cancel")');
|
|
23
|
+
}
|
|
24
|
+
async toBeVisible() {
|
|
25
|
+
await test.expect(this.container).toBeVisible();
|
|
26
|
+
}
|
|
27
|
+
getDaySuffix(day) {
|
|
28
|
+
if (day > 3 && day < 21)
|
|
29
|
+
return 'th';
|
|
30
|
+
switch (day % 10) {
|
|
31
|
+
case 1:
|
|
32
|
+
return 'st';
|
|
33
|
+
case 2:
|
|
34
|
+
return 'nd';
|
|
35
|
+
case 3:
|
|
36
|
+
return 'rd';
|
|
37
|
+
default:
|
|
38
|
+
return 'th';
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
dateLocator(day, month, dayOfWeek) {
|
|
42
|
+
const daySuffix = this.getDaySuffix(day);
|
|
43
|
+
const name = `${day}${daySuffix} ${month} (${dayOfWeek})`;
|
|
44
|
+
return this.container.getByRole('button', { name });
|
|
45
|
+
}
|
|
46
|
+
async selectDate(dayFromToday = 0) {
|
|
47
|
+
await this.dateButton.click();
|
|
48
|
+
const pacificDate = new Date();
|
|
49
|
+
const originDate = new Date();
|
|
50
|
+
if (dayFromToday) {
|
|
51
|
+
pacificDate.setDate(pacificDate.getDate() + dayFromToday);
|
|
52
|
+
}
|
|
53
|
+
const day = pacificDate.getDate();
|
|
54
|
+
const month = pacificDate.toLocaleString('default', { month: 'long' });
|
|
55
|
+
const dayOfWeek = pacificDate.toLocaleDateString('en-US', { weekday: 'long' });
|
|
56
|
+
const dateLocator = this.dateLocator(day, month, dayOfWeek);
|
|
57
|
+
const isMonthChanged = pacificDate.getMonth() !== originDate.getMonth();
|
|
58
|
+
if (!(await dateLocator.isVisible()) && isMonthChanged) {
|
|
59
|
+
await this.container.getByLabel('Go to next month').click();
|
|
60
|
+
}
|
|
61
|
+
await dateLocator.click();
|
|
62
|
+
// if day is single digit then prefix with a 0
|
|
63
|
+
if (day < 10) {
|
|
64
|
+
return `${month} 0${day}`;
|
|
65
|
+
}
|
|
66
|
+
return `${month} ${day}`;
|
|
67
|
+
}
|
|
68
|
+
async selectTime(optionIndex = 0) {
|
|
69
|
+
await this.timeButton.click();
|
|
70
|
+
const timeButton = this.container.page().getByTestId(`time_option_${optionIndex}`);
|
|
71
|
+
await test.expect(timeButton).toBeVisible();
|
|
72
|
+
await timeButton.click();
|
|
73
|
+
return await timeButton.textContent();
|
|
74
|
+
}
|
|
75
|
+
async scheduleMessage(dayFromToday = 0, timeOptionIndex = 0) {
|
|
76
|
+
await this.toBeVisible();
|
|
77
|
+
const selectedDate = await this.selectDate(dayFromToday);
|
|
78
|
+
const fromDateButton = await this.dateButton.textContent();
|
|
79
|
+
const selectedTime = await this.selectTime(timeOptionIndex);
|
|
80
|
+
await this.scheduleButton.click();
|
|
81
|
+
// if selectedDate is Today or Tomorrow then return Today or Tomorrow
|
|
82
|
+
if (fromDateButton === 'Today' || fromDateButton === 'Tomorrow') {
|
|
83
|
+
return { selectedDate: fromDateButton, selectedTime };
|
|
84
|
+
}
|
|
85
|
+
// if selectedDate is a date in the future then return the date
|
|
86
|
+
return { selectedDate, selectedTime };
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
module.exports = ScheduleMessageModal;
|
|
91
|
+
//# sourceMappingURL=schedule_message_modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule_message_modal.js","sources":["../../../../src/ui/components/channels/schedule_message_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 ScheduleMessageModal {\n readonly container: Locator;\n readonly dateButton: Locator;\n readonly timeButton: Locator;\n readonly timeOptionDropdown: Locator;\n readonly closeButton: Locator;\n readonly scheduleButton: Locator;\n readonly cancelButton: Locator;\n\n constructor(container: Locator) {\n this.container = container;\n this.dateButton = container.getByRole('button', {name: /Date/});\n this.timeButton = container.getByTestId('time_button');\n this.timeOptionDropdown = container.getByLabel('Choose a time');\n this.closeButton = container.getByRole('button', {name: 'Close'});\n this.scheduleButton = container.locator('button:has-text(\"Schedule\")');\n this.cancelButton = container.locator('button:has-text(\"Cancel\")');\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\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 const name = `${day}${daySuffix} ${month} (${dayOfWeek})`;\n return this.container.getByRole('button', {name});\n }\n\n async selectDate(dayFromToday: number = 0) {\n await this.dateButton.click();\n\n const pacificDate = new Date();\n const originDate = new Date();\n\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 dateLocator = this.dateLocator(day, month, dayOfWeek);\n\n const isMonthChanged = pacificDate.getMonth() !== originDate.getMonth();\n if (!(await dateLocator.isVisible()) && isMonthChanged) {\n await this.container.getByLabel('Go to next month').click();\n }\n\n await dateLocator.click();\n\n // if day is single digit then prefix with a 0\n if (day < 10) {\n return `${month} 0${day}`;\n }\n\n return `${month} ${day}`;\n }\n\n async selectTime(optionIndex: number = 0) {\n await this.timeButton.click();\n const timeButton = this.container.page().getByTestId(`time_option_${optionIndex}`);\n await expect(timeButton).toBeVisible();\n await timeButton.click();\n\n return await timeButton.textContent();\n }\n\n async scheduleMessage(dayFromToday: number = 0, timeOptionIndex: number = 0) {\n await this.toBeVisible();\n\n const selectedDate = await this.selectDate(dayFromToday);\n const fromDateButton = await this.dateButton.textContent();\n\n const selectedTime = await this.selectTime(timeOptionIndex);\n await this.scheduleButton.click();\n\n // if selectedDate is Today or Tomorrow then return Today or Tomorrow\n if (fromDateButton === 'Today' || fromDateButton === 'Tomorrow') {\n return {selectedDate: fromDateButton, selectedTime};\n }\n\n // if selectedDate is a date in the future then return the date\n return {selectedDate, selectedTime};\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAIc,MAAO,oBAAoB,CAAA;AAC5B,IAAA,SAAS;AACT,IAAA,UAAU;AACV,IAAA,UAAU;AACV,IAAA,kBAAkB;AAClB,IAAA,WAAW;AACX,IAAA,cAAc;AACd,IAAA,YAAY;AAErB,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;AAC1B,QAAA,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;QAC/D,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC;QACtD,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC,UAAU,CAAC,eAAe,CAAC;AAC/D,QAAA,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;QACjE,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC,OAAO,CAAC,6BAA6B,CAAC;QACtE,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,2BAA2B,CAAC;IACtE;AAEA,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;IAC9C;AAEA,IAAA,YAAY,CAAC,GAAW,EAAA;AACpB,QAAA,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,EAAE;AAAE,YAAA,OAAO,IAAI;AAEpC,QAAA,QAAQ,GAAG,GAA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,OAAO,IAAI,cAAc,KAAK,UAAU,EAAE;AAC7D,YAAA,OAAO,EAAC,YAAY,EAAE,cAAc,EAAE,YAAY,EAAC;QACvD;;AAGA,QAAA,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC;IACvC;AACH;;;;"}
|
|
@@ -1 +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":";;;;AAAA;AACA;AAIc,MAAO,mBAAmB,CAAA;AAC3B,IAAA,SAAS;AAET,IAAA,aAAa;AACb,IAAA,SAAS;AACT,IAAA,WAAW;AACX,IAAA,mBAAmB;AAE5B,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;QAE1B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACxD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,mBAAmB,CAAC;QACvD,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,qBAAqB,CAAC;QAC3D,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC,OAAO,CAAC,4BAA4B,CAAC
|
|
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":";;;;AAAA;AACA;AAIc,MAAO,mBAAmB,CAAA;AAC3B,IAAA,SAAS;AAET,IAAA,aAAa;AACb,IAAA,SAAS;AACT,IAAA,WAAW;AACX,IAAA,mBAAmB;AAE5B,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;QAE1B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACxD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,mBAAmB,CAAC;QACvD,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,qBAAqB,CAAC;QAC3D,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC,OAAO,CAAC,4BAA4B,CAAC;IAC9E;AAEA,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;IAC9C;AAEA,IAAA,YAAY,CAAC,GAAW,EAAA;AACpB,QAAA,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,EAAE;AAAE,YAAA,OAAO,IAAI;AACpC,QAAA,QAAQ,GAAG,GAAG,EAAE;AACZ,YAAA,KAAK,CAAC;AACF,gBAAA,OAAO,IAAI;AACf,YAAA,KAAK,CAAC;AACF,gBAAA,OAAO,IAAI;AACf,YAAA,KAAK,CAAC;AACF,gBAAA,OAAO,IAAI;AACf,YAAA;AACI,gBAAA,OAAO,IAAI;;IAEvB;AAEA,IAAA,WAAW,CAAC,GAAW,EAAE,KAAa,EAAE,SAAiB,EAAA;QACrD,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC;AACxC,QAAA,OAAO,IAAI,CAAC,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;AAEA;;;AAGG;AACH,IAAA,MAAM,UAAU,GAAA;AACZ,QAAA,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE;QAC9B,MAAM,UAAU,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC;AAClD,QAAA,MAAMA,WAAM,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE;AACtC,QAAA,MAAM,UAAU,CAAC,KAAK,EAAE;IAC5B;IAEA,cAAc,GAAA;AACV,QAAA,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE;;AAE9B,QAAA,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,iBAAiB,EAAE,GAAG,KAAK;QAC/E,MAAM,aAAa,GAAG,EAAE,GAAG,EAAE,CAAC;QAC9B,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,OAAO,GAAG,aAAa,GAAG,KAAK,CAAC;AAE7D,QAAA,OAAO,WAAW;IACtB;AACH;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Locator } from '@playwright/test';
|
|
2
|
+
export default class ScheduledPost {
|
|
3
|
+
readonly container: Locator;
|
|
4
|
+
readonly panelHeader: Locator;
|
|
5
|
+
readonly panelBody: Locator;
|
|
6
|
+
readonly postBody: Locator;
|
|
7
|
+
readonly postHeader: Locator;
|
|
8
|
+
readonly postImage: Locator;
|
|
9
|
+
readonly deleteButton: Locator;
|
|
10
|
+
readonly editButton: Locator;
|
|
11
|
+
readonly copyTextButton: Locator;
|
|
12
|
+
readonly rescheduleButton: Locator;
|
|
13
|
+
readonly sendNowButton: Locator;
|
|
14
|
+
readonly editTextBox: Locator;
|
|
15
|
+
readonly saveButton: Locator;
|
|
16
|
+
readonly cancelButton: Locator;
|
|
17
|
+
constructor(container: Locator);
|
|
18
|
+
toBeVisible(): Promise<void>;
|
|
19
|
+
hover(): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 ScheduledPost {
|
|
8
|
+
container;
|
|
9
|
+
panelHeader;
|
|
10
|
+
panelBody;
|
|
11
|
+
postBody;
|
|
12
|
+
postHeader;
|
|
13
|
+
postImage;
|
|
14
|
+
deleteButton;
|
|
15
|
+
editButton;
|
|
16
|
+
copyTextButton;
|
|
17
|
+
rescheduleButton;
|
|
18
|
+
sendNowButton;
|
|
19
|
+
editTextBox;
|
|
20
|
+
saveButton;
|
|
21
|
+
cancelButton;
|
|
22
|
+
constructor(container) {
|
|
23
|
+
this.container = container;
|
|
24
|
+
this.panelHeader = container.locator('.PanelHeader');
|
|
25
|
+
this.panelBody = container.locator('.DraftPanelBody');
|
|
26
|
+
this.postBody = container.locator('.post__body');
|
|
27
|
+
this.postHeader = container.locator('.post__header');
|
|
28
|
+
this.postImage = container.locator('.post__img');
|
|
29
|
+
this.deleteButton = container.locator('#draft_icon-trash-can-outline_delete');
|
|
30
|
+
this.editButton = container.locator('#draft_icon-pencil-outline_edit');
|
|
31
|
+
this.copyTextButton = container.locator('#draft_icon-content-copy_copy_text');
|
|
32
|
+
this.rescheduleButton = container.locator('#draft_icon-clock-send-outline_reschedule');
|
|
33
|
+
this.sendNowButton = container.locator('#draft_icon-send-outline_sendNow');
|
|
34
|
+
this.editTextBox = container.getByTestId('edit_textbox');
|
|
35
|
+
this.saveButton = container.locator('button:has-text("Save")');
|
|
36
|
+
this.cancelButton = container.locator('button:has-text("Cancel")');
|
|
37
|
+
}
|
|
38
|
+
async toBeVisible() {
|
|
39
|
+
await test.expect(this.container).toBeVisible();
|
|
40
|
+
}
|
|
41
|
+
async hover() {
|
|
42
|
+
await this.container.hover();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = ScheduledPost;
|
|
47
|
+
//# sourceMappingURL=scheduled_post.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduled_post.js","sources":["../../../../src/ui/components/channels/scheduled_post.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 ScheduledPost {\n readonly container: Locator;\n\n readonly panelHeader;\n readonly panelBody;\n\n readonly postBody;\n readonly postHeader;\n readonly postImage;\n\n readonly deleteButton;\n readonly editButton;\n readonly copyTextButton;\n readonly rescheduleButton;\n readonly sendNowButton;\n\n readonly editTextBox;\n readonly saveButton;\n readonly cancelButton;\n\n constructor(container: Locator) {\n this.container = container;\n\n this.panelHeader = container.locator('.PanelHeader');\n this.panelBody = container.locator('.DraftPanelBody');\n\n this.postBody = container.locator('.post__body');\n this.postHeader = container.locator('.post__header');\n this.postImage = container.locator('.post__img');\n\n this.deleteButton = container.locator('#draft_icon-trash-can-outline_delete');\n this.editButton = container.locator('#draft_icon-pencil-outline_edit');\n this.copyTextButton = container.locator('#draft_icon-content-copy_copy_text');\n this.rescheduleButton = container.locator('#draft_icon-clock-send-outline_reschedule');\n this.sendNowButton = container.locator('#draft_icon-send-outline_sendNow');\n\n this.editTextBox = container.getByTestId('edit_textbox');\n this.saveButton = container.locator('button:has-text(\"Save\")');\n this.cancelButton = container.locator('button:has-text(\"Cancel\")');\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n\n async hover() {\n await this.container.hover();\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAIc,MAAO,aAAa,CAAA;AACrB,IAAA,SAAS;AAET,IAAA,WAAW;AACX,IAAA,SAAS;AAET,IAAA,QAAQ;AACR,IAAA,UAAU;AACV,IAAA,SAAS;AAET,IAAA,YAAY;AACZ,IAAA,UAAU;AACV,IAAA,cAAc;AACd,IAAA,gBAAgB;AAChB,IAAA,aAAa;AA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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Locator } from '@playwright/test';
|
|
2
|
+
export default class ScheduledPostIndicator {
|
|
3
|
+
readonly container: Locator;
|
|
4
|
+
readonly icon: Locator;
|
|
5
|
+
readonly messageText: Locator;
|
|
6
|
+
readonly seeAllLink: Locator;
|
|
7
|
+
readonly scheduledMessageLink: Locator;
|
|
8
|
+
constructor(container: Locator);
|
|
9
|
+
toBeVisible(): Promise<void>;
|
|
10
|
+
toBeNotVisible(): Promise<void>;
|
|
11
|
+
getText(): Promise<string>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 ScheduledPostIndicator {
|
|
8
|
+
container;
|
|
9
|
+
icon;
|
|
10
|
+
messageText;
|
|
11
|
+
seeAllLink;
|
|
12
|
+
scheduledMessageLink;
|
|
13
|
+
constructor(container) {
|
|
14
|
+
this.container = container;
|
|
15
|
+
this.icon = container.getByTestId('scheduledPostIcon');
|
|
16
|
+
this.messageText = container.locator('span').first();
|
|
17
|
+
this.seeAllLink = container.locator('a:has-text("See all")');
|
|
18
|
+
this.scheduledMessageLink = container.locator('a:has-text("scheduled message")');
|
|
19
|
+
}
|
|
20
|
+
async toBeVisible() {
|
|
21
|
+
await test.expect(this.container).toBeVisible();
|
|
22
|
+
}
|
|
23
|
+
async toBeNotVisible() {
|
|
24
|
+
await test.expect(this.container).not.toBeVisible();
|
|
25
|
+
}
|
|
26
|
+
async getText() {
|
|
27
|
+
return await this.messageText.innerText();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = ScheduledPostIndicator;
|
|
32
|
+
//# sourceMappingURL=scheduled_post_indicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduled_post_indicator.js","sources":["../../../../src/ui/components/channels/scheduled_post_indicator.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 ScheduledPostIndicator {\n readonly container: Locator;\n\n readonly icon;\n readonly messageText;\n readonly seeAllLink;\n readonly scheduledMessageLink;\n\n constructor(container: Locator) {\n this.container = container;\n\n this.icon = container.getByTestId('scheduledPostIcon');\n this.messageText = container.locator('span').first();\n this.seeAllLink = container.locator('a:has-text(\"See all\")');\n this.scheduledMessageLink = container.locator('a:has-text(\"scheduled message\")');\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n\n async toBeNotVisible() {\n await expect(this.container).not.toBeVisible();\n }\n\n async getText() {\n return await this.messageText.innerText();\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAIc,MAAO,sBAAsB,CAAA;AAC9B,IAAA,SAAS;AAET,IAAA,IAAI;AACJ,IAAA,WAAW;AACX,IAAA,UAAU;AACV,IAAA,oBAAoB;AAE7B,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;QAE1B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,WAAW,CAAC,mBAAmB,CAAC;AACtD,QAAA,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE;QACpD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,uBAAuB,CAAC;QAC5D,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC,OAAO,CAAC,iCAAiC,CAAC;IACpF;AAEA,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;IAC9C;AAEA,IAAA,MAAM,cAAc,GAAA;QAChB,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE;IAClD;AAEA,IAAA,MAAM,OAAO,GAAA;AACT,QAAA,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE;IAC7C;AACH;;;;"}
|
|
@@ -4,7 +4,7 @@ var test = require('@playwright/test');
|
|
|
4
4
|
|
|
5
5
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
6
6
|
// See LICENSE.txt for license information.
|
|
7
|
-
class
|
|
7
|
+
class SearchBox {
|
|
8
8
|
container;
|
|
9
9
|
messagesButton;
|
|
10
10
|
filesButton;
|
|
@@ -27,6 +27,7 @@ class SearchPopover {
|
|
|
27
27
|
async clearIfPossible() {
|
|
28
28
|
if (await this.clearButton.isVisible()) {
|
|
29
29
|
await this.clearButton.click();
|
|
30
|
+
await test.expect(this.searchInput).toHaveValue('');
|
|
30
31
|
return true;
|
|
31
32
|
}
|
|
32
33
|
return false;
|
|
@@ -39,5 +40,5 @@ class SearchPopover {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
module.exports =
|
|
43
|
-
//# sourceMappingURL=
|
|
43
|
+
module.exports = SearchBox;
|
|
44
|
+
//# sourceMappingURL=search_box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search_box.js","sources":["../../../../src/ui/components/channels/search_box.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 SearchBox {\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 await expect(this.searchInput).toHaveValue('');\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,SAAS,CAAA;AACjB,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;IAC1D;;AAGA,IAAA,MAAM,eAAe,GAAA;QACjB,IAAI,MAAM,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE;AACpC,YAAA,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE;YAC9B,MAAMA,WAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;AAC9C,YAAA,OAAO,IAAI;QACf;AACA,QAAA,OAAO,KAAK;IAChB;AAEA,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;IAC9C;IAEA,qBAAqB,GAAA;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,uBAAuB,CAAC;IAC5D;AACH;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Locator } from '@playwright/test';
|
|
2
|
+
export default class SendMessageNowModal {
|
|
3
|
+
readonly container: Locator;
|
|
4
|
+
readonly body: Locator;
|
|
5
|
+
readonly sendNowButton: Locator;
|
|
6
|
+
readonly cancelButton: Locator;
|
|
7
|
+
readonly closeButton: Locator;
|
|
8
|
+
constructor(container: Locator);
|
|
9
|
+
toBeVisible(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
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 SendMessageNowModal {
|
|
8
|
+
container;
|
|
9
|
+
body;
|
|
10
|
+
sendNowButton;
|
|
11
|
+
cancelButton;
|
|
12
|
+
closeButton;
|
|
13
|
+
constructor(container) {
|
|
14
|
+
this.container = container;
|
|
15
|
+
this.body = container.locator('.modal-body');
|
|
16
|
+
this.sendNowButton = container.locator('button:has-text("Yes, send now")');
|
|
17
|
+
this.cancelButton = container.locator('button:has-text("Cancel")');
|
|
18
|
+
this.closeButton = container.getByRole('button', { name: 'Close' });
|
|
19
|
+
}
|
|
20
|
+
async toBeVisible() {
|
|
21
|
+
await test.expect(this.container).toBeVisible();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
module.exports = SendMessageNowModal;
|
|
26
|
+
//# sourceMappingURL=send_message_now_modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send_message_now_modal.js","sources":["../../../../src/ui/components/channels/send_message_now_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 SendMessageNowModal {\n readonly container: Locator;\n readonly body: Locator;\n readonly sendNowButton: Locator;\n readonly cancelButton: Locator;\n readonly closeButton: Locator;\n\n constructor(container: Locator) {\n this.container = container;\n\n this.body = container.locator('.modal-body');\n this.sendNowButton = container.locator('button:has-text(\"Yes, send now\")');\n this.cancelButton = container.locator('button:has-text(\"Cancel\")');\n this.closeButton = container.getByRole('button', {name: 'Close'});\n }\n\n async toBeVisible() {\n await expect(this.container).toBeVisible();\n }\n}\n"],"names":["expect"],"mappings":";;;;AAAA;AACA;AAIc,MAAO,mBAAmB,CAAA;AAC3B,IAAA,SAAS;AACT,IAAA,IAAI;AACJ,IAAA,aAAa;AACb,IAAA,YAAY;AACZ,IAAA,WAAW;AAEpB,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;QAE1B,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC;QAC5C,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC,kCAAkC,CAAC;QAC1E,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,2BAA2B,CAAC;AAClE,QAAA,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;IACrE;AAEA,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;IAC9C;AACH;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Locator } from '@playwright/test';
|
|
2
|
+
export default class AdvancedSettings {
|
|
3
|
+
readonly container: Locator;
|
|
4
|
+
readonly title: Locator;
|
|
5
|
+
id: string;
|
|
6
|
+
readonly expandedSection: Locator;
|
|
7
|
+
expandedSectionId: string;
|
|
8
|
+
readonly ctrlEnterEditButton: Locator;
|
|
9
|
+
readonly postFormattingEditButton: Locator;
|
|
10
|
+
readonly joinLeaveEditButton: Locator;
|
|
11
|
+
readonly scrollPositionEditButton: Locator;
|
|
12
|
+
readonly syncDraftsEditButton: Locator;
|
|
13
|
+
constructor(container: Locator);
|
|
14
|
+
toBeVisible(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 AdvancedSettings {
|
|
8
|
+
container;
|
|
9
|
+
title;
|
|
10
|
+
id = '#advancedSettings';
|
|
11
|
+
expandedSection;
|
|
12
|
+
expandedSectionId = '.section-max';
|
|
13
|
+
ctrlEnterEditButton;
|
|
14
|
+
postFormattingEditButton;
|
|
15
|
+
joinLeaveEditButton;
|
|
16
|
+
scrollPositionEditButton;
|
|
17
|
+
syncDraftsEditButton;
|
|
18
|
+
constructor(container) {
|
|
19
|
+
this.container = container;
|
|
20
|
+
this.title = container.getByRole('heading', { name: 'Advanced Settings', exact: true });
|
|
21
|
+
this.expandedSection = container.locator(this.expandedSectionId);
|
|
22
|
+
// Edit buttons for each setting section
|
|
23
|
+
this.ctrlEnterEditButton = container.locator('#advancedCtrlSendEdit');
|
|
24
|
+
this.postFormattingEditButton = container.locator('#formattingEdit');
|
|
25
|
+
this.joinLeaveEditButton = container.locator('#joinLeaveEdit');
|
|
26
|
+
this.scrollPositionEditButton = container.locator('#unread_scroll_positionEdit');
|
|
27
|
+
this.syncDraftsEditButton = container.locator('#syncDraftsEdit');
|
|
28
|
+
}
|
|
29
|
+
async toBeVisible() {
|
|
30
|
+
await test.expect(this.container).toBeVisible();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
module.exports = AdvancedSettings;
|
|
35
|
+
//# sourceMappingURL=advanced_settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"advanced_settings.js","sources":["../../../../../src/ui/components/channels/settings/advanced_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\nexport default class AdvancedSettings {\n readonly container: Locator;\n\n readonly title;\n public id = '#advancedSettings';\n readonly expandedSection;\n public expandedSectionId = '.section-max';\n\n readonly ctrlEnterEditButton;\n readonly postFormattingEditButton;\n readonly joinLeaveEditButton;\n readonly scrollPositionEditButton;\n readonly syncDraftsEditButton;\n\n constructor(container: Locator) {\n this.container = container;\n\n this.title = container.getByRole('heading', {name: 'Advanced Settings', exact: true});\n this.expandedSection = container.locator(this.expandedSectionId);\n\n // Edit buttons for each setting section\n this.ctrlEnterEditButton = container.locator('#advancedCtrlSendEdit');\n this.postFormattingEditButton = container.locator('#formattingEdit');\n this.joinLeaveEditButton = container.locator('#joinLeaveEdit');\n this.scrollPositionEditButton = container.locator('#unread_scroll_positionEdit');\n this.syncDraftsEditButton = container.locator('#syncDraftsEdit');\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,KAAK;IACP,EAAE,GAAG,mBAAmB;AACtB,IAAA,eAAe;IACjB,iBAAiB,GAAG,cAAc;AAEhC,IAAA,mBAAmB;AACnB,IAAA,wBAAwB;AACxB,IAAA,mBAAmB;AACnB,IAAA,wBAAwB;AACxB,IAAA,oBAAoB;AAE7B,IAAA,WAAA,CAAY,SAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,SAAS,GAAG,SAAS;AAE1B,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,SAAS,EAAE,EAAC,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC;QACrF,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC;;QAGhE,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC,OAAO,CAAC,uBAAuB,CAAC;QACrE,IAAI,CAAC,wBAAwB,GAAG,SAAS,CAAC,OAAO,CAAC,iBAAiB,CAAC;QACpE,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAC9D,IAAI,CAAC,wBAAwB,GAAG,SAAS,CAAC,OAAO,CAAC,6BAA6B,CAAC;QAChF,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC,OAAO,CAAC,iBAAiB,CAAC;IACpE;AAEA,IAAA,MAAM,WAAW,GAAA;QACb,MAAMA,WAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;IAC9C;AACH;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Locator } from '@playwright/test';
|
|
2
|
+
export type DisplaySettingsSection = 'theme' | 'clockDisplay' | 'teammateNameDisplay' | 'availabilityStatusOnPosts' | 'lastActiveTime' | 'timezone' | 'showLinkPreviews' | 'collapseImagePreviews' | 'messageDisplay' | 'clickToReply' | 'channelDisplayMode' | 'oneClickReactions' | 'emojiPicker' | 'language';
|
|
3
|
+
export default class DisplaySettings {
|
|
4
|
+
readonly container: Locator;
|
|
5
|
+
readonly title: Locator;
|
|
6
|
+
id: string;
|
|
7
|
+
readonly expandedSection: Locator;
|
|
8
|
+
expandedSectionId: string;
|
|
9
|
+
readonly themeEditButton: Locator;
|
|
10
|
+
readonly clockDisplayEditButton: Locator;
|
|
11
|
+
readonly teammateNameDisplayEditButton: Locator;
|
|
12
|
+
readonly availabilityStatusOnPostsEditButton: Locator;
|
|
13
|
+
readonly lastActiveTimeEditButton: Locator;
|
|
14
|
+
readonly timezoneEditButton: Locator;
|
|
15
|
+
readonly showLinkPreviewsEditButton: Locator;
|
|
16
|
+
readonly collapseImagePreviewsEditButton: Locator;
|
|
17
|
+
readonly messageDisplayEditButton: Locator;
|
|
18
|
+
readonly clickToReplyEditButton: Locator;
|
|
19
|
+
readonly channelDisplayModeEditButton: Locator;
|
|
20
|
+
readonly oneClickReactionsEditButton: Locator;
|
|
21
|
+
readonly emojiPickerEditButton: Locator;
|
|
22
|
+
readonly languageEditButton: Locator;
|
|
23
|
+
constructor(container: Locator);
|
|
24
|
+
toBeVisible(): Promise<void>;
|
|
25
|
+
expandSection(section: DisplaySettingsSection): Promise<void>;
|
|
26
|
+
verifySectionIsExpanded(section: DisplaySettingsSection): Promise<void>;
|
|
27
|
+
}
|