开发者

Automation tool for testing python code and javascript

开发者 https://www.devze.com 2023-02-15 08:46 出处:网络
Does anyone know any开发者_如何学运维 free automation testing tool for unit testing python code and javascript?You will likely want to compose a number of testing frameworks together. Our team uses no

Does anyone know any开发者_如何学运维 free automation testing tool for unit testing python code and javascript?


You will likely want to compose a number of testing frameworks together. Our team uses nose http://code.google.com/p/python-nose/ as pointed out by @Arbie.

We use nose to also run selenium http://seleniumhq.org/ tests with the python driver which is really the only way I know of to effectively test javascript that manipulates the DOM. Although I have high hopes for WebDriver as part of selenium 2 once it stabilizes. While using selenium we've had to Monkey Patch the python driver to make it more pythonic. Wrapping the python-selenium driver so it changes:

selenium.doCommand('waitForElementPresent', 'selector')

into:

selenium.wait_for_element_present('selector')

You can then use nose and selenium to run QUnit http://docs.jquery.com/Qunit if you want to just test base javascript functions that don't necessarily change the DOM.

Example selenium integration:

def setUp(self):
    self.test_url = "http://your_domain"
    self.selenium = selenium("localhost", 4444, "*firefox3", self.test_url)
    self.selenium.start()

def tearDown(self):
    self.selenium.stop()


Try nose http://code.google.com/p/python-nose/


Try using https://replit.com its a web based IDE for python

0

精彩评论

暂无评论...
验证码 换一张
取 消