Initial refactor of event item testing

This commit is contained in:
2020-05-21 22:48:46 +01:00
parent 919975e1ba
commit 813db2c474
5 changed files with 121 additions and 211 deletions

View File

@@ -10,3 +10,31 @@ import datetime
class Header(Region):
def find_link(self, link_text):
return self.driver.find_element_by_partial_link_text(link_text)
class ItemRow(Region):
_name_locator = (By.XPATH, '//span[@class="name"]')
_description_locator = (By.XPATH, '//div[@class="item-description"]')
_price_locator = (By.XPATH, '//span[@class="cost"]')
_quantity_locator = (By.XPATH, '//td[@class="quantity"]')
_subtotal_locator = (By.XPATH, '//span[@class="sub-total"]')
@property
def name(self):
return self.find_element(*self._name_locator).text
@property
def description(self):
return self.find_element(*self._description_locator).text
@property
def price(self):
return self.find_element(*self._price_locator).text
@property
def quantity(self):
return self.find_element(*self._quantity_locator).text
@property
def subtotal(self):
return self.find_element(*self._subtotal_locator).text