Рефакторинг

parent 0728f409
......@@ -20,13 +20,6 @@ namespace PhoneStore.Tests.Helpers
_driver.Quit();
_driver.Close();
}
public bool IsElementFound(string text)
{
var element = _driver.FindElement(By.XPath($"//*[contains(text(), '{text}')]"));
return element != null;
}
public void GoToUrl(string url)
{
_driver.Navigate().GoToUrl(url);
......@@ -44,10 +37,10 @@ namespace PhoneStore.Tests.Helpers
{
GoToUrl(RegisterUrl);
}
public void ClickButtonById(string id)
public bool IsElementFound(string text)
{
_driver.FindElement(By.Id(id)).Click();
var element = _driver.FindElement(By.XPath($"//*[contains(text(), '{text}')]"));
return element != null;
}
public void FillFormField(string fieldId, string text)
......@@ -55,5 +48,12 @@ namespace PhoneStore.Tests.Helpers
var field = _driver.FindElement(By.Id(fieldId));
field.SendKeys(text);
}
public void ClickButtonById(string id)
{
_driver.FindElement(By.Id(id)).Click();
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment