Search in sources :

Example 26 with MiniEditorComponentObject

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");
}
Also used : MiniEditorComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject) ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) VetOptionsComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetOptionsComponentObject) VetAddVideoComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetAddVideoComponentObject) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 27 with MiniEditorComponentObject

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);
}
Also used : MiniEditorComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject) JavascriptExecutor(org.openqa.selenium.JavascriptExecutor) Actions(org.openqa.selenium.interactions.Actions) WebElement(org.openqa.selenium.WebElement)

Example 28 with MiniEditorComponentObject

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);
}
Also used : MiniEditorComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject) WebElement(org.openqa.selenium.WebElement)

Example 29 with MiniEditorComponentObject

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);
}
Also used : MiniEditorComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject) ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) Test(org.testng.annotations.Test)

Example 30 with MiniEditorComponentObject

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);
}
Also used : MiniEditorComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject) ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) DeletePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject) Notification(com.wikia.webdriver.elements.oasis.components.notifications.Notification) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

MiniEditorComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject)34 Test (org.testng.annotations.Test)32 MessageWall (com.wikia.webdriver.pageobjectsfactory.pageobject.messagewall.MessageWall)22 Execute (com.wikia.webdriver.common.core.annotations.Execute)19 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)13 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)6 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)6 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)5 VetAddVideoComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetAddVideoComponentObject)4 UserProfilePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.UserProfilePageObject)4 BlogPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject)4 VetOptionsComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetOptionsComponentObject)3 Notification (com.wikia.webdriver.elements.oasis.components.notifications.Notification)2 DeletePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject)2 MessageWallCloseRemoveThreadPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.messagewall.MessageWallCloseRemoveThreadPageObject)2 MessageWallThreadPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.messagewall.MessageWallThreadPageObject)2 WebElement (org.openqa.selenium.WebElement)2 YoutubeVideo (com.wikia.webdriver.common.core.video.YoutubeVideo)1 MiniEditorPreviewComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorPreviewComponentObject)1 SpecialWikiActivityPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialWikiActivityPageObject)1