use of com.wikia.webdriver.common.core.video.YoutubeVideo in project selenium-tests by Wikia.
the class VideosPageTests method VideosPageTest_002_deleteVideo_notificationContainsTitle.
/**
* Checks if a video can successfully be deleted from the Special:Videos page. Specifically, this
* test checks if, after the video has been deleted, its title shows up in the delete confirmation
* presented by Global Notifications. (Note: This test also adds a video beforehand to make sure
* running this test is sustainable).
*/
@Execute(asUser = User.STAFF)
@Test(groups = { "VideosPage", "VideosPageTest_002", "Media" })
@RelatedIssue(issueID = "SUS-755")
public void VideosPageTest_002_deleteVideo_notificationContainsTitle() {
SpecialVideosPageObject specialVideos = new SpecialVideosPageObject(driver);
YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery(VIDEO_QUERY);
specialVideos.addVideoViaAjax(video.getUrl());
Assertion.assertTrue(specialVideos.isNewVideoAdded());
String addedVideoTitle = specialVideos.getNewestVideoTitle();
String addedVideoTitlePattern = addedVideoTitle;
if (addedVideoTitle.endsWith(SUFFIX_FOR_LONG_TITLE)) {
addedVideoTitlePattern = addedVideoTitle.replace(SUFFIX_FOR_LONG_TITLE, "");
}
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(), addedVideoTitlePattern);
}
use of com.wikia.webdriver.common.core.video.YoutubeVideo in project selenium-tests by Wikia.
the class FilePageTests method filePage004_delete.
/**
* Verify that a video can be deleted from the File page
*/
@RelatedIssue(issueID = "MAIN-4294")
@Test(groups = { "FilePage", "filePage004_delete", "Media" })
public void filePage004_delete() {
// Go to Special:Videos to add a video
YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery("data");
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());
// Now delete the video
FilePage filePage = new FilePage().open(video.getFileName());
DeletePageObject deletePage = filePage.deletePage();
deletePage.submitDeletion();
// Go back to the file page and make sure its gone
filePage = filePage.open(video.getFileName());
filePage.verifyEmptyFilePage();
}
use of com.wikia.webdriver.common.core.video.YoutubeVideo in project selenium-tests by Wikia.
the class VetSpecialVideosTests method SpecialVideos_001_Provider.
@Test(groups = { "VetTests001" })
@Execute(asUser = User.USER)
public void SpecialVideos_001_Provider() {
YoutubeVideo video = YoutubeVideoProvider.getLatestVideoForQuery("flower");
SpecialVideosPageObject specialVideos = new SpecialVideosPageObject(driver);
specialVideos.openSpecialVideoPage(wikiURL);
VetAddVideoComponentObject vetAddingVideo = specialVideos.clickAddAVideo();
vetAddingVideo.addVideoByUrl(video.getUrl());
specialVideos.verifyVideoAdded(video.getTitle());
FilePage filePage = new FilePage().open(video.getFileName());
// filePage.getGlobalNavigation().openAccountNavigation().clickLogOut();
filePage.loginAs(credentials.userNameStaff, credentials.passwordStaff, wikiURL);
DeletePageObject deletePage = filePage.deletePage();
deletePage.submitDeletion();
filePage = filePage.open(video.getFileName());
filePage.verifyEmptyFilePage();
}
Aggregations