Add an interaction test

Just one. Lol.
This commit is contained in:
2022-01-12 20:24:35 +00:00
parent aa6bb8410e
commit 7aba26218f
5 changed files with 94 additions and 5 deletions

View File

@@ -8,10 +8,35 @@ from PyRIGS.tests.pages import BasePage, FormPage
class TraineeDetail(BasePage):
URL_TEMPLATE = 'trainee/{pk}'
URL_TEMPLATE = 'training/trainee/{pk}'
_name_selector = (By.XPATH, '//h2')
@property
def page_name(self):
return self.find_element(*self._name_selector).text
class AddQualification(FormPage):
URL_TEMPLATE = 'training/trainee/{pk}/add_qualification/'
_item_selector = (By.XPATH, '//div[1]/form/div[1]/div')
_supervisor_selector = (By.XPATH, '//div[1]/form/div[3]/div')
form_items = {
'depth': (regions.SingleSelectPicker, (By.ID, 'id_depth')),
'date': (regions.DatePicker, (By.ID, 'id_date')),
'notes': (regions.TextBox, (By.ID, 'id_notes')),
}
@property
def item_selector(self):
return regions.BootstrapSelectElement(self, self.find_element(*self._item_selector))
@property
def supervisor_selector(self):
return regions.BootstrapSelectElement(self, self.find_element(*self._supervisor_selector))
@property
def success(self):
return 'add' not in self.driver.current_url