1
브라우저 테스트를 위해 MiniTest와 함께 headless watir-webdriver를 사용하고 있습니다. 그건 잘 작동합니다. 그러나 저를 만족시키지 못하는 것이 있습니다. 각 테스트 전에 헤드리스 브라우저를 다시로드합니다. 한 번로드하고 항상 사용하는 것이 좋습니다.MiniTest의 각 테스트마다 헤드리스 웹 드라이버를 다시로드하지 마십시오
그렇게 할 수 있습니까? 당신은 "로드 브라우저가"두 번 인쇄되는 것을 볼 수 있습니다
require 'watir-webdriver'
require 'headless'
require 'minitest/autorun'
class TestMe < MiniTest::Test
def setup
$headless = Headless.new
$headless.start
$b = Watir::Browser.new :firefox
$b.goto 'http://www.google.com'
puts "Browser loaded"
end
def teardown
$b.close
$headless.destroy
end
def test_that_page_is_google
assert_equal "Google", $b.title
end
def test_something
assert ($b.span(:id => 'gbqfsa').exists?), ">>Fail Google search button exists"
end
end
:
다음은 간단한 예입니다.
모든 아이디어를 환영합니다. 감사합니다.