Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/desired-caps.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ let desiredCapConstraints = _.defaults({
screenshotQuality: {
isNumber: true
},
skipLogCapture: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary if the desired capability is specified in appium-ios-driver.

Copy link
Member Author

@KazuCocoa KazuCocoa Feb 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove here after appium-boneyard/appium-ios-driver#355 and publish new version.
(In this PR or as another PR)

isBoolean: true
},
}, iosDesiredCapConstraints);

export { desiredCapConstraints };
Expand Down
6 changes: 6 additions & 0 deletions lib/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ class XCUITestDriver extends BaseDriver {
];
this.resetIos();
this.settings = new DeviceSettings(DEFAULT_SETTINGS, this.onSettingsUpdate.bind(this));
this.logs = {};

// memoize functions here, so that they are done on a per-instance basis
for (const fn of MEMOIZED_FUNCTIONS) {
Expand Down Expand Up @@ -334,6 +335,11 @@ class XCUITestDriver extends BaseDriver {
await this.runReset();

const startLogCapture = async () => {
if (this.opts.skipLogCapture) {
log.info("'skipLogCapture' is set. Skipping starting logs such as crash, system, safari console and safari network.");
return false;
}

const result = await this.startLogCapture();
if (result) {
this.logEvent('logCaptureStarted');
Expand Down
17 changes: 17 additions & 0 deletions test/unit/driver-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,23 @@ describe('driver commands', function () {
const resCaps = await driver.createSession(caps);
resCaps[1].javascriptEnabled.should.be.true;
});

it('should call startLogCapture', async function () {
const c = { ... caps };
Object.assign(c, {skipLogCapture: false});
this.timeout(MOCHA_LONG_TIMEOUT);
const resCaps = await driver.createSession(c);
resCaps[1].javascriptEnabled.should.be.true;
driver.startLogCapture.called.should.be.true;
});
it('should not call startLogCapture', async function () {
const c = { ... caps };
Object.assign(c, {skipLogCapture: true});
this.timeout(MOCHA_LONG_TIMEOUT);
const resCaps = await driver.createSession(c);
resCaps[1].javascriptEnabled.should.be.true;
driver.startLogCapture.called.should.be.false;
});
});

describe('startIWDP()', function () {
Expand Down