Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

(#10901) Adds Selenium documentation. Removes selenium_spec/

Shows the user how to run Selenium acceptance tests locally. Removes
the selenium_spec/ directory. Selenium tests now live in acceptance/selenium/
  • Loading branch information...
commit f99d5d202892b23ddc320653e8524a5ccd5fd797 1 parent 4a0cf66
@djsauble2 djsauble2 authored
View
28 SELENIUM.md
@@ -0,0 +1,28 @@
+How to run the Selenium acceptance tests
+========================================
+
+INTRODUCTION
+
+This document describes the process of running the Selenium acceptance tests
+locally. Running the tests remotely (e.g. on a virtual machine) is also
+possible, but beyond the scope of this document.
+
+See http://seleniumhq.org/docs/ for more details.
+
+PREREQUISITES
+
+- You must have an instance of Dashboard running
+- You must have the selenium-webdriver gem installed
+
+STEPS
+
+To run the Selenium acceptance tests, do the following:
+
+1. Edit DASHBOARD_ROOT/acceptance/selenium/spec_helper.rb
+
+ - Change $DASHBOARD_BASE_URL to the URL where your instance of Dashboard is
+ running
+
+ - Change $DRIVER to the browser you want to use for your tests
+
+2. Run `spec acceptance/selenium/`
View
26 selenium_spec/dashboard_reports_tab_spec.rb
@@ -1,26 +0,0 @@
-require "./selenium_spec/spec_helper.rb"
-
-describe "the Dashboard Reports tab" do
- let(:browser) { get_web_driver }
- let(:menu) { browser.find_element(:css => "div#header ul.navigation") }
-
- after :all do
- browser.quit
- end
-
- describe 'reports menu item' do
- it 'should exist' do
- reports_link = browser.find_element(:link => "Reports")
- reports_link.should be_displayed
- end
- end
-
- describe 'reports table' do
- it 'should allow status icons to be displayed with a graphical tooltip' do
- reports_link = browser.find_element(:link => "Reports")
- browser.action.click(reports_link).perform
- browser.find_element(:css => "table.inspector.main").should be_true
- end
- end
-
-end
View
26 selenium_spec/spec_helper.rb
@@ -1,26 +0,0 @@
-require "rubygems"
-require "selenium-webdriver"
-
-$DASHBOARD_BASE_URL = "http://localhost:3000/"
-$HEADLESS_DISPLAY = nil #"localhost:15.0"
-
-# Choose from :ie, :internet_explorer, :remote, :chrome, :firefox, :ff, :android, :iphone, :opera
-$DRIVER = :firefox
-
-$DRIVER_IMPLICIT_WAIT = 10
-
-# Used only when $DRIVER == :remote.
-$DRIVER_HUB_URL = "http://192.168.100.228:4444/wd/hub"
-$DRIVER_CAPABILITIES = Selenium::WebDriver::Remote::Capabilities.firefox
-
-def get_web_driver()
- if $DRIVER == :remote
- driver = Selenium::WebDriver.for(:remote, :url => $DRIVER_HUB_URL, :desired_capabilities => $DRIVER_CAPABILITIES)
- else
- ENV["DISPLAY"] = $HEADLESS_DISPLAY if $HEADLESS_DISPLAY
- driver = Selenium::WebDriver.for($DRIVER)
- end
- driver.manage.timeouts.implicit_wait = $DRIVER_IMPLICIT_WAIT
- driver.navigate.to $DASHBOARD_BASE_URL
- driver
-end
Please sign in to comment.
Something went wrong with that request. Please try again.