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

« back to all changes in this revision

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

  • Committer: nskaggs
  • Date: 2014-07-02 18:02:21 UTC
  • mto: This revision was merged to the branch mainline in revision 344.
  • Revision ID: nicholas.skaggs@canonical.com-20140702180221-ie6a0zh9hlpsequ7
migrate to emulator function

Show diffs side-by-side

added added

removed removed

Lines of Context:
319
319
        event_details_page = self.open_event(name, filter_duplicates)
320
320
        return event_details_page.delete()
321
321
 
 
322
    @autopilot.logging.log_action(logger.info)
 
323
    def get_day_header(self, day=None):
 
324
        """Return the dayheader for a given day. If no day is given,
 
325
        return the current day.
 
326
 
 
327
        :param day: A datetime object matching the header
 
328
        :return: The day header object
 
329
        """
 
330
        if day:
 
331
            headers = self.select_many('TimeLineHeaderComponent')
 
332
            for header in headers:
 
333
                if header.startDay.datetime == day:
 
334
                    day_header = header
 
335
                    break
 
336
        else:
 
337
            # just grab the current day
 
338
            day_header = self.wait_select_single(
 
339
                'TimeLineHeaderComponent', isCurrentItem=True)
 
340
 
 
341
        if not(day_header):
 
342
            raise CalendarException('Day Header not found for %s' % day)
 
343
        return day_header
 
344
 
322
345
 
323
346
class EventBubble(toolkit_emulators.UbuntuUIToolkitEmulatorBase):
324
347