[SEBA-238] End-end testcase template for scenarios

Change-Id: If4fbe8910bccdea4d05c440e9b8ab6682d974c5a
diff --git a/src/test/cord-api/Framework/AttWorkFlowDriver.robot b/src/test/cord-api/Framework/ATTWorkFlowDriver.robot
similarity index 100%
rename from src/test/cord-api/Framework/AttWorkFlowDriver.robot
rename to src/test/cord-api/Framework/ATTWorkFlowDriver.robot
diff --git a/src/test/cord-api/Framework/Subscriber.robot b/src/test/cord-api/Framework/Subscriber.robot
index 39a36d8..e8a38ac 100644
--- a/src/test/cord-api/Framework/Subscriber.robot
+++ b/src/test/cord-api/Framework/Subscriber.robot
@@ -38,5 +38,5 @@
     Log    ${json_result}
     ${json_result_list}=    Get From dictionary    ${json_result}    items
     ${getJsonDict}=    utils.getDictFromListOfDict    ${json_result_list}    serial_number    ${onu_device}
-    ${status}=  Get From Dictionary    ${getJsonDict}   status
+    ${status}=    Get From Dictionary    ${getJsonDict}   status
     [Return]    ${status}
diff --git a/src/test/cord-api/Properties/RestApiProperties.py b/src/test/cord-api/Properties/RestApiProperties.py
index 1199b8d..8a7822f 100644
--- a/src/test/cord-api/Properties/RestApiProperties.py
+++ b/src/test/cord-api/Properties/RestApiProperties.py
@@ -71,4 +71,4 @@
 BNG_MAP = '/xosapi/v1/fabric-crossconnect/bngportmappings'
 ATT_SERVICE = '/xosapi/v1/att-workflow-driver/attworkflowdriverservices'
 ATT_WHITELIST = '/xosapi/v1/att-workflow-driver/attworkflowdriverwhitelistentries'
-ATT_SERVICEINSTANTCES = '/xosapi/v1/att-workflow-driver/attworkflowdriverserviceinstances'
+ATT_SERVICEINSTANCES = '/xosapi/v1/att-workflow-driver/attworkflowdriverserviceinstances'
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATTWhiteList.txt b/src/test/cord-api/Tests/WorkflowValidations/ATTWhiteList.txt
index d550439..6ff873c 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/ATTWhiteList.txt
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATTWhiteList.txt
@@ -7,8 +7,8 @@
 Library           OperatingSystem
 Library           XML
 Library           RequestsLibrary
-Library           ../Framework/utils/utils.py
-Library           ../Framework/restApi.py
+Library           ../../Framework/utils/utils.py
+Library           ../../Framework/restApi.py
 
 *** Variables ***
 ${PATHFILE}       ${CURDIR}/data/ATTWhiteList.json
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATTWorkFlowDriver.txt b/src/test/cord-api/Tests/WorkflowValidations/ATTWorkFlowDriver.txt
index f09ddd5..6254777 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/ATTWorkFlowDriver.txt
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATTWorkFlowDriver.txt
@@ -7,8 +7,8 @@
 Library           OperatingSystem
 Library           XML
 Library           RequestsLibrary
-Library           ../Framework/utils/utils.py
-Library           ../Framework/restApi.py
+Library           ../../Framework/utils/utils.py
+Library           ../../Framework/restApi.py
 
 *** Variables ***
 ${PATHFILE}       ${CURDIR}/data/ATTWorkFlowDriver.json
diff --git a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt
index 3240c5c..7b35489 100644
--- a/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt
+++ b/src/test/cord-api/Tests/WorkflowValidations/ATT_Test001.txt
@@ -1,27 +1,58 @@
 *** Settings ***
-Documentation     Test to Configure White List
+Documentation     Test successful ping from end-end
 Suite Setup       Read InputFile
-Test Template     Configuring White List
+#Suite Teardown    Teardown
 Library           Collections
 Library           String
 Library           OperatingSystem
 Library           XML
 Library           RequestsLibrary
-Library           ../Framework/utils/utils.py
-Library           ../Framework/restApi.py
+Library           ../../Framework/utils/utils.py
+Resource           ../../Framework/utils/utils.robot
+Library           ../../Framework/restApi.py
+Resource           ../../Framework/Subscriber.robot
+Resource           ../../Framework/ATTWorkFlowDriver.robot
+Resource           ../../Framework/ONU.robot
+Resource           ../../Framework/DHCP.robot
+Variables           ../../Properties/RestApiProperties.py
 
 *** Variables ***
 ${PATHFILE}       ${CURDIR}/data/ATTWhiteList.json
+Set Global Variable    ${onu_device}
 
 *** Test Cases ***    TYPE                         LISTINDEX
-Test Create ONUWhiteList-1
-                      CREATE                       0
-Test Get ONUWhiteList-1
-                      RETRIEVE                     0
-Test Service Instance States
-                      STATUS_CHECK                 0
-Test ONU States
-                      ONU_STATUS                 0
+Validate ONU States
+    [Documentation]    Validate status field in ONU List
+    ${operational_status}    ${admin_status}    ONU Status Check    ${onu_device}
+    Should Be Equal    ${operational_status}    ACTIVE
+    Should Be Equal    ${admin_status}    ENABLED
+
+Validate states in ATT WorkFlowDriver Service Instances
+    [Documentation]    Validates necessary states for entries in workflow driver service instance list
+    Log    ${onu_device}
+    ${status}   ${authentication_status}   Service Instance Status Check    ${onu_device}
+    Should Be Equal    ${status}    valid 
+    Should Be Equal    ${authentication_status}    AWAITING
+
+Validate Subscriber State
+    [Documentation]    Validate subscriber status in the rcordsubscriber list
+    ${status}    Subscriber Status Check    ${onu_device}
+    Should Be Equal    ${status}    AWAITING-AUTH 
+
+#Send Subscriber Authentication
+#    [Documentation]
+
+
+Validate states in ATT WorkFlowDriver instances after subscriber authentication
+    [Documentation]    Validate proper states on the service instances after authentication
+    ${status}    ${authentication_status}    Service Instance Status Check    ${onu_device}
+    Should Be Equal    ${status}    valid
+    Should Be Equal    ${authentication_status}    APPROVED
+
+Re-Validate Subscriber State
+    [Documentation]    Validate subscriber status in the rcordsubscriber list
+    ${status}=    Subscriber Status Check    ${onu_device}
+    Should Be Equal    ${status}    ENABLED
 
 *** Keywords ***
 Read InputFile
@@ -31,72 +62,10 @@
     ${AttWhiteListDict}=    utils.listToDict    ${AttWhiteListList}    0
     ${onu_device}=   Get From Dictionary    ${AttWhiteListDict}    serial_number
     Log    ${onu_device}
-    Set Global Variable    ${AttWorkFlowDriver_Id}    ${EMPTY}
-    Set Global Variable    ${AttWhiteList_Id}    ${EMPTY}
-    Set Global Variable    ${onu_device}    ALPHe3d1cfa7
-    Set Global Variable    ${AttServiceInstance_Id}    ${EMPTY}
-    Set Global Variable    ${authentication_status}    ${EMPTY}
-
-
-Configuring White List
-    [Arguments]    ${type}    ${listIndex}
-    Run Keyword If    "${type}" == "CREATE"    Post White List    ${listIndex}
-    Run Keyword If    "${type}" == "RETRIEVE"    Get White List    ${listIndex}
-    Run Keyword If    "${type}" == "STATUS_CHECK"    Service Instance Status Check    ${listIndex}
-    Run Keyword If    "${type}" == "ONU_STATUS"    ONU Status Check    ${listIndex}
-
-Post White List
-    [Arguments]    ${listIndex}
-    ${AttWhiteListList} =    Get Variable Value    ${slist}
-    ${AttWhiteListDict}=    utils.listToDict    ${AttWhiteListList}    ${listIndex}
-    ${onu_device}=   Get From Dictionary    ${AttWhiteListDict}    serial_number
-    Log    ${onu_device}
-    # Retrieve ATT Service Driver Id
-    ${api_getResult}=    restApi.ApiGet    ATT_SERVICE
-    ${AttWorkFlowDriverList}=    Get From Dictionary    ${api_getResult}    items
-    ${AttWorkFlowDriverDict}=    utils.getDictFromListOfDict    ${AttWorkFlowDriverList}    leaf_model_name    AttWorkflowDriverService
-    ${AttWorkFlowDriver_Id}=    Get From Dictionary    ${AttWorkFlowDriverDict}    id
-    ${AttWhiteListDict}=    utils.setFieldValueInDict    ${AttWhiteListDict}    owner_id    ${AttWorkFlowDriver_Id}
-    Log    ${AttWhiteListDict}
-    ${api_result_status}    ${api_result_json}=    restApi.ApiPostReturnJson    ATT_WHITELIST    ${AttWhiteListDict}
-    Should Be True    ${api_result_status}
-    ${AttWhiteList_Id}=    Get From Dictionary    ${api_result_json}    id
-    Set Global Variable    ${AttWhiteList_Id}
     Set Global Variable    ${onu_device}
 
-Get White List
-    [Arguments]    ${listIndex}
-    Log    ${AttWhiteList_Id}
-    ${json_result}=    restApi.ApiChameleonGet    ATT_WHITELIST    ${AttWhiteList_Id}
-    Log    ${json_result}
-    ${AttWhiteListList} =    Get Variable Value    ${slist}
-    ${AttWhiteListDict}=    utils.listToDict    ${AttWhiteListList}    ${listIndex}
-    Log    ${AttWhiteListDict}
-    ${test_result}=    utils.compare_dict    ${AttWhiteListDict}    ${json_result}
-    Should Be True    ${test_result}
-
-Service Instance Status Check
-    [Arguments]    ${listIndex}
-    Set Global Variable    ${AttServiceInstance_Id}    ${EMPTY}
-    Log    ${AttServiceInstance_Id}
-    ${json_result}=    restApi.ApiGet    ATT_SERVICEINSTANTCES
-    Log    ${json_result}
-    ${json_result_list}=    Get From dictionary    ${json_result}    items
-    ${getJsonDict}=    utils.getDictFromListOfDict    ${json_result_list}    serial_number    ${onu_device}
-    ${status}=  Get From Dictionary    ${getJsonDict}   valid 
-    ${authentication_status}=  Get From Dictionary    ${getJsonDict}   authentication_state
-    ${AttServiceInstance_Id}=    Get From Dictionary    ${getJsonDict}   id
-    Set Global Variable    ${AttServiceInstance_Id}
-    Should Be Equal    ${status}   valid 
-    Should Be Equal    ${authentication_status}    AWAITING
-
-ONU Status Check
-    [Arguments]    ${listIndex}
-    ${json_result}=    restApi.ApiGet    ONU_DEVICE
-    Log    ${json_result}
-    ${json_result_list}=    Get From dictionary    ${json_result}    items
-    ${getJsonDict}=    utils.getDictFromListOfDict    ${json_result_list}    serial_number    ${onu_device}
-    ${operational_status}=  Get From Dictionary    ${getJsonDict}   oper_status
-    ${admin_status}=  Get From Dictionary    ${getJsonDict}   admin_state
-    Should Be Equal    ${operational_status}   ACTIVE
-    Should Be Equal    ${admin_status}    ENABLED
+Teardown
+    [Documentation]    Delete and clean up xos objects
+    Clean Up Objects   ${VOLT_SUBSCRIBER} 
+    Clean Up Objects   ${VOLT_DEVICE} 
+    Clean Up Objects   ${ATT_WHITELIST} 
diff --git a/src/test/cord-api/Tests/data/Subscriber_Att.json b/src/test/cord-api/Tests/data/Subscriber_Att.json
new file mode 100644
index 0000000..b2c1580
--- /dev/null
+++ b/src/test/cord-api/Tests/data/Subscriber_Att.json
@@ -0,0 +1,12 @@
+{
+    "SubscriberInfo" : [
+     {
+            "name": "My House-305",
+            "c_tag": 999,
+            "onu_device": "ALPHe3d1cfa7",
+            "nas_port_id": "PON 1/1/03/1:1.1.1",
+            "circuit_id": "foo",
+            "status": "pre-provisioned"
+     }
+  ]
+}