<commit_before>*** Settings ***
Documentation     INFUND-2945 As a Competition Executive I want to be able to create a new competition from the Competitions Dashboard so Innovate UK can create a new competition
...
...               INFUND-2982: Create a Competition: Step 1: Initial details
...
...               INFUND-2983: As a Competition Executive I want to be informed if the competition will fall under State Aid when I select a 'Competition type' in competition setup
...
...               INFUND-2984: As a Competition Executive I want the competition code field in the 'Initial details' tab in competition setup to generate based on open date and number of competitions in that month
...
...               INFUND-2986 Create a Competition: Step 3: Eligibility
Suite Setup       Guest user log-in    &{Comp_admin1_credentials}
Suite Teardown    TestTeardown User closes the browser
Force Tags        Comp admin
Resource          ../../../resources/GLOBAL_LIBRARIES.robot
Resource          ../../../resources/variables/GLOBAL_VARIABLES.robot
Resource          ../../../resources/variables/User_credentials.robot
Resource          ../../../resources/keywords/Login_actions.robot
Resource          ../../../resources/keywords/User_actions.robot
Resource          ../../../resources/keywords/SUITE_SET_UP_ACTIONS.robot

*** Test Cases ***
User can navigate to the competition setup form
    [Documentation]    INFUND-2945 As a Competition Executive I want to be able to create a new competition from the
    ...    Competitions Dashboard so Innovate UK can create a new competition.
    ...
    ...    INFUND-2982 Create a Competition: Step 1: Initial details
    ...
    ...    INFUND-2983 As a Competition Executive I want to be informed if the competition will fall under
    ...    State Aid when I select a 'Competition type' in competition setup.
    ...
    ...    INFUND-2986 Create a Competition: Step 3: Eligibility
    [Tags]
    When the user clicks the button/link    jQuery=.button:contains("Create competition")
    Then the user redirects to the page    Competition Setup    Step 1: Initial competition details
    And the user should not see the element    css=#stateAid

Initial details server-side validations
    [Documentation]    INFUND-2982
    [Tags]
    When the user clicks the button/link    jQuery=.button:contains("Done")
    Then the user should see an error    Please select a competition executive
    And the user should see an error    Please enter an opening month
    And the user should see an error    Please enter an opening year
    And the user should see an error    Please enter an opening day
    And the user should see an error    Please enter a title
    And the user should see an error    Please select an innovation sector
    And the user should see an error    Please select an innovation area
    And the user should see an error    Please select a competition type
    And the user should see an error    Please select a lead technologist
    And the user should see an error    Please enter a PAF number
    And the user should see an error    Please enter a budget code
    And the user should see an error    Please generate a competition code
    And the user clicks the button/link    jQuery=.button:contains("Generate competition code")
    Then the user should see the text in the page    Please fill in a correct date before generating the competition code

Initial details client-side validations
    [Documentation]    INFUND-2982
    [Tags]    Pending
    # pending INFUND-3957
    When the user selects the option from the drop-down menu    Competition Executive One    id=executiveUserId
    Then the user should not see the error anymore    Please select a competition executive
    When the user enters text to a text field    id=openingDateDay    01
    Then the user should not see the error anymore    Please enter an opening day
    And the user enters text to a text field    Id=openingDateMonth    12
    Then the user should not see the error anymore    Please enter an opening month
    And the user enters text to a text field    id=openingDateYear    2017
    Then the user should not see the error anymore    Please enter an opening year
    When the user enters text to a text field    id=title    Competition title
    And the user selects the option from the drop-down menu    Health and life sciences    id=innovationSectorCategoryId
    Then the user should not see the error anymore    Please select an innovation sector
    Then the user should not see the error anymore    Please enter a title
    When the user selects the option from the drop-down menu    Advanced Therapies    id=innovationAreaCategoryId
    Then the user should not see the error anymore    Please select an innovation area
    When the user selects the option from the drop-down menu    Additive Manufacturing    id=competitionTypeId
    Then the user should not see the error anymore    Please select a competition type
    When the user selects the option from the drop-down menu    Competition Technologist One    id=leadTechnologistUserId
    Then the user should not see the error anymore    Please select a lead technologist
    When the user enters text to a text field    id=pafNumber    2016
    And the user enters text to a text field    id=budgetCode    2004
    And the user moves focus to a different part of the page
    Then the user should not see the error anymore    Please enter a budget code
    And the user should not see the text in the page    Please enter a PAF number

The user should see the correct State aid status
    [Documentation]    INFUND-2982
    ...
    ...    INFUND-2983
    [Tags]
    Given the user selects the option from the drop-down menu    Health and life sciences    id=innovationSectorCategoryId
    When the user selects the option from the drop-down menu    Programme    id=competitionTypeId
    Then the user should see the element    css=.yes
    When the user selects the option from the drop-down menu    Special    id=competitionTypeId
    Then the user should see the element    css=.no
    When the user selects the option from the drop-down menu    Additive Manufacturing    id=competitionTypeId
    Then the user should see the element    css=.yes
    When the user selects the option from the drop-down menu    SBRI    id=competitionTypeId
    Then the user should see the element    css=.no

Competition code generation
    [Documentation]    INFUND-2984
    [Tags]    Pending
    # pending INFUND-3957
    When the user enters text to a text field    id=openingDateDay    01
    And the user enters text to a text field    Id=openingDateMonth    12
    And the user enters text to a text field    id=openingDateYear    2017
    And the user clicks the button/link    jQuery=.button:contains("Generate competition code")
    Then the competition code should be correct

Additional information can be saved
    [Documentation]    INFUND-2985
    Given the user clicks the button/link    link=Additional Information
    And the user should see the text in the page    Additional competition information
    When the user enters text to a text field    id=activityCode    lorem
    When the user enters text to a text field    id=innovateBudget    ipsum
    And the user enters text to a text field    id=coFunders    dolor
    When the user enters text to a text field    id=coFundersBudget    sit
    And the user clicks the button/link    jQuery=.button:contains("Done")
    And the user clicks the button/link    link=Initial Details
    And the user clicks the button/link    link=Additional Information
    Then the user should see the text in the page    lorem
    And the user should see the text in the page    ipsum
    And the user should see the text in the page    dolor
    And the user should see the text in the page    sit

Additional information can be edited again
    [Documentation]    INFUND-2985
    Given the user clicks the button/link    jQuery=.button:contains("Edit")
    And the user enters text to a text field    id=activityCode    amet
    And the user clicks the button/link    jQuery=.button:contains("Done")
    And the user clicks the button/link    link=Initial Details
    And the user clicks the button/link    link=Additional Information
    Then the user should see the text in the page    amet
    And the user should see the text in the page    ipsum
    And the user should see the text in the page    dolor
    And the user should see the text in the page    sit
    And the user should not see the text in the page    lorem
    [Teardown]    the user clicks the button/link    jQuery=.button:contains("Edit")

Eligibility server-side validations
    [Documentation]    INFUND-2986
    [Tags]
    Given the user clicks the button/link    link=Eligibility
    And the user should see the text in the page    Stream
    When the user clicks the button/link    jQuery=.button:contains("Done")
    Then the user should see the text in the page    Please select at least one research category
    And the user should see the text in the page    Please select a collaboration level
    And the user should see the text in the page    Please select a lead applicant type

Eligibility client-side validations
    [Documentation]    INFUND-2986, INFUND-2988
    [Tags]
    Given the user selects the radio button    multipleStream    yes
    When the user selects the checkbox    id=research-categories-33
    And the user selects the checkbox    id=research-categories-34
    And the user selects the checkbox    id=research-categories-35
    And the user moves focus to a different part of the page
    Then the user should not see the text in the page    Please select at least one research category
    And the user should see the text in the page    Please select a collaboration level
    And the user should see the text in the page    Please select a lead applicant type
    When the user selects the radio button    singleOrCollaborative    single
    And the user selects the radio button    leadApplicantType    business
    And the user selects the option from the drop-down menu    30%    name=researchParticipationAmountId
    Then the user should not see the text in the page    Please select a collaboration level
    And the user should not see the text in the page    Please select a lead applicant type
    And the user should not see the text in the page    Please select at least one research category
    And the user enters text to a text field    id=streamName    Test stream name

Eligibility information can be saved and the stream info shows correctly
    [Documentation]    INFUND-3051
    [Tags]
    When the user clicks the button/link    jQuery=.button:contains("Done")
    Then the user should see the text in the page    Multiple Stream
    And the user should see the text in the page    Yes<commit_msg>INFUND-3872: Acc test for saving different tabs<commit_after>*** Settings ***
Documentation     INFUND-2945 As a Competition Executive I want to be able to create a new competition from the Competitions Dashboard so Innovate UK can create a new competition
...
...               INFUND-2982: Create a Competition: Step 1: Initial details
...
...               INFUND-2983: As a Competition Executive I want to be informed if the competition will fall under State Aid when I select a 'Competition type' in competition setup
...
...               INFUND-2984: As a Competition Executive I want the competition code field in the 'Initial details' tab in competition setup to generate based on open date and number of competitions in that month
...
...               INFUND-2986 Create a Competition: Step 3: Eligibility
...
...               INFUND-3182 As a Competition Executive I want to the ability to save progress on each tab in competition setup.
Suite Setup       Guest user log-in    &{Comp_admin1_credentials}
Suite Teardown    TestTeardown User closes the browser
Force Tags        Comp admin
Resource          ../../../resources/GLOBAL_LIBRARIES.robot
Resource          ../../../resources/variables/GLOBAL_VARIABLES.robot
Resource          ../../../resources/variables/User_credentials.robot
Resource          ../../../resources/keywords/Login_actions.robot
Resource          ../../../resources/keywords/User_actions.robot
Resource          ../../../resources/keywords/SUITE_SET_UP_ACTIONS.robot

*** Test Cases ***
User can navigate to the competition setup form
    [Documentation]    INFUND-2945 As a Competition Executive I want to be able to create a new competition from the
    ...    Competitions Dashboard so Innovate UK can create a new competition.
    ...
    ...    INFUND-2982 Create a Competition: Step 1: Initial details
    ...
    ...    INFUND-2983 As a Competition Executive I want to be informed if the competition will fall under
    ...    State Aid when I select a 'Competition type' in competition setup.
    ...
    ...    INFUND-2986 Create a Competition: Step 3: Eligibility
    [Tags]
    When the user clicks the button/link    jQuery=.button:contains("Create competition")
    Then the user redirects to the page    Competition Setup    Step 1: Initial competition details
    And the user should not see the element    css=#stateAid

Initial details server-side validations
    [Documentation]    INFUND-2982
    [Tags]
    When the user clicks the button/link    jQuery=.button:contains("Done")
    Then the user should see an error    Please select a competition executive
    And the user should see an error    Please enter an opening month
    And the user should see an error    Please enter an opening year
    And the user should see an error    Please enter an opening day
    And the user should see an error    Please enter a title
    And the user should see an error    Please select an innovation sector
    And the user should see an error    Please select an innovation area
    And the user should see an error    Please select a competition type
    And the user should see an error    Please select a lead technologist
    And the user should see an error    Please enter a PAF number
    And the user should see an error    Please enter a budget code
    And the user should see an error    Please generate a competition code
    And the user clicks the button/link    jQuery=.button:contains("Generate competition code")
    Then the user should see the text in the page    Please fill in a correct date before generating the competition code

Initial details client-side validations
    [Documentation]    INFUND-2982
    [Tags]    Pending
    # pending INFUND-3957
    When the user selects the option from the drop-down menu    Competition Executive One    id=executiveUserId
    Then the user should not see the error anymore    Please select a competition executive
    When the user enters text to a text field    id=openingDateDay    01
    Then the user should not see the error anymore    Please enter an opening day
    And the user enters text to a text field    Id=openingDateMonth    12
    Then the user should not see the error anymore    Please enter an opening month
    And the user enters text to a text field    id=openingDateYear    2017
    Then the user should not see the error anymore    Please enter an opening year
    When the user enters text to a text field    id=title    Competition title
    And the user selects the option from the drop-down menu    Health and life sciences    id=innovationSectorCategoryId
    Then the user should not see the error anymore    Please select an innovation sector
    Then the user should not see the error anymore    Please enter a title
    When the user selects the option from the drop-down menu    Advanced Therapies    id=innovationAreaCategoryId
    Then the user should not see the error anymore    Please select an innovation area
    When the user selects the option from the drop-down menu    Additive Manufacturing    id=competitionTypeId
    Then the user should not see the error anymore    Please select a competition type
    When the user selects the option from the drop-down menu    Competition Technologist One    id=leadTechnologistUserId
    Then the user should not see the error anymore    Please select a lead technologist
    When the user enters text to a text field    id=pafNumber    2016
    And the user enters text to a text field    id=budgetCode    2004
    And the user moves focus to a different part of the page
    Then the user should not see the error anymore    Please enter a budget code
    And the user should not see the text in the page    Please enter a PAF number

Initial details correct state aid status
    [Documentation]    INFUND-2982
    ...
    ...    INFUND-2983
    [Tags]
    Given the user selects the option from the drop-down menu    Health and life sciences    id=innovationSectorCategoryId
    When the user selects the option from the drop-down menu    Programme    id=competitionTypeId
    Then the user should see the element    css=.yes
    When the user selects the option from the drop-down menu    Special    id=competitionTypeId
    Then the user should see the element    css=.no
    When the user selects the option from the drop-down menu    Additive Manufacturing    id=competitionTypeId
    Then the user should see the element    css=.yes
    When the user selects the option from the drop-down menu    SBRI    id=competitionTypeId
    Then the user should see the element    css=.no

Initial details competition code generation
    [Documentation]    INFUND-2984
    [Tags]    Pending
    # pending INFUND-3957
    When the user enters text to a text field    id=openingDateDay    01
    And the user enters text to a text field    Id=openingDateMonth    12
    And the user enters text to a text field    id=openingDateYear    2017
    And the user clicks the button/link    jQuery=.button:contains("Generate competition code")
    Then the competition code should be correct

Additional information can be saved
    [Documentation]    INFUND-2985
    ...
    ...    INFUND-3182
    Given the user clicks the button/link    link=Additional Information
    And the user should see the text in the page    Additional competition information
    When the user enters text to a text field    id=activityCode    lorem
    When the user enters text to a text field    id=innovateBudget    ipsum
    And the user enters text to a text field    id=coFunders    dolor
    When the user enters text to a text field    id=coFundersBudget    sit
    And the user clicks the button/link    jQuery=.button:contains("Done")
    And The user should not see the element    id=activityCode
    And the user clicks the button/link    link=Initial Details
    And the user clicks the button/link    link=Additional Information
    Then the user should see the text in the page    lorem
    And the user should see the text in the page    ipsum
    And the user should see the text in the page    dolor
    And the user should see the text in the page    sit

Additional information can be edited again
    [Documentation]    INFUND-2985
    ...
    ...    INFUND-3182
    Given the user clicks the button/link    jQuery=.button:contains("Edit")
    And the user enters text to a text field    id=activityCode    amet
    And the user clicks the button/link    jQuery=.button:contains("Done")
    And the user clicks the button/link    link=Initial Details
    And the user clicks the button/link    link=Additional Information
    Then the user should see the text in the page    amet
    And the user should see the text in the page    ipsum
    And the user should see the text in the page    dolor
    And the user should see the text in the page    sit
    And the user should not see the text in the page    lorem
    [Teardown]    the user clicks the button/link    jQuery=.button:contains("Edit")

Eligibility server-side validations
    [Documentation]    INFUND-2986
    [Tags]
    Given the user clicks the button/link    link=Eligibility
    And the user should see the text in the page    Stream
    When the user clicks the button/link    jQuery=.button:contains("Done")
    Then the user should see the text in the page    Please select at least one research category
    And the user should see the text in the page    Please select a collaboration level
    And the user should see the text in the page    Please select a lead applicant type
    And the user should see the text in the page    Please select a stream option

Eligibility client-side validations
    [Documentation]    INFUND-2986, INFUND-2988
    [Tags]
    Given the user selects the radio button    multipleStream    yes
    When the user selects the checkbox    id=research-categories-33
    And the user selects the checkbox    id=research-categories-34
    And the user selects the checkbox    id=research-categories-35
    And the user moves focus to a different part of the page
    When the user selects the radio button    singleOrCollaborative    single
    And the user selects the radio button    leadApplicantType    business
    And the user selects the option from the drop-down menu    30%    name=researchParticipationAmountId
    And the user moves focus to a different part of the page
    Then the user should not see the text in the page    Please select a collaboration level
    And the user should not see the text in the page    Please select a lead applicant type
    And the user should not see the text in the page    Please select at least one research category
    And the user enters text to a text field    id=streamName    Test stream name
    And the user should not see the text in the page    A stream name is required

Eligibility information can be marked as done then edit again
    [Documentation]    INFUND-3051
    ...
    ...    INFUND-3872
    [Tags]
    When the user clicks the button/link    jQuery=.button:contains("Done")
    Then the user should see the text in the page    Multiple Stream
    And The user should not see the element    id=streamName
    When the user clicks the button/link    jQuery=.button:contains("Edit")
    And the user clicks the button/link    jQuery=.button:contains("Done")
{'fraction_non_alphanumeric': 0.036408640864086406, 'fraction_numerical': 0.012241224122412242, 'mean_word_length': 2.8345125107851596, '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': '1571886', 'n_tokens_mistral': 5706, 'n_tokens_neox': 5355, 'n_words': 2996}