diff --git a/PyRIGS/tests/regions.py b/PyRIGS/tests/regions.py index 6daef657..edd767c9 100644 --- a/PyRIGS/tests/regions.py +++ b/PyRIGS/tests/regions.py @@ -117,6 +117,16 @@ class TextBox(Region): 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): def toggle(self): self.root.click() diff --git a/RIGS/tests/pages.py b/RIGS/tests/pages.py index e458ecf1..f588fd12 100644 --- a/RIGS/tests/pages.py +++ b/RIGS/tests/pages.py @@ -96,7 +96,7 @@ class CreateEvent(FormPage): _warning_selector = (By.XPATH, '/html/body/div[1]/div[1]') form_items = { - 'description': (regions.TextBox, (By.ID, 'id_description')), + 'description': (regions.SimpleMDETextArea, (By.ID, 'id_description')), 'name': (regions.TextBox, (By.ID, 'id_name')), 'start_date': (regions.DatePicker, (By.ID, 'id_start_date')), @@ -110,7 +110,7 @@ class CreateEvent(FormPage): 'collected_by': (regions.TextBox, (By.ID, 'id_collector')), '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):