Commit Graph
269 Commits
Author SHA1 Message Date
Jonathan Lipps ca90a11813 Publish
- appium@2.0.0-beta.24
 - @appium/base-driver@8.2.3
 - @appium/doctor@1.16.8
 - @appium/eslint-config-appium@5.0.1
 - @appium/fake-driver@3.2.3
 - @appium/gulp-plugins@6.0.1
 - @appium/support@2.55.3
 - @appium/test-support@1.3.10
2022-01-11 13:04:16 -08:00
Jonathan Lipps 7d8d547fbd fix(support): allow @u4/opencv4nodejs in addition to the old one, and promote it in doctor instead 2022-01-11 12:56:05 -08:00
Mykola Mokhnach 40a6f054dc fix: Switch colors package to a non-compomised repository (#16317) 2022-01-11 06:45:13 +01:00
Mykola Mokhnach d69fc6002c refactor(base-driver): Make configureApp helper more flexible (#16168) 2021-12-15 09:51:00 +01:00
Christopher Hiller af96879cfd feat(appium): add --show-config (#16207)
* feat(appium): rename --show-config to --show-build-info

* feat(appium): add --show-config

This adds a new CLI flag: `--show-config`.  When called, this will dump the values of a) arguments to the `init()` function of `main.js` _or_ args passed thru CLI, b) any config pulled from a config file, and c) the defaults as defined in schemas.

Each section is separated, and `undefined` values are omitted.

Instead of a JSON blob, the output just uses `console.dir()`.

To make this work, some refactors were needed:

- Use of `store_true` "action" for `argparse` in are now `store_const` with `const: true` because `store_true` sets the value to `false` if the flag is not present.  This essentially assigns the default value of the flag (`false`) before it should; default values must come from the schemas.
- Along those lines, removed default values from the "extra" boolean args in `args.js`
- The CLI parser now ignores `undefined` values of arguments

Other:

- Created some types for extension classes and added the `server` prop to `AppiumDriver`.
- Enabled TS checks on `lib/config.js` (where `showConfig()` lives) and `test/config-specs.js`
- Removed unnecessary call to `validate()` in `preflightChecks()`; CLI arguments are validated individually (defined in `lib/schema/cli-args.js`) and the config file is validated separately (defined in `lib/config-file.js`).
- Add more types to `main.js`; rewrite `getServerUpdaters` in lodashese for fun (which I am happy to revert)
- Fix missing type aliases in `test/cli/cli-helpers.js`
- Misc types/refactors in `config-specs.js`
- Update parser tests to reflect that `undefined` values and empty objects are eliminated from the parsed arguments

Notes:

- The `showBuildInfo()` test in `config-specs.js` (which is ostensibly a unit test) forks `git` and also seems to require network connectivity, at least on my box. This stuff should be stubbed out or moved into an E2E test.

Resolves #15672

* chore(appium): remove unused options in `toParserArgs()`
2021-12-14 11:47:10 -08:00
Kazuaki Matsuo 9a85a41b9e fix(base-driver): follow W3C capabilities more strictly (#16193)
* fix(base-driver): strict capabilities to follow W3C spec more strictly

* fix typo

* just leave a warning message
2021-12-12 01:49:20 +09:00
Renovate Bot 25087c3ee0 chore(gulp-plugins): update dependency @types/node to v16.11.12 2021-12-07 11:30:18 +00:00
Christopher Hiller e074fee89f fix(appium): disallow unsupported schemas
Some theoretical schemas are not in any sort of shape Appium can use, so we now catch them as soon as possible (at the registration phase).

- adds  type guard
- adds
2021-12-03 11:47:43 -08:00
Christopher Hiller 20d95e4531 fix(appium): correctly apply extension defaults
Extensions were not correctly receiving the default values as specified in their schemas.  For example, in `xcuitest` driver, the `wdaLocalPort` option has a default value of `8100`, but this value would never make it to the driver.

The root cause was that `getDefaultsForSchema()` returns a _flattened_ object (which is useful for displaying to users as part of `getNonDefaultServerArgs()`), but by the time defaults should get assigned to parsed arguments in `main.js`, the parsed arguments object has already been expanded to a deeply-nested, non-flattened object.  So `"driver.driverName.argName": "value"` would be set in the args, but  not `{"driver": {"driverName": {"argName": "value"}}}`.  Furthermore, the properties of `cliArgs` are not prefixed with `<extType>.<extName>.`, but are just the arg name itself (which makes sense).

To address this, two main changes:

1. `getDefaultsForSchema(flatten = true)` (renamed from `getDefaultsFromSchema()`) now accepts a `flatten` flag, which will return a flat object using `<extType>.<extName>.`-style prefixes. This is useful (and less computationally intensive) for comparing defaults across the whole of Appium and its extensions.  This is _not_ useful when merging defaults into the parsed arguments object, however, as that object will be deeply-nested.  If `flatten` is `false`, a deeply-nested object will be returned, which is consumed by the `main` module when post-processing parsed CLI arguments and config file values.
2. Added `getDefaultsForExtension(extType, extName)` which acts like `getDefaultsForSchema(flatten = true)` _but_ only returns defaults for a particular extension _and_ strips the leading prefixes.  This is used by `assignCliArgsToExtension` in the `AppiumDriver` class.

Other changes:

1. `ArgSpec` now keeps a `rawDest` property which is like `dest` w/o the prefixes.
2. Make more types
3. Re-organize `driver-specs` unit test somewhat, and update to reflect changes.
2021-12-03 11:25:34 -08:00
Jonathan Lipps 7b3893a362 fix(appium): fix incorrect handling of delete session with regard to plugin driver assignment
also take the opportunity to constantize a few more strings
2021-12-01 09:42:25 -08:00
Jonathan Lipps f51094157d chore(appium): make some appium plugins available via short name 2021-12-01 09:28:28 -08:00
Renovate Bot 0db3ec49f8 chore(gulp-plugins): update dependency yargs to v17.3.0 2021-12-01 15:51:46 +00:00
Renovate Bot 62f1894838 chore(gulp-plugins): update dependency eslint-plugin-promise to v5.2.0 2021-12-01 14:01:28 +00:00
Renovate Bot 80e77e2681 chore(doctor): update dependency appium-adb to v8.17.0 2021-12-01 10:33:54 +00:00
Mykola Mokhnach e947204351 chore(fake-driver): Bump xmldom version (#16182) 2021-11-30 21:43:40 +01:00
Renovate Bot 1e4c3e6f6d chore(gulp-plugins): update dependency @types/node to v16.11.11 2021-11-30 10:23:02 +00:00
Mykola Mokhnach 07887b7c18 refactor(base-driver): Always assume the returned responses are in W3C format (#16175) 2021-11-29 22:55:48 +01:00
Christopher Hiller 88e351fc2d fix(appium): fix behavior of ReadonlyMap to be compatible with Map 2021-11-29 11:19:45 -08:00
Mykola Mokhnach daed9be750 refactor(doctor): Remove obsolete iOS-related verifications (#16169) 2021-11-29 07:39:54 +01:00
Renovate Bot c03d98b4ee chore(gulp-plugins): update dependency @types/node to v16.11.10 2021-11-24 11:08:59 +00:00
Renovate Bot 618f4ebb87 chore(base-driver): update dependency ws to v7.5.6 2021-11-24 09:23:38 +00:00
Christopher Hiller 74a5911515 fix(appium): make object dumps less weird
The `inspectObject()` function in `utils` was doing... stuff... to display both the default caps and non-default arguments.  Arrays, in particular, wound up looking like objects.  I found this objectionable; I hope there isn't a good reason it's this way.

- Remove `utils.inspectObject()` and replace it with `inspect()`, which delegates to Node.js' built-in `util.inspect()` function (which does a bang-up job of dumping objects, including color!)
- Remove the `parser` argument (and return value!) from various functions where it was used.  e.g., `init()` in `main.js` was returning the `parser` instance, but now we don't need it, since it was only needed for `getNonDefaultServerArgs()`, which doesn't need it.  `parser` was being passed through several functions this way.
- Add a dumb test for `utils.inspect()`
- Add another dumb test for `getNonDefaultServerArgs()`
- Add `@types/express` since it was missing.
- More types in various associated places; fix other types
- Consistent naming in impl of `getNonDefaultServerArgs()`
2021-11-23 13:54:59 -08:00
Jonathan Lipps 280d409df6 Publish
- appium@2.0.0-beta.23
 - @appium/base-driver@8.2.2
 - @appium/fake-driver@3.2.2
2021-11-23 09:56:08 -08:00
Jonathan Lipps 0e7b19aabe chore!(base-driver): remove support for execute driver script since it will be a plugin moving forward 2021-11-23 09:54:19 -08:00
Jonathan Lipps 221a3ecd52 feat(appium): make server host/port information available to drivers and thereby plugins 2021-11-23 09:54:19 -08:00
Christopher Hiller cfa7f003b8 chore(appium): print npm output upon error
This change causes additional output if/when `npm` fails when run in a subprocess.
2021-11-22 12:04:10 -08:00
Renovate Bot 254923b471 chore(appium): update dependency ajv to v8.8.2 2021-11-22 12:09:49 +00:00
Christopher Hiller e36a701058 Publish
- appium@2.0.0-beta.22
 - @appium/base-driver@8.2.1
 - @appium/doctor@1.16.7
 - @appium/eslint-config-appium@5.0.0
 - @appium/fake-driver@3.2.1
 - @appium/gulp-plugins@6.0.0
 - @appium/support@2.55.2
 - @appium/test-support@1.3.9
2021-11-19 12:07:28 -08:00
Renovate Bot 894a5928ac chore(test-support): update dependency source-map-support to v0.5.21 2021-11-19 13:23:40 +00:00
Renovate Bot 4aa28b0635 chore(gulp-plugins): update dependency @types/node to v16.11.9 2021-11-19 11:43:03 +00:00
Christopher Hiller 0b4f714549 chore(appium): rename appiumCliIgnore to appiumCliIgnored
which, hopefully, is more indicative that we have a boolean
2021-11-18 12:22:15 -08:00
Christopher Hiller b04d26ca70 test(appium): better metadata about failed appium executions, hopefully
- type fiddling
2021-11-18 12:22:15 -08:00
Christopher Hiller aa69388c7a feat(appium): support for deprecated arguments
This PR adds the `appiumDeprecated` keyword which can be used to mark an argument as deprecated in the `--help` text.

In addition:

- fix a bug where `--help` would cause Appium to exit with a nonzero exit code (it would essentially `throw undefined`)
- remove unused `lib/cli/argparse-actions` and stuff that used it, since that stuff was also unused
- implement `appiumCliIgnore`, though it's not actually being used atm.
- extract helpers for running `appium` into `test/cli/cli-helpers.js`
2021-11-18 12:22:15 -08:00
Christopher Hiller 91c3ff7f19 chore: attempt to get install-fake-driver working again in CI 2021-11-18 12:08:50 -08:00
Christopher Hiller 9a4fdaece5 test(support): fix busted path in mjpeg-e2e-specs 2021-11-18 12:08:50 -08:00
Christopher Hiller 7fb1667a3b fix(eslint-config-appium): switch to peerdeps
BREAKING CHANGE:

ESLint expects configs or plugins which require other configs or plugins to have _peer dependencies_ of those things _and_ of ESLint itself.  All deps have been changed to peer deps, and this module now requires the installation of the following _if_ using npm older than v7:

```
    "@babel/core": "7.16.0",
    "@babel/eslint-parser": "7.16.3",
    "eslint": "7.32.0",
    "eslint-plugin-import": "2.25.3",
    "eslint-plugin-mocha": "9.0.0",
    "eslint-plugin-promise": "5.1.1"
```

npm@7 will install these automatically if they do not exist.
2021-11-18 12:08:50 -08:00
Christopher Hiller b3771b0042 fix(gulp-plugins): do not transpile pkg root .js files by default
BREAKING CHANGE:

Package-root `.js` files (typically `index.js`) are now (typically) cjs wrappers.  These files needn't be transpiled, and in fact, doing so will create an invalid module because it will attempt to reference `build/whatever` but the resulting artifact would live in `build/index.js`.  `build/index.js` will no longer exist.
2021-11-18 12:08:50 -08:00
Christopher Hiller 57f39c5488 fix(test-support): create cjs wrapper 2021-11-18 12:08:50 -08:00
Christopher Hiller 0d7019273b fix(support): create cjs wrapper 2021-11-18 12:08:50 -08:00
Christopher Hiller a93f37ad06 fix(fake-driver): create cjs wrapper 2021-11-18 12:08:50 -08:00
Christopher Hiller 69820eaf93 fix(doctor): move index to support cjs wrapper 2021-11-18 12:08:50 -08:00
Christopher Hiller 85cd55bc2c fix(base-driver): create cjs wrapper 2021-11-18 12:08:50 -08:00
Christopher Hiller 24596d67b0 fix(appium): create cjs wrapper 2021-11-18 12:08:50 -08:00
Christopher Hiller 46a2041fbd fix(appium): enable --relaxed-security
The `relaxed-security` option should be stored in a property named `relaxedSecurityEnabled`, but it was stored in one named `relaxedSecurity`, which broke the functionality

Ref: https://github.com/appium/appium/discussions/16103#discussioncomment-1655985
2021-11-17 18:34:30 -08:00
Christopher Hiller 22de31d6ae chore(appium): remove unused fixture 2021-11-17 18:34:30 -08:00
Jonathan Lipps 00f578dedb docs(appium): --plugins is now --use-plugins 2021-11-17 10:38:04 -08:00
Renovate Bot c17a9e4ede chore(gulp-plugins): update babel monorepo to v7.16.4 2021-11-17 11:48:28 +00:00
Renovate Bot 9ad8eb3b3a chore(appium): update dependency ajv to v8.8.1 2021-11-17 10:03:53 +00:00
Kazuaki Matsuo e7ea40a656 Revert "chore(support): update dependency klaw to v4" (#16105)
This reverts commit 6095fae8c3.
2021-11-17 05:43:22 +09:00
Christopher Hiller 192f5eb0b9 Publish
- appium@2.0.0-beta.21
2021-11-15 17:08:20 -08:00