Search in sources :

Example 6 with PhotoOptionsComponentObject

use of com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoOptionsComponentObject in project selenium-tests by Wikia.

the class ArticleSourceModeTests method RTE_012_Photo.

@Test(groups = { "RTE_extended_2", "RTE_extended_012" })
@Execute(onWikia = "seleniumtests")
public void RTE_012_Photo() {
    WikiBasePageObject base = new WikiBasePageObject();
    base.loginAs(User.STAFF);
    String articleName = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
    ArticlePageObject article = new ArticlePageObject().open(articleName);
    SourceEditModePageObject source = article.openCurrectArticleSourceMode();
    PhotoAddComponentObject photoAddPhoto = source.clickAddPhoto();
    PhotoOptionsComponentObject photoOptions = photoAddPhoto.addPhotoFromWiki(PageContent.FILE);
    photoOptions.setCaption(PageContent.CAPTION);
    photoOptions.clickAddPhoto();
    String photoName = photoAddPhoto.getPhotoName();
    Assertion.assertEquals(source.getSourceContent(), String.format(PageContent.WIKI_TEXT_PHOTO.replace("%photoName%", photoName), PageContent.CAPTION));
}
Also used : ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) SourceEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.SourceEditModePageObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) PhotoAddComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoAddComponentObject) PhotoOptionsComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoOptionsComponentObject) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 7 with PhotoOptionsComponentObject

use of com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoOptionsComponentObject in project selenium-tests by Wikia.

the class BlogFeaturesTests method addingImage.

@Test(groups = { "BlogFeatures_005", "BlogFeaturesTests" })
@Execute(asUser = User.USER)
public void addingImage() {
    WikiBasePageObject base = new WikiBasePageObject();
    SpecialCreatePage createPage = base.openSpecialCreateBlogPage(wikiURL);
    String blogPostTitle = PageContent.BLOG_POST_NAME_PREFIX + createPage.getTimeStamp();
    VisualEditModePageObject blogEdit = createPage.populateTitleField(blogPostTitle);
    PhotoAddComponentObject photoAddPhoto = blogEdit.clickPhotoButton();
    PhotoOptionsComponentObject photoOptions = photoAddPhoto.addPhotoFromWiki("image", 1);
    photoOptions.setCaption(PageContent.CAPTION);
    photoOptions.clickAddPhoto();
    blogEdit.verifyPhoto();
    BlogPageObject blogPage = blogEdit.submitBlog();
    blogPage.verifyPhoto();
}
Also used : BlogPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject) VisualEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject) WikiBasePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject) SpecialCreatePage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialCreatePage) PhotoAddComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoAddComponentObject) PhotoOptionsComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoOptionsComponentObject) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test)

Example 8 with PhotoOptionsComponentObject

use of com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoOptionsComponentObject in project selenium-tests by Wikia.

the class ArticleFeaturesCRUDTestsUser method addImage.

@Test(groups = { "ArticleFeaturesCRUDUser_010", "Smoke1" })
@Execute(asUser = User.USER)
@InBrowser(browserSize = "1024x720")
public void addImage() {
    new ArticleContent().clear();
    VisualEditModePageObject visualEditMode = new VisualEditModePageObject().open();
    PhotoAddComponentObject photoAddPhoto = visualEditMode.clickPhotoButton();
    PhotoOptionsComponentObject photoOptions = photoAddPhoto.addPhotoFromWiki("image", 1);
    photoOptions.setCaption(PageContent.CAPTION);
    photoOptions.clickAddPhoto();
    visualEditMode.verifyPhoto();
    visualEditMode.submitArticle();
}
Also used : ArticleContent(com.wikia.webdriver.common.core.api.ArticleContent) VisualEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject) PhotoAddComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoAddComponentObject) PhotoOptionsComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoOptionsComponentObject) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) InBrowser(com.wikia.webdriver.common.core.annotations.InBrowser)

Aggregations

PhotoOptionsComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoOptionsComponentObject)8 Execute (com.wikia.webdriver.common.core.annotations.Execute)7 PhotoAddComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.photo.PhotoAddComponentObject)7 Test (org.testng.annotations.Test)7 VisualEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject)5 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)4 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)3 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)3 InBrowser (com.wikia.webdriver.common.core.annotations.InBrowser)2 LightboxComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.lightbox.LightboxComponentObject)1 SourceEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.SourceEditModePageObject)1 MessageWall (com.wikia.webdriver.pageobjectsfactory.pageobject.messagewall.MessageWall)1 SpecialCreatePage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialCreatePage)1 BlogPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.blog.BlogPageObject)1