summaryrefslogtreecommitdiff
path: root/toxcreate.rb
blob: 368101bb82152c5082d60c624fa9d8f7293c8048 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
require 'rubygems'
require "rubygems"
require 'opentox-ruby'
require 'test/unit'
require 'watir-webdriver'

class ToxCreateTest < Test::Unit::TestCase
  def setup
    @browser = Watir::Browser.new :firefox
    @user = "test_ch"
    @password = "test_ch"
  end

=begin
  def test_login
  end

  def teardown
    @browser.close
  end

=end
  def test_toxcreate
    @browser.goto CONFIG[:services]["opentox-toxcreate"]
    @browser.file_field(:id, "file").set(`pwd`.chomp+"/data/hamster_carcinogenicity.csv")
    @browser.button(:value, "Create model").click
    # wait until validation is completed
    # check results (links, reports, results)
    puts @browser.url
  end

=begin
  def test_multi_cell_call
    @browser.goto CONFIG[:services]["opentox-toxcreate"]
    @browser.file_field(:id, "file").set(`pwd`.chomp+"/data/multi_cell_call.csv")
    @browser.button(:value, "Create model").click
    # wait until validation is completed
    # check results (links, reports, results)
    puts @browser.url
  end

  def test_kazius
    @browser.goto CONFIG[:services]["opentox-toxcreate"]
    @browser.file_field(:id, "file").set(`pwd`.chomp+"/data/kazius.csv")
    @browser.button(:value, "Create model").click
    # wait until validation is completed
    # check results (links, reports, results)
    puts @browser.url
  end

  def test_parallel_models
    10.times do
      @browser.goto CONFIG[:services]["opentox-toxcreate"]
      @browser.file_field(:id, "file").set(`pwd`.chomp+"/data/hamster_carcinogenicity.csv")
      @browser.button(:value, "Create model").click
    end
    #@browser.close
  end
=end
end