mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-26 01:42:16 +00:00
Create the training database (#463)
Co-authored-by: josephjboyden <josephjboyden@gmail.com>
This commit is contained in:
42
training/tests/pages.py
Normal file
42
training/tests/pages.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from django.urls import reverse
|
||||
from pypom import Region
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.support import expected_conditions as EC
|
||||
|
||||
from PyRIGS.tests import regions
|
||||
from PyRIGS.tests.pages import BasePage, FormPage
|
||||
|
||||
|
||||
class TraineeDetail(BasePage):
|
||||
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
|
||||
Reference in New Issue
Block a user