1

I am using Appium + WebDriverIO to run E2E tests for a React Native app.

I have two capabilities. One for an Android emulator and one for an iOS simulator.

I would like each of these capabilities to run in parallel on the two separate emulators, but have my tests run individually.

The problem:

The capabilities do run in parallel, but so do all my tests. This is a big problem, because all the tests are fighting to control the same emulator at the same time, so they all end up failing.

If I only have one test "spec" file everything works fine.

I tried setting maxInstances: 2 in my wdio.conf.js file, but this results in the iOS capability running twice instead of splitting them between the two.

I don't think I'm doing anything out of the ordinary. This is the relevant part of my wdio.conf.js:

export const config = {
    capabilities: [
        // Android
        {
            platformName: "Android",
            automationName: "UiAutomator2",
            app: "./path/to/apk/app-debug.apk",
            deviceName: "Pixel_4_API_30",
            platformVersion: "11.0",
        },

        // iOS
        {
            platformName: "iOS",
            automationName: "XCUITest",
            deviceName: "iPhone 11",
            platformVersion: "13.5",
            app: "./path/to/app/My App Name.app",
        },
    ],

    maxInstances: 10, // This was the default generated by the CLI

    // ...
};

How can I prevent my tests from running in parallel while still allowing tests to run on both emulators in parallel?

twiz
  • 9,041
  • 8
  • 52
  • 84

0 Answers0