test(Discord) Added test logs to discord and start of discord chat bot

This commit is contained in:
2022-04-28 12:56:49 -04:00
parent 156339786c
commit b65dae0884
25 changed files with 6277 additions and 181 deletions
+51
View File
@@ -0,0 +1,51 @@
namespace TestAutomation.Utils;
public class Website {
public Website(IWebDriver webDriver) {
WebDriver = webDriver;
HarassCalculatorPage = new HarassCalculatorPage(this);
}
public IWebDriver WebDriver { get; }
public HarassCalculatorPage HarassCalculatorPage { get; }
public IWebElement Find(string byId) {
return WebDriver.FindElement(By.Id(byId));
}
public IList<IWebElement> FindChildren(string ofId, string tagname) {
return WebDriver.FindElements(By.CssSelector($"#{ofId} {tagname}"));
}
public string FindText(string byId) {
return WebDriver.FindElement(By.Id(byId)).Text;
}
public int FindInt(string byId) {
return int.Parse(WebDriver.FindElement(By.Id(byId)).Text);
}
public IWebElement EnterInput<T>(IWebElement element, T input) {
element.Clear();
element.SendKeys(input!.ToString());
element.SendKeys(Keys.Enter);
return element;
}
public IWebElement EnterInput<T>(string byId, T input) {
var element = Find(byId);
element.Clear();
element.SendKeys(input!.ToString());
element.SendKeys(Keys.Enter);
return element;
}
public string GetLabel(string byId) {
return Find(byId).Text;
}
}