[Ovirt-devel] Re: [PATCH] moved selenium params out to configuration file

Mohammed Morsi mmorsi at redhat.com
Fri Aug 22 21:38:48 UTC 2008


Mohammed Morsi wrote:
> ---
>  wui/src/config/selenium.yml               |    8 ++++++++
>  wui/src/test/functional/interface_test.rb |   20 ++++++++++++++------
>  2 files changed, 22 insertions(+), 6 deletions(-)
>  create mode 100644 wui/src/config/selenium.yml
>
> diff --git a/wui/src/config/selenium.yml b/wui/src/config/selenium.yml
> new file mode 100644
> index 0000000..83667b3
> --- /dev/null
> +++ b/wui/src/config/selenium.yml
> @@ -0,0 +1,8 @@
> +# oVirt selenium configuration
> +
> +selenium_server:
> +  address: "192.168.50.1"
> +  port: 4444
> +  browser: "*firefox /usr/lib64/firefox-3.0.1/firefox"
> +ovirt_wui_server:
> +  address: 192.168.50.2
> diff --git a/wui/src/test/functional/interface_test.rb b/wui/src/test/functional/interface_test.rb
> index 6563b44..9052b87 100644
> --- a/wui/src/test/functional/interface_test.rb
> +++ b/wui/src/test/functional/interface_test.rb
> @@ -17,25 +17,33 @@
>  # also available at http://www.gnu.org/copyleft/gpl.html.
>  
>  if File.exists? File.dirname(__FILE__) + '/../selenium.rb'
> + require 'yaml'
>  
>   require File.dirname(__FILE__) + '/../test_helper'
>   require File.dirname(__FILE__) + '/../selenium'
>  
>   class InterfaceTest < Test::Unit::TestCase
>           def setup
> -            @browser = Selenium::SeleniumDriver.new("192.168.50.1", 4444,
> -                           "*firefox /usr/lib64/firefox-3.0.1/firefox",
> -                           "http://192.168.50.2/ovirt/", 15000)
> -            @browser.start
> +          @config = YAML::load(File.open("#{RAILS_ROOT}/config/selenium.yml"))
> +          @site_url = "http://"+
> +                      @config["ovirt_wui_server"]["address"] + "/ovirt/"
> +
> +          @browser = Selenium::SeleniumDriver.new(
> +                          @config["selenium_server"]["address"],
> +                          @config["selenium_server"]["port"],
> +                          @config["selenium_server"]["browser"],
> +                          @site_url,
> +		          15000)
> +          @browser.start
> +          @browser.open(@site_url)
>           end
>  
>           def test_ovirt
> -            @browser.open("http://192.168.50.2/ovirt/")
>              assert_equal("Dashboard", @browser.get_title())
> -	    @browser.close
>           end
>  
>           def teardown
> +	        @browser.close
>              @browser.stop
>           end
>   end
>   
Gah, didn't realize that git-send-email sent all patches as part of a
single thread. These three patches aren't all that related, though all
need ACKing.

   -Mo




More information about the ovirt-devel mailing list