+
Risk Assessment for Event N{{ object.event.pk|stringformat:"05d" }} {{ object.event.name }}
-
@@ -149,9 +143,8 @@
Edit
+
View Event
{{ object.review_string|safe }}
-
-
{% include 'partials/last_edited.html' with target="riskassessment_history" %}
diff --git a/RIGS/templates/risk_assessment_form.html b/RIGS/templates/risk_assessment_form.html
index dcde1caa..5606834f 100644
--- a/RIGS/templates/risk_assessment_form.html
+++ b/RIGS/templates/risk_assessment_form.html
@@ -106,7 +106,7 @@
{% include 'partials/yes_no_radio.html' with formitem=form.safe_loading %}
{% include 'partials/yes_no_radio.html' with formitem=form.safe_storage %}
{% include 'partials/yes_no_radio.html' with formitem=form.area_outside_of_control %}
- {% include 'partials/yes_no_radio.html' with formitem=form.barrier_required %}
+ {% include 'partials/yes_no_radio.html' with formitem=form.barrier_required %}
{% include 'partials/yes_no_radio.html' with formitem=form.nonstandard_emergency_procedure %}
diff --git a/RIGS/tests/pages.py b/RIGS/tests/pages.py
index e9fc39aa..c5b6562b 100644
--- a/RIGS/tests/pages.py
+++ b/RIGS/tests/pages.py
@@ -17,7 +17,7 @@ class Index(BasePage):
class Rigboard(BasePage):
URL_TEMPLATE = reverse('rigboard')
- _add_item_selector = (By.CSS_SELECTOR, 'a.btn:nth-child(2)')
+ _add_item_selector = (By.XPATH, "//a[contains(@class, 'btn-success') and contains(., 'New')]")
_event_row_locator = (By.ID, 'event_row')
def add(self):
@@ -86,11 +86,9 @@ class CreateEvent(FormPage):
URL_TEMPLATE = reverse('event_create')
_is_rig_selector = (By.ID, 'is_rig-selector')
- _bottom_save_selector = (By.XPATH, '//*[@id="main"]/form/div/div[6]/div/button')
_submit_locator = (By.XPATH, "//button[@type='submit' and contains(., 'Save')]")
- # TODO The ID is now no longer on the highest level element on the selector, annoyingly
- _person_selector_selector = (By.XPATH, '//*[@id="main"]/form/div/div[3]/div[1]/div[2]/div[1]/div/div/div[1]/div')
- _venue_selector_selector = (By.XPATH, '//*[@id="main"]/form/div/div[3]/div[1]/div[2]/div[1]/div/div/div[1]/div')
+ _person_selector_selector = (By.XPATH, '//*[@id="id_person"]/..')
+ _venue_selector_selector = (By.XPATH, '//*[@id="id_venue"]/..')
_mic_selector_selector = (By.XPATH, '//*[@id="form-hws"]/div[7]/div[1]/div/div')
_add_person_selector = (By.XPATH, '//a[@data-target="#id_person" and contains(@href, "add")]')
@@ -118,7 +116,7 @@ class CreateEvent(FormPage):
}
def select_event_type(self, type_name):
- self.find_element(By.XPATH, '//button[.="' + type_name + '"]').click()
+ self.find_element(By.XPATH, '//button[.="{}"]'.format(type_name)).click()
def item_row(self, ID):
return rigs_regions.ItemRow(self, self.find_element(By.ID, "item-" + ID))
@@ -133,7 +131,7 @@ class CreateEvent(FormPage):
@property
def is_expanded(self):
- return self.find_element(*self._bottom_save_selector).is_displayed()
+ return self.find_element(*self._submit_locator).is_displayed()
@property
def person_selector(self):
@@ -164,7 +162,6 @@ class CreateEvent(FormPage):
class DuplicateEvent(CreateEvent):
URL_TEMPLATE = 'event/{event_id}/duplicate'
- _submit_locator = (By.XPATH, '/html/body/div[1]/form/div/div[5]/div/button')
@property
def success(self):
@@ -173,7 +170,6 @@ class DuplicateEvent(CreateEvent):
class EditEvent(CreateEvent):
URL_TEMPLATE = 'event/{event_id}/edit'
- _submit_locator = (By.XPATH, '/html/body/div[1]/form/div/div[5]/div/button')
@property
def success(self):
diff --git a/RIGS/tests/test_functional.py b/RIGS/tests/test_functional.py
index 06e78d60..cb90b09c 100644
--- a/RIGS/tests/test_functional.py
+++ b/RIGS/tests/test_functional.py
@@ -190,7 +190,7 @@ class TestEventCreate(BaseRigboardTest):
# Expected to fail
self.page.submit()
self.assertFalse(self.page.success)
- self.assertIn("can't finish before it has started", self.page.errors["General form errors"][0])
+ self.assertIn("Unless you've invented time travel, the event can't finish before it has started.", self.page.errors["End date"])
self.wait.until(animation_is_finished())
# Fix it
@@ -200,7 +200,6 @@ class TestEventCreate(BaseRigboardTest):
self.page.submit()
self.assertTrue(self.page.success)
- # TODO Seperated because of the way submit checks erroring
def test_date_validation_2(self):
self.select_event_type("Rig")
@@ -209,7 +208,6 @@ class TestEventCreate(BaseRigboardTest):
self.page.person_selector.toggle()
self.assertFalse(self.page.person_selector.is_open)
- self.page.name = "Test Date Validation"
# end time before start
self.page.start_date = datetime.date(2020, 1, 1)
self.page.start_time = datetime.time(10, 00)
@@ -218,7 +216,7 @@ class TestEventCreate(BaseRigboardTest):
# Expected to fail
self.page.submit()
self.assertFalse(self.page.success)
- self.assertIn("can't finish before it has started", self.page.errors["General form errors"][0])
+ self.assertIn("Unless you've invented time travel, the event can't finish before it has started.", self.page.errors["End time"])
# Fix it
self.page.end_time = datetime.time(23, 00)
@@ -227,23 +225,16 @@ class TestEventCreate(BaseRigboardTest):
self.page.submit()
self.assertTrue(self.page.success)
- def test_access_validation(self):
+ self.page = pages.CreateEvent(self.driver, self.live_server_url).open()
self.select_event_type("Rig")
- self.page.person_selector.search(self.client.name)
- self.page.person_selector.set_option(self.client.name, True)
- self.page.person_selector.toggle()
- self.assertFalse(self.page.person_selector.is_open)
-
- self.page.name = "Access Validation Test"
-
self.page.start_date = datetime.date(2020, 1, 1)
self.page.access_at = datetime.datetime(2020, 1, 5, 10)
self.page.submit()
self.assertFalse(self.page.success)
self.assertTrue(self.page.errors is not None)
- self.assertIn("access time cannot be after the event has started.", self.page.errors["General form errors"][0])
+ self.assertIn("Regardless of what some clients might think, access time cannot be after the event has started.", self.page.errors["Access at"])
# Fix it
self.page.access_at = datetime.datetime(2020, 1, 1, 10)
diff --git a/assets/templates/partials/asset_list_table.html b/assets/templates/partials/asset_list_table.html
index 8be8e148..de8f713d 100644
--- a/assets/templates/partials/asset_list_table.html
+++ b/assets/templates/partials/asset_list_table.html
@@ -11,7 +11,7 @@
{% for item in object_list %}
-
+
| {{ item.asset_id }} |
{{ item.description }} |
{{ item.category }} |
diff --git a/templates/form_errors.html b/templates/form_errors.html
index 67751dd8..ed348790 100644
--- a/templates/form_errors.html
+++ b/templates/form_errors.html
@@ -5,8 +5,10 @@
{% with form|nice_errors as qq %}
{% for error_name,desc in qq.items %}
- - {{error_name}}
- - {{desc}}
+
+ - {{error_name}}
+ - {{desc}}
+
{% endfor %}
{% endwith %}