*** Settings ***
Library         Selenium2 Library
Library         Wcs Robot Framework Library
Test Setup      Setup Test
Suite Setup     Start WCS Server  False
Test Teardown   Close All Browsers

*** Keywords ***
Setup Test
  Open Browser  http://localhost:10003/  ff
  #Maximize Browser Window

Given a logged in admin
  Click Link  Login
  Input Text  qx=Username  admin
  Input Text  qx=Password  admin
  Click Button  Log in

*** Testcases ***
Create Form With a Date Field
  Reset Formdefs
  Given a logged in admin
  Click Link  Back Office
  Click Link  admin
  Click Link  Forms
  Click Link  New Form
  Input Text  qx=Form Title  Form with a date field
  Click Button  Submit
  Input Text  qx=Label  Date
  Select From List  qx=Type  Date
  Click Button  Add
  Click Link  Enable

Correct Date
  Click Link  Form with a date field
  Input Text  qx=Date  2009-10-13
  Click Button  Next
  Page Should Contain  Check values then click submit.

Incorrect Date
  Click Link  Form with a date field
  Input Text  qx=Date  hello world
  Click Button  Next
  Page Should Not Contain  Check values then click submit.

Set Minimum Date
  Given a logged in admin
  Click Link  Back Office
  Click Link  admin
  Click Link  Forms
  Click Link  Form with a date field
  Click Link  edit
  Mouse Over  css=#itemId_1
  Click Link  css=#itemId_1 .commands .edit a
  Input Text  qx=Minimum Date  2009-10-13
  Click Button  Submit

Correct Date with minimum check
  Click Link  Form with a date field
  Input Text  qx=Date  2009-10-15
  Click Button  Next
  Page Should Contain  Check values then click submit.

Incorrect Date with minimum check
  Click Link  Form with a date field
  Input Text  qx=Date  2009-08-03
  Click Button  Next
  Page Should Not Contain  Check values then click submit.

Set Maximum Date
  Given a logged in admin
  Click Link  Back Office
  Click Link  admin
  Click Link  Forms
  Click Link  Form with a date field
  Click Link  edit
  Mouse Over  css=#itemId_1
  Click Link  css=#itemId_1 .commands .edit a
  Input Text  qx=Minimum Date  ${EMPTY}
  Input Text  qx=Maximum Date  2009-10-13
  Click Button  Submit

Correct Date with maximum check
  Click Link  Form with a date field
  Input Text  qx=Date  2009-08-03
  Click Button  Next
  Page Should Contain  Check values then click submit.

Incorrect Date with maximum check
  Click Link  Form with a date field
  Input Text  qx=Date  2009-10-15
  Click Button  Next
  Page Should Not Contain  Check values then click submit.

