Optimizing our mobile automation framework
Let us now look at a couple of ways to optimize our framework. The ability to switch between Android and iOS tests without manually changing the configuration each time is a useful addition to our test framework. This can be easily achieved in WebdriverIO by separating out the wdio.conf.js files for these platforms. Figure 6.17 shows the setup of a config folder with respective config files:

Figure 6.17 – WebdriverIO config file setup
Each of the config files for the platforms will contain platform-specific information, as shown in Figures 6.18 and 6.19. The corresponding sections should be removed from the shared config file:

Figure 6.18 – WebdriverIO Android config file
The Android config file holds the path where the Android tests live and their platform-specific capabilities:

Figure 6.19 – WebdriverIO iOS config file
The iOS config...