mattermost-mobile/detox/e2e/support/ui/component/post.js
Joseph Baylon 7aebfd0b13
MM-30286 Detox/E2E: Add e2e test for MM-T3249 and added useful helpers (#4990)
* MM-30286 Detox/E2E: Add e2e test for MM-T3249 and added useful helper functions

* Update app/components/sidebars/main/channels_list/channels_list.js

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Add team icon content helper query

* Fixed reset for teams

* MM-30286 Detox/E2E: Add e2e test for MM-T3235 (#5003)

* MM-30286 Detox/E2E: Add e2e test for MM-T3255 (#5006)

* Fix merge issues

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2020-12-15 17:24:45 -08:00

30 lines
1.1 KiB
JavaScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
class Post {
testID = {
postHeaderReply: 'post_header.reply',
markdownText: 'markdown_text',
}
getPost = (postItemSourceTestID, postId, postMessage) => {
const postTestID = `${postItemSourceTestID}.${postId}`;
const baseMatcher = by.id(postTestID);
const postItemMatcher = postMessage ? baseMatcher.withDescendant(by.text(postMessage)) : baseMatcher;
const postItemHeaderReplyMatcher = by.id(this.testID.postHeaderReply).withAncestor(postItemMatcher);
const postItemMessageMatcher = by.id(this.testID.markdownText).withAncestor(postItemMatcher);
return {
postItem: element(postItemMatcher),
postItemHeaderReply: element(postItemHeaderReplyMatcher),
postItemMessage: element(postItemMessageMatcher),
};
}
getPostMessage = (postItemSourceTestID) => {
return element(by.id(this.testID.markdownText).withAncestor(by.id(postItemSourceTestID)));
}
}
const post = new Post();
export default post;