public void CICS_1332PRWSearchBoxAndTimeSelectorTest() { application = new ATProDebugApp(); application.StartAppWithLogin1(); application.MainMenu.Reports.PriceReport.Click(); var priceReportWin = new PriceReportWindow(application); priceReportWin.Panel.SearchComboBox.Text = "CAD/CHF"; Wait.UntilNoException(() => Assert.IsTrue(priceReportWin.Panel.SearchComboBox.IsDropDownOpen, "Error SearchComboBox dropdown should be opened")); priceReportWin.Panel.SearchComboBox.SelectItem(mark); Assert.AreEqual(mark, priceReportWin.Panel.SearchComboBox.SelectedValue, "Error: wrong SearchComboBox selected value"); //- There is a "to" field with displayed current date/time that doesn't allow the user to pick a date/time. The date/time can't be edited. Assert.IsFalse(priceReportWin.Panel.TillDateTimePicker.IsEnabled, "Error: Till DateTimePicker should not be enabled"); Assert.AreEqual(DateTime.Now.Date, priceReportWin.Panel.TillDateTimePicker.Value.Date, "Error: TillDateTimePicker value is wrong "); }
public void CICS_1334PRWSubmitBAndColumnFilterTest() { // var market = Consts.Market11(); string mark = "CAD/CHF"; application = new ATProDebugApp(); application.StartAppWithLogin1(); application.MainMenu.Reports.PriceReport.Click(); var priceReportWin = new PriceReportWindow(application); priceReportWin.Panel.SearchComboBox.Text = "CAD/CHF"; Wait.UntilNoException(() => Assert.IsTrue(priceReportWin.Panel.SearchComboBox.IsDropDownOpen, "Error SearchComboBox dropdown should be opened")); priceReportWin.Panel.SearchComboBox.SelectItem(mark); Assert.AreEqual(mark, priceReportWin.Panel.SearchComboBox.SelectedValue, "Error: wrong SearchComboBox selected value"); priceReportWin.Panel.ClickSubmitButton(); //Check that requests logs contains //"1/4/2016 15:06:56.429","Start request to String.Emptyhttps://ciapi.cityindex.com/TradingApi/market/99500/tickhistory?priceticks=50000String.Empty" string linePattern = ""; if (URLs.Instance.CurrentServer == Core.Enums.TeamcityRunServers.Live) { linePattern = @"Start request to \""{4}https:\/\/ciapi\.cityindex\.com\/TradingApi\/market\/\d+\/tickhistory\?priceticks=50000"; } else { linePattern = @"Start request to \""{4}https:\/\/ciapipreprod\.cityindextest9\.co\.uk\:443\/TradingApi\/market\/\d+\/tickhistory\?priceticks=50000"; } var logsDir = new DirectoryInfo(application.LogsPath); var requestsTxtFile = logsDir.GetFiles() .FirstUntilNumberOfException(d => d.Name == requestsFile, "Can't find '" + requestsFile + "' file: " + logsDir.ToString()); var lastLine = File.ReadLines(requestsTxtFile.FullName).Last(l => Regex.IsMatch(l, linePattern)); var lineDateTime = DateTime.ParseExact(lastLine.Split('"')[1], requestsDateTimeFormat, CultureInfo.InvariantCulture); Assert.IsTrue( ((DateTime.Now - lineDateTime) < new TimeSpan(0, 2, 0)) && ((DateTime.Now - lineDateTime) > new TimeSpan(0, 0, 0)), "Error: needed request is not exist. " + lastLine); priceReportWin.Panel.Table.CheckDateTimeColumnSorting("Date"); priceReportWin.Panel.Table.CheckDoubleColumnSorting("Mid"); }
public void CICS_1335PRWExportToPDFAndExcelTest() { application = new ATProDebugApp(); application.StartAppWithLogin1(); application.MainMenu.Reports.PriceReport.Click(); priceReportWin = new PriceReportWindow(application); priceReportWin.Panel.SearchComboBox.Text = mark; Wait.UntilNoException( () => Assert.IsTrue(priceReportWin.Panel.SearchComboBox.IsDropDownOpen, "Error SearchComboBox dropdown should be opened")); priceReportWin.Panel.SearchComboBox.SelectItem(mark); Assert.AreEqual(mark, priceReportWin.Panel.SearchComboBox.SelectedValue, "Error: wrong SearchComboBox selected value"); priceReportWin.Panel.ClickSubmitButton(); //priceReportWin.Panel.ExportPdfButton.Click(); //CheckExportToPDF(); priceReportWin.Panel.ExportExcelButton.Click(); CheckExportToExcel(); }
public void CICS_1331NewPriceReportsWindowTest() { application = new ATProDebugApp(); application.StartAppWithLogin1(); string typeInto = "CAD/CHF"; Assert.IsTrue(application.MainMenu.Reports.IsEnabled, "Error: expected that Reports menu item is enabled"); Assert.IsTrue(application.MainMenu.Reports.PriceReport.IsEnabled, "Error: expected that Reports -> PriceReport menu item is enabled"); application.MainMenu.Reports.PriceReport.Click(); var priceReportWin = new PriceReportWindow(application); Assert.IsTrue(priceReportWin.Panel.SearchComboBox.IsVisible, "Error: SearchComboBox should be visible on PriceReportWindow"); Assert.IsTrue(priceReportWin.Panel.SubmitButton.IsVisible, "Error: SubmitButton should be visible on PriceReportWindow"); Assert.IsFalse(priceReportWin.Panel.SubmitButton.IsEnabled, "Error: SubmitButton should be disabled on PriceReportWindow"); Assert.IsFalse(priceReportWin.Panel.Table.Rows.Any(), "Error: table should be empty on PriceReportWindow"); Assert.IsTrue(priceReportWin.Panel.ExportExcelButton.IsVisible, "Error: ExportExcelButton should be visible on PriceReportWindow"); Assert.IsTrue(priceReportWin.Panel.ExportPdfButton.IsVisible, "Error: ExportPdfButton should be visible on PriceReportWindow"); Assert.IsFalse(priceReportWin.Panel.ExportExcelButton.IsEnabled, "Error: ExportExcelButton should be disabled on PriceReportWindow"); Assert.IsFalse(priceReportWin.Panel.ExportPdfButton.IsEnabled, "Error: ExportPdfButton should be disabled on PriceReportWindow"); Assert.IsTrue(priceReportWin.Panel.TillDateTimePicker.IsVisible, "Error: TillDateTimePicker should be visible on PriceReportWindow"); priceReportWin.Panel.SearchComboBox.Click(); //3.1 Select Arabic languge menu item application.ExecuteForeachLanguageMainMenu(() => { Assert.AreEqual(translations.PriceReport, application.MainMenu.Reports.PriceReport.Text, "Error: PriceReport menu is not transalted"); priceReportWin = new PriceReportWindow(application); Assert.AreEqual(translations.PriceReport, priceReportWin.HeaderTextBlock.Text, "Error: header (PriceReportWindow) is not translated "); Assert.AreEqual(translations.SelectMarket, priceReportWin.Panel.SelectMarketLabel.Text, "Error: SelectMarketLabel (PriceReportWindow) is not translated "); Assert.AreEqual(translations.To, priceReportWin.Panel.ToLabel.Text, "Error: ToLabel (PriceReportWindow) is not translated "); Assert.AreEqual(translations.Submit, priceReportWin.Panel.SubmitButton.Text, "Error: SubmitButton (PriceReportWindow) is not translated "); Assert.AreEqual(translations.ExportToPDF, priceReportWin.Panel.ExportPdfButton.Text, "Error: ExportPdfButton (PriceReportWindow) is not translated "); Assert.AreEqual(translations.ExportToExcel, priceReportWin.Panel.ExportExcelButton.Text, "Error: ExportExcelButton (PriceReportWindow) is not translated "); Assert.IsTrue(priceReportWin.Panel.Table.IsHeaderExist(priceReportWin.Panel.Headers.Date), "Error: Date column header (PriceReportWindow) is not translated " + priceReportWin.Panel.Headers.Date); Assert.IsTrue(priceReportWin.Panel.Table.IsHeaderExist(priceReportWin.Panel.Headers.Mid), "Error: Mid column header (PriceReportWindow) is not translated " + priceReportWin.Panel.Headers.Mid); }, Enums.Languages.JPN); priceReportWin.AttachWindowToTheMain(); Assert.IsTrue(application.PriceReportPanel.Table.IsVisible, "Error: PriceReportPanel.Table should be visible"); }