diff --git a/manifests/config.pp b/manifests/config.pp index eb99d17..3c87aea 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -20,6 +20,8 @@ # class selenium::config { + $options = '-Dwebdriver.enable.native.events=1' + file { '/etc/init.d/selenium': ensure => 'file', owner => 'root', diff --git a/spec/classes/selenium_config_spec.rb b/spec/classes/selenium_config_spec.rb index 161b763..08e348d 100644 --- a/spec/classes/selenium_config_spec.rb +++ b/spec/classes/selenium_config_spec.rb @@ -3,11 +3,12 @@ describe 'selenium::config', :type => :class do let(:title) { 'redhat' } let(:facts) {{ :osfamily=> 'RedHat' }} - let :pre_condition do - "class { 'selenium::server': display => 'foo' }" - end context 'no params' do + let :pre_condition do + "class { 'selenium::server': }" + end + it do should contain_class('selenium::config') should contain_file('/etc/init.d/selenium').with({ @@ -16,10 +17,11 @@ 'group' => 'root', 'mode' => '0755', }). - with_content(/selenium-server-standalone/). - with_content(/SLNM_INSTALL_PATH=\/opt\/selenium/) - with_content(/SLNM_DISPLAY=:0/) - with_content(/SLNM_USER=selenium/) + with_content(/SLNM_DISPLAY=':0'/). + with_content(/SLNM_USER='selenium'/). + with_content(/SLNM_INSTALL_PATH='\/opt\/selenium'/). + with_content(/SLNM_JAR_NAME='selenium-server-standalone-2.35.0.jar'/). + with_content(/SLNM_OPTIONS='-Dwebdriver.enable.native.events=1'/) end end diff --git a/templates/init.d/selenium.erb b/templates/init.d/selenium.erb index 2b4684a..a5f6926 100644 --- a/templates/init.d/selenium.erb +++ b/templates/init.d/selenium.erb @@ -22,13 +22,15 @@ # Source function library. . /etc/rc.d/init.d/functions -SLNM_INSTALL_PATH=<% scope.lookupvar('selenium::server::install_path') %> -SLNM_DISPLAY=<% scope.lookupvar('selenium::server::display') %> -SLNM_USER=<%= scope.lookupvar('selenium::server::user') %> +SLNM_DISPLAY='<%= scope.lookupvar('selenium::server::display') %>' +SLNM_USER='<%= scope.lookupvar('selenium::server::user') %>' +SLNM_INSTALL_PATH='<%= scope.lookupvar('selenium::server::install_path') %>' +SLNM_JAR_NAME='<%= scope.lookupvar('selenium::install::jar_name') %>' +SLNM_OPTIONS='<%= scope.lookupvar('selenium::config::options') %>' + SLNM_LOG="${SLNM_INSTALL_PATH}/log/server.log" SLNM_ERROR_LOG="${SLNM_INSTALL_PATH}/log/error.log" -SLNM_JAR="${SLNM_INSTALL_PATH}/opt/selenium/jars/selenium-server-standalone-2.35.0.jar" -SLNM_OPTIONS='-Dwebdriver.enable.native.events=1' +SLNM_JAR="${SLNM_INSTALL_PATH}/jars/${SLNM_JAR_NAME}" prog="selenium" #config=""