Search in sources :

Example 1 with BlogPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject in project selenium-tests by Wikia.

the class UserProfilePageObject method openFirstPost.

public BlogPageObject openFirstPost() {
    for (int i = 0; i < blogPostList.size(); i++) {
        BlogPageObject blogPage = openBlogPage(i);
        String pageContent = blogPage.getAtricleTextRaw().toLowerCase();
        if (!(pageContent.contains("deleted") || pageContent.contains("redirected"))) {
            PageObjectLogging.log("openFirstPost", "valid post found on " + i + " position", true);
            break;
        }
        PageObjectLogging.log("openFirstPost", "deleted post found on " + i + " position, trying next one", true);
        driver.navigate().back();
    }
    return new BlogPageObject(driver);
}
Also used : BlogPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject)

Example 2 with BlogPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject in project selenium-tests by Wikia.

the class WikiActivityTests method WikiActivityTests_003_newBlogCreationIsRecordedOnActivityModule.

/**
   * https://wikia-inc.atlassian.net/browse/DAR-1617
   */
@Test(groups = "WikiActivity_003")
@Execute(asUser = User.USER)
public void WikiActivityTests_003_newBlogCreationIsRecordedOnActivityModule() {
    String blogTitle = PageContent.BLOG_POST_NAME_PREFIX + DateTime.now().getMillis();
    String blogContent = PageContent.BLOG_CONTENT + DateTime.now().getMillis();
    UserProfilePageObject userProfile = new WikiBasePageObject().openProfilePage(credentials.userName, wikiURL);
    userProfile.clickOnBlogTab();
    SpecialCreatePage createBlogPage = userProfile.clickOnCreateBlogPost();
    VisualEditModePageObject visualEditMode = createBlogPage.populateTitleField(blogTitle);
    visualEditMode.addContent(blogContent);
    BlogPageObject blogPage = visualEditMode.submitBlog();
    blogPage.verifyBlogTitle(blogTitle);
    blogPage.verifyContent(blogContent);
    new SpecialWikiActivityPageObject(driver).open().verifyRecentNewBlogPage(blogContent, blogTitle, credentials.userName);
}
Also used : BlogPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject) SpecialWikiActivityPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialWikiActivityPageObject) VisualEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) UserProfilePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.UserProfilePageObject) SpecialCreatePage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialCreatePage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 3 with BlogPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject in project selenium-tests by Wikia.

the class BlogCommentsTests method BlogComments_003_User_editComment.

@Test(groups = "BlogComments_003")
@Execute(asUser = User.USER)
public void BlogComments_003_User_editComment() {
    WikiBasePageObject base = new WikiBasePageObject();
    UserProfilePageObject userProfile = base.openProfilePage(credentials.userName, wikiURL);
    userProfile.clickOnBlogTab();
    BlogPageObject blogPage = userProfile.openFirstPost();
    MiniEditorComponentObject editor = blogPage.triggerCommentArea();
    String comment = PageContent.COMMENT_TEXT + blogPage.getTimeStamp();
    editor.switchAndWrite(comment);
    blogPage.submitComment();
    blogPage.verifyCommentText(comment);
    blogPage.verifyCommentCreator(credentials.userName);
    blogPage.triggerEditCommentArea();
    String commentEdited = PageContent.COMMENT_TEXT + blogPage.getTimeStamp();
    editor.switchAndEditComment(commentEdited);
    blogPage.submitEditComment();
    blogPage.verifyCommentText(commentEdited);
}
Also used : MiniEditorComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject) BlogPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) UserProfilePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.UserProfilePageObject) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 4 with BlogPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject in project selenium-tests by Wikia.

the class BlogFeaturesTests method BlogFeatures_002_AddingSlideshow.

@Test(groups = { "BlogFeatures_002", "BlogFeaturesTests" })
@Execute(asUser = User.USER)
public void BlogFeatures_002_AddingSlideshow() {
    WikiBasePageObject base = new WikiBasePageObject();
    SpecialCreatePage createPage = base.openSpecialCreateBlogPage(wikiURL);
    String blogPostTitle = PageContent.BLOG_POST_NAME_PREFIX + createPage.getTimeStamp();
    VisualEditModePageObject blogEdit = createPage.populateTitleField(blogPostTitle);
    SlideshowBuilderComponentObject slideshowBuilder = blogEdit.clickSlideshowButton();
    AddPhotoComponentObject slideshowAddPhoto = slideshowBuilder.clickAddPhoto();
    slideshowAddPhoto.search("image");
    slideshowAddPhoto.choosePhotos(4);
    slideshowAddPhoto.clickSelect();
    slideshowBuilder.adjustPosition(Positions.CENTER);
    slideshowBuilder.clickFinish();
    blogEdit.verifySlideshow();
    BlogPageObject blogPage = blogEdit.submitBlog();
    blogPage.verifySlideshow();
}
Also used : BlogPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject) SlideshowBuilderComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.slideshow.SlideshowBuilderComponentObject) VisualEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject) AddPhotoComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.addphoto.AddPhotoComponentObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) SpecialCreatePage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialCreatePage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 5 with BlogPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject in project selenium-tests by Wikia.

the class BlogFeaturesTests method BlogFeatures_003_AddingSlider.

@Test(groups = { "BlogFeatures_003", "BlogFeaturesTests" })
@Execute(asUser = User.USER)
public void BlogFeatures_003_AddingSlider() {
    WikiBasePageObject base = new WikiBasePageObject();
    SpecialCreatePage createPage = base.openSpecialCreateBlogPage(wikiURL);
    String blogPostTitle = PageContent.BLOG_POST_NAME_PREFIX + createPage.getTimeStamp();
    VisualEditModePageObject blogEdit = createPage.populateTitleField(blogPostTitle);
    SliderBuilderComponentObject sliderBuilder = blogEdit.clickSliderButton();
    sliderBuilder.selectMenuPosition(MenuPositions.VERTICAL);
    AddPhotoComponentObject sliderAddPhoto = sliderBuilder.clickAddPhoto();
    sliderAddPhoto.search("image");
    sliderAddPhoto.choosePhotos(4);
    sliderAddPhoto.clickSelect();
    sliderBuilder.clickFinish();
    blogEdit.verifySlider();
    BlogPageObject blogPage = blogEdit.submitBlog();
    blogPage.verifySlider();
}
Also used : SliderBuilderComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.slider.SliderBuilderComponentObject) BlogPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject) VisualEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject) AddPhotoComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.addphoto.AddPhotoComponentObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) SpecialCreatePage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialCreatePage) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Aggregations

BlogPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject)18 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)17 Test (org.testng.annotations.Test)17 Execute (com.wikia.webdriver.common.core.annotations.Execute)12 UserProfilePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.UserProfilePageObject)10 VisualEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject)9 SpecialCreatePage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialCreatePage)8 MiniEditorComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject)4 Notification (com.wikia.webdriver.elements.oasis.components.notifications.Notification)3 AddPhotoComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.addphoto.AddPhotoComponentObject)3 DeletePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject)2 GalleryBuilderComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.gallery.GalleryBuilderComponentObject)1 PhotoAddComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoAddComponentObject)1 PhotoOptionsComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoOptionsComponentObject)1 SliderBuilderComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.slider.SliderBuilderComponentObject)1 SlideshowBuilderComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.slideshow.SlideshowBuilderComponentObject)1 VetAddVideoComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetAddVideoComponentObject)1 VetOptionsComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetOptionsComponentObject)1 RenamePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.RenamePageObject)1 SpecialRestorePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialRestorePageObject)1