38 lines
996 B
C#
38 lines
996 B
C#
using EATestFramework.Driver;
|
|
using EATestFramework.Extensions;
|
|
using OpenQA.Selenium;
|
|
|
|
namespace EATestProject.Pages
|
|
{
|
|
public interface IHomePage
|
|
{
|
|
void CreateProduct();
|
|
void PerformClickOnSpecialValue(string name, string operation);
|
|
}
|
|
|
|
public class HomePage : IHomePage
|
|
{
|
|
private readonly IWebDriver _driver;
|
|
public HomePage(IDriverFixture driver)
|
|
{
|
|
_driver = driver.Driver;
|
|
}
|
|
|
|
IWebElement lnkProduct => _driver.FindElement(By.LinkText("Product"));
|
|
IWebElement lnkCreate => _driver.FindElement(By.LinkText("Create"));
|
|
IWebElement tblList => _driver.FindElement(By.CssSelector(".table"));
|
|
|
|
|
|
public void CreateProduct()
|
|
{
|
|
lnkProduct.Click();
|
|
lnkCreate.Click();
|
|
}
|
|
|
|
public void PerformClickOnSpecialValue(string name, string operation)
|
|
{
|
|
tblList.PerformActionOnCell("5", "Name", name, operation);
|
|
}
|
|
}
|
|
}
|