Merge lp:~elopio/ubuntuone-testing/removenotes into lp:ubuntuone-testing

Proposed by Leo Arias
Status: Merged
Approved by: Rick McBride
Approved revision: 81
Merged at revision: 81
Proposed branch: lp:~elopio/ubuntuone-testing/removenotes
Merge into: lp:ubuntuone-testing
Diff against target: 182 lines (+0/-158)
3 files modified
ubuntuone/web/tests/sst/navigation/u1webn001_maintabs.py (+0/-2)
ubuntuone/web/tests/sst/shared/actions/notes.py (+0/-129)
ubuntuone/web/tests/sst/smoketest/notespage.py (+0/-27)
To merge this branch: bzr merge lp:~elopio/ubuntuone-testing/removenotes
Reviewer Review Type Date Requested Status
Rick McBride (community) Approve
Review via email: mp+97771@code.launchpad.net

Commit message

Removed the remaining notes tests and actions.

Description of the change

Removed the remaining notes tests and actions.

To post a comment you must log in.
Revision history for this message
Rick McBride (rmcbride) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntuone/web/tests/sst/navigation/u1webn001_maintabs.py'
--- ubuntuone/web/tests/sst/navigation/u1webn001_maintabs.py 2011-12-09 18:26:08 +0000
+++ ubuntuone/web/tests/sst/navigation/u1webn001_maintabs.py 2012-03-15 23:17:19 +0000
@@ -23,12 +23,10 @@
23import actions.setup as setup_actions23import actions.setup as setup_actions
24import actions.dashboard as dashboard_actions24import actions.dashboard as dashboard_actions
25import actions.files as files_actions25import actions.files as files_actions
26import actions.notes as notes_actions
27import actions.contacts as contacts_actions26import actions.contacts as contacts_actions
2827
29setup_actions.setup()28setup_actions.setup()
30dashboard_actions.assert_page_title()29dashboard_actions.assert_page_title()
31files_actions.open()30files_actions.open()
32notes_actions.open()
33contacts_actions.open()31contacts_actions.open()
34dashboard_actions.open()32dashboard_actions.open()
3533
=== removed file 'ubuntuone/web/tests/sst/shared/actions/notes.py'
--- ubuntuone/web/tests/sst/shared/actions/notes.py 2012-02-02 00:51:29 +0000
+++ ubuntuone/web/tests/sst/shared/actions/notes.py 1970-01-01 00:00:00 +0000
@@ -1,129 +0,0 @@
1# -*- coding: utf-8 -*-
2
3# Copyright 2011 Canonical Ltd.
4#
5# This program is free software: you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 3, as published
7# by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY; without even the implied warranties of
11# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12# PURPOSE. See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program. If not, see <http://www.gnu.org/licenses/>.
16
17"""Actions for the Notes page of the Ubuntu One website."""
18
19from sst.actions import *
20from loading import *
21from selenium.webdriver.common import keys
22
23
24def open():
25 """Open the notes page and check its title with an assert."""
26 click_link(_get_notes_link(), wait=False)
27 switch_to_window()
28 assert_page_title()
29
30
31def _get_notes_link():
32 return get_element_by_css('#main-nav .notes')
33
34
35def assert_page_title():
36 """Assert that the title of the page is the expected."""
37 assert_title(u'Ubuntu One : Notes')
38
39
40def assert_note_exists(title):
41 get_element(tag='li', text=title)
42
43
44def select_note(title):
45 click_link(_get_note_link(title))
46 wait_for_action_to_complete()
47
48
49def _get_note_link(title):
50 return get_element(tag='a', css_class='note_link', text=title)
51
52
53def assert_note(title, body):
54 if title:
55 displayed_title = _get_note_title()
56 assert displayed_title == title, \
57 'Title is %(displayed)s, but it should be %(expected)s.' % \
58 {'displayed':displayed_title, 'expected':title}
59 if body:
60 displayed_body = _get_note_body()
61 assert displayed_body == body, \
62 'Body is %(displayed)s, but it should be %(expected)s.' % \
63 {'displayed':displayed_body, 'expected':body}
64
65
66def _get_note_title():
67 return get_element_by_css('#notes-main > h2').text
68
69
70def _get_note_body():
71 return get_element_by_css('#notes-main > .note-view').text
72
73
74def add_note(title, body):
75 """Click the button to add note."""
76 _click_add_note()
77 _fill(title, body)
78 _save()
79
80
81def _click_add_note():
82 link_add = get_element(css_class='add-button')
83 click_link(link_add)
84 wait_for_action_to_complete()
85
86
87def _fill(title, body):
88 if title:
89 write_textfield('id_title', title)
90 if body:
91 switch_to_frame('id_body_editor')
92 body_element = get_element(tag='body')
93 body_element.send_keys(keys.Keys().CONTROL, 'a')
94 body_element.send_keys(keys.Keys().DELETE)
95 body_element.send_keys(body)
96 switch_to_frame()
97
98
99def _save():
100 link_save = get_elements(css_class='save-button')[0]
101 click_element(link_save)
102 wait_for_action_to_complete()
103
104
105def edit_note(edited_title, edited_body):
106 """Click the button to edit note."""
107 _click_edit_note()
108 _fill(edited_title, edited_body)
109 _save()
110
111
112def _click_edit_note():
113 link_edit = get_elements(css_class='edit-button')[0]
114 click_link(link_edit)
115 wait_for_action_to_complete()
116
117
118def delete_note(title):
119 """Delete the note"""
120 select_note(title)
121 delete_button = get_element_by_css('li.selected > a.delete-button')
122 click_element(delete_button, wait=False)
123 accept_alert()
124 wait_for_action_to_complete()
125
126
127def assert_note_was_deleted(title):
128 fails(assert_note_exists, title)
129 assert_text('notes-main', '"%s" has been deleted' % title)
1300
=== removed file 'ubuntuone/web/tests/sst/smoketest/notespage.py'
--- ubuntuone/web/tests/sst/smoketest/notespage.py 2011-12-09 18:19:11 +0000
+++ ubuntuone/web/tests/sst/smoketest/notespage.py 1970-01-01 00:00:00 +0000
@@ -1,27 +0,0 @@
1# -*- coding: utf-8 -*-
2
3# Authors:
4# Rick McBride <rick.mcbride@canonical.com>
5#
6# Copyright 2011 Canonical Ltd.
7#
8# This program is free software: you can redistribute it and/or modify it
9# under the terms of the GNU General Public License version 3, as published
10# by the Free Software Foundation.
11#
12# This program is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranties of
14# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
15# PURPOSE. See the GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License along
18# with this program. If not, see <http://www.gnu.org/licenses/>.
19
20'''Check existence of notes Page.'''
21from sst.actions import *
22import actions.setup as setup_actions
23
24setup_actions.setup(new_user=False)
25go_to("/notes/")
26setup_actions.wait_for(assert_title, u"Ubuntu One : Notes")
27exists_element(css_class='add-button', text='Add note')

Subscribers

People subscribed via source and target branches