diff options
author | mr <mr@mrautenberg.de> | 2011-08-23 17:29:49 +0200 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2011-08-23 17:29:49 +0200 |
commit | b4a69302d68efc2a27c1f8a23155d58a52224a26 (patch) | |
tree | 72e608e6cf63e781ac19e50bfc9d9d5260948ab1 /toxcreate.rb | |
parent | 95e8205415932112eb6dd3393b861fad7a52f3d4 (diff) |
fix has_content syntax
Diffstat (limited to 'toxcreate.rb')
-rw-r--r-- | toxcreate.rb | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/toxcreate.rb b/toxcreate.rb index de9ab59..9b40e0e 100644 --- a/toxcreate.rb +++ b/toxcreate.rb @@ -25,24 +25,24 @@ class ToxCreateTest < Test::Unit::TestCase =begin def test_01_login visit File.join(CONFIG[:services]["opentox-toxcreate"], "login") - click_on "Login" - puts "Login without credentials" - assert page.has_content? "Please enter username and password." + click_button "Login" + puts "Login without credentials" + assert page.has_content?("Please enter username and password.") fill_in('Username', :with => @user) fill_in('Password', :with => @password + "nonsense") - click_on "Login" + click_button "Login" puts "Login with wrong password" - assert page.has_content? "Login failed. Please try again." - fill_in('Username', :with => @user) - fill_in('Password', :with => @password) - click_on "Login" - assert page.has_content? "Welcome #{@user}!" + assert page.has_content?('Login failed. Please try again.') + fill_in('Username', :with => "anonymous") + fill_in('Password', :with => "anonymous") + click_button "Login" + assert page.has_content?("Welcome anonymous!") visit File.join(CONFIG[:services]["opentox-toxcreate"], "login") - click_on "Login as guest" + click_button "Login as guest" puts "Login as user guest" - assert page.has_content? "Welcome guest!" + assert page.has_content?("Welcome guest!") end -=end + def test_02_toxcreate # works only with akephalos Capybara.current_driver = :akephalos #login(@browser, @user, @password) @@ -58,7 +58,7 @@ class ToxCreateTest < Test::Unit::TestCase end assert first(".model_status").has_content?("Completed") end - +=end def test_03_predict Capybara.register_driver :akephalos do |app| Capybara::Driver::Akephalos.new(app, :validate_scripts => false) @@ -66,13 +66,13 @@ class ToxCreateTest < Test::Unit::TestCase session = Capybara::Session.new(:akephalos) session.visit CONFIG[:services]["opentox-toxcreate"] session.click_on "Predict" - session.fill_in "or enter a Name, InChI, Smiles, CAS, ...", :with => "NNc1ccccc1" - session.check "hamster_carcinogenicity" + session.fill_in "or enter a Smiles string", :with => "NNc1ccccc1" + session.check "hamster carcinogenicity" session.click_button "Predict" - assert session.has_content? "inactive" + assert session.has_content?("Not enough similar compounds in training dataset") session.click_on "Confidence" - assert session.has_content? "Indicates the applicability domain of a model" - session.click_on "Details" + assert session.has_content?("Indicates the applicability domain of a model") + session.click_button "Details" #assert page.has_content? "false" #assert page.has_content? "0.294" |