public void CollapseAll() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); if (this.CollapseAllActive()) { Wait.ForRollerOnReportsToGoAway(); this.CollapseAllLevelsLink.Click(); Wait.ForRollerOnReportsToGoAway(); var isActive = this.CollapseAllActive(); Assert.IsFalse(isActive); } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); }
public void CheckDrillDownCollapse() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); var rowCount = this.GetReportRowElementsCount(); while (this.DrillDownCollapse.Count() > 0) { this.DrillDownCollapse.Click(); Wait.ForRollerOnReportsToGoAway(); var rowCountAfterDrillDownClick = this.GetReportRowElementsCount(); Assert.Less(rowCountAfterDrillDownClick, rowCount); rowCount = rowCountAfterDrillDownClick; } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); }
public void AcceptDisclaimerIfNotAcceptedYet() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); Wait.StandardWait(); Wait.Until(d => d.FindElement(By.CssSelector("mi-root > router-outlet"))); if (this.Disclaimer.GetIfAvaiable() != null) { this.Accept.Click(); } Wait.ForDocumentLoaded(); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); }
public string ChangeVtAndGetNewValue() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); string selectedVt = this.SingleVtButton.GetText(); this.SingleVtButton.Click(); Button newVtLocator = new Button(By.XPath($"//div[contains(text(),'{selectedVt}')]//following-sibling::div")); string newVtName = newVtLocator.GetText(); newVtLocator.Click(); Wait.ForRollerOnReportsToGoAway(); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(newVtName); }
public ReportsPage OpenReport(string reportName, string cluster = null) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name, reportName, cluster); Navigate.ToMiDashboardReports(); if (ValidateReportAlreadyOpened(reportName, cluster)) { return(new ReportsPage()); } this.OpenReportNext(reportName, cluster); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name, reportName, cluster); return(new ReportsPage()); }
public ReportsPage OpenReportNext(string reportName, string cluster = null) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name, reportName, cluster); if (reportName.Contains("13m")) { this.Reports.OpenThirteenMonths(reportName, cluster); } else { this.Reports.Open(reportName, cluster); } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name, reportName, cluster); return(new ReportsPage()); }
public TimePeriodsPage VerifyLayoutForMonthlyView() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); Assert.IsTrue(this.MonthlyButton.IsVisible()); Assert.IsTrue(this.YtdButton.IsVisible()); Assert.IsTrue(this.ValidateMonthlyIsSelected()); Assert.IsTrue(this.CancelButton.IsVisible()); Assert.IsTrue(this.SubmitButton.IsVisible()); Assert.IsTrue(this.XButton.IsVisible()); Assert.IsTrue(this.Last13MonthsButton.IsVisible()); Assert.IsTrue(this.CurrentYearButton.IsVisible()); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }
public void SingleVtSelectionSearchResult() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); this.SingleVtButton.Click(); ReadOnlyCollection <IWebElement> vtsBeforeSearch = this.elementHelpers.FindElements(ReportHeaderLocators.SingleVtListItem); this.elementHelpers.SendKeys(ReportHeaderLocators.SingleVtSearchInput, "mortgage"); ElementHelpers.Clear(ReportHeaderLocators.SingleVtSearchInput); ReadOnlyCollection <IWebElement> vtsAfterSearch = this.elementHelpers.FindElements(ReportHeaderLocators.SingleVtListItem); this.SingleVtButton.Click(); Assert.AreEqual(vtsBeforeSearch.Count, vtsAfterSearch.Count); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); }
public ValueTypesPage VerifyUncheckedCheckboxesCannotBeClickedAndGray() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); var count = this.SearchResultUncheckedCheckboxes.Count(); var counter = new Random().Next(1, count / 10); for (var index = 0; index < counter; index++) { var randomValueTypeNumber = new Random().Next(1, count - index); Assert.IsTrue(this.SearchResultUncheckedCheckboxes.Disabled(randomValueTypeNumber)); } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }
public ReportsPage GoToPreviousPage() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); var startPage = this.CurrentPageInput.GetValue(); this.PreviousPage.Click(); Wait.ForRollerOnReportsToGoAway(); var endPage = this.CurrentPageInput.GetValue(); Assert.AreEqual(int.Parse(startPage) - 1, int.Parse(endPage)); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }
public ValueTypesPage SelectYtdAndPtdOnOneValueType(ref List <string> valueType) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); var countSelectedValueTypes = this.SelectedValueTypes.Count(); var valueTypeNumber = new Random().Next(0, countSelectedValueTypes); new Checkbox(By.CssSelector(string.Empty)).CheckByJsForVtYtdPtd(valueTypeNumber * 2); new Checkbox(By.CssSelector(string.Empty)).CheckByJsForVtYtdPtd((valueTypeNumber * 2) + 1); valueType.Add( new Label(By.XPath($"{ValueTypesLocators.SelectedValueTypes}[{valueTypeNumber + 1}]/div")).GetText()); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }
public PovPage ChangeDateTo(DateTime date) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name, date); string monthName = date.ToString("MMMM", CultureInfo.GetCultureInfo("en-us")); this.DateLabel.Click(); new Button(By.XPath(@"//button[@class='current']")).Click(); new Button(By.XPath($@"//td/span[contains(text(),'{date.Year}')]")).Click(); new Button(By.XPath($@"//td/span[contains(text(),'{monthName}')]")).Click(); new Button(By.XPath($@"//td[@class='ng-star-inserted']//span[text()='{date.Day}' and not(@class='is-other-month')]")).Click(); Wait.ForRollerOnReportsToGoAway(); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name, date); return(this); }
public MiDashboardPage ChangeOrganizationUnitTo(string dropdownValue) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name, dropdownValue); Wait.ForRollersToGoAway(); this.OrganizationUnitValue.Click(); this.OrganizationUnitSearchInput.Clear(); this.OrganizationUnitSearchInput.EnterValueByJs(dropdownValue); // Wait.ForElement(this.OrganizationUnitSearchResult); this.OrganizationUnitSearchResult.WaitForIt(); this.OrganizationUnitSearchResult.Click(); Wait.ForRollersToGoAway(); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name, dropdownValue); return(new MiDashboardPage()); }
public ValueTypesPage VerifySearchForOneAndTwoCharacters() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); var countSearchResults = this.SearchResultCheckboxes.Count(); this.SearchValueTypeInput.EnterValue(RandomData.RandomString(1)); Assert.AreEqual(countSearchResults, this.SearchResultCheckboxes.Count()); this.SearchValueTypeInput.Clear(); this.SearchValueTypeInput.EnterValue(RandomData.RandomString(2)); Assert.AreEqual(countSearchResults, this.SearchResultCheckboxes.Count()); this.SearchValueTypeInput.Clear(); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }
public void AddedValueTypes(List <string> valueTypes) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); Wait.ForRollerOnReportsToGoAway(); foreach (var valueType in valueTypes) { var valueTypeColumn = new Label(By.XPath($"//table/tbody/tr/td[contains(text(),'{valueType}')]")) .IsVisible(); var valueTypeColumnAnother = new Label(By.XPath($"//table/tbody/tr/td//span[contains(text(),'{valueType}')]")) .IsVisible(); Assert.IsTrue(valueTypeColumn || valueTypeColumnAnother); } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); }
private List <string> GetTimeViewValues() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); var timeViewValues = new List <string>(); var webElements = this.elementHelpers.FindElementsInReport(By.XPath("//button[@class='btn time-view-selection__button dropdown-toggle']/../div/div")); foreach (var webElement in webElements) { if (!string.IsNullOrEmpty(webElement.Text)) { timeViewValues.Add(webElement.Text); } } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(timeViewValues); }
public TimePeriodsPage VerifyTimeViewsOnCalendar(List <string> months) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); foreach (var month in months) { var validateTimePeriod = new Checkbox(By.XPath( $"//*[@id='timePeriods-panel']//div[@class='applied-values__item-name' and contains(text(),'{month}')]")) .IsChecked(); Assert.IsTrue(validateTimePeriod); } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }
public ValueTypesPage SelectRandomValueType() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); Wait.StandardWait(); var count = this.SearchResultCheckboxes.Count() / 3; var counter = new Random().Next(1, count / 10); for (var i = 0; i < counter; i++) { var randomAttributeNumber = new Random().Next(1, count - i); this.SearchResultCheckboxes.CheckByJsForVt(randomAttributeNumber); } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }
public PovPage VerifyDate(DateTime date) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name, date); Wait.StandardWait(); var currentDate = this.DateValue.GetText(); var firstDot = currentDate.IndexOf(".", StringComparison.Ordinal) + 1; var lastDot = currentDate.LastIndexOf(".", StringComparison.Ordinal); Assert.IsTrue(date.ToString("dd").Equals(currentDate.Substring(0, 2))); Assert.IsTrue(date.ToString("MM").Equals(currentDate.Substring(firstDot, lastDot - firstDot))); Assert.IsTrue(date.ToString("yyyy").Equals(currentDate.Substring(6, 4))); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name, date); return(this); }
public ValueTypesPage AddAtLeastOneValueType(ref List <string> valueTypes) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); var count = this.SearchResultCheckboxes.Count(); var counter = new Random().Next(1, count / 10); for (var i = 0; i < counter; i++) { var randomValueTypeNumber = new Random().Next(1, count - i); var item = this.SearchResultCheckboxes.GetText(randomValueTypeNumber); this.SearchResultCheckboxes.Click(randomValueTypeNumber); valueTypes.Add(item); } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }
public AttributesPage VerifyAttributesSortedAscending() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); var secondSearchResultText = this.SearchResultCheckboxes.GetText(); for (int i = 1; i < this.SearchResultCheckboxes.Count(); i++) { var firstSearchResultText = secondSearchResultText; secondSearchResultText = this.SearchResultCheckboxes.GetText(i); if (secondSearchResultText != string.Empty) { Assert.IsTrue(string.CompareOrdinal(firstSearchResultText, secondSearchResultText) < 0); } } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }
public AttributesPage SelectRandomAttribute(ref List <string> attributes) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); var count = this.SearchResultCheckboxes.Count(); var counter = new Random().Next(1, (count + 1) / 10); for (var i = 0; i < counter; i++) { var randomAttributeNumber = new Random().Next(1, count - i); var item = this.SearchResultCheckboxes.GetText(randomAttributeNumber); this.SearchResultCheckboxes.CheckByJsForAttribute(randomAttributeNumber); attributes.Add(item); } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }
public void VerifyMessages() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); Assert.IsTrue(this.DisclaimerTitle.GetText().Equals("M&BIS Portal - Access to sensitive data")); Assert.IsTrue(this.DisclaimerDescription.GetText().Equals("You are starting an application which allows access to and exporting of a high number of records containing client identifying data. To ensure the protection of client data please adhere to the following guidelines:")); Assert.IsTrue(this.Links.GetText().Equals("Client Data Confidentiality, Data Protection and Privacy (GP-00087)")); Assert.IsTrue(this.Messages.GetText().Equals("This policy sets forth principles that must generally be complied with processing personal data, in particular when transferring such data.")); Assert.IsTrue(this.Links.GetText(1).Equals("Client Data Confidentiality Switzerland Supplement to Client Data Confidentiality/ Data Protection/Privacy (GP-00087-S02)")); Assert.IsTrue(this.Messages.GetText(1).Equals("This policy ensures compliance with Swiss legislation on Swiss banking confidentiality.")); Assert.IsTrue(this.Links.GetText(2).Equals("Information Security (GP-00040)")); Assert.IsTrue(this.Messages.GetText(2).Equals("This policy covers roles and responsibilities with regards to all information stored, processed, transmitted, accessed or printed by or on behalf of Credit Suisse.")); Assert.IsTrue(this.Links.GetText(3).Equals("IT Acceptable Use (GP-00276)")); Assert.IsTrue(this.Messages.GetText(3).Equals("This policy sets out the principles and instructions to follow for acceptable and appropriate use of information technology hardware, software, systems, applications, data, facilities, networks and telecommunications equipment based on information security control objectives and requirements to protect Credit Suisse IT information assets.")); Assert.IsTrue(this.Links.GetText(4).Equals("Information Ownership, Classification and Handling (GP-00277)")); Assert.IsTrue(this.Messages.GetText(4).Equals("This policy sets out the control objectives and minimum standards for the ownership, classification and handling of all forms of information. These are necessary to ensure that are right level of information security protection is applied to the information managed by Credit Suisse.")); Assert.IsTrue(this.DisclaimerFooterQuestion.GetText().Equals("Please note: Any activity on the application will be logged. Are you sure you want to proceed?")); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); }
public void CheckSorting() { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); Wait.ForRollerOnReportsToGoAway(); var sortColumnsCount = Math.Min(this.SortingLocators.Count(), 3); for (var i = 1; i <= sortColumnsCount; i++) { var button = new Button(By.XPath($"(//span/following-sibling::a[@bs-report-action])[{i}]")); for (var j = 0; j < 2; j++) { button.Click(); Assert.AreEqual(j == 0 ? "u" : "t", button.GetText(), "Sorting does not work"); } } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); }
public ReportsPage HeaderWithSingleVTsAndSingleTimeViewAndNoAttributes(ReportsEntity reportData) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); this.Verify.Title(reportData.Title); this.Verify.OrganizationUnit(reportData.PoV.OrganizationUnit); this.Verify.VtSelection(reportData.Vt); Assert.IsTrue(this.SingleTimeView.IsVisible()); this.Verify.Currency(reportData.Currency); Assert.IsFalse(this.CurrentlyManagedCifsButton.IsVisible()); Assert.IsFalse(this.PreviouslyManagedCifsButton.IsVisible()); Assert.IsFalse(this.FiltersButton.IsVisible()); Assert.IsTrue(this.ReloadButton.IsVisible()); Assert.IsTrue(this.ExcelButton.IsVisible()); Assert.IsTrue(this.PdfButton.IsVisible()); Assert.IsTrue(this.SaveButton.IsVisible()); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(new ReportsPage()); }
public ReportsPage HeaderProfitabilityTopEams(ReportsEntity reportData) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); this.Verify.Title(reportData.Title); this.Verify.OrganizationUnit(reportData.PoV.OrganizationUnit); Assert.IsFalse(this.SingleVtButton.IsVisible()); Assert.IsTrue(this.SingleTimeView.IsVisible()); Assert.IsFalse(this.CurrencyLabel.IsVisible()); Assert.IsFalse(this.CurrentlyManagedCifsButton.IsVisible()); Assert.IsFalse(this.PreviouslyManagedCifsButton.IsVisible()); Assert.IsFalse(this.FiltersButton.IsVisible()); Assert.IsTrue(this.ReloadButton.IsVisible()); Assert.IsTrue(this.ExcelButton.IsVisible()); Assert.IsTrue(this.PdfButton.IsVisible()); Assert.IsTrue(this.SaveButton.IsVisible()); LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(new ReportsPage()); }
public TimePeriodsPage AddAtLeastOneTimePeriodFromMonthlyView(ref List <string> months) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); this.MonthlyButton.Click(); var count = this.MonthlyTimePeriodsUnselectedButton.Count(); var counter = new Random().Next(count / 3); for (var i = 0; i < counter; i++) { var randomTimePeriodNumber = new Random().Next(count - i); var item = this.MonthlyTimePeriodsUnselectedButton.GetText(randomTimePeriodNumber); this.MonthlyTimePeriodsUnselectedButton.Click(randomTimePeriodNumber); months.Add(item); } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }
public ReportsHeaderPage TimeViewsOnReport(List <string> months) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); Wait.ForRollerOnReportsToGoAway(); var valueTypeCountColumns = this.ValueTypeColumnLabels.Count(); foreach (var month in months) { var timeViewCountColumns = new Button(By.XPath( $"//a[contains(@bs-report-action,'sortOnColumn') and (contains(text(),'v') or (contains(text(),'u')))]/preceding-sibling::span[contains(text(),'{month}')]")) .Count(); Assert.IsTrue(valueTypeCountColumns == timeViewCountColumns || valueTypeCountColumns * 2 == timeViewCountColumns || valueTypeCountColumns * 3 == timeViewCountColumns || valueTypeCountColumns * 4 == timeViewCountColumns); } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(new ReportsHeaderPage()); }
public AttributesPage VerifyDefaultAttributesInReportSettings(string reportTitle) { LoggerPage.LogStart(MethodBase.GetCurrentMethod().Name); switch (reportTitle) { case "My Client - CIF List": AttributeIsVisible("CIF Number"); AttributeIsVisible("CIF Name"); break; case "My Client - Client Group List": AttributeIsVisible("Client Number"); AttributeIsVisible("Client Name"); AttributeIsVisible("CIF Nr"); break; case "My Client - Client Group List 13m": AttributeIsVisible("Client Number"); AttributeIsVisible("Client Name"); AttributeIsVisible("CIF Nr"); break; case "My Client - Client List": AttributeIsVisible("Client Number"); AttributeIsVisible("Client Name"); break; case "My Client - RM List": AttributeIsVisible("Last name, First name"); AttributeIsVisible("PID"); break; case "My Client - Top-Bottom": AttributeIsVisible("CIF Nr"); AttributeIsVisible("CIF Name"); AttributeIsVisible("Segment"); break; case "My Contribution - Line Manager IC List": AttributeIsVisible("Last Name, First Name"); AttributeIsVisible("Overall Trg Achv%"); break; case "My Contribution - Line Manager RM List": AttributeIsVisible("Last Name, First Name"); AttributeIsVisible("Overall Trg Achv%"); break; case "My Contribution - Currently Managed CIFs": AttributeIsVisible("Client Number"); AttributeIsVisible("Client Name"); break; case "My Sales - CIF List": AttributeIsVisible("Client Number"); AttributeIsVisible("Client Name"); break; case "My Sales - Product List": AttributeIsVisible("Product Name"); AttributeIsVisible("ISIN"); break; case "My Sales - RM List": AttributeIsVisible("PID"); AttributeIsVisible("Last name, First name"); break; case "My Sales - Transaction List": AttributeIsVisible("Effective Date"); AttributeIsVisible("Deal Reference Number"); AttributeIsVisible("ISIN"); AttributeIsVisible("Valor"); AttributeIsVisible("Product Name"); AttributeIsVisible("CIF Nr"); AttributeIsVisible("CIF Name"); break; case "NNA Trend - RM List": AttributeIsVisible("PID"); AttributeIsVisible("Last name, First name"); break; default: Logger.Log("Missing report in switch statement"); Assert.IsTrue(false); break; } LoggerPage.LogEnd(MethodBase.GetCurrentMethod().Name); return(this); }