openprocurement_client.robot
6.17 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
*** Settings ***
Library op_robot_tests.tests_files.brokers.openprocurement_client_helper
*** Keywords ***
Підготувати клієнт для користувача
[Arguments] @{ARGUMENTS}
[Documentation] Відкрити брaвзер, створити обєкт api wrapper, тощо
${api_wrapper}= prepare_api_wrapper ${BROKERS['${USERS.users['${ARGUMENTS[0]}'].broker}'].api_key}
Set To Dictionary ${USERS.users['${ARGUMENTS[0]}']} client ${api_wrapper}
Log Variables
Створити тендер
[Arguments] @{ARGUMENTS}
${INITIAL_TENDER_DATA}= prepare_test_tender_data
Log object data ${INITIAL_TENDER_DATA}
${TENDER_DATA}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} create_tender ${INITIAL_TENDER_DATA}
Log object data ${TENDER_DATA} cteated_tender
${access_token}= Get Variable Value ${TENDER_DATA.access.token}
Set Global Variable ${access_token}
Set To Dictionary ${USERS.users['${ARGUMENTS[0]}']} access_token ${access_token}
Log access_token: ${access_token}
Log tender_id: ${TENDER_DATA.data.id}
Set Global Variable ${TENDER_DATA}
#Debug
[return] ${TENDER_DATA}
Пошук тендера по ідентифікатору
[Arguments] @{ARGUMENTS}
[Documentation]
... ${ARGUMENTS[0]} == username
... ${ARGUMENTS[1]} == tenderId
... ${ARGUMENTS[2]} == id
${tender_data}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${ARGUMENTS[2]}
Set To Dictionary ${USERS.users['${ARGUMENTS[0]}']} tender_data ${tender_data}
[return] ${tender_data}
обновити сторінку з тендером
[Arguments] @{ARGUMENTS}
[Documentation]
... ${ARGUMENTS[0]} == username
... ${ARGUMENTS[1]} == tenderId
... ${ARGUMENTS[2]} == id
openprocurement_client.Пошук тендера по ідентифікатору @{ARGUMENTS}
отримати інформацію із тендера
[Arguments] @{ARGUMENTS}
[Documentation]
... ${ARGUMENTS[0]} == username
... ${ARGUMENTS[1]} == fieldname
${field_value}= Get_From_Object ${USERS.users['${ARGUMENTS[0]}'].tender_data.data} ${ARGUMENTS[1]}
[return] ${field_value}
Внести зміни в тендер
[Arguments] @{ARGUMENTS}
[Documentation]
... ${ARGUMENTS[0]} == username
... ${ARGUMENTS[1]} == id
... ${ARGUMENTS[2]} == fieldname
... ${ARGUMENTS[3]} == fieldvalue
отримати тендер ${ARGUMENTS[0]} ${ARGUMENTS[1]}
Set_To_Object ${TENDER_DATA.data} ${ARGUMENTS[2]} ${ARGUMENTS[3]}
${TENDER_DATA}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} patch_tender ${TENDER_DATA}
${TENDER_DATA}= set_access_key ${TENDER_DATA} ${USERS.users['${ARGUMENTS[0]}'].access_token}
Set Global Variable ${TENDER_DATA}
отримати тендер
[Arguments] @{ARGUMENTS}
[Documentation]
... ${ARGUMENTS[0]} == username
... ${ARGUMENTS[1]} == id
${TENDER_DATA}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${ARGUMENTS[1]}
Log object data ${TENDER_DATA}
${TENDER_DATA}= set_access_key ${TENDER_DATA} ${USERS.users['${ARGUMENTS[0]}'].access_token}
Set Global Variable ${TENDER_DATA}
Задати питання
[Documentation]
... ${ARGUMENTS[0]} == username
... ${ARGUMENTS[1]} == tender_uid
... ${ARGUMENTS[2]} == question
[Arguments] @{ARGUMENTS}
log many @{ARGUMENTS}
${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${ARGUMENTS[1]}
${question}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} create_question ${tender} ${ARGUMENTS[2]}
Log object data ${question} question
Відповісти на питання
[Documentation]
... ${ARGUMENTS[0]} == username
... ${ARGUMENTS[1]} == tender_uid
... ${ARGUMENTS[2]} == question_id
... ${ARGUMENTS[3]} == answer_data
[Arguments] @{ARGUMENTS}
log many @{ARGUMENTS}
${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${ARGUMENTS[1]}
${tender}= set_access_key ${tender} ${USERS.users['${ARGUMENTS[0]}'].access_token}
${ARGUMENTS[3].data.id}= Set Variable ${tender.data.questions[${ARGUMENTS[2]}].id}
${quvestion_with_answer}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} patch_question ${tender} ${ARGUMENTS[3]}
Log object data ${quvestion_with_answer} quvestion_with_answer
Подати цінову пропозицію
[Documentation]
... ${ARGUMENTS[0]} == username
... ${ARGUMENTS[1]} == tender_uid
... ${ARGUMENTS[2]} == bid
[Arguments] @{ARGUMENTS}
log many @{ARGUMENTS}
${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${ARGUMENTS[1]}
${biddingresponce}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} create_bid ${tender} ${ARGUMENTS[2]}
Set Global Variable ${biddingresponce}
Log object data ${biddingresponce} bid
[return] ${biddingresponce}
Змінити цінову пропозицію
[Documentation]
... ${ARGUMENTS[0]} == username
... ${ARGUMENTS[1]} == tender_uid
... ${ARGUMENTS[2]} == bid
[Arguments] @{ARGUMENTS}
log many @{ARGUMENTS}
${token}= Get Variable Value ${TENDER_DATA.access.token}
Set To Dictionary ${USERS.users['${ARGUMENTS[0]}']} token ${token}
${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${ARGUMENTS[1]}
${patch}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} patch_bid ${tender} ${ARGUMENTS[2]}
Log object data ${patch} patch
Змінити цінову пропозицію
[Documentation]
... ${ARGUMENTS[0]} == username
... ${ARGUMENTS[1]} == tender_uid
... ${ARGUMENTS[2]} == bid
[Arguments] @{ARGUMENTS}
log many @{ARGUMENTS}
${token}= Get Variable Value ${TENDER_DATA.access.token}
Set To Dictionary ${USERS.users['${ARGUMENTS[0]}']} token ${token}
${tender}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} get_tender ${ARGUMENTS[1]}
${patch}= Call Method ${USERS.users['${ARGUMENTS[0]}'].client} patch_bid ${tender} ${ARGUMENTS[2]}
Log object data ${patch} patch