~pkunal-parmar/ubuntu-calendar-app/CustomSwipeArea

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): nskaggs
  • Date: 2014-03-20 14:56:32 UTC
  • mfrom: (212.1.7 revert-212)
  • Revision ID: tarmac-20140320145632-hul9eb00eot702ed
Revert rev 212. Fixes: https://bugs.launchpad.net/bugs/1294181.

Approved by Timo Jyrinki, Ubuntu Phone Apps Jenkins Bot.

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
 
14
from testtools.matchers import Equals, Not, Is, NotEquals
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()
49
53
 
50
54
        #click on new event button
51
55
        self.main_view.open_toolbar().click_button("neweventbutton")
68
72
        ok = picker.select_single("Button", objectName="TimePickerOKButton")
69
73
        self.pointing_device.click_object(ok)
70
74
 
71
 
        # Set the end time
 
75
        ## Set the end time
72
76
        end_time_field = self.main_view.get_event_end_time_field()
73
77
        self.pointing_device.click_object(end_time_field)
74
78
        picker = self.main_view.get_time_picker()
83
87
        self.keyboard.type("My location")
84
88
        self.assertThat(location_field.text, Eventually(Equals("My location")))
85
89
 
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
 
 
93
90
        #click save button
94
91
        self.main_view.open_toolbar().click_button("eventSaveButton")
95
92
 
96
93
        #verify that the event has been created in timeline
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))))
 
94
        self.main_view.open_toolbar().click_button("todaybutton")
 
95
        self.assertThat(self.main_view.get_num_events,
 
96
                        Eventually(NotEquals(num_events)))