use of com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject in project selenium-tests by Wikia.
the class VetArticleCommentsTests method RegularUserCanAddVideoInArticleCommentEditorByFindingWikiaVideo.
@Test(groups = { "VetArticleComments_002" })
@Execute(asUser = User.USER)
public void RegularUserCanAddVideoInArticleCommentEditorByFindingWikiaVideo() {
new ArticleContent().clear();
ArticlePageObject article = new ArticlePageObject().open();
MiniEditorComponentObject editor = article.triggerCommentArea();
VetAddVideoComponentObject vetAddingVideo = editor.clickAddVideo();
VetOptionsComponentObject vetOptions = vetAddingVideo.addVideoByQuery(VideoContent.WIKIA_VIDEO_QUERY, 0);
vetOptions.setCaption(PageContent.CAPTION);
String desiredVideoName = vetOptions.getVideoName();
vetOptions.submit();
Assertion.assertTrue(article.getArticleComment().isVideoVisible(), "Video is not visible");
article.submitComment();
Assertion.assertTrue(article.isVideoCommentPresent(desiredVideoName), "Video comment doesn't have desired name");
}
use of com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject in project selenium-tests by Wikia.
the class ArticlePageObject method triggerEditCommentArea.
public MiniEditorComponentObject triggerEditCommentArea() {
jsActions.scrollToElement(allCommentsArea);
WebElement mostRecentComment = articleComments.get(0);
PageObjectLogging.log("First check", mostRecentComment.getText(), true);
JavascriptExecutor js = (JavascriptExecutor) driver;
WebElement editButton = mostRecentComment.findElement(By.cssSelector(EDIT_BUTTON_SELECTOR));
new Actions(driver).moveToElement(editButton).perform();
js.executeScript("arguments[0].querySelector(arguments[1]).click()", mostRecentComment, EDIT_BUTTON_SELECTOR);
return new MiniEditorComponentObject(driver);
}
use of com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject in project selenium-tests by Wikia.
the class ArticlePageObject method triggerCommentReply.
public MiniEditorComponentObject triggerCommentReply() {
WebElement mostRecentComment = articleComments.get(0);
WebElement replyButton = mostRecentComment.findElement(By.cssSelector(REPLY_COMMENT_SELECTOR));
scrollAndClick(replyButton);
waitForElementNotVisibleByElement(replyCommentLoadingIndicator);
return new MiniEditorComponentObject(driver);
}
use of com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject in project selenium-tests by Wikia.
the class ArticleCommentsTests method ArticleComments_003_anonReplyComment.
@Test(groups = "ArticleComments_003")
public void ArticleComments_003_anonReplyComment() {
new ArticleContent().push(PageContent.ARTICLE_TEXT);
ArticlePageObject article = new ArticlePageObject().open();
String comment = PageContent.COMMENT_TEXT + article.getTimeStamp();
MiniEditorComponentObject editor = article.triggerCommentArea();
editor.switchAndWrite(comment);
article.submitComment();
article.verifyCommentText(comment);
article.verifyCommentCreator(PageContent.WIKIA_CONTRIBUTOR);
article.triggerCommentReply();
String commentReply = PageContent.REPLY_TEXT + article.getTimeStamp();
editor.switchAndReplyComment(commentReply);
article.submitReplyComment();
article.verifyCommentReply(commentReply);
article.verifyReplyCreator(PageContent.WIKIA_CONTRIBUTOR);
}
use of com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject in project selenium-tests by Wikia.
the class ArticleCommentsTests method ArticleComments_004_deleteComment.
@Test(groups = "ArticleComments_004")
@Execute(asUser = User.STAFF)
public void ArticleComments_004_deleteComment() {
new ArticleContent().push(PageContent.ARTICLE_TEXT);
ArticlePageObject article = new ArticlePageObject().open();
String comment = PageContent.COMMENT_TEXT + article.getTimeStamp();
MiniEditorComponentObject editor = article.triggerCommentArea();
editor.switchAndWrite(comment);
article.submitComment();
article.verifyCommentText(comment);
article.verifyCommentCreator(credentials.userNameStaff);
String commentText = article.getFirstCommentText();
DeletePageObject delete = article.deleteFirstComment();
delete.submitDeletion();
List<Notification> confirmNotifications = article.getNotifications(NotificationType.CONFIRM);
Assertion.assertEquals(confirmNotifications.size(), 1, DeletePageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
Assertion.assertTrue(confirmNotifications.stream().findFirst().get().isVisible());
article.verifyCommentDeleted(commentText);
}
Aggregations