forked from mattermost/mattermost-webapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
centerPage.js
48 lines (45 loc) · 1.52 KB
/
centerPage.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {Constants} from '../utils';
const centerCommands = {
navigateToPage() {
return this.waitForElementVisible('@postTextBox', Constants.DEFAULT_WAIT);
},
postAMessage(message) {
return this
.waitForElementVisible('@postTextBox', Constants.DEFAULT_WAIT)
.setValue('@postTextBox', message)
.keys(this.Keys.ENTER)
.waitForElementVisible('@postListContent', Constants.DEFAULT_WAIT);
}
};
module.exports = {
url: `${Constants.TEST_BASE_URL}`,
commands: [centerCommands],
elements: {
postTextBox: {
selector: '//*[@id="post_textbox"]',
locateStrategy: 'xpath'
},
fileAttachmentButton: {
selector: '//*[@id="create_post"]/div/div[1]/div/span/span[1]/div',
locateStrategy: 'xpath'
},
emojiPickerButton: {
selector: '//*[@id="create_post"]/div/div[1]/div/span/span[2]/span',
locateStrategy: 'xpath'
},
helpLink: {
selector: '//*[@id="create_post"]/div/div[1]/div/div/div[3]/a',
locateStrategy: 'xpath'
},
helpText: {
selector: '//*[@id="create_post"]/div/div[1]/div/div/div[3]/div',
locateStrategy: 'xpath'
},
postListContent: {
selector: '//*[@id="post-list"]/div[2]/div/div',
locateStrategy: 'xpath'
}
}
};