Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LTD-5709] Add E2E tests for licence condtions pre-fill #2271

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ commands:
default: auto
type: string
steps:
- browser-tools/install-chrome
- browser-tools/install-chrome:
chrome-version: "125.0.6422.112"
replace-existing: true
- browser-tools/install-chromedriver
- run:
name: "Install dependencies"
Expand Down
2 changes: 1 addition & 1 deletion caseworker/advice/templates/advice/advice_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ <h2 class="govuk-heading-m">Reason for approving</h2>

{% if advice.0.proviso %}
<h2 class="govuk-heading-m">Licence condition</h2>
<p class="govuk-body">{{ advice.0.proviso|linebreaks }}</p>
<div class="govuk-body licence-condition">{{ advice.0.proviso|linebreaks }}</div>
{% endif %}

{% if advice.0.note %}
Expand Down
2 changes: 1 addition & 1 deletion caseworker/advice/templates/advice/group-advice.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ <h3 class="govuk-heading-s">Reasons for refusing</h3>
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<h3 class="govuk-heading-s">Licence condition</h3>
<p class="govuk-body">{{ advice.proviso|linebreaks }}</p>
<div class="licence-condition govuk-body">{{ advice.proviso|linebreaks }}</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "serial numbers" in the licence condition
4 changes: 2 additions & 2 deletions ui_tests/caseworker/pages/advice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
5 changes: 5 additions & 0 deletions ui_tests/caseworker/step_defs/test_give_advice/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading