<commit_before>*** Settings ***
Suite Setup     Run Tests  ${EMPTY}  standard_libraries/screenshot/screenshot.txt
Force Tags      pybot  jybot  regression
Resource        atest_resource.txt

*** Test Cases ***
Save Screenshot To Default Dir Twice
    Check Test Case  ${TESTNAME}

Save Screenshot To Default Dir With File Name
    Check Test Case  ${TESTNAME}

Save Screenshot With File Name and Path Defined
    ${test} =  Check Test Case  ${TESTNAME}
    ${exp_path} =  Normalize Path  ${CURDIR}../../../../testdata/standard_libraries/screenshot/mybase_1.jpg
    Check Log Message  ${test.kws[0].msgs[0]}  Screenshot saved to '${exp_path}'

Save Screenshot To Non Existing Path
    Check Test Case  ${TESTNAME}

Save Screenshot To Overwrite Should Succeed
    Check Test Case  ${TESTNAME}

Save Screenshot To With Non Existing Path
    Check Test Case  ${TESTNAME}

Log Screenshot With Defaults
    ${test} =  Check Test Case  ${TESTNAME}
    Message Should Contain  ${test.kws[0].msgs[1]}  <img src="screenshot_1.jpg" width="100%" />

Log Screenshot With Filename Defined
    ${test} =  Check Test Case  ${TESTNAME}
    Message Should Contain  ${test.kws[0].msgs[1]}  <img src="image_1.jpg" width="100%" />

Log Screenshot With Filename And Path Defined
    ${test} =  Check Test Case  ${TESTNAME}
    Message Should Contain  ${test.kws[0].msgs[1]}  <img src="image_1.jpg" width="100%" />

Log Screenshot With Filename, Path And Width Defined
    ${test} =  Check Test Case  ${TESTNAME}
    Check Link In Log  ${test.kws[0].msgs[1]}  image_1.jpg  50%

Set Screenshot Directories With Default Path Should Be Deprecated
    Check Test Case  ${TESTNAME}
    Check Syslog Contains   'Screenshot.Set Screenshot Directories' is deprecated. Use `Set Screenshot Directory` keyword instead.

Set Screenshot Directories With Default Path and Log Path Defined Should Be Deprecated
    ${test} =  Check Test Case  ${TESTNAME}
    Check Link In Log  ${test.kws[1].msgs[1]}  screenshot_1.jpg
    Check Syslog Contains    'Screenshot.Set Screenshot Directories' is deprecated. Use `Set Screenshot Directory` keyword instead.

Log Screenshot With Initializing The Screenshot Library
    ${test} =  Check Test Case  ${TESTNAME}
    Check Link In Log  ${test.kws[0].msgs[1]}  screenshot_1.jpg

*** Keywords ***
Check Link In Log
    [Arguments]  ${message}  ${path}  ${width}=100%
    Check Log Message  ${message}  <a href="${path}"><img src="${path}" width="${width}" /></a>  HTML

Message Should contain
    [Arguments]  ${message}  ${expected}
    Should Contain  ${message.message.rstrip().lower()}  ${expected.replace('\\','/').lower()}
<commit_msg>updated after code changes<commit_after>*** Settings ***
Suite Setup     Run Tests  ${EMPTY}  standard_libraries/screenshot/screenshot.txt
Force Tags      pybot  jybot  regression
Resource        atest_resource.txt

*** Test Cases ***
Save Screenshot To Default Dir Twice
    Check Test Case  ${TESTNAME}

Save Screenshot To Default Dir With File Name
    Check Test Case  ${TESTNAME}

Save Screenshot With File Name and Path Defined
    Check Test Case  ${TESTNAME}

Save Screenshot To Non Existing Path
    Check Test Case  ${TESTNAME}

Save Screenshot To Overwrite Should Succeed
    Check Test Case  ${TESTNAME}

Save Screenshot To With Non Existing Path
    Check Test Case  ${TESTNAME}

Log Screenshot With Defaults
    ${test} =  Check Test Case  ${TESTNAME}
    Message Should Contain  ${test.kws[0].msgs[0]}  <img src="screenshot_1.jpg" width="100%" />

Log Screenshot With Filename Defined
    ${test} =  Check Test Case  ${TESTNAME}
    Message Should Contain  ${test.kws[0].msgs[0]}  <img src="image_1.jpg" width="100%" />

Log Screenshot With Filename And Path Defined
    ${test} =  Check Test Case  ${TESTNAME}
    Message Should Contain  ${test.kws[0].msgs[0]}  <img src="image_1.jpg" width="100%" />

Log Screenshot With Filename, Path And Width Defined
    ${test} =  Check Test Case  ${TESTNAME}
    Check Link In Log  ${test.kws[0].msgs[0]}  image_1.jpg  50%

Set Screenshot Directories With Default Path Should Be Deprecated
    Check Test Case  ${TESTNAME}
    Check Syslog Contains   'Screenshot.Set Screenshot Directories' is deprecated. Use `Set Screenshot Directory` keyword instead.

Set Screenshot Directories With Default Path and Log Path Defined Should Be Deprecated
    ${test} =  Check Test Case  ${TESTNAME}
    Check Link In Log  ${test.kws[1].msgs[0]}  screenshot_1.jpg
    Check Syslog Contains    'Screenshot.Set Screenshot Directories' is deprecated. Use `Set Screenshot Directory` keyword instead.

Log Screenshot With Initializing The Screenshot Library
    ${test} =  Check Test Case  ${TESTNAME}
    Check Link In Log  ${test.kws[0].msgs[0]}  screenshot_1.jpg

*** Keywords ***
Check Link In Log
    [Arguments]  ${message}  ${path}  ${width}=100%
    Check Log Message  ${message}  <a href="${path}"><img src="${path}" width="${width}" /></a>  HTML

Message Should contain
    [Arguments]  ${message}  ${expected}
    Should Contain  ${message.message.rstrip().lower()}  ${expected.replace('\\','/').lower()}

{'fraction_non_alphanumeric': 0.11564892990378951, 'fraction_numerical': 0.013155311211466719, 'mean_word_length': 3.8238636363636362, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '1368240', 'n_tokens_mistral': 1647, 'n_tokens_neox': 1610, 'n_words': 548}