/** * Test - Cloud-309:Account Search based on Account name * * <ul> * <li>Login * <li>From My Dashboard access the Advance Search CRM form * <li>In the Account Name Search text of the CRM search form enter helloaccount * <li>Validate the search results are returned 4 rows of results * <li>Validate the search results, any one of the result item should be from helloaccount * folder. * </ul> */ @Test public void AONE_13869() throws PageException, Exception { // Login ShareUser.login(drone, salesforceUserName, salesforcePassword); // Advance CRM Search with Account Name keyWordSearchText.put(SearchKeys.ACCOUNT_NAME.getSearchKeys(), accountName); List<SearchResult> results = ShareUserSearchPage.advanceSearchForCRM(drone, keyWordSearchText); Assert.assertTrue(ShareUserSearchPage.isSearchItemAvailable(drone, contract_Content)); Assert.assertTrue(results.size() == 4); List<String> folders = new LinkedList<String>(); // Finding the specific result item. for (SearchResult searchItem : results) { if (searchItem.getTitle().equalsIgnoreCase(account_Content)) { // Retrieving the folderNames from folderPath of the first resultItem. folders = ((SearchResultItem) searchItem).getFolderNamesFromContentPath(); } } Assert.assertTrue(folders.size() > 0); Assert.assertTrue(folders.get(0).equalsIgnoreCase(attachments_Folder)); Assert.assertTrue(folders.get(1).equalsIgnoreCase(accountName)); }
/** * Test - AONE-13000:Combination - Account and Case * * <ul> * <li>Login * <li>From My Dashboard, access the Advance Search CRM form * <li>In the Account Identifier Search text of the CRM search form, enter 001b0000009aPo1AAE * <li>In the Account Name Search text of the CRM search form, enter helloaccount * <li>In the Case Number Search text of the CRM search form, enter 00001006 * <li>In the Case Name Search text of the CRM search form, enter 00001006 * <li>Validate the search results is same for all combinations of search and any one of the * result item should be from helloaccountoppor folder. * </ul> */ @Test public void AONE_13881() throws PageException, Exception { // Login ShareUser.login(drone, salesforceUserName, salesforcePassword); // Advance CRM Search with Account Name and Contract Number keyWordSearchText.clear(); keyWordSearchText.put(SearchKeys.ACCOUNT_NAME.getSearchKeys(), accountName); keyWordSearchText.put(SearchKeys.CASE_NUMBER.getSearchKeys(), caseNameOrNumber); List<SearchResult> results = ShareUserSearchPage.advanceSearchForCRM(drone, keyWordSearchText); Assert.assertTrue(results.size() > 0); Assert.assertTrue(results.size() == 1); Assert.assertTrue(results.get(0).getTitle().equalsIgnoreCase(case_Content)); // Advance CRM Search with Account Name, Identifier, Case Number and Case Name. keyWordSearchText.clear(); keyWordSearchText.put(SearchKeys.ACCOUNT_NAME.getSearchKeys(), accountName); keyWordSearchText.put(SearchKeys.CASE_NAME.getSearchKeys(), caseNameOrNumber); keyWordSearchText.put(SearchKeys.CASE_NUMBER.getSearchKeys(), caseNameOrNumber); keyWordSearchText.put(SearchKeys.ACCOUNT_IDENTIFIER.getSearchKeys(), accountIdentifier); results = ShareUserSearchPage.advanceSearchForCRM(drone, keyWordSearchText); Assert.assertTrue(results.size() > 0); Assert.assertTrue(results.size() == 1); Assert.assertTrue(results.get(0).getTitle().equalsIgnoreCase(case_Content)); // Retrieving the folderNames from folderPath of the first resultItem. List<String> folders = ((SearchResultItem) results.get(0)).getFolderNamesFromContentPath(); Assert.assertTrue(folders.get(0).equalsIgnoreCase(attachments_Folder)); Assert.assertTrue(folders.get(1).equalsIgnoreCase(caseNameOrNumber)); // Advance CRM Search with Account Identifier and Case Name. keyWordSearchText.clear(); keyWordSearchText.put(SearchKeys.CASE_NAME.getSearchKeys(), caseNameOrNumber); keyWordSearchText.put(SearchKeys.ACCOUNT_IDENTIFIER.getSearchKeys(), accountIdentifier); results = ShareUserSearchPage.advanceSearchForCRM(drone, keyWordSearchText); Assert.assertTrue(results.size() > 0); Assert.assertTrue(results.size() == 1); Assert.assertTrue(results.get(0).getTitle().equalsIgnoreCase(case_Content)); // Advance CRM Search with Account Identifier and Case Number. keyWordSearchText.clear(); keyWordSearchText.put(SearchKeys.CASE_NUMBER.getSearchKeys(), caseNameOrNumber); keyWordSearchText.put(SearchKeys.ACCOUNT_IDENTIFIER.getSearchKeys(), accountIdentifier); results = ShareUserSearchPage.advanceSearchForCRM(drone, keyWordSearchText); Assert.assertTrue(results.size() > 0); Assert.assertTrue(results.size() == 1); Assert.assertTrue(results.get(0).getTitle().equalsIgnoreCase(case_Content)); }
/** * Test - AONE-13003: Basic Search for CRM property * * <ul> * <li>Login * <li>From My Dashboard, access the Basic Search form * <li>In the Search text of the basic search form, enter case name or number * <li>Validate the search results are returned. * <li>In the Search text of the basic search form, enter contract property * <li>Validate that only one search result item is returned. * <li>In the Search text of the basic search form, enter account property * <li>Validate that only 4 search result items are returned. * <li>In the Search text of the basic search form, enter opportunity property * <li>Validate that only one search result item is returned. * </ul> */ @Test public void AONE_13884() throws PageException, Exception { // Login ShareUser.login(drone, salesforceUserName, salesforcePassword); // Advance Basic Search with caseNameOrNumber List<SearchResult> results = ShareUserSearchPage.basicSearch(drone, caseNameOrNumber, false); Assert.assertTrue(results.size() > 0); // Advance Basic Search with caseNameOrNumber results = ShareUserSearchPage.basicSearch(drone, basic_Search_contractNumber, false); Assert.assertTrue(results.size() == 1); // Advance Basic Search with caseNameOrNumber results = ShareUserSearchPage.basicSearch(drone, basic_Search_accountIdentifier, false); Assert.assertTrue(results.size() == 4); // Advance Basic Search with caseNameOrNumber results = ShareUserSearchPage.basicSearch(drone, basic_Search_oppName, false); Assert.assertTrue(results.size() == 1); }
/** * Test - AONE-13001:Negative test case for combination * * <ul> * <li>Login * <li>From My Dashboard, access the Advance Search CRM form * <li>In the Oppo Name Search text of the CRM search form, enter helloaccount * <li>In the Contract Name Search text of the CRM search form, enter 00000104 * <li>In the Case Name Search text of the CRM search form, enter 00001006 * <li>Validate the search results is zero. * </ul> */ @Test public void AONE_13882() throws PageException, Exception { // Login ShareUser.login(drone, salesforceUserName, salesforcePassword); // Advance CRM Search with Opportunity Name and Contract Name keyWordSearchText.clear(); keyWordSearchText.put(SearchKeys.OPPORTUNITY_NAME.getSearchKeys(), oppName); keyWordSearchText.put(SearchKeys.CONTRACT_NAME.getSearchKeys(), contractNameOrNumber); List<SearchResult> results = ShareUserSearchPage.advanceSearchForCRM(drone, keyWordSearchText); Assert.assertTrue(results.size() == 0); // Advance CRM Search with Contract Name and Case Name. keyWordSearchText.clear(); keyWordSearchText.put(SearchKeys.CASE_NAME.getSearchKeys(), caseNameOrNumber); keyWordSearchText.put(SearchKeys.CONTRACT_NAME.getSearchKeys(), contractNameOrNumber); results = ShareUserSearchPage.advanceSearchForCRM(drone, keyWordSearchText); Assert.assertTrue(results.size() == 0); }
/** * Test - AONE-12996:Case Search based on Case name * * <ul> * <li>Login * <li>From My Dashboard, access the Advance Search CRM form * <li>In the Case Name Search text of the CRM search form, enter 00001006 * <li>Validate the search results, any one of the result item should be from 00001006 folder. * </ul> */ @Test public void AONE_13877() throws PageException, Exception { // Login ShareUser.login(drone, salesforceUserName, salesforcePassword); // Advance CRM Search with Case Name keyWordSearchText.clear(); keyWordSearchText.put(SearchKeys.CASE_NAME.getSearchKeys(), caseNameOrNumber); List<SearchResult> results = ShareUserSearchPage.advanceSearchForCRM(drone, keyWordSearchText); Assert.assertTrue(results.size() > 0); // Retrieving the folderNames from folderPath of the first resultItem. List<String> folders = ((SearchResultItem) results.get(0)).getFolderNamesFromContentPath(); Assert.assertTrue(folders.get(0).equalsIgnoreCase(attachments_Folder)); Assert.assertTrue(folders.get(1).equalsIgnoreCase(caseNameOrNumber)); }
/** * Enterprise40x-6553:Search for items * * <ul> * <li>Search for Content using Keywords search criteria * <li>Search for Content using Name search criteria * <li>Search for Content using Title search criteria * <li>Search for Content using Description search criteria * <li>Search for Content using Mimetype search criteria * <li>Search for Content using Modified Date search criteria * <li>Search for Content using Modifier search criteria * <li>Click View in Browser icon * <li>Click Download icon * <li>Search for Folder using Keywords search criteria * <li>Search for Folder using Name search criteria * <li>Search for Folder using Title search criteria * <li>Search for Folder using Description search criteria * <li>Click on folder's path * <li>Sort the found items by any criteria * </ul> * * @throws Exception */ @Test(groups = {"Sanity", "Search"}) public void enterprise40x_6553() throws Exception { testName = getTestName(); String searchTerm = testName + "-" + System.currentTimeMillis(); Boolean searchOk; String testUser = getUserNameFreeDomain(searchTerm); String siteName = getSiteName(searchTerm); String folderName = getFolderName(searchTerm + "-1"); String folderName2 = getFolderName(searchTerm + "-2"); String fileName = getFileName(searchTerm); CreateUserAPI.CreateActivateUser(drone, ADMIN_USERNAME, testUser); ShareUser.login(drone, testUser, DEFAULT_PASSWORD); // Create a Site ShareUser.createSite(drone, siteName, SITE_VISIBILITY_PUBLIC).render(); // Open Document library ShareUser.openDocumentLibrary(drone); // Create 2 Folder ShareUserSitePage.createFolder(drone, folderName, folderName + "Title1", folderName + "Desc1"); ShareUserSitePage.createFolder(drone, folderName2, folderName + "Title2", folderName + "Desc2"); // Create 2 Documents for (int i = 0; i < 2; i++) { ContentDetails contentDetails = new ContentDetails(); contentDetails.setName(fileName + "-Name-0" + i); contentDetails.setTitle(fileName + "-Title-0" + i); contentDetails.setDescription(fileName + "-Desc-0" + i); ShareUser.createContent(drone, contentDetails, ContentType.PLAINTEXT); } htmlFileName = fileName + "-Name-0" + TEST_HTML_FILE; ShareUser.uploadFileInFolder(drone, new String[] {htmlFileName}); /** Start Test */ // Searching and sorting the content items List<String> searchInfo = Arrays.asList(ADV_CONTENT_SEARCH); Map<String, String> keyWordSearchText = new HashMap<String, String>(); DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); Calendar cal = Calendar.getInstance(); String todaysDate = dateFormat.format(cal.getTime()); cal.add(Calendar.DATE, -1); try { keyWordSearchText.put(SearchKeys.KEYWORD.getSearchKeys(), searchTerm); List<SearchResultItem> searchResults = null; // Content Search with keyword: common part of filename searchResults = ShareUserSearchPage.advanceSearch(drone, searchInfo, keyWordSearchText); // Check the Search Results: Search with Retry for Solr assertTrue( ShareUserSearchPage.checkSearchResultsWithRetry( drone, ADV_CONTENT_SEARCH, searchTerm, fileName + "-Name-01", true), "Incorrect Search Results for: Keyword search- " + searchTerm + " file1 not displayed"); searchOk = ShareUserSearchPage.isSearchItemAvailable(drone, fileName + "-Name-00"); Assert.assertTrue( searchOk, "Incorrect Search Results for Name search- " + searchTerm + ". Result item - " + fileName + "-Name-00" + " not found"); keyWordSearchText.clear(); // Searching for valid Name. searchTerm = "-Name-00"; keyWordSearchText.put(SearchKeys.NAME.getSearchKeys(), searchTerm); searchResults = ShareUserSearchPage.advanceSearch(drone, searchInfo, keyWordSearchText); searchOk = ShareUserSearchPage.isSearchItemAvailable(drone, fileName + searchTerm); Assert.assertTrue(searchOk, "Incorrect Search Results for Name search- " + searchTerm); keyWordSearchText.clear(); // Searching for valid Title string searchTerm = "-Title-01"; keyWordSearchText.put(SearchKeys.TITLE.getSearchKeys(), searchTerm); searchResults = ShareUserSearchPage.advanceSearch(drone, searchInfo, keyWordSearchText); searchOk = ShareUserSearchPage.isSearchItemAvailable(drone, fileName + "-Name-01"); Assert.assertTrue(searchOk, "Incorrect Search Results for Name search- " + searchTerm); keyWordSearchText.clear(); // Searching for valid Description string searchTerm = "-Desc-01"; keyWordSearchText.put(SearchKeys.DESCRIPTION.getSearchKeys(), searchTerm); ShareUserSearchPage.advanceSearch(drone, searchInfo, keyWordSearchText); searchOk = ShareUserSearchPage.isSearchItemAvailable(drone, fileName + "-Name-01"); Assert.assertTrue(searchOk, "Incorrect Search Results for Name search- " + searchTerm); keyWordSearchText.clear(); // Searching for valid MODIFIERTODATE string keyWordSearchText.put(SearchKeys.MODIFIERTODATE.getSearchKeys(), todaysDate); keyWordSearchText.put(SearchKeys.MODIFIERFROMDATE.getSearchKeys(), todaysDate); searchResults = ShareUserSearchPage.advanceSearch(drone, searchInfo, keyWordSearchText); assertTrue( searchResults.size() > 0, "There should be search results for to date - " + todaysDate); searchOk = ShareUserSearchPage.isSearchItemAvailable(drone, fileName + "-Name-01"); Assert.assertTrue( searchOk, "Incorrect Search Results for Name search- " + keyWordSearchText + ". Result item - " + fileName + "-Name-00"); keyWordSearchText.clear(); // Searching for valid Name and Mime type. keyWordSearchText.put(SearchKeys.MIME.getSearchKeys(), "HTML"); searchResults = ShareUserSearchPage.advanceSearch(drone, searchInfo, keyWordSearchText); assertTrue(searchResults.size() > 0, "There should be search results for html MIME TYPE."); searchOk = ShareUserSearchPage.isSearchItemAvailable(drone, htmlFileName); Assert.assertTrue( searchOk, "Incorrect Search Results for Name search- " + keyWordSearchText + ". Result item - " + fileName + "-Name-00" + " not found"); searchResults.clear(); keyWordSearchText.clear(); // Searching for valid Name and Mime type. keyWordSearchText.put(SearchKeys.MODIFIER.getSearchKeys(), testUser); searchResults = ShareUserSearchPage.advanceSearch(drone, searchInfo, keyWordSearchText); assertTrue( searchResults.size() > 0, "There should be search results for " + testUser + " as modifier."); searchOk = ShareUserSearchPage.isSearchItemAvailable(drone, fileName + "-Name-00"); Assert.assertTrue( searchOk, "Incorrect Search Results for Name search- " + keyWordSearchText + ". Result item - " + fileName + "-Name-00" + " not found"); searchResults.clear(); keyWordSearchText.clear(); // Folder Search: Searching with keyword searchInfo = Arrays.asList(ADV_FOLDER_SEARCH); searchTerm = folderName; keyWordSearchText.put(SearchKeys.KEYWORD.getSearchKeys(), searchTerm); searchResults = ShareUserSearchPage.advanceSearch(drone, searchInfo, keyWordSearchText); searchOk = ShareUserSearchPage.isSearchItemAvailable(drone, folderName); Assert.assertTrue( searchOk, "Incorrect Search Results for Name search- " + searchTerm + ". Result item - " + fileName + "-Name-00" + " not found"); keyWordSearchText.clear(); // Searching for valid Name. keyWordSearchText.put(SearchKeys.NAME.getSearchKeys(), searchTerm); searchResults = ShareUserSearchPage.advanceSearch(drone, searchInfo, keyWordSearchText); assertTrue(searchResults.size() > 0, "There should be search results for name on folder."); searchOk = ShareUserSearchPage.isSearchItemAvailable(drone, folderName); Assert.assertTrue( searchOk, "Incorrect Search Results for Name search- " + searchTerm + ". Result item - " + fileName + "-Name-00" + " not found"); keyWordSearchText.clear(); // Searching for valid Title string keyWordSearchText.put(SearchKeys.TITLE.getSearchKeys(), searchTerm); searchResults = ShareUserSearchPage.advanceSearch(drone, searchInfo, keyWordSearchText); assertTrue(searchResults.size() > 0, "There should be search results for title on folder."); searchOk = ShareUserSearchPage.isSearchItemAvailable(drone, folderName); Assert.assertTrue( searchOk, "Incorrect Search Results for Name search- " + searchTerm + ". Result item - " + folderName + " not found"); keyWordSearchText.clear(); // Searching for valid Description string keyWordSearchText.put(SearchKeys.DESCRIPTION.getSearchKeys(), searchTerm); searchResults = ShareUserSearchPage.advanceSearch(drone, searchInfo, keyWordSearchText); assertTrue( searchResults.size() > 0, "There should be search results for description on folder."); searchOk = ShareUserSearchPage.isSearchItemAvailable(drone, folderName); Assert.assertTrue( searchOk, "Incorrect Search Results for Name search- " + searchTerm + ". Result item - " + folderName + " not found"); // Sorting results by Name List<SearchResultItem> sortedByName = ShareUserSearchPage.sortSearchResults(drone, SortType.NAME); List<SearchResultItem> expectedResultsSortedByName = new ArrayList<SearchResultItem>(sortedByName); Collections.sort(expectedResultsSortedByName, new SortedSearchResultItemByName()); // Check Sort order for (int i = 0; (i < 5 && i < expectedResultsSortedByName.size()); i++) { assertTrue( expectedResultsSortedByName .get(i) .getTitle() .equalsIgnoreCase(sortedByName.get(i).getTitle()), "The results are not sorted as expected - " + expectedResultsSortedByName.get(i).getTitle() + " - " + sortedByName.get(i).getTitle()); } } catch (Throwable e) { reportError(drone, testName, e); } finally { testCleanup(drone, testName); } }