Skip to content

Commit

Permalink
feat: remove iwdp related capabilities, objects (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa committed Jul 31, 2019
1 parent 2ff09f9 commit 8b44fcc
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 94 deletions.
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -164,8 +164,6 @@ Differences are noted here:
|`commandTimeouts`|Custom timeout(s) in milliseconds for WDA backend commands execution. This might be useful if WDA backend freezes unexpectedly or requires too much time to fail and blocks automated test execution. The value is expected to be of type string and can either contain max milliseconds to wait for each WDA command to be executed before terminating the session forcefully or a valid JSON string, where keys are internal Appium command names (you can find these in logs, look for "Executing command 'command_name'" records) and values are timeouts in milliseconds. You can also set the 'default' key to assign the timeout for all other commands not explicitly enumerated as JSON keys.|`'120000'`, `'{"findElement": 40000, "findElements": 40000, "setValue": 20000, "default": 120000}'`|
|`maxTypingFrequency`|Maximum frequency of keystrokes for typing and clear. If your tests are failing because of typing errors, you may want to adjust this. Defaults to 60 keystrokes per minute.|e.g., `30`|
|`simpleIsVisibleCheck`|Use native methods for determining visibility of elements. In some cases this takes a long time. Setting this capability to `false` will cause the system to use the position and size of elements to make sure they are visible on the screen. This can, however, lead to false results in some situations. Defaults to `false`, except iOS 9.3, where it defaults to `true`.|e.g., `true`, `false`|
|`startIWDP`|Set this to `true` if you want to start ios_webkit_debug proxy server automatically for accessing webviews on iOS. The capatibility only works for real device automation. Defaults to `false`.|e.g., `true`|
|`webkitDebugProxyPort`|Local port number used for communication with ios-webkit-debug-proxy. Only relevant for real devices. The default value equals to `27753`.|e.g. `20000`|
|`absoluteWebLocations`|This capability will direct the `Get Element Location` command, when used within webviews, to return coordinates which are relative to the origin of the page, rather than relative to the current scroll offset. This capability has no effect outside of webviews. Default `false`.|e.g., `true`|
|`useJSONSource`|Get JSON source from WDA and parse into XML on Appium server. This can be much faster, especially on large devices. Defaults to `false`.|e.g., `true`|
|`realDeviceScreenshotter`|Name of the alternative screenshot system to use for real devices. Defaults to the XCUITest screenshot functionality through WebDriverAgent. Possible value is `idevicescreenshot` to use the screenshot program from libimobiledevice.|e.g., `idevicescreenshot`|
Expand Down
3 changes: 0 additions & 3 deletions lib/desired-caps.js
Expand Up @@ -96,9 +96,6 @@ let desiredCapConstraints = _.defaults({
calendarAccessAuthorized: {
isBoolean: true
},
startIWDP: {
isBoolean: true,
},
useSimpleBuildTest: {
isBoolean: true
},
Expand Down
33 changes: 1 addition & 32 deletions lib/driver.js
Expand Up @@ -10,7 +10,7 @@ import {
shutdownOtherSimulators, shutdownSimulator } from './simulator-management';
import { simExists, getSimulator, installSSLCert, hasSSLCert } from 'appium-ios-simulator';
import { retryInterval, retry } from 'asyncbox';
import { settings as iosSettings, defaultServerCaps, appUtils, IWDP } from 'appium-ios-driver';
import { settings as iosSettings, defaultServerCaps, appUtils } from 'appium-ios-driver';
import { desiredCapConstraints, PLATFORM_NAME_IOS, PLATFORM_NAME_TVOS } from './desired-caps';
import commands from './commands/index';
import {
Expand Down Expand Up @@ -439,15 +439,6 @@ class XCUITestDriver extends BaseDriver {
await openUrl(this.opts.device.udid, this._currentUrl);
}

if (this.isRealDevice() && this.opts.startIWDP) {
try {
await this.startIWDP();
log.debug(`Started ios_webkit_debug proxy server at: ${this.iwdpServer.endpoint}`);
} catch (err) {
log.errorAndThrow(`Could not start ios_webkit_debug_proxy server: ${err.message}`);
}
}

if (this.isSafari() || this.opts.autoWebview) {
log.debug('Waiting for initial webview');
await this.navToInitialWebview();
Expand Down Expand Up @@ -646,10 +637,6 @@ class XCUITestDriver extends BaseDriver {
this.logs = {};
}

if (this.iwdpServer) {
await this.stopIWDP();
}

if (this.opts.enableAsyncExecuteFromHttps && !this.isRealDevice()) {
await this.stopHttpsAsyncServer();
}
Expand Down Expand Up @@ -1195,24 +1182,6 @@ class XCUITestDriver extends BaseDriver {
this.wdaCaps.capabilities, this.deviceCaps);
}

async startIWDP () {
this.logEvent('iwdpStarting');
this.iwdpServer = new IWDP({
webkitDebugProxyPort: this.opts.webkitDebugProxyPort,
udid: this.opts.udid,
logStdout: !!this.opts.showIWDPLog,
});
await this.iwdpServer.start();
this.logEvent('iwdpStarted');
}

async stopIWDP () {
if (this.iwdpServer) {
await this.iwdpServer.stop();
delete this.iwdpServer;
}
}

async reset () {
if (this.opts.noReset) {
// This is to make sure reset happens even if noReset is set to true
Expand Down
39 changes: 0 additions & 39 deletions test/functional/basic/iwdp-e2e-specs.js

This file was deleted.

18 changes: 0 additions & 18 deletions test/unit/driver-specs.js
Expand Up @@ -119,24 +119,6 @@ describe('driver commands', function () {
driver.startLogCapture.called.should.be.false;
});
});

describe('startIWDP()', function () {
let driver = new XCUITestDriver();

it('should start and stop IWDP server', async function () {
let startStub = sinon.stub();
let stopStub = sinon.stub();
iosDriver.IWDP = function () {
this.start = startStub;
this.stop = stopStub;
};
await driver.startIWDP();
await driver.stopIWDP();

startStub.calledOnce.should.be.true;
stopStub.calledOnce.should.be.true;
});
});
});

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

0 comments on commit 8b44fcc

Please sign in to comment.