Revision: 4219
Author: jprantan
Date: Thu Sep 30 03:12:03 2010
Log: updated tests.
http://code.google.com/p/robotframework/source/detail?r=4219

Modified:
 /trunk/proto/atdd-tutorial-berlin-2010/atest/vacalc/add_employee.txt
 /trunk/proto/atdd-tutorial-berlin-2010/atest/vacalc/date_validation.txt
 /trunk/proto/atdd-tutorial-berlin-2010/atest/vacalc/resource.txt

=======================================
--- /trunk/proto/atdd-tutorial-berlin-2010/atest/vacalc/add_employee.txt Thu Sep 30 02:34:53 2010 +++ /trunk/proto/atdd-tutorial-berlin-2010/atest/vacalc/add_employee.txt Thu Sep 30 03:12:03 2010
@@ -1,4 +1,9 @@
-***Test Cases***
+*** Settings ***
+Force Tags   Sprint-0  regression
+Resource  resource.txt
+
+
+*** Test Cases ***

 Adding employee
     Given no employee "Juha" exists in the system
@@ -13,7 +18,7 @@
     Then message "Employee 'Juha' already exists in the system." is shown
     and "Juha" with start date 2010-01-01 exists in the database

-Adding Two Employees
+Adding two employees
     Given no employee exists in the system
     When "Pekka" with start date 2010-01-01 is added
     and "Janne" with start date 2010-01-01 is added
@@ -22,12 +27,10 @@


 *** Keywords ***
+
 Given no employee "${name}" exists in the system
     Start Vacalc With No Employees

-Given no employee exists in the system
-    Start Vacalc With No Employees
-
 "${name}" with start date ${date} is added
     Add Employee  ${name}  ${date}

@@ -37,15 +40,12 @@
 "${name}" exists in the employee listing
     Employee Should Be Selected  ${name}

-and "${name}" with start date ${date} exists in the database
+And "${name}" with start date ${date} exists in the database
     Employee exists in the database  ${name}  ${date}
+
+Given no employee exists in the system
+    Start Vacalc With No Employees

 Given employee "${name}" with start date ${date} exists in the system
     Start Vacalc With No Employees
     Add Employee  ${name}  ${date}
-
-
-***Settings***
-Force Tags   Sprint-1
-Resource  resource.txt
-Test Teardown  Close Vacalc
=======================================
--- /trunk/proto/atdd-tutorial-berlin-2010/atest/vacalc/date_validation.txt Thu Sep 30 02:46:00 2010 +++ /trunk/proto/atdd-tutorial-berlin-2010/atest/vacalc/date_validation.txt Thu Sep 30 03:12:03 2010
@@ -1,12 +1,13 @@
-***Settings***
+*** Settings ***
 Resource        resource.txt
 Test Template   Validate start date
-Suite Teardown  Close Vacalc
+

 *** Variables ***
 ${USER}  Mr. Roboto

-***Test Cases***
+
+*** Test Cases ***

 Valid date
     2010-09-29  Employee '${USER}' was added successfully.
@@ -34,11 +35,10 @@
     2012-2-30   Day must be in 1..29.


-***Keywords***
+*** Keywords ***

 Validate start date
     [Arguments]  ${date}  ${message}
     Start Vacalc with no employees
     Add employee  ${USER}  ${date}
     Status message should be  ${message}
-
=======================================
--- /trunk/proto/atdd-tutorial-berlin-2010/atest/vacalc/resource.txt Thu Sep 30 02:46:00 2010 +++ /trunk/proto/atdd-tutorial-berlin-2010/atest/vacalc/resource.txt Thu Sep 30 03:12:03 2010
@@ -2,24 +2,26 @@
 Library  SwingLibrary
 Library  OperatingSystem

+
 *** Variables ***
 ${DATABASE}  ${CURDIR}${/}test_db.txt

+
 *** Keywords ***

 Start Vacalc
-    Close Vacalc
+    Close Vacalc If It Has Been Opened
     Set Environment Variable  VACALC_DB  ${DATABASE}
     Start Application  org.robotframework.vacalc.VacalcRunner
     Select Window  Vacation Calculator
+
+Close Vacalc If It Has Been Opened
+ ${status} ${title} = Run Keyword And Ignore Error Get Current Context
+    Run Keyword If  "${status}" == "PASS"  Close Window  ${title}

 Start Vacalc with No Employees
     Clear Database
     Start Vacalc
-
-Close Vacalc
- ${status} ${title} = Run Keyword And Ignore Error Get Current Context
-    Run Keyword If  "${status}" == "PASS"  Close Window  ${title}

 Clear Database
     Remove File  ${DATABASE}
@@ -40,12 +42,12 @@
     ${selected item}=  Get Selected Value From List  employee_list
     Should Be Equal  ${name}  ${selected item}

-Employee exists in the database
+Employee Exists In The Database
     [Arguments]  ${name}  ${date}
     ${db} =  Get File  ${DATABASE}
     Should Contain  ${db}  ${name},${date}

-Employee should not exist in the database
+Employee Should Not Exist In The Database
     [Arguments]  ${name}
     ${db} =  Get File  ${DATABASE}
     Should Not Contain  ${db}  ${name}

Reply via email to