Robot workshop testcrunch

This commit is contained in:
Filip Rechtoris
2015-11-06 11:28:11 +01:00
commit 758e7e70ac
6 changed files with 143 additions and 0 deletions

5
Config.robot Normal file
View File

@@ -0,0 +1,5 @@
*** Variables ***
${ip_address} 10.0.13.69
${port} 8443
${login} safeq
${password} password

16
Resources/Selenium.robot Normal file
View File

@@ -0,0 +1,16 @@
*** Settings ***
Library Selenium2Library
*** Keywords ***
Test init
Open Browser http://10.0.13.69:8080 firefox
Maximize Browser Window
Test teardown
Close Browser
Prepare data
${r1} = Evaluate random.randint(1000, 999999) random,sys
${r2} = Evaluate random.randint(1000, 999999) random,sys
Set Test Variable ${userId} ${r1}
Set Test Variable ${testerName} tester-${r2}

15
Testsuites/LinkedIn.robot Normal file
View File

@@ -0,0 +1,15 @@
*** Settings ***
Library Selenium2Library
*** Test Cases ***
Find Petr Neugebauer on LinkedIN
Open Browser http://www.linkedin.cz/ firefox
Maximize Browser Window
Input Text name=first Petr
Input Text name=last Neugebauer
Click Element name=search
Click Link Petr Neugebauer
Page Should Contain Testing is like sex. If its not fun, then youre doing it wronk
Sleep 3
Capture Page Screenshot
Close All Browsers

View File

@@ -0,0 +1,31 @@
*** Settings ***
Resource ../Resources/Selenium.robot
Library RequestsLibrary
Library urllib
Library uuid
Library json.JSONEncoder ensure_ascii=False
Resource ../Config.robot
Library OperatingSystem
*** Test Cases ***
Create customer
Prepare data
${auth}= Create List safeq password
Create Session main_session https://10.0.13.69:8443/payment-system/api/v2/ auth=${auth}
${data} Create Dictionary guid=${userId} name=${testerName} lookupKey=${testerName} minimumBalance=0.00 state=ENABLED
${jsondata}= json.JSONEncoder.Encode ${data}
${headers}= Create Dictionary Content-Type=application/json;charset=UTF-8
${response} Post main_session /customer ${jsondata} headers=${headers}
Should Be Equal As Strings ${response.status_code} 201
Delete All Sessions
Create customer with configuration file
Prepare data
${auth}= Create List ${login} ${password}
Create Session main_session https://${ip_address}:${port}/payment-system/api/v2/ auth=${auth}
${data} Create Dictionary guid=${userId} name=${testerName} lookupKey=${testerName} minimumBalance=0.00 state=ENABLED
${jsondata}= json.JSONEncoder.Encode ${data}
${headers}= Create Dictionary Content-Type=application/json;charset=UTF-8
${response} Post main_session /customer ${jsondata} headers=${headers}
Should Be Equal As Strings ${response.status_code} 201
Delete All Sessions

View File

@@ -0,0 +1,54 @@
*** Settings ***
Library Selenium2Library
*** Test Cases ***
Create customer
Open Browser http://10.0.13.69:8080 firefox
Click Link Payment System Administration
Input Text username safeq
Input Text password password
Click Button log-in
Click Link create-customer
Input Text guid 1
Input Text create-customer-name Tester
Input Text create-customer-lookup-key tester
Input Text create-customer-initial-balance 0
Click Button Create customer
Close Browser
Create customer with verification
Open Browser http://10.0.13.69:8080 firefox
Click Link Payment System Administration
Input Text username safeq
Input Text password password
Click Button log-in
Page Should Contain YSoft Payment System (1.25.31), Copyright© 2000-2015
Click Link create-customer
Input Text guid 1
Input Text create-customer-name Tester
Input Text create-customer-lookup-key tester
Input Text create-customer-initial-balance 0
Click Button Create customer
Page Should Contain Customer has been created.
Click Button Log out
Close Browser
Create unique customer with verification
${r1} = Evaluate random.randint(1000, 999999) random,sys
${r2} = Evaluate random.randint(1000, 999999) random,sys
Open Browser http://10.0.13.69:8080 firefox
Maximize Browser Window
Click Link Payment System Administration
Input Text username safeq
Input Text password password
Click Button log-in
Page Should Contain YSoft Payment System (1.25.31), Copyright© 2000-2015
Click Link create-customer
Input Text guid ${r1}
Input Text create-customer-name Tester-${r2}
Input Text create-customer-lookup-key tester-${r2}
Input Text create-customer-initial-balance 0
Click Button Create customer
Page Should Contain Customer has been created.
Click Button Log out
Close Browser

View File

@@ -0,0 +1,22 @@
*** Settings ***
Suite Setup Test init
Suite Teardown Test teardown
Library Selenium2Library
Resource ../Resources/Selenium.robot
*** Test Cases ***
Create customer
Prepare data
Click Link Payment System Administration
Input Text username safeq
Input Text password password
Click Button log-in
Page Should Contain YSoft Payment System (1.25.31), Copyright© 2000-2015
Click Link create-customer
Input Text guid ${userId}
Input Text create-customer-name ${testerName}
Input Text create-customer-lookup-key ${testerName}
Input Text create-customer-initial-balance 0
Click Button Create customer
Page Should Contain Customer has been created.
Click Button Log out