Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

(#10901) Moves selenium tests to acceptance/selenium

Because ./acceptance/selenium is clearer than ./selenium_spec
  • Loading branch information...
commit 4a0cf66a6e3c75c3ead2bd7869b4bba1a446cfab 1 parent bbe5cfd
@djsauble2 djsauble2 authored
View
26 acceptance/selenium/dashboard_reports_tab_spec.rb
@@ -0,0 +1,26 @@
+require "./acceptance/selenium/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 acceptance/selenium/spec_helper.rb
@@ -0,0 +1,26 @@
+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.