Repository: wix/Detox
Pull request #2575 (2021-01-06 15:01:20)

Improve Genymotion-Cloud logging in strategic places
## Description

Genymotion-cloud work tech debt (#2429): Improve logging in strategic places:
1. Report a URL to where a cloud instance can be logged-on to.
2. Be more descriptive when fetching recipes fails.

Also, move stuff around to make android driver helpers more organized.



Patch:
diff --git a/detox/src/devices/drivers/android/AndroidDeviceAllocation.js b/detox/src/devices/drivers/android/AndroidDeviceAllocation.js
index 73de51dc0..6c62d836e 100644
--- a/detox/src/devices/drivers/android/AndroidDeviceAllocation.js
+++ b/detox/src/devices/drivers/android/AndroidDeviceAllocation.js
@@ -28,4 +28,6 @@ class AndroidDeviceAllocation {
   }
 }
 
+AndroidDeviceAllocation.ALLOCATE_DEVICE_LOG_EVT = ALLOCATE_DEVICE_LOG_EVT;
+
 module.exports = AndroidDeviceAllocation;
diff --git a/detox/src/devices/drivers/android/emulator/EmulatorDriver.js b/detox/src/devices/drivers/android/emulator/EmulatorDriver.js
index c9f76c298..72ffd86e3 100644
--- a/detox/src/devices/drivers/android/emulator/EmulatorDriver.js
+++ b/detox/src/devices/drivers/android/emulator/EmulatorDriver.js
@@ -3,7 +3,7 @@ const fs = require('fs');
 const path = require('path');
 const ini = require('ini');
 const AndroidDriver = require('../AndroidDriver');
-const EmulatorDeviceAllocation = require('./EmulatorDeviceAllocation');
+const EmulatorDeviceAllocation = require('./helpers/EmulatorDeviceAllocation');
 const AVDValidator = require('./AVDValidator');
 const AVDsResolver = require('./AVDsResolver');
 const EmulatorLauncher = require('./EmulatorLauncher');
diff --git a/detox/src/devices/drivers/android/emulator/EmulatorDeviceAllocation.js b/detox/src/devices/drivers/android/emulator/helpers/EmulatorDeviceAllocation.js
similarity index 86%
rename from detox/src/devices/drivers/android/emulator/EmulatorDeviceAllocation.js
rename to detox/src/devices/drivers/android/emulator/helpers/EmulatorDeviceAllocation.js
index 04402acfd..6d7333f3e 100644
--- a/detox/src/devices/drivers/android/emulator/EmulatorDeviceAllocation.js
+++ b/detox/src/devices/drivers/android/emulator/helpers/EmulatorDeviceAllocation.js
@@ -1,10 +1,10 @@
 const _ = require('lodash');
-const AndroidDeviceAllocation  = require('../AndroidDeviceAllocation');
-const DetoxRuntimeError = require('../../../../errors/DetoxRuntimeError');
-const EmulatorTelnet = require('../tools/EmulatorTelnet');
-const logger = require('../../../../utils/logger').child({ __filename });
-const retry = require('../../../../utils/retry');
-const { traceCall } = require('../../../../utils/trace');
+const AndroidDeviceAllocation  = require('../../AndroidDeviceAllocation');
+const DetoxRuntimeError = require('../../../../../errors/DetoxRuntimeError');
+const EmulatorTelnet = require('../../tools/EmulatorTelnet');
+const logger = require('../../../../../utils/logger').child({ __filename });
+const retry = require('../../../../../utils/retry');
+const { traceCall } = require('../../../../../utils/trace');
 
 const DetoxEmulatorsPortRange = {
   min: 10000,
diff --git a/detox/src/devices/drivers/android/genycloud/GenyCloudDriver.js b/detox/src/devices/drivers/android/genycloud/GenyCloudDriver.js
index 6abc28b39..7f1ce25d4 100644
--- a/detox/src/devices/drivers/android/genycloud/GenyCloudDriver.js
+++ b/detox/src/devices/drivers/android/genycloud/GenyCloudDriver.js
@@ -1,7 +1,7 @@
 const semver = require('semver'); // eslint-disable-line node/no-extraneous-require
 const onSignalExit = require('signal-exit');
 const AndroidDriver = require('../AndroidDriver');
-const GenyCloudInstanceAllocation = require('./GenyCloudInstanceAllocation');
+const GenyCloudInstanceAllocation = require('./helpers/GenyCloudInstanceAllocation');
 const GenyDeviceRegistryFactory = require('./GenyDeviceRegistryFactory');
 const GenyCloudExec = require('./exec/GenyCloudExec');
 const RecipesService = require('./services/GenyRecipesService');
@@ -9,7 +9,7 @@ const InstanceLookupService = require('./services/GenyInstanceLookupService');
 const InstanceLifecycleService = require('./services/GenyInstanceLifecycleService');
 const InstanceNaming = require('./services/GenyInstanceNaming');
 const AuthService = require('./services/GenyAuthService');
-const DeviceQueryHelper = require('./helpers/GenyDeviceQueryHelper');
+const RecipeQuerying = require('./helpers/GenyRecipeQuerying');
 const DetoxRuntimeError = require('../../../../errors/DetoxRuntimeError');
 const logger = require('../../../../utils/logger').child({ __filename });
 const environment = require('../../../../utils/environment');
@@ -32,7 +32,7 @@ class GenyCloudDriver extends AndroidDriver {
     const recipeService = new RecipesService(this._exec, logger);
     const instanceLookupService = new InstanceLookupService(this._exec, instanceNaming, this._deviceRegistry);
     this._instanceLifecycleService = new InstanceLifecycleService(this._exec, instanceNaming);
-    this._deviceQueryHelper = new DeviceQueryHelper(recipeService);
+    this._recipeQuerying = new RecipeQuerying(recipeService);
     this._instanceAllocation = new GenyCloudInstanceAllocation(this._deviceRegistry, this._deviceCleanupRegistry, instanceLookupService, this._instanceLifecycleService, this.emitter);
 
     this._authService = new AuthService(this._exec);
@@ -48,7 +48,7 @@ class GenyCloudDriver extends AndroidDriver {
   }
 
   async acquireFreeDevice(deviceQuery) {
-    const recipe = await this._deviceQueryHelper.getRecipeFromQuery(deviceQuery);
+    const recipe = await this._recipeQuerying.getRecipeFromQuery(deviceQuery);
     this._assertRecipe(deviceQuery, recipe);
 
     const instance = await this._instanceAllocation.allocateDevice(recipe);
@@ -80,8 +80,8 @@ class GenyCloudDriver extends AndroidDriver {
   _assertRecipe(deviceQuery, recipe) {
     if (!recipe) {
       throw new DetoxRuntimeError({
-        message: 'No Genycloud devices found for recipe!',
-        hint: `Check that your Genycloud account has a template associated with your Detox device configuration: ${JSON.stringify(deviceQuery)}\n`,
+        message: `No Genymotion-Cloud template found to match the configured lookup query: ${JSON.stringify(deviceQuery)}`,
+        hint: `Revisit your detox configuration. Genymotion templates list is available at: https://cloud.geny.io/app/shared-devices`,
       });
     }
   }
diff --git a/detox/src/devices/drivers/android/genycloud/GenyCloudInstanceAllocation.js b/detox/src/devices/drivers/android/genycloud/helpers/GenyCloudInstanceAllocation.js
similarity index 80%
rename from detox/src/devices/drivers/android/genycloud/GenyCloudInstanceAllocation.js
rename to detox/src/devices/drivers/android/genycloud/helpers/GenyCloudInstanceAllocation.js
index c9836ea67..c40b427a8 100644
--- a/detox/src/devices/drivers/android/genycloud/GenyCloudInstanceAllocation.js
+++ b/detox/src/devices/drivers/android/genycloud/helpers/GenyCloudInstanceAllocation.js
@@ -1,7 +1,9 @@
-const AndroidDeviceAllocation = require('../AndroidDeviceAllocation');
-const GenyCloudInstanceHandle = require('./GenyCloudInstanceHandle');
-const retry = require('../../../../utils/retry');
-const logger = require('../../../../utils/logger').child({ __filename });
+const AndroidDeviceAllocation = require('../../AndroidDeviceAllocation');
+const GenyCloudInstanceHandle = require('../GenyCloudInstanceHandle');
+const retry = require('../../../../../utils/retry');
+const logger = require('../../../../../utils/logger').child({ __filename });
+
+const { ALLOCATE_DEVICE_LOG_EVT } = AndroidDeviceAllocation;
 
 class GenyCloudInstanceAllocation extends AndroidDeviceAllocation {
   constructor(deviceRegistry, deviceCleanupRegistry, instanceLookupService, instanceLifecycleService, eventEmitter) {
@@ -83,6 +85,10 @@ class GenyCloudInstanceAllocation extends AndroidDeviceAllocation {
     }
     return instance;
   }
+
+  _logAllocationResult(deviceQuery, deviceHandle) {
+    logger.info({ event: ALLOCATE_DEVICE_LOG_EVT }, `Allocating Genymotion-Cloud instance ${deviceHandle.name} for testing. To access it via a browser, go to: https://cloud.geny.io/app/instance/${deviceHandle.uuid}`);
+  }
 }
 
 module.exports = GenyCloudInstanceAllocation;
diff --git a/detox/src/devices/drivers/android/genycloud/helpers/GenyDeviceQueryHelper.js b/detox/src/devices/drivers/android/genycloud/helpers/GenyDeviceQueryHelper.js
deleted file mode 100644
index 9272ccf63..000000000
--- a/detox/src/devices/drivers/android/genycloud/helpers/GenyDeviceQueryHelper.js
+++ /dev/null
@@ -1,17 +0,0 @@
-const _ = require('lodash');
-
-class GenyDeviceQueryHelper {
-  constructor(recipesService) {
-    this.recipesService = recipesService;
-  }
-
-  async getRecipeFromQuery(deviceQuery) {
-    const deviceObj = _.isPlainObject(deviceQuery) ? deviceQuery : { recipeName: deviceQuery }
-    if (deviceObj.recipeUUID) {
-      return this.recipesService.getRecipeByUUID(deviceObj.recipeUUID);
-    }
-    return this.recipesService.getRecipeByName(deviceObj.recipeName);
-  }
-}
-
-module.exports = GenyDeviceQueryHelper;
diff --git a/detox/src/devices/drivers/android/genycloud/helpers/GenyRecipeQuerying.js b/detox/src/devices/drivers/android/genycloud/helpers/GenyRecipeQuerying.js
new file mode 100644
index 000000000..981fe1147
--- /dev/null
+++ b/detox/src/devices/drivers/android/genycloud/helpers/GenyRecipeQuerying.js
@@ -0,0 +1,17 @@
+const _ = require('lodash');
+
+class GenyRecipeQuerying {
+  constructor(recipesService) {
+    this.recipesService = recipesService;
+  }
+
+  async getRecipeFromQuery(deviceQuery) {
+    const queryObj = _.isPlainObject(deviceQuery) ? deviceQuery : { recipeName: deviceQuery };
+    if (queryObj.recipeUUID) {
+      return this.recipesService.getRecipeByUUID(queryObj.recipeUUID);
+    }
+    return this.recipesService.getRecipeByName(queryObj.recipeName);
+  }
+}
+
+module.exports = GenyRecipeQuerying;
diff --git a/detox/src/devices/drivers/android/genycloud/services/GenyRecipesService.js b/detox/src/devices/drivers/android/genycloud/services/GenyRecipesService.js
index e71f4ddf5..5beff6764 100644
--- a/detox/src/devices/drivers/android/genycloud/services/GenyRecipesService.js
+++ b/detox/src/devices/drivers/android/genycloud/services/GenyRecipesService.js
@@ -7,14 +7,17 @@ class GenyRecipesService {
   }
 
   async getRecipeByName(recipeName) {
-    const result = await this.genyCloudExec.getRecipe(recipeName);
-    const { recipes } = result;
+    const { recipes } = await this.genyCloudExec.getRecipe(recipeName);
     if (!recipes.length) {
       return null;
     }
 
     if (recipes.length > 1) {
-      this.logger.warn({ event: 'GENYCLOUD_RECIPE_LOOKUP'}, `More than one Genymotion-Cloud recipe found for recipe name ${recipeName}`);
+      const recipesInfoList = recipes.map((recipe) => `  ${recipe.name} (${recipe.uuid})`).join('\n');
+      this.logger.warn(
+        { event: 'GENYCLOUD_RECIPE_LOOKUP'},
+        `More than one Genymotion-Cloud recipe found for recipe name ${recipeName}:\n${recipesInfoList}\nFalling back to ${recipes[0].name}`
+      );
     }
     return new Recipe(recipes[0]);
   }


Test patch:
diff --git a/detox/src/devices/drivers/android/emulator/EmulatorDeviceAllocation.test.js b/detox/src/devices/drivers/android/emulator/helpers/EmulatorDeviceAllocation.test.js
similarity index 92%
rename from detox/src/devices/drivers/android/emulator/EmulatorDeviceAllocation.test.js
rename to detox/src/devices/drivers/android/emulator/helpers/EmulatorDeviceAllocation.test.js
index 9d7b592a7..d0b5f4888 100644
--- a/detox/src/devices/drivers/android/emulator/EmulatorDeviceAllocation.test.js
+++ b/detox/src/devices/drivers/android/emulator/helpers/EmulatorDeviceAllocation.test.js
@@ -13,37 +13,37 @@ describe('Android emulator device allocation', () => {
   let emulatorTelnet;
   let uut;
   beforeEach(() => {
-    jest.mock('../../../../utils/logger');
-    logger = require('../../../../utils/logger');
+    jest.mock('../../../../../utils/logger');
+    logger = require('../../../../../utils/logger');
 
-    jest.mock('../../../../utils/retry');
-    retry = require('../../../../utils/retry');
+    jest.mock('../../../../../utils/retry');
+    retry = require('../../../../../utils/retry');
     retry.mockImplementation((options, func) => func());
 
-    const EmulatorLauncher = jest.genMockFromModule('./EmulatorLauncher');
+    const EmulatorLauncher = jest.genMockFromModule('../EmulatorLauncher');
     emulatorLauncher = new EmulatorLauncher();
 
-    const AsyncEmitter = jest.genMockFromModule('../../../../utils/AsyncEmitter');
+    const AsyncEmitter = jest.genMockFromModule('../../../../../utils/AsyncEmitter');
     eventEmitter = new AsyncEmitter();
 
-    const DeviceRegistry = jest.genMockFromModule('../../../../devices/DeviceRegistry');
+    const DeviceRegistry = jest.genMockFromModule('../../../../../devices/DeviceRegistry');
     deviceRegistry = new DeviceRegistry();
     deviceRegistry.allocateDevice.mockImplementation((func) => func());
 
-    const FreeDeviceFinder = jest.genMockFromModule('./FreeEmulatorFinder');
+    const FreeDeviceFinder = jest.genMockFromModule('../FreeEmulatorFinder');
     freeDeviceFinder = new FreeDeviceFinder();
 
-    const ADB = jest.genMockFromModule('../exec/ADB');
+    const ADB = jest.genMockFromModule('../../exec/ADB');
     adb = new ADB();
     adb.isBootComplete.mockResolvedValue(true);
 
-    const EmulatorTelnet = jest.genMockFromModule('../tools/EmulatorTelnet');
+    const EmulatorTelnet = jest.genMockFromModule('../../tools/EmulatorTelnet');
     emulatorTelnet = new EmulatorTelnet();
-    jest.mock('../tools/EmulatorTelnet');
+    jest.mock('../../tools/EmulatorTelnet');
 
     randomFunc = jest.fn().mockReturnValue(1);
 
-    jest.mock('../../../../utils/trace', () => ({
+    jest.mock('../../../../../utils/trace', () => ({
       traceCall: jest.fn().mockImplementation((__, func) => func()),
     }));
 
diff --git a/detox/src/devices/drivers/android/genycloud/GenyCloudDriver.test.js b/detox/src/devices/drivers/android/genycloud/GenyCloudDriver.test.js
index ef289b8f2..1101b19bd 100644
--- a/detox/src/devices/drivers/android/genycloud/GenyCloudDriver.test.js
+++ b/detox/src/devices/drivers/android/genycloud/GenyCloudDriver.test.js
@@ -40,7 +40,7 @@ describe('Genymotion-cloud driver', () => {
   let adbObj;
   let Exec;
   let execObj;
-  let deviceQueryHelper;
+  let recipeQuerying;
   let deviceRegistry;
   let deviceCleanupRegistry;
   let instanceAllocation;
@@ -74,12 +74,12 @@ describe('Genymotion-cloud driver', () => {
     deviceCleanupRegistry = new DeviceRegistry();
     GenyDeviceRegistryFactory.forGlobalShutdown.mockReturnValue(deviceCleanupRegistry);
 
-    jest.mock('./helpers/GenyDeviceQueryHelper');
-    const DeviceQueryHelper = require('./helpers/GenyDeviceQueryHelper');
-    deviceQueryHelper = () => latestInstanceOf(DeviceQueryHelper);
+    jest.mock('./helpers/GenyRecipeQuerying');
+    const GenyRecipeQuerying = require('./helpers/GenyRecipeQuerying');
+    recipeQuerying = () => latestInstanceOf(GenyRecipeQuerying);
 
-    jest.mock('./GenyCloudInstanceAllocation');
-    const InstanceAllocation = require('./GenyCloudInstanceAllocation');
+    jest.mock('./helpers/GenyCloudInstanceAllocation');
+    const InstanceAllocation = require('./helpers/GenyCloudInstanceAllocation');
     instanceAllocation = () => latestInstanceOf(InstanceAllocation);
 
     const AuthService = require('./services/GenyAuthService');
@@ -181,8 +181,8 @@ describe('Genymotion-cloud driver', () => {
     });
 
     describe('device (instance) allocation', () => {
-      const givenNoRecipes = () => deviceQueryHelper().getRecipeFromQuery.mockResolvedValue(null);
-      const givenResolvedRecipeForQuery = (recipe) => deviceQueryHelper().getRecipeFromQuery.mockResolvedValue(recipe);
+      const givenNoRecipes = () => recipeQuerying().getRecipeFromQuery.mockResolvedValue(null);
+      const givenResolvedRecipeForQuery = (recipe) => recipeQuerying().getRecipeFromQuery.mockResolvedValue(recipe);
       const givenDeviceAllocationResult = (instance) => instanceAllocation().allocateDevice.mockResolvedValue(instance);
 
       it('should get a recipe and allocate a device', async () => {
@@ -198,7 +198,7 @@ describe('Genymotion-cloud driver', () => {
           adbName: instance.adbName,
           uuid: instance.uuid,
         }));
-        expect(deviceQueryHelper().getRecipeFromQuery).toHaveBeenCalledWith(deviceQuery);
+        expect(recipeQuerying().getRecipeFromQuery).toHaveBeenCalledWith(deviceQuery);
         expect(instanceAllocation().allocateDevice).toHaveBeenCalledWith(recipe);
       });
 
@@ -211,8 +211,10 @@ describe('Genymotion-cloud driver', () => {
           await uut.acquireFreeDevice(deviceQuery);
           fail('Expected an error');
         } catch (e) {
-          expect(e.toString()).toContain('No Genycloud devices found for recipe!');
-          expect(e.toString()).toContain('HINT: Check that your Genycloud account has a template associated with your Detox device configuration: ' + JSON.stringify(deviceQuery));
+          expect(e.toString()).toContain('No Genymotion-Cloud template found to match the configured lookup query');
+          expect(e.toString()).toContain(JSON.stringify(deviceQuery));
+          expect(e.toString()).toContain('HINT: Revisit your detox configuration');
+          expect(e.toString()).toContain('https://cloud.geny.io/app/shared-devices');
         }
       });
 
diff --git a/detox/src/devices/drivers/android/genycloud/GenyCloudInstanceAllocation.test.js b/detox/src/devices/drivers/android/genycloud/helpers/GenyCloudInstanceAllocation.test.js
similarity index 91%
rename from detox/src/devices/drivers/android/genycloud/GenyCloudInstanceAllocation.test.js
rename to detox/src/devices/drivers/android/genycloud/helpers/GenyCloudInstanceAllocation.test.js
index cd3693a1e..c4321f7c0 100644
--- a/detox/src/devices/drivers/android/genycloud/GenyCloudInstanceAllocation.test.js
+++ b/detox/src/devices/drivers/android/genycloud/helpers/GenyCloudInstanceAllocation.test.js
@@ -12,28 +12,28 @@ describe('Genymotion-Cloud instance allocation', () => {
   let GenyInstance;
   let uut;
   beforeEach(() => {
-    jest.mock('../../../../utils/logger');
-    logger = require('../../../../utils/logger');
+    jest.mock('../../../../../utils/logger');
+    logger = require('../../../../../utils/logger');
 
-    jest.mock('../../../../utils/retry');
-    retry = require('../../../../utils/retry');
+    jest.mock('../../../../../utils/retry');
+    retry = require('../../../../../utils/retry');
     retry.mockImplementation((options, func) => func());
 
-    const AsyncEmitter = jest.genMockFromModule('../../../../utils/AsyncEmitter');
+    const AsyncEmitter = jest.genMockFromModule('../../../../../utils/AsyncEmitter');
     eventEmitter = new AsyncEmitter();
 
-    const DeviceRegistry = jest.genMockFromModule('../../../../devices/DeviceRegistry');
+    const DeviceRegistry = jest.genMockFromModule('../../../../../devices/DeviceRegistry');
     deviceRegistry = new DeviceRegistry();
     deviceRegistry.allocateDevice.mockImplementation((func) => func());
     deviceCleanupRegistry = new DeviceRegistry();
 
-    const InstanceLookupService = jest.genMockFromModule('./services/GenyInstanceLookupService');
+    const InstanceLookupService = jest.genMockFromModule('../services/GenyInstanceLookupService');
     instanceLookupService = new InstanceLookupService();
 
-    const InstanceLifecycleService = jest.genMockFromModule('./services/GenyInstanceLifecycleService');
+    const InstanceLifecycleService = jest.genMockFromModule('../services/GenyInstanceLifecycleService');
     instanceLifecycleService = new InstanceLifecycleService();
 
-    GenyInstance = jest.genMockFromModule('./services/dto/GenyInstance');
+    GenyInstance = jest.genMockFromModule('../services/dto/GenyInstance');
 
     const InstanceAllocation = require('./GenyCloudInstanceAllocation');
     uut = new InstanceAllocation(deviceRegistry, deviceCleanupRegistry, instanceLookupService, instanceLifecycleService, eventEmitter);
@@ -247,10 +247,12 @@ describe('Genymotion-Cloud instance allocation', () => {
     });
 
     it('should log post-allocate message', async () => {
-      givenFreeInstance(aFullyConnectedInstance());
+      const instance = aFullyConnectedInstance();
+      givenFreeInstance(instance);
+
       await uut.allocateDevice(aRecipe());
-      expect(logger.debug).toHaveBeenCalledWith({ event: 'ALLOCATE_DEVICE' }, expect.stringContaining(`Settled on mock-instance-toString()`));
-      expect(logger.debug).toHaveBeenCalledTimes(2);
+
+      expect(logger.info).toHaveBeenCalledWith({ event: 'ALLOCATE_DEVICE' }, `Allocating Genymotion-Cloud instance ${instance.name} for testing. To access it via a browser, go to: https://cloud.geny.io/app/instance/${instance.uuid}`);
     });
 
     it('should emit a boot-device event for an existing instance', async () => {
@@ -293,9 +295,10 @@ describe('Genymotion-Cloud instance allocation', () => {
       eventEmitter.emit.mockRejectedValue(new Error());
 
       try {
-        await uut.allocateDevice(aRecipe);
+        await uut.allocateDevice(aRecipe());
+        fail('Expected an error');
       } catch(e) {
-        expect(logger.debug).toHaveBeenCalledTimes(2);
+        expect(eventEmitter.emit).toHaveBeenCalledTimes(1);
       }
     });
   });
diff --git a/detox/src/devices/drivers/android/genycloud/helpers/GenyDeviceQueryHelper.test.js b/detox/src/devices/drivers/android/genycloud/helpers/GenyRecipeQuerying.test.js
similarity index 94%
rename from detox/src/devices/drivers/android/genycloud/helpers/GenyDeviceQueryHelper.test.js
rename to detox/src/devices/drivers/android/genycloud/helpers/GenyRecipeQuerying.test.js
index 64480d9af..d87954002 100644
--- a/detox/src/devices/drivers/android/genycloud/helpers/GenyDeviceQueryHelper.test.js
+++ b/detox/src/devices/drivers/android/genycloud/helpers/GenyRecipeQuerying.test.js
@@ -1,4 +1,4 @@
-describe('Genymotion-cloud device-query helper', () => {
+describe('Genymotion-cloud recipe-query helper', () => {
 
   let recipesService;
   let uut;
@@ -6,7 +6,7 @@ describe('Genymotion-cloud device-query helper', () => {
     const RecipesService = jest.genMockFromModule('../services/GenyRecipesService');
     recipesService = new RecipesService();
 
-    const DeviceQueryHelper = require('./GenyDeviceQueryHelper');
+    const DeviceQueryHelper = require('./GenyRecipeQuerying');
     uut = new DeviceQueryHelper(recipesService);
   });
 
diff --git a/detox/src/devices/drivers/android/genycloud/services/GenyRecipesService.test.js b/detox/src/devices/drivers/android/genycloud/services/GenyRecipesService.test.js
index d768827fb..0d5da2a10 100644
--- a/detox/src/devices/drivers/android/genycloud/services/GenyRecipesService.test.js
+++ b/detox/src/devices/drivers/android/genycloud/services/GenyRecipesService.test.js
@@ -66,7 +66,12 @@ describe('Genymotion-Cloud recipes service', () => {
 
       expect(logger.warn).toHaveBeenCalledWith(
         { event: 'GENYCLOUD_RECIPE_LOOKUP' },
-        `More than one Genymotion-Cloud recipe found for recipe name ${recipe.name}`,
+        [
+          `More than one Genymotion-Cloud recipe found for recipe name ${recipe.name}:`,
+          `  ${recipe.name} (${recipe.uuid})`,
+          `  ${recipe2.name} (${recipe2.uuid})`,
+          `Falling back to ${recipe.name}`,
+        ].join('\n'),
       );
     });