I am new to appium. I setup appium javascript client for iOS testing. I am trying to run my test on iOS emulator and it is not working. I don’t know what is wrong. Here is the error message:
platformName = ‘iOS’,
^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid shorthand property initializer
at new Script (vm.js:84:7)
at createScript (vm.js:264:10)
at Object.runInThisContext (vm.js:312:10)
at Module._compile (internal/modules/cjs/loader.js:694:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
at Module.load (internal/modules/cjs/loader.js:626:32)
at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
at Function.Module._load (internal/modules/cjs/loader.js:558:3)
at Module.require (internal/modules/cjs/loader.js:663:17)
at require (internal/modules/cjs/helpers.js:20:18)
Here is my code:
var webdriverio = require('webdriverio');
var expect = require ('chai').expect;
var config = require ('./helpers/desiredCapabilities').options;
var client = webdriverio.remote (config);
describe ('Simple cases', function (){
before (function (){
this.timeout(50000);
return client.init();
});
describe('test-app-addition', function (){
it('add-3-3', function(){
return client.element('~IntegerA')
.setValue ('3')
.elementByAccessibilityId ('~IntegerB')
.setValue('3')
.click('~ComputeSumButton')
.element('~Answer')
.getText()
.then(function (text){
expect(text).to.equal('6');
});
});
});
after(function(){
return client.end();
});
});
Here is my helper:
exports.options = {
desiredCapabilities: {
platformName = 'iOS',
platformVersion = '12.1',
//bundleid
app = '/Users/pat/Desktop/tests/sample-code/sample-code/apps/TestApp/build/Release-iphonesimulator/TestApp-iphonesimulator.app',
deviceName = 'iPhone X'
},
host: 'localhost',
port: 4723 //appium server port
};
Summary
Summary
This text will be hidden