~cimi/unity8/scope-settings

« back to all changes in this revision

Viewing changes to tests/autopilot/unity8/shell/tests/test_lock_screen.py

  • Committer: Andrea Cimitan
  • Date: 2014-08-07 16:17:06 UTC
  • mfrom: (1109.1.25 unity8)
  • Revision ID: andrea.cimitan@gmail.com-20140807161706-j6ndy7bgz457xn4n
[ Michal Hruby ]
* Work with the scopes-v4 branch + departments->navigation renaming
[ Michał Sawicz ]
* Hardcode art shape size for click scope local and predefined
  categories While at it, drop the fillmode of cards
* Use the correct API in PageHeader. (LP: #1353048)
* Refactor dash activity indicator. (LP: #1351539)
[ Albert Astals ]
* Dash Departments fixes Update maxHeight manually since it depends on
  the position of the item and its parents and it can't know when the
  binding has to be updated Make parent stuff non interactive when the
  department list is shown
* PageHeader: when on search clip y-coordinates otherwise the
  background spills out when on search (LP: #1350398)
* Dash: Implement OverlayColor support in Cards
* Hardcode art shape size for click scope local and predefined
  categories While at it, drop the fillmode of cards
* Make test_departments test more stable There's various
  DashDepartments on the dash, make sure we're working over the one
  that is on screen, otherwise clicks don't end up where they should
* Work with the scopes-v4 branch + departments->navigation renaming
* Fixes for dash as app Load i18n catalog Process command line options
  Add the posibility to have a mouse touch adaptor (LP: #1353351)
* Implement the Expandable Preview Widget Now TextSummary is not
  expandable by itself anymore, you have to use it inside an
  Expandable to get the behaviour
* Add test prefix to xml output, seems CI needs it
[ Antti Kaijanmäki ]
* Indicators: Adds new ModemInfoItem to be used with indicator-network
  (LP: #1329204)
[ Michael Terry ]
* When the edge demo is running, don't show the greeter if the screen
  is turned off. This avoids an odd interaction where parts of the
  greeter are disabled but the edge demo isn't visible until you slide
  the greeter away. (LP: #1283425)
* Don't hardcode the phablet password in our testing script.
[ Ying-Chun Liu ]
* Add divider dots.
[ Mirco Müller ]
* Make sure the TextField of a snap-decision notification has the
  active focus upon creation, thus the osk shows up right away. (LP:
  #1346867)
[ Andrea Cimitan ]
* Add touchdown effect to dash cards.
* Import Ubuntu.Components for preview image gallery to pick up
  default flicking speeds.
[ Michael Zanetti ]
* Split the dash from the shell into a separate app (LP: #1232687)
[ Leo Arias ]
* Update the autopilot tests to work with the new dash app.
[ Daniel d'Andrada ]
* Split the dash from the shell into a separate app (LP: #1232687)

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
        if greeter.narrowMode:
52
52
            unlock_unity(unity_proxy)
53
53
            lockscreen = self._wait_for_lockscreen()
54
 
            self._enter_pincode("1234")
 
54
            self.main_window.enter_pin_code("1234")
55
55
            self.assertThat(lockscreen.shown, Eventually(Equals(False)))
56
56
        else:
57
57
            self._enter_prompt_passphrase("1234")
81
81
        if greeter.narrowMode:
82
82
            unlock_unity(unity_proxy)
83
83
            lockscreen = self._wait_for_lockscreen()
84
 
            self._enter_pincode("4321")
 
84
            self.main_window.enter_pin_code("4321")
85
85
            pinentryField = self.main_window.get_pinentryField()
86
86
            self.assertThat(pinentryField.text, Eventually(Equals("")))
87
87
            self.assertThat(lockscreen.shown, Eventually(Equals(True)))
118
118
        self.assertThat(lockscreen.shown, Eventually(Equals(True)))
119
119
        return lockscreen
120
120
 
121
 
    def _enter_pincode(self, code):
122
 
        """Enter code 'code' into the single-pin lightdm pincode entry
123
 
        screen.
124
 
 
125
 
        :param code: must be a string of numeric characters.
126
 
        :raises: TypeError if code is not a string.
127
 
        :raises: ValueError if code contains non-numeric characters.
128
 
 
129
 
        """
130
 
 
131
 
        if not isinstance(code, basestring):
132
 
            raise TypeError(
133
 
                "'code' parameter must be a string, not %r."
134
 
                % type(code)
135
 
            )
136
 
        for num in code:
137
 
            if not num.isdigit():
138
 
                raise ValueError(
139
 
                    "'code' parameter contains non-numeric characters."
140
 
                )
141
 
            self.touch.tap_object(self.main_window.get_pinPadButton(int(num)))
142
 
 
143
121
    def _enter_pin_passphrase(self, passphrase):
144
122
        """Enter the password specified in 'passphrase' into the password entry
145
123
        field of the pin lock screen.
148
126
        :raises: TypeError if passphrase is not a string.
149
127
 
150
128
        """
151
 
        if not isinstance(passphrase, basestring):
 
129
        if not isinstance(passphrase, str):
152
130
            raise TypeError(
153
131
                "'passphrase' parameter must be a string, not %r."
154
132
                % type(passphrase)
155
133
            )
156
134
 
157
 
        pinentryField = self.main_window.get_pinentryField()
158
 
        self.touch.tap_object(pinentryField)
159
 
        self.assertThat(pinentryField.activeFocus, Eventually(Equals(True)))
160
 
        for character in passphrase:
161
 
            self._type_character(character, pinentryField)
162
 
        logger.debug("Typed passphrase: %s", pinentryField.text)
 
135
        pin_entry_field = self.main_window.get_pinentryField()
 
136
        pin_entry_field.write(passphrase)
 
137
        logger.debug("Typed passphrase: %s", pin_entry_field.text)
163
138
        self.keyboard.type("\n")
164
139
 
165
140
    def _enter_prompt_passphrase(self, passphrase):
177
152
            )
178
153
 
179
154
        prompt = self.main_window.get_greeter().get_prompt()
180
 
        self.touch.tap_object(prompt)
181
 
        self.assertThat(prompt.activeFocus, Eventually(Equals(True)))
182
 
        for character in passphrase:
183
 
            self._type_character(character, prompt)
 
155
        prompt.write(passphrase)
184
156
        logger.debug("Typed passphrase: %s", prompt.text)
185
157
        self.keyboard.type("\n")
186
 
 
187
 
    def _type_character(self, character, prompt, retries=5):
188
 
        current_text = prompt.text
189
 
        self.keyboard.type(character)
190
 
        try:
191
 
            self.assertThat(
192
 
                prompt.text, Eventually(Equals(current_text + character)))
193
 
        except AssertionError:
194
 
            if retries > 0:
195
 
                self._type_character(character, prompt, retries-1)
196
 
            else:
197
 
                raise