<commit_before>*** Settings ***
Documentation     -INFUND-262: As a (lead) applicant, I want to see which fields in the form are being edited, so I can track progress
...
...               -INFUND-265: As both lead applicant and collaborator I want to see the changes other participants have made since my last visit, so I can see progress made on the application form
...               -INFUND-877: As a collaborator I want to be able to mark application questions that have been assigned to me as complete, so that my lead applicant is aware of my progress
Test Teardown     User closes the browser
Force Tags         Pending      # This test suite marked as Pending due to bug INFUND:1842
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/Applicant_actions.robot

*** Test Cases ***
Verify the applicant can assign a question
    [Documentation]    INFUND-275, INFUND-280
    [Tags]    Collaboration     HappyPath
    Given the Applicant can log in
    Given Applicant goes to the 'public description' question
    When the Applicant assigns the public description question to the collaborator    <NAME>
    Then the success message should show
    And the field of the public description question should be disabled
    And the question should show the assigned person's name

Verify the field is disabled for other collaborators
    [Documentation]    INFUND-275
    [Tags]    Collaboration         HappyPath
    Given the second Collaborator is logged in
    When the second Collaborator is in the public description question
    Then the public description question should not be editable

Verify the field is enabled for the collaborator/assignee
    [Documentation]    INFUND-275
    [Tags]    Collaboration    Overview    Pending  HappyPath
    # Pending because of INFUND-1842
    Given the Collaborator is in the public description section
    When the Collaborator gets the assigned notification
    Then the public description question should be assigned to the collaborator
    And the collaborator can see the 'assigned to you' in the overview page

Verify the ' Last update message'
    [Documentation]    INFUND-280
    [Tags]    Collaboration    Pending
    # Pending because of INFUND-1842
    Given the collaborator is in the public description section
    When the collaborator edits public description question
    Then the 'Last update' message should be updated

Verify collaborator can mark as ready for review
    [Documentation]    INFUND-877
    [Tags]    Collaboration    Pending      HappyPath
    # Pending because of INFUND-1842
    When the collaborator is in the public description section
    Then the collaborator can mark the question as ready for review

Verify the field is disabled for the collaborator
    [Documentation]    INFUND-275
    [Tags]    Collaboration
    When the collaborator is in the public description section
    Then the field of the public description question should be disabled

Verify that the field has been reassigned to the lead applicant
    [Documentation]    INFUND-275
    [Tags]    Collaboration    Pending
    # Pending because of INFUND-1842
    Given the Applicant can log in
    And Applicant goes to the 'public description' question
    When the Applicant gets the reassigned notification
    Then the public description question should be assigned to the applicant
    And the Applicant can see the 'Reassigned to: You' in the overview page

Verify that the applicant can assign a question and still mark it as complete
    [Documentation]    INFUND-877
    [Tags]    Collaboration    Pending
    # marked as pending because this functionality now seems to have been deleted! Possibly a bug?
    Given the Applicant can log in
    And Applicant goes to the 'public description' question
    When the Applicant assigns the public description question to the collaborator    <NAME>
    And the Applicant marks the public description question as complete
    Then the public description question shows as complete
    And the Applicant can mark the public description question as editable again

*** Keywords ***
the Applicant assigns the public description question to the collaborator
    [Arguments]    ${assignee_name}
    focus    css=#form-input-12 .editor
    Input Text    css=#form-input-12 .editor    lead Applicant's text 123...
    Click Element    css=#form-input-12 .assign-button button
    Click Element    xpath=//div[@id="form-input-12"]//button[contains(text(),"${assignee_name}")]

the success message should show
    Wait Until Element Is Visible    css=#content > div.event-alert
    Wait Until Page Contains    Question assigned successfully

the field of the public description question should be disabled<commit_msg>Removed the pending tags from the "Assign reassign" test suite<commit_after>*** Settings ***
Documentation     -INFUND-262: As a (lead) applicant, I want to see which fields in the form are being edited, so I can track progress
...
...               -INFUND-265: As both lead applicant and collaborator I want to see the changes other participants have made since my last visit, so I can see progress made on the application form
...               -INFUND-877: As a collaborator I want to be able to mark application questions that have been assigned to me as complete, so that my lead applicant is aware of my progress
Test Teardown     User closes the browser
Force Tags
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/Applicant_actions.robot

*** Test Cases ***
Verify the applicant can assign a question
    [Documentation]    INFUND-275, INFUND-280
    [Tags]    Collaboration    HappyPath
    Given the Applicant can log in
    Given Applicant goes to the 'public description' question
    When the Applicant assigns the public description question to the collaborator    <NAME>
    Then the success message should show
    And the field of the public description question should be disabled
    And the question should show the assigned person's name

Verify the field is disabled for other collaborators
    [Documentation]    INFUND-275
    [Tags]    Collaboration    HappyPath
    Given the second Collaborator is logged in
    When the second Collaborator is in the public description question
    Then the public description question should not be editable

Verify the field is enabled for the collaborator/assignee
    [Documentation]    INFUND-275
    [Tags]    Collaboration    Overview    HappyPath
    # Pending because of INFUND-1842
    Given the Collaborator is in the public description section
    When the Collaborator gets the assigned notification
    Then the public description question should be assigned to the collaborator
    And the collaborator can see the 'assigned to you' in the overview page

Verify the ' Last update message'
    [Documentation]    INFUND-280
    [Tags]    Collaboration
    # Pending because of INFUND-1842
    Given the collaborator is in the public description section
    When the collaborator edits public description question
    Then the 'Last update' message should be updated

Verify collaborator can mark as ready for review
    [Documentation]    INFUND-877
    [Tags]    Collaboration    HappyPath
    # Pending because of INFUND-1842
    When the collaborator is in the public description section
    Then the collaborator can mark the question as ready for review

Verify the field is disabled for the collaborator
    [Documentation]    INFUND-275
    [Tags]    Collaboration
    When the collaborator is in the public description section
    Then the field of the public description question should be disabled

Verify that the field has been reassigned to the lead applicant
    [Documentation]    INFUND-275
    [Tags]    Collaboration
    # Pending because of INFUND-1842
    Given the Applicant can log in
    And Applicant goes to the 'public description' question
    When the Applicant gets the reassigned notification
    Then the public description question should be assigned to the applicant
    And the Applicant can see the 'Reassigned to: You' in the overview page

Verify that the applicant can assign a question and still mark it as complete
    [Documentation]    INFUND-877
    [Tags]    Collaboration    Pending
    # marked as pending because this functionality now seems to have been deleted! Possibly a bug?
    Given the Applicant can log in
    And Applicant goes to the 'public description' question
    When the Applicant assigns the public description question to the collaborator    <NAME>
    And the Applicant marks the public description question as complete
    Then the public description question shows as complete
    And the Applicant can mark the public description question as editable again

*** Keywords ***
the Applicant assigns the public description question to the collaborator
    [Arguments]    ${assignee_name}
    focus    css=#form-input-12 .editor
    Input Text    css=#form-input-12 .editor    lead Applicant's text 123...
    Click Element    css=#form-input-12 .assign-button button
    Click Element    xpath=//div[@id="form-input-12"]//button[contains(text(),"${assignee_name}")]

the success message should show
    Wait Until Element Is Visible    css=#content > div.event-alert
    Wait Until Page Contains    Question assigned successfully

the field of the public description question should be disabled
{'fraction_non_alphanumeric': 0.04757566555319364, 'fraction_numerical': 0.01315922664237271, 'mean_word_length': 3.2385242385242385, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '4675286', 'n_tokens_mistral': 2523, 'n_tokens_neox': 2372, 'n_words': 1203}