Added screencapture direct in /tmp for storage of screenshots

This commit is contained in:
Wade Alcorn
2012-01-13 17:25:21 +10:00
parent 5716da2af6
commit 72f4c10ff1

View File

@@ -1,9 +1,12 @@
require 'test/unit'
BEEF_TEST_DIR = "/tmp/beef-test/"
class TC_login < Test::Unit::TestCase
def save_screenshot(session)
session.driver.browser.save_screenshot("/tmp/" + Time.now.strftime("%Y-%m-%d--%H-%M-%S-%N") + ".png")
Dir.mkdir(BEEF_TEST_DIR) if not File.directory?(BEEF_TEST_DIR)
session.driver.browser.save_screenshot(BEEF_TEST_DIR + Time.now.strftime("%Y-%m-%d--%H-%M-%S-%N") + ".png")
end
def test_log_in
@@ -21,7 +24,6 @@ class TC_login < Test::Unit::TestCase
session
end
def test_log_out
session = test_log_in
session.has_content?('logout')