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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
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
322
323
324
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
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
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
449
450
451
452
453
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
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
|
'encoding UTF-8 Do not remove or change this line!
'**************************************************************************
'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
'*
'* Copyright 2008 by Sun Microsystems, Inc.
'*
'* OpenOffice.org - a multi-platform office productivity suite
'*
'* $RCSfile: ch2_flexible_source_range_selection.inc,v $
'*
'* $Revision: 1.2 $
'*
'* last change: $Author: obo $ $Date: 2008-07-21 12:07:40 $
'*
'* This file is part of OpenOffice.org.
'*
'* OpenOffice.org is free software: you can redistribute it and/or modify
'* it under the terms of the GNU Lesser General Public License version 3
'* only, as published by the Free Software Foundation.
'*
'* OpenOffice.org is distributed in the hope that it will be useful,
'* but WITHOUT ANY WARRANTY; without even the implied warranty of
'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
'* GNU Lesser General Public License version 3 for more details
'* (a copy is included in the LICENSE file that accompanied this code).
'*
'* You should have received a copy of the GNU Lesser General Public License
'* version 3 along with OpenOffice.org. If not, see
'* <http://www.openoffice.org/license.html>
'* for a copy of the LGPLv3 License.
'*
'/***********************************************************************
'*
'* owner : oliver.craemer@sun.com
'*
'* short description : Updatetest for Flexible Source Range Selection in spreadsheets
'*
'************************************************************************
'*
' #1 tDataRangeWizardCalc ' Updatetest for tabpage DataRange via chart wizard
' #1 tDataSeriesWizardCalc ' Updatetest for tabpage DataSeries via chart wizard
' #1 tDataRangeDialogCalc ' Updatetest for tabpage DataRange via data ranges dialog
' #1 tDataSeriesDialogCalc ' Updatetest for tabpage DataSeries via data ranges dialog
' #1 fOpenTestDocumentAndInsertChart ' Sub routine which is being used by two test cases
'*
'\***********************************************************************
testcase tDataRangeWizardCalc
dim sDataRange as string
dim sInputFile as string
sInputFile = convertpath(gTestToolPath & "chart2/required/input/ch_flexrange01.ods")
printlog "Open test document gtesttoolpath/chart2/required/input/ch_flexrange01.ods"
if fOpenTestDocumentAndInsertChart(sInputFile) then
Kontext "ChartType"
printlog "Choose the Chart type <i>bar</i> (should be the second in the top-down list)"
if fSetChartType( "bar" ) > 0 then
warnlog "Something went wrong setting chart type to BAR."
warnlog "Testcase aborted"
Kontext "ChartWizard"
ChartWizard.Cancel
call hCloseDocument
goto endsub
endif
printlog "Switch to tabpage Data Range"
Kontext "ChartWizard"
GoNext.Click
Kontext "TabChartTypeDataRange"
call DialogTest ( TabChartTypeDataRange )
printlog "Check that the data range in edit field has the value $ChartFlexRange.$B$3:$E$6"
Kontext "TabChartTypeDataRange"
sDataRange = DataRange.GetText
if sDataRange <> "$ChartFlexRange.$B$3:$E$6" then
warnlog "This is not the expected datarange, it is " & sDataRange & " but should be $ChartFlexRange.$B$3:$E$6"
else
printlog " Datarange is correct"
endif
printlog "Check if -Data series in rows- is enabled"
if Rows.IsEnabled then
printlog " Data series in rows is enabled"
else
warnlog "Data series in rows is disabled"
endif
printlog "Check if Data series in columns- is enabled and chosen"
if Columns.IsEnabled then
printlog " Data series in columns is enabled"
if Columns.IsChecked then
printlog " and checked"
else
warnlog "Data series in columns is not checked"
endif
else
warnlog "Data series in columns is disabled"
endif
printlog "Check if -First row as label- is enabled and checked"
if FirstRowAsLabel.IsEnabled then
printlog " First row as label is enabled"
if FirstRowAsLabel.IsChecked then
printlog " and checked"
else
warnlog "First row as label is not checked"
endif
else
warnlog "First row as label is disabled"
endif
printlog "Check if -First column as label- is enabled and not checked"
if FirstColumnAsLabel.IsEnabled then
printlog " First column as label is enabled"
if FirstColumnAsLabel.IsChecked then
warnlog "First column as label is checked"
else
printlog " and not checked"
endif
else
warnlog "First column as label is disabled"
endif
printlog "Press button Range Chooser"
SelectDataRange.Click
printlog "Enter invalid range $ChartFlexRange.$B$3:$E$0 and close Range Chooser"
Kontext "AcceptOrRejectChangesArea"
AreaEditField.SetText "$ChartFlexRange.$B$3:$E$0"
ShrinkButton.Click
printlog "Check if -Data series in rows- is disabled"
Kontext "TabChartTypeDataRange"
if NOT Rows.IsEnabled then
printlog " Data series in rows is disabled"
else
warnlog "Data series in rows is enabled, but should be disabled"
endif
printlog "Check if -Data series in columns- is disabled"
if NOT Columns.IsEnabled then
printlog " Data series in columns is disabled"
else
warnlog "Data series in columns is enabled, but should be disabled"
endif
printlog "Check if -First row as label- is disabled"
if NOT FirstRowAsLabel.IsEnabled then
printlog " First row as label is disabled"
else
warnlog "First row as label is enabled, but should be disabled"
endif
printlog "Check if -First column as label- is disabled"
if NOT FirstColumnAsLabel.IsEnabled then
printlog " First Column as label is disabled"
else
warnlog "First Column as label is enabled, but should be disabled"
endif
printlog "Check if Back, Next and Finish does not work"
Kontext "ChartWizard"
GoBack.Click
Kontext "TabChartTypeDataRange"
if FirstColumnAsLabel.IsVisible then
printlog " Success: Back button does not work"
else
warnlog "Back button is not functionless"
Kontext "ChartWizard"
GoNext.Click
endif
printlog "Enter valid range $ChartFlexRange.$B$3:$E$6"
Kontext "TabChartTypeDataRange"
DataRange.SetText "$ChartFlexRange.$B$3:$E$6"
printlog "Check if -Data series in rows- is enabled"
if Rows.IsEnabled then
printlog " Data series in rows is enabled"
else
warnlog "Data series in rows is disabled"
endif
printlog "Check if -Data series in columns- is enabled and chosen"
if Columns.IsEnabled then
printlog " Data series in columns is enabled"
if Columns.IsChecked then
printlog " and checked"
else
warnlog "Data series in columns is not checked"
endif
else
warnlog "Data series in rows is disabled"
endif
printlog "Check if -First row as label- is enabled and checked"
if FirstRowAsLabel.IsEnabled then
printlog " First row as label is enabled"
if FirstRowAsLabel.IsChecked then
printlog " and checked"
else
warnlog "First row as label is not checked"
endif
else
warnlog "First row as label is disabled"
endif
printlog "Check if -First column as label- is enabled and not checked"
if FirstColumnAsLabel.IsEnabled then
printlog " First column as label is enabled"
if FirstColumnAsLabel.IsChecked then
warnlog "First column as label is checked"
else
printlog " and not checked"
endif
else
warnlog "First column as label is disabled"
endif
printlog "Press Cancel button"
Kontext "ChartWizard"
ChartWizard.Cancel
printlog "Close document"
Call hCloseDocument
else
warnlog "It was not possible to open the test document."
endif
endcase
'
'-------------------------------------------------------------------------
'
testcase tDataSeriesWizardCalc
dim sInputFile as string
dim iDataSeries as integer
dim sDataRanges as string
dim sRangeFor as string
dim sCategories as string
sInputFile = convertpath(gTestToolPath & "chart2/required/input/ch_flexrange02.ods")
printlog "Open test document gTestToolPath/chart2/required/input/ch_flexrange02.ods"
if fOpenTestDocumentAndInsertChart(sInputFile) then
Kontext "ChartType"
printlog "Choose the Chart type XY (SCATTER) (should be the second in the top-down list)"
if fSetChartType( "xy" ) > 0 then
warnlog "Something went wrong setting chart type to XY (SCATTER)."
Kontext "ChartWizard"
ChartWizard.Cancel
call hCloseDocument
goto endsub
endif
Kontext "ChartWizard"
printlog "Click on Next button"
GoNext.Click
printlog "Click on Next button"
GoNext.Click
Kontext "TabChartTypeDataSeries"
if RangeFor.IsVisible then
printlog " Switching to tabpage was successfull"
else
warnlog "Switching to tabpage Data Series failed"
Kontext "ChartWizard"
ChartWizard.Cancel
call hCloseDocument
goto endsub
endif
call DialogTest ( TabChartTypeDataSeries )
printlog "Check if the data series listbox is enabled and contains three entries"
iDataSeries = DataSeries.GetItemCount
if iDataSeries = 3 then
printlog " All 3 data series are available"
else
warnlog "There are " & iDataSeries & " data series instead of 3"
endif
printlog "Check if the ADD button is enabled and click the button"
if AddButton.IsEnabled then
printlog " ADD button is enabled"
AddButton.Click
else
warnlog "ADD button is not enabled"
endif
printlog "Check if there are now four entries in the data series listbox"
iDataSeries = DataSeries.GetItemCount
if iDataSeries = 4 then
printlog " Adding a data series was successfull"
else
warnlog "There are " & iDataSeries & " data series instead of 4"
endif
printlog "Check if the second data series was added below the highlighted one"
if DataSeries.GetSelIndex = 2 then
printlog " The new data series was inserted below the highlighted (first) one"
else
warnlog "The new dataseries was not inserted below the highlighted one"
endif
printlog "Check if the REMOVE button is enabled and click the button"
if RemoveButton.IsEnabled then
printlog " REMOVE button is enabled"
RemoveButton.Click
else
warnlog "REMOVE button is not enabled"
endif
printlog "Check if there are now 3 entries in the data series listbox"
iDataSeries = DataSeries.GetItemCount
if iDataSeries = 3 then
printlog " Removing a data series was successfull"
else
warnlog "There are " & iDataSeries & " data series instead of 3"
endif
printlog "Use UP button on last data series and verify that it it disabled on first entry"
DataSeries.Select(3)
if MoveUp.IsEnabled then
printlog " The MoveUp button is enabled"
printlog "Click on Move Up button twice."
MoveUp.Click
MoveUp.Click
else
warnlog "The MoveUp button is disabled"
endif
if DataSeries.GetSelIndex = 1 then
printlog " Moving data series was successfull"
if MoveUp.IsEnabled then
warnlog "MoveUp button is not disabled on first entry"
else
printlog " and MoveUp button is disabled on first enty"
endif
else
warnlog "Moving data series was not successfull"
endif
printlog "Use DOWN button and verify that it is disabled on last entry"
DataSeries.Select(1)
if MoveDown.IsEnabled then
printlog " The MoveDown button is enabled"
printlog "Click Move Down button twice"
MoveDown.Click
MoveDown.Click
else
warnlog "The MoveDown button is disabled"
endif
if DataSeries.GetSelIndex = 3 then
printlog " Moving data series was successfull"
if MoveDown.IsEnabled then
warnlog "MoveDown button is not disabled on first entry"
else
printlog " and MoveDown button is disabled on first enty"
endif
else
warnlog "Moving data series was not successfull"
endif
printlog "Select first entry in Data Ranges"
DataRanges.Select(1)
printlog "Verify that the range matches the one in edit field"
'GetSelText(line,column) is a new parameter since CWS:SRC680gh13
'Instead of 1,2 there must be 1,4 used becqause there are two invisible
'label-columns in that treelist-box
sDataRanges = DataRanges.GetSelText (1,4)
sRangeFor = RangeFor.GetText
if sDataRanges = sRangeFor then
printlog " Both ranges are matching"
else
warnlog "The ranges does not match: " & sDataRanges & sRangeFor
endif
printlog "Select second entry in Data Ranges"
DataRanges.Select(2)
printlog "Check that the range in the edit field has changed, too."
'GetSelText(line,column) is a new parameter since CWS:SRC680gh13
'Instead of 1,2 there must be 1,4 used becqause there are two invisible
'label-columns in that treelist-box
sDataRanges = DataRanges.GetSelText (1,4)
sRangeFor = RangeFor.GetText
if sDataRanges = sRangeFor then
printlog " Both ranges are matching"
else
warnlog "The ranges does not match" & sDataRanges & sRangeFor
endif
printlog "Change the range in edit field"
RangeFor.SetText "$ChartFlexRange.$D$5:$D$6;$ChartFlexRange.$D$8"
printlog "Check that the range in Data Ranges has changed, too"
'GetSelText(line,column) is a new parameter since CWS:SRC680gh13
'Instead of 1,2 there must be 1,4 used becqause there are two invisible
'label-columns in that treelist-box
sDataRanges = DataRanges.GetSelText (1,4)
if sDataRanges = "$ChartFlexRange.$D$5:$D$6;$ChartFlexRange.$D$8" then
printlog " The data range has also changed"
else
warnlog "The data range has not changed"
endif
printlog "Click on Range Chooser and change the range"
SelectRange.Click
Kontext "AcceptOrRejectChangesArea"
printlog "Enter $ChartFlexRange.$D$5:$D$6 in edit field"
AreaEditField.SetText "$ChartFlexRange.$D$5:$D$6"
printlog "Click on Shirnk button"
ShrinkButton.Click
printlog "Check if the range in Data ranges has changed"
Kontext "TabChartTypeDataSeries"
'GetSelText(line,column) is a new parameter since CWS:SRC680gh13
'Instead of 1,2 there must be 1,4 used becqause there are two invisible
'label-columns in that treelist-box
sDataRanges = DataRanges.GetSelText (1,4)
if sDataRanges = "$ChartFlexRange.$D$5:$D$6" then
printlog " The data range has also changed"
else
warnlog "The data range has not changed"
endif
printlog "Edit range for Data Labels"
printlog "Set text $ChartFlexRange.$C$15:$C$16 in categories"
Categories.SetText "$ChartFlexRange.$C$15:$C$16"
sCategories = Categories.GetText
printlog "Validate the changes have not been modified"
if sCategories = "$ChartFlexRange.$C$15:$C$16" then
printlog " The range has been modified"
else
warnlog "Modifiing the range was not successfull"
endif
printlog "Click on Range Chooser and change the range"
SelectCategories.Click
Kontext "AcceptOrRejectChangesArea"
printlog "Set text $ChartFlexRange.$C$5:$C$6 in the edit field"
AreaEditField.SetText "$ChartFlexRange.$C$5:$C$6"
printlog "Click on Shrink button"
ShrinkButton.Click
printlog "Verify that the range is taken"
Kontext "TabChartTypeDataSeries"
sCategories = Categories.GetText
if sCategories = "$ChartFlexRange.$C$5:$C$6" then
printlog " The range has been modified"
else
warnlog "Modifiing the range was not successfull"
endif
printlog "Enter invalid range $ChartFlexRange.$C$5:$C$"
Categories.SetText "$ChartFlexRange.$C$5:$C$"
Kontext "ChartWizard"
printlog "Click on the Back button"
GoBack.Click
Kontext "TabChartTypeDataSeries"
if Categories.IsVisible then
printlog " Success: Back button is disabled"
else
warnlog "Back button is not functionless"
Kontext "ChartWizard"
GoNext.Click
endif
printlog "Enter $ChartFlexRange.$C$5:$C$6 - a valid range"
Categories.SetText "$ChartFlexRange.$C$5:$C$6"
printlog "Press Range Chooser"
SelectCategories.Click
printlog "Press <END>-key"
Kontext "AcceptOrRejectChangesArea"
AreaEditField.TypeKeys "<END>"
printlog "Enter a semicolon and the second range $ChartFlexRange.$C$8"
AreaEditField.TypeKeys ";$ChartFlexRange.$C$8"
printlog "Close Range Chooser"
ShrinkButton.Click
printlog "Verify that there is a multiple range"
Kontext "TabChartTypeDataSeries"
sCategories = Categories.GetText
if sCategories = "$ChartFlexRange.$C$5:$C$6;$ChartFlexRange.$C$8" then
printlog " The range has been modified to a multiple range"
else
warnlog "Modifiing the range was not successfull"
endif
printlog "Press Cancel button"
Kontext "ChartWizard"
ChartWizard.Cancel
printlog "Close document"
Call hCloseDocument
else
warnlog "It was not possible to open the test document."
endif
endcase
'-------------------------------------------------------------------------
testcase tDataRangeDialogCalc
dim sDataRange as string
dim sInputFile as string
sInputFile = convertpath(gTestToolPath & "chart2/required/input/ch_flexrange03.ods" )
printlog "Open test document gTestToolPath/chart2/required/input/ch_flexrange03.ods"
if fOpenTestDocumentAndSelectDataRange(sInputFile) then
printlog "Check if the data range in edit field is $ChartFlexRange.$D$4:$G$6;$ChartFlexRange.$C$5:$G$6;$ChartFlexRange.$C$4"
Kontext "TabChartTypeDataRange"
sDataRange = DataRange.GetText
if sDataRange <> "$ChartFlexRange.$C$4:$G$6" then
warnlog "This is not the expected datarange, it is " & sDataRange & " but should be $ChartFlexRange.$C$4:$G$6"
else
printlog " Datarange is correct"
endif
printlog "Check if -Data series in columns- is enabled"
if Columns.IsEnabled then
printlog " Data series in columns is enabled"
else
warnlog "Data series in columns is disabled"
endif
printlog "Check if -Data series in columns- is enabled and chosen"
if Rows.IsEnabled then
printlog " Data series in rows is enabled"
if rows.IsChecked then
printlog " and checked"
else
warnlog "Data series in rows is not checked"
endif
else
warnlog "Data series in rows is disabled"
endif
printlog "Check if -First row as label- is enabled and checked"
if FirstRowAsLabel.IsEnabled then
printlog " First row as label is enabled"
if FirstRowAsLabel.IsChecked then
printlog " and checked"
else
warnlog "First row as label is not checked"
endif
else
warnlog "First row as label is disabled"
endif
printlog "Check if -First column as label- is enabled and checked"
if FirstColumnAsLabel.IsEnabled then
printlog " First column as label is enabled"
if FirstColumnAsLabel.IsChecked then
printlog " and checked"
else
warnlog "First column as label is not checked"
endif
else
warnlog "First column as label is disabled"
endif
printlog "Press button Range Chooser"
SelectDataRange.Click
printlog "Enter $ChartFlexRange.$B$3:$E$0 in Range Chooser and close Range Chooser"
Kontext "AcceptOrRejectChangesArea"
AreaEditField.SetText "$ChartFlexRange.$B$3:$E$0"
ShrinkButton.Click
printlog "Check if -Data series in rows- is disabled"
Kontext "TabChartTypeDataRange"
if NOT Rows.IsEnabled then
printlog " Data series in rows is disabled"
else
warnlog "Data series in rows is enabled, but should be disabled"
endif
printlog "Check if -Data series in columns- is disabled"
if NOT Columns.IsEnabled then
printlog " Data series in columns is disabled"
else
warnlog "Data series in columns is enabled, but should be disabled"
endif
printlog "Check if -First row as label- is disabled"
if NOT FirstRowAsLabel.IsEnabled then
printlog " First row as label is disabled"
else
warnlog "First row as label is enabled, but should be disabled"
endif
printlog "Check if -First column as label- is disabled"
if NOT FirstColumnAsLabel.IsEnabled then
printlog " First Column as label is disabled"
else
warnlog "First Column as label is enabled, but should be disabled"
endif
printlog "Check if OK button is disabled"
try
Kontext "TabChartTypeDataRange"
TabChartTypeDataRange.OK
warnlog "The OK button is not disabled"
goto endsub
catch
printlog " The OK button is disabled"
endcatch
printlog "Enter a valid range"
Kontext "TabChartTypeDataRange"
DataRange.SetText "$ChartFlexRange.$C$4:$G$6;$ChartFlexRange.$C$8:$G$8"
printlog "Check if -Data series in columns- is enabled"
if Columns.IsEnabled then
printlog " Data series in columns is enabled"
else
warnlog "Data series in columns is disabled"
endif
printlog "Check if -Data series in columns- is enabled and chosen"
if Rows.IsEnabled then
printlog " Data series in rows is enabled"
if rows.IsChecked then
printlog " and checked"
else
warnlog "Data series in rows is not checked"
endif
else
warnlog "Data series in rows is disabled"
endif
printlog "Check if -First row as label- is enabled and checked"
if FirstRowAsLabel.IsEnabled then
printlog " First row as label is enabled"
if FirstRowAsLabel.IsChecked then
printlog " and checked"
else
warnlog "First row as label is not checked"
endif
else
warnlog "First row as label is disabled"
endif
printlog "Check if -First column as label- is enabled and checked"
if FirstColumnAsLabel.IsEnabled then
printlog " First column as label is enabled"
if FirstColumnAsLabel.IsChecked then
printlog " and checked"
else
warnlog "First column as label is not checked"
endif
else
warnlog "First column as label is disabled"
endif
printlog "Press Cancel button"
Kontext "TabChartTypeDataRange"
TabChartTypeDataRange.Cancel
printlog "Close document"
Call hCloseDocument
else
warnlog "It was not possible to open the test document."
endif
endcase
'
'-------------------------------------------------------------------------
'
testcase tDataSeriesDialogCalc
dim sInputFile as string
dim iDataSeries as integer
dim sDataRanges as string
dim sRangeFor as string
dim sCategories as string
sInputFile = convertpath(gTestToolPath & "chart2/required/input/ch_flexrange04.ods")
printlog "Open test document gTestToolPath/chart2/required/input/ch_flexrange04.ods"
if fOpenTestDocumentAndSelectDataRange(sInputFile) then
Kontext
Active.SetPage TabChartTypeDataSeries
Kontext "TabChartTypeDataSeries"
printlog "Check if the data series listbox is enabled and contains one entry"
iDataSeries = DataSeries.GetItemCount
if iDataSeries = 1 then
printlog " One data serie is available"
else
warnlog "There are " & iDataSeries & " data series instead of 1"
endif
printlog "Check if the ADD button is enabled and click the button"
if AddButton.IsEnabled then
printlog " ADD button is enabled"
AddButton.Click
else
warnlog "ADD button is not enabled"
endif
printlog "Check if there are now two entries in the data series listbox"
iDataSeries = DataSeries.GetItemCount
if iDataSeries = 2 then
printlog " Adding a data series was successfull"
else
warnlog "There are " & iDataSeries & " data series instead of 2"
endif
printlog "Check if the new data series was added below the highlighted one"
if DataSeries.GetSelIndex = 2 then
printlog " The new data series was inserted below the highlighted (first) one"
else
warnlog "The new dataseries was not inserted below the highlighted one"
endif
printlog "Use UP button on last data series and verify that it it disabled on first entry"
DataSeries.Select(2)
if MoveUp.IsEnabled then
printlog " The MoveUp button is enabled"
MoveUp.Click
else
warnlog "The MoveUp button is disabled"
endif
if DataSeries.GetSelIndex = 1 then
printlog " Moving data series was successfull"
if MoveUp.IsEnabled then
warnlog "MoveUp button is not disabled on first entry"
else
printlog " and MoveUp button is disabled on first enty"
endif
else
warnlog "Moving data series was not successfull"
endif
printlog "Use DOWN button and verify that it is disabled on last entry"
DataSeries.Select(1)
if MoveDown.IsEnabled then
printlog " The MoveDown button is enabled"
MoveDown.Click
else
warnlog "The MoveDown button is disabled"
endif
if DataSeries.GetSelIndex = 2 then
printlog " Moving data series was successfull"
if MoveDown.IsEnabled then
warnlog "MoveDown button is not disabled on first entry"
else
printlog " and MoveDown button is disabled on first enty"
endif
else
warnlog "Moving data series was not successfull"
endif
printlog "Check if the REMOVE button is enabled and click the button"
if RemoveButton.IsEnabled then
printlog " REMOVE button is enabled"
RemoveButton.Click
else
warnlog "REMOVE button is not enabled"
endif
printlog "Check if there are now one entry in the data series listbox"
iDataSeries = DataSeries.GetItemCount
if iDataSeries = 1 then
printlog " Removing a data series was successfull"
else
warnlog "There are " & iDataSeries & " data series instead of 1"
endif
printlog "Select first entry in Data Ranges"
DataRanges.Select(1)
printlog "Verify that the range for NAME matches the one in edit field"
'GetSelText(line,column) is a new parameter since CWS:SRC680gh13
'Instead of 1,2 there must be 1,4 used becqause there are two invisible
'label-columns in that treelist-box
sDataRanges = DataRanges.GetSelText(1,4)
sRangeFor = RangeFor.GetText
if sDataRanges = sRangeFor then
printlog " Both ranges are matching"
else
warnlog "The ranges does not match: " & sDataRanges & sRangeFor
endif
printlog "Select second entry in Data Ranges"
DataRanges.Select(2)
printlog "Check that the range in the edit field has changed too"
'GetSelText(line,column) is a new parameter since CWS:SRC680gh13
'Instead of 1,2 there must be 1,4 used becqause there are two invisible
'label-columns in that treelist-box
sDataRanges = DataRanges.GetSelText(1,4)
sRangeFor = RangeFor.GetText
if sDataRanges = sRangeFor then
printlog " Both ranges are matching"
else
warnlog "The ranges does not match" & sDataRanges & sRangeFor
endif
printlog "Change the range in edit field"
RangeFor.SetText "$ChartFlexRange.$D$5:$D$10"
printlog "Check that the range in Data Ranges has changed too"
'GetSelText(line,column) is a new parameter since CWS:SRC680gh13
'Instead of 1,2 there must be 1,4 used becqause there are two invisible
'label-columns in that treelist-box
sDataRanges = DataRanges.GetSelText (1,4)
if sDataRanges = "$ChartFlexRange.$D$5:$D$10" then
printlog " The data range has also changed"
else
warnlog "The data range has not changed"
endif
printlog "Click on Range Chooser and change the range"
SelectRange.Click
Kontext "AcceptOrRejectChangesArea"
AreaEditField.SetText "$ChartFlexRange.$D$5:$D$12"
ShrinkButton.Click
printlog "Check if the range in Data ranges has changed"
Kontext "TabChartTypeDataSeries"
'GetSelText(line,column) is a new parameter since CWS:SRC680gh13
'Instead of 1,2 there must be 1,4 used becqause there are two invisible
'label-columns in that treelist-box
sDataRanges = DataRanges.GetSelText (1,4)
if sDataRanges = "$ChartFlexRange.$D$5:$D$12" then
printlog " The data range has also changed"
else
warnlog "The data range has not changed"
endif
printlog "Edit range for Categories"
Categories.SetText "$ChartFlexRange.$B$5:$B$10"
sCategories = Categories.GetText
if sCategories = "$ChartFlexRange.$B$5:$B$10" then
printlog " The range has been modified"
else
warnlog "Modifiing the range was not successfull"
endif
printlog "Click on Range Chooser and change the range to $ChartFlexRange.$B$5:$B$12"
SelectCategories.Click
Kontext "AcceptOrRejectChangesArea"
AreaEditField.SetText "$ChartFlexRange.$B$5:$B$12"
ShrinkButton.Click
printlog "Verify that the range is taken"
Kontext "TabChartTypeDataSeries"
sCategories = Categories.GetText
if sCategories = "$ChartFlexRange.$B$5:$B$12" then
printlog " The range has been modified"
else
warnlog "Modifiing the range was not successfull"
endif
printlog "Enter $ChartFlexRange.$B$5:$B$ as an invalid range"
Categories.SetText "$ChartFlexRange.$B$5:$B$"
printlog "Check that the OK button does not work"
try
Kontext "TabChartTypeDataSeries"
TabChartTypeDataSeries.OK
warnlog "The OK button is not disabled"
goto endsub
catch
printlog " The OK button is disabled"
endcatch
printlog "Enter as valid range $ChartFlexRange.$B$5:$B$12"
Kontext "TabChartTypeDataSeries"
Categories.SetText "$ChartFlexRange.$B$5:$B$12"
printlog "Press Range Chooser"
SelectCategories.Click
printlog "Move cursor to the end"
Kontext "AcceptOrRejectChangesArea"
AreaEditField.TypeKeys "<END>"
printlog "Enter a semicolon and the second range $ChartFlexRange.$B$14"
AreaEditField.TypeKeys ";$ChartFlexRange.$B$14"
printlog "Close Range Chooser"
ShrinkButton.Click
printlog "Verify that there is a multiple range"
Kontext "TabChartTypeDataSeries"
sCategories = Categories.GetText
if sCategories = "$ChartFlexRange.$B$5:$B$12;$ChartFlexRange.$B$14" then
printlog " The range has been modified to a multiple range"
else
warnlog "Modifiing the range was not successfull"
endif
printlog "Press Cancel button"
Kontext "TabChartTypeDataSeries"
TabChartTypeDataSeries.Cancel
printlog "Close document"
Call hCloseDocument
else
warnlog "It was not possible to open the test document."
endif
endcase
|