*** Settings ***
Variables           variables.py
Resource            plone/app/robotframework/selenium.robot
Resource            plone/app/robotframework/keywords.robot
Resource            ../lib/keywords.robot
Library             Remote    ${PLONE_URL}/RobotRemote
Library             DebugLibrary

Test Setup          Prepare test browser
Test Teardown       Close all browsers


*** Test Cases ***
Robinson cannot use the global stream
    Given I am logged in as the user robinson_crusoe
    when I open the Dashboard
    then I cannot see updates at all
    and I cannot write a new status update

# TODO: fixme

Ulysses can see but not post updates in the dashboard
    Pass Execution    Temporarily skipped. TODO: Check why this fails!
    Given I am logged in as the user ulysses_grant
    when I open the Dashboard
    then I can see updates by    Christian Stoney
    and I cannot write a new status update

Robinson cannot see any workspaces
    Given I am logged in as the user robinson_crusoe
    Then I cannot see any workspaces

Ulysses can participate in the Open Market Committee Workspace
    Given I am logged in as the user ulysses_grant
    Then I can go to the Open Market Committee Workspace
    And I open the sidebar documents tile
    And I select a file to upload
    Then the file appears in the sidebar

Robinson cannot access news
    Given I am logged in as the user robinson_crusoe
    Then I cannot access the news

Robinson cannot access library
    Given I am logged in as the user robinson_crusoe
    Then I cannot access the library

Robinson can search himself
    Given I am logged in as the user robinson_crusoe
    And I can search in the site header for Robinson
    Then I can see the search result Robinson Crusoe

Robinson cannot search Open Market Committee
    Given I am logged in as the user robinson_crusoe
    And I can search in the site header for Open
    Then I cannot see any search result

Ulysses can search Open Market Committee
    Given I am logged in as the user ulysses_grant
    And I can search in the site header for Open
    Then I can see the search result Open Market Committee


*** Keywords ***
I cannot access the news
    Click link    css=a.section-news
    I do not have sufficient privileges

I cannot access the library
    Click link    css=a.section-library
    I do not have sufficient privileges
