Skip to content

Commit 93d8682

Browse files
committed
Accept cookies in manytools site
1 parent 75172d3 commit 93d8682

File tree

1 file changed

+8
-1
lines changed
  • Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/TestApp/ManyTools/Forms

1 file changed

+8
-1
lines changed

Aquality.Selenium/tests/Aquality.Selenium.Tests/Integration/TestApp/ManyTools/Forms/ManyToolsForm.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ namespace Aquality.Selenium.Tests.Integration.TestApp.ManyTools.Forms
1010
{
1111
internal abstract class ManyToolsForm<T> : Form where T : ManyToolsForm<T>
1212
{
13-
private const string BaseUrl = "https://manytools.org/";
13+
private const string BaseUrl = "https://manytools.org/";
1414

1515
protected ManyToolsForm(By locator, string name) : base(locator, name)
1616
{
1717
}
18+
private IButton AgreeButton => ElementFactory.GetButton(By.XPath("//button[@mode='primary']"), "Agree");
1819
private ILabel ValueLabel => FormElement.FindChildElement<ILabel>(By.XPath(".//code"), Name);
1920

2021
protected abstract string UrlPart { get; }
@@ -29,6 +30,12 @@ public T Open()
2930
{
3031
AqualityServices.Browser.GoTo(Url);
3132
AqualityServices.Browser.WaitForPageToLoad();
33+
State.WaitForDisplayed();
34+
if (AgreeButton.State.IsDisplayed)
35+
{
36+
AgreeButton.Click();
37+
AgreeButton.State.WaitForNotDisplayed();
38+
}
3239
}, new List<Type> { typeof(WebDriverTimeoutException) });
3340

3441
return (T)this;

0 commit comments

Comments
 (0)