testplane icon indicating copy to clipboard operation
testplane copied to clipboard

parallel execution Android and IOS config[HELP]

Open RollerIn opened this issue 3 years ago • 3 comments

Hello, can you share the config how can we make to work for parallel execution on android and iOS ?

Thanks

RollerIn avatar Dec 20 '21 09:12 RollerIn

Hello.

Are we talking about launching an android and iOS in an emulator using an appium? If yes, then for android you should use config like this:

// hermione.conf.js
module.exports = {
  // ...
  sessionsPerBrowser: 10, // run 10 browsers in parallel (will be used for all browsers or you can specify value for each browser)
  testsPerSession: 10, // run 10 tests in each browser session before close it
  sets: {
    touch: {
      files: './folder_with_your_tests/*.hermione.js',
      browsers: ['chrome-phone', 'safari13']
    }
  },
  browsers: {
    'chrome-phone': {
      desiredCapabilities: {
        platformName: 'Android',
        deviceName: 'android',
        browserVersion: 'YOUR_BROWSER_VERSION',
        browserName: 'chrome',
        automationName: 'UiAutomator1', // when starting android with UiAutomator2 it installs the required packages to the emulator and it can take 10-20 seconds. So you can use UiAutomator1 or preinstall required packages to your emulator itself
        skipDeviceInitialization: true
      },
      calibrate: true,
      compositeImage: true,
      screenshotDelay: 600,
      orientation: 'portrait',
      resetCursor: false
    }
};

For ios you should use config like this:

module.exports = {
  // ...
  sessionsPerBrowser: 10, // run 10 browsers in parallel (will be used for all browsers or you can specify value for each browser)
  testsPerSession: 10, // run 10 tests in each browser session before close it
  sets: {
    touch: {
      files: './folder_with_your_tests/*.hermione.js',
      browsers: ['chrome-phone', 'safari13']
    }
  },
  browsers: {
    'chrome-phone': {...},
    'safari13': {
      desiredCapabilities: {
        version: '13.0',
        browserName: 'safari',
        isHeadless: false,
        platformName: 'iOS',
        deviceOrientation: 'portrait'
        deviceName: 'iPhone 11',
        automationName: 'XCUITest'
      },
      orientation: 'portrait',
      calibrate: false,
      compositeImage: true,
      resetCursor: false,
      waitOrientationChange: false,
      sessionEnvFlags: { isW3C: false }, // can't work with w3c protocol - https://github.com/appium/appium-xcuitest-driver
    },
    plugins: {
      // ...
      'hermione-safari-commands': {
        enabled: true,
        browsers: {
          safari13: {
            commands: [
              'url',
              'click',
              'screenshot',
              'orientation',
              'swipe',
              'touch',
              'dragAndDrop',
              'deviceClickBack'
            ]
          }
        }
      }
    }
};

Tests in ios works only with plugin - https://github.com/gemini-testing/hermione-safari-commands. So you should install it.

DudaGod avatar Dec 20 '21 11:12 DudaGod

@DudaGod thank you for your response , will check it and let you know have one doubt, de we need to maintain any specific ports to run parallel sessions?

RollerIn avatar Dec 20 '21 15:12 RollerIn

de we need to maintain any specific ports to run parallel sessions?

no, you don't need it at all for hermione

sipayRT avatar Dec 27 '21 12:12 sipayRT