<commit_before>*** Settings ***
Documentation   Dataprovider assign a concept to an instrument and assert it under the instrument. Prerequisite to havce "Test Konzept ${BROWSER} Publisher" concepts in the system.
Resource          ../../resources/click_element_resource.robot
Resource          ../../resources/search_resource.robot
Resource          ../../resources/home_page_resource.robot

*** Test Cases ***
Assign and Unassign concept to and from an instrument
    Get Back to german home page
    Select project by name  conceptproject${BROWSER}
    Click on Cockpit Button
    Click on Instrument Edit Button
    Assign Concept to an Instrument
    Click on Save Button
    Get back to german home page
    # wait for elasticsearch index beeing updated
    Sleep  20s
    Assert the concept has been assigned to the instrument
    Assert the concept is assigned to a study
    Assert the concept is assigned to a survey
    Unassign the concept from the instrument
    Get back to home page and deselect project

*** Keywords ***
Click on Instrument Edit Button
   Click Element Through Tooltips  xpath=//md-card[@type="instruments"]//button[@ng-click="ctrl.edit(ctrl.searchState)"]//span[text()="Bearbeiten"]
   Click Element Through Tooltips  xpath=//md-card-actions//button[normalize-space()="Bearbeiten"]

Assign Concept to an Instrument
   Click Element  xpath=//md-chips[@name="concepts"]//input[@placeholder="Konzepte suchen..."]
   Run Keyword If    '${BROWSER}' == 'firefox'  Click Element Through Tooltips  xpath=//md-virtual-repeat-container[@ng-hide="$mdAutocompleteCtrl.hidden"]//ul//li//span//span[contains(., "con-i8h7b1a0e4e4i8f5b1$")]
   Run Keyword If    '${BROWSER}' == 'chrome'  Click Element Through Tooltips  xpath=//md-virtual-repeat-container[@ng-hide="$mdAutocompleteCtrl.hidden"]//ul//li//span//span[contains(., "con-d3i8h7i8g6g6i8f5b1$")]<commit_msg>Increase sleep delay to wait for search index update (#2497)<commit_after>*** Settings ***
Documentation   Dataprovider assign a concept to an instrument and assert it under the instrument. Prerequisite to havce "Test Konzept ${BROWSER} Publisher" concepts in the system.
Resource          ../../resources/click_element_resource.robot
Resource          ../../resources/search_resource.robot
Resource          ../../resources/home_page_resource.robot

*** Test Cases ***
Assign and Unassign concept to and from an instrument
    Get Back to german home page
    Select project by name  conceptproject${BROWSER}
    Click on Cockpit Button
    Click on Instrument Edit Button
    Assign Concept to an Instrument
    Click on Save Button
    Get back to german home page
    # wait for elasticsearch index beeing updated
    Sleep  60s
    Assert the concept has been assigned to the instrument
    Assert the concept is assigned to a study
    Assert the concept is assigned to a survey
    Unassign the concept from the instrument
    Get back to home page and deselect project

*** Keywords ***
Click on Instrument Edit Button
   Click Element Through Tooltips  xpath=//md-card[@type="instruments"]//button[@ng-click="ctrl.edit(ctrl.searchState)"]//span[text()="Bearbeiten"]
   Click Element Through Tooltips  xpath=//md-card-actions//button[normalize-space()="Bearbeiten"]

Assign Concept to an Instrument
   Click Element  xpath=//md-chips[@name="concepts"]//input[@placeholder="Konzepte suchen..."]
   Run Keyword If    '${BROWSER}' == 'firefox'  Click Element Through Tooltips  xpath=//md-virtual-repeat-container[@ng-hide="$mdAutocompleteCtrl.hidden"]//ul//li//span//span[contains(., "con-i8h7b1a0e4e4i8f5b1$")]
   Run Keyword If    '${BROWSER}' == 'chrome'  Click Element Through Tooltips  xpath=//md-virtual-repeat-container[@ng-hide="$mdAutocompleteCtrl.hidden"]//ul//li//span//span[contains(., "con-d3i8h7i8g6g6i8f5b1$")]
{'fraction_non_alphanumeric': 0.10988722790453712, 'fraction_numerical': 0.011539470233412012, 'mean_word_length': 3.9149484536082473, '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': '836752', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1092, 'n_words': 354}