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