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_stop_duration_multiple_times_timer(self):
     element = Element(self.driver, None)
     element_start_time = element.start_timer(type="element")
     time.sleep(0.5)
     element_end_time = element.stop_timer(type="element")
     time.sleep(0.5)
     element.get_duration(type="element")
     time.sleep(0.5)
     element.get_duration(type="element")
     duration = element.get_duration(type="element")
     self.timer_assertions(element_start_time, element_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)