@@ -511,6 +511,61 @@ changes are backwards incompatible:
511
511
512
512
__ `Argument conversion enhancements `_
513
513
514
+ Running and result models have been changed
515
+ -------------------------------------------
516
+
517
+ Prior to Robot Framework 4.0 running and result models contained only keywords.
518
+ Although FOR loop syntax existed, internally FOR related objects were represented
519
+ as special kind of keywords. Introduction of the new IF/ELSE syntax made it clear
520
+ that this approach did not work anymore, and separate FOR and IF objects were
521
+ introduced. At the same time, some other changes were done to make these models
522
+ easier to use externally.
523
+
524
+ These changes do not affect normal Robot Framework usage at all, but tools using
525
+ the running and result models are likely to be affected. These include tools
526
+ modifying tests before execution (using e.g. pre-run modifier or listeners) as
527
+ well as tools inspecting and especially modifying results. Changes most likely
528
+ to cause problems are listed below and issue `#3749 `_ contains more details:
529
+
530
+ - `TestSuite `, `TestCase ` and `Keyword ` objects used to have `keywords ` attribute
531
+ containing keywords used in them. This name is misleading now when they also
532
+ have FOR and IF objects. With `TestCase ` and `Keyword ` the attribute was
533
+ renamed to `body ` and with `TestSuite ` it was removed altogether. The `keywords `
534
+ attribute still exists but it is read-only and deprecated.
535
+
536
+ - The new `body ` does not have `create() ` method for creating keywords, like the old
537
+ `keywords ` had, but instead it has separate `create_keyword() `, `create_for() ` and
538
+ `create_if() ` methods. This means that old usages like `test.keywords.create() `
539
+ need to be changed to `test.body.create_keyword() `.
540
+
541
+ - `TestSuite ` and `TestCase ` object nowadays have `setup ` and `teardown ` directly
542
+ when earlier they needed to be accessed via `keywords `. This means that, for
543
+ example, suite setup is accessed like `suite.setup ` instead of `suite.keywords.setup `.
544
+
545
+ - `setup ` and `teardown ` are never `None ` like they earlier could be. Instead they
546
+ are always represented as `Keyword ` objects that are just considered inactive
547
+ (and untrue) when not set. They can be activated by setting `name ` and other needed
548
+ attributes either independently or by calling the `config() ` method. If they
549
+ need to be disabled, the easiest solution is setting them to `None ` like
550
+ `test.setup = None ` which will automatically recreate an inactive setup (or
551
+ teardown) object.
552
+
553
+ - Result side got separate `For ` and `If ` objects instead of using `Keyword ` with
554
+ `type ` attribute separating normal keywords from other structures. For backwards
555
+ compatibility reasons the new objects still have `Keyword ` specific attributes
556
+ like `args `.
557
+
558
+ - On the running side `For ` and `If ` objects do not anymore extend `Keyword `.
559
+
560
+ - Earlier result side `Keyword ` had `messages ` and `keywords ` separately, but
561
+ nowadays also messages are stored in `body ` along with executed keywords as
562
+ well as FOR and IF objects. The old `messages ` is preserved as a property
563
+ getting messages from `body `.
564
+
565
+ - Visitor interface has got separate entry points for visiting FOR loops and
566
+ IF/ELSE structures. Nowadays `visit_keyword() `, `start_keyword() ` and
567
+ `end_keyword() ` are called only with actual keyword objects.
568
+
514
569
Generated output.xml has been changed
515
570
-------------------------------------
516
571
@@ -573,7 +628,6 @@ Other backwards incompatible changes
573
628
- Python 3.4 is not anymore supported. (`#3577 `_)
574
629
- Keyword types passed to listeners have changed. (`#3851 `_)
575
630
- Parsing model has been changed slightly. (`#3776 `_)
576
- - Result and running models have been changed (`#3749 `_)
577
631
- Space after a literal newline is not ignored anymore. (`#3746 `_)
578
632
- Small changes to importing listeners and model modifiers from the command line. (`#3809 `_)
579
633
- Deprecated `ConnectionCache._resolve_alias_or_index ` method has been removed. (`#3858 `_)
0 commit comments