TESTAR_dev icon indicating copy to clipboard operation
TESTAR_dev copied to clipboard

[Refactor] ForceForeground setting condition is not used internally

Open ferpasri opened this issue 4 years ago • 2 comments

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;
}

ferpasri avatar Oct 01 '21 11:10 ferpasri

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...

pekkakaho avatar May 24 '22 09:05 pekkakaho

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...)

ferpasri avatar Nov 14 '23 08:11 ferpasri