<commit_before>*** Settings ***

Library          Selenium2Library  timeout=5  implicit_wait=0.2
Library          String
Resource         keywords.txt
Library          bika.lims.testing.Keywords
Resource         plone/app/robotframework/selenium.robot
Resource         plone/app/robotframework/saucelabs.robot
Variables        plone/app/testing/interfaces.py
Variables        bika/lims/tests/variables.py
Suite Setup      Start browser
Suite Teardown   Close All Browsers

*** Variables ***

*** Test Cases ***

Test Analysis Uncertainty Precision
    [Documentation]   Analysis Results with Uncertainities and Precision
    ...  Creates an Analysis Service with uncertainities and
    ...  enables the 'Calculate precision from uncertainities' option.
    ...  The results must be formatted accordingly
    ...  See https://jira.bikalabs.com/browse/LIMS-1334 for further
    ...  information.
    Log in  test_labmanager  test_labmanager
    Go to   ${PLONEURL}/bika_setup/bika_analysisservices/analysisservice-3
    Click link  Analysis
    Wait Until Page Contains Element    Precision
    Input Text  Precision   2
    Input Text  ExponentialFormatPrecision  4
    Click link  Uncertainties

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-0
    Input Text  css=#Uncertainties-intercept_min-0   0
    Input Text  css=#Uncertainties-intercept_max-0   0.0001
    Input Text  css=#Uncertainties-errorvalue-0      0.000002
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-1
    Input Text  css=#Uncertainties-intercept_min-1   0.00011
    Input Text  css=#Uncertainties-intercept_max-1   0.002
    Input Text  css=#Uncertainties-errorvalue-1      0.000012
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-2
    Input Text  css=#Uncertainties-intercept_min-2   0.0021
    Input Text  css=#Uncertainties-intercept_max-2   0.08
    Input Text  css=#Uncertainties-errorvalue-2      0.0021
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-3
    Input Text  css=#Uncertainties-intercept_min-3   0.081
    Input Text  css=#Uncertainties-intercept_max-3   0.13
    Input Text  css=#Uncertainties-errorvalue-3      0.013
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-4
    Input Text  css=#Uncertainties-intercept_min-4   4.1
    Input Text  css=#Uncertainties-intercept_max-4   6
    Input Text  css=#Uncertainties-errorvalue-4      0.22
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-5
    Input Text  css=#Uncertainties-intercept_min-5   0.14
    Input Text  css=#Uncertainties-intercept_max-5   4
    Input Text  css=#Uncertainties-errorvalue-5      0.81
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-6
    Input Text  css=#Uncertainties-intercept_min-6   6.1
    Input Text  css=#Uncertainties-intercept_max-6   15
    Input Text  css=#Uncertainties-errorvalue-6      1.34
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-7
    Input Text  css=#Uncertainties-intercept_min-7   500001
    Input Text  css=#Uncertainties-intercept_max-7   5000000
    Input Text  css=#Uncertainties-errorvalue-7      182
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-8
    Input Text  css=#Uncertainties-intercept_min-8   15.1
    Input Text  css=#Uncertainties-intercept_max-8   50000
    Input Text  css=#Uncertainties-errorvalue-8      37
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-9
    Input Text  css=#Uncertainties-intercept_min-9   50001
    Input Text  css=#Uncertainties-intercept_max-9   500000
    Input Text  css=#Uncertainties-errorvalue-9      423

    Select Checkbox  PrecisionFromUncertainty
    Click Button  Save
    Wait Until Page Contains    Changes saved.

    Create Analysis Requests

    Create Worksheet with Analysis Requests

    Submit results and test

*** Keywords ***

Start browser
    Open browser  ${PLONEURL}/login_form  chrome
    Set selenium speed  ${SELENIUM_SPEED}

Create AnalysisRequests
    [Documentation]     Add and receive 10 ARs at once.
    @{time} =                   Get Time        year month day hour min sec
    Go to                       ${PLONEURL}/clients/client-2/portal_factory/AnalysisRequest/Request new analyses/ar_add?col_count=11
    Wait until page contains    Request new analyses
    Select From Dropdown        ar_0_Contact       <NAME>
    Select From Dropdown        ar_1_Contact       <NAME>
    Select From Dropdown        ar_2_Contact       <NAME>
    Select From Dropdown        ar_3_Contact       <NAME>
    Select From Dropdown        ar_4_Contact       <NAME>
    Select From Dropdown        ar_5_Contact       <NAME>
    Select From Dropdown        ar_6_Contact       <NAME>
    Select From Dropdown        ar_7_Contact       <NAME>
    Select From Dropdown        ar_8_Contact       <NAME>
    Select From Dropdown        ar_9_Contact       <NAME>
    Select From Dropdown        ar_10_Contact      <NAME>
    Select From Dropdown        ar_0_SampleType    Water
    Select From Dropdown        ar_1_SampleType    Water
    Select From Dropdown        ar_2_SampleType    Water
    Select From Dropdown        ar_3_SampleType    Water<commit_msg>Missed chrome browser in test<commit_after>*** Settings ***

Library          Selenium2Library  timeout=5  implicit_wait=0.2
Library          String
Resource         keywords.txt
Library          bika.lims.testing.Keywords
Resource         plone/app/robotframework/selenium.robot
Resource         plone/app/robotframework/saucelabs.robot
Variables        plone/app/testing/interfaces.py
Variables        bika/lims/tests/variables.py
Suite Setup      Start browser
Suite Teardown   Close All Browsers

*** Variables ***

*** Test Cases ***

Test Analysis Uncertainty Precision
    [Documentation]   Analysis Results with Uncertainities and Precision
    ...  Creates an Analysis Service with uncertainities and
    ...  enables the 'Calculate precision from uncertainities' option.
    ...  The results must be formatted accordingly
    ...  See https://jira.bikalabs.com/browse/LIMS-1334 for further
    ...  information.
    Log in  test_labmanager  test_labmanager
    Go to   ${PLONEURL}/bika_setup/bika_analysisservices/analysisservice-3
    Click link  Analysis
    Wait Until Page Contains Element    Precision
    Input Text  Precision   2
    Input Text  ExponentialFormatPrecision  4
    Click link  Uncertainties

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-0
    Input Text  css=#Uncertainties-intercept_min-0   0
    Input Text  css=#Uncertainties-intercept_max-0   0.0001
    Input Text  css=#Uncertainties-errorvalue-0      0.000002
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-1
    Input Text  css=#Uncertainties-intercept_min-1   0.00011
    Input Text  css=#Uncertainties-intercept_max-1   0.002
    Input Text  css=#Uncertainties-errorvalue-1      0.000012
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-2
    Input Text  css=#Uncertainties-intercept_min-2   0.0021
    Input Text  css=#Uncertainties-intercept_max-2   0.08
    Input Text  css=#Uncertainties-errorvalue-2      0.0021
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-3
    Input Text  css=#Uncertainties-intercept_min-3   0.081
    Input Text  css=#Uncertainties-intercept_max-3   0.13
    Input Text  css=#Uncertainties-errorvalue-3      0.013
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-4
    Input Text  css=#Uncertainties-intercept_min-4   4.1
    Input Text  css=#Uncertainties-intercept_max-4   6
    Input Text  css=#Uncertainties-errorvalue-4      0.22
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-5
    Input Text  css=#Uncertainties-intercept_min-5   0.14
    Input Text  css=#Uncertainties-intercept_max-5   4
    Input Text  css=#Uncertainties-errorvalue-5      0.81
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-6
    Input Text  css=#Uncertainties-intercept_min-6   6.1
    Input Text  css=#Uncertainties-intercept_max-6   15
    Input Text  css=#Uncertainties-errorvalue-6      1.34
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-7
    Input Text  css=#Uncertainties-intercept_min-7   500001
    Input Text  css=#Uncertainties-intercept_max-7   5000000
    Input Text  css=#Uncertainties-errorvalue-7      182
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-8
    Input Text  css=#Uncertainties-intercept_min-8   15.1
    Input Text  css=#Uncertainties-intercept_max-8   50000
    Input Text  css=#Uncertainties-errorvalue-8      37
    Click Button  css=#Uncertainties_more

    Wait Until Page Contains Element    css=#Uncertainties-intercept_min-9
    Input Text  css=#Uncertainties-intercept_min-9   50001
    Input Text  css=#Uncertainties-intercept_max-9   500000
    Input Text  css=#Uncertainties-errorvalue-9      423

    Select Checkbox  PrecisionFromUncertainty
    Click Button  Save
    Wait Until Page Contains    Changes saved.

    Create Analysis Requests

    Create Worksheet with Analysis Requests

    Submit results and test

*** Keywords ***

Start browser
    Open browser  ${PLONEURL}/login_form
    Set selenium speed  ${SELENIUM_SPEED}

Create AnalysisRequests
    [Documentation]     Add and receive 10 ARs at once.
    @{time} =                   Get Time        year month day hour min sec
    Go to                       ${PLONEURL}/clients/client-2/portal_factory/AnalysisRequest/Request new analyses/ar_add?col_count=11
    Wait until page contains    Request new analyses
    Select From Dropdown        ar_0_Contact       <NAME>
    Select From Dropdown        ar_1_Contact       <NAME>
    Select From Dropdown        ar_2_Contact       <NAME>
    Select From Dropdown        ar_3_Contact       <NAME>
    Select From Dropdown        ar_4_Contact       <NAME>
    Select From Dropdown        ar_5_Contact       <NAME>
    Select From Dropdown        ar_6_Contact       <NAME>
    Select From Dropdown        ar_7_Contact       <NAME>
    Select From Dropdown        ar_8_Contact       <NAME>
    Select From Dropdown        ar_9_Contact       <NAME>
    Select From Dropdown        ar_10_Contact      <NAME>
    Select From Dropdown        ar_0_SampleType    Water
    Select From Dropdown        ar_1_SampleType    Water
    Select From Dropdown        ar_2_SampleType    Water
    Select From Dropdown        ar_3_SampleType    Water
{'fraction_non_alphanumeric': 0.058542624690484615, 'fraction_numerical': 0.03289706402546869, 'mean_word_length': 2.798790728921733, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 2, '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': '4920045', 'n_tokens_mistral': 3694, 'n_tokens_neox': 3321, 'n_words': 888}