Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
61068d6
Typehints + formatting (#4)
osingaatje Sep 30, 2025
b360e92
fixed typing of get_trace in tracestate.py (#5)
tychodub Oct 8, 2025
3e8952f
Jetbrains gitignore (#7)
Egietje Oct 9, 2025
3878cc0
Create python-app.yml, for Github actions
tychodub Oct 9, 2025
6a6f4b4
Visual Paradigm Architectural Designs (#8)
osingaatje Oct 20, 2025
b4b6daa
Visualisation architecture (#9)
osingaatje Oct 22, 2025
dd971b7
Restructure + disable check on main (#10)
JWillegers Oct 22, 2025
708a034
Rollback self typing branch (#11)
tychodub Oct 29, 2025
461eee6
Documentation (+gitignore) for setting up virtual environment. (#13)
osingaatje Oct 29, 2025
8147e24
Generate html with bokeh (#15)
JWillegers Nov 5, 2025
d4dfd5c
Unit test for models.py (#17)
JWillegers Nov 12, 2025
63c8eb1
Acceptance testing (#18)
osingaatje Nov 13, 2025
905614f
Acceptance test - Vertex and Edge rules (#19)
osingaatje Nov 17, 2025
30367ab
Add subfolders to toml (#20)
JWillegers Nov 18, 2025
87ca419
Node redesign (#16)
osingaatje Nov 18, 2025
6fe3153
State graphs + graph switching + dependency checks (#21)
Egietje Nov 19, 2025
1ff8ed7
Restructure (#22)
JWillegers Nov 21, 2025
60f56fc
Updated design files according to implementation (#23)
osingaatje Nov 24, 2025
121a937
Arguments apply locally (#24)
Egietje Nov 26, 2025
0b19c82
fix line indent (#25)
JWillegers Nov 26, 2025
2c7b6be
Scenario state (#26)
tychodub Nov 27, 2025
f5e6f06
Path Highlighting (#27)
Diogossilva03 Nov 28, 2025
825c527
Unit tests and bug fixes (#28)
Egietje Dec 2, 2025
16ed4e9
Sync fork (#30)
Egietje Dec 2, 2025
57aad13
Rework trace info and fix bugs (#32)
Egietje Dec 8, 2025
edf1339
Design improvements (#33)
osingaatje Dec 10, 2025
b3d8faf
AutoPEP8 check on PRs (#29)
osingaatje Dec 16, 2025
7a3765a
Scenario Delta Value + Reduced Scenario Delta Value graph (#38)
osingaatje Dec 17, 2025
a1cfc59
Full Screen + Graph Title (#37)
Diogossilva03 Dec 17, 2025
51d0ec3
stategraph labeling: 1 edge with multiple scenarios (#39)
JWillegers Dec 17, 2025
4e89cab
Major fix reducedSDV (#40)
tychodub Dec 17, 2025
f1b0c83
Start node property (#41)
tychodub Dec 17, 2025
0288b9b
Export json (#44)
JWillegers Dec 27, 2025
d1a7fb9
Sugiyama layout (#45)
Egietje Jan 3, 2026
bc568c6
Delta value+improved delta (#46)
tychodub Jan 5, 2026
cb1fdc9
Reduced sdv label improvement (#47)
tychodub Jan 7, 2026
9161926
Sync fork (#48)
Egietje Jan 8, 2026
fb3cecc
added svg export back (#50)
osingaatje Jan 8, 2026
1f32133
Minor tweaks (#49)
Egietje Jan 9, 2026
85b16fc
Add _get_graph() in Visualiser for atesting in the future (#52)
osingaatje Jan 12, 2026
7128ac6
Fix some spelling mistakes surrounding json export (#54)
tychodub Jan 14, 2026
44526ce
Documentation (#53)
Egietje Jan 14, 2026
a578c8c
Acceptance tests (must requirements) (#55)
JWillegers Jan 18, 2026
f00b564
Zoombox (#59)
JWillegers Jan 19, 2026
f8f8c92
Atest/remaining (#58)
JWillegers Jan 19, 2026
f4e8628
Remove seed from graph title (#60)
Egietje Jan 20, 2026
9795a8d
Requirements checks for visualisation atests (#61)
osingaatje Jan 20, 2026
4f1a7e7
replace boxzoomtool for zoomintool and zoomouttool (#63)
JWillegers Jan 21, 2026
5603ae2
Split name utests (#64)
Egietje Jan 21, 2026
aa8c482
Smaller margins (#62)
Egietje Jan 21, 2026
37b6026
Documentation (#65)
Egietje Jan 21, 2026
a0ab46d
Export path (#66)
JWillegers Jan 21, 2026
2802d00
Sync fork and minor changes (#67)
Egietje Jan 23, 2026
9309ff8
Tooltips (#68)
Egietje Jan 23, 2026
47ad27b
Typehints + formatting (#4)
osingaatje Sep 30, 2025
1fb004d
fixed typing of get_trace in tracestate.py (#5)
tychodub Oct 8, 2025
61f3683
Jetbrains gitignore (#7)
Egietje Oct 9, 2025
1786ae5
Create python-app.yml, for Github actions
tychodub Oct 9, 2025
c17d889
Visual Paradigm Architectural Designs (#8)
osingaatje Oct 20, 2025
2ba3de2
Visualisation architecture (#9)
osingaatje Oct 22, 2025
ea7f59a
Restructure + disable check on main (#10)
JWillegers Oct 22, 2025
53d6a7f
Rollback self typing branch (#11)
tychodub Oct 29, 2025
69fa295
Documentation (+gitignore) for setting up virtual environment. (#13)
osingaatje Oct 29, 2025
cc77a1c
Generate html with bokeh (#15)
JWillegers Nov 5, 2025
fdc02df
Unit test for models.py (#17)
JWillegers Nov 12, 2025
a6598d8
Acceptance testing (#18)
osingaatje Nov 13, 2025
8cf5f04
Acceptance test - Vertex and Edge rules (#19)
osingaatje Nov 17, 2025
cbb2c49
Add subfolders to toml (#20)
JWillegers Nov 18, 2025
a1b9d02
Node redesign (#16)
osingaatje Nov 18, 2025
4cee185
State graphs + graph switching + dependency checks (#21)
Egietje Nov 19, 2025
407a06f
Restructure (#22)
JWillegers Nov 21, 2025
a570e10
Updated design files according to implementation (#23)
osingaatje Nov 24, 2025
a0bd588
Arguments apply locally (#24)
Egietje Nov 26, 2025
b49d79d
fix line indent (#25)
JWillegers Nov 26, 2025
8f4f557
Scenario state (#26)
tychodub Nov 27, 2025
48c0437
Path Highlighting (#27)
Diogossilva03 Nov 28, 2025
48a60e1
Unit tests and bug fixes (#28)
Egietje Dec 2, 2025
c8b3e84
Sync fork (#30)
Egietje Dec 2, 2025
a2fa358
Rework trace info and fix bugs (#32)
Egietje Dec 8, 2025
46a6db3
Design improvements (#33)
osingaatje Dec 10, 2025
79b5e85
AutoPEP8 check on PRs (#29)
osingaatje Dec 16, 2025
61146d6
Scenario Delta Value + Reduced Scenario Delta Value graph (#38)
osingaatje Dec 17, 2025
052ddf5
Full Screen + Graph Title (#37)
Diogossilva03 Dec 17, 2025
7a884fa
stategraph labeling: 1 edge with multiple scenarios (#39)
JWillegers Dec 17, 2025
47613ee
Major fix reducedSDV (#40)
tychodub Dec 17, 2025
06c0123
Start node property (#41)
tychodub Dec 17, 2025
a9f7e8b
Export json (#44)
JWillegers Dec 27, 2025
8562230
Sugiyama layout (#45)
Egietje Jan 3, 2026
0faa515
Delta value+improved delta (#46)
tychodub Jan 5, 2026
f294748
Reduced sdv label improvement (#47)
tychodub Jan 7, 2026
59b902a
Sync fork (#48)
Egietje Jan 8, 2026
872065d
added svg export back (#50)
osingaatje Jan 8, 2026
4fe4015
Minor tweaks (#49)
Egietje Jan 9, 2026
c064a7c
Add _get_graph() in Visualiser for atesting in the future (#52)
osingaatje Jan 12, 2026
e74e841
Fix some spelling mistakes surrounding json export (#54)
tychodub Jan 14, 2026
a962a71
Documentation (#53)
Egietje Jan 14, 2026
75ebaf3
Acceptance tests (must requirements) (#55)
JWillegers Jan 18, 2026
2b9547f
Zoombox (#59)
JWillegers Jan 19, 2026
38c9255
Atest/remaining (#58)
JWillegers Jan 19, 2026
2bb8240
Remove seed from graph title (#60)
Egietje Jan 20, 2026
6179302
Requirements checks for visualisation atests (#61)
osingaatje Jan 20, 2026
cf3e479
replace boxzoomtool for zoomintool and zoomouttool (#63)
JWillegers Jan 21, 2026
c267fd4
Split name utests (#64)
Egietje Jan 21, 2026
bbf4afb
Smaller margins (#62)
Egietje Jan 21, 2026
6c85c49
Documentation (#65)
Egietje Jan 21, 2026
66bf82d
Export path (#66)
JWillegers Jan 21, 2026
b080487
Sync fork and minor changes (#67)
Egietje Jan 23, 2026
1efa410
Tooltips (#68)
Egietje Jan 23, 2026
1c2275d
Merge remote-tracking branch 'origin/main'
Egietje Jan 23, 2026
30ae3c2
Removed design files and graph types for PR
Egietje Jan 23, 2026
20edb86
Remove unused methods
Egietje Jan 23, 2026
3733ba2
Reduce update visualisation calls
Egietje Jan 23, 2026
547b677
Remove whitespace changes
Egietje Jan 23, 2026
925af54
Fix warn on missing dependencies bug
Egietje Jan 25, 2026
07d1639
Move visualisation atests to a single outer suite
Egietje Jan 25, 2026
285462f
Make sure we capture all tracestate updates
Egietje Jan 25, 2026
7980ae2
added documentation to public methods of models.py
tychodub Jan 26, 2026
65f62b8
removed methods that were supposed to be removed
tychodub Jan 26, 2026
d42c695
fixed importing graphs
JWillegers Jan 27, 2026
828ac05
Merge branch 'final-pr' of https://github.com/MASTERS-Y2Q1-ISEP/robot…
JWillegers Jan 27, 2026
9313983
update export atest to use the _load_graph function
JWillegers Jan 27, 2026
714dd6d
fix model = ModelSpace() bug
osingaatje Jan 28, 2026
fbc869e
removed code snippet entirely because the ModelSpace cannot be None
osingaatje Jan 28, 2026
88fd99a
add licenses to files
JWillegers Jan 28, 2026
0e9347c
condensed docstrings in abstractgraph.py
osingaatje Jan 28, 2026
2a2f541
remove unnecessary string format
JWillegers Jan 28, 2026
da0669b
remove unused Any type import
osingaatje Jan 28, 2026
4136653
refactored Contributing and Readme
osingaatje Jan 28, 2026
7659eb8
refactored README (arguments <> instead of [] + added more nice markd…
osingaatje Jan 28, 2026
e172999
removed duplicate 'option management'
osingaatje Jan 28, 2026
89a04f9
highlighting in README
osingaatje Jan 28, 2026
4109ea5
fix docstring mistake
osingaatje Jan 28, 2026
2b2d753
autopep8 formatting
osingaatje Jan 30, 2026
6221456
sort imports and set method type
JFoederer Feb 6, 2026
9c1bfa2
take test code out pf production code
JFoederer Feb 6, 2026
52581fc
remove integration dependency from unit test
JFoederer Feb 6, 2026
772fa51
Merge branch 'main' into pr/45
JFoederer Feb 6, 2026
ec27baa
move export/import dependencies to one place
JFoederer Feb 7, 2026
7eabca3
visualisation atest overhaul
JFoederer Feb 8, 2026
9a10ff6
fix python 3.10 incompatibility
JFoederer Feb 8, 2026
d8539a9
use platform independent path separator
JFoederer Feb 8, 2026
2b67535
split graph drawing from exporting
JFoederer Feb 9, 2026
eddd48a
extract import to separate keyword
JFoederer Feb 9, 2026
468cff2
refactored visualiser integration
JFoederer Feb 13, 2026
d6d0379
fix double None return type when import failed
JFoederer Feb 13, 2026
a8590c3
visualisation in consistent dialect
JFoederer Feb 14, 2026
080af0b
fix any type
JFoederer Feb 21, 2026
3d9916d
bring user docs up to date
JFoederer Feb 21, 2026
59c7842
split how to from guidelines
JFoederer Feb 21, 2026
f2fc84a
revert unrelated changes
JFoederer Feb 21, 2026
33d0d0f
state dual license choice
JFoederer Feb 21, 2026
fc6248b
update graph legend text
JFoederer Feb 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow installs required Python dependencies and then runs the available tests.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Run Acceptance and Unit tests
name: Run Acceptance and Unit tests (with and without visualisation dependencies)

on:
pull_request:
Expand All @@ -21,10 +21,18 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: "3.10" # Only the oldest supported Python version is included here
- name: Install dependencies
run: |
python -m pip install --upgrade pip # upgrade pip to latest version
pip install . # install pyproject.toml dependencies - excludes optional dependencies (such as visualisation)
- name: Run tests

- name: Install dependencies (without extra visualisation dependencies)
run: |
python run_tests.py
python -m pip install --upgrade pip # upgrade pip to latest version
pip install . # no additional [visualisation] dependencies

- name: Run tests (without visualisation dependencies)
run: python run_tests.py

- name: Install extra visualisation dependencies
run: pip install ".[visualisation]" # extra [visualisation] dependencies in pyproject.toml

- name: Run Tests (with visualisation dependencies)
run: python run_tests.py

67 changes: 55 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The recommended installation method is using [pip](http://pip-installer.org)

After installation include `robotmbt` as library in your robot file to get access to the new functionality. To run your test suite model-based, use the __Treat this test suite model-based__ keyword as suite setup. Check the _How to model_ section to learn how to make your scenarios suitable for running model-based.

```
```robotframework
*** Settings ***
Library robotmbt
Suite Setup Treat this test suite model-based
Expand All @@ -50,7 +50,8 @@ Modelling can be done directly from [Robot framework](https://robotframework.org

Consider these two scenarios:

```
```robotframework
*** Test Cases ***
Buying a postcard
When you buy a new postcard
then you have a blank postcard
Expand All @@ -63,7 +64,8 @@ Preparing for a birthday party

Mapping the dependencies between scenarios is done by annotating the steps with modelling info. Modelling info is added to the documentation of the step as shown below. Regular documentation can still be added, as long as `*model info*` starts on a new line and a white line is included after the last `:OUT:` expression.

```
```robotframework
*** Keywords ***
you buy a new postcard
[Documentation] *model info*
... :IN: None
Expand Down Expand Up @@ -117,7 +119,8 @@ All example scenarios naturally contain data. This information is embedded in th

#### Step argument modifiers

```
```robotframework
*** Test Cases ***
Personalising a birthday card
Given there is a birthday card
when Johan writes their name on the birthday card
Expand All @@ -126,7 +129,8 @@ Personalising a birthday card

The above scenario uses the name `Johan` to create a concrete example. But now suppose that from a testing perspective `Johan` and `Frederique` are part of the same equivalence class. Then the step `Frederique writes their name on the birthday card` would yield an equally valid scenario. This can be achieved by adding a modifier (`:MOD:`) to the model info of the step. The format of a modifier is a Robot argument to which you assign a list of options. The modifier updates the argument value to a randomly chosen value from the specified options.

```
```robotframework
*** Keywords ***
${person} writes their name on the birthday card
[Documentation] *model info*
... :MOD: ${person}= [Johan, Frederique]
Expand All @@ -138,7 +142,8 @@ ${person} writes their name on the birthday card

When constructing examples, they often express relations between multiple actors, where each actor can appear in multiple steps. This makes it important to know how modifiers behave when there are multiple modifiers in a scenario.

```
```robotframework
*** Test Cases ***
Addressing a birthday card
Given Tannaz is having their birthday
and Johan has a birthday card
Expand All @@ -148,7 +153,8 @@ Addressing a birthday card

Have a look at the when-step above. We will assume the model already contains a domain term with two properties: `birthday.celebrant = Tannaz` and `birthday.guests = [Johan, Frederique]`.

```
```robotframework
*** Keywords ***
${sender} writes the address of ${receiver} on the birthday card
[Documentation] *model info*
... :MOD: ${sender}= birthday.guests
Expand All @@ -175,10 +181,12 @@ It is not possible to add new options to an existing example value. Any constrai

It is possible for a step to keep the same options. The special `.*` notation lets you keep the available options as-is. Preceding steps must then supply the possible options. Some steps can, or must, deal with multiple independent sets of options that must not be mixed, because the expected results should differ. Suppose you have a set of valid and invalid passwords. You might be reluctant to include the superset of these as options to an authentication step. Instead, you can use `:MOD: ${password}= .*` as the modifier for that step. Like in the when-step for this scenario:

```
Given 'secret' is too weak a password
When user tries to update their password to 'secret'
then the password is rejected
```robotframework
*** Test Cases ***
Reject password
Given 'secret' is too weak a password
When user tries to update their password to 'secret'
then the password is rejected
```

In a then-step, modifiers behave slightly different. In then-steps no new option constraints are accepted for an argument. Its value must already have been determined during the given- and when-steps. In other words, regardless of the actual modifier, the expression behaves as if it were `.*`. The exception to this is when a then-step signals the first use of a new example value. In that case the argument value from the original scenario text is used.
Expand All @@ -193,12 +201,47 @@ For now, variable data considers strict equivalence classes only. This means tha

By default, trace generation is random. The random seed used for the trace is logged by _Treat this test suite model-based_. This seed can be used to rerun the same trace, if no external random factors influence the test run. To activate the seed, pass it as argument:

```
```robotframework
Treat this test suite model-based seed=eag-etou-cxi-leamv-jsi
```

Using `seed=new` will force generation of a new reusable seed and is identical to omitting the seed argument. To completely bypass seed generation and use the system's random source, use `seed=None`. This has even more variation but does not produce a reusable seed.

### Graphs

A graph can be included in the log file to visualise how scenarios are linked. This helps in understanding a test suite's structure and reveals alternative paths that did not make it into the final trace.

To enable graph generation, some extra dependencies must be installed: `pip install robotframework-mbt[visualisation]`

Generate the graph by setting the graph style for the model-based suite. The graph will be included in the Robot log file as part of the keyword's logging.

```robotframework
Treat this test suite Model-based graph=scenario
```

Available graph styles:

* scenario
* Compact view: Each scenario is shown as one node.
* scenario-delta-value
* Expanded view: Scenarios can become multiple nodes if they affect system state in different ways.

#### Exporting and importing graph data

Graph data can be stored by setting an output directory using argument `export_graph_data`. This createss a json file, named after the test suite, in the selected folder. Any accessable path can be used. For your convenience, Robot Framework offers an [automatic variable](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#automatic-variables) `${OUTPUT_DIR}` that points to this run's output directory. The `export_graph_data` argument can be used independent of the `graph` argument.

```robotframework
Treat this test suite Model-based export_graph_data=${OUTPUT_DIR}
```

To recreate a graph from previously exported graph data, use:

```robotframework
Show model graph from exported file json_file_path=<file_path> graph_style=scenario
```

This will draw a graph from the exported file, without the need to rerun the test suite. It is possible to select a different graph style than was used during the test run. If no graph style is selected, then the scenario graph style is used.

### Option management

If you want to set configuration options for use in multiple test suites without having to repeat them, the keywords __Set model-based options__ and __Update model-based options__ can be used to configure RobotMBT library options. _Set_ takes the provided options and discards any previously set options. _Update_ allows you to modify existing options or add new ones. Reset all options by calling _Set_ without arguments. Direct options provided to __Treat this test suite model-based__ take precedence over library options and affect only the current test suite.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*** Settings ***
Suite Setup Clear prior exports ${OUTPUT_DIR}${/}run_model_with_graph.json
Library ../graph_checker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
*** Settings ***
Documentation This suite runs model-based with the graphing option enabled. The checks for the contents
... of the graph are delegated to the second robot file in the same folder. Export/import
... functionality is used to gain access to the graph contents.
Suite Setup Treat this test suite Model-based graph=scenario export_graph_data=${OUTPUT_DIR}
Resource ../../../resources/birthday_cards_data_variation.resource
Library robotmbt

*** Test Cases ***
Buying a card
Given Jonathan is having their birthday
and Douwe is a friend of Jonathan
and Diogo is a friend of Jonathan
and Tycho is a friend of Jonathan
and Thomas is a friend of Jonathan
When Douwe buys a birthday card
then there is a blank birthday card available

Someone writes their name on the card
Given there is a birthday card
and Diogo's name is not yet on the birthday card
when Diogo writes their name on the birthday card
then the birthday card has 'Diogo' written on it

At least 3 people can write their name on the card
Given the birthday card has 2 different names written on it
and Tycho's name is not yet on the birthday card
when Tycho writes their name on the birthday card
then the birthday card has 3 different names written on it
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
*** Settings ***
Documentation This suite takes the graph generated in the first suite in this folder
... and checks the content's properties.
Library ../graph_checker.py
Library Collections
Suite Setup Import graph data from ${OUTPUT_DIR}${/}run_model_with_graph.json

*** Test Cases ***
Scenarios are nodes in the graph
VAR @{expected_nodes} start
... Buying a card
... Someone writes their name on the card
... At least 3 people can write their name on the card
${node_count}= Number of graph nodes
Should be equal ${node_count} ${4}
@{all_nodes}= List of node titles
Lists should be equal ${all_nodes} ${expected_nodes} ignore_order=True

Dependent nodes are connected by directed edges
@{successors}= All successors to node Buying a card
VAR @{next_node} Someone writes their name on the card
Should be equal ${successors} ${next_node}
@{successors}= All successors to node Someone writes their name on the card
Should not contain ${successors} Buying a card

The dependency order for nodes is top-down
${first_pos}= Vertical position of node Buying a card
${second_pos}= Vertical position of node Someone writes their name on the card
Should be true ${second_pos} < ${first_pos}

Repeating scenarios have a self-looping edge
@{successors}= All successors to node Someone writes their name on the card
Should contain ${successors} Someone writes their name on the card
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*** Settings ***
Suite Setup Clear prior exports ${OUTPUT_DIR}${/}run_model_with_graph.json
Library ../graph_checker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
*** Settings ***
Documentation This suite runs model-based with the graphing option enabled. The checks for the contents
... of the graph are delegated to the second robot file in the same folder. Export/import
... functionality is used to gain access to the graph contents.
Suite Setup Treat this test suite Model-based graph=scenario-delta-value export_graph_data=${OUTPUT_DIR}
Resource ../../../resources/birthday_cards_data_variation.resource
Library robotmbt

*** Test Cases ***
Buying a card
Given Jonathan is having their birthday
and Douwe is a friend of Jonathan
and Diogo is a friend of Jonathan
and Tycho is a friend of Jonathan
and Thomas is a friend of Jonathan
When Douwe buys a birthday card
then there is a blank birthday card available

Someone writes their name on the card
Given there is a birthday card
and Diogo's name is not yet on the birthday card
when Diogo writes their name on the birthday card
then the birthday card has 'Diogo' written on it

At least 3 people can write their name on the card
Given the birthday card has 2 different names written on it
and Tycho's name is not yet on the birthday card
when Tycho writes their name on the birthday card
then the birthday card has 3 different names written on it
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
*** Settings ***
Documentation This suite takes the graph generated in the first suite in this folder
... and checks how the content's properties for the scenario-delta-value
... graph are different compared to the scenario graph.
Library ../graph_checker.py
Library Collections
Suite Setup Import graph data from ${OUTPUT_DIR}${/}run_model_with_graph.json graph_type=scenario-delta-value

*** Test Cases ***
Repeated scenario with different states become separate nodes
[Documentation] In the standard scenario graph, the repeated scenario would show up
... as a self-looping edge. In the scenario-delta-value variant, also
... state changes are taken into account, meaning that the two variants
... will each get their own node.
${node_count}= Number of graph nodes
Should be true ${node_count} > ${4}
@{all_nodes}= List of node titles
Should contain ${all_nodes} Someone writes their name on the card
Should contain ${all_nodes} Someone writes their name on the card (rep 2)

Full node text contains state info
[Documentation] Next to the scenario name, the node text for scenario-delta-value graphs
... also contians information about the model state. 'Buying a card'
... initialises the modeland contains all properties in their initial state.
... 'host' and 'names' are properties being tracked by the model.
${full_text}= Full node text of node Buying a card
Should contain ${full_text} host
Should contain ${full_text} names

Full node text only contains changed information
[Documentation] When someone writes their name on the card, then the host or celebrant
... does not change. The node for this scenario should only show the state
... that changed during this scenario.
${full_text}= Full node text of node Someone writes their name on the card (rep 2)
Should contain ${full_text} names
Should not contain ${full_text} host
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
*** Settings ***
Documentation This suite takes the graph generated earlier in the visualisation suite
... and uses it to check import functionality.
Library robotmbt
Library graph_checker.py
Library Collections

*** Variables ***
${prior_export} ${OUTPUT_DIR}${/}run_model_with_graph.json

*** Test Cases ***
Import as any graph type
[Documentation] The data that is stored during export is always the compelte data set. This
... has the advantage that different graph types can be reconstructed from the
... data without rerunning the model.
Import graph data from ${prior_export} graph_type=scenario
Show model graph from exported file ${prior_export} graph_style=scenario
${node_count}= Number of graph nodes
Should be equal ${node_count} ${4}
Import graph data from ${prior_export} graph_type=scenario-delta-value
Show model graph from exported file ${prior_export} graph_style=scenario-delta-value
${node_count}= Number of graph nodes
Should be true ${node_count} > ${4}

Future major version bump imports are rejected
${future_file}= Modify export file with future major version number ${prior_export}
Run keyword and expect error *incompatible RobotMBT version
... Import graph data from ${future_file}

Future minor verion bump imports are accepted
${future_file}= Modify export file with future minor version number ${prior_export}
Import graph data from ${future_file}
${node_count}= Number of graph nodes
Should be equal ${node_count} ${4}

Ill-formed files are rejected for import
${corrupted_file}= Corrupt export file ${prior_export}
Run keyword and expect error *could not be loaded as RobotMBT graph data
... Import graph data from ${corrupted_file}
8 changes: 8 additions & 0 deletions atest/robotMBT tests/10__visualisation/__init__.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*** Settings ***
Suite Setup Skip if optional visualisation is not installed
Library graph_checker.py

*** Keywords ***
Skip if optional visualisation is not installed
${partial_installation}= Graphing dependencies missing
Skip If ${partial_installation} Visualisation dependencies not installed. Please read the README for information on how to do this.
Loading