我希望能够写一个Django LiveServerTestCase它运行已使用硒IDE保存为HTML Selenium测试的测试情况。该代码可能是这个样子:Python的硒库可以起到保存为HTML
from django.test import LiveServerTestCase
from selenium.webdriver.firefox.webdriver import WebDriver
class TestUserStories(LiveServerTestCase):
@classmethod
def setUpClass(cls):
cls.selenium = WebDriver()
super(MySeleniumTests, cls).setUpClass()
def test_registration(self):
# Note - 'run_html_test' doesn't exist
self.selenium.run_html_test('selenium/registration.html')
这将使我们的QA团队(谁也不说话蟒蛇)写使用Firefox硒IDE测试,并将其保存为HTML。这可能吗?
据我所知,HTML是为了节省测试中,因为它可以让他们在IDE中进行编辑后上最好的格式 - 导出到Python不允许这一点,也产生蟒蛇,需要转换成与Django的LiveServerTestCase工作。
我认为IDE允许导出到Python。也许这是最佳的? – kgr 2012-08-06 12:56:37