Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion atest/resources/birthday_cards_data_variation.resource
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ the birthday card has ${n} different names written on it
[Documentation] *model info*
... :IN: len(set(birthday_card.names)) == ${n}
... :OUT: len(set(birthday_card.names)) == ${n}
Length should be ${names} ${{int(${n})}}
Length should be ${{set(${names})}} ${{int(${n})}}

${person} signs the birthday card
[Documentation] *model info*
Expand Down
2 changes: 1 addition & 1 deletion atest/resources/birthday_cards_flat.resource
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ${person A} passes the birthday card ${back/on} to ${person B}
Log Thank you ${person A}, I'll be sure to put my name on here.
Set suite variable ${has_card} ${person B}

${person} refuses to write their name on the birthday card
${person} writes their name in invisible ink on the birthday card
[Documentation] *model info*
... :IN: birthday_card
... :OUT: birthday_card
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ Someone writes their name on the card
when Someone writes their name on the birthday card
then the birthday card has 'Someone' written on it

Refusing to share the birthday card
Signing the card in invisible ink
Given there is a birthday card
and the birthday card has 'Someone' written on it
when Johan refuses to write their name on the birthday card
when Johan writes their name in invisible ink on the birthday card
then the birthday card has 'Someone' written on it
but the birthday card does not have 'Johan' written on it

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
*** Settings ***
Documentation This suite has more low-level scenarios than high-level scenarios,
... meaning that the high-level scenario must be repeated in order for
... the second low-level scenario to be reached.
Suite Setup Treat this test suite Model-based
Resource ../../resources/birthday_cards_composed.resource
Library robotmbt

*** Test Cases ***
Buying a card
When someone buys a birthday card
then there is a blank birthday card available

high-level scenario
Given there is a birthday card
when Someone writes their name on the birthday card
then the birthday card has 'Someone' written on it

low-level scenario A
Given there is a birthday card
when Someone writes their name in pen on the birthday card
then the birthday card has 'Someone' written on it
and there is text added in ink on the birthday card

low-level scenario B
Given there is a birthday card
when Someone writes their name in pen on the birthday card
then the birthday card has 'Someone' written on it
and there is text added in ink on the birthday card
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Buying a card
When someone buys a birthday card
then there is a blank birthday card available

Refusing to sign the birthday card
Signing the card in invisible ink
Given there is a birthday card
when everybody refuses to write their name on the birthday card
when everybody writes their name in invisible ink on the birthday card
then the birthday card has 0 names written on it

At least 42 people can write their name on the card
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
*** Settings ***
Documentation This suite confirms that a scenario that can be inserted at the place
... of refinement based on its entry conditions, but afterwards does not
... satisfy the high-level scenario's exit conditions, is rejected.
Suite Setup Expect failing suite processing
Resource ../../resources/birthday_cards_flat.resource
Library robotmbt


*** Test Cases ***
Buying a card
When someone buys a birthday card
then there is a blank birthday card available

high-level scenario
Given there is a birthday card
when Two people write their name on the birthday card
then the birthday card has 2 names written on it

low-level scenario
Given there is a birthday card
when Someone writes their name on the birthday card
then the birthday card has 'Someone' written on it


*** Keywords ***
Two people write their name on the birthday card
[Documentation]
... *model info*
... :IN: scenario.count = len(birthday_card.names)
... :OUT: len(birthday_card.names) == scenario.count+2
Skip when unreachable
Length should be ${names} ${2}

Expect failing suite processing
Run keyword and expect error Unable to compose* Treat this test suite Model-based
Set suite variable ${expected_error_detected} ${True}

Skip when unreachable
[Documentation]
... If the scenario is inserted after proper detection of the expected error,
... then this keyword causes the remainder of the scenario to be skipped and
... the test passes. When inserted without detected error, the scenario will
... fail.
IF ${expected_error_detected}
Pass execution Accepting intentionally unreachable scenario
END
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
*** Settings ***
Documentation This suite covers a special case where an incomplete rollback inside a
... scenario which is split up for refinement, could cause two scenarios
... to be inserted for a single refinement. To get into that situation the
... high-level scenario has two steps that require refinement. The first
... one only checks that a certain name is inserted, it does not check the
... number of names. The second one checks that the total number of names
... is three. This should be an unreachable situation, because refinements
... are always a single scenario and each of the scenarios only inserts a
... single name. If the rollback of the middle part (2.2 in the trace) was
... incomplete, i.e. its rollback did not include the refinement scenario
... as well, then inserting the second low-level scenario would satisfy
... the first exit conditions and inserting another low-level scenario for
... the second refinement would satisfy exit conditions for both steps and
... incorrectly complete the suite.
Suite Setup Expect failing suite processing
Resource ../../resources/birthday_cards_flat.resource
Library robotmbt


*** Test Cases ***
Buying a card
When someone buys a birthday card
then there is a blank birthday card available

high-level scenario
Given there is a birthday card
when The first person writes their name on the birthday card
and Two more people write their name on the birthday card
then the birthday card has 3 names written on it

low-level scenario A
Given there is a birthday card
and we are in refinement
when Someone writes their name on the birthday card
then the birthday card has 'Someone' written on it

low-level scenario B
Given there is a birthday card
and we are in refinement
when Someone writes their name on the birthday card
then the birthday card has 'Someone' written on it

low-level scenario C
Given there is a birthday card
and we are in refinement
when Someone writes their name on the birthday card
then the birthday card has 'Someone' written on it


*** Keywords ***
The first person writes their name on the birthday card
[Documentation] *model info*
... :IN: scenario.count = len(birthday_card.names)
... :OUT: Someone in birthday_card.names
Skip when unreachable
Should Contain ${names} Someone

Two more people write their name on the birthday card
[Documentation] *model info*
... :IN: scenario.count
... :OUT: len(birthday_card.names) == scenario.count+3
Skip when unreachable
Length should be ${names} ${2}

we are in refinement
[Documentation] Helper to prevent lower-level scenarios from being valid
... at the top-level. (Better for performance)
... *model info*
... :IN: scenario.count
... :OUT: None
No Operation

Expect failing suite processing
Run keyword and expect error Unable to compose* Treat this test suite Model-based
Set suite variable ${expected_error_detected} ${True}

Skip when unreachable
[Documentation]
... If the scenario is inserted after proper detection of the expected error,
... then this keyword causes the remainder of the scenario to be skipped and
... the test passes. When inserted without detected error, the scenario will
... fail.
IF ${expected_error_detected}
Pass execution Accepting intentionally unreachable scenario
END
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Suite Setup Treat this test suite Model-based
Resource ../../resources/birthday_cards_data_variation.resource
Library robotmbt


*** Test Cases ***
Background
Given Bahar is having their birthday
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Suite Setup Treat this test suite Model-based
Resource ../../resources/birthday_cards_data_variation.resource
Library robotmbt


*** Test Cases ***
Background
Given Bahar is having their birthday
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Suite Setup Treat this test suite Model-based
Resource ../../resources/birthday_cards_data_variation.resource
Library robotmbt


*** Test Cases ***
Background
Given Bahar is having their birthday
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
*** Settings ***
Documentation This suite uses refinement and equivalence partitioning. The high-level scenario
... requires just a single key example from the equivalence class and uses just one
... concrete example. This scenario is then refined by two more detailed examples
... that use 2 different actors with specific characters. One is concise, the other
... a bit more elaborate. This implies that for at least one set of examples the
... high-level scenario's example value does not match the low-level scenario's
... example value. They must however still be matched, and kept identical, under
... refinement.
... concrete example. This scenario can be refined by two more detailed examples
... that use 2 different actors. This implies that one refinement example will match
... the high-level scenario's example, the other does not. To complete the trace,
... the high-level scenario must be repeated, once with each possible refinement.
... The example values between the high- and low-level scenarios must be matched,
... and kept identical, under refinement.
Suite Setup Treat this test suite Model-based
Resource ../../resources/birthday_cards_data_variation.resource
Library robotmbt


*** Test Cases ***
Background
Given Bahar is having their birthday
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
*** Settings ***
Documentation This suite is an extension to the 'data fan out' suite, which needed refinement
... for just a single step. Here, the high-level scenario needs refinement in three
... of its steps. The background defines three actors and there are three refinement
... scenarios available. One for each actor. However, the high-level scenario only
... uses two of the actors, forcing the model to match up two of the steps and to
... never use the third option. The test fails if the model does not properly keep
... its data choices over all its steps when splitting the high-level scenario, and
... picks data independently in each step.
Suite Setup Treat this test suite Model-based
Resource ../../resources/birthday_cards_data_variation.resource
Library robotmbt


*** Test Cases ***
Background
Given Bahar is having their birthday
and Johan is a friend of Bahar
and Tannaz is a friend of Bahar
and Frederique is a friend of Bahar
When Johan buys a birthday card
then there is a blank birthday card available

A friend signs the birthday card
Given there is a birthday card
when Johan signs the birthday card
and Tannaz signs the birthday card
and Johan signs the birthday card again
then the birthday card has a personal touch
and the birthday card has 2 different names written on it

Signing the birthday card with your name only
Given there is a birthday card
and Johan is signing the birthday card
when Johan writes their name on the birthday card
then the birthday card has 'Johan' written on it

Signing the birthday card with: Happy birthday!
Given there is a birthday card
and Tannaz is signing the birthday card
when Tannaz writes their name on the birthday card
and Tannaz adds the wish 'Happy birthday!' to the birthday card
then the birthday card has 'Tannaz' written on it
and the birthday card proclaims: Happy birthday!

Signing the birthday card with: Cheers!
Given there is a birthday card
and Frederique is signing the birthday card
when Frederique writes their name on the birthday card
and Frederique adds the wish 'Cheers!' to the birthday card
then the birthday card has 'Frederique' written on it
and the birthday card proclaims: Cheers!


*** Keywords ***
${person} signs the birthday card again
[Documentation] Similar to '${person} signs the birthday card', but
... without the check that the name is not already on there.
...
... *model info*
... :MOD: ${person}= [guest for guest in party.guests]
... :IN: scenario.guest = ${person} | scenario.count = len(birthday_card.names)
... :OUT: len(birthday_card.names) == scenario.count+1
Should contain ${names} ${person}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Suite Setup Treat this test suite Model-based
Resource ../../resources/birthday_cards_data_variation.resource
Library robotmbt


*** Test Cases ***
Background
Given Johan is having their birthday
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Suite Setup Treat this test suite Model-based
Resource ../../resources/birthday_cards_data_variation.resource
Library robotmbt


*** Test Cases ***
Background
Given Bahar is having their birthday
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Documentation This test suite focuses on the initialisation of model data fr
Suite Setup Treat this test suite Model-based
Library robotmbt


*** Test Cases ***
Background
Given Bahar is throwing a party for their friends
Expand Down
Loading