I am trying to write end to end test using two apps and one browser. Currently my code works with 1 app and 1 browser. However when i try to add two apps with one browser it is not able anything after setting up the environment for 2 apps and the browser i.e it opens both apps in a simulator and it opens the browser.
Here is my code:
wdio.ios.app.conf.js
require('@babel/register')
exports.config = {
runner: 'local',
//
specs: [
'./tests/specs/**/*.spec.js'
],
//
exclude: [
// 'path/to/excluded/files'
],
//
//
baseUrl: 'http://localhost:9174/',
capabilities: {
chromeBrowser: {
capabilities: {
browserName: 'chrome'
}
},
shopfloorApp: {
port: 4723,
capabilities: {
platformName: 'iOS',
'appium:deviceName': 'iPhone 8',
'appium:platformVersion': '12.4',
'appium:orientation': 'PORTRAIT',
'appium:noReset': true,
'appium:newCommandTimeout': 240,
"appium:platformName": "iOS",
"appium:deviceName": "iPhone 8",
"appium:bundleId": "com.xxx.debug",
}
},
consumerApp: {
port: 4724,
capabilities: {
platformName: 'iOS',
'appium:deviceName': 'iPhone 8',
'appium:platformVersion': '13.2',
'appium:orientation': 'PORTRAIT',
'appium:noReset': true,
'appium:newCommandTimeout': 240,
"appium:platformName": "iOS",
"appium:deviceName": "iPhone 8",
"appium:bundleId": "com.xxx.debug",
}
}
},
services: ['appium'],
/* appium: {
args: {
address: '127.0.0.1',
}
}, */
//
//logLevel: 'trace',
//
//deprecationWarnings: true,
//
//bail: 0,
//
waitforTimeout: 20000,
//
//connectionRetryTimeout: 90000,
//
//connectionRetryCount: 3,
//
services: ['selenium-standalone'],
//
framework: 'jasmine',
jasmineNodeOpts:
{
// Jasmine default timeout
defaultTimeoutInterval: 60000,
expectationResultHandler(passed, assertion)
{
// do something
},
}
//
//
}
here is my testfile:
```
import ClientScreen from '../screenobjects/client.screen';
import SearchScreen from '../screenobjects/search.screen';
import HomeScreen from '../screenobjects/home.screen';
import FormScreen from '../screenobjects/forms.screen';
import CommonPage from '../pageobjects/common.page';
describe('Sending the item to the mirror successfully,', () => {
beforeEach(() => {
CommonPage.login()
});
/* afterEach(() => {
CommonPage.logout()
}); */
it('should be able to send the item to the mirror', () => {
shopfloorApp.$(ClientScreen.clientTab).click();
shopfloorApp.$(ClientScreen.searchButon).click();
shopfloorApp.$(ClientScreen.searchButon).setValue('[email protected]')
CommonPage.hideKeyboard()
shopfloorApp.$(ClientScreen.customerlabelButton).click();
driver.pause(5000)
if (shopfloorApp.$(ClientScreen.assignmentButton).getText() == 'Assign to me'){
shopfloorApp.$(ClientScreen.assignmentButton).click();
};
driver.pause(8000)
shopfloorApp.$(ClientScreen.fittingRoomButton).touchAction('press')
shopfloorApp.$(ClientScreen.mirrorName).click();
shopfloorApp.$(ClientScreen.assignMirrorButton).click();
shopfloorApp.$(HomeScreen.productsearchButton).click();
driver.pause(3000)
shopfloorApp.$(SearchScreen.handbags).click();
driver.pause(3000)
shopfloorApp.$(SearchScreen.viewAll).click();
shopfloorApp.$(SearchScreen.actionListButton).click();
//chromeBrowser.url('http://localhost:9174/')
//shopfloorApp.$(FormScreen.alert).pressButton('Send to mirror');
});
});
```
Note that if i remove the consumerapp from the config file and stay with one app and one browser, it works great.