Skip to content

Commit fbe4e46

Browse files
fix: Various type declarations and imports (#47)
* fix: Various type declarations and imports * loop * token * types import
1 parent b812327 commit fbe4e46

File tree

10 files changed

+401
-583
lines changed

10 files changed

+401
-583
lines changed

.github/workflows/pr-title.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
with:
1313
config-preset: angular
1414
env:
15-
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package-lock.json

+374-549
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-13
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@
4242
"prettier": "prettier 'src/**/*.ts' --write --single-quote",
4343
"prettier-check": "prettier 'src/**/*.ts' --check",
4444
"appium-home": "rm -rf /tmp/some-temp-dir && export APPIUM_HOME=/tmp/some-temp-dir",
45-
"test": "mocha --require ts-node/register ./test/*.spec.js --timeout 260000 ",
45+
"test": "mocha --require ts-node/register ./test/*.spec.js --timeout 260000",
4646
"run-server": "appium server -ka 800 -pa /wd/hub",
4747
"install-driver": "npm run build && appium driver install --source=local $(pwd)",
4848
"reinstall-driver": "(appium driver uninstall flutter-integration || exit 0) && npm run install-driver",
4949
"wdio-android": "wdio run ./android.conf.ts",
5050
"wdio-ios": "wdio run ./ios.conf.ts"
5151
},
5252
"devDependencies": {
53-
"@appium/types": "^0.20.3",
53+
"@appium/types": "^0.x",
5454
"@semantic-release/changelog": "^6.0.3",
5555
"@semantic-release/commit-analyzer": "^13.0.0",
5656
"@semantic-release/git": "^10.0.1",
@@ -61,18 +61,20 @@
6161
"@types/mocha": "^10.0.6",
6262
"@wdio/appium-service": "^8.38.0",
6363
"@wdio/cli": "^8.38.0",
64+
"@wdio/globals": "^8.38.0",
6465
"@wdio/local-runner": "^8.38.0",
6566
"@wdio/mocha-framework": "^8.38.0",
6667
"@wdio/spec-reporter": "^8.38.0",
6768
"@wdio/types": "^8.37.0",
69+
"@wdio/utils": "^8.38.0",
70+
"chai": "^5.1.1",
6871
"eslint-config-prettier": "^9.1.0",
6972
"eslint-plugin-prettier": "^5.1.3",
7073
"jest": "^29.7.0",
7174
"mocha": "^10.4.0",
7275
"prettier": "^3.3.2",
7376
"rimraf": "^5.0.7",
7477
"semantic-release": "^24.0.0",
75-
"semver": "^7.6.2",
7678
"ts-node": "^10.9.2",
7779
"typescript": "^5.4.5",
7880
"wdio-flutter-by-service": "^1.0.11",
@@ -82,22 +84,14 @@
8284
"appium": "^2.5.4"
8385
},
8486
"dependencies": {
85-
"@appium/base-driver": "^9.6.0",
86-
"@appium/support": "^4.2.5",
87-
"@wdio/globals": "^8.38.0",
88-
"@wdio/utils": "^8.38.0",
8987
"appium-adb": "^12.4.4",
90-
"appium-android-driver": "^9.7.2",
9188
"appium-ios-device": "^2.7.20",
9289
"appium-uiautomator2-driver": "^3.6.1",
9390
"appium-xcuitest-driver": "^7.20.1",
94-
"async-retry": "^1.3.3",
9591
"asyncbox": "^3.0.0",
96-
"axios": "^1.7.2",
9792
"bluebird": "^3.7.2",
98-
"chai": "^5.1.1",
9993
"lodash": "^4.17.21",
100-
"node-simctl": "^7.5.2",
101-
"portscanner": "^2.2.0"
94+
"portscanner": "^2.2.0",
95+
"semver": "^7.6.2"
10296
}
10397
}

src/android.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import AndroidUiautomator2Driver from 'appium-uiautomator2-driver';
1+
import { AndroidUiautomator2Driver } from 'appium-uiautomator2-driver';
22
import type { InitialOpts } from '@appium/types';
3-
import { AppiumFlutterDriver } from './driver';
4-
import ADB from 'appium-adb';
3+
import type { AppiumFlutterDriver } from './driver';
4+
import type ADB from 'appium-adb';
55

66
export async function startAndroidSession(
77
this: AppiumFlutterDriver,

src/commands/element.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import _ from 'lodash';
22
import { getProxyDriver } from '../utils';
3-
import { JWProxy } from '@appium/base-driver';
4-
import AndroidUiautomator2Driver from 'appium-uiautomator2-driver';
5-
import { W3C_ELEMENT_KEY } from '@appium/base-driver/build/lib/constants';
3+
import { JWProxy } from 'appium/driver';
4+
import { AndroidUiautomator2Driver } from 'appium-uiautomator2-driver';
5+
import { W3C_ELEMENT_KEY } from 'appium/driver';
66
import type { AppiumFlutterDriver } from '../driver';
77

88
export const ELEMENT_CACHE = new Map();

src/driver.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { BaseDriver } from '@appium/base-driver';
21
import { desiredCapConstraints } from './desiredCaps';
3-
import { JWProxy } from '@appium/base-driver';
2+
import { JWProxy, BaseDriver } from 'appium/driver';
43
import type {
54
DefaultCreateSessionResult,
65
DriverData,
76
W3CDriverCaps,
87
DriverCaps,
98
} from '@appium/types';
109
type FlutterDriverConstraints = typeof desiredCapConstraints;
11-
import XCUITestDriver from 'appium-xcuitest-driver/build/lib/driver';
12-
import AndroidUiautomator2Driver from 'appium-uiautomator2-driver';
10+
// @ts-ignore
11+
import { XCUITestDriver } from 'appium-xcuitest-driver';
12+
import { AndroidUiautomator2Driver } from 'appium-uiautomator2-driver';
1313
import { createSession as createSessionMixin } from './session';
1414
import {
1515
findElOrEls,
@@ -22,15 +22,14 @@ import {
2222
clear,
2323
ELEMENT_CACHE,
2424
} from './commands/element';
25-
2625
import {
2726
attachAppLaunchArguments,
2827
fetchFlutterServerPort,
2928
getFreePort,
3029
isFlutterDriverCommand,
3130
waitForFlutterServerToBeActive,
3231
} from './utils';
33-
import { W3C_WEB_ELEMENT_IDENTIFIER } from '@appium/support/build/lib/util';
32+
import { util } from 'appium/support';
3433
import { androidPortForward, androidRemovePortForward } from './android';
3534
import { iosPortForward, iosRemovePortForward } from './iOS';
3635
import type { PortForwardCallback, PortReleaseCallback } from './types';
@@ -312,9 +311,9 @@ export class AppiumFlutterDriver extends BaseDriver<FlutterDriverConstraints> {
312311
scrollDirection,
313312
},
314313
);
315-
if (element.ELEMENT || element[W3C_WEB_ELEMENT_IDENTIFIER]) {
314+
if (element.ELEMENT || element[util.W3C_WEB_ELEMENT_IDENTIFIER]) {
316315
ELEMENT_CACHE.set(
317-
element.ELEMENT || element[W3C_WEB_ELEMENT_IDENTIFIER],
316+
element.ELEMENT || element[util.W3C_WEB_ELEMENT_IDENTIFIER],
318317
this.proxy,
319318
);
320319
}

src/iOS.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { AppiumFlutterDriver } from './driver';
1+
import type { AppiumFlutterDriver } from './driver';
22
// @ts-ignore
3-
import XCUITestDriver from 'appium-xcuitest-driver';
3+
import { XCUITestDriver } from 'appium-xcuitest-driver';
44
import type { InitialOpts } from '@appium/types';
55
import { DEVICE_CONNECTIONS_FACTORY } from './iProxy';
66

src/iProxy.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import _ from 'lodash';
22
import net from 'net';
33
import B from 'bluebird';
4-
import { logger, util, timing } from '@appium/support';
4+
import { logger, util, timing } from 'appium/support';
55
import { utilities } from 'appium-ios-device';
66
import { checkPortStatus } from 'portscanner';
77
import { waitForCondition } from 'asyncbox';

src/logger.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { logger } from '@appium/support';
1+
import { logger } from 'appium/support';
22
import { AppiumLogger } from '@appium/types';
33

44
export const log: AppiumLogger = logger.getLogger(`FlutterIntegrationDriver`);

src/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import AndroidUiautomator2Driver from 'appium-uiautomator2-driver';
1+
import { AndroidUiautomator2Driver } from 'appium-uiautomator2-driver';
22
import { findAPortNotInUse } from 'portscanner';
33
import { waitForCondition } from 'asyncbox';
4-
import { JWProxy } from '@appium/base-driver';
4+
import { JWProxy } from 'appium/driver';
55
import type { PortForwardCallback, PortReleaseCallback } from './types';
66
import type { AppiumFlutterDriver } from './driver';
77
import _ from 'lodash';

0 commit comments

Comments
 (0)