Code review comment for lp:~om26er/ubuntu-calendar-app/robust_test

Revision history for this message
Kunal Parmar (pkunal-parmar) wrote :

looks good,

Can you check, what's wrong with following

Here, timeline_base.eventCount is always returning 0, where in QML is gets updates after sometime.
Is there way to overcome this ?

    def event_count_for_dayview(self):
        #retuns event count for dayview
        day_view = self.main_view.get_day_view()
        self.assertThat(lambda: day_view, Eventually(Not(Is(None))))

        path_base = day_view.select_single("PathViewBase",
                                           objectName="DayViewPathBase")
        current_index = path_base.currentIndex
        com_name = "DayComponent-" + str(current_index)
        #print("Comp Name:" , com_name)
        day_component = path_base.select_single("DayComponent",
                                                objectName=com_name)
        self.assertThat(lambda: day_component, Eventually(Not(Is(None))))

        timeline_base = day_component.select_single("TimeLineBase",
                                                    objectName="timeLineBase")
        self.assertThat(lambda: timeline_base, Eventually(Not(Is(None))))

        print("Event count:", timeline_base.eventCount)
        return (timeline_base.eventCount)

review: Approve

« Back to merge proposal