From 6be7606250622fb47b372d6563cc07ee44338230 Mon Sep 17 00:00:00 2001 From: Kyle O'Brien <65071578+TawneeOwl@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:44:09 +0100 Subject: [PATCH] bug/LGA-3278-elgibility-check-fix (#145) * Add proeprty disputed check * Amend the logic * Formatting * Add tests * Swap around step * Linting * Amend tests * Add property click * Remove capital * add error * check by many * Amend the message text * Remove arguement --- .../cla_frontend/frontend_income.feature | 12 +++++- .../frontend_specialist_provider.feature | 11 +++--- behave/features/steps/frontend_income.py | 37 +++++++++++++++++++ 3 files changed, 54 insertions(+), 6 deletions(-) diff --git a/behave/features/cla_frontend/frontend_income.feature b/behave/features/cla_frontend/frontend_income.feature index 09fca52f..ecaf56fd 100644 --- a/behave/features/cla_frontend/frontend_income.feature +++ b/behave/features/cla_frontend/frontend_income.feature @@ -36,4 +36,14 @@ Scenario: Ensure that the dropdowns appear on income | Child Benefit (for household) | 99999999.99 | per month | | Maintenance received | 99999999.99 | per month | | Pension income | 99999999.99 | per month | - | Other income | 99999999.99 | per month | \ No newline at end of file + | Other income | 99999999.99 | per month | + +@property_disputed_error +Scenario: Ensure that the property disputed error appears + Given I select to 'Create a case' + And I have created a user + And I have created a valid debt case + And I move onto Finances inner-tab + And I click add property + And I select Save assessment + Then The errors for property are shown \ No newline at end of file diff --git a/behave/features/cla_frontend/frontend_specialist_provider.feature b/behave/features/cla_frontend/frontend_specialist_provider.feature index 2e3cfe69..62da051d 100644 --- a/behave/features/cla_frontend/frontend_specialist_provider.feature +++ b/behave/features/cla_frontend/frontend_specialist_provider.feature @@ -133,16 +133,17 @@ Scenario: Specialist Provider rejects a case @specialist-provider-upload-csv-errors Scenario: Specialist Provider upload a csv Given I am on the CSV upload page - When I select 'Choose file' and upload an invalid csv file - Then I select the month and year for the uploaded csv file - And I select the 'Upload' button - And I am given details of the errors in each line of the csv file - # Upload a valid csv file again straight after an error upload + # Upload a valid csv file When I select 'Choose file' and upload an valid csv file Then I select the month and year for the uploaded csv file And I select the 'Upload' button And I check that there are no errors in the csv upload page Then I can see the file listed in the uploaded files table + # Upload a error file after no errors + When I select 'Choose file' and upload an invalid csv file + Then I select the month and year for the uploaded csv file + And I select the 'Upload' button + And I am given details of the errors in each line of the csv file @specialist-provider-edit-case Scenario: Specialist Provider Edits a case diff --git a/behave/features/steps/frontend_income.py b/behave/features/steps/frontend_income.py index 54bf9351..652860ec 100644 --- a/behave/features/steps/frontend_income.py +++ b/behave/features/steps/frontend_income.py @@ -1,5 +1,6 @@ from behave import step from selenium.webdriver.support.ui import Select +from selenium.webdriver.common.by import By @step("I am on the financial page which i complete up to finances") @@ -84,3 +85,39 @@ def step_assert_income_field_values(context): ).get_attribute("value") assert select.first_selected_option.text == dropdown assert currentvalue == value + + +@step("I have created a valid debt case") +def step_impl_debt_scope(context): + context.execute_steps( + """ + When I select ‘Create Scope Diagnosis' + And I select the diagnosis and click next times + | category | number | + | Debt and housing - loss of home | 1 | + | Home owner, and the nature of the debt means they are at immediate risk of losing their home (Includes shared ownership if the client is living in the property) | 1 | + | The mortgage lender is seeking or has sought a court order to recover the property (due to mortgage arrears) | 1 | + | A warrant of possession has been received by client | 1 | + Then I get an "INSCOPE" decision + And select the "Create financial assessment" button + """ + ) + + +@step("I click add property") +def step_impl_click_property(context): + context.helperfunc.click_button(By.LINK_TEXT, "Add property") + + +@step("The errors for property are shown") +def step_impl_prop_error_returned(context): + error_message = context.helperfunc.find_many_by_class("Error-message") + error_messages = [ + "Enter the value of the property", + "Enter how much is left to pay on the mortgage", + "Select if the property is disputed", + "Select if this is the main property", + "Enter what percentage of the property the client owns", + ] + for message in error_message: + assert message.text in error_messages