diff --git a/Regression_Tests/TestDataTable-API_requests.robot b/Regression_Tests/TestDataTable-API_requests.robot index e0faf24..6633e69 100644 --- a/Regression_Tests/TestDataTable-API_requests.robot +++ b/Regression_Tests/TestDataTable-API_requests.robot @@ -349,22 +349,6 @@ Create Demo Data ${resp}= PUT On Session TDT /Demo 2/Demo 3/data value 1 expected_status=201 Should Be Equal As Strings ${resp.status_code} 201 -Prep for Perf Tests - ${Table}= Set Variable TT20 - ${Col 1}= Set Variable GC_20k - ${Col 2}= Set Variable BNE_20k - ${filedata}= Get File ${CURDIR}${/}testdata${/}${Col 1}.csv - @{filelines}= Split To Lines ${filedata} - FOR ${line} IN @{filelines} - # ${resp}= POST On Session TDT /${Table}/row {"${Col 1}":"${line}"} expected_status=201 - ${resp}= PUT On Session TDT /${Table}/${Col 1}/${line} expected_status=201 - END - ${filedata}= Get File ${CURDIR}${/}testdata${/}${Col 2}.csv - @{filelines}= Split To Lines ${filedata} - FOR ${line} IN @{filelines} - # ${resp}= POST On Session TDT /${Table}/row {"${Col 1}":"${line}"} expected_status=201 - ${resp}= PUT On Session TDT /${Table}/${Col 2}/${line} expected_status=201 - END *** Keywords *** Connect to TDT diff --git a/Regression_Tests/TestDataTable-API_requests_perf.robot b/Regression_Tests/TestDataTable-API_requests_perf.robot index fa0ca1f..f8dced9 100644 --- a/Regression_Tests/TestDataTable-API_requests_perf.robot +++ b/Regression_Tests/TestDataTable-API_requests_perf.robot @@ -1,12 +1,12 @@ *** Settings *** Resource environment.robot -Library Collections -Library JsonValidator -Library RequestsLibrary -Library String +Library Collections +Library JsonValidator +Library RequestsLibrary +Library String -Suite Setup Connect to TDT +Suite Setup Ensure Test Data Exists Default Tags API RequestsLibrary @@ -94,6 +94,36 @@ Connect to TDT Create Session TDT http://${TDT_Host} Log Connect to TDT:http://${TDT_Host} +Ensure Test Data Exists + Connect to TDT + + ${resp}= GET On Session TDT /${Table}/${Col 1}/all + Log ${resp.json()} + @{coldata}= Set Variable ${resp.json()['${Col 1}']} + ${len}= Get Length ${coldata} + IF ${len} < 1000 + ${filedata}= Get File ${CURDIR}${/}testdata${/}${Col 1}.csv + @{filelines}= Split To Lines ${filedata} + FOR ${line} IN @{filelines} + # ${resp}= POST On Session TDT /${Table}/row {"${Col 1}":"${line}"} expected_status=201 + ${resp}= PUT On Session TDT /${Table}/${Col 1}/${line} expected_status=201 + END + END + + ${resp}= GET On Session TDT /${Table}/${Col 2}/all + @{coldata}= Set Variable ${resp.json()['${Col 2}']} + ${len}= Get Length ${coldata} + IF ${len} < 1000 + ${filedata}= Get File ${CURDIR}${/}testdata${/}${Col 2}.csv + @{filelines}= Split To Lines ${filedata} + FOR ${line} IN @{filelines} + # ${resp}= POST On Session TDT /${Table}/row {"${Col 1}":"${line}"} expected_status=201 + ${resp}= PUT On Session TDT /${Table}/${Col 2}/${line} expected_status=201 + END + END + + + Get TDT Value [Arguments] ${table} ${column} [Documentation] Get TDT Value /${table}/${column}