Skip to content

Commit 4e32a32

Browse files
committed
Change repository and name of new firefox driver (wires > geckodriver)
1 parent 55231f8 commit 4e32a32

File tree

8 files changed

+18
-29
lines changed

8 files changed

+18
-29
lines changed

WebDriverManager/BrowserManagers/ChromeDriverManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ public void Base()
8181
WebDriverManager.Unzip(config);
8282
WebDriverManager.Clean();
8383
WebDriverManager.AddEnvironmentVariable(config.pathVariable);
84-
// Temporary disable this functionality because of wrong path override
85-
//WebDriverManager.UpdatePath(config.pathVariable);
84+
WebDriverManager.UpdatePath(config.pathVariable);
8685
}
8786
}
8887
}

WebDriverManager/BrowserManagers/EdgeDriverManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ public void Base()
6666
{
6767
WebDriverManager.Download(config);
6868
WebDriverManager.AddEnvironmentVariable(config.pathVariable);
69-
// Temporary disable this functionality because of wrong path override
70-
//WebDriverManager.UpdatePath(config.pathVariable);
69+
WebDriverManager.UpdatePath(config.pathVariable);
7170
}
7271
}
7372
}

WebDriverManager/BrowserManagers/InternetExplorerDriverManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,7 @@ public void Base()
136136
WebDriverManager.Unzip(config);
137137
WebDriverManager.Clean();
138138
WebDriverManager.AddEnvironmentVariable(config.pathVariable);
139-
// Temporary disable this functionality because of wrong path override
140-
//WebDriverManager.UpdatePath(config.pathVariable);
139+
WebDriverManager.UpdatePath(config.pathVariable);
141140
}
142141
}
143142
}

WebDriverManager/BrowserManagers/MarionetteDriverManager.cs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public class MarionetteDriverManager : Logging, IBaseBrowserManager
1515
/// </summary>
1616
WebDriverManagerConfig config = new WebDriverManagerConfig
1717
{
18-
binary = "wires-<version>-win.exe",
19-
url = "https://github.com/jgraham/wires/releases/download/v<version>/wires-<version>-win.zip",
18+
binary = "geckodriver.exe",
19+
url = "https://github.com/mozilla/geckodriver/releases/download/v<version>/geckodriver-v<version>-win32.zip",
2020
pathVariable = "webdriver.gecko.driver",
2121
architecture = Architecture.x32.ToString()
2222
};
@@ -29,13 +29,12 @@ public string GetLatestVersion()
2929
{
3030
string version = null;
3131
var doc = new HtmlDocument();
32-
var htmlCode = client.DownloadString("https://github.com/jgraham/wires/releases");
32+
var htmlCode = client.DownloadString("https://github.com/mozilla/geckodriver/releases");
3333
doc.LoadHtml(htmlCode);
3434
var itemList = doc.DocumentNode.SelectNodes("//*[@class='release-title']/a").Select(p => p.InnerText).ToList();
35-
version = itemList.FirstOrDefault();
35+
version = itemList.FirstOrDefault().Remove(0, 1);
3636
if (version != null || version != string.Empty)
3737
{
38-
SetBinary(version);
3938
Log?.Info($"Latest marionette driver version is '{version}'");
4039
}
4140
else
@@ -50,12 +49,6 @@ public string GetLatestVersion()
5049
}
5150
}
5251

53-
private void SetBinary(string version)
54-
{
55-
config.binary = config.binary.Replace("<version>", version);
56-
Log?.Trace($"Update binary name to: '{config.binary}' in accordance with marionette driver version: '{version}'");
57-
}
58-
5952
public MarionetteDriverManager()
6053
: base()
6154
{
@@ -67,7 +60,6 @@ public MarionetteDriverManager(string version)
6760
{
6861
config.version = version;
6962
Log?.Info($"Set marionette driver version to: '{version}'");
70-
SetBinary(version);
7163
}
7264

7365
public void Init()
@@ -89,8 +81,7 @@ public void Base()
8981
WebDriverManager.Unzip(config);
9082
WebDriverManager.Clean();
9183
WebDriverManager.AddEnvironmentVariable(config.pathVariable);
92-
// Temporary disable this functionality because of wrong path override
93-
//WebDriverManager.UpdatePath(config.pathVariable);
84+
WebDriverManager.UpdatePath(config.pathVariable);
9485
}
9586
}
9687
}

WebDriverManager/BrowserManagers/OperaDriverManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,7 @@ public void Base()
108108
WebDriverManager.Unzip(config);
109109
WebDriverManager.Clean();
110110
WebDriverManager.AddEnvironmentVariable(config.pathVariable);
111-
// Temporary disable this functionality because of wrong path override
112-
//WebDriverManager.UpdatePath(config.pathVariable);
111+
WebDriverManager.UpdatePath(config.pathVariable);
113112
}
114113
}
115114
}

WebDriverManager/BrowserManagers/PhantomJsDriverManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ public void Base()
7878
WebDriverManager.Unzip(config);
7979
WebDriverManager.Clean();
8080
WebDriverManager.AddEnvironmentVariable(config.pathVariable);
81-
// Temporary disable this functionality because of wrong path override
82-
//WebDriverManager.UpdatePath(config.pathVariable);
81+
WebDriverManager.UpdatePath(config.pathVariable);
8382
}
8483
}
8584
}

WebDriverManager/Helpers/WebDriverManager.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ public static void AddEnvironmentVariable(string variable)
169169
{
170170
try
171171
{
172-
Environment.SetEnvironmentVariable(variable, desticationFolder, EnvironmentVariableTarget.Machine);
172+
var variableValue = Environment.GetEnvironmentVariable(variable);
173+
if (variableValue == null || !variableValue.Equals(desticationFolder))
174+
Environment.SetEnvironmentVariable(variable, desticationFolder, EnvironmentVariableTarget.Machine);
173175
}
174176
catch (Exception ex)
175177
{
@@ -182,6 +184,7 @@ public static void AddEnvironmentVariable(string variable)
182184
/// Update browser driver environment variable if it's already exist and different from current
183185
/// </summary>
184186
/// <param name="variable">Environment variable</param>
187+
/// NOTE: Temporary disable this functionality because of wrong path override
185188
public static void UpdatePath(string variable)
186189
{
187190
try
@@ -190,8 +193,8 @@ public static void UpdatePath(string variable)
190193
string pathvar = Environment.GetEnvironmentVariable(name);
191194
var path = pathvar + $@"%{variable}%";
192195

193-
if (!pathvar.Contains(desticationFolder))
194-
Environment.SetEnvironmentVariable(name, path, EnvironmentVariableTarget.Machine);
196+
//if (!pathvar.Contains(desticationFolder))
197+
//Environment.SetEnvironmentVariable(name, path, EnvironmentVariableTarget.Machine);
195198
}
196199
catch (Exception ex)
197200
{

WebDriverManager/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@
3434
// You can specify all the values or you can default the Build and Revision Numbers
3535
// by using the '*' as shown below:
3636
//[assembly: AssemblyVersion("1.0.*")]
37-
[assembly: AssemblyVersion("1.1.2.0")]
38-
[assembly: AssemblyFileVersion("1.1.2.0")]
37+
[assembly: AssemblyVersion("1.1.3")]
38+
[assembly: AssemblyFileVersion("1.1.3")]

0 commit comments

Comments
 (0)