diff --git a/caseworker/advice/templates/advice/advice_details.html b/caseworker/advice/templates/advice/advice_details.html index 88da2ba709..fcf62e4a24 100644 --- a/caseworker/advice/templates/advice/advice_details.html +++ b/caseworker/advice/templates/advice/advice_details.html @@ -129,7 +129,7 @@

Reason for approving

{% if advice.0.proviso %}

Licence condition

-

{{ advice.0.proviso|linebreaks }}

+
{{ advice.0.proviso|linebreaks }}
{% endif %} {% if advice.0.note %} diff --git a/ui_tests/caseworker/features/give_advice/lu_consolidate_advice.feature b/ui_tests/caseworker/features/give_advice/lu_consolidate_advice.feature index 8a54e2a4da..1174e61660 100644 --- a/ui_tests/caseworker/features/give_advice/lu_consolidate_advice.feature +++ b/ui_tests/caseworker/features/give_advice/lu_consolidate_advice.feature @@ -52,3 +52,77 @@ Feature: I want to record my user advice and any comments and conditions relatin And I click on "Details" tab Then I see the case status is now "Finalised" And I see the case is not assigned to any queues + + @lu_consolidate_advice_ogd_licence_conditions + Scenario: LU consolidate advice with OGD licence conditions + Given I sign in as Test UAT user + And I create standard application or standard application has been previously created + # LR + When I switch to "Licensing Reception" with queue "Licensing Reception SIEL applications" and I submit the case + Then I see the case status is now "Initial checks" + And I see the case is assigned to queues "Enforcement Unit Cases to Review, Technical Assessment Unit SIELs to Review" + # EU + When I switch to "Enforcement Unit" with queue "Enforcement Unit Cases to Review" and I submit the case + Then I see the case status is now "Initial checks" + And I see the case is assigned to queues "Technical Assessment Unit SIELs to Review" + And I see the case is not assigned to queues "Enforcement Unit Cases to Review" + # TAU + When I go to my profile page + And I change my team to "Technical Assessment Unit" and default queue to "Technical Assessment Unit SIELs to Review" + And I go to my case list + Then I see previously created application + When I click on the application previously created + And I assign myself to the case + Then I click on Product assessment + And I select good + And I select the CLE "ML1a" + And I select "components for" / "microwave components" as report summary prefix / subject and regime to none and submit + When I click move case forward + Then I don't see previously created application + # LU + When I switch to "Licensing Unit" with queue "Licensing Unit Pre-circulation Cases to Review" and I submit the case + Then I see the case status is now "OGD Advice" + And I see the case is assigned to queues "MOD-DI Indirect cases to review, MOD-CapProt cases to review, FCDO Cases to Review" + # MOD-DI + When I switch to "MOD-DI" with queue "MOD-DI Indirect cases to review" and I submit the case + Then I see the case status is now "OGD Advice" + And I see the case is assigned to queues "MOD-CapProt cases to review, FCDO Cases to Review" + + ##### Sub-advisor to give advice ##### + When I go to my profile page + And I change my team to "MOD-CapProt" and default queue to "MOD-CapProt cases to review" + And I go to my case list + Then I should see my case in the cases list + When I click the application previously created + And I assign myself to the case + And I click the recommendations and decision tab + And I click make recommendation + And I click approve all + And I click continue + And I enter "reason for approving" as the reasons for approving + And I click the text "Add a licence condition, instruction to exporter or footnote" + And I enter "MOD licence condition" as the licence condition + And I enter "instruction for exporter" as the instructions for the exporter + And I enter "reporting footnote" as the reporting footnote + And I click submit recommendation + Then I see "reason for approving" as the reasons for approving + And I see "MOD licence condition" as the licence condition + And I see "instruction for exporter" as the instructions for the exporter + And I see "reporting footnote" as the reporting footnote + When I logout + Given I sign in as Licensing Unit Officer + And I prepare the application for final review + When I go to my case list + And I go to my case list + And I click the application previously created + And I assign myself as case officer to the case + And I go to my case list + And I click the application previously created + And I click the recommendations and decision tab + And I click "Review and combine" + And I enter "reason for approving" as the reasons for approving + And I click "Add licence condition" + And I click submit recommendation + Then I see "reason for approving" as the reasons for approving + And I see "MOD licence condition" in the licence condition + And I see "condition that you add the firearm’s serial numbers" in the licence condition diff --git a/ui_tests/caseworker/pages/advice.py b/ui_tests/caseworker/pages/advice.py index 7cf2de31fa..47d685c6d6 100644 --- a/ui_tests/caseworker/pages/advice.py +++ b/ui_tests/caseworker/pages/advice.py @@ -165,8 +165,8 @@ def get_refusal_note(self): def get_licence_condition(self): return self.driver.find_element( - by=By.XPATH, - value="//p[preceding-sibling::*[self::h2 or self::h3][contains(text(), 'Licence condition')]][2]", + by=By.CLASS_NAME, + value="licence-condition", ).text def get_instructions_for_exporter(self): diff --git a/ui_tests/caseworker/step_defs/test_give_advice/conftest.py b/ui_tests/caseworker/step_defs/test_give_advice/conftest.py index ab9dc74ee8..d22b7034ea 100644 --- a/ui_tests/caseworker/step_defs/test_give_advice/conftest.py +++ b/ui_tests/caseworker/step_defs/test_give_advice/conftest.py @@ -133,6 +133,11 @@ def should_see_licence_condition(driver, licence_condition, context): # noqa assert RecommendationsAndDecisionPage(driver).get_licence_condition() == licence_condition +@then(parsers.parse('I see "{licence_condition}" in the licence condition')) +def should_see_licence_condition(driver, licence_condition, context): # noqa + assert licence_condition in RecommendationsAndDecisionPage(driver).get_licence_condition() + + @then(parsers.parse('I see "{instructions}" as the instructions for the exporter')) def should_see_instructions_for_exporter(driver, instructions, context): # noqa assert RecommendationsAndDecisionPage(driver).get_instructions_for_exporter() == instructions