*** Settings ***

Library  Selenium2Library  timeout=5 seconds  implicit_wait=3 seconds
Resource  keywords.txt
Resource  cover_keywords.txt
Variables  plone/app/testing/interfaces.py

Suite Setup  Start Browser and Log In
Suite Teardown  Close Browser

*** Variables ***

${basic_tile_location}  /html/body/div/div[2]/div/div[2]/div[2]/div[3]/div
${basic_uuid}  12345
${document_selector}  .ui-draggable .contenttype-document
${folder_selector}  .ui-draggable .contenttype-folder
${input_contenttree}  screenlets-content-trees
${screenlet-content-show-button}  div#screenlet-content-show-button
${home_screenlet}  #home
${tile_selector}  div.tile-container div.tile

*** Test cases ***

Test content tree tab
    # XXX: should we create the cover object programmatically?
    Create Cover  Title  Description  Empty layout
    Click Link  link=Layout

    Add Tile
    Select Tile to Add  ${basic_tile_location}
    Save Cover Layout

    Click Link  link=Compose
    Page Should Contain   Please drag&drop some content here to populate the tile.

    Click Element  css=${screenlet-content-show-button}

    Click Element  link=Content tree

    Drag And Drop  css=${document_selector}  css=${tile_selector}
    Page Should Contain  My document

    Input text  name=${input_contenttree}  front
    Page Should Contain  1 Results

    Click Link  link=Layout
    Delete Tile
    Save Cover Layout
