mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-24 00:42:17 +00:00
Region for selenium testing of SimpleMDE
Bleh, Javascript all around
This commit is contained in:
@@ -117,6 +117,16 @@ class TextBox(Region):
|
|||||||
self.root.send_keys(value)
|
self.root.send_keys(value)
|
||||||
|
|
||||||
|
|
||||||
|
class SimpleMDETextArea(Region):
|
||||||
|
@property
|
||||||
|
def value(self):
|
||||||
|
return self.driver.execute_script("return document.querySelector('#' + arguments[0]).nextSibling.nextSibling.CodeMirror.getDoc().getValue();", self.root.get_attribute("id"));
|
||||||
|
|
||||||
|
def set_value(self, value):
|
||||||
|
self.driver.execute_script("document.querySelector('#' + arguments[0]).nextSibling.nextSibling.CodeMirror.getDoc().setValue(arguments[1]);", self.root.get_attribute("id"), value);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CheckBox(Region):
|
class CheckBox(Region):
|
||||||
def toggle(self):
|
def toggle(self):
|
||||||
self.root.click()
|
self.root.click()
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ class CreateEvent(FormPage):
|
|||||||
_warning_selector = (By.XPATH, '/html/body/div[1]/div[1]')
|
_warning_selector = (By.XPATH, '/html/body/div[1]/div[1]')
|
||||||
|
|
||||||
form_items = {
|
form_items = {
|
||||||
'description': (regions.TextBox, (By.ID, 'id_description')),
|
'description': (regions.SimpleMDETextArea, (By.ID, 'id_description')),
|
||||||
|
|
||||||
'name': (regions.TextBox, (By.ID, 'id_name')),
|
'name': (regions.TextBox, (By.ID, 'id_name')),
|
||||||
'start_date': (regions.DatePicker, (By.ID, 'id_start_date')),
|
'start_date': (regions.DatePicker, (By.ID, 'id_start_date')),
|
||||||
@@ -110,7 +110,7 @@ class CreateEvent(FormPage):
|
|||||||
'collected_by': (regions.TextBox, (By.ID, 'id_collector')),
|
'collected_by': (regions.TextBox, (By.ID, 'id_collector')),
|
||||||
'po': (regions.TextBox, (By.ID, 'id_purchase_order')),
|
'po': (regions.TextBox, (By.ID, 'id_purchase_order')),
|
||||||
|
|
||||||
'notes': (regions.TextBox, (By.ID, 'id_notes'))
|
'notes': (regions.SimpleMDETextArea, (By.ID, 'id_notes'))
|
||||||
}
|
}
|
||||||
|
|
||||||
def select_event_type(self, type_name):
|
def select_event_type(self, type_name):
|
||||||
|
|||||||
Reference in New Issue
Block a user