diff --git a/lib/webdrivers/edge_finder.rb b/lib/webdrivers/edge_finder.rb index 1f21628c..5ef515d4 100644 --- a/lib/webdrivers/edge_finder.rb +++ b/lib/webdrivers/edge_finder.rb @@ -69,18 +69,17 @@ def mac_location end def linux_location - # directories = %w[/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /snap/bin /opt/google/chrome] - # files = %w[microsoft-edge] # Based on Microsoft Edge 89.0.760.0 dev - # - # directories.each do |dir| - # files.each do |file| - # option = "#{dir}/#{file}" - # return option if File.exist?(option) - # end - # end - # - # nil - raise 'Default location not yet known' + directories = %w[/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /snap/bin /opt/microsoft/edge] + files = %w[microsoft-edge microsoft-edge-beta microsoft-edge-dev] + + directories.each do |dir| + files.each do |file| + option = "#{dir}/#{file}" + return option if File.exist?(option) + end + end + + nil end def win_version(location) diff --git a/lib/webdrivers/edgedriver.rb b/lib/webdrivers/edgedriver.rb index 483dbeee..3ecd2bca 100644 --- a/lib/webdrivers/edgedriver.rb +++ b/lib/webdrivers/edgedriver.rb @@ -22,8 +22,7 @@ def browser_version # # @return [String] def base_url - # 'https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/' - 'https://msedgedriver.azureedge.net/' + 'https://msedgedriver.azureedge.net' end private @@ -76,14 +75,10 @@ def apple_m1_compatible?(driver_version) false end - def linux_compatible?(driver_version) - System.platform == 'linux' && driver_version >= normalize_version('89.0.731.0') - end - def driver_filename(driver_version) if System.platform == 'win' || System.wsl_v1? "win#{System.bitsize}" # 32 or 64-bit - elsif linux_compatible?(driver_version) + elsif System.platform == 'linux' 'linux64' elsif System.platform == 'mac' # Determine M1 or Intel architecture diff --git a/spec/webdrivers/edgedriver_spec.rb b/spec/webdrivers/edgedriver_spec.rb index 98ab9fc5..1097b949 100644 --- a/spec/webdrivers/edgedriver_spec.rb +++ b/spec/webdrivers/edgedriver_spec.rb @@ -6,7 +6,6 @@ let(:edgedriver) { described_class } before do - skip 'Edge is not yet supported on Linux' if Webdrivers::System.platform == 'linux' edgedriver.remove end @@ -123,19 +122,19 @@ context 'when required version is 0' do it 'downloads the latest version' do - allow(edgedriver).to receive(:latest_version).and_return(Gem::Version.new('77.0.207.0')) + allow(edgedriver).to receive(:latest_version).and_return(Gem::Version.new('98.0.1089.1')) edgedriver.required_version = 0 edgedriver.update - expect(edgedriver.current_version.version).to eq('77.0.207.0') + expect(edgedriver.current_version.version).to eq('98.0.1089.1') end end context 'when required version is nil' do it 'downloads the latest version' do - allow(edgedriver).to receive(:latest_version).and_return(Gem::Version.new('77.0.207.0')) + allow(edgedriver).to receive(:latest_version).and_return(Gem::Version.new('98.0.1089.1')) edgedriver.required_version = nil edgedriver.update - expect(edgedriver.current_version.version).to eq('77.0.207.0') + expect(edgedriver.current_version.version).to eq('98.0.1089.1') end end end @@ -169,7 +168,7 @@ msg = 'Unable to find latest point release version for 999.0.0. '\ 'You appear to be using a non-production version of Edge. '\ 'Please set `Webdrivers::Edgedriver.required_version = ` '\ -'to a known edgedriver version: Can not reach https://msedgedriver.azureedge.net/' +'to a known edgedriver version: Can not reach https://msedgedriver.azureedge.net' expect { edgedriver.latest_version }.to raise_exception(Webdrivers::VersionError, msg) end @@ -178,7 +177,7 @@ allow(edgedriver).to receive(:browser_version).and_return Gem::Version.new('77.0.9999') msg = 'Unable to find latest point release version for 77.0.9999. '\ 'Please set `Webdrivers::Edgedriver.required_version = ` '\ -'to a known edgedriver version: Can not reach https://msedgedriver.azureedge.net/' +'to a known edgedriver version: Can not reach https://msedgedriver.azureedge.net' expect { edgedriver.latest_version }.to raise_exception(Webdrivers::VersionError, msg) end