Small robustness improvements.

This commit is contained in:
Johannes Mockenhaupt 2017-11-24 23:03:34 +01:00
parent a95a00377b
commit 5e79900411
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
4 changed files with 4 additions and 3 deletions

View file

@ -219,7 +219,6 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
@Override @Override
public synchronized int setNewBasalProfile(Profile profile) { public synchronized int setNewBasalProfile(Profile profile) {
if (!isInitialized()) { if (!isInitialized()) {
log.error("setNewBasalProfile not initialized"); log.error("setNewBasalProfile not initialized");
Notification notification = new Notification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED, MainApp.sResources.getString(R.string.pumpNotInitializedProfileNotSet), Notification.URGENT); Notification notification = new Notification(Notification.PROFILE_NOT_SET_NOT_INITIALIZED, MainApp.sResources.getString(R.string.pumpNotInitializedProfileNotSet), Notification.URGENT);
@ -234,6 +233,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
MainApp.bus().post(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE)); MainApp.bus().post(new EventDismissNotification(Notification.FAILED_UDPATE_PROFILE));
return PumpInterface.NOT_NEEDED; return PumpInterface.NOT_NEEDED;
} }
CommandResult setResult = runCommand(MainApp.sResources.getString(R.string.combo_activity_setting_basal_profile), 2, CommandResult setResult = runCommand(MainApp.sResources.getString(R.string.combo_activity_setting_basal_profile), 2,
() -> ruffyScripter.setBasalProfile(requestedBasalProfile)); () -> ruffyScripter.setBasalProfile(requestedBasalProfile));
if (!setResult.success) { if (!setResult.success) {

View file

@ -16,6 +16,7 @@ public class ReadBasalProfileCommand extends BaseCommand {
@Override @Override
public void execute() { public void execute() {
scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU);
scripter.navigateToMenu(MenuType.BASAL_1_MENU); scripter.navigateToMenu(MenuType.BASAL_1_MENU);
scripter.verifyMenuIsDisplayed(MenuType.BASAL_1_MENU); scripter.verifyMenuIsDisplayed(MenuType.BASAL_1_MENU);
scripter.pressCheckKey(); scripter.pressCheckKey();

View file

@ -37,6 +37,7 @@ public class ReadHistoryCommand extends BaseCommand {
if (request.bolusHistory != PumpHistoryRequest.SKIP if (request.bolusHistory != PumpHistoryRequest.SKIP
|| request.tbrHistory != PumpHistoryRequest.SKIP || request.tbrHistory != PumpHistoryRequest.SKIP
|| request.pumpErrorHistory != PumpHistoryRequest.SKIP) { || request.pumpErrorHistory != PumpHistoryRequest.SKIP) {
scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU);
scripter.navigateToMenu(MenuType.MY_DATA_MENU); scripter.navigateToMenu(MenuType.MY_DATA_MENU);
scripter.verifyMenuIsDisplayed(MenuType.MY_DATA_MENU); scripter.verifyMenuIsDisplayed(MenuType.MY_DATA_MENU);
scripter.pressCheckKey(); scripter.pressCheckKey();

View file

@ -25,6 +25,7 @@ public class SetBasalProfileCommand extends BaseCommand {
@Override @Override
public void execute() { public void execute() {
scripter.verifyMenuIsDisplayed(MenuType.MAIN_MENU);
scripter.navigateToMenu(MenuType.BASAL_1_MENU); scripter.navigateToMenu(MenuType.BASAL_1_MENU);
scripter.verifyMenuIsDisplayed(MenuType.BASAL_1_MENU); scripter.verifyMenuIsDisplayed(MenuType.BASAL_1_MENU);
scripter.pressCheckKey(); scripter.pressCheckKey();
@ -66,8 +67,6 @@ public class SetBasalProfileCommand extends BaseCommand {
// confirm entered basal rate // confirm entered basal rate
scripter.pressCheckKey(); scripter.pressCheckKey();
scripter.returnToRootMenu();
scripter.verifyRootMenuIsDisplayed(); scripter.verifyRootMenuIsDisplayed();
result.success(true).basalProfile(basalProfile); result.success(true).basalProfile(basalProfile);