<commit_before>*** Settings ***
Documentation  IFS-5158 - Competition Template
Suite Setup       Custom setup
Suite Teardown    Custom teardown
Resource          ../../resources/defaultResources.robot
Resource          ../02__Competition_Setup/CompAdmin_Commons.robot

*** Variables ***
${CA_UpcomingComp}   ${server}/management/dashboard/upcoming
${competitionTitle}  H2020 Grant Transfer

*** Test Cases ***
User can select H2020 Competition Template and complete Initial details
    [Documentation]  IFS-5158
    Given a user starts a new competition
    When the user clicks the button/link                               link = Initial details
    Then the user selects the option from the drop-down menu           Horizon 2020   name = competitionTypeId
    And the user is able to complete Initial details section
    And the user should see the read-only view of the initial details
    [Teardown]  the user clicks the button/link                        link = Return to setup overview

User can populate the Completion Stage, Milestones and Public content
    [Documentation]  IFS-5158
     Given the user fills in the CS Milestones                                      release-feedback-completion-stage  1  ${nextyear}
     When the user clicks the button/link                                           link = Public content
     Then The user completes Public content for H2020 registration and publishes
     [Teardown]  the user clicks the button/link                                    link = Return to setup overview

User can populate Terms and Conditions
    [Documentation]  IFS-5158
    Given the user clicks the button/link                   link = Terms and conditions
    Then the user clicks the button/link                    jQuery = button:contains("Done")
    [Teardown]  the user clicks the button/link             link = Return to setup overview

User can populate Funding information and Eligibility
    [Documentation]  IFS-5158
    Given the user clicks the button/link          link = Funding information
    When the user completes funding information
    Then the user clicks the button/link           link = Return to setup overview
    And the user fills in the CS Eligibility       ${BUSINESS_TYPE_ID}   3  false  single-or-collaborative

User can complete the Application
    [Documentation]  IFS-5158
    Given the user clicks the button/link                      link = Application
    When the user completes the application proccess details
    Then the user clicks the button/link                       link = Return to setup overview

User can finish setting up the grant transfer
    [Documentation]  IFS-5158
    Given the user completes grant transfer setup
    Then the user should see the element             jQuery = h2:contains("Ready to open") ~ ul a:contains("${competitionTitle}")
    [Teardown]  Get competition id and set open date to yesterday  ${competitionTitle}

Applicant user start a grant transfer
    [Documentation]  IFS-5158
    [Setup]  log in as a different user    &{lead_applicant_credentials}
    Given the user navigates to the page   ${server}/competition/${competitionId}/overview
    When the user clicks the button/link   jQuery = a:contains("Start new application")
    Then the user is able to go to Application overview

*** Keywords ***
Custom setup<commit_msg>Updated the applicant user<commit_after>*** Settings ***
Documentation  IFS-5158 - Competition Template
Suite Setup       Custom setup
Suite Teardown    Custom teardown
Resource          ../../resources/defaultResources.robot
Resource          ../02__Competition_Setup/CompAdmin_Commons.robot

*** Variables ***
${CA_UpcomingComp}   ${server}/management/dashboard/upcoming
${competitionTitle}  H2020 Grant Transfer

*** Test Cases ***
User can select H2020 Competition Template and complete Initial details
    [Documentation]  IFS-5158
    Given a user starts a new competition
    When the user clicks the button/link                               link = Initial details
    Then the user selects the option from the drop-down menu           Horizon 2020   name = competitionTypeId
    And the user is able to complete Initial details section
    And the user should see the read-only view of the initial details
    [Teardown]  the user clicks the button/link                        link = Return to setup overview

User can populate the Completion Stage, Milestones and Public content
    [Documentation]  IFS-5158
     Given the user fills in the CS Milestones                                      release-feedback-completion-stage  1  ${nextyear}
     When the user clicks the button/link                                           link = Public content
     Then The user completes Public content for H2020 registration and publishes
     [Teardown]  the user clicks the button/link                                    link = Return to setup overview

User can populate Terms and Conditions
    [Documentation]  IFS-5158
    Given the user clicks the button/link                   link = Terms and conditions
    Then the user clicks the button/link                    jQuery = button:contains("Done")
    [Teardown]  the user clicks the button/link             link = Return to setup overview

User can populate Funding information and Eligibility
    [Documentation]  IFS-5158
    Given the user clicks the button/link          link = Funding information
    When the user completes funding information
    Then the user clicks the button/link           link = Return to setup overview
    And the user fills in the CS Eligibility       ${BUSINESS_TYPE_ID}   3  false  single-or-collaborative

User can complete the Application
    [Documentation]  IFS-5158
    Given the user clicks the button/link                      link = Application
    When the user completes the application proccess details
    Then the user clicks the button/link                       link = Return to setup overview

User can finish setting up the grant transfer
    [Documentation]  IFS-5158
    Given the user completes grant transfer setup
    Then the user should see the element             jQuery = h2:contains("Ready to open") ~ ul a:contains("${competitionTitle}")
    [Teardown]  Get competition id and set open date to yesterday  ${competitionTitle}

Applicant user start a grant transfer
    [Documentation]  IFS-5158
    [Setup]  log in as a different user    &{collaborator1_credentials}
    Given the user navigates to the page   ${server}/competition/${competitionId}/overview
    When the user clicks the button/link   jQuery = a:contains("Start new application")
    Then the user is able to go to Application overview

*** Keywords ***
Custom setup
{'fraction_non_alphanumeric': 0.04899910367493278, 'fraction_numerical': 0.01598446369883478, 'mean_word_length': 2.5348468848996832, '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': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2281928', 'n_tokens_mistral': 1689, 'n_tokens_neox': 1545, 'n_words': 726}