开发者

Testing workflows in Django

开发者 https://www.devze.com 2023-01-15 16:51 出处:网络
I really love testing and building unit tests, but I find it quite annoying having to build tests for a website\'s workflow.

I really love testing and building unit tests, but I find it quite annoying having to build tests for a website's workflow.

e.g.

Register -> Check email -> Activate account -> Login

or

Login -> Edit details -> Submit and view profile


manual testing = loads of time + tireing

even wh开发者_运维百科en using app such as Selenium, going though each iteration and then having to check emails etc...


Is there some way of performing an array of tests in a more efficient way?

How do you guys do it? :)


I write "functional unit" tests for individual views using Django's test framework. I have found that integration tests are best done using something like Robot Framework. In one of my projects I came up with a minimal, custom implementation of Ward Cunningham's FIT mechanism.


You probably want a functional testing framework like Cucumber (written in Ruby) or its Python equivalent, Freshen. These allow you to write workflows in a plain-language text format, and the test runner will execute the steps and check the expected results.


I usually use the Lettuce framework for this kind of testing. You can find it here: http://lettuce.it/

0

精彩评论

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