public void LookupAccountDetail_Facebook() { //Get four specified campaigns form Customized Campaign Array string[] gettingcampaignArray = UITestFramework.Object.Campaign.GetCampaignArray(); TestHelper.GetCampaignArray(gettingcampaignArray); //Prepare download Performance data Facebook.UITestFramework.UIMaps.PerformanceDataClasses.PerformanceData performanceData = new UITestFramework.UIMaps.PerformanceDataClasses.PerformanceData(); TestHelper.PrepareDownloadPerformanceData(performanceData); //Get Date range from GridViewTable cell Common.UITestFramework.UIMaps.DetailedInfoForDownloadClasses.DetailedInfoForDownload performanceDataInfo = new Common.UITestFramework.UIMaps.DetailedInfoForDownloadClasses.DetailedInfoForDownload(); performanceDataInfo.UIDetailedInfoforDownlWindow1.WaitForControlExist(); string performanceDateRange; TestHelper.GetPerformanceDateRange(performanceDataInfo, out performanceDateRange); //Downloading performance data and verify it TestHelper.DownloadPerformanceData(performanceDataInfo, performanceDateRange, performanceDataInfo.VerifyDownloadPerformanceData); //Get Performance data from datagrid view performanceData.ClickAccountDetailTab(); WinRow performanceRow; DataRow[] rows; string specifiedFileName = ConfigurationManager.AppSettings.Get("TopCampaignCSV"); Facebook.UITestFramework.UIMaps.PerformanceDataClasses.PerformanceData performancePanel = new UITestFramework.UIMaps.PerformanceDataClasses.PerformanceData(); foreach (string campaignName in gettingcampaignArray) { performancePanel.UIAccount2348004880USDWindow.UIItemWindow.UIItemTable.UIDataPanelClient.TryGetOneRowByName( performancePanel.UIAccount2348004880USDWindow.UIItemWindow.UIRow1Row, campaignName, out performanceRow); Facebook.UITestFramework.Object.AccountDetails campaignObjectInGrid = Facebook.UITestFramework.Object.AccountDetails.Parse(performanceRow); rows = TestHelper.GetPerformanceDataFromCSV(campaignName, specifiedFileName); Facebook.UITestFramework.Object.AccountDetails campaignPerformanceInCSV = Facebook.UITestFramework.Object.AccountDetails.FetchPerformance(rows); if (campaignPerformanceInCSV != null) { Assert.AreEqual<Facebook.UITestFramework.Object.AccountDetails>(campaignPerformanceInCSV, campaignObjectInGrid, "The Facebook campaign performance datas are not correct!!"); } } //Drag the ScrollBar Mouse.MoveScrollWheel(performanceData.UIAccount2348004880USDWindow.UIItemWindow2.UIVerticalScrollBar.UIPositionIndicator, 1, System.Windows.Input.ModifierKeys.None); specifiedFileName = ConfigurationManager.AppSettings.Get("TopAdsCSV"); foreach (string campaignName in gettingcampaignArray) { performancePanel.UIAccount2348004880USDWindow.UIItemWindow.UIItemTable.UIDataPanelClient.TryGetOneRowByName( performancePanel.UIAccount2348004880USDWindow.UIItemWindow1.UIItemTable.UIDataPanelClient.UIRow1Row, campaignName, out performanceRow); Facebook.UITestFramework.Object.AccountDetails campaignObjectInGrid = Facebook.UITestFramework.Object.AccountDetails.Parse(performanceRow); rows = TestHelper.GetPerformanceDataFromCSV(campaignName, specifiedFileName); Facebook.UITestFramework.Object.AccountDetails campaignPerformanceInCSV = Facebook.UITestFramework.Object.AccountDetails.FetchPerformance(rows); if (campaignPerformanceInCSV != null) { Assert.AreEqual<Facebook.UITestFramework.Object.AccountDetails>(campaignPerformanceInCSV, campaignObjectInGrid, "The Facebook campaign performance datas are not correct!!"); } } }
public void LookupAdsPerformanceData_Facebook() { //Get four specified campaigns form Customized Campaign Array string[] gettingcampaignArray = UITestFramework.Object.Campaign.GetCampaignArray(); TestHelper.GetCampaignArray(gettingcampaignArray); //Prepare download Performance data Facebook.UITestFramework.UIMaps.PerformanceDataClasses.PerformanceData performanceData = new UITestFramework.UIMaps.PerformanceDataClasses.PerformanceData(); TestHelper.PrepareDownloadPerformanceData(performanceData); //Get Date range from GridViewTable cell Common.UITestFramework.UIMaps.DetailedInfoForDownloadClasses.DetailedInfoForDownload performanceDataInfo = new Common.UITestFramework.UIMaps.DetailedInfoForDownloadClasses.DetailedInfoForDownload(); performanceDataInfo.UIDetailedInfoforDownlWindow1.WaitForControlExist(); string performanceDateRange; TestHelper.GetPerformanceDateRange(performanceDataInfo, out performanceDateRange); //Downloading performance data and verify it TestHelper.DownloadPerformanceData(performanceDataInfo, performanceDateRange, performanceDataInfo.VerifyDownloadPerformanceData); //Get Performance data from datagrid view performanceData.ClickAdsTab(); List<WinRow> performanceRows = new List<WinRow>(); DataRow[] rows; string specifiedFileName = ConfigurationManager.AppSettings.Get("AdsCSV"); Facebook.UITestFramework.UIMaps.PerformanceDataClasses.PerformanceData performancePanel = new UITestFramework.UIMaps.PerformanceDataClasses.PerformanceData(); Facebook.UITestFramework.Object.AdsPerformance oneRowInGrid = null; Facebook.UITestFramework.Object.AdsPerformance oneRowInCSV = null; foreach (string campaignName in gettingcampaignArray) { performancePanel.UIAccount2348004880USDWindow.UIItemWindow.UIItemTable.UIDataPanelClient.TryGetSomeRowsByName( performancePanel.UIAccount2348004880USDWindow.UIItemWindow.UINewItemRowRow, campaignName, performanceRows); Facebook.UITestFramework.Object.AdsPerformance[] campaignObjectInGrid = Facebook.UITestFramework.Object.AdsPerformance.Parse(performanceRows); rows = TestHelper.GetPerformanceDataFromCSV(campaignName, specifiedFileName); Facebook.UITestFramework.Object.AdsPerformance[] campaignPerformanceInCSV = Facebook.UITestFramework.Object.AdsPerformance.FetchPerformance(rows); for (int i = 0; i < rows.Length; i++) { oneRowInCSV = campaignPerformanceInCSV[i]; oneRowInGrid = campaignObjectInGrid[i]; Assert.AreEqual<Facebook.UITestFramework.Object.AdsPerformance>(oneRowInCSV, oneRowInGrid, "The Facebook campaign performance datas are not correct!!"); } } }
public void LookupAccountSummary_Facebook() { //Get four specified campaigns form Customized Campaign Array string[] gettingcampaignArray = UITestFramework.Object.Campaign.GetCampaignArray(); TestHelper.GetCampaignArray(gettingcampaignArray); //Prepare download Performance data Facebook.UITestFramework.UIMaps.PerformanceDataClasses.PerformanceData performanceData = new UITestFramework.UIMaps.PerformanceDataClasses.PerformanceData(); TestHelper.PrepareDownloadPerformanceData(performanceData); //Get Date range from GridViewTable cell Common.UITestFramework.UIMaps.DetailedInfoForDownloadClasses.DetailedInfoForDownload performanceDataInfo = new Common.UITestFramework.UIMaps.DetailedInfoForDownloadClasses.DetailedInfoForDownload(); performanceDataInfo.UIDetailedInfoforDownlWindow1.WaitForControlExist(); string performanceDateRange; TestHelper.GetPerformanceDateRange(performanceDataInfo, out performanceDateRange); //Downloading performance data and verify it TestHelper.DownloadPerformanceData(performanceDataInfo, performanceDateRange, performanceDataInfo.VerifyDownloadPerformanceData); //Get Performance data from datagrid view performanceData.ClickCampaignsTab(); WinRow performanceRow; DataRow[] rows; string specifiedFileName = ConfigurationManager.AppSettings.Get("AccountSummaryCSV"); Facebook.UITestFramework.UIMaps.PerformanceDataClasses.PerformanceData performancePanel = new UITestFramework.UIMaps.PerformanceDataClasses.PerformanceData(); foreach (string campaignName in gettingcampaignArray) { performancePanel.UIAccount2348004880USDWindow.UIItemWindow.UIItemTable.UIDataPanelClient.TryGetOneRowByName( performancePanel.UIAccount2348004880USDWindow.UIGrdCtrSummaryWindow.UINoadsinthiscampaignrTable.UIDataPanelClient.UIRow1Row, campaignName, out performanceRow); Facebook.UITestFramework.Object.AccountSummary campaignObjectInGrid = Facebook.UITestFramework.Object.AccountSummary.Parse(performanceRow); rows = TestHelper.GetPerformanceDataFromCSV(campaignName, specifiedFileName); Facebook.UITestFramework.Object.AccountSummary campaignPerformanceInCSV = Facebook.UITestFramework.Object.AccountSummary.FetchPerformance(rows); if (campaignPerformanceInCSV != null) { Assert.AreEqual<Facebook.UITestFramework.Object.AccountSummary>(campaignPerformanceInCSV, campaignObjectInGrid, "The Facebook campaign performance datas are not correct!!"); } } }