# ============================================================================
# CONTENT CREATION
# ============================================================================
#
# Run this robot test stand-alone:
#
#  $ bin/test -s vncportal.policy -t content.robot --all
#
# Run this robot test with robot server (which is faster):
#
# 1) Start robot server:
#
# $ bin/robot-server --reload-path src vncportal.policy.testing.VNCPORTAL_POLICY_ACCEPTANCE_TESTING
#
# 2) Run robot tests:
#
# $ bin/robot src/vncportal.policy/src/vncportal/policy/tests/robot/content.robot
#
# See the http://docs.plone.org for further details (search for robot
# framework).
#
# ============================================================================

*** Variables ***

# Page Object
${Login-Page-Field-Username}  xpath=//input[@name='__ac_name']
${Login-Page-Field-Password}  xpath=//input[@name='__ac_password']
${Login-Page-Button-Submit}  xpath=//button[@type="submit"]
${Header-Drop-Down}  css=.header-drop-down.hide-mobile
${Drop-Down-Menu}  css=.drop-menu-nav .nav
${Logout-Button}  css=.nav li:nth-child(2)


*** Settings ***

Resource  keywords.robot

Test Setup  Test Setup
Test Teardown  Close browser


*** Test Cases ***

# As a logged in user I can browser content -> TODO


# View

Scenario: As a logged in user I can view a folder
  Given a logged in user
    and a folder with all attributes
   When I go to the folder view
   Then I should see the folder with all attributes

Scenario: As a logged in user I can view a page
  Given a logged in user
    and a page with all attributes
   When I go to the page view
   Then I should see the page with all attributes

Scenario: As a logged in user I can view an event
  Given a logged in user
    and an event with all attributes
   When I go to the event view
   Then I should see the event with all attributes

Scenario: As a logged in user I can view a news item
  Given a logged in user
    and a news item with all attributes
   When I go to the news item view
   Then I should see the news item with all attributes

Scenario: As a logged in user I can view a link
  Given a logged in user
    and a link with all attributes
   When I go to the link view
   Then I should see the link with all attributes

Scenario: As a logged in user I can view a file
  Given a logged in user
    and a file with all attributes
   When I go to the file view
   Then I should see the file with all attributes

# Adding

Scenario: As a logged in user I can add a folder
  Given a logged in user
   When I create a new folder
   Then I should see the new folder

Scenario: As a logged in user I can add a page
  Given a logged in user
   When I create a new page
   Then I should see the new page

Scenario: As a logged in user I can add an event
  Given a logged in user
   When I create a new event
   Then I should see the new event

Scenario: As a logged in user I can add a news item
  Given a logged in user
   When I create a new news item
   Then I should see the new news item

Scenario: As a logged in user I can add a link
  Given a logged in user
   When I create a new link
   Then I should see the new link

Scenario: As a logged in user I can add a file
  Given a logged in user
   When I create a new file
   Then I should see the new file

# Editing

Scenario: As a logged in user I can edit a folder
  Given a logged in user
    and a folder
   When I edit the folder
   Then I should see my edited folder attributes

Scenario: As a logged in user I can edit a page
  Given a logged in user
    and a page
   When I edit the page
   Then I should see my edited page attributes

Scenario: As a logged in user I can edit an event
  Given a logged in user
    and an event
   When I edit the event
   Then I should see my edited event attributes

Scenario: As a logged in user I can edit a news item
  Given a logged in user
    and a news item
   When I edit the news item
   Then I should see my edited news item attributes

Scenario: As a logged in user I can edit a link
  Given a logged in user
    and a link
   When I edit the link
   Then I should see my edited link attributes

Scenario: As a logged in user I can edit a file
  Given a logged in user
    and a file
   When I edit the file
   Then I should see my edited file attributes


*** Keywords ***

# Given

a logged in user
  # Precondition: use the autologin feature
  No operation

a folder with all attributes
  No operation

a page with all attributes
  No operation

a news item with all attributes
  No operation

an event with all attributes
  No operation

a file with all attributes
  No operation

a link with all attributes
  No operation

# When

I go to the folder view
  No operation

I go to the page view
  No operation

I go to the news item view
  No operation

I go to the event view
  No operation

I go to the file view
  No operation

I go to the link view
  No operation

I create a new folder
  No operation

I create a new page
  No operation

I create a new news item
  No operation

I create a new event
  No operation

I create a new file
  No operation

I create a new link
  No operation

I edit the folder
  No operation

I edit the page
  No operation

I edit the news item
  No operation

I edit the event
  No operation

I edit the file
  No operation

I edit the link
  No operation

# Then

I should see the folder with all attributes
  No operation

I should see the page with all attributes
  No operation

I should see the news item with all attributes
  No operation

I should see the event with all attributes
  No operation

I should see the file with all attributes
  No operation

I should see the link with all attributes
  No operation

I should see the new folder
  No operation

I should see the new page
  No operation

I should see the new news item
  No operation

I should see the new event
  No operation

I should see the new file
  No operation

I should see the new link
  No operation

I should see my edited folder attributes
  No operation

I should see my edited page attributes
  No operation

I should see my edited news item attributes
  No operation

I should see my edited event attributes
  No operation

I should see my edited file attributes
  No operation

I should see my edited link attributes
  No operation
