11using System ;
2+ using System . IO ;
23using System . Net ;
34using WebDriverManager . DriverConfigs ;
45using WebDriverManager . Helpers ;
@@ -13,13 +14,19 @@ public class DriverManager
1314
1415 private IBinaryService _binaryService ;
1516 private readonly IVariableService _variableService ;
17+ private string _downloadDirectory = Directory . GetCurrentDirectory ( ) ;
1618
1719 public DriverManager ( )
1820 {
1921 _binaryService = new BinaryService ( ) ;
2022 _variableService = new VariableService ( ) ;
2123 }
2224
25+ public DriverManager ( string downloadDirectory )
26+ {
27+ _downloadDirectory = downloadDirectory ;
28+ }
29+
2330 public DriverManager ( IBinaryService binaryService , IVariableService variableService )
2431 {
2532 _binaryService = binaryService ;
@@ -61,8 +68,7 @@ public string SetUpDriver(IDriverConfig config, string version = VersionResolveS
6168 version = GetVersionToDownload ( config , version ) ;
6269 var url = architecture . Equals ( Architecture . X32 ) ? config . GetUrl32 ( ) : config . GetUrl64 ( ) ;
6370 url = UrlHelper . BuildUrl ( url , version ) ;
64- var binaryPath = FileHelper . GetBinDestination ( config . GetName ( ) , version , architecture ,
65- config . GetBinaryName ( ) ) ;
71+ var binaryPath = Path . Combine ( _downloadDirectory , config . GetName ( ) , version , architecture . ToString ( ) , config . GetBinaryName ( ) ) ;
6672 return SetUpDriverImpl ( url , binaryPath ) ;
6773 }
6874 }
0 commit comments