<commit_before>*** Settings ***
Documentation     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
...
...               IFUND-3888 Rearrangement of Competitions setup
...
...               INFUND-4682 Initial details can be saved with an opening date in the past
...
...               INFUND-2993 As a competitions team member I want to be able to add milestones when creating my competition so these can be used manage its progress
...
...               INFUND-3001 As a Competitions team member I want the service to automatically save my edits while I work through Initial details section in Competition Setup the so that I do not lose my changes
...
...               INFUND-4581 As a Competitions team member I want the service to automatically save my edits while I work through Funding information section in Competition Setup the so that I do not lose my changes
...
...               INFUND-4586 As a Competitions team member I want the service to automatically save my edits while I work through Application Questions section in Competition Setup the so that I do not lose my changes
...
...               INFUND-5639 As a Competitions team member I want to be able to view the Application process within the application question section in Competition Setup so that I can set up my competition using more convenient navigation
...
...               INFUND-5641 As a Competitions team member I want to be able to update the assessor setup questions so that I can amend the defaults if required for the competition
Suite Setup       The user logs-in in new browser  &{Comp_admin1_credentials}
Suite Teardown    The user closes the browser
Force Tags        CompAdmin
Resource          ../../resources/defaultResources.robot
Resource          CompAdmin_Commons.robot

*** Test Cases ***
Initial details: server-side validations
    [Documentation]    INFUND-2982
    ...
    ...    IFUND-3888
    [Tags]    HappyPath
    Given the user navigates to the page   ${CA_UpcomingComp}
    And the user clicks the button/link    jQuery=.button:contains("Create competition")
    And The user clicks the button/link    link=Initial details
    When the user clicks the button/link   jQuery=.button:contains("Done")
    Then the user should see an error    Please enter a title.
    And the user should see an error    Please select a competition type.
    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 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 an opening month.
    And the user should see an error    Please select an Innovation Lead.
    And the user should see an error    Please select a Portfolio Manager.

Initial details: client-side validations
    [Documentation]    INFUND-2982
    ...
    ...    INFUND-3888
    [Tags]    HappyPath
    #TODO Remove the comments when the inf-5327 is fixed
    When the user enters text to a text field    id=title    Validations Test
    Then the user should not see the error any more    Please enter a title.
    When the user selects the option from the drop-down menu    Programme    id=competitionTypeId
    Then the user should not see the error any more    Please select a competition type.
    When the user selects the option from the drop-down menu    Health and life sciences    id=innovationSectorCategoryId
    Then the user should not see the error any more    Please select an innovation sector.
    When the user selects the option from the drop-down menu    Advanced therapies    id=innovationAreaCategoryId-0
    Then the user should not see the error any more    Please select an innovation area.
    When the user enters text to a text field    id=openingDateDay    01
    #Then the user should not see the error any more    Please enter an opening day.
    When the user enters text to a text field    Id=openingDateMonth    12
    #Then the user should not see the error any more    Please enter an opening month.
    When the user enters text to a text field    id=openingDateYear    2017
    #Then the user should not see the error any more    Please enter an opening year.
    When the user selects the option from the drop-down menu    <NAME>    id=innovationLeadUserId
    Then the user should not see the error any more    Please select an Innovation Lead.
    When the user selects the option from the drop-down menu    <NAME>     id=executiveUserId
    Then The user should not see the text in the page    Please select a competition executive.    #Couldn't use this keyword : "Then the user should not see the error any more" . Because there is not any error in the page

Initial details: Autosave
    [Documentation]    INFUND-3001
    [Tags]
    When the user clicks the button/link    link=Competition setup
    and the user clicks the button/link    link=Initial details
    Then the user should see the correct values in the initial details form

Initial details: should not allow dates in the past
    [Documentation]    INFUND-4682
    Given 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    2015
    And the user moves focus and waits for autosave
    When the user clicks the button/link    jQuery=.button:contains("Done")
    Then The user should not see the element    jQuery=.button:contains("Edit")
    [Teardown]    #the user enters text to a text field    id=openingDateYear    2017

Initial details: mark as done
    [Documentation]    INFUND-2982
    ...
    ...    INFUND-2983
    ...
    ...    INFUND-3888
    [Tags]    HappyPath
    Given The user enters valid data in the initial details
    And the user moves focus and waits for autosave<commit_msg>IFS-769 Fixing acc tests<commit_after>*** Settings ***
Documentation     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
...
...               IFUND-3888 Rearrangement of Competitions setup
...
...               INFUND-4682 Initial details can be saved with an opening date in the past
...
...               INFUND-2993 As a competitions team member I want to be able to add milestones when creating my competition so these can be used manage its progress
...
...               INFUND-3001 As a Competitions team member I want the service to automatically save my edits while I work through Initial details section in Competition Setup the so that I do not lose my changes
...
...               INFUND-4581 As a Competitions team member I want the service to automatically save my edits while I work through Funding information section in Competition Setup the so that I do not lose my changes
...
...               INFUND-4586 As a Competitions team member I want the service to automatically save my edits while I work through Application Questions section in Competition Setup the so that I do not lose my changes
...
...               INFUND-5639 As a Competitions team member I want to be able to view the Application process within the application question section in Competition Setup so that I can set up my competition using more convenient navigation
...
...               INFUND-5641 As a Competitions team member I want to be able to update the assessor setup questions so that I can amend the defaults if required for the competition
Suite Setup       The user logs-in in new browser  &{Comp_admin1_credentials}
Suite Teardown    The user closes the browser
Force Tags        CompAdmin
Resource          ../../resources/defaultResources.robot
Resource          CompAdmin_Commons.robot

*** Test Cases ***
Initial details: server-side validations
    [Documentation]    INFUND-2982
    ...
    ...    IFUND-3888
    [Tags]    HappyPath
    Given the user navigates to the page   ${CA_UpcomingComp}
    And the user clicks the button/link    jQuery=.button:contains("Create competition")
    And The user clicks the button/link    link=Initial details
    When the user clicks the button/link   jQuery=.button:contains("Done")
    Then the user should see an error    Please enter a title.
    And the user should see an error    Please select a competition type.
    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 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 an opening month.
    And the user should see an error    Please select an Innovation Lead.
    And the user should see an error    Please select a Portfolio manager.

Initial details: client-side validations
    [Documentation]    INFUND-2982
    ...
    ...    INFUND-3888
    [Tags]    HappyPath
    #TODO Remove the comments when the inf-5327 is fixed
    When the user enters text to a text field    id=title    Validations Test
    Then the user should not see the error any more    Please enter a title.
    When the user selects the option from the drop-down menu    Programme    id=competitionTypeId
    Then the user should not see the error any more    Please select a competition type.
    When the user selects the option from the drop-down menu    Health and life sciences    id=innovationSectorCategoryId
    Then the user should not see the error any more    Please select an innovation sector.
    When the user selects the option from the drop-down menu    Advanced therapies    id=innovationAreaCategoryId-0
    Then the user should not see the error any more    Please select an innovation area.
    When the user enters text to a text field    id=openingDateDay    01
    #Then the user should not see the error any more    Please enter an opening day.
    When the user enters text to a text field    Id=openingDateMonth    12
    #Then the user should not see the error any more    Please enter an opening month.
    When the user enters text to a text field    id=openingDateYear    2017
    #Then the user should not see the error any more    Please enter an opening year.
    When the user selects the option from the drop-down menu    <NAME>    id=innovationLeadUserId
    Then the user should not see the error any more    Please select an Innovation Lead.
    When the user selects the option from the drop-down menu    <NAME>     id=executiveUserId
    Then The user should not see the text in the page    Please select a Portfolio manager.    #Couldn't use this keyword : "Then the user should not see the error any more" . Because there is not any error in the page

Initial details: Autosave
    [Documentation]    INFUND-3001
    [Tags]
    When the user clicks the button/link    link=Competition setup
    and the user clicks the button/link    link=Initial details
    Then the user should see the correct values in the initial details form

Initial details: should not allow dates in the past
    [Documentation]    INFUND-4682
    Given 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    2015
    And the user moves focus and waits for autosave
    When the user clicks the button/link    jQuery=.button:contains("Done")
    Then The user should not see the element    jQuery=.button:contains("Edit")
    [Teardown]    #the user enters text to a text field    id=openingDateYear    2017

Initial details: mark as done
    [Documentation]    INFUND-2982
    ...
    ...    INFUND-2983
    ...
    ...    INFUND-3888
    [Tags]    HappyPath
    Given The user enters valid data in the initial details
    And the user moves focus and waits for autosave
{'fraction_non_alphanumeric': 0.04180373906764021, 'fraction_numerical': 0.017572013158950493, 'mean_word_length': 2.7328541479484874, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '265853', 'n_tokens_mistral': 3231, 'n_tokens_neox': 3023, 'n_words': 1718}