Commit Graph

8892 Commits

Author SHA1 Message Date
Renovate Bot a5d45979b9 chore(appium): update dependency yaml to v2.0.1 2022-04-16 11:03:49 +00:00
Renovate Bot 14490a0d17 chore(): update dependency lint-staged to v12.3.8 2022-04-15 16:30:47 +00:00
Renovate Bot f50f493dd5 chore(): update dependency @types/async-lock to v1.1.5 2022-04-15 13:29:52 +00:00
Renovate Bot 79f86c6bcd chore(appium): update dependency yaml to v2 2022-04-14 15:11:04 -07:00
Christopher Hiller 15439c2ae7 fix(execute-driver-plugin): upgrade webdriverio 2022-04-14 14:30:00 -07:00
Christopher Hiller dc9fa6236d fix(base-plugin): use correct 'address' prop instead of 'host' 2022-04-14 14:30:00 -07:00
Christopher Hiller 237529c1ac chore(types,base-driver): rename DriverOpts => ServerArgs
- these are first and foremost _server_ args, so go with that, except they _also_ get provided to drivers, so we can use the `DriverOpts` alias there.
- simplify `tsconfig.json` in `@appium/types`
2022-04-14 14:30:00 -07:00
Christopher Hiller 8b814c9243 fix(appium): make types actually consumable
- because we had not previously (before `base-plugin`) tried to consume the appium declarations ourselves, I found a problem where the reference to internal types (`types/`) was not referenced correctly.  this was fixed by renaming the files to `.ts` so the declarations are generated and put in `build/` along w/ `lib/`. this necessitated explictly exporting all types
- fixed a problem with `Args` not allowing an `undefined` `subcommand` prop
- added an `AppiumEnv` type
- simplify `tsconfig.json`
2022-04-14 14:30:00 -07:00
Christopher Hiller 8b010df295 chore: simplify test scripts
- `e2e-test` is now `test:e2e`
- removed `pre`/`post` lifecycle scripts because it's hard to parse what's happening
- in CI, e2e tests do _not_ run in parallel, no extra build occurs, no types are built, and no lint happens.  (types/lint happens in a diff job, and there aren't enough cores available for parallel mode to make a difference)
- removed a bunch of scripts to test individual packages. you can just `cd packages/<pkgname> && npm t`
2022-04-14 14:30:00 -07:00
Christopher Hiller 2d76923e72 fix(base-driver): do not throw if updateSettings aren't provided
BREAKING CHANGES

Some plugin tests were calling code which called the `update()` method of `DeviceSettings`, but there's apparently no code that actually sets the `onUpdateSettings` listener anywhere (maybe drivers can opt-in to this behavior?), which was causing exceptions to get thrown.

The E2E tests expected this code to reject, but the plugin tests expected it to _not_ reject, so I'm not sure what's right.

- adds unit tests for `DeviceSettings`

_Note: after further investigation, I think this was throwing simply due to `base-plugin` using an old version of `appium-fake-driver` which used an old `appium-base-driver`.  @jlipps says this change is OK._
2022-04-14 14:30:00 -07:00
Christopher Hiller b438249583 fix(base-plugin): correct version 2022-04-14 14:30:00 -07:00
Christopher Hiller 83d87213c3 chore(execute-driver-plugin): import execute-driver-plugin
yeah this is my bad.  if we really need the history I can redo this.

no significant changes; just the usual stuff about builds and types.

bonus: I figured out how to get webdriverio types working
2022-04-14 14:30:00 -07:00
Christopher Hiller 7b560bbb33 chore(base-plugin): update e2e test helpers types 2022-04-14 14:30:00 -07:00
Christopher Hiller 37cb3bd80c fix(appium): fix some argument-related types
Since plugin tests now depend on appium types, I discovered some issues...

- `PartialArgs` renamed to `Args`. This can be basically any object, but contains some "reflection" to tell "server" args vs "extension" args
- Added a type guard to help with this
- Reorganized `init()` slightly
- Updated some type references elsewhere in the codebase

Note that `ParsedArgs` (no generic) contains "server args", `ParsedArgs<T>` contains "either server or extension args", and `ParsedArgs<{subcommand: 'driver'|'plugin'>` contains "extension" args.  In particular, no defaults or config settings get applied to "extension" args.

Also fixed wrong `types` path in `package.json`
2022-04-14 14:30:00 -07:00
Christopher Hiller 8bcc143bff fix(fake-plugin): fix scripts 2022-04-14 14:30:00 -07:00
Christopher Hiller b8df5b5c38 fix(types): fix declaration for AppiumServer['close']
previously, `close` was considered an overload, meaning that _both_ the original `close` (from `net.Server`) _and_ our async version were defined.

This was incorrect, since we fully monkeypatch `close`, so this change removes the original `close` declaration entirely
2022-04-14 14:30:00 -07:00
Christopher Hiller 68c3a1dfe4 chore: simplify root tsconfig.json 2022-04-14 14:30:00 -07:00
Christopher Hiller 7feffe9404 chore: update wallaby config to avoid local_appium_home 2022-04-14 14:30:00 -07:00
Christopher Hiller c4cd2b3774 chore: remove leftover appium-plugins package dir 2022-04-14 14:30:00 -07:00
Christopher Hiller 7f84e98256 test(images-plugin): attempt to fix e2e test 2022-04-14 14:30:00 -07:00
Christopher Hiller aaa6aaf965 chore(types): remove schema json which came in via bad merge 2022-04-14 14:30:00 -07:00
Christopher Hiller 882a5f4d5e chore: unify test setup fixture
Moved the stuff in `test/setup-babel` into `test/setup` and then removed some cruft in the `test:*` scripts of each package referencing `test/setup-babel`
2022-04-14 14:30:00 -07:00
Christopher Hiller a53258c312 fix(universal-xml-plugin): fix ref to appium-support
ugh bad rebase
2022-04-14 14:30:00 -07:00
Christopher Hiller 30cc9c8181 test(base-plugin): use local appium to install drivers/plugins in test helpers
- since `appium` is already required to start the server, might as well use it instead of `npx appium` to install drivers & plugins
- supports `appiumHome` option
- improved console output
- fix dev script to build helpers
- remove `test/helpers.js` from TS config (adding TS support to test files will be another PR)
2022-04-14 14:30:00 -07:00
Christopher Hiller c29563f684 fix(fake-plugin): index.js must be a CJS script 2022-04-14 14:30:00 -07:00
Christopher Hiller f7760a2fa6 fix(images-plugin): fix bad merge and tests
- adds/fixes a couple types; sets up type dependencies
- update e2e tests to pull fake driver & plugin from local
- fix sinon usage
- fix some assertions
2022-04-14 14:30:00 -07:00
Christopher Hiller 122a389868 chore(schema): fix dev script 2022-04-14 14:30:00 -07:00
Christopher Hiller 2520a9e3d4 chore(opencv): add some stub types 2022-04-14 14:30:00 -07:00
Christopher Hiller ac575cc81f fix(fake-plugin): fix bad merge 2022-04-14 14:30:00 -07:00
Christopher Hiller 5b54017054 chore: relocated plugins
- left some necessary config in packages/plugins-temp which will get removed after full integration

# Conflicts:
#	packages/appium-plugins/.github/workflows/main.yml
#	packages/appium-plugins/packages/base/package-lock.json
#	packages/appium-plugins/packages/base/package.json
#	packages/appium-plugins/packages/fake/package-lock.json
#	packages/appium-plugins/packages/images/package-lock.json
#	packages/appium-plugins/packages/images/package.json
#	packages/appium-plugins/packages/relaxed-caps/package-lock.json
#	packages/appium-plugins/packages/relaxed-caps/package.json
#	packages/appium-plugins/packages/universal-xml/package-lock.json
#	packages/fake-plugin/lib/logger.js
#	packages/fake-plugin/lib/scripts/fake-error.js
#	packages/fake-plugin/lib/scripts/fake-success.js
#	packages/fake-plugin/package.json
#	packages/universal-xml-plugin/package.json
2022-04-14 14:30:00 -07:00
Renovate Bot 6704023ffc chore(workflows): update actions/setup-node action to v2.5.0 2022-04-14 14:30:00 -07:00
Jonathan Lipps 24c7e3012a docs: appium's plugin flag is --use-plugins now, not --plugins 2022-04-14 14:30:00 -07:00
Jonathan Lipps c1b5abbd21 feat(fake): add unexpected shutdown handler 2022-04-14 14:30:00 -07:00
Jonathan Lipps 347b5be885 docs(base): document onUnexpectedShutdown for plugin authors 2022-04-14 14:30:00 -07:00
Jonathan Lipps e7beecd52f fix(universal-xml): remove code related to proxying now that it is moot 2022-04-14 14:30:00 -07:00
Jonathan Lipps 98014f1405 fix(images): remove code related to proxying now that it is moot 2022-04-14 14:30:00 -07:00
Jonathan Lipps e463d4973c feat(fake): add fake window handle plugin override 2022-04-14 14:30:00 -07:00
Renovate Bot c35c534ee5 chore(workflows): update actions/setup-node action to v2.4.1 2022-04-14 14:30:00 -07:00
Avi Goldman 536d1e86c8 docs: fix typo in url (#38) 2022-04-14 14:30:00 -07:00
Renovate Bot f68c52a98e chore(workflows): update actions/setup-node action to v2.4.0 2022-04-14 14:30:00 -07:00
Jonathan Lipps 36b125dd61 chore(base): add info about neverProxy to README 2022-04-14 14:30:00 -07:00
Jonathan Lipps 270a2d2ca5 fix(images): ensure image plugin new methods are never proxied 2022-04-14 14:30:00 -07:00
Jonathan Lipps 712d35ce08 fix(fake): ensure fake plugin new methods are never proxied 2022-04-14 14:30:00 -07:00
renovate[bot] bfd461bd16 chore: configure renovate
* Add renovate.json

* chore: configure renovate

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Jonathan Lipps <jlipps@gmail.com>
2022-04-14 14:30:00 -07:00
Kazuaki Matsuo 821f770ce5 fix: add export 2022-04-14 14:30:00 -07:00
Jonathan Lipps 472d56da9e Publish
- @appium/base-plugin@1.7.0
 - @appium/fake-plugin@1.2.0
 - @appium/images-plugin@1.2.0
 - @appium/relaxed-caps-plugin@1.0.0-beta.3
 - @appium/universal-xml-plugin@1.0.0-beta.4
2022-04-14 14:30:00 -07:00
Jonathan Lipps c962b525f9 Publish
- @appium/fake-plugin@1.1.0
 - @appium/images-plugin@1.1.6

feat: allow appium to pass cli args to plugins (#10)

* feat: allow appium to pass cli args to plugins

* feat: add new method for getting cli args from plugin

* refactor: refactor how plugin cli args are recieved

* style: run lint
2022-04-14 14:30:00 -07:00
Jonathan Lipps 36926fa6ff test(images): skip images plugin unit tests which require opencv, if opencv is not available the rationale is that folks developing plugins other than this one shouldn't need to go through the pain of opencv4nodejs setup. CI will catch any regressions in unit tests for this particular plugin. 2022-04-14 14:30:00 -07:00
Jonathan Lipps 5474639535 chore: peg to latest appium beta for test correctness
chore: add scripts to allow for the testing of run cli command against plugins
2022-04-14 14:30:00 -07:00
Jonathan Lipps f8c0afba29 Publish
- @appium/base-plugin@1.6.4
 - @appium/fake-plugin@1.0.0
 - @appium/images-plugin@1.1.5
 - @appium/relaxed-caps-plugin@1.0.0-beta.2
 - @appium/universal-xml-plugin@1.0.0-beta.3
2022-04-14 14:30:00 -07:00