~schwann/gallery-app/gallery-no-album-share

« back to all changes in this revision

Viewing changes to tests/autopilot/goodhope/tests/test_photo_viewer.py

  • Committer: Omer Akram
  • Date: 2012-11-30 12:56:27 UTC
  • mto: (428.7.2 gallgood)
  • mto: This revision was merged to the branch mainline in revision 447.
  • Revision ID: om26er@ubuntu.com-20121130125627-3jvgzerxi1e4231p
add docstrings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
        self.mouse.click()
37
37
 
38
38
    def test_photo_viewer_chrome(self):
 
39
        """Opening a photo must show the viewer chrome e.g trash, share
 
40
        buttons.
 
41
 
 
42
        """
39
43
        photo_viewer_chrome = self.photo_viewer.get_photo_viewer_chrome()
40
44
 
41
45
        self.assertThat(photo_viewer_chrome.visible, Eventually(Equals(True)))
42
46
 
43
47
    def test_nav_bar_back_button(self):
 
48
        """Clicking the back button must close the photo."""
44
49
        photo_viewer = self.photo_viewer.get_main_photo_viewer()
45
50
        back_button = self.photo_viewer.get_viewer_chrome_back_button()
46
51
 
50
55
        self.assertThat(photo_viewer.visible, Eventually(Equals(False)))
51
56
 
52
57
    def test_nav_bar_trash_button(self):
 
58
        """Clicking the trash button must show the delete dialog."""
53
59
        trash_button = self.photo_viewer.get_viewer_chrome_trash_button()
54
60
        delete_dialog = self.photo_viewer.get_delete_dialog()
55
61
 
61
67
        self.assertThat(delete_dialog.visible, Eventually(Equals(True)))
62
68
 
63
69
    def test_nav_bar_album_picker_button(self):
 
70
        """Clicking the album picker must show the picker dialog."""
64
71
        album_button = self.photo_viewer.get_viewer_chrome_album_button()
65
72
        album_picker = self.photo_viewer.get_popup_album_picker()
66
73
 
71
78
        self.assertThat(album_picker.visible, Eventually(Equals(True)))
72
79
 
73
80
    def test_nav_bar_share_button(self):
 
81
        """Clicking the share button must show the share dialog."""
74
82
        share_button = self.photo_viewer.get_viewer_chrome_share_button()
75
83
        share_menu = self.photo_viewer.get_share_dialog()
76
84
 
81
89
        self.assertThat(share_menu.visible, Eventually(Equals(True)))
82
90
 
83
91
    def test_nav_bar_more_button(self):
 
92
        """Click 'more' button must show more options."""
84
93
        more_button = self.photo_viewer.get_viewer_chrome_more_button()
85
94
        more_menu = self.photo_viewer.get_more_dialog()
86
95
 
91
100
        self.assertThat(more_menu.visible, Eventually(Equals(True)))
92
101
 
93
102
    def test_nav_bar_edit_button(self):
 
103
        """Clicking the edit button must show the edit dialog."""
94
104
        edit_button = self.photo_viewer.get_viewer_chrome_toolbar_edit_button()
95
105
        edit_dialog = self.photo_viewer.get_photo_edit_dialog()
96
106
 
101
111
        self.assertThat(edit_dialog.visible, Eventually(Equals(True)))
102
112
 
103
113
    def test_double_click_zoom(self):
 
114
        """Double clicking an opened photo must zoom it."""
104
115
        opened_photo = self.photo_viewer.get_photo_component()
105
116
 
106
117
        self.mouse.move_to_object(opened_photo)
115
126
        self.assertThat(opened_photo.fullyUnzoomed, Eventually(Equals(True)))
116
127
 
117
128
    def test_photo_crop_box_shows(self):
 
129
        """Clicking the crop item in the edit dialog must show crop interactor."""
118
130
        edit_button = self.photo_viewer.get_viewer_chrome_toolbar_edit_button()
119
131
        crop_item = self.photo_viewer.get_crop_menu_item()
120
132
        crop_box = self.photo_viewer.get_crop_interactor()