aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vid/resources/keywords/scaleout_vid_keywords.robot
diff options
context:
space:
mode:
authorkoblosz <sandra.koblosz@nokia.com>2018-10-23 07:32:30 +0200
committerkoblosz <sandra.koblosz@nokia.com>2018-10-23 08:25:47 +0200
commit2ac270a8ee0ecf5357c541deb6e162b4cc26dd98 (patch)
tree4dd8770e719c806af57d252de44df663b06f74bd /tests/vid/resources/keywords/scaleout_vid_keywords.robot
parent5d59d1bf48fa2f0fbd433e8b25a207d62ddf8d22 (diff)
Enhance vid CSIT tests, added for scaleout
Issue-ID: VID-323 Change-Id: I31ad377ee766eaf66c848ad802c33e21ea1dfe76 Signed-off-by: Sandra Koblosz <sandra.koblosz@nokia.com>
Diffstat (limited to 'tests/vid/resources/keywords/scaleout_vid_keywords.robot')
-rw-r--r--tests/vid/resources/keywords/scaleout_vid_keywords.robot45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/vid/resources/keywords/scaleout_vid_keywords.robot b/tests/vid/resources/keywords/scaleout_vid_keywords.robot
new file mode 100644
index 00000000..0b96d45d
--- /dev/null
+++ b/tests/vid/resources/keywords/scaleout_vid_keywords.robot
@@ -0,0 +1,45 @@
+*** Settings ***
+Documentation Collection of util keywords for managing SO simulator
+Library SeleniumLibrary
+Library RequestsLibrary
+Library OperatingSystem
+Library Collections
+Library json
+Resource ../../../common.robot
+
+
+*** Keywords ***
+Setup Expected Data In SO Simulator
+ [Documentation] Setup data to be returned by simulator
+ [Arguments] ${expectedResponseFilePath} ${simulatorBaseUrl} ${simulatorPutEndpoint}
+ ${expectedDataToReturn}= json_from_file ${expectedResponseFilePath}
+ ${headers}= Create Dictionary Content-Type=application/json
+ ${session}= Create Session so_simulator ${simulatorBaseUrl}
+ ${resp}= Put Request so_simulator uri=/${simulatorPutEndpoint} data=${expectedDataToReturn} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Log to console Successfully initialized so-simulator: status code ${resp.status_code}
+
+
+Send Post request from VID FE
+ [Documentation] Imitates VID UI. This keyword is designed for imitating calls from VID UI to VID BE
+ [Arguments] ${vidBaseUrl} ${endpoint} ${requestFilePath} ${expectedResponseFilePath} ${cookie}
+ ${vidRequest}= json_from_file ${requestFilePath}
+ ${headers}= Create Dictionary Content-Type=application/json Cookie=${cookie}
+ ${session}= Create Session vid ${vidBaseUrl}
+ ${resp}= Post Request vid uri=/${endpoint} data=${vidRequest} headers=${headers}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Log to console ${resp.content}
+ [Return] ${resp}
+
+
+Login to VID Internally
+ [Arguments] ${url} ${username} ${password}
+ [Documentation] Login using Autn
+ Open browser ${url} chrome
+ Input Text id=loginId ${username}
+ Input Password id=password ${password}
+ Click Element id=loginBtn
+ ${cookie_value} Get Cookie Value JSESSIONID
+ [Return] JSESSIONID=${cookie_value}
+
+