Skip to content

Commit

Permalink
fix: Various type declarations and imports (#47)
Browse files Browse the repository at this point in the history
* fix: Various type declarations and imports

* loop

* token

* types import
  • Loading branch information
mykola-mokhnach authored Jul 11, 2024
1 parent b812327 commit fbe4e46
Show file tree
Hide file tree
Showing 10 changed files with 401 additions and 583 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
with:
config-preset: angular
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
923 changes: 374 additions & 549 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 7 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
"prettier": "prettier 'src/**/*.ts' --write --single-quote",
"prettier-check": "prettier 'src/**/*.ts' --check",
"appium-home": "rm -rf /tmp/some-temp-dir && export APPIUM_HOME=/tmp/some-temp-dir",
"test": "mocha --require ts-node/register ./test/*.spec.js --timeout 260000 ",
"test": "mocha --require ts-node/register ./test/*.spec.js --timeout 260000",
"run-server": "appium server -ka 800 -pa /wd/hub",
"install-driver": "npm run build && appium driver install --source=local $(pwd)",
"reinstall-driver": "(appium driver uninstall flutter-integration || exit 0) && npm run install-driver",
"wdio-android": "wdio run ./android.conf.ts",
"wdio-ios": "wdio run ./ios.conf.ts"
},
"devDependencies": {
"@appium/types": "^0.20.3",
"@appium/types": "^0.x",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.0",
"@semantic-release/git": "^10.0.1",
Expand All @@ -61,18 +61,20 @@
"@types/mocha": "^10.0.6",
"@wdio/appium-service": "^8.38.0",
"@wdio/cli": "^8.38.0",
"@wdio/globals": "^8.38.0",
"@wdio/local-runner": "^8.38.0",
"@wdio/mocha-framework": "^8.38.0",
"@wdio/spec-reporter": "^8.38.0",
"@wdio/types": "^8.37.0",
"@wdio/utils": "^8.38.0",
"chai": "^5.1.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"mocha": "^10.4.0",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"semantic-release": "^24.0.0",
"semver": "^7.6.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"wdio-flutter-by-service": "^1.0.11",
Expand All @@ -82,22 +84,14 @@
"appium": "^2.5.4"
},
"dependencies": {
"@appium/base-driver": "^9.6.0",
"@appium/support": "^4.2.5",
"@wdio/globals": "^8.38.0",
"@wdio/utils": "^8.38.0",
"appium-adb": "^12.4.4",
"appium-android-driver": "^9.7.2",
"appium-ios-device": "^2.7.20",
"appium-uiautomator2-driver": "^3.6.1",
"appium-xcuitest-driver": "^7.20.1",
"async-retry": "^1.3.3",
"asyncbox": "^3.0.0",
"axios": "^1.7.2",
"bluebird": "^3.7.2",
"chai": "^5.1.1",
"lodash": "^4.17.21",
"node-simctl": "^7.5.2",
"portscanner": "^2.2.0"
"portscanner": "^2.2.0",
"semver": "^7.6.2"
}
}
6 changes: 3 additions & 3 deletions src/android.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AndroidUiautomator2Driver from 'appium-uiautomator2-driver';
import { AndroidUiautomator2Driver } from 'appium-uiautomator2-driver';
import type { InitialOpts } from '@appium/types';
import { AppiumFlutterDriver } from './driver';
import ADB from 'appium-adb';
import type { AppiumFlutterDriver } from './driver';
import type ADB from 'appium-adb';

export async function startAndroidSession(
this: AppiumFlutterDriver,
Expand Down
6 changes: 3 additions & 3 deletions src/commands/element.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import _ from 'lodash';
import { getProxyDriver } from '../utils';
import { JWProxy } from '@appium/base-driver';
import AndroidUiautomator2Driver from 'appium-uiautomator2-driver';
import { W3C_ELEMENT_KEY } from '@appium/base-driver/build/lib/constants';
import { JWProxy } from 'appium/driver';
import { AndroidUiautomator2Driver } from 'appium-uiautomator2-driver';
import { W3C_ELEMENT_KEY } from 'appium/driver';
import type { AppiumFlutterDriver } from '../driver';

export const ELEMENT_CACHE = new Map();
Expand Down
15 changes: 7 additions & 8 deletions src/driver.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { BaseDriver } from '@appium/base-driver';
import { desiredCapConstraints } from './desiredCaps';
import { JWProxy } from '@appium/base-driver';
import { JWProxy, BaseDriver } from 'appium/driver';
import type {
DefaultCreateSessionResult,
DriverData,
W3CDriverCaps,
DriverCaps,
} from '@appium/types';
type FlutterDriverConstraints = typeof desiredCapConstraints;
import XCUITestDriver from 'appium-xcuitest-driver/build/lib/driver';
import AndroidUiautomator2Driver from 'appium-uiautomator2-driver';
// @ts-ignore
import { XCUITestDriver } from 'appium-xcuitest-driver';
import { AndroidUiautomator2Driver } from 'appium-uiautomator2-driver';
import { createSession as createSessionMixin } from './session';
import {
findElOrEls,
Expand All @@ -22,15 +22,14 @@ import {
clear,
ELEMENT_CACHE,
} from './commands/element';

import {
attachAppLaunchArguments,
fetchFlutterServerPort,
getFreePort,
isFlutterDriverCommand,
waitForFlutterServerToBeActive,
} from './utils';
import { W3C_WEB_ELEMENT_IDENTIFIER } from '@appium/support/build/lib/util';
import { util } from 'appium/support';
import { androidPortForward, androidRemovePortForward } from './android';
import { iosPortForward, iosRemovePortForward } from './iOS';
import type { PortForwardCallback, PortReleaseCallback } from './types';
Expand Down Expand Up @@ -312,9 +311,9 @@ export class AppiumFlutterDriver extends BaseDriver<FlutterDriverConstraints> {
scrollDirection,
},
);
if (element.ELEMENT || element[W3C_WEB_ELEMENT_IDENTIFIER]) {
if (element.ELEMENT || element[util.W3C_WEB_ELEMENT_IDENTIFIER]) {
ELEMENT_CACHE.set(
element.ELEMENT || element[W3C_WEB_ELEMENT_IDENTIFIER],
element.ELEMENT || element[util.W3C_WEB_ELEMENT_IDENTIFIER],
this.proxy,
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/iOS.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AppiumFlutterDriver } from './driver';
import type { AppiumFlutterDriver } from './driver';
// @ts-ignore
import XCUITestDriver from 'appium-xcuitest-driver';
import { XCUITestDriver } from 'appium-xcuitest-driver';
import type { InitialOpts } from '@appium/types';
import { DEVICE_CONNECTIONS_FACTORY } from './iProxy';

Expand Down
2 changes: 1 addition & 1 deletion src/iProxy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import net from 'net';
import B from 'bluebird';
import { logger, util, timing } from '@appium/support';
import { logger, util, timing } from 'appium/support';
import { utilities } from 'appium-ios-device';
import { checkPortStatus } from 'portscanner';
import { waitForCondition } from 'asyncbox';
Expand Down
2 changes: 1 addition & 1 deletion src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logger } from '@appium/support';
import { logger } from 'appium/support';
import { AppiumLogger } from '@appium/types';

export const log: AppiumLogger = logger.getLogger(`FlutterIntegrationDriver`);
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AndroidUiautomator2Driver from 'appium-uiautomator2-driver';
import { AndroidUiautomator2Driver } from 'appium-uiautomator2-driver';
import { findAPortNotInUse } from 'portscanner';
import { waitForCondition } from 'asyncbox';
import { JWProxy } from '@appium/base-driver';
import { JWProxy } from 'appium/driver';
import type { PortForwardCallback, PortReleaseCallback } from './types';
import type { AppiumFlutterDriver } from './driver';
import _ from 'lodash';
Expand Down

0 comments on commit fbe4e46

Please # to comment.