diff --git a/pylenium/performance.py b/pylenium/performance.py index 25ab9ca..1e21d77 100644 --- a/pylenium/performance.py +++ b/pylenium/performance.py @@ -118,7 +118,6 @@ def measure(self, mark) -> float: js = 'return performance.measure("Measure", "{}");'.format(mark) measured = self._wait().until(lambda driver: driver.execute_script(js), "PerformanceMeasure not generated yet") return PerformanceMeasure(**measured).duration - class PerformanceMeasure(BaseModel): """The PerformanceMeasure Representation. diff --git a/tests/test_flows.py b/tests/test_flows.py index 58a7f03..3d407f6 100644 --- a/tests/test_flows.py +++ b/tests/test_flows.py @@ -27,8 +27,8 @@ def test_add_to_cart_xpath(self, sauce: Pylenium): sauce.getx("//a[@class='shopping_cart_link']").click() assert sauce.findx("//*[@class='cart_item']").should().have_length(6) - def test_add_to_cart_xpath(self, sauce: Pylenium): - """Add 6 different items to the cart. There should be 6 items in the cart.""" + def test_add_to_cart_xpath_duration(self, sauce: Pylenium): + """Add 6 different items to the cart. There should be 6 items in the cart. Duration should be less than 2000ms""" sauce.performance.mark("Adding item in cart") for button in sauce.findx("//*[contains(@id, 'add-to-cart')]"): button.click()