Extension methods for table handling and using certain controls in the table

This commit is contained in:
2022-01-27 15:36:23 +01:00
parent c4adc1442b
commit b8d5b1fdcf
3 changed files with 143 additions and 0 deletions

View File

@ -1,4 +1,5 @@
using EATestFramework.Driver;
using EATestFramework.Extensions;
using OpenQA.Selenium;
namespace EATestProject.Pages
@ -6,6 +7,7 @@ namespace EATestProject.Pages
public interface IHomePage
{
void CreateProduct();
void PerformClickOnSpecialValue(string name, string operation);
}
public class HomePage : IHomePage
@ -18,11 +20,18 @@ namespace EATestProject.Pages
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);
}
}
}

View File

@ -42,6 +42,7 @@ namespace EATestProject
_homePage.CreateProduct();
_createProductPage.EnterProductDetails(product);
_homePage.PerformClickOnSpecialValue("Monitor", "Details");
}
[Theory, AutoData]