Skip to content

Commit

Permalink
Move waiter to framework
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Jun 26, 2024
1 parent 25d3cf7 commit b86a81f
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
<PackageReference Include="Scriban" Version="5.9.0" GeneratePathProperty="true" PrivateAssets="all" />
<PackageReference Include="YamlDotNet" Version="13.4.0" GeneratePathProperty="true" PrivateAssets="all" />
<PackageReference Include="Yapoml.Framework.Workspace" Version="0.15.2" GeneratePathProperty="true" PrivateAssets="all" />
<PackageReference Include="Yapoml.Framework.Workspace" Version="0.16.0" GeneratePathProperty="true" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
21 changes: 11 additions & 10 deletions src/Yapoml.Selenium/Components/BaseComponentConditions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading;
using Yapoml.Framework;
using Yapoml.Framework.Logging;
using Yapoml.Selenium.Components.Conditions;
using Yapoml.Selenium.Components.Conditions.Generic;
Expand Down Expand Up @@ -81,7 +82,7 @@ bool attempt()
{
scope.Execute(() =>
{
Services.Waiter.Until(attempt, timeout.Value, PollingInterval);
Waiter.Until(attempt, timeout.Value, PollingInterval);
});
}
}
Expand Down Expand Up @@ -128,7 +129,7 @@ bool attempt()
{
scope.Execute(() =>
{
Services.Waiter.Until(attempt, timeout.Value, PollingInterval);
Waiter.Until(attempt, timeout.Value, PollingInterval);
});
}
}
Expand Down Expand Up @@ -188,7 +189,7 @@ bool attempt()
{
scope.Execute(() =>
{
Services.Waiter.Until(attempt, timeout.Value, PollingInterval);
Waiter.Until(attempt, timeout.Value, PollingInterval);
});
}
}
Expand Down Expand Up @@ -237,7 +238,7 @@ bool attempt()
{
scope.Execute(() =>
{
Services.Waiter.Until(attempt, timeout.Value, PollingInterval);
Waiter.Until(attempt, timeout.Value, PollingInterval);
});
}
}
Expand Down Expand Up @@ -269,7 +270,7 @@ bool attempt()
{
scope.Execute(() =>
{
Services.Waiter.Until(attempt, timeout.Value, PollingInterval);
Waiter.Until(attempt, timeout.Value, PollingInterval);
});
}
}
Expand Down Expand Up @@ -301,7 +302,7 @@ bool attempt()
{
scope.Execute(() =>
{
Services.Waiter.Until(attempt, timeout.Value, PollingInterval);
Waiter.Until(attempt, timeout.Value, PollingInterval);
});
}
}
Expand Down Expand Up @@ -344,7 +345,7 @@ bool attempt()
{
scope.Execute(() =>
{
Services.Waiter.Until(attempt, timeout.Value, PollingInterval);
Waiter.Until(attempt, timeout.Value, PollingInterval);
});
}
}
Expand Down Expand Up @@ -377,7 +378,7 @@ bool attempt()
{
scope.Execute(() =>
{
Services.Waiter.Until(attempt, timeout.Value, PollingInterval);
Waiter.Until(attempt, timeout.Value, PollingInterval);
});
}
}
Expand Down Expand Up @@ -430,7 +431,7 @@ bool attempt()
{
scope.Execute(() =>
{
Services.Waiter.Until(attempt, timeout.Value, PollingInterval);
Waiter.Until(attempt, timeout.Value, PollingInterval);
});
}
}
Expand Down Expand Up @@ -473,7 +474,7 @@ bool attempt()
{
scope.Execute(() =>
{
Services.Waiter.Until(attempt, timeout.Value, PollingInterval);
Waiter.Until(attempt, timeout.Value, PollingInterval);
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Yapoml.Selenium/Components/BaseComponentList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#if NET6_0_OR_GREATER
using System.Runtime.CompilerServices;
#endif
using Yapoml.Framework;
using Yapoml.Framework.Logging;
using Yapoml.Framework.Options;
using Yapoml.Selenium.Components.Metadata;
using Yapoml.Selenium.Events;
using Yapoml.Selenium.Options;
using Yapoml.Selenium.Services;
using Yapoml.Selenium.Services.Factory;
using Yapoml.Selenium.Services.Locator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
using System.Runtime.CompilerServices;
#endif
using System.Threading;
using Yapoml.Framework;
using Yapoml.Framework.Logging;
using Yapoml.Selenium.Components.Conditions;
using Yapoml.Selenium.Events;
using Yapoml.Selenium.Services;
using Yapoml.Selenium.Services.Locator;

namespace Yapoml.Selenium.Components
Expand Down
3 changes: 2 additions & 1 deletion src/Yapoml.Selenium/Components/BasePageConditions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using OpenQA.Selenium;
using System;
using System.Threading;
using Yapoml.Framework;
using Yapoml.Framework.Logging;
using Yapoml.Selenium.Components.Conditions;
using Yapoml.Selenium.Components.Metadata;
Expand Down Expand Up @@ -54,7 +55,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, PollingInterval);
Waiter.Until(condition, timeout.Value, PollingInterval);
});
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Yapoml.Framework;
using Yapoml.Framework.Logging;

namespace Yapoml.Selenium.Components.Conditions.Generic
Expand Down Expand Up @@ -42,7 +43,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -80,7 +81,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -118,7 +119,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -156,7 +157,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -194,7 +195,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -232,7 +233,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Text.RegularExpressions;
using Yapoml.Framework;
using Yapoml.Framework.Logging;

namespace Yapoml.Selenium.Components.Conditions.Generic
Expand Down Expand Up @@ -43,7 +44,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -79,7 +80,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -110,7 +111,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -141,7 +142,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -177,7 +178,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -213,7 +214,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -249,7 +250,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -285,7 +286,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -321,7 +322,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -357,7 +358,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -388,7 +389,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down Expand Up @@ -419,7 +420,7 @@ bool condition()
{
scope.Execute(() =>
{
Services.Waiter.Until(condition, timeout.Value, _pollingInterval);
Waiter.Until(condition, timeout.Value, _pollingInterval);
});
}
}
Expand Down
58 changes: 0 additions & 58 deletions src/Yapoml.Selenium/Services/Waiter.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Yapoml.Selenium/Yapoml.Selenium.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</PackageReference>

<PackageReference Include="Selenium.WebDriver" Version="4.11.0" />
<PackageReference Include="Yapoml.Framework" Version="0.15.2" />
<PackageReference Include="Yapoml.Framework" Version="0.16.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit b86a81f

Please sign in to comment.