本文整理汇总了Python中page.Page.test方法的典型用法代码示例。如果您正苦于以下问题:Python Page.test方法的具体用法?Python Page.test怎么用?Python Page.test使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类page.Page
的用法示例。
在下文中一共展示了Page.test方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from page import Page [as 别名]
# 或者: from page.Page import test [as 别名]
def run(self):
try:
webdriver = selenium_webdriver.Firefox()
with self.lock:
print "Starting", self.name
while True:
try:
suite_name, suite = self.q.get_nowait()
log = lambda message: self.log(suite_name, message)
for ui_map, actions in suite:
# log the UI map name if in debug mode
if self.store['debug']:
log(ui_map)
# create the page and test it
page = Page(
suite_name,
actions,
webdriver,
self.store,
self.log
)
page.test()
# suite is complete: success!
log("Suite Passed")
except Queue.Empty:
# nothing left to consume
break
except WebDriverException, e:
# Houston, we have a problem
try:
log("X Page Failed: %s" % ui_map)
log("X %s" % e)
log("X Suite Failed: %s" % suite_name)
except:
# these variables (log, ui_map, suite_name)
# may not be assigned yet on CTL-C
pass
# the following exceptions occur on CTL-C
except KeyboardInterrupt:
pass
except URLError:
pass
except BadStatusLine:
pass
except Exception, e:
print "Exception:", e
print e.__class__
print_exc()