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

*** Test cases ***

Test CRUD
    Create Cover  Title  Description  Empty layout
    Update  Title fixed  Description fixed
    Delete

Test renderBase
    Goto Homepage
    Create Cover  Title  Description  Empty layout
    ${BASE}  Get Element Attribute  tag=base@href
    Should Be Equal  ${BASE}  ${PLONE_URL}/title-1/
    Click Link  link=Compose
    ${BASE}  Get Element Attribute  tag=base@href
    Should Be Equal  ${BASE}  ${PLONE_URL}/title-1/
    Click Link  link=Layout
    ${BASE}  Get Element Attribute  tag=base@href
    Should Be Equal  ${BASE}  ${PLONE_URL}/title-1/
    
*** Keywords ***

Update
    [arguments]  ${title}  ${description}

    Click Link  link=Edit
    Input Text  css=${title_selector}  ${title}
    Input Text  css=${description_selector}  ${description}
    Click Button  Save
    Page Should Contain  Changes saved

Delete
    Open Action Menu
    Log Source
    Click Link  css=a#plone-contentmenu-actions-delete
    Click Button  Delete
    Page Should Contain  Plone site
