Skip to content

Commit

Permalink
Fix #2 IEDriver on Windows 10 requires firewall rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Hoer committed Oct 19, 2015
1 parent b8315c6 commit 02800ba
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.1.1

- Fix #2 IEDriver on Windows 10 is getting 'Windows firewall has blocked some of the features of this app'

## 1.1.0

- IEDriver release 2.48.0
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'MIT'
description 'Selenium WebDriver for Internet Explorer'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.1.0'
version '1.1.1'

supports 'windows'

Expand Down
8 changes: 8 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
notifies :unzip, "windows_zipfile[#{iedriver_dir}]", :immediately if platform?('windows')
end

name = 'Command line server for the IE Driver'
execute "Firewall rule '#{name}'" do
command "netsh advfirewall firewall add rule name=\"#{name}\" dir=in profile=private"\
" action=allow program=\"#{iedriver_dir}\\IEDriverServer.exe\""
action :run
not_if "netsh advfirewall firewall show rule name=\"#{name}\" > nul"
end

link "#{node['iedriver']['home']}\\IEDriverServer.exe" do
to "#{iedriver_dir}\\IEDriverServer.exe"
end
Expand Down
9 changes: 9 additions & 0 deletions spec/unit/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
ENV['SYSTEMDRIVE'] = 'C:'
node.set['iedriver']['version'] = '2.45.0'
allow_any_instance_of(Chef::Recipe).to receive(:ie_version).and_return('11.0.0.0')
stub_command(
"netsh advfirewall firewall show rule name=\"Command line server for the IE Driver\" > nul").and_return(false)
end.converge(described_recipe)
end

Expand All @@ -32,6 +34,13 @@
)
end

it 'adds command line firewall rule' do
expect(chef_run).to run_execute("Firewall rule 'Command line server for the IE Driver'").with(
command: 'netsh advfirewall firewall add rule name="Command line server for the IE Driver"'\
' dir=in profile=private action=allow program="C:\\iedriver\\iedriver-2.45.0\\IEDriverServer.exe"'
)
end

it 'links driver' do
expect(chef_run).to create_link('C:\iedriver\IEDriverServer.exe').with(
to: 'C:\iedriver\iedriver-2.45.0\IEDriverServer.exe'
Expand Down

0 comments on commit 02800ba

Please sign in to comment.