robotframework-doctestlibrary 0.30.0__tar.gz → 0.30.0.dev1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/PdfTest.py +6 -44
  2. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/PKG-INFO +1 -20
  3. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/README.md +0 -19
  4. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/pyproject.toml +1 -1
  5. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/Ai/__init__.py +0 -0
  6. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/Ai/prompts.py +0 -0
  7. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/Ai/renderers.py +0 -0
  8. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/Ai/responses.py +0 -0
  9. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/DocumentRepresentation.py +0 -0
  10. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/Downloader.py +0 -0
  11. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/IgnoreAreaManager.py +0 -0
  12. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/Ocr.py +0 -0
  13. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/PdfStructureComparator.py +0 -0
  14. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/PdfStructureModels.py +0 -0
  15. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/PrintJob.py +0 -0
  16. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/PrintJobTests.py +0 -0
  17. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/TextNormalization.py +0 -0
  18. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/VisualTest.py +0 -0
  19. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/__init__.py +0 -0
  20. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/config.py +0 -0
  21. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/llm/__init__.py +0 -0
  22. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/llm/client.py +0 -0
  23. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/llm/config.py +0 -0
  24. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/llm/exceptions.py +0 -0
  25. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/llm/prompts.py +0 -0
  26. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/DocTest/llm/types.py +0 -0
  27. {robotframework_doctestlibrary-0.30.0 → robotframework_doctestlibrary-0.30.0.dev1}/LICENSE +0 -0
@@ -491,14 +491,10 @@ class PdfTest(object):
491
491
  - ``whitespace_replacement`` (str, default single space): character inserted when collapsing whitespace.
492
492
  - ``round_precision`` (int or ``None``, default ``3``): precision for rounding bounding boxes.
493
493
  - ``dpi`` (int, optional): DPI used when building the structure (defaults to library DPI).
494
- - ``mask``: JSON/dict/list/string mask definition (same formats as ``Compare Pdf Documents``) used to ignore dynamic regions.
495
- - ``text_mask_patterns``: regex or list of regex strings to skip lines during comparison.
496
- - ``ignore_ligatures`` (bool, default ``False``): normalise common ligatures (``fi`` → ``fi``) prior to comparison.
497
494
 
498
495
  Examples:
499
496
  | `Compare Pdf Structure` reference.pdf candidate.pdf
500
497
  | `Compare Pdf Structure` reference.pdf candidate.pdf position_tolerance=3 relative_tolerance=0.02
501
- | `Compare Pdf Structure` reference.pdf candidate.pdf mask=${CURDIR}${/}mask.json text_mask_patterns=\\d{4}-\\d{4} ignore_ligatures=${True}
502
498
  | `Run Keyword And Expect Error` The compared PDF structure is different. Compare Pdf Structure reference.pdf candidate_with_changed_text.pdf
503
499
 
504
500
  """
@@ -519,10 +515,6 @@ class PdfTest(object):
519
515
  if dpi is None:
520
516
  dpi = DEFAULT_DPI
521
517
 
522
- mask_value = kwargs.get('mask')
523
- text_mask_patterns_arg = kwargs.get('text_mask_patterns')
524
- ignore_ligatures = _as_bool(kwargs.get('ignore_ligatures', False), False)
525
-
526
518
  extraction_config = StructureExtractionConfig(
527
519
  collapse_whitespace=collapse_whitespace,
528
520
  strip_font_subset=strip_font_subset,
@@ -530,50 +522,20 @@ class PdfTest(object):
530
522
  strip_line_edges=strip_line_edges,
531
523
  drop_empty_lines=drop_empty_lines,
532
524
  round_precision=round_precision,
533
- normalize_ligatures=ignore_ligatures,
534
525
  )
535
526
  tolerance = StructureTolerance(
536
527
  position=position_tolerance,
537
528
  size=size_tolerance,
538
529
  relative=relative_tolerance,
539
530
  )
540
- mask_file, mask_payload, text_pattern_values, mask_warnings = self._resolve_mask_arguments(
541
- mask_value,
542
- text_mask_patterns_arg,
543
- )
544
- for warning in mask_warnings:
545
- logger.warn(warning)
546
- compiled_text_patterns, pattern_warnings = self._compile_text_mask_patterns(text_pattern_values)
547
- for warning in pattern_warnings:
548
- logger.warn(warning)
549
-
550
- reference_repr = DocumentRepresentation(
551
- reference_document,
531
+ result = self._perform_structure_comparison(
532
+ reference_document=reference_document,
533
+ candidate_document=candidate_document,
534
+ tolerance=tolerance,
535
+ extraction_config=extraction_config,
536
+ case_sensitive=case_sensitive,
552
537
  dpi=dpi,
553
- ignore_area_file=mask_file,
554
- ignore_area=mask_payload,
555
538
  )
556
- candidate_repr = DocumentRepresentation(
557
- candidate_document,
558
- dpi=dpi,
559
- ignore_area_file=mask_file,
560
- ignore_area=mask_payload,
561
- )
562
- try:
563
- result = self._perform_structure_comparison(
564
- reference_document=reference_document,
565
- candidate_document=candidate_document,
566
- tolerance=tolerance,
567
- extraction_config=extraction_config,
568
- case_sensitive=case_sensitive,
569
- dpi=dpi,
570
- reference_representation=reference_repr,
571
- candidate_representation=candidate_repr,
572
- text_mask_patterns=compiled_text_patterns,
573
- )
574
- finally:
575
- reference_repr.close()
576
- candidate_repr.close()
577
539
  if not result.passed:
578
540
  raise AssertionError('The compared PDF structure is different.')
579
541
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: robotframework-doctestlibrary
3
- Version: 0.30.0
3
+ Version: 0.30.0.dev1
4
4
  Summary: A library for Visual Document Testing
5
5
  License: Apache-2.0
6
6
  Author: Many Kasiriha
@@ -414,25 +414,6 @@ Compare two PDF Files and check all possible content
414
414
  Compare Pdf Documents Reference.pdf Candidate.pdf
415
415
  ```
416
416
 
417
- ### Ignoring dynamic fields in PDF comparisons
418
-
419
- Both `Compare Pdf Documents` and `Compare Pdf Structure` now share the same helper options for masking boilerplate data:
420
-
421
- - `mask` accepts inline JSON/dicts, Robot lists, or a path to a JSON file generated by the screenshot tooling. Add `unit=pt` when coordinates are already expressed in PDF points.
422
- - `text_mask_patterns` lets you provide one or more regular expressions (string or `@{list}`) to drop matching lines from both PDFs before diffing. This is handy for timestamps, order numbers, etc.
423
- - `ignore_ligatures=${True}` normalises glyphs such as `fi`/`fl` to their ASCII representation so small font engine differences do not fail the comparison.
424
-
425
- ```RobotFramework
426
- *** Settings ***
427
- Library DocTest.PdfTest
428
-
429
- *** Test Cases ***
430
- Compare invoices while ignoring IDs
431
- ${mask}= Set Variable {"pages":[{"page":1,"rectangles":[{"left":410,"top":36,"right":560,"bottom":78}],"unit":"pt"}]}
432
- Compare Pdf Structure ${CURDIR}/baseline.pdf ${CURDIR}/candidate.pdf mask=${mask}
433
- ... text_mask_patterns=\\bINV-\d{6}\\b ignore_ligatures=${True} position_tolerance=5
434
- ```
435
-
436
417
  ### Ignore Watermarks for Visual Comparisons
437
418
  Store the watermark in a separate B/W image or PDF.
438
419
  <br>
@@ -365,25 +365,6 @@ Compare two PDF Files and check all possible content
365
365
  Compare Pdf Documents Reference.pdf Candidate.pdf
366
366
  ```
367
367
 
368
- ### Ignoring dynamic fields in PDF comparisons
369
-
370
- Both `Compare Pdf Documents` and `Compare Pdf Structure` now share the same helper options for masking boilerplate data:
371
-
372
- - `mask` accepts inline JSON/dicts, Robot lists, or a path to a JSON file generated by the screenshot tooling. Add `unit=pt` when coordinates are already expressed in PDF points.
373
- - `text_mask_patterns` lets you provide one or more regular expressions (string or `@{list}`) to drop matching lines from both PDFs before diffing. This is handy for timestamps, order numbers, etc.
374
- - `ignore_ligatures=${True}` normalises glyphs such as `fi`/`fl` to their ASCII representation so small font engine differences do not fail the comparison.
375
-
376
- ```RobotFramework
377
- *** Settings ***
378
- Library DocTest.PdfTest
379
-
380
- *** Test Cases ***
381
- Compare invoices while ignoring IDs
382
- ${mask}= Set Variable {"pages":[{"page":1,"rectangles":[{"left":410,"top":36,"right":560,"bottom":78}],"unit":"pt"}]}
383
- Compare Pdf Structure ${CURDIR}/baseline.pdf ${CURDIR}/candidate.pdf mask=${mask}
384
- ... text_mask_patterns=\\bINV-\d{6}\\b ignore_ligatures=${True} position_tolerance=5
385
- ```
386
-
387
368
  ### Ignore Watermarks for Visual Comparisons
388
369
  Store the watermark in a separate B/W image or PDF.
389
370
  <br>
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "robotframework-doctestlibrary"
3
- version = "0.30.0"
3
+ version = "0.30.0dev01"
4
4
  description = "A library for Visual Document Testing"
5
5
  authors = ["Many Kasiriha <many.kasiriha@dbschenker.com>"]
6
6
  maintainers = ["Many Kasiriha <many.kasiriha@dbschenker.com>"]