Code review comment for lp:~brian-murray/launchpad/limited-subscriptions-page

Revision history for this message
Curtis Hovey (sinzui) wrote :

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/+subscriptions')
    >>> 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')
    >>> 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".

    >>> sample_browser = setupBrowser(auth='Basic <email address hidden>:test')
    >>> sample_browser.open('http://bugs.launchpad.dev/~name12/+subscriptions')
    >>> sample_browser.getLink(id='unsubscribe-subscriber-12').click()
    >>> print sample_browser.title
   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()
    >>> 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.

# >>> name16_browser = setupBrowser(auth='Basic <email address hidden>:test')
# >>> name16_browser.open(
# ... 'http://bugs.launchpad.dev/firefox/+bug/1/+addsubscriber')
# >>> name16_browser.getControl('Person').value = 'guadamen'
# >>> name16_browser.getControl('Subscribe user').click()

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')
# >>> unsub_link = name16_browser.getLink(id='unsubscribe-subscriber-32')

Sample Person chooses to review the subscriptions for his HWDB team.

    >>> sample_browser.open('https://launchpad.dev/~hwdb-team/+subscriptions')
    >>> print sample_browser.title
    Subscriptions for HWDB Team

    >>> 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 Person chooses to unsubscribe from bug 14.

    >>> 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

« Back to merge proposal