@Test(dependsOnMethods = "checkChangeCategoryName", groups = "Enterprise-only", timeOut = 400000) public void checkDeleteCategory() throws Exception { CategoryManagerPage categoryManagerPage = drone.getCurrentPage().render(); int categoryCount = categoryManagerPage.getCategoriesCount(); categoryManagerPage.deleteCategory(renameCategoryName); Thread.sleep(solrWaitTime); // wait solr drone.refresh(); assertFalse(categoryManagerPage.isCategoryPresent(renameCategoryName)); assertTrue(categoryCount - 2 == categoryManagerPage.getCategoriesCount()); }
@Test(dependsOnMethods = "checkOpenSubCategory", groups = "Enterprise-only", timeOut = 400000) public void checkChangeCategoryName() throws Exception { CategoryManagerPage categoryManagerPage = drone.getCurrentPage().render(); categoryManagerPage.editCategory(categoryName, renameCategoryName); Thread.sleep(solrWaitTime); // wait solr drone.refresh(); assertTrue(categoryManagerPage.isCategoryPresent(renameCategoryName)); categoryManagerPage.openSubCategoryList(renameCategoryName); assertTrue(categoryManagerPage.isCategoryPresent(subCategoryName)); }
@Test( dependsOnMethods = "checkCategoryCountAndAddNew", groups = "Enterprise-only", timeOut = 400000) public void checkOpenSubCategory() throws Exception { CategoryManagerPage categoryManagerPage = drone.getCurrentPage().render(); int categoryCount = categoryManagerPage.getCategoriesCount(); categoryManagerPage.addNewCategory(categoryName, subCategoryName); Thread.sleep(solrWaitTime); // wait solr drone.refresh(); assertTrue(categoryCount == categoryManagerPage.getCategoriesCount()); categoryManagerPage.openSubCategoryList(categoryName); assertTrue(categoryCount + 1 == categoryManagerPage.getCategoriesCount()); assertTrue(categoryManagerPage.isCategoryPresent(subCategoryName)); }
@Test( dependsOnMethods = "checkThatFactoryReturnCategoryManagerPage", groups = "Enterprise-only", timeOut = 400000) public void checkCategoryCountAndAddNew() throws Exception { CategoryManagerPage categoryManagerPage = drone.getCurrentPage().render(); int categoryCount = categoryManagerPage.getCategoriesCount(); assertTrue(categoryCount > 0); categoryManagerPage.addNewCategory(rootCategoryName, categoryName); Thread.sleep(solrWaitTime); // wait solr drone.refresh(); assertTrue( categoryCount < categoryManagerPage.getCategoriesCount(), "Before " + categoryCount + ", after " + categoryManagerPage.getCategoriesCount()); assertTrue(categoryManagerPage.isCategoryPresent(categoryName)); }