Skip to content

Commit

Permalink
bug/LGA-3278-elgibility-check-fix (#145)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
TawneeOwl authored Oct 21, 2024
1 parent 3acdee2 commit 6be7606
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 6 deletions.
12 changes: 11 additions & 1 deletion behave/features/cla_frontend/frontend_income.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| 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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 37 additions & 0 deletions behave/features/steps/frontend_income.py
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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 <category> and click next <number> 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

0 comments on commit 6be7606

Please sign in to comment.