~phablet-team/gallery-app/trunk

« back to all changes in this revision

Viewing changes to tests/autopilot/gallery_app/tests/test_albums_view.py

  • Committer: CI bot
  • Author(s): Ugo Riboni
  • Date: 2014-10-17 07:40:32 UTC
  • mfrom: (1101.1.2 dont-create-album-on-cancel)
  • Revision ID: ps-jenkins@lists.canonical.com-20141017074032-sgbfti6w3pjr2rke
Delete the new empty album if the album editor is closed by clicking outside of the album cover Fixes: 1234128
Approved by: Arthur Mello

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
 
69
69
    def test_add_album_and_cancel(self):
70
70
        """Add one album, cancel it and checks if the number of albums does
71
 
        not change
 
71
        not change. Do this in the two different ways we have to cancel editing.
72
72
        """
 
73
 
 
74
        # Cancel by pressing back in the header
73
75
        albums = self.albums_view.number_of_albums_in_albums_view()
74
76
        self.main_view.get_header().click_action_button("addButton")
75
77
        editor = self.app.select_single(album_editor.AlbumEditor)
80
82
            Eventually(Equals(albums))
81
83
        )
82
84
 
 
85
        # Cancel by clicking outside of the album cover
 
86
        self.main_view.get_header().click_action_button("addButton")
 
87
        editor = self.app.select_single(album_editor.AlbumEditor)
 
88
        editor.ensure_fully_open()
 
89
        editor.close()
 
90
 
 
91
        self.assertThat(
 
92
            lambda: self.albums_view.number_of_albums_in_albums_view(),
 
93
            Eventually(Equals(albums))
 
94
        )
 
95
 
83
96
    # Check if Camera Button is not visible at Desktop mode
84
97
    def test_camera_button_visible(self):
85
98
        cameraButtonVisible = self.check_header_button_exist("cameraButton")