Commit Graph

9819 Commits

Author SHA1 Message Date
Christopher Hiller cfdf898e04 fix(appium): do not throw ENAMETOOLONG on long cli arg
Some CLI args can be interpreted as filenames or JSON/CSV blobs.  Appium first assumes the value is a file and attempts to open it.  But if a blob is given and it is of some _problematic length_, the OS will throw an `ENAMETOOLONG` exception trying to open a filepath with a huge blob.  If the JSON is reasonably small, an `ENOENT` will be thrown instead.  Previous to this change, we were only looking for `ENOENT`; now we treat `ENAMETOOLONG` errors as JSON blobs.  If the problem is that the filename _is_ actually too long, the user will get an "invalid JSON" error, which will probably be confusing, but is less likely to happen than the more-common error this addresses.

If someone complains about it in the future, we can take another look, but it's going to take more effort than it's worth atm to fix it (imo).
2022-08-10 15:51:31 -07:00
Christopher Hiller 159703744f fix(types): add missing @types/ws dep 2022-08-10 14:54:51 -07:00
Jonathan Lipps 7ae4b5cb6a docs(appium): fix env var typo in docs publishing (#17318) 2022-08-10 11:43:28 -07:00
Christopher Hiller 887cb449e6 chore(eslint-config-appium): upgrade to ESLint v8
BREAKING CHANGE:

This change upgrades to ESLint v8 and removes `@babel/eslint-parser`, which is only necessary if we're using mid-stage TC39 proposals (which we aren't).  I think `@babel/core` was a peer dep of `@babel/eslint-parser`, so I removed that too.  And removed cruft from the main configuration.

ESLint rules _very likely_ had breaking changes, but I didn't experience any on our codebase.  However, this version of ESLint seems to be incompatible with `gulp-eslint`, so `@appium/gulp-plugins` should be held back from upgrading.

In addition:

- Updated `README.md`
- Updated some fields in `package.json`
- Loosened `peerDependencies`, as they're supposed to be loose.
2022-08-10 11:36:28 -07:00
Jonathan Lipps c58f32441d Publish
- appium@2.0.0-beta.43
 - @appium/base-driver@8.7.0
 - @appium/base-plugin@1.10.2
 - @appium/doctor@1.16.25
 - @appium/docutils@0.0.10
 - @appium/fake-driver@4.2.0
 - @appium/fake-plugin@2.1.0
 - @appium/gulp-plugins@7.0.5
 - @appium/images-plugin@1.3.5
 - @appium/support@2.59.5
 - @appium/test-support@1.5.0
 - @appium/types@0.4.0
@appium/base-driver@8.7.0 @appium/base-plugin@1.10.2 @appium/doctor@1.16.25 @appium/docutils@0.0.10 @appium/fake-driver@4.2.0 @appium/fake-plugin@2.1.0 @appium/gulp-plugins@7.0.5 @appium/images-plugin@1.3.5 @appium/support@2.59.5 @appium/test-support@1.5.0 @appium/types@0.4.0 appium@2.0.0-beta.43
2022-08-10 07:45:24 -07:00
Jonathan Lipps 325f9900cc chore(appium): don't lint autogenerated docs assets js 2022-08-10 07:42:44 -07:00
Jonathan Lipps 337ec3e7ba feat(base-driver,fake-driver,appium): add convenience methods for defining execute script overloads (#17321)
* feat(base-driver,fake-driver,appium): add convenience methods for defining execute script overloads

* Update packages/appium/docs/en/ecosystem/build-drivers.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* Update packages/appium/docs/en/ecosystem/build-drivers.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* Update packages/appium/docs/en/ecosystem/build-drivers.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* Update packages/appium/docs/en/ecosystem/build-drivers.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* review

* review

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>
2022-08-09 20:47:47 -07:00
Christopher Hiller 888aac85ff fix(support): add missing @appium/types
This package was missing `@appium/types`, which means packages consuming `@appium/support` which _don't_ also consume `appium` in some capacity will have types that won't compile, e.g., `teen_process`.
2022-08-09 15:26:20 -07:00
Christopher Hiller ee0a579ddc chore(gulp-plugins): remove unused babel-eslint 2022-08-09 10:49:44 -07:00
Christopher Hiller 8d6ffe0932 fix(support): path to APPIUM_HOME must always be absolute
Closes #17338
2022-08-09 10:49:32 -07:00
Christopher Hiller d4b983328a feat(appium,base-driver,fake-driver,fake-plugin,test-support,types): updateServer receives cliArgs param
This PR passes a `cliArgs` parameter to the static method `updateServer` of drivers and plugins so they can take action on the server configuration based on the content of the arguments.

Note that `cliArgs` is a misnomer, because these args can also come from configuration files.

Closes #17304
2022-08-08 14:00:58 -07:00
renovate[bot] ce7b4520a4 chore(): update dependency @types/chai to v4.3.3 2022-08-08 11:54:58 +00:00
Christopher Hiller dc4835f293 fix(appium): fix busted config file normalization algorithm
I'm not sure _what_ happened here other than "the types weren't strict enough" otherwise I would have noticed this earlier.  Anyway; the check to see if we should dig into the config object to normalize the keys was getting passed _something_ but that _something_ wasn't anything it expected.

As a result, I needed to update some tests which assumed `readConfigFile()` resolved w/ an identity w/r/t the config file itself.  It doesn't give the config file back verbatim any longer; the result will be normalized to camel-case keys (or whatever the `appiumCliDest` property is, if it exists)
2022-08-04 15:38:52 -07:00
Christopher Hiller dc730e7307 chore(): ignore local_appium_home in wallaby tests 2022-08-04 15:38:52 -07:00
Christopher Hiller ec79486df0 chore(types): enable ESM interop by default
for stuff that is type-checked but not part of the actual build. this was driving me nuts, sorry.
2022-08-04 15:38:52 -07:00
ian zhang b5ea03ae85 docs: Update Edit URL and Fix typo of MJSONWP (#17315)
As branch 2.0 won't there any more , just replace with master as latest resource
2022-08-04 14:10:51 -07:00
Jonathan Lipps 3c6633eaa1 docs(appium): restore config developer docs (#17312) 2022-08-03 16:56:08 -07:00
Jonathan Lipps bf53db9fac docs(appium): reorganize migration doc info (#17311)
* docs(appium): reorganize migration doc info so that appropriate bits are in their own docs

* Update packages/appium/docs/en/ecosystem/build-drivers.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* Update packages/appium/docs/en/ecosystem/build-drivers.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* Update packages/appium/docs/en/guides/caps.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* Update packages/appium/docs/en/guides/caps.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* Update packages/appium/docs/en/guides/config.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* Update packages/appium/docs/en/guides/config.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* Update packages/appium/docs/en/guides/config.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* Update packages/appium/docs/en/guides/config.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* Update packages/appium/docs/en/guides/config.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* Update packages/appium/docs/en/guides/migrating-1-to-2.md

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>

* add header for extensions

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>
2022-08-03 15:45:01 -07:00
Jonathan Lipps fd57ff03a4 docs(appium): actually fix link to new docs 2022-08-03 13:13:14 -07:00
Jonathan Lipps 167fdb18f7 docs(appium): fix link to new docs in old docs dir 2022-08-03 13:12:48 -07:00
Jonathan Lipps 50964e0690 docs(appium): migrate the migration docs and fix urls (#17306)
* docs(appium): migrate the migration docs and fix urls

* Update packages/appium/docs/en/guides/migrating-1-to-2.md

Co-authored-by: Kazuaki Matsuo <fly.49.89.over@gmail.com>

* docs(appium): migrate the migration docs and fix urls

Co-authored-by: Kazuaki Matsuo <fly.49.89.over@gmail.com>
2022-08-03 11:46:48 -07:00
renovate[bot] a2385f08d5 chore(images-plugin): update dependency lru-cache to v7.13.2 2022-08-03 13:39:58 +00:00
Jonathan Lipps 500c08f392 Publish
- appium@2.0.0-beta.42
 - @appium/base-driver@8.6.1
 - @appium/base-plugin@1.10.1
 - @appium/doctor@1.16.24
 - @appium/docutils@0.0.9
 - @appium/eslint-config-appium@6.0.4
 - @appium/execute-driver-plugin@2.0.4
 - @appium/fake-driver@4.1.0
 - @appium/fake-plugin@2.0.5
 - @appium/gulp-plugins@7.0.4
 - @appium/images-plugin@1.3.4
 - @appium/opencv@1.0.11
 - @appium/relaxed-caps-plugin@1.0.0-beta.11
 - @appium/schema@0.0.9
 - @appium/support@2.59.4
 - @appium/test-support@1.4.1
 - @appium/types@0.3.1
 - @appium/universal-xml-plugin@1.0.0-beta.13
@appium/base-driver@8.6.1 @appium/base-plugin@1.10.1 @appium/doctor@1.16.24 @appium/docutils@0.0.9 @appium/eslint-config-appium@6.0.4 @appium/execute-driver-plugin@2.0.4 @appium/fake-driver@4.1.0 @appium/fake-plugin@2.0.5 @appium/gulp-plugins@7.0.4 @appium/images-plugin@1.3.4 @appium/opencv@1.0.11 @appium/relaxed-caps-plugin@1.0.0-beta.11 @appium/schema@0.0.9 @appium/support@2.59.4 @appium/test-support@1.4.1 @appium/types@0.3.1 @appium/universal-xml-plugin@1.0.0-beta.13 appium@2.0.0-beta.42
2022-08-02 20:21:17 -07:00
Christopher Hiller 4655302239 test(appium): add smoke test for driver installation
This adds a test (which currently only runs automatically in CI) which installs the uiautomator2 driver.  This will ensure that driver installation does not only work in a dev environment!

Due to needing to support Windows and not wishing to befoul the default `APPIUM_HOME`, we need `cross-env` as a production dependency (otherwise the smoke test would fail) to set a temporary `APPIUM_HOME` (`local_appium_home`) which is relative to the temp dir used by the smoke test (see https://github.com/boneskull/nodejs-production-test-action)
2022-08-02 17:21:14 -07:00
Christopher Hiller 5efd62af08 chore(ci): fix target branch for FOSSA job 2022-08-02 16:18:39 -07:00
Christopher Hiller 27ac2fa125 fix(appium): add npm version check
Also fix duplication of error messages about engines.

Unfortunately this adds another startup delay, but I'm unsure of a better way around it.  I guess bundling our own npm might work!
2022-08-02 14:43:25 -07:00
Christopher Hiller d8d2382327 fix(appium,base-driver,base-plugin,doctor,docutils,eslint-config-appium,execute-driver-plugin,fake-driver,fake-plugin,gulp-plugins,images-plugin,opencv,relaxed-caps-plugin,schema,support,test-support,types,universal-xml-plugin): update engines
also add a missing dep in `@appium/schema`
2022-08-02 14:22:44 -07:00
Christopher Hiller faff3ce347 feat(appium): pass unknown args to extension scripts
Resolves #17250

This change passes any extra unknown arguments to extension scripts _if and only if_ `appium <extension> <name> run` is executed.  In all other cases, unknown arguments result in an error and the `appium` CLI will abort as before.

Example:

```bash
appium driver fake run fake-success --foo --bar`
```

In the `fake-success` script of the `fake` driver, `process.argv.slice(2)` will be `['--foo', '--bar']`.  Extra arguments can appear anywhere after the `appium` executable in the command and do not need to appear after the script name.

- In addition, added some missing arguments for extension subcommands to the types (`json`, `suppressOutput`).  Extra arguments are stored in property `extraArgs`.
- Fixed a type problem surfaced by the previous item
- Changed help text for the `run` subcommand to hopefully read more clearly
- Reorganized E2E tests for the `run` subcommand
- Slightly changed error output when unknown argument is provided (given that we now need to DIY this)
2022-08-02 10:55:11 -07:00
renovate[bot] 05b981afa2 chore(): update babel monorepo to v7.18.10 2022-08-02 13:51:09 +00:00
Christopher Hiller 5e047485ee chore(renovate): add "del", "get-port", "inquirer", "vinyl-paths" to exclusion list
these packages are now ESM-only
2022-08-01 14:36:28 -07:00
Christopher Hiller b7e905eaf1 fix(appium): partially revert 2a6a056187
This removes the symlink we were creating to avoid an extra install of `appium` in `APPIUM_HOME`.  Using a symlink obviously breaks stuff, because (for whatever reason) `npm` wants to run lthe `prepare` lifecycle script in the symlinked `appium`, which will not work outside of a dev environment due to missing dev depenencies.

Because npm v7+'s behavior is to install peer dependencies automatically, this will cause `appium` to be installed alongside any extensions in `APPIUM_HOME`. Each extension will have its own `appium`. This may just be the price we have to pay for using `APPIUM_HOME`, or there may be another solution to avoid the extra install (I'm not sure what it is).  I think it _also_ exposes us to future bugs where the running Appium differs from whatever the peer dependency is set to... which sort of defeats the purpose of peer dependencies.  Either way, the user will get a warning if the currently-running Appium is too new for an extension.
2022-08-01 14:36:03 -07:00
renovate[bot] 47de13c0d6 chore(types): update dependency type-fest to v2.18.0 2022-07-31 13:25:12 +00:00
renovate[bot] edc9a5e7e7 chore(): update dependency @types/node to v16.11.47 2022-07-31 11:01:36 +00:00
renovate[bot] 6c36683859 chore(docutils): update dependency jsdoc-plugin-typescript to v2.1.1 2022-07-30 11:00:12 +00:00
renovate[bot] 6db31553db chore(execute-driver-plugin): update dependency webdriverio to v7.20.9 2022-07-29 19:21:42 +00:00
renovate[bot] de273dd370 chore(doctor): update dependency appium-adb to v9.10.2 2022-07-29 11:09:34 +00:00
Christopher Hiller f6e6d7234e Publish
- appium@2.0.0-beta.41
 - @appium/base-driver@8.6.0
 - @appium/base-plugin@1.10.0
 - @appium/doctor@1.16.23
 - @appium/docutils@0.0.8
 - @appium/eslint-config-appium@6.0.3
 - @appium/execute-driver-plugin@2.0.3
 - @appium/fake-driver@4.0.2
 - @appium/fake-plugin@2.0.4
 - @appium/gulp-plugins@7.0.3
 - @appium/images-plugin@1.3.3
 - @appium/opencv@1.0.10
 - @appium/relaxed-caps-plugin@1.0.0-beta.10
 - @appium/schema@0.0.8
 - @appium/support@2.59.3
 - @appium/test-support@1.4.0
 - @appium/types@0.3.0
 - @appium/universal-xml-plugin@1.0.0-beta.12
@appium/base-driver@8.6.0 @appium/base-plugin@1.10.0 @appium/doctor@1.16.23 @appium/docutils@0.0.8 @appium/eslint-config-appium@6.0.3 @appium/execute-driver-plugin@2.0.3 @appium/fake-driver@4.0.2 @appium/fake-plugin@2.0.4 @appium/gulp-plugins@7.0.3 @appium/images-plugin@1.3.3 @appium/opencv@1.0.10 @appium/relaxed-caps-plugin@1.0.0-beta.10 @appium/schema@0.0.8 @appium/support@2.59.3 @appium/test-support@1.4.0 @appium/types@0.3.0 @appium/universal-xml-plugin@1.0.0-beta.12 appium@2.0.0-beta.41
2022-07-28 14:34:54 -07:00
renovate[bot] 1848cc8229 chore(): update dependency @types/node to v16.11.46 2022-07-28 12:27:47 +00:00
renovate[bot] 54908e1cae chore(types): update dependency type-fest to v2.17.0 2022-07-22 16:54:35 +00:00
renovate[bot] ae0ff136f6 chore(docutils): update dependency jsdoc to v3.6.11 2022-07-22 14:30:22 +00:00
Christopher Hiller 018daac156 chore(): remove dependabot config 2022-07-20 11:42:33 -07:00
renovate[bot] 32b9e50b3c chore(docutils): update dependency jsdoc-plugin-typescript to v2.1.0 2022-07-20 15:12:09 +00:00
renovate[bot] 8b48e46952 chore(): update dependency @types/sinon to v10.0.13 2022-07-20 12:17:57 +00:00
renovate[bot] c256e0026b chore(doctor): update dependency appium-adb to v9.10.1 2022-07-19 15:29:26 +00:00
renovate[bot] 27ea226364 chore(): update babel monorepo to v7.18.9 2022-07-19 12:46:13 +00:00
Kazuaki Matsuo e71e4eeecb docs: add ruby (#16857)
* chore: add ruby

* append ruby more

* tweak

* update
2022-07-18 22:03:32 -07:00
Christopher Hiller 4627756c66 test(images-plugin): use appium/test 2022-07-18 15:58:21 -07:00
Christopher Hiller a96f1197a7 test(execute-driver-plugin): use appium/test 2022-07-18 15:58:21 -07:00
Christopher Hiller 5226844468 test(fake-driver): use appium/test 2022-07-18 15:58:21 -07:00
Christopher Hiller 70d88cb86f feat(appium,base-driver,base-plugin,test-support,types): move test fixtures into test-support
- `@appium/test-support` now exports the e2e setup for plugins, and e2e/unit suites for drivers from base-driver.  it also generates declarations.
- `appium` exports this as `appium/test`.
- The `capability.spec.js` unit test for basedriver now avoids spying on the "global" logger, due to test flake.  It now spies directly on the function which calls the global logger. (@mykola_mokhnach)
- removed homebrew ansi-stripping code from `test-support` and replaced with `@colors/colors`
- type fixes and refactors for `@appium/test-support`
- type fixes for `appium`
- simplify `lib/index.js` of `@appium/base-driver`
2022-07-18 15:58:21 -07:00