[Refactor] ForceForeground setting condition is not used internally
Right now we are always forcing the SUT to the foreground without using the ForceForeground test.setting
https://github.com/TESTARtool/TESTAR_dev/blob/89e183a3ead682072d73097eee9d435abcbd06df/testar/src/org/fruit/monkey/DefaultProtocol.java#L1616
// If the system is in the background, we need to force it into the foreground!
// We set this.forceToForeground to true and selectAction will make sure that the next action we will select
// is putting the SUT back into the foreground.
if(!state.get(Tags.Foreground, true) && system.get(Tags.SystemActivator, null) != null){
this.forceToForeground = true;
return actions;
}
Add this setting as a condition or remove from ConfigTags if is not used.
// If the system is in the background, we need to force it into the foreground!
// We set this.forceToForeground to true and selectAction will make sure that the next action we will select
// is putting the SUT back into the foreground.
if(!state.get(Tags.Foreground, true) && system.get(Tags.SystemActivator, null) != null && settings.get(ConfigTags.ForceForeground, false)){
this.forceToForeground = true;
return actions;
}
To be considered, whether there is a use case when we don't want to bring the SUT to the foreground.
Also, another discussion is how force to foreground implementation works...
Refactor the ForceForeground ConfigTag to allow users to select how to put the system in the foreground. Also, take into consideration the different OS (Windows, MacOS, etc...)