File tree Expand file tree Collapse file tree 8 files changed +25
-21
lines changed
WebDriverManager/DriverConfigs/Impl Expand file tree Collapse file tree 8 files changed +25
-21
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,5 @@ public void DriverDownloadTest()
2222 new DriverManager ( ) . SetUpDriver ( new EdgeConfig ( ) ) ;
2323 Assert . NotEmpty ( WebDriverFinder . FindFile ( GetBinaryName ( ) ) ) ;
2424 }
25-
26- [ Fact ]
27- public void GetMatchingBrowserVersionTest ( )
28- {
29- Assert . Throws < NotImplementedException > ( ( ) => GetMatchingBrowserVersion ( ) ) ;
30- }
3125 }
3226}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public void DriverDownloadTest()
2626 [ Fact ]
2727 public void GetMatchingBrowserVersionTest ( )
2828 {
29- Assert . Throws < NotImplementedException > ( ( ) => GetMatchingBrowserVersion ( ) ) ;
29+ Assert . Throws < NotImplementedException > ( GetMatchingBrowserVersion ) ;
3030 }
3131 }
3232}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public void DriverDownloadTest()
2626 [ Fact ]
2727 public void GetMatchingBrowserVersionTest ( )
2828 {
29- Assert . Throws < NotImplementedException > ( ( ) => GetMatchingBrowserVersion ( ) ) ;
29+ Assert . Throws < NotImplementedException > ( GetMatchingBrowserVersion ) ;
3030 }
3131 }
3232}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public void DriverDownloadTest()
2626 [ Fact ]
2727 public void GetMatchingBrowserVersionTest ( )
2828 {
29- Assert . Throws < NotImplementedException > ( ( ) => GetMatchingBrowserVersion ( ) ) ;
29+ Assert . Throws < NotImplementedException > ( GetMatchingBrowserVersion ) ;
3030 }
3131 }
3232}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public void DriverDownloadTest()
2626 [ Fact ]
2727 public void GetMatchingBrowserVersionTest ( )
2828 {
29- Assert . Throws < NotImplementedException > ( ( ) => GetMatchingBrowserVersion ( ) ) ;
29+ Assert . Throws < NotImplementedException > ( GetMatchingBrowserVersion ) ;
3030 }
3131 }
3232}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ public void DriverDownloadTest()
2626 [ Fact ]
2727 public void GetMatchingBrowserVersionTest ( )
2828 {
29- Assert . Throws < NotImplementedException > ( ( ) => GetMatchingBrowserVersion ( ) ) ;
29+ Assert . Throws < NotImplementedException > ( GetMatchingBrowserVersion ) ;
3030 }
3131 }
3232}
Original file line number Diff line number Diff line change @@ -58,14 +58,6 @@ public virtual string GetLatestVersion()
5858 return GetLatestVersion ( LatestReleaseVersionUrl ) ;
5959 }
6060
61- public virtual string GetMatchingBrowserVersion ( )
62- {
63- var rawChromeBrowserVersion = RegistryHelper . GetInstalledBrowserVersion ( BrowserExecutableFileName ) ;
64- var chromeBrowserVersion = VersionHelper . GetVersionWithoutRevision ( rawChromeBrowserVersion ) ;
65- var url = ExactReleaseVersionPatternUrl . Replace ( "<version>" , chromeBrowserVersion ) ;
66- return GetLatestVersion ( url ) ;
67- }
68-
6961 private static string GetLatestVersion ( string url )
7062 {
7163 var uri = new Uri ( url ) ;
@@ -83,5 +75,13 @@ private static string GetLatestVersion(string url)
8375 }
8476 }
8577 }
78+
79+ public virtual string GetMatchingBrowserVersion ( )
80+ {
81+ var rawChromeBrowserVersion = RegistryHelper . GetInstalledBrowserVersion ( BrowserExecutableFileName ) ;
82+ var chromeBrowserVersion = VersionHelper . GetVersionWithoutRevision ( rawChromeBrowserVersion ) ;
83+ var url = ExactReleaseVersionPatternUrl . Replace ( "<version>" , chromeBrowserVersion ) ;
84+ return GetLatestVersion ( url ) ;
85+ }
8686 }
8787}
Original file line number Diff line number Diff line change 22using System . IO ;
33using System . Net ;
44using System . Runtime . InteropServices ;
5+ using WebDriverManager . Helpers ;
56
67namespace WebDriverManager . DriverConfigs . Impl
78{
89 public class EdgeConfig : IDriverConfig
910 {
1011 private const string BaseVersionPatternUrl = "https://msedgedriver.azureedge.net/<version>/" ;
12+ private const string LatestReleaseVersionUrl = "https://msedgedriver.azureedge.net/LATEST_STABLE" ;
13+
14+ private const string BrowserExecutableFileName = "msedge.exe" ;
1115
1216 public virtual string GetName ( )
1317 {
@@ -35,7 +39,12 @@ public virtual string GetBinaryName()
3539
3640 public virtual string GetLatestVersion ( )
3741 {
38- var uri = new Uri ( "https://msedgedriver.azureedge.net/LATEST_STABLE" ) ;
42+ return GetLatestVersion ( LatestReleaseVersionUrl ) ;
43+ }
44+
45+ public virtual string GetLatestVersion ( String url )
46+ {
47+ var uri = new Uri ( url ) ;
3948 var webRequest = WebRequest . Create ( uri ) ;
4049 using ( var response = webRequest . GetResponse ( ) )
4150 {
@@ -53,7 +62,8 @@ public virtual string GetLatestVersion()
5362
5463 public string GetMatchingBrowserVersion ( )
5564 {
56- throw new NotImplementedException ( ) ;
65+ var rawEdgeBrowserVersion = RegistryHelper . GetInstalledBrowserVersion ( BrowserExecutableFileName ) ;
66+ return rawEdgeBrowserVersion ;
5767 }
5868 }
5969}
You can’t perform that action at this time.
0 commit comments