Skip to content

Commit

Permalink
NEW: upgrade selenium to latest & weaken deps to 4.*
Browse files Browse the repository at this point in the history
+ remove WDM from tests and README
  • Loading branch information
yashaka committed Feb 9, 2024
1 parent 2c56f5f commit 05b8e2a
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 36 deletions.
2 changes: 1 addition & 1 deletion NSelene/NSelene.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Selenium.WebDriver" Version="4.9.1" />
<PackageReference Include="Selenium.WebDriver" Version="4.*" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using NUnit.Framework;
using OpenQA.Selenium.Chrome;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;
using static NSelene.Selene;

namespace NSelene.Tests.Examples.SharedDriver.StraightForward
Expand All @@ -12,14 +10,10 @@ public class BrowserTest
[OneTimeSetUp]
public void initDriver()
{
new DriverManager().SetUpDriver(
new ChromeConfig(), version: "Latest"
// new ChromeConfig(), version: "89.0.4389.23"
);
var options = new ChromeOptions();
options.AddArguments("headless");
Configuration.Driver = new ChromeDriver(options);
Configuration.BaseUrl = "http://todomvc.com/examples/emberjs";
Configuration.BaseUrl = "http://todomvc-emberjs-app.autotest.how/";
}

[OneTimeTearDown]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using NUnit.Framework;
using OpenQA.Selenium.Chrome;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;
using static NSelene.Selene;

namespace NSelene.Tests.Examples.SharedDriver.WithPageObjects
Expand All @@ -12,10 +10,6 @@ public class BrowserTest
[OneTimeSetUp]
public void initDriver()
{
new DriverManager().SetUpDriver(
new ChromeConfig(), version: "Latest"
// new ChromeConfig(), version: "89.0.4389.23"
);
var options = new ChromeOptions();
options.AddArguments("headless");
Configuration.Driver = new ChromeDriver(options);
Expand Down
7 changes: 0 additions & 7 deletions NSeleneTests/Integration/SharedDriver/Configuration_Specs.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;

namespace NSelene.Tests.Integration.SharedDriver.SeleneElementSpec
{
Expand All @@ -16,11 +14,6 @@ public class Configuration_Specs
[OneTimeSetUp]
public void InitConfiguration()
{
new DriverManager().SetUpDriver(
new ChromeConfig(), version: "Latest"
// new ChromeConfig(), version: "89.0.4389.23"
);

var options = new ChromeOptions();
options.AddArguments("headless");
this._driver1 = new ChromeDriver(options);
Expand Down
8 changes: 0 additions & 8 deletions NSeleneTests/Integration/SharedDriver/Harness/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;
using WebDriverManager.Helpers;
using static NSelene.Selene;

namespace NSelene.Tests.Integration.SharedDriver.Harness
Expand All @@ -18,11 +15,6 @@ public class BaseTest
[OneTimeSetUp]
public void initDriver()
{
new DriverManager().SetUpDriver(
new ChromeConfig(), version: "Latest"
// new ChromeConfig(), version: "89.0.4389.23"
);

var options = new ChromeOptions();
options.AddArguments("headless");
this._driver = new ChromeDriver(options);
Expand Down
2 changes: 0 additions & 2 deletions NSeleneTests/NSeleneTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
</PropertyGroup>

<ItemGroup>

<PackageReference Include="NUnit" Version="3.13.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="WebDriverManager" Version="2.16.2" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Main features:
- **User-oriented API for Selenium Webdriver** (code like speak common English)
- **Ajax support** (Smart implicit waiting and retry mechanism)
- **PageObjects support** (all elements are lazy-evaluated objects)
- **Automatic driver management** (no need to install and setup driver for quick local execution)

[Available at Nuget](www.nuget.org/packages/NSelene)

Expand Down Expand Up @@ -89,17 +88,13 @@ Find an example of NSelene usage in [this template project](https://github.com/y

Below you can find a short overview:

NSelene has no fully automatic driver management. Given the [WebDriverManager] is installed, then you can set your driver up manually, e.g. like here:

```csharp
[TestFixture]
public class BrowserTest
{
[SetUp]
public void InitDriver()
{
string chromeVersion = "Latest"; // e.g. "83.0.4103.39" or "Latest", see https://chromedriver.chromium.org/downloads
new DriverManager().SetUpDriver(new ChromeConfig(), version: chromeVersion);
Configuration.Driver = new ChromeDriver();

// a handy option to enable automatic waiting for no overlay in web tests
Expand Down

0 comments on commit 05b8e2a

Please sign in to comment.