~bjornt/launchpad/architect-vision

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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
= Filing bugs on ProjectGroups =

Even though it's not possible to file bugs against projects directly,
it's still possible to file a bug from a project's main page.

    >>> user_browser.open('http://launchpad.dev/gnome')
    >>> user_browser.getLink(url='+filebug').click()
    >>> user_browser.url
    'http://bugs.launchpad.dev/gnome/+filebug'

The ProjectGroup filebug page is like a Product's filebug page, except that
it also asks for a Product. Only Products that are using Bugs are
shown in the list of options.

    >>> user_browser.getControl('Project').options
    ['evolution']

After we selected a product and entered a summary, we get presented with
a list of possible duplicates.

    >>> user_browser.getControl('Project').value = ['evolution']
    >>> user_browser.getControl('Summary').value = 'Evolution crashes'
    >>> user_browser.getControl('Continue').click()

    >>> print find_main_content(user_browser.contents).renderContents()
    <...
    No similar bug reports were found...

Entering a description and submitting the bug takes the user to the bug
page.

    >>> user_browser.getControl('Further information').value = 'Crash.'
    >>> user_browser.getControl('Submit Bug Report').click()
    >>> user_browser.url
    'http://bugs.launchpad.dev/evolution/+bug/...'
    >>> user_browser.title
    'Bug #... in Evolution: ...Evolution crashes...'


== Subscribing to a similar bug ==

If our bug is described by one of the suggested similar bugs, we can
subscribe to it instead of filing a new bug. This also loosely implies
a "me too" vote.

    >>> user_browser.open("http://bugs.launchpad.dev/gnome/+filebug")
    >>> user_browser.getControl('Project').value = ['evolution']
    >>> user_browser.getControl('Summary').value = 'Evolution crashes'
    >>> user_browser.getControl('Continue').click()

As before, we get a list of similar bugs to choose from, including the
bugs we filed recently.

    >>> from lp.bugs.tests.bug import print_bugs_list
    >>> print_bugs_list(user_browser.contents, "similar-bugs")
    #... Evolution crashes
    New (0 comments) last updated ...

This one matches, so we subscribe.

    >>> user_browser.getControl(
    ...     "Yes, this is the bug I'm trying to report").click()

    >>> print user_browser.url
    http://bugs.launchpad.dev/evolution/+bug/...

But, of course, we're already subscribed because we created it.

    >>> for message in get_feedback_messages(user_browser.contents):
    ...     print message
    This bug is already marked as affecting you.


== Filing a bug when there are none similar ==

When no similar bugs are found the form works the same but appears
different in the user agent.

    >>> user_browser.open("http://launchpad.dev/gnome/+filebug")

Submitting some distinctive details...

    >>> user_browser.getControl('Project').value = ['evolution']
    >>> user_browser.getControl('Summary').value = (
    ...     'Faznambutron dumps core unless clenching')
    >>> user_browser.getControl('Continue').click()

...yields no similar bugs. In fact, the similar bugs table is not even
shown.

    >>> similar_bugs_list = find_tag_by_id(
    ...     user_browser.contents, "similar-bugs")
    >>> print similar_bugs_list
    None

But, as before, entering a description and submitting the bug takes
the user to the bug page.

    >>> user_browser.getControl('Further information').value = (
    ...     'Faznambutron is a plugin designed to ...')
    >>> user_browser.getControl('Submit Bug Report').click()
    >>> user_browser.url
    'http://bugs.launchpad.dev/evolution/+bug/...'
    >>> user_browser.title
    'Bug #... in Evolution: ...Faznambutron dumps core...'


== Empty ProjectGroups ==

It isn't possible to file a bug against an empty project. However, we give the
user some feedback in this regard. We need to create a new project first.

    >>> admin_browser.open('http://launchpad.dev/projectgroups/+new')
    >>> admin_browser.getControl('Name:', index=0).value = 'test-group'
    >>> admin_browser.getControl('Display Name:').value = 'Test Group'
    >>> admin_browser.getControl('Title:').value = 'Test Group'
    >>> admin_browser.getControl('Project Group Summary:').value = 'Summary'
    >>> admin_browser.getControl('Description:').value = 'Description'
    >>> admin_browser.getControl('Maintainer:').value = 'cprov'
    >>> admin_browser.getControl('Add').click()
    >>> admin_browser.url
    'http://launchpad.dev/test-group'

A user navigating to the filebug page will see an information message. The
user can only get to the filebug page by entering its URL directly because all
links to the page are disabled for empty project groups. Since there are users
who would navigate to the page in that manner we test it here.

    >>> user_browser.open('http://launchpad.dev/test-group/+filebug')
    >>> user_browser.url
    'http://launchpad.dev/test-group/+filebug'

    >>> for message in find_tags_by_class(user_browser.contents,
    ...     'informational message'):
    ...     print message.renderContents()
    There are no projects registered for Test Group that use Launchpad to
    track bugs.

If the project registrant visits the filebug page they will see an additional
message:

    >>> admin_browser.open('http://launchpad.dev/test-group/+filebug')

    >>> for message in find_tags_by_class(admin_browser.contents,
    ...     'warning message'):
    ...     print message.renderContents()
    There are no projects registered for Test Group. <br /> You need
    to <a href="/test-group/+newproduct">register another project that
    is part of Test Group</a> or associate an existing project with
    it.


== ProjectGroups With no Products Using Launchpad Bugs ==

If we add a new product to our test project (specifically one that doesn't use
Launchpad for bug tracking) information about that product will also be
displayed.

    >>> admin_browser.open('http://launchpad.dev/test-group/+newproduct')
    >>> admin_browser.getControl(name='field.name', index=0).value = 'testy'
    >>> admin_browser.getControl(name='field.displayname').value = 'Testy Product'
    >>> admin_browser.getControl(name='field.title').value = 'A Product for Testing'
    >>> admin_browser.getControl(name='field.summary').value = 'Used for testing'
    >>> admin_browser.getControl('Continue').click()
    >>> print admin_browser.url
    http://launchpad.dev/test-group/+newproduct

    >>> admin_browser.getControl(name='field.licenses').value = ['GNU_GPL_V2']
    >>> admin_browser.getControl('Complete Registration').click()
    >>> admin_browser.url
    'http://launchpad.dev/testy'

The user will now see the new product on the project's +filebug page, but will
not be able to file a bug against it.

    >>> user_browser.reload()
    >>> for message in find_tags_by_class(user_browser.contents,
    ...     'informational message'):
    ...     print message.renderContents()
    There are no projects registered for Test Group that use Launchpad to
    track bugs.

Testy Product doesn't use define an external bug tracker and isn't registered
in any source packages and the user is told this.

    >>> print extract_text(find_tag_by_id(user_browser.contents,
    ...     'product-list-summary'))
    There is 1 project registered as part of Test Group but it does not use
    Launchpad as its bug tracker.

    >>> for tag in find_tags_by_class(
    ...     user_browser.contents, 'product-bug-options'):
    ...     print extract_text(tag)
    Testy Product
    Testy Product does not use an external bug tracker or has not registered
    it with launchpad.
    Testy Product is not registered with any source packages. You can help by
    linking them for us.

The user will also be presented with a link to the product's overview page:

    >>> user_browser.getLink('Testy Product').url
    'http://launchpad.dev/testy'

If we set up an external bug tracker for Testy Product, this will be reflected
in the Test Group's filebug page.

    >>> from zope.component import getUtility
    >>> from canonical.launchpad.interfaces.launchpad import (
    ...     ILaunchpadCelebrities)

    >>> login('admin@canonical.com')
    >>> ubuntu = getUtility(ILaunchpadCelebrities).ubuntu
    >>> hoary = ubuntu.getSeries('hoary')
    >>> thunderbird_spn = factory.getOrMakeSourcePackageName('thunderbird')
    >>> spph = factory.makeSourcePackagePublishingHistory(
    ...     sourcepackagename=thunderbird_spn, distroseries=hoary)
    >>> logout()

    >>> admin_browser.open('http://launchpad.dev/testy/+configure-bugtracker')
    >>> admin_browser.getControl(name='field.bugtracker').value = ['external']
    >>> admin_browser.getControl(
    ...     name='field.bugtracker.bugtracker').value = ['3']
    >>> admin_browser.getControl('Change').click()

And on the filebug page...

    >>> user_browser.reload()
    >>> print extract_text(find_tag_by_id(user_browser.contents,
    ...     'product-list-summary'))
    There is 1 project registered as part of Test Group but it does not use
    Launchpad as its bug tracker.

    >>> for tag in find_tags_by_class(
    ...     user_browser.contents, 'product-bug-options'):
    ...     print extract_text(tag)
    Testy Product
    External bug tracker: Debian Bug tracker.
    Testy Product is not registered with any source packages. You can help by
    linking them for us.

Finally, we add Testy Product to a source package:

    >>> admin_browser.open('http://bugs.launchpad.dev/testy/trunk/+ubuntupkg')
    >>> admin_browser.getControl('Source Package Name').value = 'thunderbird'
    >>> admin_browser.getControl('Update').click()

And this is also shown on the filebug page:

    >>> user_browser.reload()
    >>> user_browser.reload()
    >>> print extract_text(find_tag_by_id(user_browser.contents,
    ...     'product-list-summary'))
    There is 1 project registered as part of Test Group but it does not use
    Launchpad as its bug tracker.

    >>> for tag in find_tags_by_class(
    ...     user_browser.contents, 'product-bug-options'):
    ...     print extract_text(tag)
    Testy Product
    External bug tracker: Debian Bug tracker.
    Source package: Ubuntu thunderbird (File a bug here)

We should be able to follow the link to the Ubuntu thunderbird source package
to file a bug:

    >>> user_browser.getLink('File a bug here').click()
    >>> user_browser.url
    'http://launchpad.dev/ubuntu/+source/thunderbird/+filebug'

If we add a second product to the project, this too will be shown on the
filebug page:

    >>> admin_browser.open('http://launchpad.dev/test-group/+newproduct')
    >>> admin_browser.getControl(name='field.name', index=0).value = 'second-test'
    >>> admin_browser.getControl(name='field.displayname').value = 'Another product'
    >>> admin_browser.getControl(name='field.title').value = 'For Testing'
    >>> admin_browser.getControl(name='field.summary').value = 'Used for testing'
    >>> admin_browser.getControl('Continue').click()
    >>> print admin_browser.url
    http://launchpad.dev/test-group/+newproduct

    >>> admin_browser.getControl(name='field.licenses').value = ['GNU_GPL_V2']
    >>> admin_browser.getControl('Complete Registration').click()
    >>> admin_browser.url
    'http://launchpad.dev/second-test'

    >>> user_browser.open('http://launchpad.dev/test-group/+filebug')
    >>> print extract_text(find_tag_by_id(user_browser.contents,
    ...     'product-list-summary'))
    There are 2 projects registered as part of Test Group but none of them use
    Launchpad as their bug tracker.

    >>> for tag in find_tags_by_class(
    ...     user_browser.contents, 'product-bug-options'):
    ...     print extract_text(tag)
    Another product
    Another product does not use an external bug tracker or has not registered
    it with launchpad.
    Another product is not registered with any source packages. You can help
    by linking them for us.
    Testy Product
    External bug tracker: Debian Bug tracker.
    Source package: Ubuntu thunderbird (File a bug here)