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