~nskaggs/ubuntu-clock-app/fix-icon

« back to all changes in this revision

Viewing changes to tests/autopilot/ubuntu_clock_app/tests/test_timer.py

  • Committer: Tarmac
  • Author(s): Nekhelesh Ramananthan
  • Date: 2014-02-19 01:38:49 UTC
  • mfrom: (326.1.32 fix-alarm-tests)
  • Revision ID: tarmac-20140219013849-407u35re9qe24rzn
Fixes the alarm tests. Fixes: https://bugs.launchpad.net/bugs/1188809, https://bugs.launchpad.net/bugs/1188810.

Approved by Ubuntu Phone Apps Jenkins Bot, Leo Arias.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        # Move to Timer tab
45
45
        self.main_view.switch_to_tab("TimerTab")
46
46
 
47
 
    def select_name_preset_label(self):
48
 
        label = self.main_view.get_timer_name_preset()
49
 
        timeout = 0
50
 
        while not label.focus and timeout < 10:
51
 
            self.pointing_device.click_object(label)
52
 
            sleep(1)
53
 
            timeout += 1
54
 
        return label
55
 
 
56
47
    def delete_first_preset(self):
57
 
        self.main_view.drag_page_up("TimerPage", self)
 
48
        self.main_view.drag_page_up("TimerPage")
58
49
 
59
50
        # Delete the preset
60
51
        first_preset = self.main_view.get_first_preset_list_item()
69
60
        self.main_view.get_toolbar().click_button('addPresetButton')
70
61
 
71
62
        # Set Timer label as "test"
72
 
        self.main_view.drag_page_up("TimerPage", self)
73
 
        label = self.select_name_preset_label()
74
 
        self.assertThat(label.focus, Eventually(Equals(True)))
75
 
        self.keyboard.type("test")
76
 
        self.assertThat(label.text, Eventually(Equals("test")))
77
 
 
78
 
        self.main_view.drag_page_down("TimerPage", self)
 
63
        self.main_view.drag_page_up("TimerPage")
 
64
        label = self.main_view.get_timer_name_preset()
 
65
        label.write("AutopilotTimer")
 
66
        self.assertThat(label.text, Eventually(Equals("AutopilotTimer")))
 
67
        self.main_view.drag_page_down("TimerPage")
79
68
 
80
69
        if setTime:
81
70
            # Set timer minute
124
113
        # Create a new preset
125
114
        self.add_preset()
126
115
 
127
 
        self.main_view.drag_page_up("TimerPage", self)
 
116
        self.main_view.drag_page_up("TimerPage")
128
117
 
129
118
        # Click to select the preset
130
119
        # FIXME: Instead of always running the first preset, run the preset which was created
131
120
        first_preset = self.main_view.get_first_preset_list_item()
132
121
        self.pointing_device.click_object(first_preset)
133
122
 
134
 
        self.main_view.drag_page_down("TimerPage", self)
 
123
        self.main_view.drag_page_down("TimerPage")
135
124
 
136
125
        # Click to start the preset
137
126
        label = self.main_view.get_label_timer()