我今天早上刚开始看SST。我写过这个简单的测试用例,它始终通过:
from sst.actions import *
from sst import cases
class RootTest(cases.SSTTestCase):
def test_root_page(self):
go_to('http://localhost:8888/')
assert_title_contains('Booga')
assert_button("file_select")
assert_button("upload")
return self
class LoginTest(cases.SSTTestCase):
def login(self):
go_to('http://localhost:8888/login')
assert_element(id="Email")
assert_element(id="Passwd")
assert_element(id="booga")
return self
我的代码中没有'booga'。
当我执行sst-run sst_test时,我得到以下内容:
Tests running...
DEBUG:SST:Starting browser (attempt: 1)
DEBUG:SST:Cannot connect to process 5392 with port: 32773, count 1
DEBUG:SST:Cannot connect to process 5392 with port: 32773, count 2
DEBUG:SST:Browser started: firefox
DEBUG:SST:Stopping browser
sst_test ... OK (2.317 secs)
Ran 1 test in 2.317s
OK
这是一个带有py 2.7.3的ubuntu 12.04系统。为什么测试失败?
答案 0 :(得分:1)
你需要使用自己的跑步者。 sst-run
仅用于运行SST基于脚本的测试。
请参阅: http://testutils.org/sst/#using-sst-in-unittest-test-suites