-
Notifications
You must be signed in to change notification settings - Fork 181
Expand file tree
/
Copy pathreplace_robot_variables.robot
More file actions
86 lines (71 loc) · 3.45 KB
/
replace_robot_variables.robot
File metadata and controls
86 lines (71 loc) · 3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
*** Settings ***
Documentation Tests which work with the same input params across all databases.
Resource ../../resources/common.resource
Suite Setup Connect To DB
Suite Teardown Disconnect From Database
Test Setup Create Table And Set Test Variable
Test Teardown Drop Tables Person And Foobar
*** Variables ***
${Query with vars} SELECT * FROM \${PERSON_TABLE}
${Script with vars} ${Script files dir}/select_with_robot_variables.sql
&{Error}
... psycopg2=*syntax error*$*
... oracledb=*$*invalid character*
... pymssql=*Incorrect syntax*$*
... pymysql=*error*syntax*
... pyodbc=*error*syntax*
... ibm_db_dbi=*Invalid SQL syntax*
... sqlite3=*unrecognized token*$*
*** Test Cases ***
Query
${results}= Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Query ${Query with vars}
${results}= Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Query ${Query with vars} replace_robot_variables=False
Query ${Query with vars} replace_robot_variables=True
SQL String
Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Execute Sql String ${Query with vars}
Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Execute Sql String ${Query with vars} replace_robot_variables=False
Execute Sql String ${Query with vars} replace_robot_variables=True
SQL Script
Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Execute Sql Script ${Script with vars}
Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Execute Sql Script ${Script with vars} replace_robot_variables=False
Execute Sql Script ${Script with vars} replace_robot_variables=True
Row Count
${result}= Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Row Count ${Query with vars}
${result}= Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Row Count ${Query with vars} replace_robot_variables=False
${result}= Row Count ${Query with vars} replace_robot_variables=True
Description
${result}= Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Description ${Query with vars}
${result}= Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Description ${Query with vars} replace_robot_variables=False
${result}= Description ${Query with vars} replace_robot_variables=True
Check Query Result
Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Check Query Result ${Query with vars} contains Franz Allan col=1
Run Keyword And Expect Error
... ${Error}[${DB_MODULE}]
... Check Query Result
... ${Query with vars}
... contains
... Franz Allan
... col=1
... replace_robot_variables=False
Check Query Result ${Query with vars} contains Franz Allan col=1 replace_robot_variables=True
Check Row Count
Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Check Row Count ${Query with vars} == 2
Run Keyword And Expect Error ${Error}[${DB_MODULE}]
... Check Row Count ${Query with vars} == 2 replace_robot_variables=False
Check Row Count ${Query with vars} == 2 replace_robot_variables=True
*** Keywords ***
Create Table And Set Test Variable
Create Person Table And Insert Data
Set Test Variable ${PERSON_TABLE} person