segmenter_test.rb 884 Bytes
Newer Older
1
2
3
4
5
6
7
load 'browser_test.rb'

class SegmenterTest < BrowserTest

  def set_browser
    # Redefine set_browser as the tested webpage is totally different

8
    folder_path = File.expand_path(File.dirname(__FILE__))
9
10
11
12
    folder_path.sub! '/browser/test/functional', ''
    index_path = 'file://' + folder_path + '/browser/segmenter_page.html'

    print "Open browser\n"
13
    $b = SegmenterBrowser.new
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

    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