I'm trying to create a test setup hierarchy in robot framework.
I have a sub-suite, that defines its own Test Setup - but this overrides the parent suite's Test Setup.
I want both Test setups to run - one after the other, first the Parent Test Setup (that is defined in init.txt) and after that the Test setup that is defined using the * Settings * section.
You can achieve this kind of behavior at least with a bit of a hack way, by using set global variable, run keywords and an external resource file. This however requires you to define the test setup setting with a variable.
Example below:
Contents of __init__.txt:
*** Settings ***
Resource Resource.txt
Suite setup Set test setup variable
Test setup Test setup keyword
*** Keywords ***
Set test setup variable
Set global variable ${test setup variable} Test setup keyword
Contents of Resource.txt:
*** Keywords ***
Test setup keyword
Log Test setup from top level
Contents of Test_suite.txt:
*** Settings ***
Resource Resource.txt
Test setup Run keywords ${test setup variable} Test setup from test suite
*** Test cases ***
Test test setups
Log this should run two log keywords.
*** Keywords ***
Test setup from test suite
Log Test setup from test suite
I think this is the closest you can get.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With