public void CalculateBtnDisabled365(int amount, int rate, int term) { DepositPage depositPage = new DepositPage(driver); depositPage.SetAmountRateTerm(amount, rate, term); Assert.IsFalse(depositPage.CalculateBtn.Enabled); }
public void HistoryNotRestored() { //Act DepositPage depositPage = new DepositPage(driver); depositPage.SetAmountRateTerm(12345, 87, 299); depositPage.SelectFinYear(360); depositPage.Calculate(); //Assert Assert.IsTrue(depositPage.OpenHistoryPage().Clear().BackToDeposit().OpenHistoryPage().IsHistoryClean); }
public void LastCalculatedDataSaved() { //Act DepositPage depositPage = new DepositPage(driver); depositPage.SetAmountRateTerm(12345, 87, 299); depositPage.SelectFinYear(360); depositPage.Calculate(); //Assert Assert.AreEqual(depositPage.CaptureDataToArray(), depositPage.OpenHistoryPage().CaptureRowToArray(1)); }
public void SequentialCalculationsSaved(int amount_of_calculations) { //Act DepositPage depositPage = new DepositPage(driver); depositPage.OpenHistoryPage().Clear().BackToDeposit(); for (int i = 0; i < amount_of_calculations; i++) { depositPage.SetAmountRateTerm(12341 + i, 91 + i, 301 + i); depositPage.Calculate(); } //Assert Assert.AreEqual(amount_of_calculations, depositPage.OpenHistoryPage().GetRowsNumber()); }
public void End_Date(int term, int fin_year) { //Arrange DateTime startDate = new DateTime(2019, 7, 15); //Act DepositPage depositPage = new DepositPage(driver); depositPage.StartDate = startDate; depositPage.SelectFinYear(fin_year); depositPage.SetAmountRateTerm(1, 1, term); depositPage.Calculate(); //Assert Assert.AreEqual(startDate.AddDays(term).ToString(SettingsPage.DefaultDateFormat, CultureInfo.InvariantCulture), depositPage.EndDate); }
public void OrderingInHistory(int amount_of_calculations) { //Act String[] entered_values = new string[8]; DepositPage depositPage = new DepositPage(driver); for (int i = 0; i < amount_of_calculations; i++) { depositPage.SetAmountRateTerm(12341 + i, 91 + i, 301 + i); depositPage.Calculate(); if (i == 0) { entered_values = depositPage.CaptureDataToArray(); } } //Assert Assert.AreEqual(entered_values, depositPage.OpenHistoryPage().CaptureRowToArray(amount_of_calculations)); }
public void Date_Format_Applied(String date_format, int term) { //Arrange DateTime startDate = new DateTime(2020, 1, 1); //Act SettingsPage settingsPage = new SettingsPage(driver); settingsPage.SelectDateFormat.SelectByText(date_format); settingsPage.Save(); DepositPage depositPage = new DepositPage(driver); depositPage.StartDate = startDate; depositPage.SetAmountRateTerm(1, 1, term); depositPage.Calculate(); //Assert Assert.AreEqual(startDate.AddDays(term).ToString(date_format, CultureInfo.InvariantCulture), depositPage.EndDate); }
public void Number_Format_Applied(String number_format, int fin_year) { //Arrange Decimal amount = 12345m; int rate = 74; int term = 211; int year_length = 365; //Act SettingsPage settingsPage = new SettingsPage(driver); settingsPage.SelectNumberFormat.SelectByText(number_format); settingsPage.Save(); DepositPage depositPage = new DepositPage(driver); depositPage.SelectFinYear(fin_year); depositPage.SetAmountRateTerm(amount, rate, term); depositPage.Calculate(); //Assert Assert.AreEqual(Math.Round(amount * rate * term / 100 / year_length, 2).ToString("N", settingsPage.GetSelectedNFI(number_format)), depositPage.InterestStr); }
public void DateIsSavingInSelectedFormat(String dateFormat, int term) { //Arrange DepositPage depositPage = new DepositPage(driver); DateTime startDate = depositPage.StartDate; DateTime endDate = startDate.AddDays(term); String strStartDate = startDate.ToString(dateFormat, CultureInfo.InvariantCulture); String strEndDate = endDate.ToString(dateFormat, CultureInfo.InvariantCulture); //Act SettingsPage settingsPage = depositPage.OpenSettingsPage(); settingsPage.SelectDateFormat.SelectByText(dateFormat); settingsPage.Save(); depositPage.SetAmountRateTerm(1, 1, term); depositPage.Calculate(); HistoryPage historyPage = depositPage.OpenHistoryPage(); String histStartDate = historyPage.GetDateFrom(1); String histEndDate = historyPage.GetDateTo(1); //Assert Assert.AreEqual(strStartDate, histStartDate, "Start Date value is wrong."); Assert.AreEqual(strEndDate, histEndDate, "End Date value is wrong."); }