<commit_before>*** Settings ***
Documentation     As a public user checking the shopping cart funtionalisties
Resource          ../../resources/click_element_resource.robot
Resource          ../../resources/search_resource.robot

*** Variables ***
@{MD_ACCESSWAYNAMES}   Create List    download-suf  remote-desktop-suf   onsite-suf   download-cuf
@{MD_VERSIONNAMES}   Create List    1.0.0  1.0.1
@{MD_DATAPRODUCTS}   Create List   stu-gra2005$  stu-scs2016$

*** Test Cases ***
Check Shooping Cart as a Public User
   Click on search result by id    @{MD_DATAPRODUCTS}[1]
   Click On Add Shopping Cart Icon
   Assert Study Input is Disabled
   Select Access Way for the Datasets from The List   @{MD_ACCESSWAYNAMES}[3]
   Select Version the Datasets from The List   @{MD_VERSIONNAMES}[2]
   Check The Close Button is Available
   Put in Shopping Cart
   Check Shopping Cart
   Confirm Order
   Close The Toast Message
   Check The Dataproducts Link
   Check The Variables Link
   Check The Datasets Link
   Check Delete Button is Available
   Empty The Shopping Cart


*** Keywords ***
Click On Add Shopping Cart Icon
   Click Element Through Tooltips   xpath=//md-icon[contains(., 'add_shopping_cart')]

Assert Study Input is Disabled
   Element Should Be Disabled    xpath=//input[@name='studyTitle']

Select Access Way for the Datasets from The List
   [Arguments]   ${accesswayname}
   Click Element Through Tooltips    xpath=//md-select[@name='accessWay']
   Click Element Through Tooltips    xpath=//md-select-menu//md-option[contains(., '${accesswayname}')]

Select Version the Datasets from The List
   [Arguments]   ${versionname}
   Click Element Through Tooltips    xpath=//md-select[@name='version']
   Click Element Through Tooltips    xpath=//md-select-menu//md-option[contains(., '${versionname}')]

Put in Shopping Cart
   Click Element Through Tooltips    xpath=//span[contains(., 'In den Einkaufswagen')]
   #Sleep  2s

Check Shopping Cart
   Click Element Through Tooltips    xpath=//a//md-icon[contains(., 'shopping_cart')]

Check Delete Button is Available
   Page Should Contain Element    xpath=//button[md-icon[text()='delete_forever']]

Check The Close Button is Available
   Page Should Contain Element    xpath=//span[contains(., 'Schließen')]

Confirm Order
   Click Element Through Tooltips   xpath=//span[contains(., 'Beantragen')]

Close The Toast Message
   Click Element Through Tooltips  xpath=//md-toast//span[contains(., 'Sie haben noch nicht alle benötigten')]
   Element Should Contain  xpath=//md-toast//span[contains(.,'Sie haben noch nicht alle benötigten')]  Sie haben noch nicht alle benötigten
   Click Element Through Tooltips  xpath=//button//following::md-icon[contains(.,"close")]

Check The Dataproducts Link
   Click Element Through Tooltips   xpath=//a[contains(., 'aus der Studienreihe')]
   Go Back

Check The Variables Link
   Click Element Through Tooltips   xpath=//a[contains(., 'Variablen')]
   Go Back

Check The Datasets Link
   Click Element Through Tooltips   xpath=//a[contains(., 'Datens')]
   Go Back

Empty The Shopping Cart
   Click Element Through Tooltips   xpath=//span[contains(., 'Einkaufswagen leeren')]

<commit_msg>#2041 fixed the error of shoppingcart test to sync with other tests<commit_after>*** Settings ***
Documentation     As a public user checking the shopping cart funtionalisties
Resource          ../../resources/click_element_resource.robot
Resource          ../../resources/search_resource.robot
Resource          ../../resources/home_page_resource.robot

*** Variables ***
@{MD_ACCESSWAYNAMES}   Create List    download-suf  remote-desktop-suf   onsite-suf   download-cuf
@{MD_VERSIONNAMES}   Create List    1.0.0  1.0.1
@{MD_DATAPRODUCTS}   Create List   stu-gra2005$  stu-scs2016$


*** Test Cases ***
Check Shooping Cart as a Public User
   Click on search result by id    @{MD_DATAPRODUCTS}[1]
   Click On Add Shopping Cart Icon
   Assert Study Input is Disabled
   Select Access Way for the Datasets from The List   @{MD_ACCESSWAYNAMES}[2]
   Select Version the Datasets from The List   @{MD_VERSIONNAMES}[2]
   Check The Close Button is Available
   Put in Shopping Cart
   Check Shopping Cart
   Confirm Order
   Close The Toast Message
   Check The Links
   Check Delete Button is Available
   Empty The Shopping Cart
   Get back to german home page   # to sync with next test flow



*** Keywords ***
Click On Add Shopping Cart Icon
   Click Element Through Tooltips   xpath=//md-icon[contains(., 'add_shopping_cart')]

Assert Study Input is Disabled
   Element Should Be Disabled    xpath=//input[@name='studyTitle']

Select Access Way for the Datasets from The List
   [Arguments]   ${accesswayname}
   Click Element Through Tooltips    xpath=//md-select[@name='accessWay']
   Click Element Through Tooltips    xpath=//md-select-menu//md-option[contains(., '${accesswayname}')]

Select Version the Datasets from The List
   [Arguments]   ${versionname}
   Click Element Through Tooltips    xpath=//md-select[@name='version']
   Click Element Through Tooltips    xpath=//md-select-menu//md-option[contains(., '${versionname}')]

Put in Shopping Cart
   Click Element Through Tooltips    xpath=//span[contains(., 'In den Einkaufswagen')]

Check Shopping Cart
   Click Element Through Tooltips    xpath=//a//md-icon[contains(., 'shopping_cart')]

Check Delete Button is Available
   Page Should Contain Element    xpath=//button[md-icon[text()='delete_forever']]

Check The Close Button is Available
   Page Should Contain Element    xpath=//span[contains(., 'Schließen')]

Confirm Order
   Click Element Through Tooltips   xpath=//span[contains(., 'Beantragen')]

Close The Toast Message
   Click Element Through Tooltips  xpath=//md-toast//span[contains(., 'Sie haben noch nicht alle benötigten')]
   Element Should Contain  xpath=//md-toast//span[contains(.,'Sie haben noch nicht alle benötigten')]  Sie haben noch nicht alle benötigten
   Click Element Through Tooltips  xpath=//button//following::md-icon[contains(.,"close")]

Check The Links
    @{MD_DATALINKS}   Create List    Studienreihe   Variablen   Datens
    :FOR   ${MD_LK}   IN  @{MD_DATALINKS}
    \   Click Element Through Tooltips   xpath=//a[contains(., '${MD_LK}')]
    \   Go Back

Empty The Shopping Cart
   Click Element Through Tooltips   xpath=//span[contains(., 'Einkaufswagen leeren')]




{'fraction_non_alphanumeric': 0.1002356637863315, 'fraction_numerical': 0.00612725844461901, 'mean_word_length': 3.7120651369356032, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1469676', 'n_tokens_mistral': 1968, 'n_tokens_neox': 1939, 'n_words': 639}