Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Pages/AccountActivityPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class AccountActivityPage : BasePage
private By _withdrawalColumn = By.CssSelector("#filtered_transactions_for_account table tr:nth-child(1) td:nth-child(4)");
private By _h2Header = By.ClassName("board-header");

private By _accountSummaryLink = By.Id("account_summary_tab");

// Constructor
public AccountActivityPage(IWebDriver driver) : base(driver) { }

Expand All @@ -38,7 +40,8 @@ public void ClickFindButton()
ClickElement(_findButton);
}

public void CheckTabPanelHeaderIsDisplayed(){
public void CheckTabPanelHeaderIsDisplayed()
{
var element = _driver.FindElement(_h2Header).Displayed;
Assert.That(element, Is.True);
}
Expand Down Expand Up @@ -72,5 +75,9 @@ public void CompleteFindTransactionSearchParameters(string description, string f
SendText(_toAmountField, true, toAmount);
SendText(_typeField, false, type);
}
public void ClickAccountSummaryLink()
{
ClickElement(_accountSummaryLink);
}
}
}
21 changes: 15 additions & 6 deletions Pages/AccountSummaryPage.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
using NUnit.Framework;
using OpenQA.Selenium;

namespace CSharpSeleniumFramework.Pages{
namespace CSharpSeleniumFramework.Pages
{

public class AccountSummaryPage : BasePage{
public class AccountSummaryPage : BasePage
{

public AccountSummaryPage(IWebDriver driver) : base(driver){
public AccountSummaryPage(IWebDriver driver) : base(driver) { }

public void VerifyAllSectionHeadersDisplayed()
{
var sections = new List<String> { "Cash Accounts", "Investment Accounts", "Credit Accounts", "Loan Accounts" };
foreach (var section in sections)
{
IWebElement element = _driver.FindElement(By.XPath($"//h2[text()='{section}']"));
Assert.That(element.Displayed);
}
}

}

}
}
7 changes: 7 additions & 0 deletions Pages/OnlineBankingPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using SeleniumExtras.WaitHelpers;

namespace CSharpSeleniumFramework.Pages

{
public class OnlineBankingPage : BasePage
{
Expand All @@ -14,6 +15,7 @@ public class OnlineBankingPage : BasePage
// Selectors
private By _h1Header = By.TagName("h1");
private By _payBillsLink = By.Id("pay_bills_link");
private By _accountSummaryLink = By.Id("account_summary_link");

// Constructor
public OnlineBankingPage(IWebDriver driver) : base(driver) { }
Expand All @@ -23,6 +25,11 @@ public void ClickPayBillsLink()
{
ClickElement(_payBillsLink);
}
public void ClickAccountSummaryLink()
{
ClickElement(_accountSummaryLink);
}

public void CheckOnlineBankingPageHeader()
{
string h1Header = _driver.FindElement(_h1Header).Text;
Expand Down
37 changes: 37 additions & 0 deletions Tests/AccountSummaryTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using Allure.NUnit.Attributes;
using Allure.NUnit;
using CSharpSeleniumFramework.Pages;
using CSharpSeleniumFramework.Utils;

namespace CSharpSeleniumFramework.Tests
{
[TestFixture]
[AllureNUnit]
public class AccountSummaryTest : BaseTest
{
[SetUp]
public override void Setup()
{
base.Setup();
// Login
string username = "username";
string password = "password";
_homePage.ClickSignInButton();
_loginPage.Login(username, password);
_loginPage.ByPassSSLCertIssue();
_homePage.ClickCheckingAccountActivityLink();
}

[Test]
[AllureFeature("Account Summary")]
[AllureStory("Check all sections displayed on the page")]
public void CheckSectionsDisplayed()
{
_accountActivityPage.ClickAccountSummaryLink();
_accountSummaryPage.VerifyAllSectionHeadersDisplayed();
}
}
}
4 changes: 3 additions & 1 deletion Tests/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class BaseTest
protected TransferFundsPage _transferFundsPage;
protected AccountActivityPage _accountActivityPage;
protected PayBillsPage _payBillsPage;
protected AccountSummaryPage _accountSummaryPage;

[SetUp]
public virtual void Setup()
Expand All @@ -36,7 +37,7 @@ public virtual void Setup()
);

_driver = new ChromeDriver(options);
_driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(20); // Global implicit wait
_driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10); // Global implicit wait

_basePage = new BasePage(_driver);
_homePage = new HomePage(_driver);
Expand All @@ -45,6 +46,7 @@ public virtual void Setup()
_transferFundsPage = new TransferFundsPage(_driver);
_accountActivityPage = new AccountActivityPage(_driver);
_payBillsPage = new PayBillsPage(_driver);
_accountSummaryPage = new AccountSummaryPage(_driver);
_driver.Manage().Window.Maximize();

//Visit the application
Expand Down
Loading