Search in sources :

Example 1 with YoutubeVideo

use of com.wikia.webdriver.common.core.video.YoutubeVideo in project selenium-tests by Wikia.

the class VetArticleCommentsTests method RegularUserCanAddVideoInArticleCommentEditorByProvidingYoutubeVideoUrl.

@Test(groups = { "VetArticleComments_001" })
@Execute(asUser = User.USER)
@RelatedIssue(issueID = "SUS-758", comment = "This issue is related to API call and should not cause permanent " + "test failure. Otherwise the failure must be caused by other issue")
public void RegularUserCanAddVideoInArticleCommentEditorByProvidingYoutubeVideoUrl() {
    new ArticleContent().clear();
    ArticlePageObject article = new ArticlePageObject().open();
    MiniEditorComponentObject editor = article.triggerCommentArea();
    VetAddVideoComponentObject vetAddingVideo = editor.clickAddVideo();
    YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery("microsoft");
    String expectedCaption = PageContent.CAPTION + article.getTimeStamp();
    vetAddingVideo.addVideoByUrl(video.getUrl()).setCaption(expectedCaption).submit();
    Assertion.assertTrue(article.getArticleComment().isVideoVisible());
    article.submitComment();
    Assertion.assertEquals(article.getArticleComment().getLatestCommentCaption(), expectedCaption, "Latest comment caption doesn't equal to expected caption");
}
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) VetAddVideoComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetAddVideoComponentObject) YoutubeVideo(com.wikia.webdriver.common.core.video.YoutubeVideo) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue)

Example 2 with YoutubeVideo

use of com.wikia.webdriver.common.core.video.YoutubeVideo in project selenium-tests by Wikia.

the class ArticleSourceModeTests method RTE_021_YoutubeTag_Publish.

@CreationTicket(ticketID = "CONCF-626")
@Test(groups = { "RTE_extended_4", "RTE_extended_021" })
public void RTE_021_YoutubeTag_Publish() {
    WikiBasePageObject base = new WikiBasePageObject();
    String articleName = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
    ArticlePageObject article = new ArticlePageObject().open(articleName);
    SourceEditModePageObject source = article.openCurrectArticleSourceMode();
    YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery("water");
    String videoID = video.getID();
    source.addContentInSourceMode("<youtube>\n" + videoID + "\n</youtube>");
    article = source.clickPublishButton();
    article.verifyArticleTitle(articleName);
}
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) YoutubeVideo(com.wikia.webdriver.common.core.video.YoutubeVideo) CreationTicket(com.wikia.webdriver.common.core.annotations.CreationTicket) Test(org.testng.annotations.Test)

Example 3 with YoutubeVideo

use of com.wikia.webdriver.common.core.video.YoutubeVideo in project selenium-tests by Wikia.

the class FilePageTests method filePage005_deleteFromHistory.

/**
   * Verify that a video can be deleted from the File page
   */
@Test(groups = { "FilePage", "filePage005_deleteFromHistory", "Media" })
@RelatedIssue(issueID = "SUS-317", comment = "Product code defect. Test manually that the video can be deleted")
public void filePage005_deleteFromHistory() {
    YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery("pokemon");
    // Go to Special:Videos to add a video
    SpecialVideosPageObject specialVideos = new SpecialVideosPageObject(driver);
    specialVideos.loginAs(credentials.userNameStaff, credentials.passwordStaff, wikiURL);
    specialVideos.openSpecialVideoPage(wikiURL);
    // Add a Youtube video we'll delete
    VetAddVideoComponentObject vetAddingVideo = specialVideos.clickAddAVideo();
    vetAddingVideo.addVideoByUrl(video.getUrl());
    // Verify the video is actually there
    specialVideos.verifyVideoAdded(video.getTitle());
    // Go to the history tab and add a second video to test deleting a version
    FilePage filePage = new FilePage().open(video.getFileName());
    filePage.selectHistoryTab();
    filePage.replaceVideo(VideoContent.YOUTUBE_VIDEO_URL5);
    // Load the file page again, should have the same name
    filePage.open(video.getFileName()).verifyEmbeddedVideoIsPresent();
    //Removed following lines until SUS-317 is fixed
    //// Go to the history tab and verify there are at least two videos
    //filePage.selectHistoryTab();
    //filePage.verifyVersionCountAtLeast(2);
    //// Delete the second version
    //DeletePageObject deletePage = filePage.deleteVersion(2);
    //deletePage.submitDeletion();
    //Removed above lines until SUS-317is fixed
    // Load the file page again, should have the same name
    filePage.open(video.getFileName()).verifyEmbeddedVideoIsPresent();
    // Delete the first version and thus the whole page
    DeletePageObject deletePage = filePage.deleteVersion(1);
    deletePage.submitDeletion();
    // Go back to the file page and make sure its gone
    filePage.open(video.getFileName()).verifyEmptyFilePage();
}
Also used : DeletePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject) YoutubeVideo(com.wikia.webdriver.common.core.video.YoutubeVideo) VetAddVideoComponentObject(com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetAddVideoComponentObject) FilePage(com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage) SpecialVideosPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVideosPageObject) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue)

Example 4 with YoutubeVideo

use of com.wikia.webdriver.common.core.video.YoutubeVideo in project selenium-tests by Wikia.

the class VideosPageTests method VideosPageTest_003_deleteVideo_removedFromRecentVideos.

/**
     * Checks if a video can successfully be deleted from the Special:Videos page. Specifically, this
     * test checks if, after the video has been deleted, it is no longer present in the list of most
     * recent videos on Special:Videos. (Note: in order to accomplish this the test also adds a video
     * before hand to ensure that 1.) the test is sustainable, and 2.) it knows what the most recent
     * video is).
     */
@Execute(asUser = User.STAFF)
@Test(groups = { "VideosPage", "VideosPageTest_003", "Media" })
@RelatedIssue(issueID = "SUS-863")
public void VideosPageTest_003_deleteVideo_removedFromRecentVideos() {
    SpecialVideosPageObject specialVideos = new SpecialVideosPageObject(driver);
    YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery(VIDEO_QUERY);
    specialVideos.addVideoViaAjax(video.getUrl());
    Assertion.assertTrue(specialVideos.isNewVideoAdded());
    String addedVideoTitle = specialVideos.getNewestVideoTitle();
    specialVideos.deleteNewestVideo();
    List<Notification> confirmNotifications = specialVideos.getNotifications(NotificationType.CONFIRM);
    Assertion.assertEquals(confirmNotifications.size(), 1, SpecialVideosPageObject.AssertionMessages.INVALID_NUMBER_OF_CONFIRMING_NOTIFICATIONS);
    Notification notification = confirmNotifications.stream().findFirst().get();
    Assertion.assertTrue(notification.isVisible(), SpecialVideosPageObject.AssertionMessages.BANNER_NOTIFICATION_NOT_VISIBLE);
    Assertion.assertStringContains(notification.getMessage(), addedVideoTitle);
    Assertion.assertNotEquals(specialVideos.getNewestVideoTitle(), addedVideoTitle, "Video is still visible as newest video");
}
Also used : YoutubeVideo(com.wikia.webdriver.common.core.video.YoutubeVideo) SpecialVideosPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVideosPageObject) Notification(com.wikia.webdriver.elements.oasis.components.notifications.Notification) Execute(com.wikia.webdriver.common.core.annotations.Execute) Test(org.testng.annotations.Test) RelatedIssue(com.wikia.webdriver.common.core.annotations.RelatedIssue)

Example 5 with YoutubeVideo

use of com.wikia.webdriver.common.core.video.YoutubeVideo in project selenium-tests by Wikia.

the class ArticleSourceModeTests method RTE_020_YoutubeTag_Preview.

@CreationTicket(ticketID = "CONCF-626")
@Test(groups = { "RTE_extended_4", "RTE_extended_020" })
public void RTE_020_YoutubeTag_Preview() {
    WikiBasePageObject base = new WikiBasePageObject();
    String articleName = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
    ArticlePageObject article = new ArticlePageObject().open(articleName);
    SourceEditModePageObject source = article.openCurrectArticleSourceMode();
    YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery("water");
    String videoID = video.getID();
    source.addContentInSourceMode("<youtube>\n" + videoID + "\n</youtube>");
    PreviewEditModePageObject preview = source.previewArticle();
    preview.verifyVideoOnPreview(videoID);
}
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) YoutubeVideo(com.wikia.webdriver.common.core.video.YoutubeVideo) PreviewEditModePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.PreviewEditModePageObject) CreationTicket(com.wikia.webdriver.common.core.annotations.CreationTicket) Test(org.testng.annotations.Test)

Aggregations

YoutubeVideo (com.wikia.webdriver.common.core.video.YoutubeVideo)8 Test (org.testng.annotations.Test)8 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)5 SpecialVideosPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.special.SpecialVideosPageObject)5 Execute (com.wikia.webdriver.common.core.annotations.Execute)4 VetAddVideoComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.vet.VetAddVideoComponentObject)4 DeletePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.actions.DeletePageObject)3 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)3 FilePage (com.wikia.webdriver.pageobjectsfactory.pageobject.special.filepage.FilePage)3 CreationTicket (com.wikia.webdriver.common.core.annotations.CreationTicket)2 Notification (com.wikia.webdriver.elements.oasis.components.notifications.Notification)2 WikiBasePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.WikiBasePageObject)2 SourceEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.SourceEditModePageObject)2 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)1 MiniEditorComponentObject (com.wikia.webdriver.pageobjectsfactory.componentobject.minieditor.MiniEditorComponentObject)1 PreviewEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.PreviewEditModePageObject)1