awetestlib 0.1.0-x86-mingw32 → 0.1.1-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/version.rb +1 -1
- data/test/zoho_util.rb +485 -484
- metadata +3 -3
data/lib/version.rb
CHANGED
data/test/zoho_util.rb
CHANGED
@@ -1,484 +1,485 @@
|
|
1
|
-
module ZohoUtil
|
2
|
-
|
3
|
-
def run
|
4
|
-
if @xls_path
|
5
|
-
get_variables(@xls_path, :role)
|
6
|
-
@login.each_key do |key|
|
7
|
-
if @login[key]['enabled'] == 'Y'
|
8
|
-
@user = @login[key]['userid']
|
9
|
-
@pass = @login[key]['password']
|
10
|
-
@role = @login[key]['role']
|
11
|
-
@url1 = @login[key]['url']
|
12
|
-
debug_to_report("@user: #{@user}, @pass: #{@pass}, @role: #{@role} (#{__LINE__})")
|
13
|
-
break
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
set_textfield_by_name(browser, '
|
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
|
-
filepath
|
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
|
-
click_text(browser, '
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
#
|
125
|
-
#
|
126
|
-
#
|
127
|
-
#
|
128
|
-
#
|
129
|
-
#
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
#
|
141
|
-
#
|
142
|
-
#
|
143
|
-
#
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
validate_text(browser, '
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
validate_text(browser, 'Lead
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
set_textfield_by_name(browser, 'property(
|
230
|
-
set_textfield_by_name(browser, 'property(
|
231
|
-
|
232
|
-
|
233
|
-
select_option_by_name_and_option_value(browser, 'property(
|
234
|
-
select_option_by_name_and_option_value(browser, 'property(
|
235
|
-
select_option_by_name_and_option_value(browser, 'property(
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
set_textfield_by_name(browser, 'property(
|
250
|
-
set_textfield_by_name(browser, 'property(
|
251
|
-
set_textfield_by_name(browser, 'property(
|
252
|
-
set_textfield_by_name(browser, 'property(
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
select_option_by_name_and_option_value(browser, 'property(
|
322
|
-
|
323
|
-
|
324
|
-
set_textfield_by_name(browser, 'property(
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
popup
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
select_option_by_name_and_option_value(browser, 'property(
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
debug_to_log("#{__method__}:
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
@login[key]
|
449
|
-
@login[key]['
|
450
|
-
@login[key]['
|
451
|
-
@login[key]['
|
452
|
-
@login[key]['
|
453
|
-
@login[key]['
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
1
|
+
module ZohoUtil
|
2
|
+
|
3
|
+
def run
|
4
|
+
if @xls_path
|
5
|
+
get_variables(@xls_path, :role)
|
6
|
+
@login.each_key do |key|
|
7
|
+
if @login[key]['enabled'] == 'Y'
|
8
|
+
@user = @login[key]['userid']
|
9
|
+
@pass = @login[key]['password']
|
10
|
+
@role = @login[key]['role']
|
11
|
+
@url1 = @login[key]['url']
|
12
|
+
debug_to_report("@user: #{@user}, @pass: #{@pass}, @role: #{@role} (#{__LINE__})")
|
13
|
+
break
|
14
|
+
end
|
15
|
+
end
|
16
|
+
else
|
17
|
+
@user = "joeklienwatir@gmail.com"
|
18
|
+
@pass = 'watir001'
|
19
|
+
@url1 = "https://accounts.zoho.com/login?serviceurl=https://www.zoho.com/&hide_signup=true&css=https://www.zoho.com/css/login.css"
|
20
|
+
end
|
21
|
+
|
22
|
+
home_url = 'https://crm.zoho.com/crm/ShowHomePage.do'
|
23
|
+
validation = 'Welcome joeklienwatir at Software'
|
24
|
+
|
25
|
+
browser = open_browser
|
26
|
+
go_to_url(browser, @url1)
|
27
|
+
zoho_login(browser, @user, @pass, home_url, validation)
|
28
|
+
run_test(browser)
|
29
|
+
logout(browser)
|
30
|
+
|
31
|
+
rescue
|
32
|
+
fatal_to_log("#{@myName} '#{$!}'")
|
33
|
+
browser.close
|
34
|
+
raise
|
35
|
+
end
|
36
|
+
|
37
|
+
def zoho_login(browser, userid, password, url, validation = 'Welcome joeklienwatir at Software')
|
38
|
+
mark_testlevel("#{__method__.to_s.titleize}", 8)
|
39
|
+
set_textfield_by_name(browser, 'lid', userid)
|
40
|
+
set_textfield_by_name(browser, 'pwd', password)
|
41
|
+
click_button_by_value(browser, 'Sign In')
|
42
|
+
go_to_url(browser, url)
|
43
|
+
validate_text(browser, validation)
|
44
|
+
end
|
45
|
+
|
46
|
+
def navigate_to_crm(browser)
|
47
|
+
mark_testlevel("#{__method__.to_s.titleize}", 3)
|
48
|
+
click_text(browser, 'CRM')
|
49
|
+
end
|
50
|
+
|
51
|
+
def navigate_to_project(browser)
|
52
|
+
mark_testlevel("#{__method__.to_s.titleize}", 3)
|
53
|
+
click_text(browser, 'Projects')
|
54
|
+
end
|
55
|
+
|
56
|
+
def signout(browser)
|
57
|
+
mark_testlevel("#{__method__.to_s.titleize}", 8)
|
58
|
+
click_text(browser, /Sign Out/)
|
59
|
+
end
|
60
|
+
|
61
|
+
def create_blank_new_account(browser)
|
62
|
+
mark_testlevel("#{__method__.to_s.titleize}", 3)
|
63
|
+
click_text(browser, 'New Account')
|
64
|
+
validate_text(browser, 'Create Account')
|
65
|
+
click_button_by_value(browser, 'Save')
|
66
|
+
sleep(1)
|
67
|
+
close_popup('Message from webpage')
|
68
|
+
end
|
69
|
+
|
70
|
+
def export_accounts(browser)
|
71
|
+
mark_testlevel("#{__method__.to_s.titleize}", 5)
|
72
|
+
click_text(browser, 'Setup')
|
73
|
+
sleep_for(2)
|
74
|
+
click_text(browser, 'Export Data')
|
75
|
+
sleep_for(2)
|
76
|
+
select_option_by_name_and_option_value(browser, 'module', 'Accounts')
|
77
|
+
if @use_sikuli
|
78
|
+
run_sikuli_script("exportaccounts")
|
79
|
+
close_popup('File Download')
|
80
|
+
else
|
81
|
+
#click_button_no_wait_by_value(browser, 'Export')
|
82
|
+
# Make sure popups are allowed by browser
|
83
|
+
|
84
|
+
mark_testlevel("#{__method__.to_s.titleize} Download", 4)
|
85
|
+
filename = 'Account_Export.cvs'
|
86
|
+
filepath = "#{@myRoot}/#{filename}"
|
87
|
+
filepath.gsub!('/', '\\')
|
88
|
+
message_to_log("#{filepath.to_s}")
|
89
|
+
if File.exist?(filepath)
|
90
|
+
File.delete(filepath)
|
91
|
+
end
|
92
|
+
sleep(3)
|
93
|
+
|
94
|
+
click_button_no_wait_by_value(browser, 'Export')
|
95
|
+
sleep_for(5)
|
96
|
+
close_popup('Message from webpage', 'Are you sure?')
|
97
|
+
sleep_for(1)
|
98
|
+
|
99
|
+
click_button_no_wait_by_value(browser, 'Export')
|
100
|
+
sleep_for(3)
|
101
|
+
close_popup('Message from webpage', 'Are you sure?')
|
102
|
+
sleep_for(3)
|
103
|
+
|
104
|
+
save_file1(filepath)
|
105
|
+
sleep_for(4)
|
106
|
+
|
107
|
+
#if popup_exists?(popup, 'File Download')
|
108
|
+
# save_file(filepath)
|
109
|
+
# click_popup_button('File Download', 'Save')
|
110
|
+
# file_download(browser)
|
111
|
+
# save_file_orig(filepath)
|
112
|
+
# close_popup_by_button_title(popup, 'Close', 'Download Complete')
|
113
|
+
#end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def import_accounts(browser)
|
118
|
+
mark_testlevel("#{__method__.to_s.titleize}", 5)
|
119
|
+
#click_class(browser, 'menuOn', 'Accounts')
|
120
|
+
click_text(browser, 'Accounts')
|
121
|
+
click_text(browser, 'Import Accounts')
|
122
|
+
click(browser, :button, :value, 'Import Accounts')
|
123
|
+
validate_text(browser, 'Import Accounts')
|
124
|
+
#click_button_by_name(browser, 'theFile')
|
125
|
+
#file_upload(filepath)
|
126
|
+
#click_button_by_class(browser, 'button')
|
127
|
+
#select_option_by_name_and_option_value(browser, 'CrmAccount:ACCOUNTNAME', 'Account Name')
|
128
|
+
#click_button_by_class(browser, 'button')
|
129
|
+
#click_button_by_value(browser, 'Import')
|
130
|
+
#validate_no_text(browser, '0', 'No of Records added:')
|
131
|
+
end
|
132
|
+
|
133
|
+
def verify_accounts(browser)
|
134
|
+
mark_testlevel("#{__method__.to_s.titleize}", 5)
|
135
|
+
click_text(browser, 'Accounts')
|
136
|
+
validate_text(browser, '<No Accounts found >')
|
137
|
+
#select_option_by_class_and_option_value(browser, 'select', 'My Accounts')
|
138
|
+
#sleep(1)
|
139
|
+
#select_option_by_class_and_option_value(browser, 'select', 'New This Week')
|
140
|
+
#sleep(1)
|
141
|
+
#select_option_by_class_and_option_value(browser, 'select', 'New Last Week')
|
142
|
+
#sleep(1)
|
143
|
+
#select_option_by_class_and_option_value(browser, 'select', 'Unread Accounts')
|
144
|
+
#sleep(1)
|
145
|
+
end
|
146
|
+
|
147
|
+
def reports(browser)
|
148
|
+
mark_testlevel("#{__method__.to_s.titleize}", 6)
|
149
|
+
click_text(browser, 'Reports')
|
150
|
+
validate_text(browser, 'Recently Accessed Reports')
|
151
|
+
validate_text(browser, '<No Recent Reports Found >')
|
152
|
+
end
|
153
|
+
|
154
|
+
def search_accounts(browser)
|
155
|
+
mark_testlevel("#{__method__.to_s.titleize}", 6)
|
156
|
+
select_option_by_name_and_option_value(browser, 'searchCategory', 'Accounts')
|
157
|
+
set_textfield_by_id(browser, 'searchword', 'Test Account #1')
|
158
|
+
click_button_by_value(browser, 'Go')
|
159
|
+
sleep(3)
|
160
|
+
validate_text(browser, 'Search Results')
|
161
|
+
end
|
162
|
+
|
163
|
+
def clone_account(browser)
|
164
|
+
mark_testlevel("#{__method__.to_s.titleize}", 5)
|
165
|
+
click_text(browser, 'Home')
|
166
|
+
sleep(1)
|
167
|
+
validate_text(browser, 'Welcome tester at Software')
|
168
|
+
click_text(browser, 'Tester')
|
169
|
+
sleep(2)
|
170
|
+
validate_text(browser, 'Lead Details')
|
171
|
+
validate_text(browser, 'Lead Information')
|
172
|
+
click_button_by_name(browser, 'Clone')
|
173
|
+
sleep(2)
|
174
|
+
validate_text(browser, 'Clone Account')
|
175
|
+
click_button_by_value(browser, 'Save')
|
176
|
+
end
|
177
|
+
|
178
|
+
def pagination(browser)
|
179
|
+
mark_testlevel("#{__method__.to_s.titleize}", 6)
|
180
|
+
click_text(browser, 'Accounts')
|
181
|
+
sleep(1)
|
182
|
+
click_text(browser, 'A')
|
183
|
+
sleep(1)
|
184
|
+
click_text(browser, 'B')
|
185
|
+
sleep(1)
|
186
|
+
click_text(browser, 'C')
|
187
|
+
sleep(1)
|
188
|
+
click_text(browser, 'D')
|
189
|
+
sleep(1)
|
190
|
+
click_text(browser, 'E')
|
191
|
+
sleep(1)
|
192
|
+
click_text(browser, 'F')
|
193
|
+
sleep(1)
|
194
|
+
end
|
195
|
+
|
196
|
+
def click_headers(browser)
|
197
|
+
mark_testlevel("#{__method__.to_s.titleize}", 6)
|
198
|
+
click_text(browser, 'Leads')
|
199
|
+
sleep(1)
|
200
|
+
click_text(browser, 'Accounts')
|
201
|
+
sleep(1)
|
202
|
+
click_text(browser, 'Contacts')
|
203
|
+
sleep(1)
|
204
|
+
click_text(browser, 'Potentials')
|
205
|
+
sleep(1)
|
206
|
+
click_text(browser, 'Campaigns')
|
207
|
+
sleep(1)
|
208
|
+
click_text(browser, 'Reports')
|
209
|
+
sleep(1)
|
210
|
+
click_text(browser, 'Dashboards')
|
211
|
+
sleep(1)
|
212
|
+
click_text(browser, 'Activities')
|
213
|
+
sleep(1)
|
214
|
+
click_text(browser, 'Cases')
|
215
|
+
sleep(1)
|
216
|
+
end
|
217
|
+
|
218
|
+
def new_lead(browser)
|
219
|
+
mark_testlevel("#{__method__.to_s.titleize}", 3)
|
220
|
+
click_text(browser, 'Leads')
|
221
|
+
sleep(2)
|
222
|
+
validate_text(browser, 'Leads: All Open Leads')
|
223
|
+
click_button_by_value(browser, 'New Lead ')
|
224
|
+
sleep(2)
|
225
|
+
validate_text(browser, 'Create Lead')
|
226
|
+
select_option_by_name_and_option_value(browser, 'property(saltName)', 'Mr.')
|
227
|
+
#browser.select_list(:name, 'property(saltName)').select_value(Mr.)
|
228
|
+
|
229
|
+
set_textfield_by_name(browser, 'property(Company)', 'Test Zoho Company')
|
230
|
+
set_textfield_by_name(browser, 'property(Last Name)', 'Tester')
|
231
|
+
set_textfield_by_name(browser, 'property(Phone)', '415-999-9999')
|
232
|
+
|
233
|
+
select_option_by_name_and_option_value(browser, 'property(Lead Source)', 'Advertisement')
|
234
|
+
select_option_by_name_and_option_value(browser, 'property(Industry)', 'ASP')
|
235
|
+
select_option_by_name_and_option_value(browser, 'property(Lead Status)', 'Contacted')
|
236
|
+
select_option_by_name_and_option_value(browser, 'property(Rating)', 'Active')
|
237
|
+
|
238
|
+
|
239
|
+
browser.image(:title, 'Calculator').click
|
240
|
+
sleep(4)
|
241
|
+
attach_popup_by_url(browser, "https://crmold.zoho.com/crm/Calc.do?currFld=property(Annual%20Revenue)")
|
242
|
+
sleep(3)
|
243
|
+
close_modal_ie(browser, 'Calculator')
|
244
|
+
set_checkbox_by_name(browser, 'property(Email Opt Out)')
|
245
|
+
sleep(2)
|
246
|
+
clear_checkbox_by_name(browser, 'property(Email Opt Out)')
|
247
|
+
|
248
|
+
|
249
|
+
set_textfield_by_name(browser, 'property(Street)', '1600 Holloway Avenue') ## Address
|
250
|
+
set_textfield_by_name(browser, 'property(State)', 'California')
|
251
|
+
set_textfield_by_name(browser, 'property(City)', 'San Francisco')
|
252
|
+
set_textfield_by_name(browser, 'property(Zip Code)', '94541')
|
253
|
+
set_textfield_by_name(browser, 'property(Country)', 'USA')
|
254
|
+
|
255
|
+
set_textfield_by_name(browser, 'property(Description)', 'This is a description')
|
256
|
+
click_button_by_value(browser, 'Save')
|
257
|
+
sleep(2)
|
258
|
+
end
|
259
|
+
|
260
|
+
def find_leads(browser)
|
261
|
+
mark_testlevel("#{__method__.to_s.titleize}", 5)
|
262
|
+
click_text(browser, 'Leads')
|
263
|
+
sleep(1)
|
264
|
+
set_textfield_by_name(browser, 'newsearchString', 'Test Zoho Company')
|
265
|
+
click_button_by_name(browser, 'Go')
|
266
|
+
sleep(2)
|
267
|
+
validate_text(browser, 'Test Zoho Company')
|
268
|
+
end
|
269
|
+
|
270
|
+
def leads_delete_message(browser)
|
271
|
+
mark_testlevel("#{__method__.to_s.titleize}", 4)
|
272
|
+
click_text(browser, 'Leads')
|
273
|
+
sleep(1)
|
274
|
+
set_checkbox_by_name(browser, 'allcheck')
|
275
|
+
sleep(1)
|
276
|
+
clear_checkbox_by_name(browser, 'allcheck')
|
277
|
+
sleep(1)
|
278
|
+
click_button_by_value(browser, 'Delete')
|
279
|
+
sleep(1)
|
280
|
+
close_popup('Message from webpage')
|
281
|
+
end
|
282
|
+
|
283
|
+
def find_lead_reports(browser) ## Find Lead Reports by Source
|
284
|
+
mark_testlevel("#{__method__.to_s.titleize}", 6)
|
285
|
+
click_text(browser, 'Reports')
|
286
|
+
sleep(2)
|
287
|
+
click_text(browser, 'Lead Reports')
|
288
|
+
sleep(2)
|
289
|
+
click_text(browser, 'Leads By Source')
|
290
|
+
sleep(2)
|
291
|
+
validate_text(browser, 'Leads By Source')
|
292
|
+
|
293
|
+
select_option_by_name_and_option_value(browser, 'stdDateFilter', 'today')
|
294
|
+
click_button_by_value(browser, 'Apply Filter')
|
295
|
+
sleep(2)
|
296
|
+
validate_text(browser, 'tester')
|
297
|
+
end
|
298
|
+
|
299
|
+
def create_chart(browser)
|
300
|
+
mark_testlevel("#{__method__.to_s.titleize}", 7)
|
301
|
+
click_button_by_value(browser, 'Delete Chart')
|
302
|
+
sleep(2)
|
303
|
+
click_button_by_value(browser, 'Create Chart')
|
304
|
+
sleep(2)
|
305
|
+
validate_text(browser, 'Create Chart: Leads By Source')
|
306
|
+
|
307
|
+
browser.frame(:name, 'chartLayer').cell(:text, 'Vertical Bar').click
|
308
|
+
|
309
|
+
#click_id(browser, 'chart1') ## Vertical Bar chart
|
310
|
+
sleep(2)
|
311
|
+
click_button_by_value(browser, 'Save')
|
312
|
+
sleep(3)
|
313
|
+
end
|
314
|
+
|
315
|
+
def create_campaign(browser)
|
316
|
+
mark_testlevel("#{__method__.to_s.titleize}", 7)
|
317
|
+
click_text(browser, 'Home')
|
318
|
+
sleep(1)
|
319
|
+
click_text(browser, 'Create Campaign')
|
320
|
+
set_textfield_by_name(browser, 'property(Campaign Name)', 'Zoho Campaign')
|
321
|
+
select_option_by_name_and_option_value(browser, 'property(Type)', 'Conference')
|
322
|
+
select_option_by_name_and_option_value(browser, 'property(Status)', 'Planning')
|
323
|
+
sleep(1)
|
324
|
+
set_textfield_by_name(browser, 'property(Start Date)', '03/11/2012')
|
325
|
+
set_textfield_by_name(browser, 'property(End Date)', '05/20/2012')
|
326
|
+
#browser.button(:onclick, 'showCalc('property(Actual Cost)')'
|
327
|
+
|
328
|
+
end
|
329
|
+
|
330
|
+
def create_task(browser)
|
331
|
+
mark_testlevel("#{__method__.to_s.titleize}", 8)
|
332
|
+
click_text(browser, 'Home')
|
333
|
+
sleep(1)
|
334
|
+
click_text(browser, 'New Task')
|
335
|
+
sleep(2)
|
336
|
+
validate_text(browser, 'Create Task')
|
337
|
+
|
338
|
+
browser.image(:title, 'Subject Name Lookup').click
|
339
|
+
sleep(2)
|
340
|
+
popup = attach_browser_by_url(browser, /Subject/)
|
341
|
+
|
342
|
+
sleep(2)
|
343
|
+
popup.link(:text, 'Product Demo').click
|
344
|
+
validate_textfield_value_by_name(browser, /Subject/, 'Product Demo')
|
345
|
+
|
346
|
+
set_textfield_by_name(browser, 'property(Due Date)', '03/11/2012')
|
347
|
+
select_option_by_name_and_option_value(browser, 'property(leContModSel)', 'Leads')
|
348
|
+
sleep(1)
|
349
|
+
select_option_by_name_and_option_value(browser, 'property(leContModSel)', 'Contacts')
|
350
|
+
|
351
|
+
browser.image(:id, 'modNameImg').click
|
352
|
+
sleep(2)
|
353
|
+
#attach_popup(browser, :title, /Zoho CRM - Account Name Lookup/)
|
354
|
+
popup = attach_browser_by_url(browser, "https://crmold.zoho.com/crm/Search.do?searchmodule=Accounts&fldName=modname&fldId=modid&fldLabel=Accounts&fldValue=&user=undefined&condition=undefined")
|
355
|
+
sleep(1)
|
356
|
+
set_textfield_by_name(popup, 'fldValue', 'Test Account #1')
|
357
|
+
click_button_by_value(popup, 'Go')
|
358
|
+
popup.link(:text, 'Test Account #1').click
|
359
|
+
close_modal_ie(browser, 'Account Name Lookup')
|
360
|
+
sleep(2)
|
361
|
+
|
362
|
+
select_option_by_name_and_option_value(browser, 'property(Status)', 'In Progress')
|
363
|
+
select_option_by_name_and_option_value(browser, 'property(Priority)', 'Normal')
|
364
|
+
set_textfield_by_name(browser, 'property(Description)', 'This is the task information')
|
365
|
+
click_button_by_value(browser, 'Save')
|
366
|
+
sleep(3)
|
367
|
+
end
|
368
|
+
|
369
|
+
########################################################################
|
370
|
+
# EVERYTHING BELOW: TEMPORARY OVERRIDES/ADDITIONS NOT YET IN SHAMISEN pmn 12jul1012
|
371
|
+
########################################################################
|
372
|
+
|
373
|
+
def get_variables(file, login = :role, dbg = true)
|
374
|
+
debug_to_log("#{__method__}: file = #{file}")
|
375
|
+
debug_to_log("#{__method__}: role = #{login}")
|
376
|
+
|
377
|
+
@var = Hash.new
|
378
|
+
workbook = Excel.new(file)
|
379
|
+
data_index = find_sheet_with_name(workbook, 'Data')
|
380
|
+
workbook.default_sheet = workbook.sheets[data_index]
|
381
|
+
var_col = 0
|
382
|
+
|
383
|
+
2.upto(workbook.last_column) do |col|
|
384
|
+
scriptName = workbook.cell(1, col)
|
385
|
+
if scriptName == @myName
|
386
|
+
var_col = col
|
387
|
+
break
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
391
|
+
2.upto(workbook.last_row) do |line|
|
392
|
+
name = workbook.cell(line, 'A')
|
393
|
+
value = workbook.cell(line, var_col).to_s.strip
|
394
|
+
@var[name] = value
|
395
|
+
end
|
396
|
+
|
397
|
+
@var.keys.sort.each do |name|
|
398
|
+
message_tolog("@var #{name}: '#{@var[name]}'")
|
399
|
+
end if dbg
|
400
|
+
|
401
|
+
@login = Hash.new
|
402
|
+
login_col = 0
|
403
|
+
role_col = 0
|
404
|
+
userid_col = 0
|
405
|
+
password_col = 0
|
406
|
+
url_col = 0
|
407
|
+
name_col = 0
|
408
|
+
role_index = find_sheet_with_name(workbook, 'Login')
|
409
|
+
if role_index >= 0
|
410
|
+
workbook.default_sheet = workbook.sheets[role_index]
|
411
|
+
|
412
|
+
1.upto(workbook.last_column) do |col|
|
413
|
+
a_cell = workbook.cell(1, col)
|
414
|
+
case a_cell
|
415
|
+
when @myName
|
416
|
+
login_col = col
|
417
|
+
break
|
418
|
+
when 'role'
|
419
|
+
role_col = col
|
420
|
+
when 'userid'
|
421
|
+
userid_col = col
|
422
|
+
when 'password'
|
423
|
+
password_col = col
|
424
|
+
when 'url'
|
425
|
+
url_col = col
|
426
|
+
when 'name'
|
427
|
+
name_col = col
|
428
|
+
end
|
429
|
+
end
|
430
|
+
|
431
|
+
2.upto(workbook.last_row) do |line|
|
432
|
+
role = workbook.cell(line, role_col)
|
433
|
+
userid = workbook.cell(line, userid_col)
|
434
|
+
password = workbook.cell(line, password_col)
|
435
|
+
url = workbook.cell(line, url_col)
|
436
|
+
username = workbook.cell(line, name_col)
|
437
|
+
enabled = workbook.cell(line, login_col).to_s
|
438
|
+
|
439
|
+
case login
|
440
|
+
when :id
|
441
|
+
key = userid
|
442
|
+
when :role
|
443
|
+
key = role
|
444
|
+
else
|
445
|
+
key = role
|
446
|
+
end
|
447
|
+
|
448
|
+
@login[key] = Hash.new
|
449
|
+
@login[key]['role'] = role
|
450
|
+
@login[key]['userid'] = userid
|
451
|
+
@login[key]['password'] = password
|
452
|
+
@login[key]['url'] = url
|
453
|
+
@login[key]['name'] = username
|
454
|
+
@login[key]['enabled'] = enabled
|
455
|
+
|
456
|
+
end
|
457
|
+
|
458
|
+
@login.keys.sort.each do |key|
|
459
|
+
message_tolog("@login (by #{login}): #{key}=>'#{@login[key].to_yaml}'")
|
460
|
+
end if dbg
|
461
|
+
end
|
462
|
+
|
463
|
+
rescue
|
464
|
+
fatal_to_log("#{__method__}: '#{$!}'")
|
465
|
+
end
|
466
|
+
|
467
|
+
def find_sheet_with_name(workbook, sheet_name)
|
468
|
+
sheets = workbook.sheets
|
469
|
+
idx = 0
|
470
|
+
found = false
|
471
|
+
sheets.each do |s|
|
472
|
+
if s == sheet_name
|
473
|
+
found = true
|
474
|
+
break
|
475
|
+
end
|
476
|
+
idx += 1
|
477
|
+
end
|
478
|
+
if found
|
479
|
+
idx
|
480
|
+
else
|
481
|
+
-1
|
482
|
+
end
|
483
|
+
end
|
484
|
+
|
485
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awetestlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: x86-mingw32
|
12
12
|
authors:
|
13
13
|
- Anthony Woo
|