*** 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 ***

${embed_tile_location}  /html/body/div/div[2]/div/div[2]/div[2]/div[3]/div[5]
${embed_selector}  ul#item-list li.ui-draggable
${tile_selector}  div.tile-container div.tile

*** Test cases ***

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

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

    Click Link  link=Compose
    Page Should Contain  Please edit the tile to add the code to be embedded.

    Click Element  css=div#screenlet-content-show-button

    # FIXME: current selectors suck!
    #Drag And Drop  css=${embed_selector}  css=${tile_selector}
    #Page Should Contain  The embed don't have any results

    Click Link  link=Layout
    Delete Tile
    Save Cover Layout
