[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Ovirt-devel] [PATCH] oVirt Selenium Configuration



>From 22430a127a02f7c34912106f3b0f55a6379ae460 Mon Sep 17 00:00:00 2001
From: Mohammed Morsi <mmorsi redhat com>
Date: Thu, 21 Aug 2008 15:10:36 -0400
Subject: [PATCH] moved selenium params out to configuration file

---
 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
-- 
1.5.4.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]