<commit_before>*** Settings ***
Documentation   IFS-6237 Loans - Application submitted screen
...
...             IFS-6238 Loans - Application submitted email
...
...             IFS-6205 Loans - T&Cs select page
...
...             IFS-6207 Loans - Your Funding - How much funding is required
...
...             IFS-6208 Loans - Updates to Finance Summary Table
...
...             IFS-6369 Loans - Remove Financial year table from Spend Profile
...
...             IFS-6292 Loans - Finance Checks - Remove 'Approved' and link to viability checks
...
...             IFS-6285 Loans - Remove Bank Details - External Journey - Project Setup
...
...             IFS-6307 Loans - Remove Bank Details - Internal Journey - Project Setup
...
...             IFS-6363 Loans - Project Setup Complete - Internal Screen & Submission
...
...             IFS-6294 Loans - Project Setup Complete External Journey
...
...             IFS-6298 Loans - Project Setup Content Review
...
...             IFS-6368 Loans - Remove Documents
...
...             IFS-7244 - Loans should not have change funding percentage
...
...             IFS-8944 SBRI milestones - Record changes to milestones
...
...             IFS-9483 Loans: Content changes and banner
...
...             IFS-9484 Loans: Applicant journey
...
...             IFS-10703 Loans question - open in Salesforce (as second tab)
...
...             IFS-9679 MO Spend profile: IFS Admin only to be able to approve or reject spend profiles
...
...             IFS-10705  B&FI question submitted
...
...             IFS-10753 Loans - Application Overview business and financial information Content
...
...             IFS-10825 Assessor Dashboard Business and Financial Overview
...
...             IFS-10757 Loans - Application summary and Overview Content
...
...             IFS-10761 Loans - Implement redirection to Application Overview from SF using single tab
...
...             IFS-10869 Loans Part B: remove unnecessary banner
...

Suite Setup     Custom suite setup
Suite Teardown  Custom suite teardown
Resource        ../../../resources/defaultResources.robot
Resource        ../../../resources/common/Applicant_Commons.robot
Resource        ../../../resources/common/PS_Common.robot
Resource          ../../../resources/common/Competition_Commons.robot

*** Variables ***
${loan_comp_PS}                            Project setup loan comp
${loan_comp_PS_Id}                         ${competition_ids["${loan_comp_PS}"]}
${loan_comp_application}                   Loan Competition
${loanApplicationName}                     Loan Application
${loan_comp_appl_id}                       ${competition_ids["${loan_comp_application}"]}
${loanApplicationID}                       ${application_ids["${loanApplicationName}"]}
${loan_PS_application1}                    Loan Project 1
${loan_PS_application2}                    Loan Project 2
${loan_PS_application_Id}                  ${application_ids["${loan_PS_application1}"]}
${loan_PS_project_Id}                      ${project_ids["${loan_PS_application1}"]}
${loan_PS_project_Id2}                     ${project_ids["${loan_PS_application2}"]}
${loan_PS}                                 ${server}/project-setup/project/${loan_PS_project_Id}
${loan_PS_Url}                             ${loan_PS}/details
${loan_finance_checks}                     ${server}/project-setup-management/project/${loan_PS_project_Id}/finance-check
${eligibility_changes}                     ${loan_finance_checks}/organisation/${EMPIRE_LTD_ID}/eligibility/changes
${spend_profile}                           ${server}/project-setup-management/project/${loan_PS_project_Id}/spend-profile/approval


*** Test Cases ***
The user can navigate back to application overview in the same window from part b questions form
    [Documentation]     IFS-10761
    When the user creates a new application
    And the user clicks the button/link                           link = Business and financial information
    And the user clicks the button/link                           jQuery = a:contains("Continue")
    And the user logs in if username field present
    Then title should be                                           Home

The user can see b&fi application question as complete and shows edit online survey button
    [Documentation]    IFS-9484  IFS-10705  IFS-10703
    Given the user navigates to the page                    ${server}/applicant/dashboard
    When The user clicks the button/link                    link = ${loanApplicationName}
    And the user clicks the button/link                     link = Business and financial information
    Then the user should see b&fi question details

the user can open the sales force new tab on clicking conitnue button in incomplete status of b&fi question
    [Documentation]   IFS-10703
    Given the sales force submits/unsubmits b&fi survey     0
    When the user clicks the button/link                    jQuery = a:contains("Continue")
    And the user logs in if username field present
    Then title should be                                    Home

The user will not be able to mark the application as complete without completing business and financial information
    [Documentation]    IFS-9484  IFS-10705 IFS-10757
    Given the user navigates to the page                        ${server}/applicant/dashboard
    And The user clicks the button/link                         link = ${loanApplicationName}
    When the user clicks the button/link                        id = application-overview-submit-cta
    Then the user should see that the element is disabled       id = submit-application-button
    And The user clicks the button/link                         id = accordion-questions-heading-1-1
    And The user should not see the element                     jQuery = #accordion-questions-content-1-1 button:contains("Mark")
    And the user should see the element                         jQuery = .section-incomplete + button:contains("Business and financial information")
    And the user should see the element                         jQuery = h2:contains("Applicant details")
    And the user should see the element                         jQuery = h2:contains("Project finance")

The user can see the business and financial information application question in application overview as complete
    [Documentation]    IFS-9484  IFS-10705
    When the sales force submits/unsubmits b&fi survey     1
    Then the user should see the element                   jQuery = .section-complete + button:contains("Business and financial information")

Return and edit button should not change the status of B&FI question
    [Documentation]    IFS-11019
    When the user clicks the button/link   jQuery = #accordion-questions-content-1-1 button:contains("Return and edit")
    Then the user should see the element   jQuery = p:contains("This question is marked as complete.")

Loan application shows correct T&C's
    [Documentation]    IFS-6205  IFS-9483  IFS-9716
    Given the user clicks the button/link   link = Back to application overview
    And the user clicks the button/link     link = Loan terms and conditions
    And the user should see the element     jQuery = h1:contains("Loans terms and conditions")
    When the user clicks the button/link    link = Back to application overview
    Then the user should see the element    jQuery = li:contains("Loan terms and conditions") .task-status-complete

Max funding sought validation
    [Documentation]  IFS-7866
    Given the user sets max available funding              60000  ${loan_comp_appl_id}
    When the user enters a value over the max funding
    Then the user should see a field and summary error     Your funding sought exceeds GBP 60,000. You must lower your funding level percentage or your project costs.

Loan application Your funding
    [Documentation]  IFS-6207
    Given the user enters empty funding amount
    When the user enters text to a text field  id = amount   57,803
    And the user clicks the button/link        id = mark-all-as-complete
    Then the user should see the element       jQuery = td:contains("200,903") ~ td:contains("57,803") ~ td:contains("30.00%") ~ td:contains("2,468") ~ td:contains("140,632")

Loan application finance overview
    [Documentation]  IFS-6208
    Given the user clicks the button/link  link = Back to application overview
    When the user clicks the button/link   link = Finances overview
    Then the user should see the element   jQuery = td:contains("200,903") ~ td:contains("57,803") ~ td:contains("30.00%") ~ td:contains("2,468") ~ td:contains("140,632")

Loan application submission
    [Documentation]  IFS-6237  IFS-6238  IFS-9483 IFS-10825 IFS-10869
    Given the user submits the loan application
    When the user clicks the button/link            link = View application
    Then the user should see the element            jQuery = h1:contains("Application overview")
    And the user should see the element             jQuery = span:contains("Thanks for submitting Part B of your loan application.")
    And the user should see the element             jQuery = span:contains("What happens next")
    And the user should see the element             jQuery = p:contains("We will make our decision based on: Suitability of your business to receive a loan and the quality of the project.")
    And the user reads his email                    ${lead_applicant_credentials["email"]}   Complete your application for Loan Competition   You have completed your application for Loan Competition.

Assessor can view BFI question in application
   [Documentation]   IFS-10825
   [Setup]  log in as a different user                                      &{internal_finance_credentials}
   Given moving competition to Closed                                       ${loan_comp_appl_id}
   When the user navigates to the page                                      ${server}/management/competition/${loan_comp_appl_id}/assessors/find<commit_msg>Added At's for IFS-11137<commit_after>*** Settings ***
Documentation   IFS-6237 Loans - Application submitted screen
...
...             IFS-6238 Loans - Application submitted email
...
...             IFS-6205 Loans - T&Cs select page
...
...             IFS-6207 Loans - Your Funding - How much funding is required
...
...             IFS-6208 Loans - Updates to Finance Summary Table
...
...             IFS-6369 Loans - Remove Financial year table from Spend Profile
...
...             IFS-6292 Loans - Finance Checks - Remove 'Approved' and link to viability checks
...
...             IFS-6285 Loans - Remove Bank Details - External Journey - Project Setup
...
...             IFS-6307 Loans - Remove Bank Details - Internal Journey - Project Setup
...
...             IFS-6363 Loans - Project Setup Complete - Internal Screen & Submission
...
...             IFS-6294 Loans - Project Setup Complete External Journey
...
...             IFS-6298 Loans - Project Setup Content Review
...
...             IFS-6368 Loans - Remove Documents
...
...             IFS-7244 - Loans should not have change funding percentage
...
...             IFS-8944 SBRI milestones - Record changes to milestones
...
...             IFS-9483 Loans: Content changes and banner
...
...             IFS-9484 Loans: Applicant journey
...
...             IFS-10703 Loans question - open in Salesforce (as second tab)
...
...             IFS-9679 MO Spend profile: IFS Admin only to be able to approve or reject spend profiles
...
...             IFS-10705  B&FI question submitted
...
...             IFS-10753 Loans - Application Overview business and financial information Content
...
...             IFS-10825 Assessor Dashboard Business and Financial Overview
...
...             IFS-10757 Loans - Application summary and Overview Content
...
...             IFS-10761 Loans - Implement redirection to Application Overview from SF using single tab
...
...             IFS-10869 Loans Part B: remove unnecessary banner
...
...             IFS-11137 Content change mop-up relating to Loans Part B epic
...

Suite Setup     Custom suite setup
Suite Teardown  Custom suite teardown
Resource        ../../../resources/defaultResources.robot
Resource        ../../../resources/common/Applicant_Commons.robot
Resource        ../../../resources/common/PS_Common.robot
Resource          ../../../resources/common/Competition_Commons.robot

*** Variables ***
${loan_comp_PS}                            Project setup loan comp
${loan_comp_PS_Id}                         ${competition_ids["${loan_comp_PS}"]}
${loan_comp_application}                   Loan Competition
${loanApplicationName}                     Loan Application
${loan_comp_appl_id}                       ${competition_ids["${loan_comp_application}"]}
${loanApplicationID}                       ${application_ids["${loanApplicationName}"]}
${loan_PS_application1}                    Loan Project 1
${loan_PS_application2}                    Loan Project 2
${loan_PS_application_Id}                  ${application_ids["${loan_PS_application1}"]}
${loan_PS_project_Id}                      ${project_ids["${loan_PS_application1}"]}
${loan_PS_project_Id2}                     ${project_ids["${loan_PS_application2}"]}
${loan_PS}                                 ${server}/project-setup/project/${loan_PS_project_Id}
${loan_PS_Url}                             ${loan_PS}/details
${loan_finance_checks}                     ${server}/project-setup-management/project/${loan_PS_project_Id}/finance-check
${eligibility_changes}                     ${loan_finance_checks}/organisation/${EMPIRE_LTD_ID}/eligibility/changes
${spend_profile}                           ${server}/project-setup-management/project/${loan_PS_project_Id}/spend-profile/approval


*** Test Cases ***
The user can navigate back to application overview in the same window from part b questions form
    [Documentation]     IFS-10761
    When the user creates a new application
    And the user clicks the button/link                           link = Business and financial information
    And the user clicks the button/link                           jQuery = a:contains("Continue")
    And the user logs in if username field present
    Then title should be                                           Home

The user can see b&fi application question as complete and shows edit online survey button
    [Documentation]    IFS-9484  IFS-10705  IFS-10703
    Given the user navigates to the page                    ${server}/applicant/dashboard
    When The user clicks the button/link                    link = ${loanApplicationName}
    And the user clicks the button/link                     link = Business and financial information
    Then the user should see b&fi question details

the user can open the sales force new tab on clicking conitnue button in incomplete status of b&fi question
    [Documentation]   IFS-10703
    Given the sales force submits/unsubmits b&fi survey     0
    When the user clicks the button/link                    jQuery = a:contains("Continue")
    And the user logs in if username field present
    Then title should be                                    Home

The user will not be able to mark the application as complete without completing business and financial information
    [Documentation]    IFS-9484  IFS-10705 IFS-10757
    Given the user navigates to the page                        ${server}/applicant/dashboard
    And The user clicks the button/link                         link = ${loanApplicationName}
    When the user clicks the button/link                        id = application-overview-submit-cta
    And The user should see the element                         jQuery = span:contains("Business and financial information")
    And The user should see the element                         jQuery = p:contains("Information not yet provided")
    Then the user should see that the element is disabled       id = submit-application-button
    And The user clicks the button/link                         id = accordion-questions-heading-1-1
    And The user should not see the element                     jQuery = #accordion-questions-content-1-1 button:contains("Mark")
    And the user should see the element                         jQuery = .section-incomplete + button:contains("Business and financial information")
    And the user should see the element                         jQuery = h2:contains("Applicant details")
    And the user should see the element                         jQuery = h2:contains("Project finance")

The user can see the business and financial information application question in application overview as complete
    [Documentation]    IFS-9484  IFS-10705
    When the sales force submits/unsubmits b&fi survey     1
    Then the user should see the element                   jQuery = .section-complete + button:contains("Business and financial information")

Return and edit button should not change the status of B&FI question
    [Documentation]    IFS-11019
    When the user clicks the button/link   jQuery = #accordion-questions-content-1-1 button:contains("Return and edit")
    Then the user should see the element   jQuery = p:contains("This question is marked as complete.")

Loan application shows correct T&C's
    [Documentation]    IFS-6205  IFS-9483  IFS-9716
    Given the user clicks the button/link   link = Back to application overview
    And the user clicks the button/link     link = Loan terms and conditions
    And the user should see the element     jQuery = h1:contains("Loans terms and conditions")
    When the user clicks the button/link    link = Back to application overview
    Then the user should see the element    jQuery = li:contains("Loan terms and conditions") .task-status-complete

Max funding sought validation
    [Documentation]  IFS-7866
    Given the user sets max available funding              60000  ${loan_comp_appl_id}
    When the user enters a value over the max funding
    Then the user should see a field and summary error     Your funding sought exceeds GBP 60,000. You must lower your funding level percentage or your project costs.

Loan application Your funding
    [Documentation]  IFS-6207
    Given the user enters empty funding amount
    When the user enters text to a text field  id = amount   57,803
    And the user clicks the button/link        id = mark-all-as-complete
    Then the user should see the element       jQuery = td:contains("200,903") ~ td:contains("57,803") ~ td:contains("30.00%") ~ td:contains("2,468") ~ td:contains("140,632")

Loan application finance overview
    [Documentation]  IFS-6208
    Given the user clicks the button/link  link = Back to application overview
    When the user clicks the button/link   link = Finances overview
    Then the user should see the element   jQuery = td:contains("200,903") ~ td:contains("57,803") ~ td:contains("30.00%") ~ td:contains("2,468") ~ td:contains("140,632")

Loan application submission
    [Documentation]  IFS-6237  IFS-6238  IFS-9483 IFS-10825 IFS-10869
    Given the user submits the loan application
    When the user clicks the button/link            link = View application
    Then the user should see the element            jQuery = h1:contains("Application overview")
    And the user should see the element             jQuery = span:contains("Thanks for submitting Part B of your loan application.")
    And the user should see the element             jQuery = span:contains("What happens next")
    And the user should see the element             jQuery = p:contains("We will make our decision based on the suitability of your business and the quality of the project.")
    And the user reads his email                    ${lead_applicant_credentials["email"]}   Complete your application for Loan Competition   You have completed your application for Loan Competition.

Assessor can view BFI question in application
   [Documentation]   IFS-10825
   [Setup]  log in as a different user                                      &{internal_finance_credentials}
   Given moving competition to Closed                                       ${loan_comp_appl_id}
   When the user navigates to the page                                      ${server}/management/competition/${loan_comp_appl_id}/assessors/find
{'fraction_non_alphanumeric': 0.07680967123691582, 'fraction_numerical': 0.02948547840188707, 'mean_word_length': 2.234265734265734, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1798579', 'n_tokens_mistral': 5499, 'n_tokens_neox': 4932, 'n_words': 1945}