-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
142 lines (97 loc) · 3.62 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
Introduction
============
This plugin allows you to integrate cucumber with Trac. It will allow you to enter User Stories in a wiki page and execute them as part of a continuous integration build. The results of the story execution will then be displayed in the wiki page.
Example
=======
The following example will create a story named user_login with the tags wiki and login:
{{{
#!CucumberStory
#name: manage_login
Feature: User login
In order to use the site
as an unauthenticated visitors
i want to be able to login
Scenario: Logging in
Given I am on the homepage
When I enter my login details
And press "Login"
Then I should see my name
}}}
If, when opening the page, the story has already been run and its output is present in the database
Use Cases
=========
The following is a list of possible interactions of the user with the plugin
New Feature is entered
----------------------
* User edits page
* User adds new story
* new story is extracted and saved in a .feature file
* the name for the file is taken from the macro parameters
* callback to observers is made
Existing Feature (which has been run before) is displayed
---------------------------------------------------------
* User visits a page with an embedded story
* The story database is queried for the story
* the key is taken from the macro parameters
* result of story execution is displayed
* scenarios are collapsed and coloured according to their status
* error messages for failed steps are shown in a popup
New Feature (which has not been run before) is displayed
---------------------------------------------------------
* User visits a page with an embedded story
* The story database is queried for the story
* the key is taken from the macro parameters
* the database returns a record_not_found
* a pending execution message is displayed
Existing Feature is edited
--------------------------
* User edits page
* User changes an existing story
* new story is extracted and saved in a .feature file, overwriting the existing
* the name for the file is taken from the macro parameters
* callback to observers is made
Trac-Macros
===========
* CucumberStory - wraps a story
* Arguments:
- name: name of the story, this must be unique
- tags (optional): a number of tags to be associated with this story
Components
==========
CucumberPlugin
--------------
represents the plugin
Extension points:
- observer: receives callbacks on add and edit of stories
- database: interfaces with the story database
- story_renderer: renders a story
CucumberDatabase
----------------
interface to the story database
- saves and updates stories extracted from the wiki
- returns the output for stories
- maintains the mapping of story names to page names
(this is required to be able to remove stories)
Configuration:
- location: location of the story database
CucumberStoryRenderer
---------------------
renders story output to HTML
CucumberStoryMacro
------------------
macro for rendering a single story
Interfaces
==========
class ICucumberDatabase:
def save_story(name, story, tags):
"""Save the given story under the given name with the given tags"""
def get_story(name):
"""retrieve the output for given story, None if story has not yet executed"""
class ICucumberStoryRenderer:
def render_story_output(story):
"""turn the output of the given story into HTML"""
class ICucumberObserver:
def story_added(story_name, story, tags):
"""called when a new story is added"""
def story_edited(story_name, story, tags):
"""called when an existing story is edited"""