def test_get_split_after_reset_timer(self):
     element = Element(self.driver, None)
     start_time = element.start_timer()
     assert hasattr(self.driver, "start_time")
     assert self.driver.start_time == start_time, "Expecting the start_time = {} - actual: {}".format(
         start_time, self.driver.start_time)
     element.reset_timer()
     split_time = element.get_split_time()
     assert split_time == 0, "Expecting the split time to be 0 if I haven't started a timer"
 def test_start_stop_multiple_times_timer(self):
     element = Element(self.driver, None)
     element_start_time = element.start_timer(type="element")
     time.sleep(0.5)
     element.stop_timer(type="element")
     time.sleep(0.5)
     element_end_time = element.stop_timer(type="element")
     duration = element.get_duration(type="element")
     self.timer_assertions(element_start_time, element_end_time, duration)
 def test_start_stop_duration_multiple_times_timer(self):
     element = Element(self.driver, None)
     start_time = element.start_timer()
     time.sleep(0.5)
     end_time = element.stop_timer()
     time.sleep(0.5)
     element.get_duration()
     time.sleep(0.5)
     element.get_duration()
     duration = element.get_duration()
     self.timer_assertions(start_time, end_time, duration)
 def test_start_get_duration_multiple_times_timer(self):
     element = Element(self.driver, None)
     start_time = element.start_timer()
     time.sleep(0.5)
     duration = element.get_duration()
     end_time = self.driver.end_time
     time.sleep(0.5)
     actual_duration = element.get_duration()
     assert str(actual_duration) == str(duration), "Expecting duration to be the same - actual: {} - expected: {}".format(
         actual_duration, duration)
     time.sleep(0.5)
     actual_duration = element.get_duration()
     assert str(actual_duration) == str(duration), "Expecting duration to be the same - actual: {} - expected: {}".format(
         actual_duration, duration)
     self.timer_assertions(start_time, end_time, duration)
 def test_start_stop_split_timer(self):
     element = Element(self.driver, None)
     start_time = element.start_timer()
     time.sleep(0.5)
     split_time = element.get_split_time()
     assert split_time > 0
     assert not hasattr(self.driver, "end_time") or self.driver.end_time == 0
     time.sleep(0.5)
     split_time = element.get_split_time()
     assert not hasattr(self.driver, "end_time") or self.driver.end_time == 0
     assert split_time > 0
     time.sleep(0.5)
     end_time = element.stop_timer()
     duration = element.get_duration()
     assert duration > split_time
     self.timer_assertions(start_time, end_time, duration)
 def test_start_timer(self):
     element = Element(self.driver, None)
     start_time = element.start_timer()
     assert hasattr(self.driver, "start_time")
     assert self.driver.start_time == start_time, "Expecting the start_time = {} - actual: {}".format(
         start_time, self.driver.start_time)
 def test_element_start_timer(self):
     element = Element(self.driver, None)
     element_start_time = element.start_timer(type="element")
     assert hasattr(self.driver, "element_start_time")
     assert self.driver.element_start_time == element_start_time, "Expecting the element_start_time = {} - actual: {}".format(
         element_start_time, self.driver.element_start_time)