*** 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 ***
Anonymous gets a notification when clicking an unauthorized pat-inject link
    Given I am logged in as the user allan_neece
    Go to    ${PLONE_URL}/test_injection_on_insufficient_privileges
    Click Link    Test unauthorized pat-inject
    Wait Until Page Contains    You do not have sufficient privileges to view this page

Allan cannot access some apps
    Given I am logged in as the user allan_neece
    Then I can go to the application    App store
    And I see the modal    App not available
    But I cannot go to the application    Administrator Tool


*** Keywords ***
I see the modal
    [Arguments]    ${title}
    Page should contain Element    jquery=h1:contains("${title}")
    Click button    jquery=#pat-modal .close-panel
