Commit 1a7411aa authored by Mikaël Salson's avatar Mikaël Salson Committed by Mathieu Giraud

browser/test/functional: Factorize browser instanciation

We should just intantiate the browser in one place so that we can easily change it.
Moreover we benefit that to make it possible to change the browser path (FF).
This would enable testing several versions of the web browser.
parent a7129a9e
......@@ -41,9 +41,7 @@ class BrowserTest < MiniTest::Test
end
print "Open browser\n"
#$b = VidjilBrowser.new :safari
$b = VidjilBrowser.new :firefox
#$b = VidjilBrowser.new :chrome
$b = VidjilBrowser.new
print "Resize\n"
$b.window.resize_to(1500, 800)
......
......@@ -10,9 +10,7 @@ class SegmenterTest < BrowserTest
index_path = 'file://' + folder_path + '/browser/segmenter_page.html'
print "Open browser\n"
#$b = VidjilBrowser.new :safari
$b = SegmenterBrowser.new :firefox
#$b = VidjilBrowser.new :chrome
$b = SegmenterBrowser.new
print "Resize\n"
$b.window.resize_to(1500, 800)
......
......@@ -113,7 +113,7 @@ GGGGGAGGCTTGGTACAGCCTGGGGGGTCCCTGAGACTCTCCTGTGCAGCCTCTGGATTCACCTTCAGTAGCTACGACAT
assert (right_coord_of_textarea < left_coord_of_scatterplot), "Textarea should be left of scatterplot"
end
def test_zz_close
close_everything
end
......
......@@ -3,6 +3,15 @@ require 'watir-webdriver'
class VidjilBrowser < Watir::Browser
def initialize
if ENV['WATIR_BROWSER_PATH']
print "Using custom browser location " + ENV['WATIR_BROWSER_PATH'] + "\n"
Selenium::WebDriver::Firefox.path = ENV['WATIR_BROWSER_PATH']
end
# :chrome or :safari
super :firefox
end
# Return the text field that allows to edit a clone name
def clone_name_editor
return text_field(:id => 'new_name')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment