~timo-jyrinki/ubuntu-calendar-app/revert_213_that_reverted_212

« back to all changes in this revision

Viewing changes to tests/autopilot/calendar_app/tests/test_calendar.py

  • Committer: Timo Jyrinki
  • Date: 2014-03-24 13:56:27 UTC
  • Revision ID: timo.jyrinki@canonical.com-20140324135627-l1kr11f5avrabstp
Revert bzr213 that reverted bzr212, taking into accound conflicts in calendar.qml and WeekView.qml.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
from autopilot.matchers import Eventually
13
13
 
14
 
from testtools.matchers import Equals, Not, Is, NotEquals
 
14
from testtools.matchers import Equals, Not, Is
15
15
 
16
16
import time
17
17
 
46
46
 
47
47
    def test_new_event(self):
48
48
        """test add new event """
49
 
        #go to today
50
 
        self.main_view.switch_to_tab("dayTab")
51
 
        self.main_view.open_toolbar().click_button("todaybutton")
52
 
        num_events = self.main_view.get_num_events()
53
49
 
54
50
        #click on new event button
55
51
        self.main_view.open_toolbar().click_button("neweventbutton")
72
68
        ok = picker.select_single("Button", objectName="TimePickerOKButton")
73
69
        self.pointing_device.click_object(ok)
74
70
 
75
 
        ## Set the end time
 
71
        # Set the end time
76
72
        end_time_field = self.main_view.get_event_end_time_field()
77
73
        self.pointing_device.click_object(end_time_field)
78
74
        picker = self.main_view.get_time_picker()
87
83
        self.keyboard.type("My location")
88
84
        self.assertThat(location_field.text, Eventually(Equals("My location")))
89
85
 
 
86
        #input people
 
87
        people_field = self.main_view.get_event_people_field()
 
88
        self.pointing_device.click_object(people_field)
 
89
        self.assertThat(people_field.activeFocus, Eventually(Equals(True)))
 
90
        self.keyboard.type("Me")
 
91
        self.assertThat(people_field.text, Eventually(Equals("Me")))
 
92
 
90
93
        #click save button
91
94
        self.main_view.open_toolbar().click_button("eventSaveButton")
92
95
 
93
96
        #verify that the event has been created in timeline
94
 
        self.main_view.open_toolbar().click_button("todaybutton")
95
 
        self.assertThat(self.main_view.get_num_events,
96
 
                        Eventually(NotEquals(num_events)))
 
97
        self.main_view.switch_to_tab("dayTab")
 
98
        self.assertThat(lambda: self.main_view.get_label_with_text(
 
99
                        eventTitle, root=self.main_view.get_day_view()),
 
100
                        Eventually(Not(Is(None))))