Skip to content

Commit

Permalink
Merge pull request #2068 from uktrade/LTD-5130-Amend-by-copy-E2E-tests
Browse files Browse the repository at this point in the history
LTD-5130: Add BDD scenario for amending an application by copy
  • Loading branch information
saruniitr authored Jul 19, 2024
2 parents a22a826 + 61d87c0 commit e9e0db9
Show file tree
Hide file tree
Showing 5 changed files with 372 additions and 12 deletions.
4 changes: 2 additions & 2 deletions exporter/templates/applications/applications.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ <h1 class="govuk-heading-l">
</a>
<a href="{% url 'applications:applications' %}?sort_by=submitted_at&selected_filter=finalised_applications"
class="lite-tabs__tab {% if request.build_absolute_uri|has_param:"selected_filter=finalised_applications" %}lite-tabs__tab--selected{% endif %}"
id="applications-tab-draft">
id="applications-tab-finalised">
Finalised
</a>
<a href="{% url 'applications:applications' %}?sort_by=-created_at&selected_filter=draft_tab" class="lite-tabs__tab" id="applications-tab-draft">
<a href="{% url 'applications:applications' %}?sort_by=-created_at&selected_filter=draft_tab" class="lite-tabs__tab" id="applications-tab-drafts">
{% lcs "applications.ApplicationsList.DRAFTS_TAB" %}
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions exporter/templates/applications/drafts.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ <h1 class="govuk-heading-l">
</a>
<a href="{% url 'applications:applications' %}?sort_by=submitted_at&selected_filter=finalised_applications"
class="lite-tabs__tab"
id="applications-tab-draft">
id="applications-tab-finalised">
Finalised
</a>
<a href="{% url 'applications:applications' %}?sort_by=-created_at&selected_tab=draft_tab" class="lite-tabs__tab lite-tabs__tab--selected">
<a href="{% url 'applications:applications' %}?sort_by=-created_at&selected_tab=draft_tab" class="lite-tabs__tab lite-tabs__tab--selected" id="applications-tab-drafts">
{% lcs "applications.ApplicationsList.DRAFTS_TAB" %}
</a>
</div>
Expand Down
25 changes: 17 additions & 8 deletions ui_tests/exporter/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,24 @@ def go_to_exporter(driver, register_organisation, sso_sign_in, exporter_url, con
if mock_sso_login_screen and settings.MOCK_SSO_ACTIVATE_ENDPOINTS:
MockSigninPage(driver).sign_in(exporter_info["email"])

if "select-organisation" in driver.current_url:
no = utils.get_element_index_by_text(Shared(driver).get_radio_buttons_elements(), context.org_name)
Shared(driver).click_on_radio_buttons(no)
functions.click_submit(driver)
elif Shared(driver).get_text_of_organisation_heading() != context.org_name:
organisation_index = None
if "select-organisation" not in driver.current_url:
Hub(driver).click_switch_link()
no = utils.get_element_index_by_text(Shared(driver).get_radio_buttons_elements(), context.org_name)
Shared(driver).click_on_radio_buttons(no)
functions.click_submit(driver)

organisation_index = utils.get_element_index_by_text(
Shared(driver).get_radio_buttons_elements(),
context.org_name,
)
Shared(driver).click_on_radio_buttons(organisation_index)

organisation_id = driver.find_element(
by=By.ID,
value=f"id_organisation_{organisation_index + 1}",
).get_property("value")

context.organisation = {"id": organisation_id, "name": context.org_name}

functions.click_submit(driver)


@given("Only my email is to be processed by LITE-HMRC")
Expand Down
71 changes: 71 additions & 0 deletions ui_tests/exporter/features/amendments/siel_amendments.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
@all
Feature: I want to submit SIEL applications and be able to make major amendments and resubmit
As a logged in exporter
I want to submit SIEL applications and be able to make major amendments and resubmit

@skip
# Enable this scenario when this flow is enabled by default for all Exporters
Scenario: Exporter making major amendments to an already submitted application
Given I signin and go to exporter homepage and choose Test Org
And I create a standard draft application with "Amend by copy" as reference
When I go to task list of the draft application
And I add Consignee with details "Consignee", "1234 Consignee address", "FR"
And I add End-user with details "End user", "1234 End-user address", "AU"
And I add a set of products to the application as json:
[
{"name": "Sporting shotgun", "part_number": "SP123", "control_list_entries": ["6A005b5b1"]},
{"name": "Sodium chloride", "part_number": "NACL", "control_list_entries": ["PL9010"]},
{"name": "Ammunition", "part_number": "PN156", "control_list_entries": ["ML1a"]},
{"name": "Magnetic sensor", "part_number": "MAG690", "control_list_entries": ["6A006"]},
{"name": "Imaging device", "part_number": "IMX300", "control_list_entries": ["ML22a"]}
]
And I continue to submit application
And I click continue
And I agree to the declaration
Then application is submitted
And I record application reference code
#
# Edit journey
#
When I go to my list of applications
And I click on the application previously submitted
And I proceed to edit this application
Then I see confirmation page to open application for editing
When I confirm to edit the application
Then I see task list of amended application
#
# Status checks
#
When I go to my list of applications
And I click on the application previously submitted
Then the application cannot be opened for editing
And the application status is "Superseded by exporter edit"
When I go to my list of applications
Then I see new application ready for amendments under drafts
#
# Products and party checks
#
When I go to task list of the amended draft application
And I click on "Tell us about the products" section
Then I see products with below details as json:
["Sporting shotgun", "Sodium chloride", "Ammunition", "Magnetic sensor", "Imaging device"]
When I go to task list of the amended draft application
And I click on "Consignee" section
Then I see Consignee with details "Consignee", "1234 Consignee address, France"
When I go to task list of the amended draft application
And I click on "End user" section
Then I see End-user with details "End user", "1234 End-user address Australia"
#
# Making an edit
#
When I go to task list of the amended draft application
And I click on "Your reference" section
And I edit exporter reference as "Amended reference" and submit
Then I see exporter reference updated as "Amended reference"
#
# Submit amended application
#
When I continue to submit application
And I click continue
And I agree to the declaration
Then application is submitted
Loading

0 comments on commit e9e0db9

Please sign in to comment.