<commit_before>*** Settings ***
Documentation     IFS-7213  Investor Partnerships Funding type & T&Cs
...
...               IFS-7235  Change to terms and conditions labelling for Investor Partnerships
...
...               IFS-8779 Subsidy Control - Create a New Competition - Initial Details
...
...               IFS-9214 Add dual T&Cs to Subsidy Control Competitions
...
...               IFS-12827 Investor Partnerships - Update to terms and conditions
...
Suite Setup       Custom Suite Setup
Suite Teardown    Custom suite teardown
Resource          ../../../resources/defaultResources.robot
Resource          ../../../resources/common/Competition_Commons.robot
Resource          ../../../resources/common/Assessor_Commons.robot

*** Variables ***
${investorCompName}         Investor
${investorCompId}           ${competition_ids["${investorCompName}"]}
${investorApplication}      Investor partnership
${investorApplicationId}    ${application_ids["${investorApplication}"]}
${tandcLink}                Investor Partnerships terms and conditions
${investorPSApplication}    Investor ps application
${investorPSApplicationId}  ${application_ids["${investorPSApplication}"]}
${investorApplicationLink}  ${server}/management/competition/${investorCompId}/application/${investorApplicationId}
${investorFeedbackLink}     ${server}/application/${investorPSApplicationId}/summary


*** Test Cases ***
Investor partnership initial details
    [Documentation]  IFS-7213
    Given the user fills in initial details
    When the user clicks the button/link      link = Initial details
    Then the user should see the element      jQuery = dt:contains("Funding type") ~ dd:contains("Investor Partnership")

Edit view of initial details
    [Documentation]  IFS-7213
    Given the user clicks the button/link     css = button[type="submit"]
    Then the user should see the element      jQuery = dt:contains("Funding type") ~ dd:contains("Investor Partnership")
    [Teardown]   navigate to comp setup of investor comp

Creating a new investor comp points to the correct T&C
    [Documentation]  IFS-7213  IFS-12827
    Given the user fills in initial details
    When the user clicks the button/link        link = Terms and conditions
    Then the user should see the element        jQuery = [name="termsAndConditionsId"]:checked ~ label:contains("Investor Partnerships")

The Investor partnership t&c's are correct
    [Documentation]  IFS-7213
    When the user clicks the button/link     link = Investor Partnerships (opens in a new window)
    And select window                        title = Terms and conditions for Investor Partners - Innovation Funding Service
    Then the user should see the element     jQuery = h1:contains("Terms and conditions for Investor Partners")
    #And close window
    [Teardown]  the user closes the last opened tab
    #And select window                        title = Competition terms and conditions - Innovation Funding Service

T&c's can be confirmed
    [Documentation]  IFS-7213  IFS-9214  IFS-12827
    Given the user clicks the button/link      jQuery = button:contains("Done")
    When the user clicks the button twice      jQuery = label:contains("Investor Partnerships")
    And the user clicks the button/link        jQuery = button:contains("Done")
    And the user should see the element        jQuery = dt:contains("Subsidy control terms and conditions") ~ dd:contains("Investor Partnerships")
    And the user should see the element        jQuery = dt:contains("State aid terms and conditions") ~ dd:contains("Investor Partnerships")
    Then the user clicks the button/link       link = Back to competition details
    And the user should see the element        jQuery = li:contains("Terms and conditions") .task-status-complete

Applicant is able to see correct T&C's
    [Documentation]  IFS-7213
    Given Log in as a different user         ${peter_styles_email}  ${short_password}
    when the user clicks the button/link     link = Investor partnership
    And the user clicks the button/link      link = ${tandcLink}
    Then the user should see the element     jQuery = h2:contains("Terms and conditions of an Innovate UK investor partnerships competition")

Applicant can confirm t&c's
    [Documentation]  IFS-7235
    Given the user selects the checkbox      agreed
    When the user clicks the button/link     css = button[type="submit"]
    And the user clicks the button/link      link = Back to application overview
    Then the user should see the element     jQuery = li:contains("${tandcLink}") .task-status-complete

Internal user sees correct label for T&C's
    [Documentation]  IFS-7235
    Given Log in as a different user         &{Comp_admin1_credentials}
    When the user navigates to the page      ${investorApplicationLink}
    Then the user should see the element     jQuery = button:contains("${tandcLink}")<commit_msg>removed commented out code<commit_after>*** Settings ***
Documentation     IFS-7213  Investor Partnerships Funding type & T&Cs
...
...               IFS-7235  Change to terms and conditions labelling for Investor Partnerships
...
...               IFS-8779 Subsidy Control - Create a New Competition - Initial Details
...
...               IFS-9214 Add dual T&Cs to Subsidy Control Competitions
...
...               IFS-12827 Investor Partnerships - Update to terms and conditions
...
Suite Setup       Custom Suite Setup
Suite Teardown    Custom suite teardown
Resource          ../../../resources/defaultResources.robot
Resource          ../../../resources/common/Competition_Commons.robot
Resource          ../../../resources/common/Assessor_Commons.robot

*** Variables ***
${investorCompName}         Investor
${investorCompId}           ${competition_ids["${investorCompName}"]}
${investorApplication}      Investor partnership
${investorApplicationId}    ${application_ids["${investorApplication}"]}
${tandcLink}                Investor Partnerships terms and conditions
${investorPSApplication}    Investor ps application
${investorPSApplicationId}  ${application_ids["${investorPSApplication}"]}
${investorApplicationLink}  ${server}/management/competition/${investorCompId}/application/${investorApplicationId}
${investorFeedbackLink}     ${server}/application/${investorPSApplicationId}/summary


*** Test Cases ***
Investor partnership initial details
    [Documentation]  IFS-7213
    Given the user fills in initial details
    When the user clicks the button/link      link = Initial details
    Then the user should see the element      jQuery = dt:contains("Funding type") ~ dd:contains("Investor Partnership")

Edit view of initial details
    [Documentation]  IFS-7213
    Given the user clicks the button/link     css = button[type="submit"]
    Then the user should see the element      jQuery = dt:contains("Funding type") ~ dd:contains("Investor Partnership")
    [Teardown]   navigate to comp setup of investor comp

Creating a new investor comp points to the correct T&C
    [Documentation]  IFS-7213  IFS-12827
    Given the user fills in initial details
    When the user clicks the button/link        link = Terms and conditions
    Then the user should see the element        jQuery = [name="termsAndConditionsId"]:checked ~ label:contains("Investor Partnerships")

The Investor partnership t&c's are correct
    [Documentation]  IFS-7213
    When the user clicks the button/link     link = Investor Partnerships (opens in a new window)
    And select window                        title = Terms and conditions for Investor Partners - Innovation Funding Service
    Then the user should see the element     jQuery = h1:contains("Terms and conditions for Investor Partners")
    [Teardown]  the user closes the last opened tab

T&c's can be confirmed
    [Documentation]  IFS-7213  IFS-9214  IFS-12827
    Given the user clicks the button/link      jQuery = button:contains("Done")
    When the user clicks the button twice      jQuery = label:contains("Investor Partnerships")
    And the user clicks the button/link        jQuery = button:contains("Done")
    And the user should see the element        jQuery = dt:contains("Subsidy control terms and conditions") ~ dd:contains("Investor Partnerships")
    And the user should see the element        jQuery = dt:contains("State aid terms and conditions") ~ dd:contains("Investor Partnerships")
    Then the user clicks the button/link       link = Back to competition details
    And the user should see the element        jQuery = li:contains("Terms and conditions") .task-status-complete

Applicant is able to see correct T&C's
    [Documentation]  IFS-7213
    Given Log in as a different user         ${peter_styles_email}  ${short_password}
    when the user clicks the button/link     link = Investor partnership
    And the user clicks the button/link      link = ${tandcLink}
    Then the user should see the element     jQuery = h2:contains("Terms and conditions of an Innovate UK investor partnerships competition")

Applicant can confirm t&c's
    [Documentation]  IFS-7235
    Given the user selects the checkbox      agreed
    When the user clicks the button/link     css = button[type="submit"]
    And the user clicks the button/link      link = Back to application overview
    Then the user should see the element     jQuery = li:contains("${tandcLink}") .task-status-complete

Internal user sees correct label for T&C's
    [Documentation]  IFS-7235
    Given Log in as a different user         &{Comp_admin1_credentials}
    When the user navigates to the page      ${investorApplicationLink}
    Then the user should see the element     jQuery = button:contains("${tandcLink}")
{'fraction_non_alphanumeric': 0.08014045233915108, 'fraction_numerical': 0.014458329030259218, 'mean_word_length': 3.236220472440945, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3234605', 'n_tokens_mistral': 2671, 'n_tokens_neox': 2443, 'n_words': 958}