jeanphix/Ghost.py — Issue #1: Testcase to documentation
Author: jeanphix
Created: 2011-12-10 10:02:50+00:00
State: open
Labels: Improvement

I'm currently thinking about a cool feature that will bring user docs from test case, here is a sample:

class FormTestCase(GhostTestCase):
"""Form related stories."""

report_path = '/path/to/html/report'

@report
def test_anonymous_fill(self):
"""As an anonymous user, I can send data using the form."""
self.ghost.open("form.html")
self.snap_passed("Form is now loaded, now I need to fill first field")
self.ghost.set_field_value('[name=first-field]', 'my value')
self.snap_passed("First field is now filled, now I need to fill second field", selector="form")

def another_non_reported_test(self):
pass

That will generate an HTML report with well organised stories described using docblocks, passed messages and snapshots.