~kobe24-lixiang/ubiquity-ubuntukylin/trunk

« back to all changes in this revision

Viewing changes to autopilot/ubiquity_autopilot_tests/tests/test_nonenglish_default.py

  • Committer: kobe
  • Date: 2014-08-22 06:37:21 UTC
  • Revision ID: xiangli@ubuntukylin.com-20140822063721-p145o500i2y7o48h
first version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Testing Default Install for the Ubiquity Installer
 
2
# Author: Dan Chapman <daniel@chapman-mail.com>
 
3
# Copyright (C) 2013
 
4
#
 
5
# This program is free software: you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License version 3 as
 
7
# published by the Free Software Foundation.
 
8
#
 
9
# This program is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
# GNU General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License
 
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
from ubiquity_autopilot_tests.tests import UbiquityAutopilotTestCase
 
17
from testtools.matchers import Equals
 
18
from autopilot.matchers import Eventually
 
19
from ubiquity_autopilot_tests.emulators import gtktoplevel
 
20
 
 
21
 
 
22
class DefaultInstallTestCase(UbiquityAutopilotTestCase):
 
23
    """
 
24
    A default install testcase just generally clicks through the installer
 
25
    using all the default values
 
26
    """
 
27
 
 
28
    def test_default_install(self, ):
 
29
        #first check we have an emulator instance
 
30
        flavor = self.get_distribution()
 
31
        self.assertIsInstance(self.main_window, gtktoplevel.GtkWindow)
 
32
        self.assertThat(self.main_window.visible, Eventually(Equals(True)))
 
33
        self.welcome_page_tests()
 
34
        self.go_to_next_page()
 
35
        self.preparing_page_tests()
 
36
        self.go_to_next_page()
 
37
        if flavor == 'Edubuntu':
 
38
            self.edubuntu_addon_window_tests(ltsp=True)
 
39
            self.go_to_next_page()
 
40
            self.edubuntu_packages_window_tests()
 
41
            self.go_to_next_page()
 
42
        self.installation_type_page_tests(default=True)
 
43
        self.go_to_next_page(wait=True)
 
44
        self.location_page_tests()
 
45
        self.go_to_next_page()
 
46
        self.keyboard_layout_page_tests()
 
47
        self.go_to_next_page()
 
48
        self.user_info_page_tests('Autopilot', 'password')
 
49
        self.go_to_progress_page()
 
50
 
 
51
        self.progress_page_tests()
 
52
        self.assertThat(lambda: self.app.select_single(
 
53
            'GtkDialog',
 
54
            name='finished_dialog').visible,
 
55
            Eventually(Equals(True), timeout=180))
 
56
        #XXX: Uncomment if you want to restart after install complete
 
57
        ## we need to sleep here to wait for dialog to fully load. It appears
 
58
        ## in dbus before its actually visible. As the test has already passed
 
59
        ## this doesn't affect outcome
 
60
        #time.sleep(5)
 
61
        #
 
62
        #self.keyboard.press_and_release('Enter')