-
Notifications
You must be signed in to change notification settings - Fork 21
/
Compare.robot
98 lines (69 loc) · 6.07 KB
/
Compare.robot
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
*** Settings ***
Library DocTest.VisualTest show_diff=true take_screenshots=true screenshot_format=png #pdf_rendering_engine=ghostscript
Library Collections
*** Test Cases ***
Compare two Beach images
Run Keyword And Expect Error The compared images are different. Compare Images testdata/Beach_left.jpg testdata/Beach_right.jpg
Compare two Farm images
Run Keyword And Expect Error The compared images are different. Compare Images testdata/Farm_left.jpg testdata/Farm_right.jpg
Compare two Farm images with date pattern
Compare Images testdata/Beach_date.png testdata/Beach_left.png placeholder_file=testdata/pattern_mask.json
Compare two Farm images with area mask as list
${top_mask} Create Dictionary page=1 type=area location=top percent=10
${bottom_mask} Create Dictionary page=all type=area location=bottom percent=10
${masks} Create List ${top_mask} ${bottom_mask}
Compare Images testdata/Beach_date.png testdata/Beach_left.png mask=${masks}
Compare two Farm images with area mask as string
Compare Images testdata/Beach_date.png testdata/Beach_left.png mask=top:10;bottom:10
Compare two Farm images with date pattern and east detection
Compare Images testdata/Beach_date.png testdata/Beach_left.png placeholder_file=testdata/pattern_mask.json ocr_engine=east
Compare two different PDF Files
Run Keyword And Expect Error The compared images are different. Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_changed.pdf
Compare two different PDF Files with pattern mask
Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_changed.pdf placeholder_file=testdata/pdf_pattern_mask.json
Compare two different PDF Files with area mask
Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_changed.pdf placeholder_file=testdata/pdf_area_mask.json
Compare two different PDF Files with pattern mask as parameter
Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_changed.pdf mask=[{"page": "all","name": "Ref ID","type": "pattern","pattern": ".*RTMOE.*"},{"page": "all","name": "Job ID","type": "pattern","pattern": "JobID.*"}]
Compare two different PDF Files with moved text
Run Keyword And Expect Error The compared images are different. Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_moved.pdf
Compare two different PDF Files with moved text but same content OCR
Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_moved.pdf check_text_content=${true}
Compare two different PDF Files with moved text but same content pdfminer
Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_moved.pdf check_text_content=${true} get_pdf_content=${true}
Compare two different PDF Files with moved text but and different content pdfminer
Run Keyword And Expect Error The compared images are different. Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_moved_and_different.pdf check_text_content=${true} get_pdf_content=${true}
Compare two different PDF Files with moved text within tolerance
Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_moved.pdf move_tolerance=20 get_pdf_content=${true}
Compare two different PDF Files with moved text outside tolerance
Run Keyword And Expect Error The compared images are different. Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_moved.pdf move_tolerance=5 get_pdf_content=${true}
Compare two different Image Files with moved text
Compare Images testdata/small_A_reference.png testdata/small_A_moved.png move_tolerance=60 ignore_watermarks=False
Compare two different PDF Files with moved text within tolerance using OCR
Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_moved.pdf move_tolerance=20 force_ocr=True
Compare two different PDF Files with moved text outside tolerance using OCR
Run Keyword And Expect Error The compared images are different. Compare Images testdata/sample_1_page.pdf testdata/sample_1_page_moved.pdf move_tolerance=5 force_ocr=True
Compare two small Image Files with moved text without OCR
Compare Images testdata/small_A_reference.png testdata/small_A_moved.png move_tolerance=60 ignore_watermarks=False
Compare Images With Different Shapes
Run Keyword And Expect Error STARTS:The compared images have different dimensions Compare Images testdata/Beach_left.jpg testdata/Beach_cropped.jpg
Compare Text Content from PDF
${text} Get Text From Document testdata/sample.pdf
List Should Contain Value ${text} THE TEST SHIPPER
Compare Text Content from Image
${text} Get Text From Document testdata/Beach_date.png
List Should Contain Value ${text} 123456789
List Should Contain Value ${text} 01-Jan-2021
Compare Text Content from Image with east
${text} Get Text From Document testdata/Beach_date.png ocr_engine=east
Should Contain Match ${text} *01-Jan-2021*
Should Contain Match ${text} *SOUVENIR*
Should Contain Match ${text} *123456789*
Compare Images And Resize With Different Shapes
Run Keyword And Expect Error The compared images are different. Compare Images testdata/Beach_left.jpg testdata/Beach_cropped.jpg resize_candidate=True
Compare Images Different Images With Full Watermark
Compare Images testdata/Beach_date.png testdata/Beach_left.png watermark_file=testdata/Beach_date_mask_full.png
Compare Images Different Images With Partial Watermark
Run Keyword And Expect Error The compared images are different. Compare Images testdata/Beach_date.png testdata/Beach_left.png watermark_file=testdata/Beach_date_mask_partial.png
Compare Images Different Images With Smaller Watermark
Compare Images testdata/Beach_date.png testdata/Beach_left.png watermark_file=testdata/Beach_date_mask_full_smaller.png