Guest User

Untitled

a guest
Sep 18th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 39.32 KB | None | 0 0
  1. package com.dachisgroup.sbi.verification.mainSite;
  2.  
  3. import java.io.IOException;
  4. import java.util.ArrayList;
  5. import java.util.Date;
  6.  
  7. import jxl.read.biff.BiffException;
  8.  
  9. import org.testng.annotations.Test;
  10.  
  11. import com.dachisgroup.sbi.filtersBlock.BrandsFilter;
  12. import com.dachisgroup.sbi.init.Common;
  13. import com.dachisgroup.sbi.init.SeleniumInit;
  14. import com.dachisgroup.sbi.init.TestData;
  15. import com.dachisgroup.sbi.pages.advocates.AdvocatesPage;
  16. import com.dachisgroup.sbi.pages.index.IndexPage;
  17. import org.testng.Assert;
  18. import org.openqa.selenium.By;
  19. import org.openqa.selenium.NoSuchElementException;
  20. import org.openqa.selenium.WebElement;
  21.  
  22.  
  23. public class TS_Advocate extends SeleniumInit implements TestData{
  24.  
  25.     Date date = new Date();
  26.     Common common = new Common(driver);
  27.  
  28.     String url = "123123"; 
  29.     String time = common.toGmtString(date);
  30.     String name = "mister" + time;
  31.     String name2 = "miss" + time;
  32.     String namesub1 = name.substring(0, 1);
  33.     String namesub2 = name.substring(6, 11);
  34.     String firstName = common.generateRandomChars(5);
  35.     String lastName = common.generateRandomChars(6);
  36.     String email = time + "@mailinator.com";
  37.     String message = common.generateRandomSymbols(12);
  38.    
  39.     @Test
  40.     public void companyPortfolioTest() throws InterruptedException{
  41.    
  42.         String advocateName = "Asex";
  43.         String advocateDetailRange = "30d";            
  44.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword);         
  45.         advocatesPage.clickAdvocateDetailRange(advocateName, advocateDetailRange);
  46.  
  47.     }
  48.    
  49.     /**
  50.      * <b>Scenario</b> "Multiple 'Platforms' filters work correctly" <br>
  51.      * <b>given</b>    "User is on the 'Advocate Insight' page" <br>
  52.      * <b>when</b>     "user selects 'Facebook' platform filter" </br>
  53.      * <b>then</b>     "only 'Facebook' social profile is displayed" </br>
  54.      * QA-618
  55.      */
  56.    
  57.     @Test
  58.     public void multiplePlatformsFiltersWorkCorrectly(){
  59.         boolean areOnlyAccountsSpecifiedPresent;
  60.        
  61.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola,qapassword);
  62.         advocatesPage = advocatesPage.checkMultiplePlatformAndShowResult("Facebook", "Twitter");
  63.         areOnlyAccountsSpecifiedPresent = advocatesPage.areOnlyAccountsSpecifiedPresent("Facebook", "Twitter");
  64.         Assert.assertTrue(areOnlyAccountsSpecifiedPresent);
  65.     }
  66.    
  67.    
  68.     /**
  69.      * <b>Scenario</b> "Subsidiaries' filters work correctly" <br>
  70.      * <b>given</b>    "User is on the 'Advocate Insight' page" </br>
  71.      * <b>when</b>     "user selects 'PepsiCo, Inc.' susidiaries filter" </br>
  72.      * <b>then</b>     "only 'PepsiCo, Inc.' social profile is displayed" </br>
  73.      * QA-618
  74.      */
  75.    
  76.     @Test
  77.     public void subsidiariesFiltersWorkCorrectly(){
  78.         int accountsNumbers, realAccountsNumber;
  79.         boolean areAllSubsidiariesAreEqualToExpected;
  80.         advocatesPage = indexPage.loginToAdvocatePage(qanokia, qapassword);
  81.         advocatesPage = advocatesPage.checkSubsidiaryAndShowResult("Navigeishn Teknolodzhiz C-I-S OOO");       
  82.         advocatesPage.clickShowAllAccs();
  83.         accountsNumbers = advocatesPage.getAccountsNumbers();
  84.         realAccountsNumber = advocatesPage.getRealAccountNumbers();
  85.         Assert.assertEquals(accountsNumbers, realAccountsNumber);
  86.         areAllSubsidiariesAreEqualToExpected = advocatesPage.areAllSubsidiariesAreEqualToExpected("Navigeishn Teknolodzhiz C-I-S OOO", "Subsidiaries", accountsNumbers);
  87.         Assert.assertTrue(areAllSubsidiariesAreEqualToExpected);
  88.     }
  89.    
  90.     @Test
  91.     public void selectAllFilterIsWorkingCorrectlyForDifferentFilters(){
  92.         int accountsNumbers;
  93.         boolean platformFilterState, brandsFilterState;
  94.        
  95.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola,qapassword);
  96.         platformsFilter = advocatesPage.clickOnPlatformsFilter();
  97.         platformsFilter.selectAllPlatformFilters();
  98.         platformFilterState = platformsFilter.areAllPlatformCheckboxesChecked();
  99.        
  100.         Assert.assertEquals(platformFilterState, true);
  101.        
  102.         advocatesPage = new AdvocatesPage(driver);
  103.        
  104.         brandsFilter = advocatesPage.clickOnBrandsFilter();
  105.         brandsFilter.selectAllBrandsFilters();
  106.         brandsFilterState = brandsFilter.areAllBrandsCheckboxesChecked();
  107.        
  108.         Assert.assertEquals(brandsFilterState, true);
  109.     }
  110.    
  111.     /**
  112.      * <b>Scenario</b> "Regions' filters work correctly" </br>
  113.      * <b>given</b>    "User is on the 'Advocate Insight' page" </br>
  114.      * <b>when</b>     "user selects 'North America' regions filter" </br>
  115.      * <b>then</b>     "only 'North America' social profile is displayed" </br>
  116.      * QA-618
  117.      */
  118.    
  119.     @Test
  120.     public void regionsFiltersWorkCorrectly(){
  121.         int accountsNumbers, accountsNumbersFromLabel;
  122.         boolean areAllSubsidiariesAreEqualToExpected;
  123.         String accountName, regionName;
  124.        
  125.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola,qapassword);
  126.         accountName = advocatesPage.getRandomAccountName();
  127.         advocatesPage.expandNeededAdvocateAccount(accountName);
  128.         advocatesPage.clickAssigmentsTabLink();
  129.         editAssignmentsForm = advocatesPage.clickEditAssigmentLink();
  130.         editAssignmentsForm.expandAll();
  131.         editAssignmentsForm.uncheckAllBoxes();
  132.         regionName = editAssignmentsForm.clickAndGetRandomCountry();
  133.         advocatesPage = editAssignmentsForm.clickSaveButton();     
  134.         advocatesPage.checkRegionsAndShowResult(regionName);   
  135.         accountsNumbers = advocatesPage.getAccountsNumbers();
  136.         accountsNumbersFromLabel = advocatesPage.getAccountsNumberFromLabel();
  137.         Assert.assertEquals(accountsNumbersFromLabel, accountsNumbers);
  138.         areAllSubsidiariesAreEqualToExpected = advocatesPage.areAllSubsidiariesAreEqualToExpected(regionName, "Regions", accountsNumbers);
  139.         Assert.assertTrue(areAllSubsidiariesAreEqualToExpected);
  140.     }
  141.    
  142.     /**
  143.      * <b>Scenario</b> "User is able to edit associations in the advocate accounts" </br>
  144.      * <b>given</b>    "User is on the 'Advocates' page" </br>
  145.      * <b>when</b>     "user expands advocate account" </br>
  146.      * <b>and</b>      "user clicks 'Company Associations' Tab and click 'edit' link" </br>
  147.      * <b>then</b>     "'Edit Assignments' form appears" </br>
  148.      * <b>when</b>     "user check 'Location', 'Brands' checkboxes and clicks [Save] button" </br>
  149.      * <b>then</b>     "advocate account is updated according to the set data and displayed correctly on the 'Advocates' page." </br>
  150.      * QA-656
  151.      */
  152.    
  153.     @Test        
  154.     public void userIsAbleToEditAssociationsInTheAdvocateAccounts(){
  155.         String account;
  156.         boolean isEditAssigmentFormDisplayed;
  157.         String socAssigments;
  158.         String assigments;
  159.        
  160.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword);
  161.         account = advocatesPage.clickRandomAdvocateAcc();
  162.         advocatesPage.clickAssigmentsTabLink();
  163.         editAssignmentsForm = advocatesPage.clickEditAssigmentLink();
  164.         isEditAssigmentFormDisplayed = editAssignmentsForm.isEditAssigmentFormDisplayed();
  165.         Assert.assertTrue(isEditAssigmentFormDisplayed);
  166.         editAssignmentsForm.expandAll();
  167.         editAssignmentsForm.uncheckAllBoxes();
  168.         assigments = editAssignmentsForm.checkRandomAssociations();
  169.         advocatesPage = editAssignmentsForm.clickSaveButton();
  170.         advocatesPage.submitNewSearch(account);
  171.         advocatesPage.clickRandomAdvocateAcc();
  172.         advocatesPage.clickAssigmentsTabLink();
  173.         socAssigments = advocatesPage.geAdvocateAccountAssociations();
  174.         Assert.assertEquals(assigments, socAssigments);
  175.     }
  176.    
  177.     /**
  178.      * <b>Scenario</b> "Grouping by each type should return correct result on the 'Avocates' page" </br>
  179.      * <b>given</b>    "User is on the 'Avocates' page" </br>
  180.      * <b>then</b>     "'Group by:' menu has 'None' value by default" </br>
  181.      * <b>when</b>     "user sets 'Platform' type in the 'Group by:' drop-down menu" </br>
  182.      * <b>then</b>     "'Advocate insight' page is dimmed and spinner image during the loading of the result is displayed" </br>
  183.      * <b>and</b>      "all existed in the system social platforms with and without social account(s) are displayed correctly" </br>
  184.      * <b>when</b>     "user sets 'Brand' type in the 'Group by:' drop-down menu" </br>
  185.      * <b>then</b>     "'Advocate insight' page is dimmed and spinner image during the loading of the result is displayed" </br>
  186.      * <b>and</b>      "all existed in the system brands with assigned social account(s) are displayed correctly" </b>
  187.      * <b>and</b>      "text '<#number> brands with no social accounts associated' is displayed" </br>
  188.      * <b>when</b>     "user sets 'Region' type in the 'GroTup by:' drop-down menu" </br>
  189.      * <b>then</b>     "'Advocate insight' page is dimmed and spinner image during the loading of the result is displayed" </br>
  190.      * <b>and</b>      "all existed in the system regions with assigned social account(s) are displayed correctly" </br>
  191.      * <b>and</b>      "text '<#number> regions with no social accounts associated' is displayed" </br>
  192.      * <b>when</b>     "user sets 'Country' type in the 'Group by:' drop-down menu" </br>
  193.      * <b>then</b>     "'Advocate insight' page is dimmed and spinner image during the loading of the result is displayed" </br>
  194.      * <b>and</b>      "all existed in the system countries with assigned social account(s) are displayed correctly" </br>
  195.      * <b>and</b>      "text '<#number> countries with no social accounts associated' is displayed" </br>
  196.      * <b>when</b>     "user sets 'Subsidiary' type in the 'Group by:' drop-down menu" </br>
  197.      * <b>then</b>     "'Advocate insight' page is dimmed and spinner image during the loading of the result is displayed" </br>
  198.      * <b>and</b>      "all existed in the system subsidiaries with assigned social account(s) are displayed correctly" </br>
  199.      * <b>when</b>     "user sets 'Last activity' type in the 'Group by:' drop-down menu" </br>
  200.      * <b>then</b>     "'Advocate insight' page is dimmed and spinner image during the loading of the result is displayed" </br>
  201.      * <b>and</b>      "corresponding to the last activiy search request advocate account(s) is/are displayed correctly." </br>
  202.      * <b>and</b>      "text 'No known activity <#number>' is displayed" </br>
  203.      * <b>when</b>     "user sets 'Relationship' type in the 'Group by:' drop-down menu" </br>
  204.      * <b>then</b>     "'Advocate insight' page is dimmed and spinner image during the loading of the result is displayed" </br>
  205.      * <b>and</b>      "all existed in the system relationship(s) with and without account(s) is/are displayed correctly" </br>
  206.      * <b>when</b>     "user sets 'Tag' type in the 'Group by:' drop-down menu" </br>
  207.      * <b>then</b>     "'Advocate insight' page is dimmed and spinner image during the loading of the result is displayed" </br>
  208.      * <b>and<br>      "corresponding to the last activiy search request tag(s) is/are displayed correctly." </br>
  209.      * <b>and</b>      "text '<#number> Tags with no Social Accounts associated' is displayed" <br>
  210.      * QA-658
  211.      */
  212.    
  213.     @Test
  214.     public void groupingByEachTypeShouldReturnCorrectResultOnTheAvocatesPage(){
  215.         String dropDownLabelText;
  216.         boolean isGroupByValueCorrect;
  217.         ArrayList<String> platformsList;
  218.         ArrayList<String> togglesList;
  219.         boolean isContainsAll;
  220.         ArrayList<String> brandsList;
  221.         String notAssociatedText;
  222.         boolean checkNotAssociatedText;
  223.         ArrayList<String> regionsList;
  224.  
  225.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword);
  226.         dropDownLabelText = advocatesPage.getDropDownLabelText();
  227.         Assert.assertEquals("Group by:", dropDownLabelText);
  228.         isGroupByValueCorrect = advocatesPage.isGroupByValueCorrect("None");
  229.         Assert.assertTrue(isGroupByValueCorrect);
  230.         advocatesPage.selectNeededPivotFilter("Platform");
  231.         advocatesPage.clickOnPlatformsLink();
  232.         platformsList = advocatesPage.getPlatformsText();
  233.         togglesList = advocatesPage.getToggleNames();
  234.         isContainsAll = advocatesPage.isContainsAll(platformsList, togglesList);
  235.         Assert.assertTrue(isContainsAll);
  236.         advocatesPage.selectNeededPivotFilter("Brand");
  237.         advocatesPage.clickOnBrandsFilterLink();
  238.         brandsList = advocatesPage.getBrandsLabelsText();
  239.         togglesList = advocatesPage.getToggleNames();
  240.         isContainsAll = advocatesPage.isContainsAll(brandsList, togglesList);
  241.         Assert.assertTrue(isContainsAll);
  242.         notAssociatedText = advocatesPage.getTextFromNotAssociatedRow();
  243.         checkNotAssociatedText = notAssociatedText.contains("Brands with no Social Accounts associated");
  244.         Assert.assertTrue(checkNotAssociatedText);
  245.         advocatesPage.selectNeededPivotFilter("Region");
  246.         advocatesPage.clickOnRegionsFilterLink();
  247.         regionsList = advocatesPage.getRegionLabels();
  248.         togglesList =  advocatesPage.getToggleNames();
  249.         isContainsAll = advocatesPage.isContainsAll(regionsList, togglesList);
  250.         Assert.assertTrue(isContainsAll);
  251.     }
  252.    
  253.     /**
  254.      * <b>Scenario</b> "Close filter popup" </br>
  255.      * <b>given</b>    "User is on the 'Advocate Insight' page" </br>
  256.      * <b>when</b>     "user opens regions popup and press cancel link" </br>
  257.      * <b>then</b>     "filters popup is dissapear" </br>
  258.      *
  259.      */
  260.    
  261.     @Test
  262.     public void closeFilterPopup(){
  263.         boolean isRegionsFilterPopupDisplayed;
  264.  
  265.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola,qapassword);
  266.         regionsFilter = advocatesPage.clickOnRegionsFilter();
  267.         regionsFilter.clickOnCancelLink();
  268.         isRegionsFilterPopupDisplayed = regionsFilter.isRegionsFilterPopupDisplayed();
  269.         Assert.assertFalse(isRegionsFilterPopupDisplayed);
  270.     }
  271.    
  272.    
  273.     /**
  274.      * <b>Scenario</b> "2 different filters select" </br>
  275.      * <b>given</b>    "User is on the 'Advocate Insight' page" </br>
  276.      * <b>when</b>     "user selects 'Naked Juice' brands filter and 'North America' regions filter" </br>
  277.      * <b>then</b>     "social accounts with Naked Juice' brands and 'North America' regions are displayed" </br>
  278.      * QA-618 + QA-1084
  279.      */
  280.    
  281.     @Test
  282.     public void twoDifferentFiltersSelect(){
  283.         int accountsNumbers, accountsNumbersFromLabel;
  284.         String accountName, brandName, regionName;
  285.         boolean areAllSubsidiariesAreEqualToExpected;
  286.  
  287.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola,qapassword);
  288.         accountName = advocatesPage.getRandomAccountName();
  289.         advocatesPage.expandNeededAdvocateAccount(accountName);
  290.         advocatesPage.clickAssigmentsTabLink();
  291.         editAssignmentsForm = advocatesPage.clickEditAssigmentLink();
  292.         editAssignmentsForm.expandAll();
  293.         editAssignmentsForm.uncheckAllBoxes();
  294.         brandName = editAssignmentsForm.clickAndGetRandomBrand();
  295.         regionName = editAssignmentsForm.clickAndGetRandomCountry();
  296.         advocatesPage = editAssignmentsForm.clickSaveButton();     
  297.         advocatesPage.checkBrandsAndShowResult(brandName);
  298.         advocatesPage.checkRegionsAndShowResult(regionName);   
  299.         accountsNumbers = advocatesPage.getAccountsNumbers();
  300.         accountsNumbersFromLabel = advocatesPage.getAccountsNumberFromLabel();
  301.         Assert.assertEquals(accountsNumbersFromLabel, accountsNumbers);
  302.         areAllSubsidiariesAreEqualToExpected = advocatesPage.areAllSubsidiariesAreEqualToExpected(brandName, regionName, "Brands", "Regions", accountsNumbers);
  303.         Assert.assertTrue(areAllSubsidiariesAreEqualToExpected);
  304.     }
  305.    
  306.    
  307.     /**
  308.      * <b>Scenario</b> "Brands' filters work correctly" </br>
  309.      * <b>given</b>    "User is on the 'Advocate Insight' page" </br>
  310.      * <b>when</b>     "user selects 'Naked Juice' brands filter" </br>
  311.      * <b>then</b>     "only 'Naked Juice' social profile is displayed" </br>
  312.      * QA-618
  313.      */
  314.    
  315.     @Test
  316.     public void brandsFiltersWorkCorrectly(){
  317.         int accountsNumbers, realAccountsNumber;;
  318.         boolean areAllSubsidiariesAreEqualToExpected;
  319.         indexPage = new IndexPage(driver);
  320.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola,qapassword);
  321.         advocatesPage = advocatesPage.checkBrandsAndShowResult("Big Crush");
  322.         realAccountsNumber = advocatesPage.getRealAccountNumbers();
  323.         accountsNumbers = advocatesPage.getAccountsNumbers();
  324.         Assert.assertEquals(realAccountsNumber, accountsNumbers);
  325.         areAllSubsidiariesAreEqualToExpected = advocatesPage.areAllSubsidiariesAreEqualToExpected("Big Crush", "Brands", accountsNumbers);
  326.         Assert.assertTrue(areAllSubsidiariesAreEqualToExpected);
  327.     }
  328.    
  329.     /**
  330.      * <b>Scenario</b> "Additional accounts should be displayed in the employee governance after the [Show more accounts] link pressed" </br>
  331.      * <b>given</b>    "User is on the 'Social Business Graph' page" </br>
  332.      * <b>when</b>     "user clicks 'Advocate Insight' tab" </br>
  333.      * <b>then</b>     "'25' or less accounts should be shown" </br>
  334.      * <b>and</b>      "when [Show more accounts] link is pressed" </br>
  335.      * <b>then</b>     "additional accounts are displayed in the employee portfolio." </br>
  336.      * QA-662
  337.      */
  338.    
  339.     @Test
  340.     public void additionalAccountsShouldBeDisplayedInTheEmployeeGovernanceAfterTheShowMoreAccountsLinkPressed(){
  341.         boolean isAccountsOnPageCountValid;
  342.         boolean isMoreAccountsShown;
  343.    
  344.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword );
  345.         isAccountsOnPageCountValid = advocatesPage.isAccountsOnPageCountValid(25);
  346.         Assert.assertTrue(isAccountsOnPageCountValid);
  347.         advocatesPage.showMoreAccounts();
  348.         isMoreAccountsShown = advocatesPage.isMoreAccountsShown(25);
  349.         Assert.assertTrue(isMoreAccountsShown);
  350.     }
  351.    
  352.     /**
  353.      * <b>Scenario</b> "Removing account is working correctly" </br>
  354.      * <b>given</b>    "User is on the 'Advocates' page" </br>
  355.      * <b>when</b>     "user expands account" </br>
  356.      * <b>and</b>      "click on settings menu" </br>
  357.      * <b>and</b>      "clicks on'Remove account' link" </br>
  358.      * <b>then</b>     "[Remove account] form and [Close], [Yes], [No] buttons are displayed" </br>
  359.      * <b>when</b>     "user selects 'Permanently remove'" </br>
  360.      * <b>and</b>      "clicks [Yes] button" </br>
  361.      * <b>then</b>     "form 'Advocate account is removed' is displayed" </br>
  362.      * <b>when</b>     "user clicks [close] button" </br>
  363.      * <b>then</b>     "social account is removed." </br>
  364.      * QA-660
  365.      */
  366.    
  367.     @Test
  368.     public void removingAccountIsWorkingCorrectly(){
  369.        
  370.         String userName1 = "test56@dachisgroup.com";
  371.         String password1 = "Passw0rd!";
  372.        
  373.         String accountName;
  374.         boolean isFormDisplayed;
  375.         boolean isNameFormCorrect;
  376.         boolean isCloseButtonDisplayed;
  377.         boolean isYesButtonDisplayed;
  378.         boolean isNoButtonDisplayed;
  379.         boolean isAccountsAreShown;
  380.  
  381.         advocatesPage = indexPage.loginToAdvocatePage(qanokia, qapassword);
  382.         accountName = advocatesPage.clickRandomAdvocateAcc();
  383.         System.out.println(accountName);
  384.         advocatesPage.mouseOverAccountSettings();
  385.         removeAccountForm = advocatesPage.clickRemoveAccountLink();
  386.         isFormDisplayed = removeAccountForm.isFormDisplayed();
  387.         Assert.assertTrue(isFormDisplayed);
  388.        
  389.        
  390.         isNameFormCorrect = removeAccountForm.isNameFormCorrect("REMOVE ACCOUNT");
  391.         Assert.assertTrue(isNameFormCorrect);
  392.         isCloseButtonDisplayed = removeAccountForm.isCloseButtonDisplayed();
  393.         Assert.assertTrue(isCloseButtonDisplayed);
  394.         isYesButtonDisplayed = removeAccountForm.isYesButtonDisplayedOnAdvocate();
  395.         Assert.assertTrue(isYesButtonDisplayed);
  396.         isNoButtonDisplayed = removeAccountForm.isNoButtonDisplayed();
  397.         Assert.assertTrue(isNoButtonDisplayed);
  398.        
  399.         removeAccountForm.clickPermRadioButton();
  400.         removeAccountForm.clickYesButtonOnAdvocate();
  401.         isFormDisplayed = removeAccountForm.isFormDisplayed();
  402.         Assert.assertTrue(isFormDisplayed);
  403.         removeAccountForm.clickCloseButton();
  404.         advocatesPage.submitNewSearch(accountName);
  405.         isAccountsAreShown = advocatesPage.isAccountsAreShown(accountName);
  406.         Assert.assertFalse(isAccountsAreShown);
  407.     }
  408.    
  409.     /**
  410.      * <b>Scenario</b> "After clicking [No] button on the 'Remove account' form, user backs to the Advocate page" </br>
  411.      * <b>given</b>    "User is on the 'Advocates' page" </br>
  412.      * <b>when</b>     "user expands account" </br>
  413.      * <b>and</b>      "click on settings menu" </br>
  414.      * <b>and</b>      "clicks on'Remove account' link" </br>
  415.      * <b>and</b>      "clicks [No] button" </br>
  416.      * <b>then</b>     "advocate page is displayed." </br>
  417.      * QA-660
  418.      */
  419.    
  420.     @Test
  421.     public void afterClickingNoButtonOnTheRemoveAccountFormUserBacksToTheAdvocatePage(){
  422.         String accountName;
  423.         boolean isAdvocatesPageDisplayed, isAccountsAreShown;
  424.  
  425.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword);
  426.         accountName = advocatesPage.clickRandomAdvocateAcc();
  427.         advocatesPage.mouseOverAccountSettings();
  428.         removeAccountForm = advocatesPage.clickRemoveAccountLink();
  429.         advocatesPage = removeAccountForm.clickNoButtonInAdvocateAccMenu();
  430.         isAdvocatesPageDisplayed = advocatesPage.isAdvocatesPageDisplayed();
  431.         Assert.assertTrue(isAdvocatesPageDisplayed);
  432.         advocatesPage.submitNewSearch(accountName);
  433.         isAccountsAreShown = advocatesPage.isAccountsAreShown(accountName);
  434.         Assert.assertTrue(isAccountsAreShown);
  435.     }
  436.    
  437.     /**
  438.      * <b>Scenario</b> "Change advocate account to employee works correctly" </br>
  439.      * <b>given</b>    "User is on the 'Advocates' page" </br>
  440.      * <b>when</b>     "user expands random account" </br>
  441.      * <b>and</b>      "clicks on settings menu" </br>
  442.      * <b>and</b>      "clicks on 'Change to Employee' link" </br>
  443.      * <b>then</b>     "'Change this account to an Employee Account' form appears" </br>
  444.      * <b>and</b>      "[Close] / [Yes] / [No] buttons are displayed on the form correctly" </br>
  445.      * <b>when</b>     "user clicks [Yes] button" </br>
  446.      * <b>then</b>     "'Advocate account is changed to employee account' form appears" </br>
  447.      * <b>when</b>     "user clicks [Close] button on the appeared form" </br>
  448.      * <b>then</b>     "advocate account was changed to the employee" </br>
  449.      * <b>and</b>      "changed account has disappeared from the 'Advocate insight' page and appeared on the 'Employee portfolio' page." </br>
  450.      * QA-676
  451.      * @throws InterruptedException
  452.      */
  453.    
  454.     @Test
  455.     public void changeAdvocateAccountToEmployeeWorksCorrectly() throws InterruptedException{
  456.        
  457.         common.log("This script is being failed due to issue: SBI-3121");
  458.        
  459.         String accountName;
  460.         boolean isChangeToEmployeeFormDisplayed;
  461.         boolean isCloseButtonDisplayed;
  462.         boolean isYesButtonDisplayed;
  463.         boolean isNoButtonDisplayed;
  464.         boolean isChangeToEmployeeConfirmFormDisplayed;
  465.         boolean isAccountsAreShown;
  466.        
  467.         String username = "test56@dachisgroup.com";
  468.         String password = "Passw0rd!";
  469.  
  470.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword);
  471.         accountName = advocatesPage.clickRandomAdvocateAcc();
  472.         advocatesPage.mouseOverAccountSettings();
  473.         changeToEmployeeForm = advocatesPage.clickChangeToEmployeeLink();
  474.         isChangeToEmployeeFormDisplayed = changeToEmployeeForm.isChangeToEmployeeFormDisplayed("CHANGE THIS ACCOUNT TO AN EMPLOYEE ACCOUNT");
  475.         Assert.assertTrue(isChangeToEmployeeFormDisplayed);
  476.         isCloseButtonDisplayed = changeToEmployeeForm.isCloseButtonDisplayed();
  477.         Assert.assertTrue(isCloseButtonDisplayed);
  478.         isYesButtonDisplayed =changeToEmployeeForm.isYesButtonDisplayed();
  479.         Assert.assertTrue(isYesButtonDisplayed);
  480.         isNoButtonDisplayed = changeToEmployeeForm.isNoButtonDisplayed();
  481.         Assert.assertTrue(isNoButtonDisplayed);
  482.         accountIsChangeForm = changeToEmployeeForm.clickYesButton();
  483.         isChangeToEmployeeConfirmFormDisplayed = accountIsChangeForm.isChangeToEmployeeConfirmFormDisplayed("ADVOCATE ACCOUNT CHANGED TO EMPLOYEE ACCOUNT");       
  484.         Assert.assertTrue(isChangeToEmployeeConfirmFormDisplayed);
  485.         advocatesPage = accountIsChangeForm.clickCloseButton();
  486.         advocatesPage.submitNewSearch(accountName);
  487.         isAccountsAreShown = advocatesPage.isAccountsAreShown(accountName);
  488.         Assert.assertFalse(isAccountsAreShown);
  489.         employeePortfolioPage = advocatesPage.clickEmployeePortfolioLink();
  490.         employeePortfolioPage.searchEmployee(accountName);
  491.         isAccountsAreShown = employeePortfolioPage.isAccountsAreShown(accountName);
  492.         Assert.assertTrue(isAccountsAreShown); 
  493.     }
  494.    
  495.     /**
  496.      * <b>Scenario</b> "Search by name is working correctly" </br>
  497.      * <b>given</b>    "User is on the 'Advocates' page" </br>
  498.      * <b>when</b>     "user enter account name in the search field" </br>
  499.      * <b>then</b>     "search result according to the search criteria is displayed correctly." </br>
  500.      * QA-678
  501.      */
  502.    
  503.     @Test
  504.     public void searchByNameIsWorkingCorrectly(){
  505.         String accountName;
  506.         boolean isSearchWork;
  507.  
  508.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword);
  509.         accountName = advocatesPage.getRandomAccountName();
  510.         advocatesPage.submitNewSearch(accountName);
  511.         isSearchWork = advocatesPage.isSearchWork(accountName);
  512.         Assert.assertTrue(isSearchWork);
  513.     }
  514.    
  515.     /**
  516.      * <b>Scenario</b> "Remove filter is working correctly" </br>
  517.      * <b>given</b>    "User is on the 'Advocate Insight' page" </br>
  518.      * <b>when</b>     "user selects 'Naked Juice' brands filter" </br>
  519.      * <b>then</b>     "the number of clear filter tabs should be 1" </br>
  520.      * <b>when</b>     "user remove filter" </br>
  521.      * <b>then</b>     "all accounts which were present before filter removed are shown"
  522.      * QA-618
  523.      */
  524.    
  525.     @Test
  526.     public void removeFilterIsWorkingCorrectly(){
  527.         int accountsNumber;
  528.         int clearFilterNumbers;
  529.         int accountsNumbers;
  530.  
  531.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola,qapassword);
  532.         accountsNumber = advocatesPage.getAccountsNumbers();
  533.         advocatesPage = advocatesPage.checkBrandsAndShowResult("Big Crush");
  534.         clearFilterNumbers = advocatesPage.getClearFilterNumbers();
  535.         Assert.assertEquals(1, clearFilterNumbers);
  536.         advocatesPage.removeAllFilters();
  537.         accountsNumbers = advocatesPage.getAccountsNumbers();
  538.         Assert.assertEquals(accountsNumber, accountsNumbers);
  539.     }
  540.    
  541.    
  542.     /**
  543.      * <b>Scenario</b> "Search functionality is working correctly" </br>
  544.      * <b>given</b>    "User is on the 'Advocate Insight' page" </br>
  545.      * <b>when</b>     "user inputs account name in the search field" </br>
  546.      * <b>then</b>     "Verify that only account expected is represented in the list" </br>
  547.      * QA-621
  548.      */
  549.    
  550.     @Test
  551.     public void searchFunctionalityIsWorkingCorrectly(){
  552.         String accountName;
  553.         int accountsNumbers;
  554.         String getFirstAccountName;
  555.        
  556.         String username = "test56@dachisgroup.com";
  557.         String password = "Passw0rd!";
  558.  
  559.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola,qapassword);
  560.         accountName = advocatesPage.getRandomAccountName();
  561.         advocatesPage.submitNewSearch(accountName);
  562.         accountsNumbers = advocatesPage.getAccountsNumbers();
  563.         Assert.assertEquals(1, accountsNumbers);
  564.         getFirstAccountName = advocatesPage.getFirstAccountName();
  565.         Assert.assertEquals(accountName, getFirstAccountName);
  566.     }
  567.    
  568.    
  569.     /**
  570.      * <b>Scenario</b> "Edit and Save Account Info with empty fields" </br>
  571.      * <b>given</b>    "User is on the 'Advocate Insight' page" </br>
  572.      * <b>when</b>     "user opens social account" </br>
  573.      * <b>and</b>      "clicks on [Edit Account Info] link" </br>
  574.      * <b>then</b>     "[Edit Account] form appears" </br>
  575.      * <b>when</b>     "user erased all required data" </br>
  576.      * <b>and</b>      "presses [Save and Close] button" </br>
  577.      * <b>then</b>     "error notification appears" </br>
  578.      * QA-619
  579.      */
  580.     @Test
  581.     public void editAndSaveAccountInfoWithEmptyFields(){
  582.         String formHeaderText; 
  583.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola,qapassword);
  584.         String accName = advocatesPage.getRandomAccountName();
  585.         advocatesPage.submitNewSearch(accName);
  586.         advocatesPage.clickRandomAdvocateAcc();
  587.         editAccountInfoForm = advocatesPage.clickEditAccountInfoLink();
  588.         formHeaderText = editAccountInfoForm.getFormHeaderText();
  589.         Assert.assertEquals("Social Account Setup", formHeaderText);
  590.         editAccountInfoForm.clearAccountInfoSection();
  591.         editAccountInfoForm.clickSaveAndCloseButton(); 
  592.     }
  593.    
  594.    
  595.     /**
  596.      * <b>Scenario</b> "Cancel feature on Edit Account Info form" </br>
  597.      * <b>given</b>    "User is on the 'Advocate Insight' page" </br>
  598.      * <b>when</b>     "clicks on [Edit Account Info] link from account details section" </br>
  599.      * <b>and</b>      "user changes all data" </br>
  600.      * <b>and</b>      "presses [Cancel] button" </br>
  601.      * <b>then</b>     "changes were not saved" </br>
  602.      */
  603.     @Test
  604.     public void cancelFeatureOnEditAccountInfoForm(){      
  605.         String accountInfo, updatedAccountInfo;
  606.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola,qapassword);
  607.         advocatesPage.clickRandomAdvocateAcc();
  608.         accountInfo = advocatesPage.getAccountInfo();
  609.         editAccountInfoForm = advocatesPage.clickEditAccountInfoLink();
  610.         editAccountInfoForm.fillAccountInfoSection(name, "description" , "url");
  611.         advocatesPage = editAccountInfoForm.clickCancelButton();
  612.         updatedAccountInfo = advocatesPage.getAccountInfo();
  613.         accountInfo.equals(updatedAccountInfo);
  614.         Assert.assertEquals(updatedAccountInfo, accountInfo);
  615.     }
  616.    
  617.    
  618.     /**
  619.      * <b>Scenario</b> "Close feature on Edit Account Info form" </br>
  620.      * <b>given</b>    "User is on the 'Advocate Insight' page" </br>
  621.      * <b>when</b>     "clicks on [Edit Account Info] link from random account details section" </br>
  622.      * <b>and</b>      "user changes all data" </br>
  623.      * <b>and</b>      "presses [Close] button" </br>
  624.      * <b>then</b>     "changes were not saved" </br>
  625.      * QA-619
  626.      */
  627.    
  628.     @Test
  629.     public void closeFeatureOnEditAccountInfoForm(){
  630.         String accountInfo, updatedAccountInfo;
  631.  
  632.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola,qapassword);
  633.         advocatesPage.clickRandomAdvocateAcc();
  634.         accountInfo = advocatesPage.getAccountInfo();
  635.         editAccountInfoForm = advocatesPage.clickEditAccountInfoLink();
  636.         editAccountInfoForm.fillAccountInfoSection(name, "description" , "url");
  637.         advocatesPage = editAccountInfoForm.clickCloseButton();
  638.         updatedAccountInfo = advocatesPage.getAccountInfo();
  639.         accountInfo.equals(updatedAccountInfo);
  640.         Assert.assertEquals(updatedAccountInfo, accountInfo);
  641.     }
  642.    
  643.    
  644.     /**
  645.      * <b>Scenario</b> "Edit Account Info feature" </br>
  646.      * <b>given</b>    "User is on the 'Advocate Insight' page" </br>
  647.      * <b>when</b>     "clicks on [Edit Account Info] link from random account details section" </br>
  648.      * <b>and</b>      "user changes all data" </br>
  649.      * <b>and</b>      "presses [Save and Close] button" </br>
  650.      * <b>then</b>     "changes were successfully saved" </br>
  651.      * QA-619
  652.      */
  653.    
  654.     @Test
  655.     public void editAccountInfoFeature(){
  656.         String updatedAccountInfo;
  657.         boolean isContainUrl;
  658.         boolean isContainDiscriprion;
  659.  
  660.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola,qapassword);
  661.         advocatesPage.clickRandomAdvocateAcc();
  662.         editAccountInfoForm = advocatesPage.clickEditAccountInfoLink();
  663.         editAccountInfoForm.fillAccountInfoSection(name, "" , "");
  664.         advocatesPage = editAccountInfoForm.clickSaveAndCloseButton();
  665.         advocatesPage.submitNewSearch(name);
  666.         advocatesPage.clickRandomAdvocateAcc();
  667.         updatedAccountInfo = advocatesPage.getAccountInfo();
  668.         isContainDiscriprion = updatedAccountInfo.contains("");
  669.         Assert.assertTrue(isContainDiscriprion);
  670.         isContainUrl = updatedAccountInfo.contains("");
  671.         Assert.assertTrue(isContainUrl);
  672.     }
  673.    
  674.    
  675.     /**
  676.      * <b>Scenario</b> "Exported accounts data should be the same as accounts data on the Advocates Page" </br>
  677.      * <b>given</b>    "User is on the 'Advocates' page" </br>
  678.      * <b>when</b>     "clicks 'Show more accounts link'" </br>
  679.      * <b>and</b>      "user mouses over 'Settings' image and clicks 'Export Result' link" </br>
  680.      * <b>then</b>     "'Export Results to Excel' window appears" </br>
  681.      * <b>and</b>      "file with data is downloaded correctly" </br>
  682.      * <b>and</b>      "exported account data are the same as on Advocates Page."
  683.      * SBI-1751
  684.      * @throws IOException
  685.      * @throws BiffException
  686.      */
  687.    
  688.     @Test
  689.     public void exportedAccountsDataShouldBeTheSameAsAccountsDataOnTheAdvocatesPage() throws BiffException, IOException{
  690.         String exportWindowTitle;
  691.         boolean isAccountsAreExported;
  692.    
  693.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword);
  694.         advocatesPage.clickAccountSortLink();      
  695.         advocatesPage.clickShowAllAccs();
  696.         ArrayList<String> accounts = advocatesPage.getAccountsData();
  697.         advocatesPage.mouseOverSettingsImage();
  698.         advocatesPage.clickSettingsImage();
  699.         advocatesPage.clickExportLink();
  700.         exportWindowTitle = advocatesPage.exportWindowTitle();
  701.         Assert.assertEquals("EXPORT RESULTS TO EXCEL", exportWindowTitle);
  702.         ArrayList<String> accountsFromXml = common.getAccountsInfoFromXlsFile("C:\\accounts.xls",2);
  703.         isAccountsAreExported = advocatesPage.isAccountsAreExported(accounts, accountsFromXml);
  704.         Assert.assertTrue(isAccountsAreExported);
  705.     }
  706.    
  707.    
  708.    
  709.     /**
  710.      * <b>Scenario</b> "User is able to add and delete tag in 'Attributes (Tags)' column" </br>
  711.      * <b>given</b>    "User is on employee Portfolio Page" </br>
  712.      * <b>when</b>     "user clicks on tag" </br>
  713.      * <b>then</b>     "'Add tag' form is displayed" </br>
  714.      * <b>when</b>     "user adds tag" </br>
  715.      * <b>then</b>     "tag was added" </br>
  716.      * <b>and</b>      "tag number increased." </b>
  717.      * <b>when</b>     "user deletes tag" </b>
  718.      * <b>then</b>     "tag was deleted" </b>
  719.      * <b>and</b>      "tag number decreased." </br>
  720.      * QA-655
  721.      */
  722.    
  723.     @Test
  724.     public void userIsAbleToAddAndDeleteTagInAttributesTagsColumn(){
  725.         int difference;
  726.         boolean isAddTagFormDisplayed;
  727.         boolean isTagAdded;
  728.         int tagNumberAfter;
  729.         int tagNumberBefore;
  730.  
  731.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword);
  732.         String accountName = advocatesPage.getRandomSocialAccountName();
  733.         tagNumberBefore = advocatesPage.getTagNumber(accountName);
  734.         attributeTagForm = advocatesPage.clickTag(accountName);
  735.         isAddTagFormDisplayed = attributeTagForm.isAddTagFormDisplayed();
  736.         Assert.assertTrue(isAddTagFormDisplayed);
  737.         attributeTagForm.setTag("Test" +time);
  738.         tagNumberAfter = advocatesPage.getTagNumber(accountName);
  739.         isTagAdded = attributeTagForm.isTagAdded("Test" +time);
  740.         Assert.assertTrue(isTagAdded);
  741.         attributeTagForm.closeAddTagForm();
  742.         difference = tagNumberAfter-tagNumberBefore;
  743.         Assert.assertEquals(1, difference);
  744.         attributeTagForm = advocatesPage.clickTag(accountName);
  745.         attributeTagForm.deleteTag("Test" +time);
  746.         isTagAdded = attributeTagForm.isTagAdded("Test" +time);
  747.         Assert.assertFalse(isTagAdded);
  748.         attributeTagForm.closeAddTagForm();
  749.         tagNumberAfter = advocatesPage.getTagNumber(accountName);
  750.         difference = tagNumberAfter-tagNumberBefore;
  751.         Assert.assertEquals(0, difference);
  752.     }
  753.    
  754.    
  755.     /**
  756.      * <b>Scenario</b> "User is able to add and delete tag on the employee social profile details" </br>
  757.      * <b>given</b>    "User is on employee Portfolio Page" </br>
  758.      * <b>when</b>     "user expands social employee details" </br>
  759.      * <b>and</b>      "adds tag" </br>
  760.      * <b>then</b>     "tag was added" </B>
  761.      * <b>and</b>      "tag number increased on the 'Tags' tab" </br>
  762.      * <b>when</b>     "user deletes tag" </br>
  763.      * <b>then</b>     "tag was deleted" </br>
  764.      * <b>and</b>      "tag number decreased." </br>
  765.      * QA-655
  766.      */
  767.    
  768.     @Test
  769.     public void userIsAbleToAddAndDeleteTagOnTheEmployeeSocialProfileDetails(){
  770.         boolean isTagAdded;
  771.  
  772.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword);     
  773.         String accountName = advocatesPage.getRandomSocialAccountName();   
  774.         advocatesPage.submitNewSearch(accountName);
  775.         advocatesPage.clickSpecifiedName(accountName);
  776.         advocatesPage.clickTagsTab();
  777.         advocatesPage.addTag("Test" +time);
  778.         isTagAdded = advocatesPage.isTagAdded("Test" +time);
  779.         Assert.assertTrue(isTagAdded);//   
  780.         advocatesPage.deleteTag("Test" +time);
  781.         isTagAdded = advocatesPage.isTagAdded("Test" +time);
  782.         Assert.assertFalse(isTagAdded);
  783. //     
  784.     }
  785.    
  786.    
  787.     /**
  788.      * <b>Scenario</b> "User is able to add notes in Advocate account" </br>
  789.      * <b>given</b>    "User is on Advocate Insight Page" </br>
  790.      * <b>when</b>     "user clicks on an advocate account" </br>
  791.      * <b>and</b>      "adds a note" </br>
  792.      * <b>and</b>      "clicks on add author note button" </br>
  793.      * <b>then</b>     "note was added at top place" </B>
  794.      * <b>when</b>     "adds another note" </br>
  795.      * <b>and</b>      "clicks on add author note button" </br>
  796.      * <b>then</b>     "note was added at top place" </br>
  797.      * <b>and</b>      "previous note was shifted to second place" </br>
  798.      * QA-703
  799.      */
  800.     @Test
  801.     public void userCanAddNotes(){
  802.    
  803.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword);
  804.         String accountName = advocatesPage.getRandomSocialAccountName();
  805.         System.out.println(accountName);
  806.         advocatesPage.clickSpecifiedName(accountName);
  807.         String randomNote1 = common.generateRandomChars(5) + " " + common.generateRandomSymbols(7);
  808.         advocatesPage.addAuthorNote(randomNote1);
  809.         Assert.assertTrue(advocatesPage.isNoteDisplayed(randomNote1));
  810.        
  811.         String randomNote2 = common.generateRandomChars(5) + " " + common.generateRandomSymbols(7);
  812.         advocatesPage.addAuthorNote(randomNote2);
  813.         Assert.assertTrue(advocatesPage.isNoteDisplayed(randomNote2));
  814.        
  815.     }
  816.  
  817.    
  818.     /**
  819.      * <b>Scenario</b> "User is able to delete notes in Advocate account" </br>
  820.      * <b>given</b>    "User is on Advocate Insight Page" </br>
  821.      * <b>when</b>     "user clicks on an advocate account" </br>
  822.      * <b>and</b>      "adds a note" </br>
  823.      * <b>and</b>      "clicks on add author note button" </br>
  824.      * <b>then</b>     "note was added at top place" </B>
  825.      * <b>and</b>      "adding date was current date" </br>
  826.      * <b>and</b>      "authour's name was same as logged-in user" </br>
  827.      * <b>when</b>     "user clicks on delete note button" </br>
  828.      * <b>then</b>     "note was deleted" </br>
  829.      * QA-705
  830.      */
  831.     @Test
  832.     public void userCanDeleteNotes(){
  833.  
  834.         advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword);
  835.         String accountName = advocatesPage.getRandomSocialAccountName();
  836.         advocatesPage.clickSpecifiedName(accountName);
  837.         String randomNote = common.generateRandomChars(5) + " " + common.generateRandomSymbols(7);
  838.         advocatesPage.addAuthorNote(randomNote);
  839.         WebElement notes = driver.findElement(
  840.                 By.xpath("//p[@class='noteText']/span[normalize-space(text())='"+randomNote+"']"));
  841.         boolean isAuthorNotePresent=common.isElementPresent(notes);
  842.         Assert.assertTrue(isAuthorNotePresent);
  843.        
  844.         // Verify author name in note.
  845.         String welcomeText = driver.findElement(By.xpath("//li[@id='dachisgroupHome']/../li[2]")).getText();
  846.         String loggedUser = welcomeText.substring(welcomeText.indexOf(" ")+1);
  847.         boolean isAuthorNameCorrect = common.isElementPresent(
  848.                 driver.findElement(By.xpath("//p[@class='noteText']/span[normalize-space(text())='"+randomNote+"']"+
  849.                 "/../../div/b[@class='noteName'][text()='"+loggedUser+"']")));
  850.         Assert.assertTrue(isAuthorNameCorrect);
  851.        
  852.         // Verify date in note.
  853.         String noteDate = common.dateForNotes(new Date());     
  854.         boolean isRandomNotePresent = advocatesPage.isRandomNotePresent(randomNote);
  855.         boolean isRandomDatePresent = advocatesPage.isDatePresent(noteDate, randomNote);       
  856.         Assert.assertTrue(isRandomNotePresent);
  857.         Assert.assertTrue(isRandomDatePresent);
  858.        
  859.         advocatesPage.deleteAuthorNote(randomNote);
  860.        
  861.         try {
  862.             driver.findElement(By.xpath("//p[@class='noteText']/span[normalize-space(text())='"+randomNote+"']"));
  863.         } catch (NoSuchElementException noSuchElementException) {
  864.             isAuthorNotePresent = false;
  865.         }
  866.         Assert.assertFalse(isAuthorNotePresent);
  867.        
  868.     }
  869.    
  870.    
  871.         /**
  872.          * <b>Scenario</b> "User is able to add notes in Advocate account" </br>
  873.          * <b>given</b>    "User is on Advocate Insight Page" </br>
  874.          * <b>when</b>     "user clicks on an advocate account" </br>
  875.          * <b>and</b>      "adds a note" </br>
  876.          * <b>and</b>      "clicks on add author note button" </br>
  877.          * <b>then</b>     "note was added at top place" </B>
  878.          * <b>and</b>      "clicks on edit author note button" </br>
  879.          * <b>then</b>     "updates the notes" </br>
  880.          * <b>and</b>      "clicks on add author note button" </br>
  881.          * <b>and</b>      "note was updated at top place" </br>
  882.          * QA-704
  883.          */
  884.    
  885.         @Test
  886.         public void userCanEditNotes(){
  887.                
  888.             advocatesPage = indexPage.loginToAdvocatePage(qacocacola, qapassword);
  889.             String accountName = advocatesPage.getRandomSocialAccountName();
  890.             advocatesPage.clickSpecifiedName(accountName);
  891.             String randomNote = common.generateRandomChars(7) + " " + common.generateRandomSymbols(8);
  892.             advocatesPage.addAuthorNote(randomNote);
  893.             advocatesPage.isNoteDisplayed(randomNote);
  894.             Assert.assertTrue(advocatesPage.isNoteDisplayed(randomNote));
  895.             String randomEditNote = common.generateRandomChars(7) + " " + common.generateRandomSymbols(8);
  896.             advocatesPage.editAuthorNote( randomNote , randomEditNote );
  897.             common.pause(2000);
  898.             Assert.assertTrue(advocatesPage.isNoteDisplayed(randomEditNote));
  899.     }
  900. }
Add Comment
Please, Sign In to add comment