Commit a7129a9e authored by Mikaël Salson's avatar Mikaël Salson Committed by Mathieu Giraud
Browse files

browser/test/functional/segmenter_test.rb: Factorize opening of segmenter app

We have a file dedicated to the opening of the browser for the file
of interest, in the same fashion as browser_test.rb
parent f09c601e
load 'browser_test.rb'
class SegmenterTest < BrowserTest
def set_browser
# Redefine set_browser as the tested webpage is totally different
folder_path = Dir.pwd
folder_path.sub! '/browser/test/functional', ''
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
print "Resize\n"
$b.window.resize_to(1500, 800)
print "Testing segmenter page at " + index_path + "\n"
$b.goto index_path
# check that the segmenter loaded correctly
if not $b.textarea(:id => 'form_sequences').present?
print "Loading of segmenter page failed. Do not execute remaining tests."
exit
end
print "Segmenter page loaded, launching tests.\n"
end
def setup
super
if not defined? $b
set_browser
end
end
end
load 'segmenter_browser.rb'
load 'browser_test.rb'
load 'segmenter_test.rb'
class TestSegmenterPage < BrowserTest
def set_browser
# Redefine set_browser as the tested webpage is totally different
folder_path = Dir.pwd
folder_path.sub! '/browser/test/functional', ''
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
print "Resize\n"
$b.window.resize_to(1500, 800)
print "Testing segmenter page at " + index_path + "\n"
$b.goto index_path
# check that the segmenter loaded correctly
if not $b.textarea(:id => 'form_sequences').present?
print "Loading of segmenter page failed. Do not execute remaining tests."
exit
end
print "Segmenter page loaded, launching tests.\n"
end
def setup
super
if not defined? $b
set_browser
end
end
class TestSegmenterPage < SegmenterTest
def test_00_launch_query
sequences = $b.textarea(:id => 'form_sequences')
......
load 'segmenter_browser.rb'
load 'browser_test.rb'
load 'segmenter_test.rb'
class TestSegmenterPageErrors < BrowserTest
def set_browser
# Redefine set_browser as the tested webpage is totally different
folder_path = Dir.pwd
folder_path.sub! '/browser/test/functional', ''
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
print "Resize\n"
$b.window.resize_to(1500, 800)
print "Testing segmenter page at " + index_path + "\n"
$b.goto index_path
# check that the segmenter loaded correctly
if not $b.textarea(:id => 'form_sequences').present?
print "Loading of segmenter page failed. Do not execute remaining tests."
exit
end
print "Segmenter page loaded, launching tests.\n"
end
def setup
super
if not defined? $b
set_browser
end
end
class TestSegmenterPageErrors < SegmenterTest
def test_00_launch_bad_query
sequences = $b.textarea(:id => 'form_sequences')
......
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