我希望能夠寫一個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