Search in sources :

Example 46 with VisualEditorPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject in project selenium-tests by Wikia.

the class VECategoryTests method VECategoryTests_005_AddNewCategoryWithSortKey.

//CA05
@Test(groups = { "VECategoryTests", "VECategoryTests_005", "VEAddCategory" })
public void VECategoryTests_005_AddNewCategoryWithSortKey() {
    String testCategory2 = "Newstuff";
    String sortKey = "testkey";
    List<String> categoryWithSortKeyWikiTexts = new ArrayList<>();
    categoryWithSortKeyWikiTexts.add("[[Category:" + testCategory2 + "|" + sortKey + "]]");
    String articleName2 = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
    VisualEditorPageObject ve = base.openVEOnArticle(wikiURL, articleName2);
    ve.verifyVEToolBarPresent();
    ve.verifyEditorSurfacePresent();
    VisualEditorOptionsDialog optionsDialog = (VisualEditorOptionsDialog) ve.openDialogFromMenu(InsertDialog.CATEGORIES);
    optionsDialog.addCategory(testCategory2);
    optionsDialog.addSortKeyToCategory(testCategory2, sortKey);
    ve = optionsDialog.clickApplyChangesButton();
    ve.verifyVEToolBarPresent();
    VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton();
    VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges();
    reviewDialog.verifyAddedDiffs(categoryWithSortKeyWikiTexts);
    saveDialog = reviewDialog.clickReturnToSaveFormButton();
    ArticlePageObject article = saveDialog.savePage();
    article.verifyVEPublishComplete();
}
Also used : ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) ArrayList(java.util.ArrayList) VisualEditorReviewChangesDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorReviewChangesDialog) VisualEditorOptionsDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorOptionsDialog) VisualEditorSaveChangesDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog) Test(org.testng.annotations.Test)

Example 47 with VisualEditorPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject in project selenium-tests by Wikia.

the class VEGalleryTests method VEGalleryTests_005_Remove.

@Test(groups = { "VEGallery", "VEGalleryTests_005", "VEGalleryRemove" }, dependsOnGroups = "VEGalleryTests_001")
public void VEGalleryTests_005_Remove() {
    VisualEditorPageObject ve = article.openVEOnArticle(wikiURL, articleName);
    ve.verifyVEToolBarPresent();
    ve.verifyEditorSurfacePresent();
    ve.deleteGallery(0);
    ve.verifyGalleries(0);
    ve.publish();
}
Also used : VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) Test(org.testng.annotations.Test)

Example 48 with VisualEditorPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject in project selenium-tests by Wikia.

the class VECategoryTests method VECategoryTests_001_AddNewCategory.

//CA01
@Test(groups = { "VECategoryTests", "VECategoryTests_001", "VEAddCategory", "VECategoryTests_002" })
public void VECategoryTests_001_AddNewCategory() {
    articleName = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
    VisualEditorPageObject ve = base.openVEOnArticle(wikiURL, articleName);
    ve.verifyVEToolBarPresent();
    ve.verifyEditorSurfacePresent();
    VisualEditorOptionsDialog optionsDialog = (VisualEditorOptionsDialog) ve.openDialogFromMenu(InsertDialog.CATEGORIES);
    optionsDialog.addCategory(testCategory);
    ve = optionsDialog.clickApplyChangesButton();
    ve.verifyVEToolBarPresent();
    VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton();
    VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges();
    reviewDialog.verifyAddedDiffs(categoryWikiTexts);
    saveDialog = reviewDialog.clickReturnToSaveFormButton();
    ArticlePageObject article = saveDialog.savePage();
    article.verifyVEPublishComplete();
}
Also used : ArticlePageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject) VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) VisualEditorReviewChangesDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorReviewChangesDialog) VisualEditorOptionsDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorOptionsDialog) VisualEditorSaveChangesDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog) Test(org.testng.annotations.Test)

Example 49 with VisualEditorPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject in project selenium-tests by Wikia.

the class VECategoryTests method VECategoryTests_003_NewCategorySuggestions.

//CA03
@Test(groups = { "VECategoryTests", "VECategoryTests_003", "VEAddCategory" })
public void VECategoryTests_003_NewCategorySuggestions() {
    String articleName2 = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp();
    VisualEditorPageObject ve = base.openVEOnArticle(wikiURL, articleName2);
    ve.verifyVEToolBarPresent();
    ve.verifyEditorSurfacePresent();
    VisualEditorOptionsDialog optionsDialog = (VisualEditorOptionsDialog) ve.openDialogFromMenu(InsertDialog.CATEGORIES);
    optionsDialog.verifyLinkSuggestions(categorySearchStr, CategoryResultType.NEW);
}
Also used : VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) VisualEditorOptionsDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorOptionsDialog) Test(org.testng.annotations.Test)

Example 50 with VisualEditorPageObject

use of com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject in project selenium-tests by Wikia.

the class VEGalleryTests method VEGalleryTests_002_GalleryCart.

//AG02
@Test(groups = { "VEGallery", "VEGalleryTests_002", "VEGalleryCart" })
public void VEGalleryTests_002_GalleryCart() {
    int numOfMediaToRemoveFirst = 1;
    int numOfMediaToRemoveSecond = 2;
    int numOfMediaToAdd = 2;
    int initialNumOfMedia = 7;
    int expectedNumOfMedia = initialNumOfMedia;
    String randomArticleName = PageContent.ARTICLE_NAME_PREFIX + article.getTimeStamp();
    VisualEditorPageObject ve = article.openVEOnArticle(wikiURL, randomArticleName);
    ve.verifyVEToolBarPresent();
    ve.verifyEditorSurfacePresent();
    VisualEditorInsertGalleryDialog galleryDialog = ve.clickGalleryButton();
    galleryDialog = galleryDialog.searchMedia("he");
    //verify # of cart items  = 9
    galleryDialog.addMediaToCart(initialNumOfMedia);
    galleryDialog.verifyNumOfCartItems(expectedNumOfMedia);
    //verify # of cart items  = 8
    galleryDialog.removeMediaFromCart(numOfMediaToRemoveFirst);
    expectedNumOfMedia = expectedNumOfMedia - numOfMediaToRemoveFirst;
    galleryDialog.verifyNumOfCartItems(expectedNumOfMedia);
    //verify # of cart item = 11
    galleryDialog = galleryDialog.searchMedia("a");
    galleryDialog.addMediaToCart(numOfMediaToAdd);
    expectedNumOfMedia = expectedNumOfMedia + numOfMediaToAdd;
    galleryDialog.verifyNumOfCartItems(expectedNumOfMedia);
    //verify # of cart item = 9
    galleryDialog = galleryDialog.searchMedia("he");
    galleryDialog.removeMediaFromCart(numOfMediaToRemoveSecond);
    expectedNumOfMedia = expectedNumOfMedia - numOfMediaToRemoveSecond;
    galleryDialog.verifyNumOfCartItems(expectedNumOfMedia);
}
Also used : VisualEditorInsertGalleryDialog(com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorInsertGalleryDialog) VisualEditorPageObject(com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject) Test(org.testng.annotations.Test)

Aggregations

VisualEditorPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.visualeditor.VisualEditorPageObject)85 Test (org.testng.annotations.Test)69 ArticlePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.ArticlePageObject)44 VisualEditorSaveChangesDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorSaveChangesDialog)17 Execute (com.wikia.webdriver.common.core.annotations.Execute)15 RelatedIssue (com.wikia.webdriver.common.core.annotations.RelatedIssue)12 WebElement (org.openqa.selenium.WebElement)11 VisualEditorReviewChangesDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorReviewChangesDialog)9 VisualEditorAddMediaDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorAddMediaDialog)7 SourceEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.SourceEditModePageObject)7 ArticleContent (com.wikia.webdriver.common.core.api.ArticleContent)6 VisualEditorOptionsDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorOptionsDialog)5 ArticlePurger (com.wikia.webdriver.common.core.helpers.ArticlePurger)4 VisualEditorInsertGalleryDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorInsertGalleryDialog)4 VisualEditorInsertTemplateDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorInsertTemplateDialog)4 VisualEditModePageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.article.editmode.VisualEditModePageObject)4 ArrayList (java.util.ArrayList)4 VisualEditorAddMapDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorAddMapDialog)3 VisualEditorEditTemplateDialog (com.wikia.webdriver.pageobjectsfactory.componentobject.visualeditordialogs.VisualEditorEditTemplateDialog)3 WikiHistoryPageObject (com.wikia.webdriver.pageobjectsfactory.pageobject.wikipage.WikiHistoryPageObject)2