This is closer to a proper story and described the goals that Sample Person uses
+subscriptions to accomplish.
Subscriptions View
==================
XXX: bdmurray 2010-09-24 bug=628411 This story is complete until we publish
the link that leads to the +subscriptions page.
XXX: A story is written from a user's perspective. It explains how a user
accomplishes a task and how he know it. Use user names and rules when
telling the story. Stories do not test failure,
permissions, or method functions--that is the domain of unittests.
Any user can view the direct subcriptions that a person or team has to
bugs, blueprints, questions, branches, and merge proposals.
The user can see that the Ubuntu Team does not have an direct bug
subscritions.
>>> page_text = extract_text(find_main_content(anon_browser.contents))
>>> "does not have any direct bug subscriptions" in page_text
True
Any user can see that that Sample Person is subscribed to several bugs.
The bug subscriptions table includes the bug number, title and location.
>>> anon_browser.open('http://launchpad.dev/~name12/+subscriptions')
>>> bug_sub_table = find_tag_by_id(
... anon_browser.contents, 'bug_subscriptions')
>>> for tr in bug_sub_table.findAll('tr'):
... print extract_text(tr)
Summary
In
13
Launchpad CSS and JS is not testible
Launchpad
5
Firefox install instructions should be complete
...
4
Reflow problems with complex page layouts
Mozilla Firefox
2
Blackhole Trash folder
...
9
Thunderbird crashes
thunderbird (Ubuntu)
Sample Person can see his see his direct bug subscriptions too, and he can
use the page manage his direct subscriptions. He chooses to view bug 13, "Launchpad CSS and JS is not testible".
After viewing the +subscribe page Sample Person decides that he want to
reamain subscribed to bug 13. He uses the cancel link to
>>> sample_browser.getLink('Cancel').click()
>>> print sample_browser.title
Subscriptions: Sample Person
He chooses to unsubscribe from bug 2, "Blackhole Trash folder".
>>> sample_browser.getLink(id='unsubscribe-subscriber-2').click()
>>> print sample_browser.title
Unsubscribe from bug #2
Sample Person unselects the checkbox and continues.
>>> sample_browser.getControl('Unsubscribe me from this bug') = False
>>> sample_browser.getControl('Continue').click()
>>> print sample_browser.title
Subscriptions: Sample Person
Sample Person can see that bug #2 is not listed in his direct bug
subscriptions.
>>> print extract_text(find_tag_by_id(
... sample_browser.contents, 'bug_subscriptions'))
Summary In
13 Launchpad CSS and JS is not testible Launchpad
5 Firefox install instructions should be complete Mozilla Firefox
4 Reflow problems with complex page layouts Mozilla Firefox
9 Thunderbird crashes thunderbird (Ubuntu)
XXX The permission on the links is controlled by the view, so the test belong
there. ie. Sample Person did not come to Launchpad to faile.
If you view someone's subscriptions that you don't have permission to modify
there will be no edit subscription link.
XXX Do not use the test browser to setup data. we have a factory that is
#fast and reliable.
#Create a bug subscription for a team of which name16 is a member.
XXX Do not use name16. I know that name16 is an admin with super powers, Use
#admin_browser to make it clear you are testing features that admins perform.
#This is not an admin feature so do not use him...lots of tests like this mask
#permissions bugs.
#If you are the member of a team with bug subscriptions you will have edit
#subscriptions links in the bug subscription table.
>>> print extract_text(find_tag_by_id(
... sample_browser.contents, 'bug_subscriptions'))
Summary In
14 jokosher exposes personal details in its actions portlet Jokosher
>>> sample_browser.getLink(id='unsubscribe-subscriber-14').click()
>>> print sample_browser.title
Unsubscribe from bug #14
>>> sample_browser.getControl(
... 'Unsubscribe HWDB Team from this bug') = False
>>> sample_browser.getControl('Continue').click()
>>> print sample_browser.title
Subscriptions for HWDB Team
>>> page_text = extract_text(find_main_content(sample_browser.contents))
>>> "does not have any direct bug subscriptions" in page_text
True
This is closer to a proper story and described the goals that Sample Person uses
+subscriptions to accomplish.
Subscriptions View
==================
XXX: bdmurray 2010-09-24 bug=628411 This story is complete until we publish
the link that leads to the +subscriptions page.
XXX: A story is written from a user's perspective. It explains how a user
accomplishes a task and how he know it. Use user names and rules when
telling the story. Stories do not test failure,
permissions, or method functions--that is the domain of unittests.
Any user can view the direct subcriptions that a person or team has to
bugs, blueprints, questions, branches, and merge proposals.
>>> anon_browser.open('http:// launchpad. dev/~ubuntu- team/+subscript ions')
>>> print anon_browser.title
Subscriptions : “Ubuntu Team” team
The user can see that the Ubuntu Team does not have an direct bug
subscritions.
>>> page_text = extract_ text(find_ main_content( anon_browser. contents) )
>>> "does not have any direct bug subscriptions" in page_text
True
Any user can see that that Sample Person is subscribed to several bugs.
The bug subscriptions table includes the bug number, title and location.
>>> anon_browser.open('http:// launchpad. dev/~name12/ +subscriptions') contents, 'bug_subscripti ons') table.findAll( 'tr'):
>>> bug_sub_table = find_tag_by_id(
... anon_browser.
>>> for tr in bug_sub_
... print extract_text(tr)
Summary
In
13
Launchpad CSS and JS is not testible
Launchpad
5
Firefox install instructions should be complete
...
4
Reflow problems with complex page layouts
Mozilla Firefox
2
Blackhole Trash folder
...
9
Thunderbird crashes
thunderbird (Ubuntu)
Sample Person can see his see his direct bug subscriptions too, and he can
use the page manage his direct subscriptions. He chooses to view
bug 13, "Launchpad CSS and JS is not testible".
>>> sample_browser = setupBrowser( auth='Basic <email address hidden>:test') browser. open('http:// bugs.launchpad. dev/~name12/ +subscriptions') browser. getLink( id='unsubscribe -subscriber- 12').click( ) browser. title
>>> sample_
>>> sample_
>>> print sample_
Unsubscribe from bug #13
After viewing the +subscribe page Sample Person decides that he want to
reamain subscribed to bug 13. He uses the cancel link to
>>> sample_ browser. getLink( 'Cancel' ).click( ) browser. title
>>> print sample_
Subscriptions: Sample Person
He chooses to unsubscribe from bug 2, "Blackhole Trash folder".
>>> sample_ browser. getLink( id='unsubscribe -subscriber- 2').click( ) browser. title
>>> print sample_
Unsubscribe from bug #2
Sample Person unselects the checkbox and continues.
>>> sample_ browser. getControl( 'Unsubscribe me from this bug') = False browser. getControl( 'Continue' ).click( ) browser. title
>>> sample_
>>> print sample_
Subscriptions: Sample Person
Sample Person can see that bug #2 is not listed in his direct bug
subscriptions.
>>> print extract_ text(find_ tag_by_ id( browser. contents, 'bug_subscripti ons'))
... sample_
Summary In
13 Launchpad CSS and JS is not testible Launchpad
5 Firefox install instructions should be complete Mozilla Firefox
4 Reflow problems with complex page layouts Mozilla Firefox
9 Thunderbird crashes thunderbird (Ubuntu)
XXX The permission on the links is controlled by the view, so the test belong
there. ie. Sample Person did not come to Launchpad to faile.
If you view someone's subscriptions that you don't have permission to modify
there will be no edit subscription link.
XXX Do not use the test browser to setup data. we have a factory that is
#fast and reliable.
#Create a bug subscription for a team of which name16 is a member.
# >>> name16_browser = setupBrowser( auth='Basic <email address hidden>:test') browser. open( bugs.launchpad. dev/firefox/ +bug/1/ +addsubscriber') browser. getControl( 'Person' ).value = 'guadamen' browser. getControl( 'Subscribe user').click()
# >>> name16_
# ... 'http://
# >>> name16_
# >>> name16_
XXX Do not use name16. I know that name16 is an admin with super powers, Use
#admin_browser to make it clear you are testing features that admins perform.
#This is not an admin feature so do not use him...lots of tests like this mask
#permissions bugs.
#If you are the member of a team with bug subscriptions you will have edit
#subscriptions links in the bug subscription table.
# >>> name16_ browser. open('http:// launchpad. dev/~guadamen/ +subscriptions') browser. getLink( id='unsubscribe -subscriber- 32')
# >>> unsub_link = name16_
Sample Person chooses to review the subscriptions for his HWDB team.
>>> sample_ browser. open('https:/ /launchpad. dev/~hwdb- team/+subscript ions') browser. title
>>> print sample_
Subscriptions for HWDB Team
>>> print extract_ text(find_ tag_by_ id( browser. contents, 'bug_subscripti ons'))
... sample_
Summary In
14 jokosher exposes personal details in its actions portlet Jokosher
Sample Person chooses to unsubscribe from bug 14.
>>> sample_ browser. getLink( id='unsubscribe -subscriber- 14').click( ) browser. title
>>> print sample_
Unsubscribe from bug #14
>>> sample_ browser. getControl( browser. getControl( 'Continue' ).click( ) browser. title
... 'Unsubscribe HWDB Team from this bug') = False
>>> sample_
>>> print sample_
Subscriptions for HWDB Team
>>> page_text = extract_ text(find_ main_content( sample_ browser. contents) )
>>> "does not have any direct bug subscriptions" in page_text
True