Commit Graph
10160 Commits
Author SHA1 Message Date
Jonathan Lipps 5443b570ad fix(appium): resolve-from is a dependency 2021-11-15 12:24:42 -08:00
Jonathan Lipps d7882a15ee Publish
- appium@2.0.0-beta.20
 - @appium/base-driver@8.2.0
 - @appium/doctor@1.16.6
 - @appium/eslint-config-appium@4.7.4
 - @appium/fake-driver@3.2.0
 - @appium/gulp-plugins@5.5.5
 - @appium/support@2.55.1
 - @appium/test-support@1.3.8
@appium/test-support@1.3.8 @appium/base-driver@8.2.0 @appium/doctor@1.16.6 @appium/eslint-config-appium@4.7.4 @appium/fake-driver@3.2.0 @appium/gulp-plugins@5.5.5 @appium/support@2.55.1 appium@2.0.0-beta.20
2021-11-15 12:15:51 -08:00
Christopher Hiller a56cba0b03 fix(appium): ensure correct paths for schema declaration generation
- also convert script to ESM for fun
- transpiles appium just to be sure -- this generates the base schema `.json` file
2021-11-15 11:52:22 -08:00
Renovate Bot f5ef3230eb chore(appium): update dependency ajv to v8.8.0 2021-11-14 09:46:53 +00:00
Kazuaki Matsuo 1307b2554a chore(base): Make useSystemUnzip option configurable via process environment (#16082) 2021-11-13 17:40:46 +09:00
Jonathan Lipps 5b9a4c2ffa chore(appium): some cosmetic improvements to session and proxy naming etc 2021-11-12 22:15:06 -05:00
Jonathan Lipps fff6b2eb00 feat(appium): allow plugins to react to unexpected session shutdowns 2021-11-12 22:15:06 -05:00
Jonathan Lipps ead3e0723f fix(appium): stop calling plugins 'sessionless' since the name is immutable
and plugins can now migrate from sessionless to session-based
2021-11-12 22:15:06 -05:00
Jonathan Lipps 70910087d1 fix(appium): fix interaction of plugins with proxying
Previously, you could not 'await next()' in a plugin and trigger the default proxy behaviour.
Now this is possible.
2021-11-12 22:15:06 -05:00
Jonathan Lipps 9e6c0a13ef feat(fake-driver): add a new 'PROXY' context that does 'proxying' for use in testing 2021-11-12 22:15:06 -05:00
Jonathan Lipps c5f363f5d9 refactor(base-driver): all drivers now support executeCommand 2021-11-12 22:15:06 -05:00
Jonathan Lipps 3f1bb4c9c3 fix(appium): if a sessionless plugin is used for createSession, promote it to a session plugin
so it can share state within itself
2021-11-12 22:15:06 -05:00
Christopher Hiller 7052bd2f07 chore(appium): rename package.json config prop to appiumConfig
- update `configuration-system.md` docs to reflect this and a bunch of other things while I was in there
2021-11-12 14:17:59 -08:00
Renovate Bot 3c14756835 chore(): update dependency @appium/fake-plugin to v1.3.0 2021-11-12 14:45:59 +00:00
Renovate Bot 27a248835d chore(appium): update dependency @appium/base-plugin to v1.8.0 2021-11-12 12:32:43 +00:00
Christopher Hiller e951010055 fix(appium): add missing support for schema-as-object
I had intended to allow extensions to define a schema via `package.json` instead of a path to a file, and apparently forgot to implement this.  So, now it is implemented.
2021-11-11 09:19:23 -08:00
Renovate Bot 4338bb8830 chore(): update dependency appium-base-driver to v7.11.0 2021-11-11 14:01:48 +00:00
Renovate Bot 7eff3c9fe7 chore(support): update dependency bplist-parser to v0.3.1 2021-11-11 13:07:24 +00:00
Renovate Bot 3cc5a4d3a1 chore(appium): update dependency ajv to v8.7.1 2021-11-11 11:54:04 +00:00
Renovate Bot 6bdb7a045c chore(eslint-config-appium): update babel monorepo to v7.16.3 2021-11-11 01:49:34 +00:00
Christopher Hiller 7381a13da3 fix(appium): remove extra logging from config-file
Logging was happening here before the logger was properly initialized, which looked weird.  Just remove logs for now until we find a better solution.

In addition, fixed some typing problems:
- we need `@types/node` for node globals (like errors that have a `code` property)
- set various typings as globals: `node`, `mocha`, `chai` & its ilk
2021-11-10 14:44:37 -08:00
Renovate Bot 02bfd74021 chore(appium): update dependency lilconfig to v2.0.4 2021-11-10 21:40:49 +00:00
Renovate Bot 701a9aee33 chore(appium): update dependency ajv-formats to v2.1.1 2021-11-10 19:09:59 +00:00
Renovate Bot 94648da93d chore(gulp-plugins): update dependency @types/node to v16 2021-11-10 11:55:33 -05:00
Renovate Bot 3929592e6d chore(test-support): update dependency sinon to v12 2021-11-10 11:55:16 -05:00
Renovate Bot d53cbcfbf6 chore(): update dependency eslint-find-rules to v4 2021-11-10 11:54:47 -05:00
Renovate Bot 47b9f0406f chore(eslint-config-appium): update dependency eslint-plugin-import to v2.25.3 2021-11-10 11:24:56 -05:00
Renovate Bot 6095fae8c3 chore(support): update dependency klaw to v4 2021-11-10 11:24:33 -05:00
Renovate Bot cc315a944e chore(): update dependency type-fest to v2.5.3 2021-11-10 14:29:50 +00:00
Renovate Bot 69ef7520b0 chore(appium): update dependency @sidvind/better-ajv-errors to v0.9.2 2021-11-10 12:31:39 +00:00
Renovate Bot f4cf4db4cc chore(): update dependency json-schema-to-typescript to v10.1.5 2021-11-10 10:58:17 +00:00
Christopher Hiller 9a5ad9350f chore(appium): review changes
- replace `_.forEach`
- simplify `ArgSpec` constructor
- update `appium` executable description
- avoid a bunch of warnings in `cli-args-specs.js`
2021-11-09 11:57:26 -08:00
Christopher Hiller 4f2d424971 docs(appium): add configuration system technical overview 2021-11-09 11:57:26 -08:00
Christopher Hiller 68009b68dc chore(appium): commit appium-config.schema.json to vcs
- we want to reference this file from the documentation, and the easiest way to do so is just to add it to vcs.  we can change where it lives later, if necessary.
- modify gulpfile to handle this
2021-11-09 11:57:26 -08:00
Christopher Hiller 94b727eaf1 docs: update migration guide to reflect changes to configuration files, arguments, etc.
- add a JS example config file
2021-11-09 11:57:26 -08:00
Christopher Hiller 5b8c448648 docs(appium): update example configuration files 2021-11-09 11:57:26 -08:00
Christopher Hiller a940533a1b chore(appium): fix access of wrong arguments object
Prevented subcommands from working properly.
In addition, cleaned up some types; `FlattenedAppiumConfig` is now just `ParsedArgs`.
2021-11-09 11:57:26 -08:00
Christopher Hiller fc566628f5 fix(appium): avoid deprecation warning from argparse 2021-11-09 11:57:26 -08:00
Christopher Hiller 94c07a6333 chore(appium): more type fixes
- revert changes to default boolean values
- fix types w/r/t the object returned by `parseArgs()`
- `.d.ts` files _and_ `.js` files can now be checked via `tsc` (given typescript Version 4.6.0-dev.20211102 or newer); remove `jsconfig.json` in lieu of `tsconfig.json`.  js files will only be checked if `// @ts-check` pragma is present
2021-11-09 11:57:26 -08:00
Christopher Hiller a7fa66bb7d fix(appium): bad type name 2021-11-09 11:57:26 -08:00
Christopher Hiller ad69b6bcf9 chore(gulp-plugins): remove cruft from babel config 2021-11-09 11:57:26 -08:00
Christopher Hiller 95dfe24176 fix(appium): add types for parsed argument object
- add more comments explaining various types
- fix some types in `lib/main.js`
- rename `args` to `parsedArgs` to be more obvious about what's what
- `parsedArgs` is now correctly typed! I think.
- fix `NormalizedAppiumConfiguration` (and rename to `NormalizedAppiumConfig`) which was essentially incorrect, since it did not respect `appiumCliDest` (e.g., `tmp` would be `tmpDir` in the config normalized by the code, but the type would not reflect this)
- add type for `driverConfig` prop to `AppiumDriver`
- remove a bunch of `default: false` nonsense from schema
- fix `tmp`, which is now stored in `tmpDir` as it should be

Note that any source file with a `// @ts-check` in it which operates on the parsed arguments object will have type support available.  we're not linting the types (yet), but when we do, it will save us some potential headaches like incorrect usage or unknown arguments
2021-11-09 11:57:26 -08:00
Christopher Hiller b7c230c1e9 fix(appium): properly validates config files containing extension config
When combining extension schemas with the base schema, the keywords weren't quite right (the extension name was not being recognized in any config files).

refactored a few things to support this, but the nut of it is in `AppiumSchema#finalize`, where we no longer use `anyOf`.  I added a couple more functions to `ArgSpec` which generate various IDs and references in order to avoid having mysterious calls to `_.kebabCase()` everywhere.

in addition:

- no longer breaks if the exact same extension tries to register itself twice.  this can happen if one happens to, say, instantiate multiple `DriverConfig`s.  this happens in the tests.  it _should_ not happen, since it's really unnecessary, so instead of this, we have a `DriverConfig.getInstance()` (and for `PluginConfig`) which keeps track of singletons linked to `APPIUM_HOME` dirs.  at runtime, we're unlikely to ever need to instantiate multiple instances of these classes _anyway_, so it's on a per-appium-home basis mainly for testing purposes.  the constructors are still usable directly, but discouraged (now marked `@private`).
- updated tests to reflect this change.  in at least one place in the tests, we're trying to get at the actual extension class constructor, and were instantiating an extra `DriverConfig` to do that--but now we do not need to, as `DriverConfig.getInstance()` just grabs the one already created when we called `runExtensionCommand()`.
- removed unused `AppiumSchema#getAllSchemas`
- renamed "ID" to "ref" to be more clear about which identifier we're talking about--a schema reference, as one would put in a `$ref` field
- renamed arg `<extension-type>s` to `use-<extension-type>s` wherever necessary, since that arg was renamed; fix a bunch of fixtures
- restore default value of `[]` to `use-plugins`, since the code expects it to be defined
2021-11-09 11:57:26 -08:00
Christopher Hiller 0ef53d4e99 fix(gulp-plugins): fix potential race condition re: gulpfile.js
the `configure()` function in the spawn watcher could fail in some circumstances because because the task created by the call to `this.gulp.watch('./gulpfile.js')` does not actually signal completion, which can cause gulp to fail with a "did you forget to signal async completion?" error.

instead of trying to watch gulpfiles, we can just ignore them.  not ideal, but at least it won't break.
2021-11-09 11:57:26 -08:00
Christopher Hiller 867cdbcfdc chore(appium): refactor validation by referencing properties directly
previously, we'd create a new schema for every single argument.  I felt this was probably wrong... and I was right.  `ajv` allows getting the schema (and thus validation) by reference path!  so `appium.json#/properties/server/properties/address` would be the schema for `address`.
this necessitated storing the reference path for each argument, so `ArgSpec` was updated to reflect that.  further, we add references (`$ref`) to each schema added by each extension under an `anyOf` prop of the `driver` and `plugin` config attributes.

- in addition, added some more tests to more thoroughly cover branches and define behavior (especially in `toParserArgs()`)
- moved some tests into `test/schema/`
- added a couple tests for `ArgSpec`
- renamed `--plugins` to `--use-plugins` and `--drivers` to `--use-drivers`
- schema updated to nest `driver` and `plugin` under `server`.  `server` is now currently the only top-level prop.
- removed all hard-coded `$id` fields from arguments, as they aren't needed anyway (and maintaining them is likely going to be a source of bugs)
- `ArgumentDefinition` type becomes `ArgumentDefinitions` and is now a `Map`, as it's basically a devolved `Map` anyway.
- fixed problem with extensions using `appiumCliAliases`, which could allow conflicts with base appium server args.
- add some missing `appiumCliDescription` fields
2021-11-09 11:57:26 -08:00
Christopher Hiller c67b26f861 chore(schema): finish converting AppiumSchema to singleton
- `lib/schema/schema.js` now exports bound methods from the `AppiumSchema` instance
- add some specific error types
- expose `ArgSpec.toId` which is helpful if we have all of the information about an argument, but don't have its unique ID handy
- much docstrings/types
2021-11-09 11:57:26 -08:00
Christopher Hiller cab0c4c3f2 chore(appium): maintain struct to help translation of arguments
- see `schema/arg-spec.js`
- avoids problems with weirdly-named extensions
- make arg handling easier to reason about
- significantly improve speed of default value checks
- remove unused `warnNodeDeprecations`
- move extension schema reading to `extension-config`
- add a `ReadonlyMap` util class
- fixed issue with incorrectly-derived CLI argument
2021-11-09 11:57:26 -08:00
Christopher Hiller 6e362a1249 chore: update 'dev' script to NOT notify 2021-11-09 11:57:26 -08:00
Christopher Hiller 37de68df68 chore(appium): review changes
- some reformatting + import organization
- renamed some unclear variables
- created more constants
- remove schema migration code
- remove log-fiddling in `config-file-e2e-specs.js`
2021-11-09 11:57:26 -08:00
Christopher Hiller 40a5bac610 chore(fake-driver): add missing LICENSE 2021-11-09 11:57:26 -08:00