Compare commits

...
Author SHA1 Message Date
Jonathan Lipps 3ec3a0efa5 Publish
- appium@2.0.0-beta.28
 - @appium/base-driver@8.4.0
 - @appium/doctor@1.16.12
 - @appium/eslint-config-appium@5.0.3
 - @appium/fake-driver@3.2.7
 - @appium/gulp-plugins@6.0.3
 - @appium/opencv@1.0.3
 - @appium/schema@0.0.1
 - @appium/support@2.57.0
 - @appium/test-support@1.3.14
 - @appium/types@0.1.0
2022-04-07 16:12:21 -07:00
Jonathan Lipps f971aa9f1c chore(appium-monorepo): fix preversion script by removing schema reference 2022-04-07 16:09:06 -07:00
Christopher Hiller 3adf4d4283 chore: fix dev scripts 2022-04-07 14:24:10 -07:00
Christopher Hiller f33b87bbf9 chore(appium,types,schema): create @appium/schema
`@appium/schema` is a package which was extracted from `appium`.  It _only_ contains the schema.  The impetus here was to avoid cyclical dependencies, since `appium` depends on `@appium/types`, and `@appium/types` depends on the schema.  This package breaks the cycle.

The `scripts/generate-schema-json.js` (which converts the compiled JS schema file into JSON) has moved into this package, and the generated JSON file is now under version control.  This is because the `generate-schema-types.js` script (previously `generate-schema-declarations`) depends on it, and `@appium/types` depends on the generated types.  The generated types are _also_ under version control.  I do not expect the schema to change often, so I believe the tradeoff to be worth it.

## @appium/schema

`lib/appium-config-schema.js` is the "single source of truth" for the schema.

## appium

- Removed schema source
- Removed namespaces from internal types because they suck (see change to `types/index.d.ts`)
- Removed unused `continuation-local-storage`
- Add dep for `@appium/schema`
- Added a TS project dependency on `@appium/schema`

## @appium/types

- The "sources" have moved from `src` to `lib` for consistency.
- `lib/appium-config.ts` (the generated types) are now under version control.
- `lib/schema/` has been removed (it previously held the JSON schema artifact)
- `scripts/generate-schema-declarations.js` becomes `scripts/generate-schema-types.js`
- Updated scripts in `package.json`
- Added dep for `@appium/schema`
- Added a TS project dependency on `@appium/schema`

## Other

- Reorganize root `tsconfig.json`; add `schema` reference; remove unused `noEmit: true`
- Sort root `package.json`
- Remove schema JSON and schema declarations scripts, since those are now both handled in their respective packages
- Remove `lint-staged` config for schema file, since it didn't work right anyway (still need to do something about this, but probably doesn't need to be in a precommit hook)
- Remove stuff from `.gitignore`
2022-04-07 14:05:41 -07:00
Renovate Bot c8227d8ab8 chore(support): update dependency semver to v7.3.6 2022-04-07 17:58:14 +00:00
Renovate Bot 02706de19d chore(gulp-plugins): update babel monorepo to v7.17.9 2022-04-07 14:51:07 +00:00
Renovate Bot 6701251411 chore(doctor): update dependency appium-adb to v9.2.1 2022-04-07 11:37:22 +00:00
Renovate Bot bc36b8dfcc chore(gulp-plugins): update dependency eslint-plugin-import to v2.26.0 2022-04-06 13:39:35 +00:00
Renovate Bot 4060c17cc6 chore(fake-driver): update dependency @xmldom/xmldom to v0.8.2 2022-04-06 10:39:12 +00:00
Renovate Bot fa20f8058f chore(appium): update dependency winston to v3.7.2 2022-04-05 12:39:42 +00:00
Kazuaki Matsuo 8f4a5e9752 ci: drop nodejs 12, add 17 (#16703)
* ci: drop nodejs 12, add 18

* 17, not 18 yet as maximum version

* test: increase timeout
2022-04-05 15:31:25 +09:00
Renovate Bot 7c7a290cfa chore(doctor): update dependency appium-adb to v9 2022-04-04 15:30:56 -07:00
Renovate Bot 919d55d1cb chore(gulp-plugins): update dependency fancy-log to v2 2022-04-04 15:25:38 -07:00
Kazuaki Matsuo 4235f27445 docs(appium): merge from master (#16672) 2022-04-04 15:20:18 -07:00
d23907def5 chore: update dependency webdriverio to v7 (#15489)
* chore(): update dependency webdriverio to v7

* chore(fake-driver,appium): upgrade webdriverio to latest

- fixed broken tests in `@appium/fake-driver` and `appium`
- remove unused `appium-base-driver` from root of monorepo

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Christopher Hiller <boneskull@boneskull.com>
2022-04-04 15:14:59 -07:00
Renovate Bot dd38c6f42c chore(base-driver): update dependency body-parser to v1.20.0 2022-04-04 15:13:29 +00:00
Renovate Bot 2a5f7c2b73 chore(support): update dependency moment to v2.29.2 2022-04-04 12:19:16 +00:00
Renovate Bot 3f388b935a chore(): update dependency @types/base64-stream to v1.0.2 2022-04-01 23:31:46 +00:00
Mykola Mokhnach a9651d3c59 fix(base-driver): Update/simplify the logic for logger prefix (#16683) 2022-04-01 22:34:57 +02:00
Renovate Bot a91d283128 chore(support): update dependency type-fest to v2.12.2 2022-04-01 11:55:17 +00:00
Mykola Mokhnach d8a9b4da36 feat(base-driver): Add more shadow root-related W3C routes (#16700) 2022-03-31 17:46:44 +02:00
Renovate Bot 4f41ec3c7a chore(base-driver): update dependency lru-cache to v7.7.3 2022-03-31 13:25:29 +00:00
Christopher Hiller 8c3d9ec347 docs: add migration information for nodeconfig, allow-insecure and deny-insecure
Closes #16593
2022-03-30 14:43:47 -07:00
Christopher Hiller 0bbec13d1e fix(appium): allow multiple drivers to be installed
Closes #16674

the problem here was the existence of the empty `package.json`.  it should exist, because if it doesn't, then `npm` may end up using a `package.json` in a parent directory.  but it can't be _empty_, because subsequent `npm install`s will essentially remove any package that it's currently not installing!  `npm` likes to "fix" `node_modules`, which is undesirable here.

to avoid this, the behavior has changed to persisting the dependency version to `package.json`.  behavior differs if we're using a local `APPIUM_HOME` or the default one.  with the default, we have more control, and choose to use `--save-dev --save-exact --no-package-lock --global-style` which gives us what we need.  if `APPIUM_HOME` is a local package, all we can do is `--save-dev` (since it's _likely_ that an extension will be a dev dependency).  in the future, we may choose to actually determine _what kind_ of dependency `appium` is and tell `npm` to use the same one.  not sure if that's needed, though.

further, in the case of a local appium dep (local `APPIUM_HOME`), updating `package.json` should cause the package hash (used by the thing that syncs `extensions.yaml` with installed packages) to update as well, so we're doing that.

modified the logic in `ExtensionCommand` to treat `--source=local` to pass the `installSpec` thru verbatim.

also fixed `BuildInfo` type to reflect reality and use `@types/teen_process`.  fixed some other broken types in `test` (files in `test` are not checked by typescript yet; we'll need a separate `tsconfig.json` for this, since we do not want to emit declarations)
2022-03-30 14:43:21 -07:00
Christopher Hiller 61b05063ee fix(support): avoid 'npm link' for local-sourced extensions
'npm link' is weird and we do not need to use it.  `npm install /path/to/some/module` will create a symbolic link, but it _won't_ create a global link.  it otherwise behaves similarly to `npm install`.

- also updated to use `@types/teen_process`
- fixed some weird types in `util.getLockFileGuard()`
2022-03-30 14:43:21 -07:00
Christopher Hiller 7a028c8d9a chore: add types for teen_process
which magically appeared. thanks definitelytyped!
2022-03-30 14:43:21 -07:00
Christopher Hiller 06f75a281c chore(base-driver): remove ts-expect-error directive from elementShadowRoot route 2022-03-30 14:42:56 -07:00
Christopher Hiller 47b0df06ec fix(types): add method for elementShadowRoot 2022-03-30 14:42:56 -07:00
Christopher Hiller b7b8b12eff chore(appium): switch type of inner drivers
This PR changes the type of inner drives from `Driver` to `ExternalDriver`, which is more accurate.
2022-03-30 14:42:22 -07:00
Renovate Bot 6fbff601b6 chore(base-driver): update dependency lru-cache to v7.7.2 2022-03-30 10:23:14 +00:00
Renovate Bot e5ad7a9fd8 chore(workflows): update actions/checkout action to v3 2022-03-29 17:46:52 -07:00
Jonathan Lipps 54f1308a36 chore: fix reinstall script and clean ordering 2022-03-29 17:46:16 -07:00
Christopher Hiller 826de8c346 chore(doctor): remove gulp
- removes gulp, builds w/ babel, tests w/ mocha
- reorg test files
2022-03-29 15:56:02 -07:00
Christopher Hiller 3833b237df chore(opencv): remove gulp
- build now happens via babel
- test now happens via mocha
- renamed/reorganized test files
2022-03-29 15:55:48 -07:00
Christopher Hiller d400405296 chore(test-support): remove gulp
- use mocha, babel
- reorg test files
2022-03-29 15:55:34 -07:00
Christopher Hiller e439387d5c docs(types): add README.md
- update keywords
2022-03-29 15:55:16 -07:00
Christopher Hiller 7498a7ab90 chore: add a script to sync LICENSE files across packages
This will be run before publish, and will copy the root `LICENSE` file to all packages, so that they appear in the published tarballs.

`packages/*/LICENSE` are ignored by Git, since they are redundant with the root `LICENSE` file.
2022-03-29 15:54:55 -07:00
Mykola Mokhnach 6973f54e06 chore: Fix indentation (#16678) 2022-03-29 08:00:54 +02:00
Mykola Mokhnach c63e9bf8e0 fix(base-driver): Make sure we never mutate incoming args (#16670) 2022-03-28 20:35:37 +02:00
Renovate Bot 25fab42940 chore(test-support): update dependency sinon to v13 2022-03-28 11:28:31 -07:00
Renovate Bot 3bfee19a66 chore(workflows): update actions/setup-node action to v3 2022-03-28 11:27:40 -07:00
Renovate Bot 6cf1590a2d chore(): update dependency @types/json-schema to v7.0.11 2022-03-26 17:39:51 +00:00
Renovate Bot b6b9a2b019 chore(support): update dependency type-fest to v2.12.1 2022-03-26 10:49:56 +00:00
Renovate Bot 9b6565b3ba chore(gulp-plugins): update dependency eslint-plugin-promise to v6 2022-03-25 15:25:20 -07:00
Christopher Hiller 06a605420d feat(appium): generate declaration files (#16597)
* feat(appium): generate declaration files

Configure TS to generate declaration files for `appium` package.

Most of these changes are just types getting added or changed via docstrings; in other places, typechecking has caught problems and I had to refactor code to address them.

- Removed `// @ts-check` pragma from all files in `lib/`, since now `checkJs: true` is in `tsconfig.json`.  It needs to stay in place elsewhere (I think) because only sources in `lib` have declarations generated.
- The `install`, `uninstall`, `update` and `run` functions in the base `ExtensionCommand` class were renamed and prefixed with a `_`; TS does not allow overridden functions with differing signatures.   It no longer exports a default.
- Removed `type` prop of options for `DriverCommand` and `PluginCommand` constructors, respectively (this value is derived from the `ExtensionConfig` `config` parameter instead)
- `AppiumDriver` now extends `DriverCore` instead of `BaseDriver`, since some of its function signatures differ from `BaseDriver`'s.
- Small refactor of `deleteSession` to make typechecker happy.
- `executeCommand` now calls to `BaseDriver` directly if `isUmbrellaCmd` is truthy.  This is one place where inheritance just kind of breaks, since `BaseDriver#executeCommand` returns something entirely different than `AppiumDriver#executeCommand` would otherwise.
- Removed `--delete-dir-on-start` from build command, since it may blast generated declarations.
- Reorganize declarations in `types/`; moved some of them out of `@typedef`s. `types.d.ts` becomes `index.d.ts`
- Note that this contains the declarations for `PluginClass` and `DriverClass`, which correspond to the types of extension "main" classes. This differs from the interfaces provided in `@appium/types` (e.g., `Driver`, `ExternalDriver`) in that these aren't just objects; they are classes with constructors and static members. I may end up moving some of this stuff into `@appium/types`, but I'm not sure how useful it will be.  Will see when I add types to `@appium/fake-driver`.

* chore(appium): remove transpile directives
this was ostensibly for gulp-babel

* chore(appium): remove redundant type declaration

* fix(appium): avoid potential unhandled rejections

- make types more readable

* chore(appium): fix capabilities types

- move `scripts/generate*` elsewhere
- add reference to `@appium/types` in `tsconfig.json`

* chore(appium): review updates for legibility
2022-03-25 14:54:45 -07:00
Christopher Hiller 164bedb2f1 feat(base-driver): generate declaration files
This was not as easy as the other two.  The main issue involves the `BaseDriver` class and is threefold:

1. `BaseDriver` and a valid external subclass thereof (a `Driver`) are not the same, because the former is essentially _abstract_. There is no notion of an abstract class in JS nor in TS for JS.
2. Splitting `BaseDriver` into several modules and "mixing in" some modules is just not well-understood by TS.
3. `AppiumDriver` inherits _most_ of `BaseDriver`, but overrides some functions with differing signatures. This is unsupported by TS.

To work around these problems, I had to:

1. Move the `Driver` interface into `@appium/types`, since other packages may depend on it.  We do not want circular dependencies, which is likely to occur otherwise.  Further, there is no way to tell TS for JS that a class _implements_ an interface or type.
2. Refactor the mixins (in `basedriver/commands/`) into "mixin classes", as understood by typescript. These are dynamic classes returned by functions which accept a class parameter, and _extend_ that class. The result is marginally better, but the implementation is ... well, see for yourself.  It is not possible to use declaration merging to just "trick" TS into thinking that `BaseDriver` has all of these extra methods; classes cannot be merged, and even if you could, you can't use declaration merging to "add" methods afaict.
3. `BaseDriver` is now an empty class which inherits from all mixins applied to `DriverCore`.  Due to syntactic restrictions, it must be a `class` statement in order to use the `@implements` tag, which causes TS to check that the result fully implements `Driver`.  `AppiumDriver` _also_ inherits from `DriverCore`, since it does not override `BaseDriver` "properly".  `BaseDriverCore` itself is pretty small, containing only those functions which `AppiumDriver` defines as differing.

Otherwise:

- `BaseDriver` does not inherit from `Protocol`, which is just an empty class. `Protocol` was removed.
- All of the error classes are exported from `protocol/errors`, because TS cannot see them otherwise.
- Exported missing `GET_STATUS_COMMAND` from `protocol/index`
- Re-exported `normalizeBasePath` from `server` instead of `protocol`, since that's where it's defined
- Removed `index.d.ts`
- Mixins use `@implements` as well. Note that `@implements` does not support `import('..')` syntax.

chore(base-driver): attempted to make types for mixins less awful

fixed a couple issues in the types in `driver.js`

core(base-driver): add capabilities types

- also move the bluebird config into the index
- fix references to `DriverOpts`
- add `assignServer()` to `BaseDriverCore`, used by `AppiumDriver`

chore(base-driver): fix more types

add missing reference to `@appium/types` in `tsconfig.json`

fix(base-driver): ensure getLogEvents is async

fix(base-driver): add some more type checks and fix logCustomEvent to be async

chore(base-driver): reformat
2022-03-25 14:54:45 -07:00
Christopher Hiller 326b7b4e06 feat(support): generate declaration files
Most of these changes are the addition of types.  There are a few places in which the typechecker found weirdness, and I have addressed those.

- In `logging.js`, `parseInt()` was being called on props of `process.env`; this is not allowed, because `parseInt()` only accepts a string, and props may be `undefined`.
- In `log-internal.js`, I had to remove the `raiseError()` function because TypeScript is unable to understand that a function, when called, will always throw.  The fix was just to replace with `throw new Error...`
- Introduced a var in `mjpeg.js` to avoid repeated casting
- Added some type guards to `net.js`. as function parameters, union types kind of suck. This is definitely one place TS would have helped, since it allows function overloads.  Also dropped use of deprecated `url` module in lieu of W3C `URL`.
- Removed some old-node-version cruft from `util.js`.

Non-code changes:

- Needed to use an override for `type-fest`, as it's included as a transitive dependency, but otherwise is only present in the devdeps of the monorepo root `package.json`. This means, due to version conflicts, a `support/node_modules/type-fest` would be created with an old, incompatible version, which would be preferred over the monorepo one due to Node's resolution algorithm.  This needs npm v8.3+ to work properly, but is only a problem for contributors (not consumers).
- Pinned type of `opencvv-bindings`.
- No longer deleting `build` dir before transpilation since it may contain generated declarations!
2022-03-25 14:54:45 -07:00
Christopher Hiller 72085caa0a feat(types): add new @appium/types package
This changes the TS configuration to to a) emit declarations for supported packages, and b) build declarations incrementally by package.

To begin, we are targeting `appium`, `@appium/base-driver` and `@appium/support` for declarations; these three are intended to be published with declarations generated via their JS.

Both `@appium/support` and `appium` are fully typechecked (sans implicit `any` types), but `@appium/base-driver` is mostly not.  Regardless, declarations are generated for all three.

Each package will have its own `tsconfig.json` which "inherits" from `config/tsconfig.base.json`.  Each will also need to declare relative paths to dependencies. e.g., the `appium` package must configure its `tsconfig.json` so that it depends on the declarations of `@appium/support` and also where to find `@appium/support`. Essentially, a small dependency tree gets built, and those at the "root" get their declarations built first; then the consumers use those declarations.

Also reorganized some scripts and added `npm-run-all` to help and added a "typecheck" job to CI.

Since `npm install` will build, it's pretty inconvenient to have `npm` abort installation if the build fails.  In that case, if any of the build steps fail (see `build:loose`) the installation will continue.  Added a `prepublishOnly` which runs a build in "strict" mode where everything must pass.

_Note: there's still a strong coupling of "what `BaseDriver` provides" and "what an external driver *may* provide".  It's unclear to me if this is a problem, though there seem to be a handful of methods that external drivers *must* implement.  The easiest way to get around this would probably be to extract these required properties and methods into their own interface (duplication) if we cannot otherwise declare methods as "abstract".  As it stands, the `Driver` is basically just `BaseDriver`._

Also:

- Moved some configuration types out of `appium` and into here, since they are used both by `appium` and `base-driver` via `DriverOpts`
- Split `Driver` type into "the thing that BaseDriver is" and "all the other methods external drivers can implement"
- Added missing `proxyCommand` method
- Better generics for `LogType`
- Remove unused `Constructor` type
- Better types for `getSession`/`getSessions`
- Added util `Class` type
- Added many missing typings from DefinitelyTyped
- Added `ts-node` for `@wdio/types` (I need to send a PR to webdriver to eliminate this dependency)
- Type checks in their CI step
2022-03-25 14:54:45 -07:00
Renovate Bot 4ff63e2425 chore(): update dependency serve-static to v1.15.0 2022-03-25 14:43:56 +00:00
Renovate Bot a4229f9382 chore(doctor): update dependency inquirer to v8.2.2 2022-03-25 12:09:52 +00:00
Renovate Bot 075eaeb8ce chore(): update dependency typescript to v4.6.3 2022-03-25 09:30:00 +00:00
Renovate Bot 523301199a chore(support): update dependency plist to v3.0.5 2022-03-24 11:48:16 +00:00
Renovate Bot 6cf9c63da2 chore(appium): update dependency lilconfig to v2.0.5 2022-03-24 10:02:20 +00:00
Jonathan Lipps 6d35def9ed Publish
- appium@2.0.0-beta.27
 - @appium/base-driver@8.3.1
 - @appium/doctor@1.16.11
 - @appium/fake-driver@3.2.6
 - @appium/support@2.56.1
 - @appium/test-support@1.3.13
2022-03-23 11:50:58 -07:00
Christopher Hiller 77727dc913 fix(support): add missing resolve-from dependency
see https://github.com/appium/java-client/issues/1667
2022-03-23 11:44:51 -07:00
Mykola Mokhnach bbfc7ef51d fix(base-driver): Use WeakRef to reference the driver instance in the log prefix generator (#16636) 2022-03-23 18:48:33 +01:00
Renovate Bot 21d337f976 chore(appium): update dependency ajv to v8.11.0 2022-03-23 13:36:43 +00:00
Renovate Bot 1a73ac0b75 chore(): update dependency finalhandler to v1.2.0 2022-03-23 10:34:34 +00:00
Christopher Hiller 35d9dc7ebc chore(base-driver): ungulpify
This PR removes Gulp from `@appium/base-driver` and reorganizes the test files.

The build needs to be a little different since other modules depend on its `build/test/basedriver` module.  IMO this should probably get moved elsewhere, but this does not break compatibility.
2022-03-22 18:12:02 -07:00
Christopher Hiller 2877f90981 chore(fake-driver): gulp is dead, long live scripts
This PR removes Gulp from `@appium/fake-driver` as already done in a couple other packages.

Also: moved `screen.png` into `lib/` since `@babel/cli` can just copy it over into `build/`.
2022-03-22 18:11:37 -07:00
Jonathan Lipps f5cce0f29d Publish
- appium@2.0.0-beta.26
 - @appium/base-driver@8.3.0
 - @appium/doctor@1.16.10
 - @appium/eslint-config-appium@5.0.2
 - @appium/fake-driver@3.2.5
 - @appium/gulp-plugins@6.0.2
 - @appium/opencv@1.0.2
 - @appium/support@2.56.0
 - @appium/test-support@1.3.12
2022-03-22 13:41:57 -07:00
Renovate Bot 96fd7782eb chore(support): update dependency read-pkg to v5.2.0 2022-03-22 17:30:52 +00:00
Renovate Bot 56f5c87d91 chore(support): update dependency axios to v0.26.1 2022-03-22 16:27:35 +00:00
Renovate Bot 9fb03950d6 chore(gulp-plugins): update dependency mocha to v9.2.2 2022-03-22 14:08:48 +00:00
Renovate Bot 7f6d9f54fc chore(gulp-plugins): update dependency yargs to v17.4.0 2022-03-22 11:22:05 +00:00
Kazuaki Matsuo 3ee93ba5bd fix: revert 15809 (#16621)
* fix: revert 15809

* change comment
2022-03-21 10:10:35 -07:00
Renovate Bot c1054c7996 chore(gulp-plugins): update dependency globby to v11.1.0 2022-03-21 15:22:00 +00:00
Renovate Bot c5164f7743 chore(fake-driver): update dependency @xmldom/xmldom to v0.8.1 2022-03-21 12:37:19 +00:00
Renovate Bot 6ca1191bb2 chore(doctor): update dependency appium-adb to v8.18.0 2022-03-20 16:46:34 +00:00
Renovate Bot f947828e9b chore(base-driver): update dependency lru-cache to v7.7.1 2022-03-20 14:51:43 +00:00
Renovate Bot 0ebdd0ed78 chore(base-driver): update dependency http-status-codes to v2.2.0 2022-03-20 13:08:38 +00:00
Renovate Bot 840e5a767c chore(appium): update dependency winston to v3.6.0 2022-03-20 11:05:08 +00:00
Renovate Bot a2fc58cd93 chore(appium): update dependency ajv to v8.10.0 2022-03-19 18:06:19 +00:00
Renovate Bot c8ee934718 chore(): update dependency type-fest to v2.12.1 2022-03-19 15:24:03 +00:00
Renovate Bot 0b4dad2f4c chore(): update dependency eslint-find-rules to v4.1.0 2022-03-19 14:06:16 +00:00
Renovate Bot 799fb87be3 chore(gulp-plugins): update babel monorepo to v7.17.8 2022-03-19 11:13:48 +00:00
Renovate Bot 970017b208 chore(gulp-plugins): update dependency yargs to v17.3.1 2022-03-18 18:15:57 +00:00
Renovate Bot 43d36bb60c chore(): update dependency lint-staged to v12.3.7 2022-03-18 15:17:24 +00:00
Renovate Bot 06a8fe467c chore(gulp-plugins): update dependency node-notifier to v10.0.1 2022-03-17 16:38:06 +00:00
Renovate Bot ad0814532b chore(): update dependency @types/json-schema to v7.0.10 2022-03-17 12:35:15 +00:00
Renovate Bot 3add8c0906 chore(gulp-plugins): update dependency eslint-plugin-import to v2.25.4 2022-03-16 18:14:37 +00:00
Renovate Bot 3648ed017b chore(gulp-plugins): update dependency @types/node to v16.11.26 2022-03-16 16:43:48 +00:00
Renovate Bot 37c25e4546 chore(doctor): update dependency inquirer to v8.2.1 2022-03-16 16:13:41 +00:00
Renovate Bot 11fb7c1a2e chore(): update dependency lint-staged to v12.3.6 2022-03-16 13:29:50 +00:00
Renovate Bot 297a307725 chore(gulp-plugins): update babel monorepo to v7.17.7 2022-03-16 10:55:01 +00:00
Renovate Bot 1cc5a9e2cc chore(base-driver): update dependency ws to v7.5.7 2022-03-15 16:56:39 +00:00
Renovate Bot 7b6159cf2f chore(base-driver): update dependency express to v4.17.3 2022-03-15 14:12:16 +00:00
Renovate Bot 28a14da729 chore(base-driver): update dependency body-parser to v1.19.2 2022-03-15 11:44:51 +00:00
Renovate Bot 54b1f5276a chore(base-driver): update dependency async-lock to v1.3.1 2022-03-14 20:26:14 +00:00
Renovate Bot 8c3cca06e5 chore(appium): update dependency @appium/base-plugin to v1.8.1 2022-03-14 17:22:42 +00:00
Renovate Bot 84eb71fb0f chore(): update dependency serve-static to v1.14.2 2022-03-14 14:26:50 +00:00
Renovate Bot d1e0043e37 chore(): update dependency lint-staged to v12.3.5 2022-03-14 11:13:28 +00:00
Renovate Bot b57115b2f0 chore(): update dependency chai to v4.3.6 2022-03-13 16:37:42 +00:00
Renovate Bot 3a6b3c7788 chore(): update dependency appium-base-driver to v7.11.3 2022-03-13 14:34:57 +00:00
Renovate Bot 92d7359763 chore(): update dependency @types/sinon-chai to v3.2.8 2022-03-13 12:23:56 +00:00
Renovate Bot 9fc213aa7d chore(): update dependency @types/sinon to v10.0.11 2022-03-13 11:06:12 +00:00
Renovate Bot c5560ab238 chore(): update dependency @types/chai-as-promised to v7.1.5 2022-03-12 18:37:49 +00:00
Renovate Bot adcc2a28e9 chore(): update dependency @appium/fake-plugin to v1.3.1 2022-03-12 16:57:57 +00:00
Renovate Bot 94fe0f2ef8 chore(): update babel monorepo 2022-03-12 14:36:43 +00:00
Renovate Bot 9608fd74af chore(support): pin dependency opencv-bindings to 4.5.5 2022-03-12 12:10:27 +00:00
Kazuaki Matsuo eb378bf47e docs: update clipboard description from the master branch (#16559) 2022-03-11 16:44:23 +09:00
Kazuaki Matsuo 2de0e383cc chore(base-driver): address zip/unzip in the docstring of configureApp (#16548)
* fix(base): do not skip unzip even onPostProcess is function

* address unzip/zip
2022-03-10 11:22:54 -08:00
Renovate Bot 0f0616523e chore(support): update dependency npmlog to v6 2022-03-10 11:15:34 -08:00
Renovate Bot b4b4204818 chore(appium): update dependency @sidvind/better-ajv-errors to v1 2022-03-10 11:12:48 -08:00
Christopher Hiller 3ce313ebb9 chore(support): ditch gulp
This PR builds and tests `@appium/support` without Gulp.  Much like the changes to `appium`:

- Test files reorganized and renamed
- Tests run via `mocha` proper using `@babel/register` (no build needed)
- Build run via `@babel/cli`
2022-03-10 11:12:14 -08:00
Christopher Hiller a00119405a chore(appium): move babel-register setup to monorepo root
Since multiple packages will be using this file, it should probably just live here.
We will eventually be able to remove the `--require ../../test/setup-babel.js` from the testing scripts once we've gotten off of gulp entirely (it can be referenced in `.mocharc.js` instead)
2022-03-10 11:12:14 -08:00
Christopher Hiller 4b9bfb35aa chore: add directory prop to repository prop of package.json
I think npm uses this to link to the correct path of the package in a monorepo.
2022-03-10 11:10:35 -08:00
Christopher Hiller c653d2cf3b chore: lint the code once per build action
Previously, every version of Node.js would run eslint, which is redundant
2022-03-10 10:52:02 -08:00
Christopher Hiller 46942e0423 chore(appium): peer review changes
- add note about argparse tomfoolery
- refactor `list` command impl for better types
- rewrite exception in `driver-config`
- add `hasDriver`, `hasPlugin`, and small refactors in `manifest`
- add note about args in `grid-register`
- remove invalid comment in `main`
- more test coverage for `manifest`
2022-03-09 14:50:45 -08:00
Christopher Hiller d9fd258eee chore: make typedefs less verbose
`@typedef {Object} Foo` is the same as `@typedef Foo`, and one of those is shorter.
2022-03-09 14:50:45 -08:00
Christopher Hiller a80e4b85a4 chore: use proper version of typescript 2022-03-09 14:50:45 -08:00
Christopher Hiller 5be33381fd test(base-driver): rewrite some assertions in capability-specs
simplified some stuff that was giving me problems.

instead of doing a try..await..catch and calling `fail()` if the catch block wasn't called, just use `sinon-chai`'s `.should.eventually.be.rejectedWith(ErrorClass, /message/)`

depending on the order in which this test file is run versus others, it's possible that some will fail because of global logging weirdness.  but normally this doesn't happen... keep an eye on it!
2022-03-09 14:50:45 -08:00
Christopher Hiller 1dbeee2006 fix(appium): remove bad log
the log message upon "appium driver install foo" said the strategy was "null", which is not quite right.
2022-03-09 14:50:45 -08:00
Christopher Hiller 1097fde0fc test(appium): add e2e tests for CLI argument errors (#16496)
This addition was prompted by #16076, which I was loathe to merge until I got this work done.

Further:

- changed the signature of `runAppiumRaw` helper to require options (because currying)
- in lieu of an actual plugin for mocha that handles snapshots, added some helper functions to help with comparing `appium`'s output
- revert all of the removals of `@ts-expect-error` I did somewhere else.  this was due to a stale TS lang server
2022-03-09 14:50:45 -08:00
Christopher Hiller 2781805c05 chore: ban direct usage of sinon (#16485)
* chore: ban direct usage of sinon

Calling `sinon.stub()`, `sinon.mock()` etc., directly is error-prone. Care must be taken to explicitly restore any stub created.

Using a sandbox (via `sinon.createSandbox()`), you don't need to remember to restore everything you fiddled with.

To that end, I've converted all direct `sinon` calls into sandbox calls and **BANNED** direct usage of `sinon` via ESLint.

# Conflicts:
#	.eslintrc

* test(base-driver): replace restricted sinon.spy() usage in server-specs.js

* test(support): formatting
2022-03-09 14:50:45 -08:00
Christopher Hiller 868517b6f4 chore: remove gulp from appium package (#16459)
This change removes `gulp` and replaces it with plain ol' `babel` and `mocha`.

## `appium`

- No gulp.
- `test/` has been re-organized.  All test files now end in the extension `.spec.js`, which is a recognized convention and understood by editors/IDEs.  The tests are further split into `unit` and `e2e` subdirs.  This makes working with both `babel` and `mocha` easier.
- The tests are _not_ run against the transpiled code; code is now transpiled on-the-fly via `@babel/register`. This only affects `appium`.
- `commands-yml/validator.js` moved to `scripts/parse-yml-commands.js`. It has been rewritten as a CJS module.  `commands-yml/` should not contain `.js` files.
- `test/setup.js` is a new test harness specific to Appium, which loads & configures `@babel/register`.  Eventually, the contents of this file can be moved into the root monorepo's `test/setup.js`, but the rest of the packages do not need `@babel/register`, so we avoid the overhead.

## `@appium/gulp-plugins`

- Unfortunately, due to the new `npm test` strategy (see below), we cannot use the `nyan` reporter.  Or rather, we _can_, but will not see the animation.  So the reporter is now set to default to `spec`.
- Modified tests so they didn't overwrite the actual `build` dir with transpiled fixtures, which is what was happening. This was causing failures depending on the transpile/test order.

## All Packages

- All packages now have their own `build`, `test`, `test:e2e` and `dev` (just build + watch mode) npm scripts. This makes running a complete build easier, since each package can now provide its own appropriate command.  This is _mostly_ just `gulp once` (where `gulp` was used before), except for `appium`, where `@babel/cli` is used directly.
- This is what happens when `npm test` is run from the monorepo (in order):
    1. All packages are built (in parallel) by running `npm run build` in each folder (via `lerna`). See `pretest`
    2. All code is linted directly via `eslint`.
    3. All _unit tests_ are run w/ `npm test` in each folder, having assumed transpilation already occurred (if necessary).
- `npm run e2e-test` runs the `npm run test:e2e` in each folder. No transpilation occurs! Careful.
- All scripts are expected to live in `packages/*/scripts`, and this directory enforces CJS via ESLint.  `postinstall.js` moved, as well as `check-npm-pack-files.js`. `generate-schema-declarations.mjs` moved from the root `scripts/` dir into `packages/appium/scripts/`; it's now CJS instead of ESM.
- I had profiled running various things with `lerna run --parallel`, but it turns out this is not faster.  I'm not sure why, but I think it may have something to do with streaming STDOUT/STDERR, or potentially the overhead of running child processes outweighs the time it takes to actually run tests and builds.
- The behavior of `lerna run` now mimicks `lerna exec`, which was "run stuff in serial, streaming the output". The default behavior of `lerna run` is "run stuff in parallel, buffering the output".  Buffered output sucks, and streaming the output from all tasks at once creates chaos.  To override this behavior, you'll see `--parallel --concurrency=8 --prefix` for tasks that can truly be parallelized, like transpilation.  The number 8 is the "maximum", and CI usually won't have more than 2 cores available anyway.
- When run in CI, Mocha runs with `--forbid-only`, which will fail if there's an `.only()` somewhere in the tests. Further, it forces color output.

## Etc.

- Updated Wallaby config, `.gitignore`, `.eslintignore`.
- Sorted `package.json` files
- Removed `watch` and `coverage` scripts which were broken anyway.

chore(appium): fix schema json path issues

- the path to the JSON schema is now correct: `lib/appium-config-schema.json`
- add `log-symbols` to devdeps for niceness. this is already a transitive dep
2022-03-09 14:50:45 -08:00
Christopher Hiller bfdbb4cc92 chore(support): replace promisified fs functions with native fsPromises functions
(where applicable)

- typed and documented some stuff
- added `fs.openFile` which resolves w/a `fsPromises.FileHandle` object.  `fs.open` still resolves with a file descriptor.  this is, I think, the only explicit conflict between the builtin `fs` module and ours. we should consider deprecating or removing our `fs.open` and using the `FileHandle`-returning impl, because it's a little easier to use.  Once we do, we can also remove `fs.close()`, `fs.read()` and `fs.write()`, as those are redundant since they are methods of the `FileHandle` object returned from `fsPromises.open`.  A cursory check in the `appium` org suggests that `open` and its ilk are not used except in some test cases.
- assign properties directly to the `fs` object, as this is easier for the type system to understand (rather than iterating over property names and assigning properties in the loop)
- `which` actually returns a `Promise` now and does not need promisification
- added note about future changes to `rmdir`
2022-03-09 14:50:45 -08:00
Christopher Hiller cfd7cdbb7d chore(appium): use new mkdirp
- fix some types, mocks
- rename `HASHFILE_RELATIVE_PATH` to `PKG_HASHFILE_RELATIVE_PATH`; hopefully that's less opaque
- fixed broken junk in `commands-yml/parse.js` which will conflict with #16459 so idk
2022-03-09 14:50:45 -08:00
Christopher Hiller 9829e69333 feat(support): remove mkdirp
- `mkdirp` module is now deprecated and re-exports `fs.mkdirp`, which is new
- fix some types in `fs` module
- fix `walkDir` which did not actually resolve to `null` ever
2022-03-09 14:50:45 -08:00
Christopher Hiller f9de06341d chore(gulp-plugins): replace find-root with pkg-dir
`find-root` is unmaintained
2022-03-09 14:50:45 -08:00
Christopher Hiller 2fbd49fed4 feat(support): move npm module into support
- Altered strategy for determining `APPIUM_HOME` by using `npm ls` and reading `package.json` if that fails
- rename `isLocalAppiumInstalled` to `hasAppiumDependency` in `env` module
- no longer care about `peerDependencies`; we can add this later if necessary
- consume `pkg-dir` module
- remove `read-pkg-up`
- move `npm` module into `support` (which is the `feat` here, I guess)
- the `NPM` class no longer has internal state, so doesn't really need to be a class, but I didn't want to bother with that refactor.  the module exports the class `NPM` and an instance `npm`.  creating new instances of `NPM` are useless, but there's no guard against it.
- method signatures in `NPM` class have changed to generally accept a `cwd` string.  further, non-optional options have been moved out of an optional options object. 😄

feat(appium): remove NPM module (it went into @appium/support)

- Probably not a breaking change, but it certainly breaks a few things in `appium`, which I addressed.
- Updated for new `NPM` api
- fixed sandboxing issue in `cli-specs`
- update `mocks`
2022-03-09 14:50:45 -08:00
Christopher Hiller d89fb9b354 feat(appium): allow installation of extensions via npm
## BREAKING CHANGES

(potentially, anyway)

1. Installation of extensions via `appium` now treats `$APPIUM_HOME` _mostly_ like a project containing a `node_modules` subfolder, with extensions under that.  Previously, each extension would have its own folder, with a `node_modules` and empty `package.json`, and finally the extension.  The intent was to inhibit deduping and conflicts with any `package.json` files in ancestors of `$APPIUM_HOME`.  I showed this was unnecessary because the same thing can be accomplished via the flag `--global-style` for `npm install`.  Ultimately, this simplifies the directory structure of `$APPIUM_HOME`.
2. `$APPIUM_HOME/extensions.yaml` now lives at `$APPIUM_HOME/node_modules/.cache/appium/extensions.yaml`.  The `node_modules/.cache/<pkg-name>` convention is fairly common for packages having temporary files which need to persist while a module is installed (no more, no less).
3. If the _current working directory_ contains a `package.json` which has `appium` as any sort of (non-`file:`) dependency _or_ `$CWD/node_modules/appium` is a resolvable module, `APPIUM_HOME` defaults to `cwd`.
4. "Install" and "link" lockfiles (see `lib/cli/npm`) have also moved from `$APPIUM_HOME` to `$APPIUM_HOME/node_modules/.cache/appium`.
5. The `runExtensionCommand()` function in the `cli/extension` module no longer accepts a `type` parameter, which can be derived from the `configObject` parameter anyway (redundant)
6. Loading of extensions (i.e. reading `extensions.yaml`) has been moved into its own function, `loadExtensions()` in `extension/index.js`.
7. `getActivePlugins` and `getActiveDrivers` have been moved here from `lib/main`.  Changed the signatures of these, since they don't actually need the entire `ParsedArgs` object.
8. `ext-config-io` module, which handles reading/writing `extensions.yaml` has been moved to `extension/manifest.js`.
9. The `installPath` property in `extensions.yaml` has been removed and is unneeded due to 1.
10. `read()` has been removed from `extension-config` and its subclasses.
11. Moved `ReadonlyMap` from `utils` to `schema/schema` module.  Probably so I didn't have to stub it in a test.
12. Moved `rootDir` from `utils` to `config`.
13. Removed `drivers` module; moved `findMatchingDriver` to `DriverConfig#findMatchingDriver`.  Removed `AppiumDriver#_findMatchingDriver`; calls `DriverConfig#findMatchingDriver` directly instead.
14. Removed `plugins` module; its contents now live in `constants`.
15. Dynamic determination of `APPIUM_HOME` now happens in the `env.resolveAppiumHome()` method of `@appium/support` (introduced in a previous commit).  It should not happen anywhere else, because it will be wrong.
16. Because the `lib` dir was becoming rather unwieldy, I moved modules associated with extension loading and config into an `extension` subdir
17. `getParser()` in `cli/parser` is no longer async; the async stuff it was doing moved into `loadExtensions()`.  `getParser()` can be used without calling `loadExtensions()` first (no extensions will be loaded)

## Summary

This enables installation of extensions via `npm`; e.g., `npm install appium-xcuitest-driver -D`.  Because `appium` usually manages the `extensions.yaml` (the "manifest"), this is not possible when installing modules via other means.  To handle this situation, if we have an `appium`-dep-containing `package.json` in `APPIUM_HOME`, a hash is taken of the `package.json`.  This hash is checked at runtime; if it has changed, `appium` will scan `node_modules` (_not_ `package.json`; we only care about extensions that are _actually installed_, which is different from how we handle an `appium` dep) for extensions, and the hash will be updated.  Extensions are defined as "modules having a `package.json` which contains an `appium` field which is an object of a particular shape".  When these are found, they are appended to `extensions.yaml`.  In theory, this allows a user to use `appium` _or_ `npm` (at their convenience) to manage extensions.

See the "when appium is a dependency" suite in `test/cli/cli-e2e-specs.js` for more context.

## Notes

- Added a `constants` module, which provides a centralized place for various constants.  This makes finding constants less cognitively demanding. 🙂  You may not like this; if you don't, the constants can be moved to more appropriate places.
- Added `extension/package-changed` module which is used to determine if a `package.json` has changed
- Many types are added/changed throughout.  See especially `extension/manifest` for many type definitions involving the shape of `extensions.yaml` and the `appium` prop of extensions' `package.json`.
- Reorganized some tests based on structure of `lib`.
- Split `extension-config-specs.js` into `driver-config-specs.js` and `plugin-config-specs.js`.
- Many refactors in now-fully-typed `cli-e2e-specs`; introduced some more helpers in `test/cli/cli-helpers.js` and used these.  Makes calling out to the `appium` executable from E2E tests a little easier.
- Introduced `test/extension/mocks` for DRY mocks, since many of the unit tests here now use the same ones.
- Consolidated fixtures into `test/fixtures`. Fixtures can always be found via the `resolveFixture()` method of `test/helpers.js`.

## TODO (before this lands)

- Instead of using `$CWD` for `APPIUM_HOME` if `appium` is a dep, we probably want to use `find-pkg-up` or something.  This should be okay, since if we find a `package.json` and `appium` _isn't_ a dep, we will just be using the default `APPIUM_HOME`.
- We _may_ also need to search `package.json` for known extensions, since it's possible to use them standalone.  However, I'm not sure if this use case needs `APPIUM_HOME` at all?

chore: vscode stuff

- change default build task to `dev`, which just transpiles in the background
- updated `test - current file` launch config for better debugging

chore(appium): peer review refactors

- The old class name of `Manifest` used to be `ExtConfigIO`, but I forgot to update these variable names.  `io` is now `manifest`, wherever used
- Created a more clear separation between the `create()` and `getInstance()` static methods of `DriverConfig`/`PluginConfig`.  `create()` should _only_ be used for instantiation, and `getInstance()` should _only_ be used if we have already instantiated the object with an associated `Manifest`. `create()` now _throws_ if the `Manifest` already has an association in place.  The reason this is split into two functions instead of just using `_.memoize()` is because of the options in the second parameter (`extData`, `logFn`), which would require the _same configuration object_ in order to return the already-created instance.  This is not a problem in `Manifest`, where the factory only accepts a single parameter.
- The `_instances` static method of `PluginConfig`/`DriverConfig` is now a `WeakMap`, keyed on a `Manifest` instance instead of the `appiumHome` string. This makes the relationship between them more explicit.
- Fixed some formatting
- Fixed type issues in schema tests, `grid-register` and its tests
- Made the constructor of `Manifest` private, created a memoized static method `getInstance()`; removed `getManifestInstance()` export.
- Refactored `let`-destructuring to the fancy new syntax I learned from @mykola-mokhnach
- Explained the meaning of `CONFIG_DATA_DRIVER_KEY` and `CONFIG_DATA_PLUGIN_KEY` in `manifest` module
- Replaced unnecessary use of `null` with `undefined` in `Manifest` class
- Removed runtime type check from `packageDidChange()`
- Had some fun renaming `ReadonlyMap` in `schema` module
2022-03-09 14:50:45 -08:00
Christopher Hiller 37e7b8266c chore: update wallaby & vscode configs 2022-03-09 14:50:45 -08:00
Christopher Hiller 4ef3323d1a feat(support): add env module
- `env` module exposes functions for determining `APPIUM_HOME`, where various files should live, etc., by examining the runtime environment
- fixed some functions in `fs` which unnecessarily used `this` (which prevented dereferencing)
- added `walk()` to `fs` which just exposes `klaw` (since `walkDir` has very limited behavior). this enables `walk()` to be used as an async iterator, which is handy.
- fixed a bunch of types in the `util` module. involved some actual code changes, but the original code only worked by chance.
- removed `strict` option from `util.coerceVersion()`, since the option isn't actually used anywhere.  this should be considered a breaking change if some module somewhere _else_ uses it and we consider it a public API.  I'm pretty sure that's not the case, so.
2022-03-09 14:50:45 -08:00
Christopher Hiller 1b29920485 fix(fake-driver): create cjs executable entry point
This driver wasn't working properly when used directly
2022-03-09 14:50:45 -08:00
Christopher Hiller 1954021af9 chore: typescript updates
- Upgrade TS to `next` tag.  It's "safe" to use using bleeding-edge TS here since we don't actually use it to compile anything
- Add a bunch of missing types: `find-root`, `klaw`, `lockfile`, `mv`, `ncp`, `rimraf`
2022-03-09 14:50:45 -08:00
Christopher Hiller 891d601ee7 chore(gulp-plugins): add test env for babel
When `BABEL_ENV=test` we should get better sourcemaps
2022-03-09 14:50:45 -08:00
Mykola Mokhnach 493c48d190 feat: Add a missing route for element shadow root (#16538) 2022-03-09 18:51:41 +01:00
Mykola Mokhnach 16b2e8f14b chore: Switch @dabh/colors to @colors/colors (#16539) 2022-03-09 18:51:24 +01:00
Jonathan Lipps 5abf852046 fix(appium): make sure logsink init happens first since it patches npmlog globally (fix #16519) 2022-03-08 07:29:27 -08:00
Kazuaki MatsuoandJonathan Lipps 9e41fc210e docs: update drivers (#16522)
* docs: update drivers

* use table

* merge the table

* merge the table

* simplify

* Apply suggestions from code review

Co-authored-by: Jonathan Lipps <jlipps@gmail.com>

Co-authored-by: Jonathan Lipps <jlipps@gmail.com>
2022-03-08 12:56:27 +09:00
Kazuaki MatsuoandChristopher Hiller ad08384e53 docs: merge docs from 1 to 2 (#16505)
* docs: merge docs from 1 to 2

* revert 2.0 docs

* update

* update from current master

* remove duplications

* tweak a bit

* Apply suggestions from code review

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

* Update docs/README.md

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

* Update docs/en/about-appium/getting-started.md

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

* Update docs/README.md

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

* Update docs/README.md

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

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>
2022-03-04 16:22:44 +09:00
Christopher Hiller 2e15c85f44 chore(appium): remove ios-webkit-debug-proxy-launcher; closes #16486 2022-02-24 14:29:05 -08:00
Renovate Bot 2ed1fa8abc chore(): update dependency lint-staged to v12 2022-02-24 14:28:30 -08:00
Mykola Mokhnach 3c7ac49478 refactor(base-driver): Tune the logic for the destination logger extraction (#16488) 2022-02-23 11:11:41 +01:00
Mykola Mokhnach 83493941ee refactor: Make loggers connected to the particular driver instances (#16478) 2022-02-23 07:49:42 +01:00
Mykola Mokhnach a8315f3f87 fix(appium): Increase the default limit of process listeners (#16471) 2022-02-18 21:08:48 +01:00
Christopher Hiller 79772d7a4f test(base-driver): replace direct calls to sinon with a sandbox
This is safer, because test failures can happen due to lack of isolation and order in which tests are executed
2022-02-17 11:52:52 -08:00
Mykola Mokhnach 1165269644 fix: Update property name after lru-cache package bump (#16446) 2022-02-14 11:22:52 +01:00
Mykola Mokhnach 632b75227c chore(base-driver): Bump lru-cache (#16431) 2022-02-10 08:27:05 +01:00
Kazuaki Matsuo 5aae1ae8a7 fix: remove BASEDRIVER_HANDLED_SETTINGS (#16368) 2022-02-09 17:41:50 +01:00
Mykola Mokhnach a881ae992a feat(base-driver): Add the size validation of the passed settings objects (#16420) 2022-02-09 08:09:25 +01:00
Mykola Mokhnach ed50a38657 refactor: Allow any of createSession arguments to be W3C capabilities object (#16408) 2022-02-07 15:27:55 +01:00
Jonathan Lipps 42f4a2de2d Publish
- appium@2.0.0-beta.25
 - @appium/base-driver@8.2.4
 - @appium/doctor@1.16.9
 - @appium/fake-driver@3.2.4
 - @appium/opencv@1.0.1
 - @appium/support@2.55.4
 - @appium/test-support@1.3.11
2022-01-21 12:07:01 -08:00
Jonathan Lipps 555b93bf55 refactor!(support): move opencv related functionality into its own package 2022-01-21 08:52:36 -08:00
Jonathan Lipps 9bb88e0ac8 fix!(support): migrate to opencv-bindings and away from opencv4nodejs 2022-01-21 08:52:36 -08:00
Christopher Hiller 7470ed00b2 fix(appium): make show-config more right
`--show-config` was not able to distinguish between defaults and values provided on the CLI.  now it does.  `--show-config` now displays (in this order):

1. any settings from the defaults (across Appium and any extensions)
2. any settings specified in config files
3. any settings specified on the CLI
4. the final merged configuration

Ref: #16340
2022-01-19 16:10:10 -08:00
Christopher Hiller eac88e5038 chore(appium): fix some formatting problems
- syntax highlighting can get weird with object literal types in docstrings; they need spaces
- ensure eslint doesn't try to lint `.d.ts` files
2022-01-19 16:10:10 -08:00
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 bc86e2800e chore(): update dependency @types/chai to v4.3.0 2021-12-08 10:48:48 +00: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 ab9e2458ee chore: add workflow_dispatch event trigger
update install script URL.
2021-12-03 11:53:22 -08:00
Christopher Hiller fa453a18db chore: restrict FOSSA workflow
This PR moves the FOSSA check from the Node workflow to its own.  It won't run if the API key secret is not present (which would be true when running PRs from forks).

In addition, the check

1. will only run on changes to any `package.json` in the monorepo
2. runs `fossa test` to fail upon failure (previously it would only fail upon _error_)
2021-12-03 11:53:22 -08: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
Renovate Bot 86e5dc304e chore(): update dependency type-fest to v2.8.0 2021-12-02 10:50:37 +00: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 eafd06fa5a chore(): update dependency type-fest to v2.7.0 2021-12-01 12:27: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
Kazuaki Matsuo e7801b60e1 docs: update badges in readme (#16171) 2021-11-29 17:26:49 +09:00
Mykola Mokhnach daed9be750 refactor(doctor): Remove obsolete iOS-related verifications (#16169) 2021-11-29 07:39:54 +01:00
Renovate Bot 58d408550f chore(): update dependency @types/sinon-chai to v3.2.6 2021-11-25 10:53:49 +00: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
Renovate Bot 5df02abe0a chore(): update dependency type-fest to v2.6.0 2021-11-23 13:56:18 +00:00
Renovate Bot 3e61d93769 chore(): update dependency appium-base-driver to v7.11.2 2021-11-23 10:56:53 +00:00
Christopher Hiller 5a2b981fb7 chore: update 'clean' script to remove any stray package lockfiles
`packages/*/package-lock.json` _should not exist_, but if it does, it will prevent proper versioning.  This fixes that problem.
2021-11-22 12:07:32 -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
Renovate Bot 9e75670035 chore(): update dependency appium-base-driver to v7.11.1 2021-11-20 10:33:27 +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 d201d64b49 fix: use relative package references
This should (hopefully) fix the Lerna issues we've been encountering.  With this change, the root monorepo lists all packages as dependencies and uses relative `file:` URLs to do so.  This means `lerna bootstrap` is no longer necessary.

In addition, defaults to `--save-exact` in `npm install` and `lerna add`.  Also installs peer dependencies of `@appium/eslint-config-appium`.
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
Kazuaki Matsuo 3f7bed69fd docs: add environment about APPIUM_PREFER_SYSTEM_UNZIP (#16119) 2021-11-18 09:59:45 -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 a237dff45c chore(): update dependency type-fest to v2.5.4 2021-11-17 14:05:19 +00: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
Jonathan Lipps 7fa14c2082 docs(appium): note change in chromedriver install args for appium 2 2021-11-16 11:56:18 -08:00
Christopher Hiller 192f5eb0b9 Publish
- appium@2.0.0-beta.21
2021-11-15 17:08:20 -08:00
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
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
Christopher Hiller 0bb78f0870 chore(appium): ensure schema TS declaration is added to stage
`lint-staged` doesn't want to do it because reasons.  I don't think it necessarily supports the use case where if file _A_ is staged, then file _B_ should be staged--it only acts upon file _A_.

also replace the `lint:fix` script with use of `eslint` proper, since using `gulp` misses files _not_ in `packages/`.
2021-11-09 11:57:26 -08:00
Christopher Hiller 548310d018 chore(appium): use Ajv to validate CLI args
This now consumes Ajv directly to validate CLI args.  Since a JSON schema is made of JSON schemas, we can simply validate an argument against _the schema for that argument_.

- Replaced parser transformation functions (`parseSecurityFeatures()`, `parseJsonStringOrFile()`) with custom transforms which are bound to keyword `appiumCliTransformer`.  e.g., any option that can now accept a JSON string or filepath on the command line may use `appiumCliTransformer: 'json'`.  This is the default behavior for `array` and `object` -type options, which cannot easily be expressed on the CLI.  The config file does _not_ support this behavior, so the value must be whatever the schema `type` says (e.g., an `object` instead of a JSON string or filepath).  To this end, removed `parser-helpers.js`
- Further, we now disallow union types in the schema. A prop must have a single type.
- Added custom keywords `appiumCliDest`, `appiumCliDescription`, and `appiumCliTransformer`. Previously (if existed), this could have been any value--these are now typed by the schema--e.g., a number for `appiumCliDest` will fail.
- Added more types and TS checks around
- Fixed misspelling of "successfully" in various places
- Removed `@oclifg/errors` because we can now use `better-ajv-errors` to display them, as intended. It looks great!
- Moved all schema-related stuff to `lib/schema/` because I had too many modules
- Added more constants to please @mykola-mokhnach 😄
- Handles untyped properties or `null`-typed properties
- `getSchema()`, `validate()` etc now accept a schema ID. The schema ID is derived from the argument name. This is how we handle validation for each argument individually.  The config file is still validated against the entire schema at once.
- Fixed problem where only `driverConfigs` were ever used to call extension commands!
- Added some semaphore-like things to `ExtConfigIO` to avoid multiple reads/writes at once
- Fixed display of metavars in `--help`
- More tests; removed tests for removed code
2021-11-09 11:57:26 -08:00
Christopher Hiller 1a860cade2 fix(appium): restore missing call to validate extensions 2021-11-09 11:57:26 -08:00
Christopher Hiller 44be52d822 test(appium): use version constant in cli-e2e-specs 2021-11-09 11:57:26 -08:00
Christopher Hiller 237479c67c chore(appium): implement review changes
- flip if/else conditions in various places
- add export `SERVER_SUBCOMMAND` constant to `parser.js` (which is the string `server`)
- add `SERVER_PROP` constant to `schema.js` (which is also the string `server` but means a difft thing)
- more constants in `ext-config-io.js`
- add some more types in `ArgParser` constructor; simplify
- add constant regexp in `schema-args.js`
- use more lodash in `grid-register.js`
- simplify `_.includes()` call in `main.js`
- simplify error-handling in `readExtensionSchema()` of `schema.js`; fix docstring; remove associated tests
- fix a sanity check in `schema-specs.js`
2021-11-09 11:57:26 -08:00
Christopher Hiller d52c36e1ea feat(appium): configuration file and schema support
Summary: This PR adds support for configuration files (e.g., `.appiumrc.json`) and schema definitions.  Command-line options _and_ configuration is now derived from the schema(s), for Appium _and_ its extensions (both plugins and drivers).

## Dependencies
### Development
- Added `through2` for a custom gulp task to convert `appium/lib/appium-config-schema.js` to a JSON file
- Added `json-schema-to-typescript` for converting aforementioned JSON file to a `.d.ts` file (which gets published)

### Production (applies to `appium` only)
- Added `libconfig` for multi-format config file loading, which is a smaller drop-in replacement for `cosmiconfig`
- Added `ajv` for schema support and validation
- Added `ajv-formats` to understand optional value formats (e.g., `ipv4`)
- Added `@sidvind/better-ajv-errors` which provides nice error output on the CLI if the config file is invalid
- Added `@oclif/errors` for better error output on the CLI if _arguments_ are invalid

## New Modules of Note

- `lib/schema.js` consumes `ajv` to create and modify a schema
    - It exposes a handful of public API functions, so that consumers can query the schemas without actually running Appium.
    - The flow is basically this: read the base schema (`appium-config-schema.js`).  When extensions load and have schemas, add those to a pot.  When `finalizeSchema()` is called, throw the base schema into the pot as well, stir, and add to singleton `ajv` instance.  Now we can validate against the stew.
    - The schema for an extension is read and registered via `readExtensionSchema()`
    - Provides a way to get at default (for showing those "non-default" options) and `flattenSchema()` which squishes the finalized schema into a single `Record` key/value object, for use by the CLI.  This may make sense to move into `schema-args.js`
    - Provides access to ajv-and-JSON-schema-defined _formatters_ (which are basically just validation functions).  For example, if we want any string, it's just a `string`.  But if we want the string to match a regexp, that's a formatter.  (e.g., the `hostname` type)
-  lib/config-file.js` consumes `lilconfig` to read config files, validate them against the schema, and provide the result as CLI args
    - Handles conversion between kebab-case and camelCase
    - Contains `formatErrors()` which will be called after validation of a config file fails, which shows _exactly_ where the config file is wrong (usually).
- `lib/cli/schema-args.js` which serves as an adapter between the schema and `argparse`
    - Translates between JSON schema and `argparse`, which...well, I did what I could.  It's pretty close.
    - Wraps the formatters as mentioned above, and provides custom ones.
    - We cannot, unfortunately, wholly use schema validation against CLI args.  The flag names are different, the structure is different, there's no actual _file_ to compare against, and `argparse` does not help.  We _can_ use anything `argparse` natively provides, in addition to `ajv` formatters, and any custom ones (e.g., allowable number ranges).
    - Will likely end up adding more formatters corresponding to various JSON schema features later.  We _may_ be able to use _more_ of Ajv to do this (e.g., reuse its internal validators, if they are public APIs).
- `lib/appium-config-schema.js` which is the root schema. Extensions add to this before it is registered & compiled by `ajv`.
    - The basic shape is that there are three top-level props, `server`, `driver`, and `plugin`.  `server` contains all of the server options as you'd expect, and `driver` and `plugin` will be filled in by extensions.  Each will have properties corresponding to the extension name.  You can find examples in `sample-code` and the test fixtures
    - There's a gulp task that takes this file, rewrites it as JSON, then pipes it into another tool which outputs a `.d.ts` file, nicely described using all of the metadata from the schema.  This will be useful for mainly contributors, extension authors, and consumers of Appium (though not end-users).
- `lib/ext-config-io.js`
    - A new module which handles reading/writing of YAML extension config files only.
    - This class is a singleton.
    - Some logic pulled out of `extension-config.js` and into here
    - Previously, we would read/write this file multiple times (once per subclass of `ExtensionConfig`)
    - This module uses a naive dirty-tracker to persist the extension data automatically.
    - Subclasses of `ExtensionConfig` only have access to their "portion" of the config file; drivers can't see plugins and vice-versa.
    - `DRIVER_TYPE` and `PLUGIN_TYPE` originate here, mainly to avoid a circular dependency

## Modifications

- The single source of truth for the CLI _and_ config file options is the schema, with the caveats that:
    - Command-line arguments (for `appium server` are effectively a flat list, but the schema/config file is not.
    - Extension-specific configuration lives in an extension-type-specific property (`driver` or `plugin`) in the config file
        - Under each (`driver` or `plugin`), each extension may have a configuration section corresponding to the extension name
        - The shape of the extension-specific options _can_ be defined by a schema (and referenced in the `appium.schema` prop of the extension's `package.json`)
        - If an extension does not provide a schema, no validation will occur on any options found here -- TODO needs tests
    - This does _not_ affect _CLI commands_ added by extensions; only options for `server`.
- The `--appium-home` flag is now removed, as we can't find extensions without `APPIUM_HOME`, which means we can't parse arguments (because extensions may have added some).
- `--plugin-args` and `--driver-args` are removed.  These are replaced by individual flags for each argument, defined by the extension in its schema, e.g., `--driver-fake-host=127.0.0.1`
- Extensions can still define argument "constraints" using `argConstraints`, but this is considered deprecated
- `lib/main.js`
    - Now exports a few public APIs
    - split into functions `init` and `main`.  `init` is intended to be run via a consumer, which does what the old `main` did up to starting the server.  This bisection is not perfect, as `init` still does some CLI-related things; it needs to be further broken up.
    - `driverConfig.read()` and `pluginConfig.read()` are now called in `lib/cli/parser.js`.
    - Merges the CLI args, config file args, and defaults, in that order of precedence.
- `lib/grid-register.js`
    - Supports embedded configuration instead of just a path to a JSON file.
    - Not clear to me if `nodeconfig` is a thing we need to keep?
- `lib/extension-config.js`
    - Given `APPIUM_HOME` is where we keep the extensions, this file now defines `APPIUM_HOME`. It is exported from the `appium` package.
    - Add `getSchemaProblems()` method, which will read/validate/register the schema for an extension, if one exists.
    - Added many type annotations
    - `read()` and `write()` now delegate to the singleton `ExtConfigIO` instnace
    - Re-exports `DRIVER_TYPE` and `PLUGIN_TYPE`
- `lib/driver-config.js`
    - **Fix** the case where two drivers attempt to use the same `automationName`.  It appears this was intended, but did not work correctly.  This involved overloading `read()`.
- `lib/plugin-config.js`
    - Literally nothing, which is neat.
- `lib/config.js`
    - Remove unused validations (now occur via schema validation or are extension-specific)
    - Rename `getNonDefaultArgs` to `getNonDefaultServerArgs` to be more specific
    - Rewrote `getNonDefaultServerArgs`, which became much more complicated due to adding a config file and schema defaults to the mix. Flexed my lodash-fu, which is still kind of crappy because I'm better with `lodas/fp`.
- `lib/cli/parser.js`
    - Created a wrapper for `argparse`: class `ArgParser`, which replaces the monkeypatching we were doing here.
    - This class also stores extension-specific args in a namespace.  For example, `--driver-foo-bar=baz` would normally be stored in prop `driverFooBar`, but this moves it into `driver: {foo: {bar: 'baz'}}`, which will be provided to its associated extension
    - `addExtensionsToParser` renamed to `addExtensionCommandsToParser` which is more specific.
    - Removed `getDefaultServerArgs` since those now come from the schema.
    - Removed "shared args" stuff
    - `getParser` is now async, and constructs an `ArgParser`.  By necessity, the extension config YAML is read here (which is still wonky because we have to call `read()` twice; it only actually ends up reading once)
    - `getParser` also _finalizes_ the schema, which means "katamari-up the base schema and all extension schemas, then tell ajv about the result"
- `lib/cli/parser-helpers.js`
    - Allow security features to just be an array (as allowed in schema)
    - TODO: needs test
- `lib/cli/extension.js`
    - Use `APPIUM_HOME` exported from `lib/extension-config` instead of `args.appiumHome`
    - Avoids re-instantiating `ExtensionConfig` subclasses if not needed
- `lib/cli/args.js`
    - Remove all server argument definitions in lieu of schema; leave a few that do not make sense in a config file (like `--config`, which determines the location of the config file!)
    - Server args are now pulled from the schema via a call to `toParserArgs()` with overrides for various validation functions (which are confusingly "types" in `argparse` parlance).  Overrides can probably be removed or relocated to `schema-args`
    - Instantiates the `DriverConfig` and `PluginConfig` instances, which are exported.   These might want to move somewhere else
- Tests
    - Added unit tests for `extension-config`, `grid-register` which were missing
    - Added unit tests for new `schema` and `schema-args` and `config-file` modules
    - Added e2e test for config file handling
    - Other necessary modifications
    - Fix path to `fake-driver` in `driver-e2e-specs`
    - Removed stuff from `parser-specs` which no longer applies

## Other

- Added `scripts/generate-schema-declarations.js` which uses `json-schema-to-typescript` to create `appium-config.d.ts`
- Added config file samples in `.json` and `.yaml` formats
- Added custom gulp task to `appium/gulpfile.js` to generate schema in JSON format, since its "single source of truth" is actually just a big JS object
- Moved `appium` CLI-related tests into `test/cli`
- Added some declarations into `packages/appium/types`; the schema-related one is generated by the script mentioend above, but `types.d.ts` is just some stuff that was not expressible in a docstring
2021-11-09 11:57:26 -08:00
Jonathan Lipps 71357e52e1 Publish
- appium@2.0.0-beta.19
 - @appium/base-driver@8.1.2
 - @appium/doctor@1.16.5
 - @appium/eslint-config-appium@4.7.3
 - @appium/fake-driver@3.1.0
 - @appium/gulp-plugins@5.5.4
 - @appium/support@2.55.0
 - @appium/test-support@1.3.7
2021-11-09 14:07:38 -05:00
Renovate Bot 6bb9439089 chore(gulp-plugins): update babel monorepo to v7.16.0 2021-10-30 10:41:03 +00:00
Renovate Bot bcc441c612 chore(): update dependency type-fest to v2.5.2 2021-10-27 13:25:10 +00:00
Renovate Bot fb957786fa chore(support): update dependency axios to v0.24.0 2021-10-27 12:06:57 +00:00
Renovate Bot dedd1a25fa chore(): update dependency @types/sinon to v10.0.6 2021-10-27 10:11:30 +00:00
Renovate Bot 97a9d898f5 chore(): update dependency lint-staged to v11.2.6 2021-10-27 08:29:45 +00:00
Renovate Bot 05ec960c34 chore(): update dependency lint-staged to v11.2.4 2021-10-24 14:02:16 +00:00
Renovate Bot 6e28a8ffce chore(): update dependency @types/sinon to v10.0.5 2021-10-24 11:21:17 +00:00
Renovate Bot 3b16633a0a chore(gulp-plugins): update dependency replace-in-file to v6.3.2 2021-10-23 09:39:10 +00:00
Renovate Bot c69815b5e4 chore(gulp-plugins): update dependency replace-in-file to v6.3.1 2021-10-21 22:38:01 +00:00
Renovate Bot 2fae09b9f1 chore(support): update dependency axios to v0.23.0 2021-10-21 20:50:00 +00:00
Renovate Bot 7cbe1f220f chore(gulp-plugins): update dependency babel-plugin-istanbul to v6.1.1 2021-10-21 19:51:41 +00:00
Renovate Bot 54ed9292ac chore(): update dependency type-fest to v2.5.1 2021-10-21 18:39:38 +00:00
Renovate Bot 863e44e657 chore(eslint-config-appium): update dependency eslint-plugin-import to v2.25.2 2021-10-21 16:34:57 +00:00
Renovate Bot 276f5697ee chore(support): update dependency shell-quote to v1.7.3 2021-10-21 15:05:31 +00:00
Renovate Bot c3fa3c841f chore(eslint-config-appium): update dependency eslint-plugin-promise to v5.1.1 2021-10-21 14:08:13 +00:00
Renovate Bot 0d787d9002 chore(): update dependency @types/json-schema to v7.0.9 2021-10-21 12:36:38 +00:00
Renovate Bot 5c6a630686 chore(): update dependency @types/sinon to v10.0.4 2021-10-21 10:48:12 +00:00
Renovate Bot 1a6cf81d55 chore(): update dependency @types/chai to v4.2.22 2021-10-21 10:01:59 +00:00
Renovate Bot 8a6732c47c chore(doctor): update dependency appium-adb to v8.16.2 2021-10-21 08:44:48 +00:00
Renovate Bot 64c5733123 chore(): update dependency lint-staged to v11.2.3 2021-10-21 06:05:33 +00:00
Renovate Bot fb602e3741 chore(gulp-plugins): update dependency mocha to v9.1.3 2021-10-21 03:54:56 +00:00
Renovate Bot b295d85198 chore(): update dependency appium-base-driver to v7.10.1 2021-10-21 01:16:51 +00:00
Christopher Hiller a91bec3456 chore(gulp-plugins): postTranspile task always runs after transpile task; add dev task
- `postTranspile` would only run from certain _other_ tasks (like `test`).  This seemed incorrect, so now it runs after `transpile`, regardless of what task (or human) runs `transpile`.
- Added a `dev` task, which is like `watch`, except does not run tests (only transpiles)
2021-10-20 16:02:32 -07:00
Christopher Hiller 7b7a983bbe test(support): skip problem global-resolution test 2021-10-20 16:02:32 -07:00
Christopher Hiller cf7438a352 feat(fake-driver): add a schema
Adds an example schema to `fake-driver`. This is used for testing.
Also simplify assignment of commands to `FakeDriver.prototype`.
2021-10-20 16:02:32 -07:00
Christopher Hiller f0cb12d2e8 chore(eslint-config-appium): dev & test env improvements
- add `jsconfig.json` for the TS language server to understand the project
- update `.wallaby.js` to transpile fixtures if necessary; run on save to reduce lag
- update single-file Mocha debug launch config
- add `test` env in `babel.config.json` which is used by the former
- add some handy vscode tasks
- add a bunch of types
- remove unused `babel-eslint` (we use `@babel/eslint-parser`)
- bump `ecmaVersion` in `eslint-config-appium`
- remove cruft from babel configs (`shippedProposals: true` goes a long way)
- enable `sinon-chai` globally in tests
- add `rewiremock` for module-level mocking (sinon cannot do this itself, but they work in tandem)
2021-10-20 11:39:59 -07:00
Corneliu Duplachi 0e633939f9 fix(base-driver): type inconsistency (#15982)
* fix(base-driver): type inconsistency

* reset is set in BaseDriver
2021-10-18 14:30:10 -07:00
Kazuaki Matsuo 829eb6623d chore(base-driver): Add params to setWindowRect handler (#15974) 2021-10-17 08:07:04 +09:00
Renovate Bot f10c2c3630 chore(): update dependency lint-staged to v11.2.1 2021-10-09 08:58:52 +00:00
Corneliu Duplachi 476dbf3e32 chore(base-driver): add type definition for optional commands (#15931)
* feat(base-driver): add type definition for optional commands

* update type definition

* reuse Rect in Size, Position type

* fix: actions is unwrapped
2021-10-08 19:10:02 -07:00
Renovate Bot ac49b6b5db chore(gulp-plugins): update dependency @octokit/rest to v18.12.0 2021-10-08 08:49:10 +00:00
Renovate Bot 6732b1d8f6 chore(gulp-plugins): update babel monorepo to v7.15.8 2021-10-07 08:42:01 +00:00
Renovate Bot 537faa6670 chore(doctor): update dependency inquirer to v8.2.0 2021-10-06 07:54:49 +00:00
Renovate Bot 19b6b34519 chore(): update dependency lint-staged to v11.2.0 2021-10-04 13:04:37 +00:00
Renovate Bot 7a476af925 chore(support): update dependency axios to v0.22.0 2021-10-01 10:48:41 +00:00
Renovate Bot 0d0eb17acb chore(gulp-plugins): update dependency @octokit/rest to v18.11.4 2021-10-01 09:52:39 +00:00
Renovate Bot 1dc5f2916f chore(doctor): update dependency appium-adb to v8.16.1 2021-10-01 08:49:53 +00:00
Renovate Bot bf4fac2ab0 chore(gulp-plugins): update dependency @octokit/rest to v18.11.3 2021-09-30 08:29:22 +00:00
Christopher Hiller a5d91addd1 chore(pkg): obviousify scripts
- also speedify install by running `postinstall` builds in parallel
2021-09-28 07:54:20 -07:00
Christopher Hiller a172196d43 chore(base-driver): revert name change of TEST_HOST to DEFAULT_TEST_HOST
This would have been a breaking change if other packages depend on it, since I think it's a public API
2021-09-28 07:54:20 -07:00
Christopher Hiller cf86871d4f fix(base-driver): allow https in helper URL generation
- use constants/helpers for `jsonwp-proxy` url tests
2021-09-28 07:54:20 -07:00
Christopher Hiller 01d7c1bd7e fix(base-driver): better URL handling in driver-e2e tests
- fix a potential port-reuse issue in `getTestPort()` helper
- dedupe `127.0.0.1` constant
- export curried `createAppiumURL(address, port, session, pathname)` helper for less error-prone URL generation
- export some HTTP method names as constants
2021-09-28 07:54:20 -07:00
Christopher Hiller 3396594f76 chore(fake-driver): make wdio quieter 2021-09-28 07:54:20 -07:00
Christopher Hiller a3b021a0e8 chore: replace occurrences of 'localhost' with '127.0.01'; use random ports; closes #15399
- `base-driver` gets a new `helpers` module with a `getTestPort` function; this is now used throughout the tests
- `fake-driver` can't use random ports because it depends on `appium-base-driver`'s test suite, and that is _not_ the current appium-2.0-compatible `@appium/base-driver`
2021-09-28 07:54:20 -07:00
Renovate Bot 02a9b27799 chore(gulp-plugins): update dependency @octokit/rest to v18.11.2 2021-09-28 08:50:17 +00:00
Renovate Bot b1c7673f8d chore(doctor): update dependency appium-adb to v8.16.0 2021-09-26 13:51:24 +00:00
Renovate Bot c96069520a chore(gulp-plugins): update dependency yargs to v17.2.1 2021-09-26 11:52:58 +00:00
Kazuaki Matsuo 98e07de197 chore(support): Increase the default timeout for upload/download (#15894) 2021-09-26 16:11:56 +09:00
Renovate Bot 017925d9e0 chore(doctor): update dependency appium-adb to v8.15.0 2021-09-25 14:25:25 +00:00
Renovate Bot 85c1e46209 chore(gulp-plugins): update dependency mocha to v9.1.2 2021-09-25 12:58:17 +00:00
Renovate Bot 6a17749a7e chore(gulp-plugins): update dependency @octokit/rest to v18.11.1 2021-09-25 10:39:55 +00:00
Kazuaki Matsuo 0d1d3f2b66 chore(appium): apply command yml and ja resource in 1.x to 2.0 (#15881)
* chore: apply command yml and ja resource in 1.x to 2.0

* update commands

* tweak

* tweak

* remove appium prefix

* tweak toc

* tweak positions
2021-09-24 01:23:49 +09:00
Kazuaki Matsuo 1383366899 feat: Add a possibility to use PowerShell to unzip files in Windows (from appium-support#227) (#15882) 2021-09-24 01:22:34 +09:00
Renovate Bot b57c5b5035 chore(support): update dependency glob to v7.2.0 2021-09-23 11:44:55 +00:00
Renovate Bot 8f50af69f0 chore(gulp-plugins): update dependency yargs to v17.2.0 2021-09-23 10:31:08 +00:00
Renovate Bot 0d5ea9a531 chore(gulp-plugins): update dependency @octokit/rest to v18.11.0 2021-09-23 08:51:29 +00:00
Renovate Bot 760aebadac chore(fake-driver): update dependency asyncbox to v2.9.2 2021-09-21 07:47:00 +00:00
Renovate Bot 502dd81cea chore(): update dependency yaml-js to v0.3.1 2021-09-20 09:50:45 +00:00
Renovate Bot 987130981a chore(eslint-config-appium): update dependency @babel/eslint-parser to v7.15.7 2021-09-18 02:33:41 +00:00
Jonathan Lipps 01dd42ee17 Publish
- appium@2.0.0-beta.18
 - @appium/base-driver@8.1.1
 - @appium/fake-driver@3.0.5
2021-09-16 10:37:18 -07:00
Jonathan Lipps 31af0e1167 chore(base-driver): start to document BaseDriver types for TS users 2021-09-16 10:24:56 -07:00
Jonathan Lipps 4f89d398a4 Publish
- appium@2.0.0-beta.17
 - @appium/base-driver@8.1.0
 - @appium/doctor@1.16.4
 - @appium/fake-driver@3.0.4
2021-09-16 10:15:01 -07:00
Jonathan Lipps 3e5aec945b feat(base-driver): allow drivers, and plugins to declare that certain routes must never be proxied 2021-09-16 10:13:57 -07:00
Renovate Bot 650f4e2688 chore(doctor): update dependency inquirer to v8.1.5 2021-09-16 10:21:57 +00:00
Jonathan Lipps e0c7754af6 Publish
- appium@2.0.0-beta.16
 - @appium/base-driver@8.0.3
 - @appium/fake-driver@3.0.3
2021-09-15 12:02:01 -07:00
Jonathan Lipps ff3bb4f4b5 feat(appium): add env var to trigger reloading of extensions
this is useful during driver/plugin development, so the appium server does not always
need to be restarted, at least not when extensions are created on new sessions
2021-09-15 11:40:07 -07:00
Renovate Bot 96079de6b3 chore(fake-driver): update dependency asyncbox to v2.9.1 2021-09-15 08:41:36 +00:00
Jonathan Lipps 4ec2d1edd7 Publish
- appium@2.0.0-beta.15
 - @appium/base-driver@8.0.2
 - @appium/doctor@1.16.3
 - @appium/eslint-config-appium@4.7.2
 - @appium/fake-driver@3.0.2
 - @appium/gulp-plugins@5.5.3
 - @appium/support@2.54.2
 - @appium/test-support@1.3.6
2021-09-14 14:08:52 -07:00
697 changed files with 23560 additions and 11418 deletions
+7 -4
View File
@@ -1,6 +1,9 @@
coverage
node_modules
**/coverage/**
**/node_modules/**
examples/javascript-wd
packages/*/build/**/*
**/build/**
**/*.min.js
sample-code
**/*.d.ts
**/build-fixtures/**
**/*.ts
+29
View File
@@ -9,6 +9,35 @@
{
"files": "packages/*/test/**/*",
"rules": { "func-names": "off" }
},
{
"files": "./packages/*/scripts/**/*.js",
"parserOptions": {
"sourceType": "script"
}
},
{
"files": "./packages/*/test/**/*.js",
"rules": {
"no-restricted-properties": [
"error",
{
"object": "sinon",
"property": "spy",
"message": "Use `sandbox = sinon.createSandbox()` and `sandbox.spy()` instead. Don't forget to call `sandbox.restore()` in `afterEach`"
},
{
"object": "sinon",
"property": "stub",
"message": "Use `sandbox = sinon.createSandbox()` and `sandbox.stub()` instead. Don't forget to call `sandbox.restore()` in `afterEach`"
},
{
"object": "sinon",
"property": "mock",
"message": "Use `sandbox = sinon.createSandbox()` and `sandbox.mock()` instead. Don't forget to call `sandbox.restore()` in `afterEach`"
}
]
}
}
]
}
+28 -52
View File
@@ -1,64 +1,40 @@
# Generated by FOSSA CLI (https://github.com/fossas/fossa-cli)
# Visit https://fossa.com to learn more
version: 2
cli:
server: https://app.fossa.com
fetcher: git
project: github.com/appium/appium
analyze:
modules:
- name: appium-monorepo
type: npm
target: .
version: 3
project:
id: github.com/appium/appium
name: appium
paths:
exclude:
- ./sample-code
- '**/fixtures/**'
- '**/demo/**'
- '**/example/**'
- '**/examples/**'
targets:
only:
- type: npm
path: .
options:
strategy: node_modules
- name: appium
type: npm
target: ./packages/appium
- type: npm
path: ./packages/appium
options:
strategy: node_modules
- name: '@appium/base-driver'
type: npm
target: ./packages/base-driver
- type: npm
path: ./packages/base-driver
options:
strategy: node_modules
- name: '@appium/doctor'
type: npm
target: ./packages/doctor
- type: npm
path: ./packages/doctor
options:
strategy: node_modules
- name: eslint-config-appium
type: npm
target: ./packages/eslint-config-appium
- type: npm
path: ./packages/eslint-config-appium
options:
strategy: node_modules
- name: '@appium/fake-driver'
type: npm
target: ./packages/fake-driver
- type: npm
path: ./packages/fake-driver
options:
strategy: node_modules
- name: '@appium/gulp-plugins'
type: npm
target: ./packages/gulp-plugins
- type: npm
path: ./packages/gulp-plugins
options:
strategy: node_modules
- name: '@appium/support'
type: npm
target: ./packages/support
- type: npm
path: ./packages/support
options:
strategy: node_modules
- name: '@appium/test-support'
type: npm
target: ./packages/test-support
- type: npm
path: ./packages/test-support
options:
strategy: node_modules
revision:
branch: 2.0
+53
View File
@@ -0,0 +1,53 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Appium Build
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 17.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install latest npm
run: npm install -g npm
- name: Install dependencies
run: npm install
- name: Run unit tests
run: npm run test:ci
- name: Install @appium/fake-driver
run: npm run install-fake-driver
- name: Run E2E tests
run: npm run e2e-test
lint:
name: Lint & Check Types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: npm install
- name: ESLint
run: npm run lint
- name: Check types
run: npm run build:types
docs:
name: Build Command Documentation
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: npm install
- name: Generate docs
run: npm run generate-docs
+21
View File
@@ -0,0 +1,21 @@
name: License Checks
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
fossa-check:
name: Run FOSSA Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: '2.0'
- name: fossa analyze
run: |
npm install
curl -sS -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
fossa analyze
fossa test
env:
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
-47
View File
@@ -1,47 +0,0 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: |
npm install
npm test
npm run install-fake-driver
npm run e2e-test
fossa-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Analyze with FOSSA
run: |
npm install
curl https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash
fossa analyze
env:
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
generate_docs:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
npm install
npm run generate-docs
+3
View File
@@ -56,3 +56,6 @@ appium.zip
.vscode/settings.json
.nyc_output
*.lerna_backup
**/build-fixtures/**
*.tsbuildinfo
packages/*/LICENSE
+6 -1
View File
@@ -3,5 +3,10 @@
'use strict';
module.exports = {
require: require.resolve('./test/setup.js')
require: [
require.resolve('./test/setup.js')
],
// forbids use of .only() in CI
forbidOnly: Boolean(process.env.CI),
color: true
};
+3 -1
View File
@@ -1,2 +1,4 @@
# Do not disable package-lock. Disabling package-lock also disables npm-shrinkwrap
package-lock=true
package-lock=true
save-exact=true
+11 -38
View File
@@ -2,49 +2,22 @@
"version": "0.2.0",
"configurations": [
{
"args": [
"--require",
"@babel/register",
"--timeout",
"999999",
"--colors",
"${file}"
],
"args": ["--colors", "--timeout", "0", "${file}"],
"internalConsoleOptions": "openOnSessionStart",
"name": "Test - Current File",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"runtimeArgs": ["--require", "@babel/register"],
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"type": "pwa-node"
},
{
"name": "Debug",
"type": "node",
"request": "launch",
"skipFiles": ["<node_internals>/**", "**/node_modules/mocha/**"],
"type": "pwa-node",
"sourceMaps": true,
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"args": ["."]
},
{
"name": "Attach Debug",
"type": "node",
"request": "attach",
"cwd": "${workspaceFolder}",
"port": 9229
},
{
"name": "Test All",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/_mocha",
"args": [
"--require",
"@babel/register",
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/packages/appium/test"
]
"outfiles": [],
"env": {
"NODE_ENV": "test",
"BABEL_ENV": "test"
},
"autoAttachChildProcesses": true,
}
]
}
+136
View File
@@ -0,0 +1,136 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"label": "npm: dev",
"detail": "lerna exec --parallel gulp dev",
"isBackground": true,
},
{
"type": "shell",
"command": "npm",
"args": [
"exec",
"--",
"lerna",
"exec",
"--scope=@appium/fake-driver",
"--",
"gulp",
"transpile"
],
"label": "transpile: @appium/fake-driver",
"problemMatcher": []
},
{
"type": "shell",
"command": "npm",
"args": [
"exec",
"--",
"lerna",
"exec",
"--scope=appium",
"--",
"gulp",
"transpile"
],
"label": "transpile: appium",
"problemMatcher": []
},
{
"type": "shell",
"command": "npm",
"args": [
"exec",
"--",
"lerna",
"exec",
"--scope=@appium/support",
"--",
"gulp",
"transpile"
],
"label": "transpile: @appium/support",
"problemMatcher": []
},
{
"type": "shell",
"command": "npm",
"args": [
"exec",
"--",
"lerna",
"exec",
"--scope=@appium/test-support",
"--",
"gulp",
"transpile"
],
"label": "transpile: @appium/test-support",
"problemMatcher": []
},
{
"type": "shell",
"command": "npm",
"args": [
"exec",
"--",
"lerna",
"exec",
"--scope=@appium/gulp-plugins",
"--",
"gulp",
"transpile"
],
"label": "transpile: @appium/gulp-plugins",
"problemMatcher": []
},
{
"type": "shell",
"command": "npm",
"args": [
"exec",
"--",
"lerna",
"exec",
"--scope=@appium/doctor",
"--",
"gulp",
"transpile"
],
"label": "transpile: @appium/doctor",
"problemMatcher": []
},
{
"type": "shell",
"command": "npm",
"args": [
"exec",
"--",
"lerna",
"exec",
"--scope=@appium/base-driver",
"--",
"gulp",
"transpile"
],
"label": "transpile: @appium/base-driver",
"problemMatcher": []
},
{
"type": "npm",
"script": "test:e2e:appium",
"problemMatcher": [],
"label": "npm: test:e2e:appium",
"detail": "e2e tests: appium"
}
]
}
+13 -7
View File
@@ -14,20 +14,22 @@ module.exports = (wallaby) => {
'./packages/**/*.json',
'!./packages/**/build/**',
'!./packages/**/test/**/*-specs.js',
'!./packages/**/test/**/*.spec.js',
'!./packages/*/node_modules/**',
'!./packages/*/gulpfile.js',
'!./packages/*/scripts/**',
'./packages/*/test/**/fixtures/**/*',
'./packages/*/test/**/mocks.js',
'./packages/*/test/helpers.js',
'./babel.config.json',
// below this are fixtures
{
binary: true,
pattern: './packages/support/test/assets/sample_binary.plist',
pattern: './packages/support/test/unit/assets/sample_binary.plist',
},
{
instrument: false,
pattern: './packages/support/test/assets/sample_text.plist',
},
{
instrument: false,
pattern: './packages/*/test/**/fixtures/**/*',
pattern: './packages/support/test/unit/assets/sample_text.plist',
},
{
instrument: false,
@@ -37,6 +39,7 @@ module.exports = (wallaby) => {
instrument: false,
pattern: './packages/gulp-plugins/build/**/*',
},
// this setup file is special
{
instrument: false,
pattern: './test/setup.js'
@@ -45,7 +48,9 @@ module.exports = (wallaby) => {
testFramework: 'mocha',
tests: [
'./packages/*/test/**/*-specs.js',
'./packages/*/test/unit/**/*.spec.js',
'!./packages/*/test/**/*-e2e-specs.js',
'!./packages/*/test/e2e/**/*',
'!./packages/*/node_modules/**',
// this is more of an E2E test and it's tedious to run
'!./packages/gulp-plugins/test/transpile-specs.js',
@@ -55,6 +60,7 @@ module.exports = (wallaby) => {
},
setup() {
require('./test/setup');
}
},
runMode: 'onsave'
};
};
+248
View File
@@ -1,3 +1,251 @@
CHANGES IN VERSION 1.22.3 (FROM 1.22.2)
===================================
Appium 1.22.3 is a patch release
We're going to move to [Appium 2.x](https://github.com/appium/appium/blob/2.0/docs/en/about-appium/1.x-eol.md).
Appium 1.x will be receiving minor or patch releases only if XCTest gets breaking updates or major bugs pop up before the EOL.
### iOS(XCUITest)
- Fix failing screenshot issue in Xcode 13.3 and iOS 15.4 combination [WebDriverAgent#573](https://github.com/appium/WebDriverAgent/pull/573)
- Please read [the original issue](https://github.com/appium/appium/issues/16604) for more details
CHANGES IN VERSION 1.22.2 (FROM 1.22.1)
===================================
Appium 1.22.2 is a patch release
We're going to move to [Appium 2.x](https://github.com/appium/appium/blob/2.0/docs/en/about-appium/1.x-eol.md).
Appium 1.x will be receiving minor or patch releases only if XCTest gets breaking updates or major bugs pop up before the EOL.
### iOS(XCUITest)
- Add `safariTabBarPosition` settings api to help `nativeWebTap` capability/setting consider if the device has the tab bar at the top or at the bottom of Safari window. Please read `safariTabBarPosition` in [Settings API](https://github.com/appium/appium-xcuitest-driver#settings-api) for more details [appium-xcuitest-driver#1361](https://github.com/appium/appium-xcuitest-driver/pull/1361)
- Do not show the keyboard tutorial in iOS 15 environment for simulators [appium-ios-simulator#315](https://github.com/appium/appium-ios-simulator/pull/315)
- Fix to pass installation options in [Install App](http://appium.io/docs/en/commands/device/app/install-app/) command [appium-xcuitest-driver#1357](https://github.com/appium/appium-xcuitest-driver/pull/1357)
- Disable the default XCTest's notification checker to avoid [an issue on iOS 15.2](https://github.com/appium/appium/issues/16025) [WebDriverAgent#540](https://github.com/appium/WebDriverAgent/pull/540)
- Slightly improve the performance of XML source generation [appium-xcuitest-driver#1351](https://github.com/appium/appium-xcuitest-driver/pull/1351) [WebDriverAgent#544](https://github.com/appium/WebDriverAgent/pull/544)
CHANGES IN VERSION 1.22.1 (FROM 1.22.0)
===================================
Appium 1.22.1 is a patch release
We're going to move to [Appium 2.x](https://github.com/appium/appium/blob/2.0/docs/en/about-appium/1.x-eol.md).
Appium 1.x will be receiving minor or patch releases only if XCTest gets breaking updates or major bugs pop up before the EOL.
### General
* Enforce unzip with JS implementation when `APPIUM_PREFER_SYSTEM_UNZIP` environment variable is given as `0` or `false` [appium-base-driver#537](https://github.com/appium/appium-base-driver/pull/537)
* This change may fix [installation error in iOS simulators](https://github.com/appium/appium/issues/16050)
### Android General
* Use bundletool to install .apks packages [appium-adb#578](https://github.com/appium/appium-adb/pull/578)
* Handle unlock via `locksettings` adb command [appium-adb#577](https://github.com/appium/appium-adb/pull/577)
* Add a tiny delay after changing IME for Android 12 [appium-adb#581](https://github.com/appium/appium-adb/pull/581)
### Android(UIAutomator2)
* Add capabilities:
* `unlockStrategy` to customize the strategy of unlock. Defaults to `locksettings` on Android 8+, where this adb shell command is supported. The previous behavior is `uiautomator`.
* `chromeLoggingPrefs` to configure chrome logging preferences mapping [appium-android-driver#710](https://github.com/appium/appium-android-driver/pull/710)
* Add `mobile:` extensions:
* `mobile:unlock` to unlock the device as a mobile command [appium-android-driver#709](https://github.com/appium/appium-android-driver/pull/709)
* Fix `/appium/device/display_density` endpoint to get the device density on Android 12 by getting it via Android API instead of adb command [appium-uiautomator2-driver#474](https://github.com/appium/appium-uiautomator2-driver/pull/474) [appium-uiautomator2-server#444](https://github.com/appium/appium-uiautomator2-server/pull/444)
* XPath locators now support [XPath 2.0](https://www.w3.org/TR/xpath20/) specification. XPath 2.0 is backward compatible to v 1.0, which means the most of existing queries should still work as expected. However, more advanced queries might require updates due to the strict type checking. See [issues#16142](https://github.com/appium/appium/issues/16142) [appium-uiautomator2-server#442](https://github.com/appium/appium-uiautomator2-server/pull/442) for more details.
### iOS(XCUITest)
* Decode cookies safely in WebView context [appium-xcuitest-driver#1336](https://github.com/appium/appium-xcuitest-driver/pull/1336)
* Tune alert monitoring [appium-xcuitest-driver#1340](https://github.com/appium/appium-xcuitest-driver/pull/1340)
* Add capabilities:
* `appInstallStrategy` capability to customize the application installation strategy. `serial`, `parallel` and `ios-deploy` are available. Please read [capabilities](https://github.com/appium/appium-xcuitest-driver#app) for more details. This strategy is available via installation APIs as well.
* Add `mobile:` extensions:
* `mobile:listApps` to get the list of installed applications on the real device under test [appium-xcuitest-driver#1342](https://github.com/appium/appium-xcuitest-driver/pull/1342)
* Add `NSProcessInfoThermalState` in [mobile: deviceInfo](https://github.com/appium/appium-xcuitest-driver#mobile-deviceinfo) [WebDriverAgent#536](https://github.com/appium/WebDriverAgent/pull/536)
* Add `nativeWebTapTabBarVisibility` and `nativeWebTapTabBarVisibility` Settings API items to handle _tab bar_ and _smart app banner_ via Settings API [appium-xcuitest-driver#1345](https://github.com/appium/appium-xcuitest-driver/pull/1345) (Thanks @zcmgyu)
* Fix `useXctestrunFile` capability behavior on Xcode 13 [WebDriverAgent#538](https://github.com/appium/WebDriverAgent/pull/538)
* Fix caching elements from `execute_script` in WebView context [appium-xcuitest-driver#1350](https://github.com/appium/appium-xcuitest-driver/pull/1350)
* Fix `<` escape in the XML page source (`"appium:useJSONSource": false`) [appium-xcuitest-driver#1347](https://github.com/appium/appium-xcuitest-driver/pull/1347)
* Disable the build in notification checker by XCTest to avoid possible UI interuction failure on Xcode 13.2 and iOS 15.2 [WebDriverAgent#540](https://github.com/appium/WebDriverAgent/pull/540)
CHANGES IN VERSION 1.22.0 (FROM 1.21.0)
===================================
Appium 1.22.0 is a minor release
We're going to move to [Appium 2.x](https://github.com/appium/appium/blob/2.0/docs/en/about-appium/1.x-eol.md).
Appium 1.x will have minor or patch releases only when Appium 1.x gets breaking updates in XCTest or critical bugs before the EOL.
### General
* Add `imageMatchMethod` to be able to customize image mathcing method in [find element by image](http://appium.io/docs/en/advanced-concepts/image-elements/) [appium-base-driver#480](https://github.com/appium/appium-base-driver/pull/480) [appium-support#222](https://github.com/appium/appium-support/pull/222)
* `appium:enableWebviewDetailsCollection` capability defaults to `true` [appium-android-driver#699](https://github.com/appium/appium-android-driver/pull/699) (Thanks @mwakizaka)
* Support `satellites` option in `setGeoLocation` command as [geo command on emulators](https://developer.android.com/studio/run/emulator-console) [appium-adb#571](https://github.com/appium/appium-adb/pull/571)
* Use system unzip to unzip compressed files by default. It fallbacks to JS implementation. [appium-support#226](https://github.com/appium/appium-support/pull/226) [appium-support#227](https://github.com/appium/appium-support/pull/227)
### Android General
* Add `pinWithKeyEvent` option as `unlockType` in [unlock action](https://github.com/appium/appium-android-driver/blob/master/docs/UNLOCK.md) to send the pin code as keyevent [appium-android-driver#691](https://github.com/appium/appium-android-driver/pull/691)
* Allow to establish a chrome session with its `beta`, `dev` and `canary` [appium-android-driver#699](https://github.com/appium/appium-android-driver/pull/699) (Thanks @mwakizaka)
* Optimize error handling in certificate validation [appium-adb#572](https://github.com/appium/appium-adb/pull/572)
### Android(UIAutomator2)
* Add `mobile:` extensions:
* `mobile:startActivity` to launch an activity more flexible. Please read [mobile: startActivity](https://github.com/appium/appium-uiautomator2-driver#mobile-startactivity) for more details [appium-android-driver#701](https://github.com/appium/appium-android-driver/pull/701)
* `mobile: broadcast` to a send broadcast intent. Please read [mobile: broadcast](https://github.com/appium/appium-uiautomator2-driver#mobile-broadcast) for more details [appium-uiautomator2-driver/471](https://github.com/appium/appium-uiautomator2-driver/pull/471)
* `mobile: clearApp` to delete a package data via `adb shell pm clear` [appium-uiautomator2-driver#472](https://github.com/appium/appium-uiautomator2-driver/pull/472)
* Add active element support [appium-uiautomator2-driver#457](https://github.com/appium/appium-uiautomator2-driver/pull/457) [appium-uiautomator2-server#424](https://github.com/appium/appium-uiautomator2-server/pull/424) (Thanks @vane and @jzaleski)
### Android(Espresso)
* The default Kotlin plugin version is 1.4.32 [appium-espresso-driver#663](https://github.com/appium/appium-espresso-driver/pull/663)
* Fix typecast error in build config [appium-espresso-driver#683](https://github.com/appium/appium-espresso-driver/pull/683)
### iOS General
* Xcode 13 and iOS 15 support
### iOS(XCUITest)
* Add capabilities:
* `appium:useNativeCachingStrategy` to reduce a potential stale element error. Please read the capability in [XCUITest capabilities](https://github.com/appium/appium-xcuitest-driver#webdriveragent). Defaults to `true` [appium-xcuitest-driver#1317](https://github.com/appium/appium-xcuitest-driver/pull/1317)
* `appium:forceAppLaunch` to launch the application under test forcefully with `appium:bundleId`. Defaults to `true` unless `noReset` capability is set to `true`. [appium-xcuitest-driver#1314](https://github.com/appium/appium-xcuitest-driver/pull/1314)
* `appium:forceSimulatorSoftwareKeyboardPresence` to make force enabling simulator keyboard optional for simulator. Please read the section in [capabilities](https://github.com/appium/appium-xcuitest-driver#simulator) for more details. [appium-xcuitest-driver#1327](https://github.com/appium/appium-xcuitest-driver/pull/1327)
* `appium:resetLocationService` to reset the location service in the session deletion on real device. [appium-xcuitest-driver#1333](https://github.com/appium/appium-xcuitest-driver/pull/1333)
* Add `mobile:` extensions:
* `mobile:configureLocalization` to change localization settings on the currently booted simulator. Please read [configurelocalization](https://github.com/appium/appium-xcuitest-driver#mobile-configurelocalization) for more details [appium-xcuitest-driver#1300](https://github.com/appium/appium-xcuitest-driver/pull/1300)
* `mobile:resetLocationService` to reset the location service. [appium-xcuitest-driver#1333](https://github.com/appium/appium-xcuitest-driver/pull/1333)
* Add `durationSeconds` argument in `mobile: pressButton` for tvOS
* Add `getProperty` command to support [Get Element Property](https://www.w3.org/TR/webdriver/#dfn-get-element-property) endpoint. In native context, the command is equal to [Get Element Attribute](https://www.w3.org/TR/webdriver/#get-element-attribute) [appium-xcuitest-driver#1313](https://github.com/appium/appium-xcuitest-driver/pull/1313)
* Update parsing logic to parse `:wdc:` element id by Safari Web inspector in WebView context [appium-xcuitest-driver#1324](https://github.com/appium/appium-xcuitest-driver/pull/1324) [appium#15230](https://github.com/appium/appium/issues/15230)
* Probably the host macOS should have Safari 14.1
* Improve alert checking logic in Web context [appium-xcuitest-driver#1320](https://github.com/appium/appium-xcuitest-driver/pull/1320)
* Fix coordinate offset with `absoluteWebLocations` capability in Web context
[appium-xcuitest-driver#1322](https://github.com/appium/appium-xcuitest-driver/pull/1322)
* Fix element identification logic for over iOS 13 [WebDriverAgent#523](https://github.com/appium/WebDriverAgent/pull/523) (Thanks @Dan-Maor)
* This fix may improve page source results in some environment
* Fix visibility handling in `mobile:scroll` with `toVisible` argument [WebDriverAgent#528](https://github.com/appium/WebDriverAgent/pull/528) (Thanks @Dan-Maor)
* Fix `velocity` argument in `mobile:swipe` [appium-xcuitest-driver#1329](https://github.com/appium/appium-xcuitest-driver/pull/1329)
* Fix: `customSSLCert` capability logic [appium-xcuitest-driver#1334](https://github.com/appium/appium-xcuitest-driver/pull/1334)
### Mac2
* Add `macos:` extensions:
* Add support [swipe guestures](https://github.com/appium/appium-mac2-driver#mobile-swipe) [appium-mac2-driver#85](https://github.com/appium/appium-mac2-driver/pull/85)
* Add `language` option in `macos: appleScript` to be able to use other languages supported by `osascript` [appium-mac2-driver#89](https://github.com/appium/appium-mac2-driver/pull/89)
* Add support of touch bar interaction [appium-mac2-driver#87](https://github.com/appium/appium-mac2-driver/pull/87)
* Fix handling of libxml2 client to prevent memory leaks [appium-mac2-driver#86](https://github.com/appium/appium-mac2-driver/pull/86)
## Windows
* Add `windows:` extensions:
* [`deleteFile`](https://github.com/appium/appium-windows-driver#windows-deletefile) and [`deleteFolder`](https://github.com/appium/appium-windows-driver#windows-deletefolder) [appium-windows-driver#107](https://github.com/appium/appium-windows-driver/pull/107) (Thanks @ggaller)
* Add [push_file](https://appium.io/docs/en/commands/device/files/push-file/), [pull_file](https://appium.io/docs/en/commands/device/files/pull-file/), [pull_folder](https://appium.io/docs/en/commands/device/files/pull-folder/) [appium-windows-driver#107](https://github.com/appium/appium-windows-driver/pull/107) (Thanks @ggaller)
* Tune WAD install path lookup [appium-windows-driver#111](https://github.com/appium/appium-windows-driver/pull/111) (Thanks to notice us @blakee1)
### Community/Company based drivers
#### You.i Engine Driver
The version is `1.2.9`
#### Flutter driver
The version is `0.0.32`
CHANGES IN VERSION 1.21.0 (FROM 1.20.2)
===================================
Appium 1.21.0 is a minor release
### General
* Minimum NodeJS version moved to 12
* Support multiple image matches for [Finding and Interacting with Image Elements](http://appium.io/docs/en/advanced-concepts/image-elements/) [appium-base-driver#449](https://github.com/appium/appium-base-driver/pull/449) (@khaong)
### Android General
* Disable sending of Google analytics data by instruments [appium-uiautomator2-driver#452](https://github.com/appium/appium-uiautomator2-driver/pull/452), [appium-espresso-driver#666](https://github.com/appium/appium-espresso-driver/pull/666)
* Improve detection of screen lock status [appium/appium-adb#564](https://github.com/appium/appium-adb/pull/564)
* Add `speed` optional parameter to mock location [appium-android-driver#681](https://github.com/appium/appium-android-driver/pull/681) (Thanks to @salabogdan)
* Fix `autoLaunch` to install applications by `app` and `otherApps` capabilities, but does not launch them as same as iOS [appium-uiautomator2-driver#440](https://github.com/appium/appium-uiautomator2-driver/pull/440), [appium-espresso-driver#654](https://github.com/appium/appium-espresso-driver/pull/654), [appium-android-driver#676](https://github.com/appium/appium-android-driver/pull/676)
* Fix to handle special characters by `mobile:type` [appium-adb#567](https://github.com/appium/appium-adb/pull/567)
* Fix to switch to Web Views with same package name, but different process names [appium-android-driver#687](https://github.com/appium/appium-android-driver/pull/687)
* Fix to stop screen recording after a session is closed [appium-android-driver#675](https://github.com/appium/appium-android-driver/pull/675) and each driver
### Android(UIAutomator2)
* Add `mobile:` extensions:
* `mobile:doubleClickGesture` for double click guesture [appium-uiautomator2-driver#441](https://github.com/appium/appium-uiautomator2-driver/pull/441), [appium-uiautomator2-server#415](https://github.com/appium/appium-uiautomator2-server/pull/415)
* `mobile:installMultipleApks` to install multiple apks via `adb install-multiple` command. Please read [mobile:installMultipleApks](https://github.com/appium/appium-uiautomator2-driver/blob/master/README.md#mobile-installmultipleapks) for more details
* Fix XPath lookup for queries which have `@*` attribute pattern [appium-uiautomator2-server#417](https://github.com/appium/appium-uiautomator2-server/pull/417)
### Android(Espresso)
* Fix to raise an error in [Reset App](http://appium.io/docs/en/commands/device/app/reset-app/). It must quit the session and create a new one in Espresso driver. [appium-espresso-driver#649](https://github.com/appium/appium-espresso-driver/pull/649)
* Fix to reset instrumentation state before starting a new instance [appium-espresso-driver#662](https://github.com/appium/appium-espresso-driver/pull/662)
* Gradle wrapper has been rewritten using Kotlin DSL [appium-espresso-driver#658](https://github.com/appium/appium-espresso-driver/pull/658), [appium-espresso-driver#659](https://github.com/appium/appium-espresso-driver/pull/659) (Thanks to @misa)
### iOS General
* Xcode 12.5 support
### iOS(XCUITest)
* Add capabilities:
* `appium:includeDeviceCapsToSessionInfo` to skip adding the screen information in order to improve [Get Session Capabilities](http://appium.io/docs/en/commands/session/get/) API. `mobile:viewportRect` and `mobile:deviceScreenInfo` help to get these information when this capability is `false`. [appium-xcuitest-driver#1278](https://github.com/appium/appium-xcuitest-driver/pull/1278)
* `appium:disableAutomaticScreenshots` to handle automatic screenshot by XCTest. Defaults to `true` [appium-xcuitest-driver#1288](https://github.com/appium/appium-xcuitest-driver/pull/1288) (@mrmacete)
* `appium:shouldTerminateApp` to handle if Appium terminates the application under test process on the session end. Defaults to `true` [appium-xcuitest-driver#1290](https://github.com/appium/appium-xcuitest-driver/pull/1290), [WebDriverAgent#486/](https://github.com/appium/WebDriverAgent/pull/486/) (Thanks to @mrmacete)
* Add `mobile:` extensions:
* `mobile:viewportRect` returns the screen viewport information which is part of [Get Session Capabilities](http://appium.io/docs/en/commands/session/get/)
* `mobile:deviceScreenInfo` returns the screen information which is part of [Get Session Capabilities](http://appium.io/docs/en/commands/session/get/), [WebDriverAgent#483](https://github.com/appium/WebDriverAgent/pull/483)
* `mobile:pushNotification` to simulator push notification on simulator by `xcrun simctl push` command. It requires Xcode 11.4+. Please read [mobile:pushNotification](https://github.com/appium/appium-xcuitest-driver#mobile-pushnotification) for mroe details to trigger a push notification. [appium-xcuitest-driver#1286](https://github.com/appium/appium-xcuitest-driver/pull/1286/)
* `mobile:expectNotification` to wait for a notification on the device under test. Please read [mobile:expectNotification](https://github.com/appium/appium-xcuitest-driver#mobile-pushnotification) for more information on how to use it. [appium-xcuitest-driver#1287](https://github.com/appium/appium-xcuitest-driver/pull/1287) [WebDriverAgent#480](https://github.com/appium/WebDriverAgent/pull/480)
* `mobile:performIoHidEvent` to emulate low-level IO HID device events. Read [mobile:performIoHidEvent](https://github.com/appium/appium-xcuitest-driver#mobile-performiohidevent) for more details. [appium-xcuitest-driver#1291](https://github.com/appium/appium-xcuitest-driver/pull/1291), [WebDriverAgent#494](https://github.com/appium/WebDriverAgent/pull/494)
* Add css selector support [appium-xcuitest-driver#1274](https://github.com/appium/appium-xcuitest-driver/pull/1274)
* `css selector` selector will be converted to `-ios class chain` selector
* Support [Get Geolocation](https://appium.io/docs/en/commands/session/geolocation/get-geolocation/) API [appium-xcuitest-driver#1266](https://github.com/appium/appium-xcuitest-driver/pull/1266)
* _Allow Location Access_ in _Location Services_ for _WebDriverAgent-Runner_ must be set to **Always**
* Add `accessible` attribute field into the XML page source [WebDriverAgent#493](https://github.com/appium/WebDriverAgent/pull/493) (Thanks to @TheDarkestDay)
* Improve performance of the keyboard dismissal logic [appium-xcuitest-driver#1267](https://github.com/appium/appium-xcuitest-driver/pull/1267), [WebDriverAgent#458](https://github.com/appium/WebDriverAgent/pull/458)
* Fix performance degradation of interaction in `nativeWebTap:true` [appium-xcuitest-driver/pull/1265](https://github.com/appium/appium-xcuitest-driver#1265)
### Mac2
* Add capabilities:
* `appium:webDriverAgentMacUrl` to allow Appium to connect to a running WebDriverAgentMac instance at this URL [appium-mac2-driver#41](https://github.com/appium/appium-mac2-driver/pull/41)
* Add a possibility to provide key names for `macos:keys` extension [appium-mac2-driver#60](https://github.com/appium/appium-mac2-driver/pull/60)
* Add `hittable` attribute field into the XML page source [appium-mac2-driver#65](https://github.com/appium/appium-mac2-driver/pull/65)
* More fine-grained handling of orphaned xcodebuild processes [appium-mac2-driver#73](https://github.com/appium/appium-mac2-driver/pull/73)
### You.i Engine Driver
The version is `1.2.8`
### Community based drivers
#### Flutter driver
The version is `0.0.28`
#### New drivers
Add the ability to load `appium-roku-driver`([appium#15227](https://github.com/appium/appium/pull/15227)) and `appium-webos-driver`([appium#15260](https://github.com/appium/appium/pull/15260)) by @cbuelvasc
CHANGES IN VERSION 1.20.2 (FROM 1.20.1)
===================================
Appium 1.20.2 is a patch release
### Android(UIAutomator2)
* Fix element caching performance [appium-uiautomator2-server#406](https://github.com/appium/appium-uiautomator2-server/pull/406)
CHANGES IN VERSION 1.20.1 (FROM 1.20.0)
===================================
Appium 1.20.1 is a patch release
### Android(UIAutomator2)
* Fix setting the session capabilities [appium-uiautomator2-server#404](https://github.com/appium/appium-uiautomator2-server/pull/404)
CHANGES IN VERSION 1.20.0 (FROM 1.19.1)
===================================
+1 -2
View File
@@ -1,8 +1,7 @@
## Appium
[![NPM version](https://badge.fury.io/js/appium.svg)](https://npmjs.org/package/appium)
[![Dependency Status](https://david-dm.org/appium/appium.svg)](https://david-dm.org/appium/appium)
[![devDependency Status](https://david-dm.org/appium/appium/dev-status.svg)](https://david-dm.org/appium/appium#info=devDependencies)
[![Node.js CI](https://github.com/appium/appium/actions/workflows/node.js.yml/badge.svg?branch=2.0)](https://github.com/appium/appium/actions/workflows/node.js.yml)
[![Monthly Downloads](https://img.shields.io/npm/dm/appium.svg)](https://npmjs.org/package/appium)
+8 -13
View File
@@ -4,22 +4,13 @@
"@babel/preset-env",
{
"targets": {
"node": "10"
}
"node": "12"
},
"shippedProposals": true
}
]
],
"plugins": [
"source-map-support",
"@babel/plugin-transform-runtime",
"@babel/plugin-syntax-bigint",
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-optional-chaining",
["@babel/plugin-proposal-private-methods", {"loose": true}],
["@babel/plugin-proposal-class-properties", {"loose": true}],
["@babel/plugin-proposal-private-property-in-object", {"loose": true}]
],
"plugins": ["source-map-support", "@babel/plugin-transform-runtime"],
"comments": false,
"sourceMaps": "both",
"env": {
@@ -32,6 +23,10 @@
}
]
]
},
"test": {
"retainLines": true,
"comments": true
}
}
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"composite": true,
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"module": "es2015",
"moduleResolution": "node",
"resolveJsonModule": true,
"strictNullChecks": true,
"removeComments": false,
"target": "es2015",
"types": [
"node",
"mocha",
"chai",
"sinon-chai",
"chai-as-promised"
]
}
}
+7 -2
View File
@@ -6,6 +6,11 @@ Formatted doc is [here](http://appium.io/documentation.html?lang=en).
## doc translation
At the moment we are focusing on improving the english documentation. When it
is done we are planning to setup proper i18n l10n processes so that it is
At the moment we are focusing on improving the English documentation. When it
is done, we are planning to establish proper i18n and l10n processes so that it is
easier for people to help in translating the documentation.
## Bump supported NodeJS version
- Refer to the [Node.js Release Working Group README](https://github.com/nodejs/release#readme) to check LTS, maintenance, and EOL Node.js versions
- Example to bump supported NodeJS version: appium/appium#15000
+7 -4
View File
@@ -11,13 +11,16 @@ Appium 服务端自身定义了基于官方协议的扩展,帮助 Appium 用
Ruby | [https://github.com/appium/ruby_lib](https://github.com/appium/ruby_lib), [https://github.com/appium/ruby_lib_core](https://github.com/appium/ruby_lib_core)
Python | [https://github.com/appium/python-client](https://github.com/appium/python-client)
Java | [https://github.com/appium/java-client](https://github.com/appium/java-client)
C# (.NET) | [https://github.com/appium/appium-dotnet-driver](https://github.com/appium/appium-dotnet-driver)
### Community based
语言 / 框架 | Github 仓库和安装指南 |
----- | ----- |
JavaScript (Node.js) | [https://github.com/admc/wd](https://github.com/admc/wd)
JavaScript (Node.js) | [https://github.com/webdriverio/webdriverio](https://github.com/webdriverio/webdriverio)
JavaScript (Browser) | [https://github.com/projectxyzio/web2driver](https://github.com/projectxyzio/web2driver)
Objective C | [https://github.com/appium/selenium-objective-c](https://github.com/appium/selenium-objective-c)
PHP | [https://github.com/appium/php-client](https://github.com/appium/php-client)
C# (.NET) | [https://github.com/appium/appium-dotnet-driver](https://github.com/appium/appium-dotnet-driver)
RobotFramework | [https://github.com/jollychang/robotframework-appiumlibrary](https://github.com/jollychang/robotframework-appiumlibrary)
RobotFramework | [https://github.com/serhatbolsu/robotframework-appiumlibrary](https://github.com/serhatbolsu/robotframework-appiumlibrary)
---
EOF.
+1 -1
View File
@@ -1,6 +1,6 @@
## Appium 介绍
Appium 是一个开源工具,用于自动化 iOS 手机、 Android 手机和 Windows 桌面平台上的原生、移动 Web 和混合应用。**「原生应用」**指那些用 iOS、 Android 或者 Windows SDKs 编写的应用。**「移动 Web 应用」**是用移动端浏览器访问的应用( Appium 支持 iOS 上的 Safari 、Chrome 和 Android 上的内置浏览器)。**「混合应用」**带有一个「webview」的包装器——用来和 Web 内容交互的原生控件。类似于 [Apache Cordova](https://cordova.apache.org) 或 [Phonegap](http://phonegap.com/) 项目,创建一个混合应用使得用 Web 技术开发然后打包进原生包装器创建一个混合应用变得容易了。
Appium 是一个开源工具,用于自动化 iOS 手机、 Android 手机和 Windows 桌面平台上的原生、移动 Web 和混合应用。**「原生应用」**指那些用 iOS、 Android 或者 Windows SDKs 编写的应用。**「移动 Web 应用」**是用移动端浏览器访问的应用( Appium 支持 iOS 上的 Safari 、Chrome 和 Android 上的内置浏览器)。**「混合应用」**带有一个「webview」的包装器——用来和 Web 内容交互的原生控件。类似于 [Apache Cordova](https://cordova.apache.org) 项目,创建一个混合应用使得用 Web 技术开发然后打包进原生包装器创建一个混合应用变得容易了。
重要的是,Appium 是跨平台的:它允许你用同样的 API 对多平台(iOS、Android、Windows)写测试。做到在 iOS、Android 和 Windows 测试套件之间复用代码。
+1 -1
View File
@@ -29,7 +29,7 @@ Appium 给用户提供了在一个机器上启动多个 Android sessions 的方
十分不幸,目前并不能在本地运行 iOS 的并发测试。iOS 同一时间只能启动一个模拟器,不像 Andoid 可以同时多个模拟器去运行测试。
如果你想运行 iOS 的并发测试,你需要使用 Sauce 上传你的 Appium 测试脚本,然后就可以运行多台 iOS 和 Android 的并发测试,只要你的账号允许。查看更多相关信息可以查看 [这里](https://docs.saucelabs.com/tutorials/appium/)。
如果你想运行 iOS 的并发测试,你需要使用 Sauce 上传你的 Appium 测试脚本,然后就可以运行多台 iOS 和 Android 的并发测试,只要你的账号允许。
本文由 thanksdanny 翻译,由 lihuazhang 校验。
@@ -8,17 +8,13 @@ Appium 支持以下语言的客户端类库:
| [Python][pypi]               | [GitHub](https://github.com/appium/python-client) |
| [Java][maven] | [GitHub](https://github.com/appium/java-client) |
| [JavaScript][npm] | [GitHub](https://github.com/admc/wd) |
| [PHP][php] | [GitHub](https://github.com/appium/php-client) |
| [C#][nuget] | [GitHub](https://github.com/appium/appium-dotnet-driver) |
| [Objective-C][cocoapods] | [GitHub](https://github.com/appium/selenium-objective-c) |
[rubygems]: http://rubygems.org/gems/appium_lib
[pypi]: https://pypi.python.org/pypi/Appium-Python-Client
[maven]: https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22io.appium%22%20AND%20a%3A%22java-client%22
[npm]: https://www.npmjs.org/package/wd
[php]: https://github.com/appium/php-client
[nuget]: https://www.nuget.org/packages/Appium.WebDriver/
[cocoapods]: https://github.com/appium/selenium-objective-c
注意,一些方法类似 `endTestCoverage()` 目前并不能完全支持。当[这个问题](https://github.com/appium/appium/issues/2448)被解决后,覆盖率支持才会被添加。如果你仍然想使用这些方法,请参考 GitHub 上关于 bindings 的文档。
@@ -47,21 +43,11 @@ driver.lockScreen(3);
driver.lock(3)
```
```php
// php
$this->lock(3);
```
```csharp
// c#
driver.LockDevice(3);
```
```objectivec
// objective c
[driver lockDeviceScreen:3];
```
### 将应用切换至后台
将当前的应用切换到后台,然后可以让其在指定时间内回到前台,或者让它一直留在后台。
@@ -97,24 +83,12 @@ driver.backgroundApp(-1); // 持续置于后台
driver.backgroundApp({timeout: null}); // 持续置于后台
```
```php
// php
$this->backgroundApp(5);
$this->backgroundApp(-1);
```
```csharp
// c#
driver.BackgroundApp(5);
driver.BackgroundApp(-1);
```
```objectivec
// objective c
[driver runAppInBackground:3];
[driver runAppInBackground:-1];
```
### 收起键盘
收起键盘。
@@ -141,23 +115,11 @@ driver.hideKeyboard();
driver.hideKeyboard()
```
```php
// php
$this->hideKeyboard();
$this->hideKeyboard(array('strategy' => 'pressKey', 'key' => 'Done'));
```
```csharp
// c#
driver.HideKeyboard("Done");
```
```objectivec
// objective c
[driver hideKeyboard];
```
### 启动 Activity
在当前 app 打开一个 activity,或者新打开一个应用并启动一个 acticity, *仅支持 Android*。
@@ -187,18 +149,6 @@ start_activity app_package: 'io.appium.android.apis', app_activity: '.accessibil
driver.StartActivity("com.example.android.apis", ".Foo");
```
```php
// php
$this->startActivity(array("appPackage" => "com.example.android.apis",
"appActivity" => ".Foo"));
```
```objectivec
// objective c
[driver startActivity:@"com.example.android.apis" package:@".Foo"];
```
### 打开通知栏
打开通知栏,*仅支持 Android*。
@@ -228,16 +178,6 @@ open_notifications
driver.OpenNotifications();
```
```php
// php
$this->openNotifications();
```
```objectivec
// objective c
[driver openNotifications];
```
### 应用是否已安装
检测应用是否已被安装。
@@ -263,21 +203,11 @@ driver.isAppInstalled("com.example.android.apis")
.then(function (isAppInstalled) { /*...*/ })
```
```php
// php
$this->isAppInstalled('com.example.android.apis');
```
```csharp
// c#
driver.IsAppInstalled("com.example.android.apis-");
```
```objectivec
// objective c
[driver isAppInstalled:@"com.example.android.apis-"];
```
### 安装应用
在设备上安装应用。
@@ -302,21 +232,11 @@ driver.installApp("path/to/my.apk")
driver.installApp("path/to/my.apk")
```
```php
// php
$this->installApp('path/to/my.apk');
```
```csharp
// c#
driver.InstallApp("path/to/my.apk");
```
```objectivec
// objective c
[driver installAppAtPath:@"path/to/my.apk"];
```
### 卸载应用
@@ -342,21 +262,11 @@ driver.removeApp("com.example.android.apis")
driver.removeApp("com.example.android.apis")
```
```php
// php
$this->removeApp('com.example.android.apis');
```
```csharp
// c#
driver.RemoveApp("com.example.android.apis");
```
```objectivec
// objective c
[driver removeApp:@"com.example.android.apis"];
```
### 摇一摇
模拟摇晃设备的操作。
@@ -381,21 +291,11 @@ driver.shake()
driver.shake()
```
```php
// php
$this->shake();
```
```csharp
// c#
driver.ShakeDevice();
```
```objectivec
// objective c
[driver shakeDevice];
```
### 关闭应用
关闭应用。
@@ -420,21 +320,11 @@ driver.closeApp()
driver.closeApp()
```
```php
// php
$this->closeApp();
```
```csharp
// c#
driver.CloseApp();
```
```objectivec
// objective c
[driver closeApp];
```
### 启动(Launch)
为 desired capabilities 启动一个 session。请注意只有设置了 autoLaunch=false 关键字时才会生效。这不是为了随意启动一个应用或 activities ——如果你想这么做,请使用 `start_activity` 这个 desired capability 的参数。这个方法的使用场景是在你设置了 autoLaunch=false 后,用来继续执行初始化("launch")流程的。(译者注:举个例子,国产系统经常会在应用安装时弹出提示窗阻碍安装,此时可以通过 autoLaunch=false 来让应用安装后先执行你的脚本来关掉弹窗,然后再用这个函数来继续启动应用。)
@@ -459,21 +349,11 @@ driver.launchApp()
driver.launchApp()
```
```php
// php
$this->launchApp();
```
```csharp
// c#
driver.LaunchApp();
```
```objectivec
// objective c
[driver launchApp];
```
### 重置
重置应用。(译者注:类似于清除缓存)
@@ -498,21 +378,11 @@ driver.resetApp()
driver.resetApp()
```
```php
// php
$this->reset();
```
```csharp
// c#
driver.ResetApp();
```
```objectivec
// objective c
[driver resetApp];
```
### 可用的上下文(Contexts)
列出所有可用的上下文(contexts)。
@@ -537,21 +407,11 @@ driver.getContextHandles()
driver.contexts().then(function (contexts) { /*...*/ })
```
```php
// php
$this->contexts();
```
```csharp
// c#
driver.GetContexts()
```
```objectivec
// objective c
NSArray *contexts = driver.allContexts;
```
### 当前上下文(context)
列出当前的上下文(context)。
@@ -576,21 +436,11 @@ driver.getContext()
driver.currentContext().then(function (context) { /*...*/ })
```
```php
// php
$this->context();
```
```csharp
// c#
driver.GetContext()
```
```objectivec
// objective c
NSString *context = driver.context;
```
### 切换至默认的上下文(context)
切换回默认的上下文(context)。(译者注:一般就是原生上下文 “NATIVE_APP”)
@@ -615,21 +465,11 @@ driver.context();
driver.context()
```
```php
// php
$this->context(NULL);
```
```csharp
// c#
driver.SetContext();
```
```objectivec
// objective c
[driver setContext:nil];
```
### 应用的字符串
获得应用的字符串。(译者注:这里实际指的是返回应用的多语言文本,即每个 string 变量及在指定语言上的显示内容。例如 `{"action_forgot_password":"Forgot your password?"}` 。在 android 上对应的是项目中的 `strings.xml` 多语言配置文件)
@@ -654,23 +494,11 @@ driver.getAppStrings();
driver.getAppStrings().then(function (appStrings) { /*...*/ })
```
```php
// php
$this->appStrings();
$this->appStrings('ru');
```
```csharp
// c#
driver.GetAppStrings();
```
```objectivec
// objective c
[driver appStrings];
[driver appStringsForLanguage:"@ru"];
```
### 按键事件
给设备发送按键事件。
@@ -695,22 +523,11 @@ driver.sendKeyEvent(AndroidKeyCode.HOME);
driver.deviceKeyEvent(wd.SPECIAL_KEYS.Home)
```
```php
// php
$this->keyEvent('176');
```
```csharp
// c#
driver.KeyEvent("176");
```
```objectivec
// objective c
NSError *err;
[driver triggerKeyEvent:176 metastate:0 error:&err];
```
### 当前 Activity
获取当前的 Acticity。仅支持 Android。
@@ -735,22 +552,11 @@ driver.currentActivity();
driver.getCurrentActivity().then(function (activity) { /*...*/ })
```
```php
// php
$this->currentActivity();
```
```csharp
// c#
driver.GetCurrentActivity();
```
```objectivec
// objective c
NSError *err;
[driver currentActivity];
```
### 当前包名(package)
获取当前包名(package)。仅支持 Android 。
@@ -775,17 +581,11 @@ driver.getCurrentPackage();
driver.getCurrentPackage().then(function (package) { /*...*/ })
```
```php
// php
$this->currentPackage();
```
```csharp
// c#
driver.GetCurrentPackage();
```
### 点击操作 / 多点触控操作
用于生成点击操作的 API。这部分文档的内容将会很快被补充进来。
@@ -821,33 +621,6 @@ action
return action.perform(); // returns a promise
```
```php
// php
$action = $this->initiateTouchAction();
->press(array('element' => $el))
->release()
->perform();
$action1 = $this->initiateTouchAction();
$action1->press(array('element' => $els[0]))
->moveTo(array('x' => 10, 'y' => 0))
->moveTo(array('x' => 10, 'y' => -75))
->moveTo(array('x' => 10, 'y' => -600))
->release();
$action2 = $this->initiateTouchAction();
$action2->press(array('element' => $els[1]))
->moveTo(array('x' => 10, 'y' => 10))
->moveTo(array('x' => 10, 'y' => -300))
->moveTo(array('x' => 10, 'y' => -600))
->release();
$multiAction = $this->initiateMultiAction();
$multiAction->add($action1);
$multiAction->add($action2);
$multiAction->perform();
```
```csharp
// c#
ITouchAction action = new TouchAction(driver);
@@ -891,11 +664,6 @@ return driver.swipe({ startX: 75, startY: 500,
endX: 75, endY: 0, duration: 800 });
```
```php
// php
$this->swipe(75, 500, 75, 0, 800);
```
```csharp
// c#
todo: c#
@@ -952,10 +720,6 @@ return driver.pinch(el);
return el.pinch();
```
```php
$this->pinch($el);
```
```csharp
// c#
driver.Pinch(25, 25)
@@ -1012,11 +776,6 @@ return driver.zoom(el);
return el.zoom();
```
```php
// php
$this->zoom($el);
```
```csharp
// c#
driver.Zoom(100, 200);
@@ -1054,12 +813,6 @@ return driver.elementByAccessibilityId().then(function (el) {
});
```
```php
// php
$els = $this->elements($this->using('class name')->value('android.widget.TextView'));
$this->scroll($els[count($els) - 1], $els[0]);
```
```csharp
// c#
Dictionary<string, string> scrollObject = new Dictionary<string, string>();
@@ -1093,11 +846,6 @@ driver.pullFile("Library/AddressBook/AddressBook.sqlitedb")
.then(function (base64File) { /*...*/ })
```
```php
// php
$this->pullFile('Library/AddressBook/AddressBook.sqlitedb');
```
```csharp
// c#
driver.PullFile("Library/AddressBook/AddressBook.sqlitedb");
@@ -1133,13 +881,6 @@ driver.pushFile(path, data)
driver.pushFile(path, data)
```
```php
// php
$path = 'data/local/tmp/test_push_file.txt';
$data = 'This is the contents of the file to push to the device.';
$this->pushFile($path, base64_encode($data));
```
```csharp
// c#
driver.PushFile("/data/local/tmp/file.txt", "some data for the file");
@@ -1175,12 +916,6 @@ var settings = driver.settings();
browser.updateSettings({'someSetting': true});
```
```php
// php
$settings = $this->getSettings();
$this->updateSettings(array('cyberdelia' => "open"));
```
```csharp
// c#
Dictionary<String, Object>settings = driver.GetSettings();
@@ -22,7 +22,7 @@
想知道当前要做什么,最好的方法就是是查看示例代码:
[Node.js](https://github.com/appium/appium/tree/master/sample-code/javascript-webdriverio) | [Python](https://github.com/appium/appium/tree/master/sample-code/python) | [PHP](https://github.com/appium/appium/tree/master/sample-code/php) | [Ruby](https://github.com/appium/appium/tree/master/sample-code/ruby) | [Java](https://github.com/appium/appium/tree/master/sample-code/java)
[Node.js](https://github.com/appium/appium/tree/master/sample-code/javascript-webdriverio) | [Python](https://github.com/appium/appium/tree/master/sample-code/python) | [Ruby](https://github.com/appium/appium/tree/master/sample-code/ruby) | [Java](https://github.com/appium/appium/tree/master/sample-code/java)
基本上,首先确认 Appium 正在运行:
@@ -50,20 +50,6 @@
}
```
```php
// php
public static $browsers = array(
array(
'desiredCapabilities' => array(
'platformName' => 'iOS',
'platformVersion' => '7.1',
'deviceName' => 'iPhone Simulator',
'app' => $myApp
)
)
);
```
```java
// java
DesiredCapabilities capabilities = new DesiredCapabilities();
@@ -142,20 +128,6 @@ Activity 可以通过以下方式指定:
}
```
```php
// php
public static $browsers = array(
array(
'desiredCapabilities' => array(
'platformName' => 'Android',
'platformVersion' => '4.4',
'deviceName' => 'Android Emulator',
'app' => $myApp
)
)
);
```
```java
// java
DesiredCapabilities capabilities = new DesiredCapabilities();
@@ -205,23 +177,6 @@ Android 设备在 4.3 版本(API 级别 17)之前没有安装谷歌的 [UiA
}
```
```php
// php
public static $browsers = array(
array(
'desiredCapabilities' => array(
'automationName' => 'Selendroid',
'platformName' => 'Android',
'platformVersion' => '2.3',
'deviceName' => 'Android Emulator',
'app' => $myApp,
'appPackage' => 'com.mycompany.package',
'appActivity'=> '.MainActivity'
)
)
);
```
```java
// java
DesiredCapabilities capabilities = new DesiredCapabilities();
+11 -4
View File
@@ -6,15 +6,22 @@ Appium client libraries implement the [Mobile JSON Wire Protocol](https://github
The Appium server itself defines custom extensions to the official protocols, giving Appium users helpful access to various device behaviors (such as installing/uninstalling apps during the course of a test session). This is why we need Appium-specific clients, not just the 'vanilla' Selenium clients. Of course, Appium client libraries only **add** functionality (in fact, they simply extend the standard Selenium clients), so they can still be used to run regular Selenium sessions.
### Appium repository
Language/Framework | Github Repo and Installation Instructions |
----- | ----- |
Ruby | [https://github.com/appium/ruby_lib](https://github.com/appium/ruby_lib), [https://github.com/appium/ruby_lib_core](https://github.com/appium/ruby_lib_core)
Python | [https://github.com/appium/python-client](https://github.com/appium/python-client)
Java | [https://github.com/appium/java-client](https://github.com/appium/java-client)
JavaScript (Node.js) | [https://github.com/admc/wd](https://github.com/admc/wd)
C# (.NET) | [https://github.com/appium/appium-dotnet-driver](https://github.com/appium/appium-dotnet-driver)
### Community based
Language/Framework | Github Repo and Installation Instructions |
----- | ----- |
[Deprecated] JavaScript (Node.js) | [https://github.com/admc/wd](https://github.com/admc/wd)
JavaScript (Node.js) | [https://github.com/webdriverio/webdriverio](https://github.com/webdriverio/webdriverio)
JavaScript (Browser) | [https://github.com/projectxyzio/web2driver](https://github.com/projectxyzio/web2driver)
Objective C | [https://github.com/appium/selenium-objective-c](https://github.com/appium/selenium-objective-c)
PHP | [https://github.com/appium/php-client](https://github.com/appium/php-client)
C# (.NET) | [https://github.com/appium/appium-dotnet-driver](https://github.com/appium/appium-dotnet-driver)
RobotFramework | [https://github.com/serhatbolsu/robotframework-appiumlibrary](https://github.com/serhatbolsu/robotframework-appiumlibrary)
W3C WebDriver protocol compatible clients also work.
+4 -3
View File
@@ -18,7 +18,8 @@ to Appium, you will need [Node.js and NPM](http://nodejs.org) (use
[n](https://github.com/visionmedia/n), or `brew install node` to install
Node.js. Make sure you have not installed Node or Appium with `sudo`, otherwise
you'll run into problems). We recommend the latest stable version, though
Appium supports Node 10+.
Appium supports Node.js 12+.
(The minimal Node.js version follows Node.js' [release schedule](https://github.com/nodejs/release#readme)
The actual installation is as simple as:
@@ -184,7 +185,7 @@ So here is how we begin to construct a session in our test file:
```js
// javascript
const opts = {
path: '',
path: '/wd/hub',
port: 4723,
capabilities: {
platformName: "Android",
@@ -239,7 +240,7 @@ const wdio = require("webdriverio");
const assert = require("assert");
const opts = {
path: '',
path: '/wd/hub',
port: 4723,
capabilities: {
platformName: "Android",
+3 -4
View File
@@ -7,8 +7,8 @@ applications on iOS mobile, Android mobile, and Windows desktop platforms.
supports Safari on iOS and Chrome or the built-in 'Browser' app on Android).
**Hybrid apps** have a wrapper around a "webview" -- a native control that
enables interaction with web content. Projects like [Apache Cordova](https://cordova.apache.org)
or [Phonegap](http://phonegap.com/) make it easy to build apps using web
technologies that are then bundled into a native wrapper, creating a hybrid app.
make it easy to build apps using web technologies that are then bundled
into a native wrapper, creating a hybrid app.
Importantly, Appium is "cross-platform": it allows you to write tests against
multiple platforms (iOS, Android, Windows), using the same API. This enables
@@ -79,8 +79,7 @@ up a lot of possibilities: we can write our test code in any language that has
a http client API, but it is easier to use one of the [Appium client
libraries](http://appium.io/downloads). We can put the server on a different
machine than our tests are running on. We can write test code and rely on
a cloud service like [Sauce Labs](https://saucelabs.com/products/mobile-app-testing) & [LambdaTest](https://www.lambdatest.com/feature) to receive and
interpret the commands.
cloud services to receive and interpret the commands.
**Session**<br/>
Automation is always performed in the context of a session. Clients initiate
+20 -60
View File
@@ -1,68 +1,28 @@
## Appium Platform Support
Appium supports a variety of platforms and testing modalities (native,
hybrid, web, real devices, simulators, etc...). This document is designed to
make explicit the level of support and requirements for each of these.
hybrid, web, real devices, simulators, etc...).
This documentation aims to list available drivers and each repository.
### iOS Support
## Drivers supported by the Appium team
iOS automation is supported with two drivers:
This section lists drivers that are supported by Appium team.
* The [XCUITest Driver](/docs/en/drivers/ios-xcuitest.md)
* The (deprecated) [UIAutomation Driver](/docs/en/drivers/ios-uiautomation.md)
| Platform | Driver | Repository |
| :---: | :---: | :--- |
| iOS | [XCUITest Driver](/docs/en/drivers/ios-xcuitest.md) | https://github.com/appium/appium-xcuitest-driver |
| iOS | [safaridriver](/docs/en/drivers/safari.md) | https://github.com/appium/appium-safari-driver |
| Android | [UiAutomator2 Driver](/docs/en/drivers/android-uiautomator2.md) | https://github.com/appium/appium-uiautomator2-driver |
| Android | [Espresso Driver](/docs/en/drivers/android-espresso.md) | https://github.com/appium/appium-espresso-driver |
| Android, macOS, Windows, Linux | [geckodriver](/docs/en/drivers/gecko.md) | https://github.com/appium/appium-geckodriver |
| macOS | [Mac2Driver](/docs/en/drivers/mac2.md) | https://github.com/appium/appium-mac2-driver |
| Windows | [WinAppDriver](/docs/en/drivers/windows.md) | https://github.com/appium/appium-windows-driver |
Please refer to these driver docs for setup instructions.
## Drivers supported by their own communities
* Versions: 12.2 and up (as a rule, Appium supports the latest two iOS versions)
* Devices: Simulator and real device for iPhone, iPad and tvOS
* Native app support: Yes, with debug version of .app (simulator),
or correctly-signed .ipa (real devices). Underlying support is provided by
Apple's [XCUITest](https://developer.apple.com/reference/xctest) (or [UIAutomation](https://web.archive.org/web/20160904214108/https://developer.apple.com/library/ios/documentation/DeveloperTools/Reference/UIAutomationRef/) for older versions)
framework.
* Mobile web support: Yes, via automation of mobile Safari. For real devices,
`ios-webkit-remote-debugger` is required, and automation of native aspects of
the Safari interface is not possible. See the [mobile web doc](/docs/en/writing-running-appium/web/mobile-web.md) for instructions.
* Hybrid support: Yes. For real devices, ios-webkit-remote-debugger is
required. See the [hybrid doc](/docs/en/writing-running-appium/web/hybrid.md) for instructions.
* Support for automating multiple apps in one session: No
* Support for automating multiple devices simultaneously: No
* Support for automating vendor-provided or third-party apps: Only
vendor-provided apps (Preferences, Maps, etc...), and only on the simulator. For iOS 10+, you can automate the home screen as well.
* Support for automating custom, non-standard UI controls: Minimal. You need to
set accessibility information on the control which enables some basic
automation.
### Android Support
Android automation is supported with two drivers:
* The [UiAutomator2 Driver](/docs/en/drivers/android-uiautomator2.md)
* The (deprecated) [UiAutomator Driver](/docs/en/drivers/android-uiautomator.md)
Please refer to these driver docs for setup instructions.
* Versions: 4.3 and up
* Versions 4.3 and up are supported via Appium's [UiAutomator and UiAutomator2](http://developer.android.com/tools/testing-support-library/index.html#UIAutomator)
libraries. UiAutomator is the default driver.
* Devices: Android emulators and real Android devices
* Native app support: Yes
* Mobile web support: Yes. Automation
is effected using a bundled [Chromedriver](http://chromedriver.chromium.org)
server as a proxy. With 4.3, automation works on official Chrome
browser or Chromium only. With 4.4+, automation also works on the built-in
"Browser" app. Chrome/Chromium/Browser must already be installed on the
device under test. See the [mobile web doc](/docs/en/writing-running-appium/web/mobile-web.md) for instructions.
* Hybrid support: Yes. See the [hybrid doc](/docs/en/writing-running-appium/web/hybrid.md) for instructions.
* With default Appium automation backend: versions 4.4 and up
* Support for automating multiple apps in one session: Yes
* Support for automating multiple devices simultaneously: Yes,
though Appium must be started using different ports for the server
parameters `--port`, `--bootstrap-port` and/or
`--chromedriver-port`. See the [server args doc](/docs/en/writing-running-appium/server-args.md) for more
information on these parameters.
* Support for automating vendor-provided or third-party apps: Yes
* Support for automating custom, non-standard UI controls: No
### Windows Desktop Support
See the [Windows Driver](/docs/en/drivers/windows.md) doc for details
| Driver name | Repository |
| :---: | :--- |
| Flutter | https://github.com/appium-userland/appium-flutter-driver |
| You.i Engine | https://github.com/YOU-i-Labs/appium-youiengine-driver |
| Roku | https://github.com/projectxyzio/appium-roku-driver |
| WebOS | https://github.com/sharkyStudy/appium-webos-driver |
@@ -0,0 +1,288 @@
# Appium 2 Configuration System
Appium 2 supports configuration files. A configuration file is intended to have (nearly) 1:1 parity with command-line arguments. An end user can supply Appium 2 with a configuration file, CLI args, or both (the args have precedence over the config file).
This document will be a technical overview of how the configuration system works. It is intended for Appium contributors, but will also explain the system's fundamental features.
## Reading a Config File
A config file is a JSON, JavaScript, or YAML file which can be validated against a schema. By default, this file will be named `.appiumrc.{json,js,yaml,yml}` and should be in the root of the project which depends upon `appium`. Other filenames and locations are supported via the `--config <file>` flag. For obvious reasons, the `config` argument is disallowed within config files.
In lieu of a separate file, configuration can be embedded in a project's `package.json` using the `appiumConfig` property, e.g.,:
```json
{
"appiumConfig": {
"server": {
"port": 12345
}
}
}
```
When an Appium server is started via the `appium` executable, the `init` function in `lib/main.js` will call into `lib/config-file.js` to load and/or search for a configuration file and in `package.json`.
> Note: It is not an error if configuration isn't found!
The [`lilconfig`](https://npm.im/lilconfig) package provides the search & load functionality; refer to its documentation for more information about the search paths. Additionally, Appium provides support for config files written in YAML via the package [`yaml`](https://npm.im/yaml).
If a config file is found and successfully [validated](#validation), the result will be merged with a set of defaults and any additionall CLI arguments. CLI arguments have precedence over config files, and config files have precedence over defaults.
## Validation
The same system is used for _both_ validation of config files _and_ command-line arguments.
The package [`ajv`](https://npm.im/ajv) provides validation. Of course, to make `ajv` validate anything, it must be provided a _schema_.
The _base_ schema is a [JSON Schema Draft-7](https://json-schema.org/draft/2020-12/json-schema-core.html)-compliant object exported by `lib/schema/appium-config-schema.js`. This schema defines configuration _native to Appium_, and only concerns its behavior as a _server_; it does not define configuration for any other functionality (e.g., the `plugin` or `driver` subcommands).
> Note that this file is the _base_ schema; this will become painfully relevant.
This file is is _not_ a JSON file, because a) JSON is painful to work with for humans, b) is especially reviled by @jlipps, and c) `ajv` accepts objects, not JSON files.
It is more straightforward to explain how config files are validated, so we'll start there.
### Validating Config Files
When a config file is found (`lib/config-file.js`), it will call the `validate` function exported from `lib/schema/schema.js` with the contents of the config file. In turn, this asks `ajv` to validate the data against the schema that Appium has provided it.
If the config file is invalid, errors will be generated to be displayed to the user. Finally, the `init` function will detect these errors, display them, and the process will exit.
I hope that made sense, because this is the easy part.
### Validating CLI Arguments
As mentioned earlier, the same system is used for validating both config files and CLI arguments.
Totally not judging, but Appium uses [`argparse`](https://npm.im/argparse) for its CLI argument parsing. This package, and others like it, provides an API to define the arguments a command-line Node.js script accepts, and will ultimately return an object representation of the user-supplied arguments.
Just as the schema defines what's allowed in a config file, it also defines what's allowed on the command-line.
#### Defining CLI Arguments via Schema
CLI arguments must be _defined_ before their values can be validated.
A JSON schema isn't a natural fit for defining CLI args--it needs some grease to make it work--but it's close enough that we can do so with an adapter and some custom metadata.
In `lib/cli/parser.js`, there's a wrapper around `argparse`'s `ArgumentParser`; it's called (wait for it)... `ArgParser`. The wrapper exists because we're doing some custom things with `argparse`, but is has nothing to do with the schema directly.
An `ArgParser` instance is created and its `parseArgs()` method is called with the raw CLI arguments. The definition of the accepted arguments comes from `lib/cli/args.js` in part--here, all of the arguments _not_ intended for use with the `server` subcommand are hard-coded (e.g., the `driver` subcommand and _its_ subcommands). `args.js` also contains a function `getServerArgs()`, which in turn calls into `toParserArgs` in `lib/schema/cli-args.js`. `lib/schema/cli-args.js` can be considered the "adapter" layer between `argparse` and the schema.
`toParserArgs` uses the `flattenSchema` function exported by `lib/schema/schema.js`, which "squashes" the schema into a key/value representation. Then, `toParserArgs` iterates over each key/value pair and "converts" it into a suitable `ArgumentOption` object for final handoff to `ArgParser`.
This adapter (`cli-args.js`) is where most of the mess is hidden; let's explore this rat's nest a bit further.
##### CLI & Schema Incongruities
The conversion algorithm (see function `subSchemaToArgDef` in `lib/schema/cli-args.js`) is mostly just hacks and special cases neatly packed into a function. Things that don't cleanly map from `argparse` to a JSON schema include, but are not limited to:
- A schema cannot natively express "store the value of `--foo=<value>` in a property called `bar`" in a schema (this corresponds to the `ArgumentOption['dest']` prop).
- A schema cannot natively express aliases; e.g., `--verbose` can also be `-v`
- A schema `enum` is not restricted to multiple types, but `argparse`'s equivalent `ArgumentOption['choices']` prop _is_
- A schema does not know about `argparse`'s concept of "actions" (note that Appium is not currently using custom actions--though it did, and it could again).
- `argparse` has no native type for `email`, `hostname`, `ipv4`, `uri` etc., and the schema does
- Schema validation only _validates_, it does not perform translation, transformation, or coercion (mostly). `argparse` allows this.
- Schemas allow the `null` type, for whatever reason. Ever pass `null` on the CLI?
- `argparse` does not understand anything other than primitives; no objects, arrays, etc., and certainly not arrays of a particular type.
All of the above cases and others are handled by the adapter.
> Note: some decisions made in the adapter were arrived at via coin toss. If you are curious about why something is the way it is, it's likely that it had to do _something_.
Let's look more closely at handling types.
#### Argument Types via `ajv`
While `argparse` allows consumers, via its API, to define the _type_ of various arguments (e.g., a string, number, boolean flag, etc.), Appium mostly avoids these built-in types. _Why is that?_ Well:
1. We already know the type of an argument, because we've defined it in a schema.
2. `ajv` provides validation against a schema.
3. A schema allows for greater expression of types, allowed values, etc., than `argparse` can provide natively.
4. The expressiveness of a schema allows for better error messaging.
To that end, the adapter eschews `argparse`'s built-in types (see allowed string values of `ArgumentOption['type']`) and instead abuses the ability to provide a _function_ as a `type`. The exception is _boolean_ flags, which do not have a `type`, but rather `action: 'store_true'`. The world may never know why.
##### Types as Functions
When a `type` is a function, the function performs both validation _and_ coercion (if necessary). So what are these functions?
> Note: `type` is _omitted_ (and thus _not_ a function) from the `ArgumentOption` if the property type is `boolean`, and is instead provided an `action` property of `store_true`. Yes, this is weird. No, I don't know why.
Well... it depends upon the schema. But generally speaking, we create a _pipeline_ of functions, each corresponding to a keyword in the schema. Let's take the example of the `port` argument. In lieu of asking the OS which ports the `appium`-running user can bind to, this argument is expected to be an integer between 1 and 65535. This turns out to be two functions which we combine into a pipeline:
1. Convert the value to an integer, if possible. Because _every value in `process.argv` is a string_, we must coerce if we want a number.
2. Use `ajv` to validate the integer against the schema for `port`. A schema lets us define a range via the `minimum` and `maximum` keywords. Read more about how this works in
Much like the config file validation, if errors are detected, Appium nicely tells the end-user and the process exits w/ some help text.
For other arguments which are naturally of non-primitive types, things are not so straightforward.
##### Transformers
Remember how `argparse` doesn't understand arrays? What if the most ergonomic way to express a value is, in fact, an array?
Well, Appium can't accept an array on the CLI, even though it can accept one in the config file. But Appium _can_ accept a comma-delimited string (a CSV "line"). Or a string filepath referring to a file which _contains_ a delimited list. Either way: by the time the value gets out of the argument parser, it should be an array.
And as mentioned above, the native facilities of a JSON schema cannot express this. However, it's possible to define a _custom keyword_ which Appium can then detect and handle accordingly. So that's what Appium does.
In this case, a custom keyword `appiumCliTransformer` is registered with `ajv`. The value of `appiumCliTransformer` (at the time of this writing) can be `csv` or `json`. In the base schema file, `appium-config-schema.js`, Appium uses `appiumCliTransformer: 'csv'` if this behavior is desired.
> Note: Any property defined in the schema having type `array` will _automatically_ uses the `csv` transformer. Likewise, a property having type `object` will use the `json` transformer. It's conceivable that `array` may want to use the `json` transformer, but otherwise, the presence of the `appiumCliTransformer` keyword on an `array`-or-`object`-typed property is not stricly necessary.
The adapter (remember the adapter?) creates a pipeline function including a special "CSV transformer" (transformers are defined in `lib/schema/cli-transformers.js`), and uses this function as the `type` property of the `ArgumentOption` passed into `argparse`. In this case, the `type: 'array'` in the schema is ignored.
> Note: the config file doesn't _need_ to perform any complex transformation of values, because it naturally allows Appium to define exactly what it expects. So Appium does no post-processing of config file values.
Properties that do not need this special treatment use `ajv` directly for validation. How this works requires some explanation, so that's next.
#### Validation of Individual Arguments via `ajv`
When we think of a JSON schema, we tend to think, "I have this JSON file and I want to validate it against the schema". That's valid, and in fact Appium does just that with config files! However, Appium does not do this when validating arguments.
> Note: During implementation, I was tempted to mash all of the arguments together into a config-file-like data structure and then validate it all at once. I think that would have been _possible_, but since an object full of CLI arguments is a flat key/value structure and the schema is not, this seemed like trouble.
Instead, Appium validates a value against a specific property _within_ the schema. To do this, it maintains a mapping between a CLI argument definition and its corresponding property. The mapping itself is a `Map` with a unique identifier for the argument as the key, and an `ArgSpec` (`lib/schema/arg-spec.js`) object as the value.
An `ArgSpec` object stores the following metadata:
| Property Name | Description |
| --------------- | ------------------------------------------------------------------------------------- |
| `name` | Canonical name of the argument, corresponding to the property name in the schema. |
| `extType?` | `driver` or `plugin`, if appropriate |
| `extName?` | Extension name, if appropriate |
| `ref` | Computed `$id` of the property in the schema |
| `arg` | Argument as accepted on CLI, without leading dashes |
| `dest` | Property name in parsed arguments object (as returned by `argparse`'s `parse_args()`) |
| `defaultValue?` | Value of the `default` keyword in schema, if appropriate |
When a schema is [finalized](#schema-finalization), the `Map` is populated with `ArgSpec` objects for all known arguments.
So when the adapter is creating the pipeline of functions for the argument's `type`, it already has an `ArgSpec` for the argument. It creates a function which calls `validate(value, ref)` (in `lib/schema/schema.js`) where `value` is whatever the user provided, and `ref` is the `ref` property of the `ArgSpec`. The concept is that `ajv` can validate using _any_ `ref` it knows about; each property in a schema can be referenced by this `ref` whether it's defined or not. To help visualize, if a schema is:
```json
{
"$id": "my-schema.json",
"type": "object",
"properties": {
"foo": {
"type": "number"
}
}
}
```
The `ref` of `foo` would be `my-schema.json#/properties/foo`. Assuming our `Ajv` instance knows about this `my-schema.json`, then we can call its `getSchema(ref)` method (which has a `schema` property, but is a misnomer nonetheless) to get a validation function; `validate(value, ref)` in `schema.js` calls this validation function.
> Note: The schema spec says a schema author can supply an explicit `$id` keyword to override this; it's unsupported by Appium at this time. If needed, extension authors must carefully use `$ref` without custom `$id`s. It's highly unlikely an extension would have a schema so complicated as to need this, however; Appium itself doesn't even use `$ref` to define its own properties!
Next, let's take a look at how Appium loads schemas. This actually happens _before_ any argument validation.
## Schema Loading
Let's ignore extensions for a moment, and start with the base schema.
When something first imports the `lib/schema/schema.js` module, an instance of an `AppiumSchema` is created. This is a singleton, and its methods are exported from the module (all of which are bound to the instance).
The constructor does very little; it instantiates an `Ajv` instance and configures it with Appium's [custom keywords](#custom-keyword-reference) and adds support for the `format` keyword via the [ajv-formats](https://npm.im/ajv-formats) module.
Otherwise, the `AppiumSchema` instance does not interact with the `Ajv` instance until its `finalize()` method (exported as `finalizeSchema()`) is called. When this method is called, we're saying "we are not going to add any more schemas; go ahead and create `ArgSpec` objects and register schemas with `ajv`".
When does finalization happen? Well:
1. When the `appium` executable begins, it _checks for and configures extensions_ (hand-wave) in `APPIUM_HOME`.
2. Only then does it start to think about arguments--it instantiates an `ArgParser`, which (as you'll recall) runs the adapter to convert the schema to arguments.
3. _Finalization happens here_--when creating the parser. Appium need the schema(s) to be registered with `ajv` in order to create validation functions for arguments.
4. Thereafter, Appium parses the arguments with the `ArgParser`.
5. Finally, decides what to do with the returned object.
Without extensions, `finalize()` still knows about the Appium base schema (`appium-config-schema.js`), and just registers that. However, step 1. above is doing a _lot of work_, so let's look at how extensions come into play.
## Extension Support
One of the design goals of this system is the following:
_An extension should be able to register custom CLI arguments with the Appium, and a user should be able to use them like any other argument_.
Previously, Appium 2.0 accepted arguments in this manner (via `--driverArgs`), but validation was hand-rolled and required extension implementors to use a custom API. It also required the user to awkwardly pass a JSON string as the configuration on the command-line. Further, no contextual help (via `--help`) existed for these arguments.
Now, by providing a schema for its options, a driver or plugin can register CLI arguments and config file schemas with Appium.
To register a schema, an extension must provide the `appium.schema` property in its `package.json`. The value may be a schema or a path to a schema. If the latter, the schema should be JSON or a CommonJS module (ESM not supported at this time, nor is YAML).
For any property in this schema, the property will appear as a CLI argument of the form `--<extension-type>-<extension-name>-<property-name>`. For example, if the `fake` driver provides a property `foo`, the argument will be `--driver-fake-foo`, and will show in `appium server --help` like any other CLI argument.
The corresponding property in a config file would be `server.<extension-type>.<extension-name>.<property-name>`, e.g.:
```json
{
"server": {
"driver": {
"fake": {
"foo": "bar"
}
}
}
}
```
The naming convention described above avoids problems of one extension type having a name conflict with a different extension type.
> Note: while an extension can provide aliases via `appiumCliAliases`, "short" flags are disallowed, since all arguments from extensions are prefixed with `--<extension-type>-<extension-name>-`. The extension name and argument name will be kebab-cased for the CLI, according to [Lodash's rules](https://lodash.com/docs/4.17.15#kebabCase) around kebab-casing.
The schema object will look much like Appium's base schema, but it will only have top-level properties (nested properties are currently unsupported). Example:
```json
{
"title": "my rad schema for the cowabunga driver",
"type": "object",
"properties": {
"fizz": {
"type": "string",
"default": "buzz",
"$comment": "corresponds to CLI --driver-cowabunga-fizz"
}
}
}
```
As written in a user's config file, this would be the `server.driver.cowabunga.fizz` property.
When extensions are loaded, the `schema` property is verified and the schema is registered with the `AppiumSchema` (it is _not_ registered with `Ajv` until `finalize()` is called).
During finalization, each registered schema is added to the `Ajv` instance. The schema is assigned an `$id` based on the extension type and name (which overrides whatever the extension provides, if anything). Schemas are also forced to disallowed unknown arguments via the `additionalProperties: false` keyword.
Behind the scenes, the base schema has `driver` and `plugin` properties which are objects. When finalized, a property is added to each--corresponding to an extension name--and the value of this property is a reference to the `$id` of a property in the extension schema. For example, the `server.driver` property will look like this:
```json
{
"driver": {
"cowabunga": {
"$ref": "driver-cowabunga.json"
}
}
}
```
This is why we call it the "base" schema--it is _mutated_ when extensions provide schemas. The extension schemas are kept separately, but the _references_ are added to the schema before it's ultimately added to `ajv`. This works because an `Ajv` instance understands references _from_ any schema it knows about _to_ any schema it knows about.
> Note: This makes it impossible to provide a complete static schema for Appium _and_ the installed extensions (as of Nov 5 2021). A static `.json` schema _is_ generated from the base (via a Gulp task), but it does not contain any extension schemas. The static schema also has uses beyond Appium; e.g., IDEs can provide contextual error-checking of config files this way. Let's solve this?
Just like how we look up the reference ID of a particular argument in the base schema, validation of arguments from extensions happens the exact same way. If the `cowabunga` driver has the schema ID `driver-cowabunga.json`, then the `fizz` property can be referenced from any schema registered with `ajv` via `driver-cowabunga.json#/properties/fizz`. "Base" schema arguments begin with `appium.json#properties/` instead.
## Development Environment Support
During the flow of development, a couple extra tasks have been automated to maintain the base schema:
- As a post-transpilation step, a `lib/appium-config.schema.json` gets generated from `lib/schema/appium-config-schema.js` (in addition to its CJS counterpart generated by Babel). This file is under version control. It ends up being _copied_ to `build/lib/appium-config.schema.json` in this step.
- A pre-commit hook (see `scripts/generate-schema-declarations.js` in the root monorepo) generates a `types/appium-config-schema.d.ts` from the above JSON file. The types in `types/types.d.ts` depend upon this file. This file is under version control.
## Custom Keyword Reference
Keywords are defined in `lib/schema/keywords.js`.
- `appiumCliAliases`: allows a schema to express aliases (e.g., a CLI argument can be `--verbose` or `-v`). This is an array of strings. Strings shorter than three (3) characters will begin with a single dash (`-`) instead of a double-dash (`--`). Note that any argument provided by an extension will begin with a double-dash, because these are required to have the `--<extension-type>-<extension-name>-` prefix.
- `appiumCliDest`: allows a schema to specify a custom property name in the post-`argprase` arguments objects. If not set, this becomes a camelCased string.
- `appiumCliDescription`: allows a schema to override the description of the argument when displayed on the command-line. This is useful paired with `appiumCliTransformer` (or `array`/`object`-typed properties), since there's a substantial difference between what a CLI-using user can provide vs. what a config-file-using user can provide.
- `appiumCliTransformer`: currently a choice between `csv` and `json`. These are custom functions which post-process a value. They are not used when loading & validating config files, but the idea should be that they result in the same object you'd get if you used whatever the config file wanted (e.g., an array of strings). `csv` is for comma-delimited strings and CSV files; `json` is for raw JSON strings and `.json` files.
- `appiumCliIgnore`: If `true`, do not support this property on the CLI.
- `appiumDeprecated`: If `true`, the property is considered "deprecated", and will be displayed as such to the user (e.g., in the `--help` output). Note the JSON Schema draft-2019-09 introduces a new keyword `deprecated` which we should use instead if upgrading to this metaschema. When doing so, `appiumDeprecated` should itself be marked as `deprecated`.
+8 -2
View File
@@ -1,6 +1,12 @@
## Selenium Grid
## Selenium Grid 4
You are able to register your appium server with a local [Selenium grid](https://github.com/SeleniumHQ/selenium/wiki/Grid2) ([setup docs](https://www.selenium.dev/documentation/en/grid/grid_3/setting_up_your_own_grid/)) by using the
`Relay` feature in Grid 4 allows you to proxy Appium requests to an appium server instance.
Please check [Relaying commands to a service endpoint that supports WebDriver](https://www.selenium.dev/documentation/grid/configuration/toml_options/#relaying-commands-to-a-service-endpoint-that-supports-webdriver) and [Selenium Grid 4 and Appium together in harmony](https://www.youtube.com/watch?v=3_aP2rsqZD0) about the configuration and for more details.
## Selenium Grid 3
You are able to register your appium server with a local [Selenium grid](https://github.com/SeleniumHQ/selenium/wiki/Grid2) ([setup docs](https://www.selenium.dev/documentation/legacy/grid_3/setting_up_your_own_grid/)) by using the
`--nodeconfig` server parameter.
```center
@@ -4,7 +4,7 @@ This document is a guide for those who are using Appium 1.x and wish to migrate
## Overview of Appium 2.0
Appium 2.0 is the most major new release of Appium in over 5 years. The changes in Appium 2.0 are *not* primarily related to changes in automation behaviors for specific platforms. Instead, Appium 2.0 reenvisions Appium as a *platform* where "drivers" (code projects that introduce support for automation of a given platform) and "plugins" (code projects that allow for overriding, altering, extending, or adding behaviors to Appium) can be easily created and shared.
Appium 2.0 is the most major new release of Appium in over 5 years. The changes in Appium 2.0 are _not_ primarily related to changes in automation behaviors for specific platforms. Instead, Appium 2.0 reenvisions Appium as a _platform_ where "drivers" (code projects that introduce support for automation of a given platform) and "plugins" (code projects that allow for overriding, altering, extending, or adding behaviors to Appium) can be easily created and shared.
At the same time, the Appium project is taking the opportunity to remove many old and deprecated bits of functionality.
@@ -14,7 +14,7 @@ Together these do introduce a few breaking changes to how Appium is installed, h
Have a look at the [Appium 2.0 release notes](https://github.com/appium/appium/releases/tag/v2.0.0-beta) for a more comprehensive list of changes. Here we call out the breaking changes and what you need to do do account for them.
#### :bangbang: Installing drivers during setup
### :bangbang: Installing drivers during setup
When you installed Appium 1.x, all available drivers would be installed at the same time as the main Appium server. This is no longer the case. Simply installing Appium 2.0 (e.g., by `npm install -g appium`), will install the Appium server only, but no drivers. To install drivers, you must instead use the new [Appium extension CLI](../drivers/driver-cli.md). For example, to install the latest versions of the XCUITest and UiAutomator2 drivers, after installing Appium you would run the following commands:
@@ -32,59 +32,63 @@ npm install -g appium --drivers=xcuitest,uiautomator2
This will install Appium and the two drivers for you in one go.
#### :bangbang: Driver-specific command line options
### :bangbang: Chromedriver installation flags
In Appium 1.x it was possible to customize the way Chromedriver was installed (as part of the UiAutomator2 driver for example), using the following command line flags:
* `--chromedriver-skip-install`
* `--chromedriver-version`
* `--chromedriver-cdnurl`
Because Appium 2.0 now installs drivers for you, and because these flags were implemented as NPM config flags, they will no longer work. Instead, use the following environment variables during driver installation:
* `APPIUM_SKIP_CHROMEDRIVER_INSTALL`
* `CHROMEDRIVER_VERSION`
* `CHROMEDRIVER_CDNURL`
For example:
```
APPIUM_SKIP_CHROMEDRIVER_INSTALL=1 appium driver install uiautomator2
```
### :bangbang: Driver-specific command line options
With Appium 1.x, command-line options specific to particular drivers were all hosted on the main Appium server. So, for example, `--chromedriver-executable` was a CLI parameter you could use with Appium to set the location of a specific Chromedriver version for use with, say, the UiAutomator2 driver.
With Appium 2.x, all driver- and platform-specific CLI params have been moved to the drivers themselves. To access them, we use a single CLI param called `--driver-args`, whose value is a JSON string or a path to a JSON file, which when parsed is an object of the following form:
With Appium 2.x, all driver- and platform-specific CLI params have been moved to the drivers themselves. To access them, you'll now need to prepend the argument with the extension type (either `driver` or `plugin`) and the name of the extension. For example, `--chromedriver-executable` becomes `--driver-uiautomator2-chromedriver-executable`.
```json
{
"<driver-name>": {
"<arg-name>": <arg-value>,
...
},
...
}
```
In other words, you can construct an object with parameters for one or more drivers by their name. The parameters which are available to use this way will be documented by the driver itself. So to see what has become of `--chromedriver-executable`, you can head to the UiAutomator2 driver documentation. In this case, we'd start Appium like this:
```
appium --driver-args='{"uiautomator2": {"chromedriverExecutable": "/path/to/chromedriver/binary"}}'
```
#### :bangbang: Driver updates
### :bangbang: Driver updates
In the past, to get updates to your iOS or Android drivers, you'd simply wait for those updates to be rolled into a new release of Appium, and then update your Appium version. With Appium 2.x, the Appium server and the Appium drivers are versioned and released separately. This means that drivers can be on their own release cadence and that you can get driver updates as they happen, rather than waiting for a new Appium server release. The way to check for driver updates is with the CLI:
```
```bash
appium driver list --updates
```
If any updates are available, you can then run the `update` command for any given driver:
```
```bash
appium driver update xcuitest
```
To update the Appium server itself, you do the same thing as in the past: `npm install -g appium`. Now, installing new versions of the Appium server will leave your drivers intact, so the whole process will be much more quick.
#### :bangbang: Protocol changes
### :bangbang: Protocol changes
Appium's API is based on the [W3C WebDriver Protocol](https://www.w3.org/TR/webdriver/), and it has supported this protocol for years. Before the W3C WebDriver Protocol was designed as a web standard, several other protocols were used for both Selenium and Appium. These protocols were the "JSONWP" (JSON Wire Protocol) and "MSJONWP" (Mobile JSON Wire Protocol). The W3C Protocol differs from the (M)JSONWP protocols in a few small ways.
Up until Appium 2.0, Appium supported both protocols, so that older Selenium/Appium clients could still communicate with newer Appium servers. Moving forward, support for older protocols will be removed.
:bangbang: *Capabilities*
### :bangbang: _Capabilities_
One significant difference between old and new protocols is in the format of capabilities. Previously called "desired capabilities", and now called simply "capabilities", there is now a requirement for a so-called "vendor prefix" on any non-standard capabilities. The list of standard capabilities is given in the [WebDriver Protocol spec](https://www.w3.org/TR/webdriver/#capabilities), and includes a few commonly used capabilities such as `browserName` and `platformName`.
These standard capabilities continue to be used as-is. All other capabilities must include a "vendor prefix" in their name. A vendor prefix is a string followed by a colon, such as `appium:`. Most of Appium's capabilities go beyond the standard W3C capabilities and must therefore include vendor prefixes (we recommend that you use `appium:` unless directed otherwise by documentation). For example:
* `appium:app`
* `appium:noReset`
* `appium:deviceName`
- `appium:app`
- `appium:noReset`
- `appium:deviceName`
This requirement may or may not be a breaking change for your test suites when targeting Appium 2.0. If you're using an updated Appium client, the client will add the `appium:` prefix for you on all necessary capabilities. New versions of the Appium Inspector tool will also do this. Cloud-based Appium providers may also do this. So simply be aware that if you get any messages to the effect that your capabilities lack a vendor prefix, this is how you solve that problem.
@@ -94,50 +98,65 @@ To make everyone's lives a bit easier, we've also introduced the option of wrapp
```json
{
"platformName": "iOS",
"browserName": "Safari",
"appium:options": {
"platformVersion": "14.4",
"deviceName": "iPhone 11",
"automationName": "XCUITest"
}
"platformName": "iOS",
"browserName": "Safari",
"appium:options": {
"platformVersion": "14.4",
"deviceName": "iPhone 11",
"automationName": "XCUITest"
}
}
```
(Of course, each client will have a different way of creating structured capabilities like `appium:options` or other ones that you might have seen such as `goog:chromeOptions`). NB: capabilities that show up in `appium:options` will overwrite capabilities of the same name that show up at the top level of the object.
:bangbang: *Removed Commands*
### :bangbang: _Removed Commands_
Commands which were a part of the old JSON Wire Protocol and not a part of the W3C Protocol are no longer available:
* TODO (these commands are being identified and removed and will be updated here when complete)
- TODO (these commands are being identified and removed and will be updated here when complete)
If you use a modern Appium or Selenium client, you should no longer have access to these anyway, so any breaking changes should appear on the client side first and foremost.
#### :bangbang: Image analysis features moved to plugin
### :bangbang: Image analysis features moved to plugin
One of the design goals for Appium 2.0 is to migrate non-core features into special extensions called [plugins](#TODO). This allows people to opt into features which require extra time to download or extra system setup. The various image-related features of Appium (image comparison, finding elements by image, etc...) have been moved into an officially supported plugin called [images](https://github.com/appium/appium-plugins/tree/master/packages/images).
If you use these image-related methods, to continue accessing them you will need to do two things.
1. Install the plugin: `appium plugin install images`
2. Ensure you start the Appium server with access to run the plugin by including it in the list of plugins designated on the command line, e.g., `appium --plugins=images`
2. Ensure you start the Appium server with access to run the plugin by including it in the list of plugins designated on the command line, e.g., `appium --use-plugins=images`
Image-related commands will also be removed on the client side of things, which means you will need to follow the instructions on the plugin README for installing client-side plugins to access these features.
#### :bangbang: Old drivers removed
### :bangbang: Execute Driver Script command moved to plugin
If you use the advanced Execute Driver Script feature (which allows you to send in a WebdriverIO script to have it executed completely on the server instead of command-by-command from the client), this functionality has been moved to a plugin. Here's what to do to keep using it:
1. Install the plugin: `appium plugin install execute-driver`
2. Ensure you start the Appium server with access to run the plugin by including it in the list of plugins designated on the command line, e.g., `appium --use-plugins=execute-driver`
### :bangbang: External Files No Longer Supported for `--nodeconfig`, `--allow-insecure` and `--deny-insecure`
These options can be provided as strings on the command line (a JSON string for `--nodeconfig` and a comma-separated list of strings for `--allow-insecure` and `--deny-insecure`). Arguments provided on the command line will likely need to be quoted or escaped.
The recommended method to provide these options is now via a [configuration file](#tada-configuration-files). Please see [JSON](https://github.com/appium/appium/blob/2.0/sample-code/appium.config.sample.json), [YAML](https://github.com/appium/appium/blob/2.0/sample-code/appium.config.sample.yaml), and [JS](https://github.com/appium/appium/blob/2.0/sample-code/appium.config.sample.js) for example config files.
In summary, if you are using a JSON Appium config file, you can simply cut-and-paste the contents of your "nodeconfig" JSON file into the value of the `server.nodeconfig` property. Any CSV-like files you had previously provided for `--allow-insecure` and `--deny-insecure` become the values of the `server.allow-insecure` and `server.deny-insecure` properties in the Appium config files (respectively); both are arrays of strings.
### :bangbang: Old drivers removed
The old iOS and Android (UiAutomator 1) drivers and related tools (e.g., `authorize-ios`) have been removed. They haven't been relevant for many years anyway.
#### :warning: Internal packages renamed
### :warning: Internal packages renamed
Some Appium-internal NPM packages have been renamed (for example, `appium-base-driver` is now `@appium/base-driver`). This is not a breaking change for Appium users, only for people who have built software that directly incorporates Appium's code.
#### :warning: "WD" JavaScript client library no longer supported
### :warning: "WD" JavaScript client library no longer supported
For many years, some of Appium's authors maintained the [WD](https://github.com/admc/wd) client library. This library has been deprecated and has not been updated for use with the W3C WebDriver protocol. As such, if you're using this library you'll need to move to a more modern one. We recommend [WebdriverIO](https://webdriver.io).
#### :warning: Appium Inspector split out from Appium Desktop
### :warning: Appium Inspector split out from Appium Desktop
The inspecting portion of Appium Desktop has been moved to its own app, Appium Inspector: [github.com/appium/appium-inspector](https://github.com/appium/appium-inspector). It's fully compatible with Appium 2.0 servers. Simply download it and run it on its own. You no longer need the GUI Appium Desktop server to inspect apps. The Appium Desktop server will continue to be supported at its original site: [github.com/appium/appium-desktop](https://github.com/appium/appium-desktop). It will simply no longer bundle the Inspector with it.
@@ -147,24 +166,140 @@ You can also now use the Appium Inspector without downloading anything, by visit
Apart from the breaking changes mentioned above, in this section is a list of some of the major new features you may wish to take advantage of with Appium 2.0.
#### Plugins
### Plugins
:tada: *Server Plugins*
#### :tada: _Server Plugins_
TODO
:tada: *Client Plugins*
#### :tada: _Client Plugins_
TODO
#### :tada: Install drivers and plugins from anywhere
### :tada: Install drivers and plugins from anywhere
TODO
#### :tada: Driver and Plugin CLI args
### :tada: Configuration Files
Appium now supports _configuration files_ in addition to command-line arguments. In a nutshell, nearly all arguments which Appium 1.x required to be provided on the CLI are now able to be expressed via a configuration file. Configuration files may be in JSON, JS, or YAML format.
Please note that CLI arguments have _precedence_ over configuration files; if a value is set in a config file _and_ via CLI argument, the CLI argument is preferred.
#### Supported Config File Locations
Configuration files can be named anything, but the following filenames will be automatically discovered and loaded by Appium:
- `.appiumrc.json`
- `.appiumrc.yaml`
- `.appiumrc.yml`
- `.appiumrc.js`
- `.appiumrc.cjs`
- `appium.config.js`
- `appium.config.cjs`
- `.appiumrc` (which is considered to be JSON)
Further, the `appium` property in your project's `package.json` can contain the configuration.
Appium will search _up_ the directory tree from the current working directory for one of these files. If it reaches the current user's home directory or filesystem root, it will stop looking.
To specify a custom location for your config file (and avoid searching), use `appium --config-file /path/to/config/file`.
> Note: Configuration files in ESM format are not currently supported.
#### Configuration File Format
You might want to see examples:
- [Appium Configuration - JSON](../../../sample-code/appium.config.sample.json)
- [Appium Configuration - YAML](../../../sample-code/appium.config.sample.yaml)
- [Appium Configuration - JS](../../../sample-code/appium.config.sample.js)
Description of the format is available, as well:
- [Appium Configuration File JSON Schema](../../../packages/appium/lib/appium-config.schema.json)
- [TypeScript declarations for Appium Configuration](../../../packages/appium/types/appium-config.d.ts)
To describe in words, the config file will have a root `server` property, and all arguments are child properties. For certain properties which must be supplied as comma-delimited lists, JSON strings, and/or external filepaths, these instead will be of their "native" type. For example, `--use-plugins <value>` needs `<value>` to be comma-delimited string or path to a delimited file. However, the config file just wants an array, e.g.,:
```json
{
"server": {
"use-plugins": ["my-plugin", "some-other-plugin"]
}
}
```
For `driver`-and-`plugin`-specific configuration, these live under the `server.driver` and `server.plugin` properties, respectively. Each driver or plugin will have its own named property, and the values of any specific configuration it provides are under this. For example:
```json
{
"server": {
"driver": {
"xcuitest": {
"webkit-debug-proxy-port": 5400
}
}
}
}
```
> Note: The above configuration corresponds to the `--driver-xcuitest-webkid-debug-proxy-port` CLI argument.
All properties are case-sensitive and will be in kebab-case. For example, `callback-port` is allowed, but `callbackPort` is not.
### :tada: Driver and Plugin CLI args
TODO
#### For Extension Authors
To define CLI arguments (or configuration properties), your extension must provide a _schema_. In the `appium` property of your extension's `package.json`, add a `schema` property. This will either a) be a schema itself, or b) be a path to a schema.
The rules for these schemas:
- Schemas must conform to [JSON Schema Draft-07](https://ajv.js.org/json-schema.html#draft-07).
- Schemas must be in JSON or JS (CommonJS) format.
- Custom `$id` values are unsupported. To use `$ref`, provide a value relative to the schema root, e.g., `/properties/foo`.
- Known values of the `format` keyword are likely supported, but various other keywords may be unsupported. If you find a keyword that is unsupported which you need to use, please [ask for support](https://github.com/appium/appium/issues/new) or send a PR!
- The schema must be of type `object` (`{"type": "object"}`), containing the arguments in a `properties` keyword. Nested properties are unsupported.
Example:
```json
{
"type": "object",
"properties": {
"test-web-server-port": {
"type": "integer",
"minimum": 1,
"maximum": 65535,
"description": "The port to use for the test web server"
},
"test-web-server-host": {
"type": "string",
"description": "The host to use for the test web server",
"default": "sillyhost"
}
}
}
```
The above schema defines two properties which can be set via CLI argument or configuration file. If this extension is a _driver_ and its name is "horace", the CLI args would be `--driver-horace-test-web-server-port` and `--driver-horace-test-web-server-host`, respectively. Alternatively, a user could provide a configuration file containing:
```json
{
"server": {
"driver": {
"horace": {
"test-web-server-port": 1234,
"test-web-server-host": "localhorse"
}
}
}
}
```
## Special Notes for Cloud Providers
The rest of this document has applied to Appium generally, but some of the architectural changes in Appium 2.0 will constitute breaking changes for Appium-related service providers, whether a cloud-based Appium host or an internal service. At the end of the day, the maintainer of the Appium server is responsible for installing and making available the various Appium drivers and plugins that end users may wish to use.
@@ -175,12 +310,12 @@ With Appium 2.0, we enter a new era where end users may wish to target various i
In addition to the standard `platformName`, `appium:deviceName`, `appium:automationName`, and `appium:platformVersion`, we recommend adopting the capability `$cloud:appiumOptions`, where the label `$cloud` is not meant to be interpreted literally but instead should be replaced by your vendor prefix (so for HeadSpin it would be `headspin`, Sauce Labs it would be `sauce`, and BrowserStack it would be `browserstack`, to name just a few examples). The `$cloud:appiumOptions` capability would itself be a JSON object, with the following internal keys:
|Capability|Used for|Example|
|----------|-------|-------|
|`version`|Designating which version of the Appium server is used to host and manage drivers. If ommitted, behavior left up to the provider, but the recommendation would be to provide the latest official version.|`2.0.0`|
|`automationVersion`|Designating which version of the specified driver should be used.|`1.55.2`|
|`automation`|Designating a custom driver to use (see below for more info). This would override `appium:automationName` and `$cloud:automationVersion`|`{"name": "org/custom-driver", "source": "github", "package": "custom-driver"}`|
|`plugins`|Designating the list of plugins (and potentially versions of plugins) to be activated (see below for more info).|`["images", "universal-xml"]`|
| Capability | Used for | Example |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `version` | Designating which version of the Appium server is used to host and manage drivers. If ommitted, behavior left up to the provider, but the recommendation would be to provide the latest official version. | `2.0.0` |
| `automationVersion` | Designating which version of the specified driver should be used. | `1.55.2` |
| `automation` | Designating a custom driver to use (see below for more info). This would override `appium:automationName` and `$cloud:automationVersion` | `{"name": "org/custom-driver", "source": "github", "package": "custom-driver"}` |
| `plugins` | Designating the list of plugins (and potentially versions of plugins) to be activated (see below for more info). | `["images", "universal-xml"]` |
### Basic example
@@ -188,16 +323,16 @@ Appium extensions (drivers and plugins) have a set of properties that specify wh
```json
{
"platformName": "iOS",
"appium:platformVersion": "14.4",
"appium:deviceName": "iPhone 11",
"appium:app": "Some-App.app.zip",
"appium:automationName": "XCUITest",
"$cloud:appiumOptions": {
"appiumVersion": "2.0.0",
"automationVersion": "3.52.0",
"plugins": ["images"],
}
"platformName": "iOS",
"appium:platformVersion": "14.4",
"appium:deviceName": "iPhone 11",
"appium:app": "Some-App.app.zip",
"appium:automationName": "XCUITest",
"$cloud:appiumOptions": {
"appiumVersion": "2.0.0",
"automationVersion": "3.52.0",
"plugins": ["images"]
}
}
```
@@ -209,18 +344,18 @@ The previous example still looks a bit disorganized, so of course we also recomm
```json
{
"platformName": "iOS",
"appium:options": {
"platformVersion": "14.4",
"deviceName": "iPhone 11",
"app": "Some-App.app.zip",
"automationName": "XCUITest",
},
"$cloud:appiumOptions": {
"appiumVersion": "2.0.0",
"automationVersion": "3.52.0",
"plugins": ["images"],
}
"platformName": "iOS",
"appium:options": {
"platformVersion": "14.4",
"deviceName": "iPhone 11",
"app": "Some-App.app.zip",
"automationName": "XCUITest"
},
"$cloud:appiumOptions": {
"appiumVersion": "2.0.0",
"automationVersion": "3.52.0",
"plugins": ["images"]
}
}
```
@@ -228,10 +363,10 @@ The previous example still looks a bit disorganized, so of course we also recomm
Some service providers may wish to dynamically allow access to all of the features of the Appium 2.0 CLI, including downloading arbitrary drivers and plugins. To represent these extensions, we can define special JSON "extension objects", with the following keys:
* `name`: the name of the extension. This would be an NPM package name (if downloading from NPM), or a git or GitHub spec (if downloading from a git server or GitHub).
* `version`: the version of the extension, e.g., the NPM package version or Git SHA.
* (optional) `source`: a denotation of where the extension can be downloaded from. Recommended to support the following values: `appium`, `npm`, `git`, `github`. Here, `appium` means "Appium's own official list", and should be the default value if this key is not included.
* (optional) `package`: when downloading extensions from git or github, the NPM package name of the extension must also be provided. This is optional for non-git sources.
- `name`: the name of the extension. This would be an NPM package name (if downloading from NPM), or a git or GitHub spec (if downloading from a git server or GitHub).
- `version`: the version of the extension, e.g., the NPM package version or Git SHA.
- (optional) `source`: a denotation of where the extension can be downloaded from. Recommended to support the following values: `appium`, `npm`, `git`, `github`. Here, `appium` means "Appium's own official list", and should be the default value if this key is not included.
- (optional) `package`: when downloading extensions from git or github, the NPM package name of the extension must also be provided. This is optional for non-git sources.
Since each session is handled by a single driver, the `$cloud:appiumOptions`/`$automation` capability could be used with an extension object value to denote this driver, for example:
@@ -10,6 +10,7 @@ The important capabilities:
- `chromedriverPort` the chromedriver port (if using webviews or chrome)
- `mjpegServerPort` If you are using [appium-uiautomator2-driver](https://github.com/appium/appium-uiautomator2-driver), set a unique MJPEG server port for each parallel session. Otherwise you might get a port conflict such as in [this issue](https://github.com/appium/appium/issues/7745).
- `systemPort` If you are using [appium-uiautomator2-driver](https://github.com/appium/appium-uiautomator2-driver), set a unique system port for each parallel session. Otherwise you might get a port conflict such as in [this issue](https://github.com/appium/appium/issues/7745).
- `chromedriverPort` If you are using [appium-chromedriver](https://github.com/appium/appium-chromedriver), set a unique ChromeDriver port for each parallel session. Otherwise, you might get a port conflict with the error message `Address already in use (48)` in the ChromeDriver log.
### Parallel iOS Tests
+5 -56
View File
@@ -1,6 +1,6 @@
## Settings
Settings are a new concept introduced by appium. They are currently not a part of the Mobile JSON Wire Protocol, or the Webdriver spec.
Settings are a new concept introduced by Appium. They are currently not a part of the Mobile JSON Wire Protocol, or the Webdriver spec.
Settings are a way to specify the behavior of the appium server.
@@ -48,64 +48,13 @@ Settings are implemented via the following API endpoints:
[Image Elements](https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/image-elements.md) also has image elements specific settings.
### Android Only
### UiAutomator2
|Name|Description|Values|
|----|----|----|
| `ignoreUnimportantViews` | Controls whether the Android device should use `setCompressedLayoutHeirarchy()` which ignores all views which are marked IMPORTANT_FOR_ACCESSIBILITY_NO or IMPORTANT_FOR_ACCESSIBILITY_AUTO (and have been deemed not important by the system), in an attempt to make things less confusing or faster. Defaults to `false`. | `false` or `true` |
Please refer to the documentation on the [UiAutomator2 Driver repository](https://github.com/appium/appium-uiautomator2-driver#settings-api)
#### UiAutomator2
|Name|Description|Values|
|----|----|----|
| `actionAcknowledgmentTimeout` | Same as: [setActionAcknowledgmentTimeout](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html#setActionAcknowledgmentTimeout(long)). If a negative value is given, it would set to default (3 * 1000 milliseconds). Handled by [UiAutomator Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html) in Android API 18 and above. | e.g., `5000` |
| `allowInvisibleElements` | Controls whether the Android device should show all elements, visible and invisible. Defaults to `false`. | `false` or `true` |
| `enableMultiWindows` | If enabled then the page source and xpath lookup will include all windows available to the accessibility rather than the active one only. It might help to resolve finding elements on windows like `android.widget.PopupWindow`. Defaults to `false` and returns an active root window. Read [appium-uiautomator2-server#301](https://github.com/appium/appium-uiautomator2-server/pull/301) for more details. | `true` or `false` |
| `enableNotificationListener` | Controls whether the Android device should enable or disable the `NotificationListener`. Defaults to `true`. | `false` or `true` |
| `keyInjectionDelay` | Same as: [setKeyInjectionDelay](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html#setKeyInjectionDelay(long)). If a negative value is given, it would set to default (0 milliseconds). Handled by [UiAutomator Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html) in Android API 18 and above. | e.g., `5000` |
| `mjpegBilinearFiltering` | Controls whether or not to apply bilinear filtering to source screenshot resize algorithm. Enabling this flag may improve the quality of the resulting scaled bitmap, but will introduce a [small] performance hit. Defaults to `false`. | `false` or `true` |
| `mjpegScalingFactor` | Controls the scaling factor of streamed screenshots. 100 means no scaling is applied (e.g. 100% of the original size). The bigger image size is the more CPU performance is needed to encode it. Integer values between `1` and `100` are available. Defaults to `50`. | `1` to `100` |
| `mjpegServerFramerate` | Controls the framerate of streamed screenshots. Greater framerate values create greater CPU load. That actual maximum framerate value is limited by the performance of the device under test. Integer values between `1` and `60` are available. Defaults to `10`. | `1` to `60` |
| `mjpegServerPort` | Controls the MJPEG server port. Integer values between `1024` and `65535` are available. Defaults to `7810`. | `1024` to `65535` |
| `mjpegServerScreenshotQuality` | Controls the quality of streamed screenshots. Where the best quality is 100 and the worst is 1. The greater the value is the more CPU time is needed to encode a single bitmap into JPEG format. Usually a value between 25 and 90 is fine for this setting. Greater values affect performance too much without visible quality improvements and lower ones introduce visible distortions into the resulting image. Integer values between `1` and `100` are available. Defaults to `50`. | `1` to `100` |
| `normalizeTagNames` | Translate all class names used as XML tags to the limited set of ASCII characters supported by Apache Harmony library. Used by default in Android to avoid possible XML parsing exceptions caused by XPath lookup. The translation is based on [junidecode](https://github.com/gcardone/junidecode). This prevents [this error case](https://github.com/appium/appium/issues/11854). Defaults to `false`. | `false` or `true` |
| `scrollAcknowledgmentTimeout` | Same as: [setScrollAcknowledgmentTimeout](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html#setScrollAcknowledgmentTimeout(long)). If a negative value is given, it would set to default (200 milliseconds). Handled by [UiAutomator Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html) in Android API 18 and above. | e.g. `300` |
| `serverPort` | Controls the server port. Integer values between `1024` and `65535` are available. Defaults to `6790`. | `1024` to `65535` |
| `shutdownOnPowerDisconnect` | Shutdown the server through the broadcast receiver on [ACTION_POWER_DISCONNECTED](https://developer.android.com/reference/android/content/Intent.html#ACTION_POWER_DISCONNECTED). Defaults to `true`. | `false` or `true` |
| `simpleBoundsCalculation` | If enabled then the `bounds` attribute will be calculated using a less accurate but simpler method that may improve performance. First available in Appium 1.18.0. Defaults to `false`. | `false` or `true` |
| `trackScrollEvents` | Controls the tracking of scroll events as they happen. If `true`, a field, `lastScrollData`, is added to the results of `getSession`, which can then be used to check on scroll progress. Turning this feature off significantly increases touch action performance. Defaults to `true`. | `false` or `true` |
| `waitForIdleTimeout` | Same as: [setWaitForIdleTimeout](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html#setWaitForIdleTimeout(long)). If a negative value is given, it would set to default (10 * 1000 milliseconds). Handled by [UiAutomator Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html) in Android API 18 and above. | e.g. `10000` |
| `waitForSelectorTimeout` | Same as: [setWaitForSelectorTimeout](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html#setWaitForSelectorTimeout(long)). If a negative value is given, it would set to default (10 * 1000 milliseconds). Handled by [UiAutomator Configurator](https://developer.android.com/reference/android/support/test/uiautomator/Configurator.html) in Android API 18 and above. | e.g. `10000` |
| `wakeLockTimeout` | Controls the timeout of the acquired wake lock. The lock is acquired on server startup and is held until the UIAutomator2 server is killed or the timeout expires. Setting this value to zero or a negative number will release the lock immediately if it is held. Defaults to '24 * 60 * 60 * 1000' milliseconds. | e.g. `0`, `60000` (1 min) |
|`useResourcesForOrientationDetection`| Whether to use application resource properties to figure out the current device orientation. By default the orientation value is based on the current rotation, which might be incorrect for some particular device types (usually tablets). `false` by default. Available since Appium 1.20.0 | e.g. `true` |
### iOS Only
#### XCUITest
|Name|Description|Values|Appium versions|
|----|----|----|----|
|`nativeWebTap`| Enable "real", non-javascript-based web taps in Safari. Default: `false`. Warning: depending on viewport size/ratio; this might not accurately tap an element. | `true`, `false` |1.7.0+|
|`mjpegServerScreenshotQuality`| The quality of the screenshots generated by the screenshots broadcaster, expressed as a value from `0` to `100`. The value `0` represents the maximum compression (or lowest quality) while the value `100` represents the least compression (or best quality). The default value is `25`. | e.g., `10` |1.10.0+|
|`mjpegServerFramerate`| The framerate at which the background screenshots broadcaster should broadcast screenshots in range `1..60`. The default value is `10` (Frames Per Second). Setting zero value will cause the framerate to be at its maximum possible value. | e.g., `60` |1.10.0+|
|`screenshotQuality`| Changes the quality of phone display screenshots following [xctest/xctimagequality](https://developer.apple.com/documentation/xctest/xctimagequality?language=objc). Default value is `1`. Read `screenshotQuality` in [appium-xcuitest-driver](https://github.com/appium/appium-xcuitest-driver#desired-capabilities) | e.g. `0`, `1`, `2` |1.10.0+|
|`mjpegScalingFactor`| Changes the scale of screenshots. Defaults to `100`, no scaling. Integer between `1` and `100` are available. | e.g. `1`, `50`, `100` |1.12.0+|
|`keyboardAutocorrection`| Changes the 'Auto-Correction' preference in _Keyboards_ setting. Defaults to `false` when WDA starts as xctest. | `true`, `false` |1.14.0+|
|`keyboardPrediction`| Changes the 'Predictive' preference in _Keyboards_ setting. Defaults to `false` when WDA starts as xctest. | `true`, `false` |1.14.0+|
|`customSnapshotTimeout` (`snapshotTimeout` before 1.20.0) | Set how much time is allowed to resolve a single accessibility snapshot with custom attributes. _Snapshots_ are mainly used for page source generation, XML lookup and custom attributes retrieval (these are visibility and accessibility ones). It might be necessary to increase this value if the actual page source is very large and contains hundreds of UI elements. Defaults to 15 seconds. Since Appium 1.20.0 if this timeout expires and no custom snapshot could be made then WDA tries to calculate the missing attributes using its own algorithms, so setting this value to zero might speed up, for example, page source retrieval, but for the cost of some element attribute preciseness. | e.g. `10`, `100` (seconds) |1.15.0+|
|`waitForIdleTimeout`|The amount of time in float seconds to wait until the application under test is idling. XCTest requires the app's main thread to be idling in order to execute any actions on it, so each action, like single click, might take a lot of time in case your app is constantly hogging the main thread. The default value is `10` (seconds). Setting it to zero disables idling checks completely (not recommended).|e.g. `2.5`|1.20.0+|
|`animationCoolOffTimeout`|The amount of time in float seconds to wait until the application under test does not have any active animations. This check is usually applied after each automation action that is supposed to change the state of the application under test, like `click` one, and blocks XCTest until the transition of the tested application to a new state completes or the cool off timeout occurs. The default value is `2` (seconds). Setting it to zero disables animation checks completely.|e.g. `1.5`, `0`|1.20.0+|
|`snapshotMaxDepth`| Changes the value of maximum depth for traversing elements source tree. It may help to prevent out of memory or timeout errors while getting the elements source tree, but it might restrict the depth of source tree. Please consider restricting this value if you observed an error like _Timed out snapshotting com.apple.testmanagerd..._ message or _Cannot get 'xml' source of the current application_ in your Appium log since they are possibly timeout related. A part of elements source tree might be lost if the value was too small. Defaults to `50` | e.g. `100` | 1.17.0+ |
|`useFirstMatch` | Enabling this setting makes single element lookups faster, but there is the known [problem](https://github.com/appium/appium/issues/10101) related to nested elements lookup. Defaults to `false`. |`true`, `false` |1.15.0+|
|`reduceMotion`| Changes the 'reduce motion' preference of accessibility feature. | `true`, `false` |1.15.0+|
|`defaultActiveApplication`| Sets the hint for active application selection. This helps WebDriverAgent to select the current application if there are multiple items in the active applications list and the desired one is also one of them. The setting is particularly useful for split-screen apps automation. Defaults to `auto`, which makes WebDriverAgent to select the application whose element is located at `screenPoint` location or a single item from the active apps list if the length of this list is equal to one. | e.g., `com.apple.Preferences` |1.15.0+|
|`activeAppDetectionPoint`| Defines the coordinates of the current screen point. WebDriverAgent uses this point to detect the active application if multiple application are active on the screen. The format of this value is `x,y`, where x and y are float or integer numbers representing valid screen coordinates. Setting this value to a point outside the actual screen coordinates might corrupt WebDriverAgent functionality. By default the screen point coordinates equal to 20% of the minimum screen dimension each, e.g. `MIN(w, h) * 0.2, MIN(w, h) * 0.2` | e.g. `100,300` |1.15.0+|
| `includeNonModalElements` | Whether returns all of elements including no modal dialogs on iOS 13+. It fixes [cannot find elements on nested modal presentations](https://github.com/appium/appium/issues/13227), but it might make visibility attributes unreliable. You could also enable `shouldUseTestManagerForVisibilityDetection` setting (defaults to `false`) or `simpleIsVisibleCheck` capability to improve the visibility detection. This issue may happen between iOS 13.0 to 13.2 (and Xcode 11.0 to 11.2). The query issued in `includeNonModalElements` returns `nil` with newer iOS/Xcode versions and Appium/WDA return proper elements three without this setting being used. Defaults to `false`. | `true`, `false` |1.15.0+|
| `acceptAlertButtonSelector` | Allows to customize accept alert button selector. It helps you to handle an arbitrary element as accept button in `accept alert` command. The selector should be a valid [class chain](https://github.com/facebookarchive/WebDriverAgent/wiki/Class-Chain-Queries-Construction-Rules) expression, where the search root is the alert element itself. The default button location algorithm is used if the provided selector is wrong or does not match any element. | e.g., <code>**/XCUIElementTypeButton[\`label CONTAINS[c] 'accept'\`]</code> | 1.16.0+ |
| `dismissAlertButtonSelector` | Allows to customize dismiss alert button selector. It helps you to handle an arbitrary element as dismiss button in `dismiss alert` command. The selector should be a valid [class chain](https://github.com/facebookarchive/WebDriverAgent/wiki/Class-Chain-Queries-Construction-Rules) expression, where the search root is the alert element itself. The default button location algorithm is used if the provided selector is wrong or does not match any element. | e.g., <code>**/XCUIElementTypeButton[\`label CONTAINS[c] 'dismiss'\`]</code> | 1.16.0+ |
| `screenshotOrientation` | Adjust screenshot orientation for iOS. Appium tries to return a screenshot and adjust its orientation properly using internal heuristics, but sometimes it does not work, especially in landscape mode. The actual screenshot orientation depends on various factors such as OS versions, model versions and whether this is a real or simulator device. This option allows you to enforce the given image orientation. Defaults to `auto`.| `auto`, `portrait`, `portraitUpsideDown`, `landscapeRight`, `landscapeLeft` | 1.17.0+ |
| `boundElementsByIndex` | Whether to look up elements with [`allElementsBoundByAccessibilityElement`](https://developer.apple.com/documentation/xctest/xcuielementquery/1500816-allelementsboundbyaccessibilitye) (default) or [`allElementsBoundByIndex`](https://developer.apple.com/documentation/xctest/xcuielementquery/1500945-allelementsboundbyindex). [This Stack Overflow topic](https://stackoverflow.com/questions/49307513/meaning-of-allelementsboundbyaccessibilityelement) explains the differences. Defaults to `false` | `true`, `false` | 1.18.0+ |
### XCUITest
Please refer to the documentation on the [XCUITest Driver repository](https://github.com/appium/appium-xcuitest-driver#settings-api)
### Mac2
@@ -55,15 +55,13 @@ so you'll see the icon of WebDriverAgentRunner application on the springboard.
WebDriverAgent application acts as a REST server, which proxies external API requests to native XCTest calls
for your application under test. The server address will be _localhost_ if you run your tests on Simulator
or the actual phone IP address in case of real device.
We use [appium-ios-device](https://github.com/appium/appium-ios-device) to route network requests
or the actual phone IP address in case of real device. Appium uses [appium-ios-device](https://github.com/appium/appium-ios-device) to route network requests
to a real device from _localhost_ via USB, which means one can use this tool to unify WDA network
address for Simulator and for real device.
You can use [appium-ios-device](https://github.com/appium/appium-ios-device) to connect to
a remote device requiring the module from your JavaScript code as same as Appium.
Alternatively, you can also use _iproxy_ to handle WebDriverAgent outside Appium.
It is available via `node install -g iproxy`.
Alternatively, you can also use [iproxy](https://github.com/libimobiledevice/libusbmuxd#iproxy), [go-ios](https://github.com/danielpaulus/go-ios) or [tidevice](https://github.com/alibaba/taobao-iphone-device) to handle WebDriverAgent process outside Appium. For instance, `iproxy` could be installed using npm: `npm install -g iproxy`.
This helper class written in Java illustrates the main implementation details
wit _iproxy_:
-7
View File
@@ -38,12 +38,6 @@ context = current_context
context = @driver.current_context
```
```php
# PHP
$context = $driver->context();
```
```csharp
// C#
string Context = driver.Context;
@@ -89,7 +83,6 @@ For information on contexts, see Appium's [hybrid automation docs](/docs/en/writ
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/doc/api.md) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#current_context-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/context/get-context.yml)
+1 -8
View File
@@ -37,12 +37,6 @@ context = @driver.available_contexts
```
```php
# PHP
$contexts = $driver->contexts();
```
```csharp
// C#
List<string> AllContexts = new List<string>();
@@ -57,7 +51,7 @@ List<string> AllContexts = new List<string>();
## Description
Retrieve all the contexts available to be automated. This will include, at least, the native context. There can also be zero or more web view contexts. For information on the format of the context names, see the [get context documentation](/docs/en/commands/context/get-context.md).
[mobile command](/docs/en/commands/mobile-command.md) `mobile: getContexts` is available on iOS (XCUITest) and Android (UIAutomator2 and Espresso) to get more detailed contexts.
[mobile command](/docs/en/commands/mobile-command.md) `mobile: getContexts` is available on iOS (XCUITest) and Android (UIAutomator2 and Espresso) to get more detailed contexts.
For information on contexts, see Appium's [hybrid automation docs](/docs/en/writing-running-appium/web/hybrid.md).
@@ -88,7 +82,6 @@ For information on contexts, see Appium's [hybrid automation docs](/docs/en/writ
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/doc/api.md) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#available_contexts-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/context/get-contexts.yml)
-10
View File
@@ -55,15 +55,6 @@ webview = @driver.available_contexts[1]
```
```php
# PHP
$contexts = $driver->contexts();
$driver->context($contexts[1]);
// ...
$driver->context('NATIVE_APP');
```
```csharp
// C#
// Switch to specific webview
@@ -118,7 +109,6 @@ For information on contexts, see Appium's [hybrid automation docs](/docs/en/writ
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/doc/api.md) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#set_context-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/context/set-context.yml)
@@ -37,12 +37,6 @@ current_activity
```
```php
# PHP
$activity = $driver->currentActivity();
```
```csharp
// C#
string activity = driver.CurrentActivity;
@@ -77,7 +71,6 @@ string activity = driver.CurrentActivity;
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2519) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#current_activity-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/Android/AndroidDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/activity/current-activity.yml)
@@ -108,4 +101,4 @@ Name of the current [activity](https://developer.android.com/reference/android/a
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/activity/current-activity.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L429)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L440)
@@ -37,12 +37,6 @@ current_package
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
string package = driver.CurrentPackage;
@@ -77,7 +71,6 @@ string package = driver.CurrentPackage;
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| None | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2526) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#current_package-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/Android/AndroidDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/activity/current-package.yml)
@@ -108,4 +101,4 @@ Name of the current [package](https://developer.android.com/reference/java/lang/
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/activity/current-package.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L432)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L443)
@@ -40,13 +40,6 @@ start_activity app_package: "com.example", app_activity: "ActivityName"
```
```php
# PHP
$driver->startActivity(array('appPackage' => 'com.example',
'appActivity' => 'ActivityName'));
```
```csharp
// C#
driver.StartActivity("com.example", "ActivityName");
@@ -81,7 +74,6 @@ driver.StartActivity("com.example", "ActivityName");
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2948) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Android/Device#start_activity-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/Android/AndroidDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/activity/start-activity.yml)
@@ -121,4 +113,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/activity/start-activity.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L525)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L536)
+1 -8
View File
@@ -42,12 +42,6 @@ activate_app('io.appium.android.apis')
```
```php
# PHP
// Supports only `mobile: queryAppState` for iOS, XCUITest
```
```csharp
// C#
driver.activateApp('com.apple.Preferences');
@@ -88,7 +82,6 @@ iOS tests with XCUITest can also use the `mobile: activateApp` method. See detai
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#activate_app-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/activate-app.yml)
@@ -121,4 +114,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/activate-app.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L445)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L456)
+2 -9
View File
@@ -42,12 +42,6 @@ query_app_state('io.appium.android.apis') # `query_` prefix is also available
```
```php
# PHP
// Supports only `mobile: queryAppState` for iOS, XCUITest
```
```csharp
// C#
// Supports only `mobile: queryAppState` for iOS, XCUITest
@@ -87,7 +81,6 @@ iOS tests with XCUITest can also use the `mobile: queryAppState` method. See det
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Base/Driver#app_state-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/app-state.yml)
@@ -96,7 +89,7 @@ iOS tests with XCUITest can also use the `mobile: queryAppState` method. See det
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/app-state.yml)
### Endpoint
`GET /session/:session_id/appium/device/app_state`
`POST /session/:session_id/appium/device/app_state`
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/app-state.yml)
### URL Parameters
@@ -120,4 +113,4 @@ Current the target app status. (Clients wrap the response properly) `0` is not i
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/app-state.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L480)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L491)
@@ -37,12 +37,6 @@ background_app(10)
```
```php
# PHP
$driver->backgroundApp(10);
```
```csharp
// C#
driver.BackgroundApp(10)
@@ -94,7 +88,6 @@ iOS tests with XCUITest can also use the `mobile: terminateApp` method to termin
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2841) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#background_app-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/background-app.yml)
@@ -127,4 +120,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/background-app.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L556)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L567)
+1 -8
View File
@@ -37,12 +37,6 @@ close_app
```
```php
# PHP
$driver->closeApp();
```
```csharp
// C#
driver.CloseApp();
@@ -77,7 +71,6 @@ driver.CloseApp();
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2798) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#close_app-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/close-app.yml)
@@ -108,4 +101,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/close-app.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L550)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L561)
@@ -37,12 +37,6 @@ end_coverage("Intent", "/path")
```
```php
# PHP
$driver->endTestCoverage('Intent', '/path');
```
```csharp
// C#
driver.EndTestCoverage("Intent", "/path");
@@ -77,7 +71,6 @@ driver.EndTestCoverage("Intent", "/path");
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2858) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| None | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Android/Device#end_coverage-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/Android/AndroidDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/end-test-coverage.yml)
@@ -111,4 +104,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/end-test-coverage.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L559)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L570)
@@ -37,12 +37,6 @@ app_strings("en")
```
```php
# PHP
$strings = $driver->appStrings();
```
```csharp
// C#
Dictionary<string, object> appStrings = driver.GetAppStringDictionary("end", "/path/to/file");
@@ -77,7 +71,6 @@ Dictionary<string, object> appStrings = driver.GetAppStringDictionary("end", "/p
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2916) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#app_strings-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/get-app-strings.yml)
@@ -111,4 +104,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/get-app-strings.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L562)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L573)
+1 -8
View File
@@ -37,12 +37,6 @@ install_app('/Users/johndoe/path/to/app.apk')
```
```php
# PHP
$driver->installApp('/Users/johndoe/path/to/app.apk');
```
```csharp
// C#
driver.InstallApp("/Users/johndoe/path/to/app.apk")
@@ -82,7 +76,6 @@ iOS tests with XCUITest can also use the `mobile: installApp` method. See detail
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2540) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#install_app-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/install-app.yml)
@@ -115,4 +108,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/install-app.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L436)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L447)
@@ -37,12 +37,6 @@ app_installed?('com.example.AppName')
```
```php
# PHP
$driver->isAppInstalled('com.example.AppName')
```
```csharp
// C#
driver.IsAppInstalled("com.example.AppName");
@@ -82,7 +76,6 @@ iOS tests with XCUITest can also use the `mobile: isAppInstalled` method. See de
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2586) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#app_installed%3F-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/is-app-installed.yml)
@@ -115,4 +108,4 @@ Return true if installed, false if not (`boolean`)
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/is-app-installed.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L472)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L483)
+1 -8
View File
@@ -37,12 +37,6 @@ launch_app
```
```php
# PHP
$driver->launchApp();
```
```csharp
// C#
driver.LaunchApp();
@@ -83,7 +77,6 @@ iOS tests with XCUITest can also use the `mobile: launchApp` method. See detaile
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2798) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#launch_app-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/launch-app.yml)
@@ -114,4 +107,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/launch-app.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L547)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L558)
+1 -8
View File
@@ -37,12 +37,6 @@ remove_app('com.example.AppName')
```
```php
# PHP
$driver->removeApp('com.example.AppName');
```
```csharp
// C#
driver.RemoveApp("com.example.AppName");
@@ -82,7 +76,6 @@ iOS tests with XCUITest can also use the `mobile: removeApp` method. See detaile
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2563) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#remove_app-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/remove-app.yml)
@@ -116,4 +109,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/remove-app.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L454)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L465)
+1 -8
View File
@@ -37,12 +37,6 @@ reset
```
```php
# PHP
$driver->reset();
```
```csharp
// C#
driver.ResetApp();
@@ -77,7 +71,6 @@ driver.ResetApp();
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2827) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#reset-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/reset-app.yml)
@@ -108,4 +101,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/reset-app.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L553)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L564)
+1 -8
View File
@@ -42,12 +42,6 @@ terminate_app('io.appium.android.apis')
```
```php
# PHP
// Supports only `mobile: queryAppState` for iOS, XCUITest
```
```csharp
// C#
// Supports only `mobile: queryAppState` for iOS, XCUITest
@@ -87,7 +81,6 @@ iOS tests with XCUITest can also use the `mobile: terminateApp` method. See deta
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Base/Driver#terminate_app-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/terminate-app.yml)
@@ -121,4 +114,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/app/terminate-app.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L463)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L474)
@@ -37,12 +37,6 @@ finger_print 1
```
```php
# PHP
// PHP Code here
```
```csharp
// C#
// CSharp Code here
@@ -85,7 +79,6 @@ Touch ID by iOS is [here](http://appium.io/docs/en/commands/device/simulator/tou
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/appium/appium-android-driver/blob/d16c7161d92ab6f6c9cec3f22218219ac3659716/lib/commands/actions.js#L260) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Android/Device#finger_print-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/authentication/finger-print.yml)
@@ -118,4 +111,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/authentication/finger-print.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L388)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L399)
@@ -39,12 +39,6 @@ get_clipboard
```
```php
# PHP
// PHP Code here
```
```csharp
// C#
// CSharp Code here
@@ -56,13 +50,9 @@ get_clipboard
Get the content of the system clipboard
(For iOS real devices) Apple security preferences require the WebDriverAgentRunner application to be in [foreground](https://github.com/appium/WebDriverAgent/issues/330) in order to be able to receive the system clipboard content. Otherwise an empty string is always returned. Consider using [Activate App](/docs/en/commands/device/app/activate-app.md) and [Background App](/docs/en/commands/device/app/background-app.md) to change the foreground application.
Activate App command cannot launch the WebDriverAgent properly on some environments. It depends on XCTest framework by Apple. Then, you should launch the WebDriverAgent using its Springboard's application icon. Follow the example below.
(For iOS 13+ real devices) Apple security preferences require the WebDriverAgentRunner application to be in [foreground](https://github.com/appium/WebDriverAgent/issues/330) in order to be able to receive the system clipboard content. Otherwise an empty string is always returned. Consider using [Activate App](/docs/en/commands/device/app/activate-app.md) and [Background App](/docs/en/commands/device/app/background-app.md) to change the foreground application. Activate App command cannot launch the WebDriverAgent properly on some environments. It depends on XCTest framework by Apple. Then, you should launch the WebDriverAgent using its Springboard's application icon. Follow the example below.
1. Open Springboard, `@driver.activate_app 'com.apple.springboard'`. 2. Find the WDA icon with `@driver.find_element :accessibility_id, 'WebDriverAgentRunner-Runner'` (It should be visible on the screen) and click it. 3. Call the get clipboard API. 4. Open the application under test with the [Activate App](/docs/en/commands/device/app/activate-app.md).
1. Open springboard, `@driver.activate_app 'com.apple.springboard'`.
2. Find the WDA icon with `@driver.find_element :accessibility_id, 'WebDriverAgentRunner-Runner'` (It should be visible on the screen) and click it.
3. Call the get clipboard API.
4. Open the application under test with the [Activate App](/docs/en/commands/device/app/activate-app.md).
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/get-clipboard.yml)
## Support
@@ -91,7 +81,6 @@ Activate App command cannot launch the WebDriverAgent properly on some environme
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/releases) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [Android](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Android/Device#get_clipboard-instance_method) [iOS](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Ios/Device#get_clipboard-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/releases/latest) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/get-clipboard.yml)
@@ -40,12 +40,6 @@ set_clipboard content: 'happy testing'
```
```php
# PHP
// PHP Code here
```
```csharp
// C#
// CSharp Code here
@@ -56,7 +50,8 @@ set_clipboard content: 'happy testing'
## Description
Set the content of the system clipboard
(For iOS 15+ real devices) Apple security preferences require the WebDriverAgentRunner application to be in [foreground](https://github.com/appium/appium/issues/16526) in order to set the system clipboard content. Consider using [Activate App](/docs/en/commands/device/app/activate-app.md) and [Background App](/docs/en/commands/device/app/background-app.md) to change the foreground application. Activate App command cannot launch the WebDriverAgent properly on some environments. It depends on XCTest framework by Apple. Then, you should launch the WebDriverAgent using its Springboard's application icon. Follow the example below.
1. Open Springboard, `@driver.activate_app 'com.apple.springboard'`. 2. Find the WDA icon with `@driver.find_element :accessibility_id, 'WebDriverAgentRunner-Runner'` (It should be visible on the screen) and click it. 3. Call the get clipboard API. 4. Open the application under test with the [Activate App](/docs/en/commands/device/app/activate-app.md).
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
## Support
@@ -85,7 +80,6 @@ Set the content of the system clipboard
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/releases) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [iOS](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Ios/Device#set_clipboard-instance_method) [Android](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Android/Device#set_clipboard-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/releases/latest) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
+1 -6
View File
@@ -35,10 +35,6 @@ set_power_ac :on
```
```php
// Not supported
```
```csharp
// Not supported
```
@@ -77,7 +73,6 @@ To set the state of the battery charger to connected or not.
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| None | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| None | |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Android/Device/Emulator#set_power_ac-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml)
@@ -110,4 +105,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L415)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L426)
@@ -35,10 +35,6 @@ set_power_capacity 50
```
```php
// Not supported
```
```csharp
// Not supported
```
@@ -77,7 +73,6 @@ To set the battery percentage.
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| None | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| None | |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Android/Device/Emulator#set_power_capacity-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_capacity.yml)
@@ -110,4 +105,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_capacity.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L412)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L423)
+1 -8
View File
@@ -37,12 +37,6 @@ pull_file('/data/local/tmp/file.txt')
```
```php
# PHP
$data = $driver->pullFile('data/local/tmp/file.txt');
```
```csharp
// C#
byte[] fileBase64 = driver.PullFile("/path/to/device/foo.bar");
@@ -77,7 +71,6 @@ byte[] fileBase64 = driver.PullFile("/path/to/device/foo.bar");
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2665) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#pull_file-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/pull-file.yml)
@@ -110,4 +103,4 @@ Contents of file in base64 (`string`)
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/pull-file.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L504)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L515)
+1 -8
View File
@@ -37,12 +37,6 @@ pull_folder('/data/local/tmp/file.txt')
```
```php
# PHP
$folderBase64 = $driver->pullFolder($path);
```
```csharp
// C#
byte[] folder = driver.PullFolder("/path/to/device");
@@ -77,7 +71,6 @@ byte[] folder = driver.PullFolder("/path/to/device");
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2688) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#pull_folder-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/pull-folder.yml)
@@ -110,4 +103,4 @@ A string of Base64 encoded data, representing a zip archive of the contents of t
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/pull-folder.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L507)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L518)
+2 -9
View File
@@ -22,7 +22,7 @@ self.driver.push_file(dest_path, base64.b64encode(data).decode('utf-8'))
```javascript
// Javascript
// webdriver.io example
let data = new Buffer("Hello World").toString('base64');
let data = Buffer.from("Hello World").toString('base64');
driver.pushFile('/data/local/tmp/file.txt', data);
// wd example
@@ -40,12 +40,6 @@ push_file('/data/local/tmp/foo.bar', File.read('path/to/file.png'))
```
```php
# PHP
$driver->pushFile('/data/local/tmp/foo.bar', 'QXJlIHlvdXIgYmVlcnMgb2theT8=');
```
```csharp
// C#
driver.PushFile("/data/local/tmp/foo.bar", new FileInfo("/Users/johndoe/files/foo.bar"))
@@ -80,7 +74,6 @@ driver.PushFile("/data/local/tmp/foo.bar", new FileInfo("/Users/johndoe/files/fo
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2640) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#push_file-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/push-file.yml)
@@ -114,4 +107,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/push-file.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L501)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L512)
@@ -37,12 +37,6 @@ device_locked?
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
bool isLocked = driver.IsLocked(); // Supported by IOSDriver & AndroidDriver
@@ -77,7 +71,6 @@ bool isLocked = driver.IsLocked(); // Supported by IOSDriver & AndroidDriver
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2407) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#device_locked%3F-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/Android/AndroidDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml)
@@ -108,4 +101,4 @@ True if the device is locked, false if not (`boolean`)
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L367)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L378)
+1 -8
View File
@@ -39,12 +39,6 @@ lock(5) # lock 5 seconds
```
```php
# PHP
$driver->lock(5);
```
```csharp
// C#
driver.Lock(); // Supported by IOSDriver & AndroidDriver
@@ -79,7 +73,6 @@ driver.Lock(); // Supported by IOSDriver & AndroidDriver
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2363) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#lock-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/Android/AndroidDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/lock.yml)
@@ -112,4 +105,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/lock.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L361)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L372)
@@ -30,12 +30,6 @@ driver.rotateDevice({x: 114, y: 198, duration: 5, radius: 3, rotation: 220, touc
# Not supported
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
driver.Rotate(new Dictionary<string, int> { { "x", 114 }, { "y", 198 }, { "duration", 5 }, { "radius", 3 }, { "rotation", 220 }, { "touchCount", 2 } });
@@ -70,7 +64,6 @@ driver.Rotate(new Dictionary<string, int> { { "x", 114 }, { "y", 198 }, { "durat
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2470) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/rotate.yml)
@@ -108,4 +101,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/rotate.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L424)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L435)
@@ -37,12 +37,6 @@ shake
```
```php
# PHP
$driver->shake();
```
```csharp
// C#
driver.ShakeDevice();
@@ -77,7 +71,6 @@ driver.ShakeDevice();
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2342) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#shake-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/iOS/IOSDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/shake.yml)
@@ -108,4 +101,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/shake.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L354)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L365)
@@ -41,12 +41,6 @@ unlock
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
driver.Unlock(); // Supported by IOSDriver & AndroidDriver
@@ -81,7 +75,6 @@ driver.Unlock(); // Supported by IOSDriver & AndroidDriver
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2386) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#unlock-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/Android/AndroidDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/unlock.yml)
@@ -112,4 +105,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/unlock.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L364)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L375)
+1 -11
View File
@@ -37,15 +37,6 @@ hide_keyboard
```
```php
# PHP
$driver->hideKeyboard();
$driver->hideKeyboard(array(
'keyName' => 'Done'
));
```
```csharp
// C#
driver.HideKeyboard();
@@ -80,7 +71,6 @@ driver.HideKeyboard();
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2723) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#hide_keyboard-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/keys/hide-keyboard.yml)
@@ -116,4 +106,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/keys/hide-keyboard.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L495)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L506)
@@ -37,10 +37,6 @@ is_keyboard_shown
```
```php
// Not supported
```
```csharp
// Not supported
```
@@ -73,7 +69,6 @@ is_keyboard_shown
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| None | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2638) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#is_keyboard_shown-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/keys/is-keyboard-shown.yml)
@@ -104,4 +99,4 @@ True if the keyboard is shown. (`boolean`)
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/keys/is-keyboard-shown.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L498)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L509)
@@ -37,12 +37,6 @@ long_press_keycode(10)
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
driver.LongPressKeyCode(WindowsKeyCode.Back);
@@ -81,7 +75,6 @@ See https://developer.android.com/reference/android/view/KeyEvent.html# for refe
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2478) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#long_press_keycode-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/Windows/WindowsDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/keys/long-press-keycode.yml)
@@ -116,4 +109,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/keys/long-press-keycode.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L385)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L396)
@@ -37,12 +37,6 @@ press_keycode(10)
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
driver.PressKeyCode(WindowsKeyCode.Windows);
@@ -81,7 +75,6 @@ See https://developer.android.com/reference/android/view/KeyEvent.html for refer
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2457) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#press_keycode-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/Windows/WindowsDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/keys/press-keycode.yml)
@@ -116,4 +109,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/keys/press-keycode.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L382)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L393)
+1 -8
View File
@@ -37,12 +37,6 @@ gsm_call(phone_number: '5551234567', action: :call)
```
```php
# PHP
// TODO
```
```csharp
// C#
// TODO
@@ -77,7 +71,6 @@ gsm_call(phone_number: '5551234567', action: :call)
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3183) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Android/Device/Emulator#gsm_call-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/gsm-call.yml)
@@ -111,4 +104,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/gsm-call.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L394)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L405)
@@ -37,12 +37,6 @@ gsm_signal :good
```
```php
# PHP
// TODO
```
```csharp
// C#
// TODO
@@ -77,7 +71,6 @@ gsm_signal :good
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3221) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Android/Device/Emulator#gsm_signal-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/gsm-signal.yml)
@@ -110,4 +103,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/gsm-signal.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L397)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L408)
+1 -8
View File
@@ -37,12 +37,6 @@ gsm_voice :home
```
```php
# PHP
// TODO
```
```csharp
// C#
// TODO
@@ -77,7 +71,6 @@ gsm_voice :home
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3241) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Android/Device/Emulator#gsm_voice-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/gsm-voice.yml)
@@ -110,4 +103,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/gsm-voice.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L409)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L420)
@@ -37,10 +37,6 @@ set_network_speed :lte
```
```php
// Not supported
```
```csharp
// Not supported
```
@@ -73,7 +69,6 @@ set_network_speed :lte
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3411) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Android/Device/Emulator#set_network_speed-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/network-speed.yml)
@@ -106,4 +101,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/network-speed.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L418)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L429)
+1 -8
View File
@@ -37,12 +37,6 @@ send_sms(phone_number: '555-123-4567', message: 'Hey lol')
```
```php
# PHP
// TODO
```
```csharp
// C#
// TODO
@@ -77,7 +71,6 @@ send_sms(phone_number: '555-123-4567', message: 'Hey lol')
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3183) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Android/Device/Emulator#send_sms-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/send-sms.yml)
@@ -111,4 +104,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/send-sms.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L391)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L402)
@@ -35,12 +35,6 @@ toggle_flight_mode
```
```php
# PHP
// TODO
```
```csharp
// C#
// TODO
@@ -75,7 +69,6 @@ toggle_flight_mode
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2712) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#toggle_flight_mode-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-airplane-mode.yml)
@@ -106,4 +99,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-airplane-mode.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L510)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L521)
@@ -35,12 +35,6 @@ toggle_data
```
```php
# PHP
// TODO
```
```csharp
// C#
// TODO
@@ -83,7 +77,6 @@ because it requires system or carrier privileged permission, and Android <= 21 d
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2771) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Device#toggle_data-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-data.yml)
@@ -114,4 +107,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-data.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L513)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L524)
@@ -37,12 +37,6 @@ toggle_location_services
```
```php
# PHP
// TODO
```
```csharp
// C#
// TODO
@@ -77,7 +71,6 @@ toggle_location_services
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2758) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Device#toggle_location_services-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-location-services.yml)
@@ -108,4 +101,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-location-services.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L519)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L530)
@@ -37,12 +37,6 @@ toggle_wifi
```
```php
# PHP
// TODO
```
```csharp
// C#
// TODO
@@ -83,7 +77,6 @@ Since Android Q, a method to change the WiFi service state has been restricted.
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2738) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Device#toggle_wifi-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-wifi.yml)
@@ -114,4 +107,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/network/toggle-wifi.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L516)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L527)
@@ -37,12 +37,6 @@ get_performance_data package_name: 'io.appium.android.apis', data_type: 'cpuinfo
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
// Not supported
@@ -77,7 +71,6 @@ get_performance_data package_name: 'io.appium.android.apis', data_type: 'cpuinfo
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3412) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Android/Device#get_performance_data-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/performance-data/get-performance-data.yml)
@@ -112,4 +105,4 @@ The information type of the system state which is supported to read as like cpu,
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/performance-data/get-performance-data.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L379)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L390)
@@ -37,12 +37,6 @@ get_performance_data_types
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
// Not supported
@@ -77,7 +71,6 @@ get_performance_data_types
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3398) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Android/Device#get_performance_data_types-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/performance-data/performance-data-types.yml)
@@ -108,4 +101,4 @@ The available performance data types (cpuinfo|batteryinfo|networkinfo|memoryinfo
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/performance-data/performance-data-types.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L376)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L387)
@@ -23,9 +23,7 @@ self.driver.start_recording_screen()
// webdriver.io example
driver.startRecordingScreen();
// wd example
await driver.startRecordingScreen();
// Not supported
```
```ruby
@@ -42,12 +40,6 @@ start_recording_screen video_type: 'h264', time_limit: '260' # iOS
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
driver.StartRecordingScreen(
@@ -84,9 +76,8 @@ driver.StartRecordingScreen(
|[Java](https://github.com/appium/java-client/releases/latest)| All | [static.javadoc.io](https://static.javadoc.io/io.appium/java-client/6.1.0/io/appium/java_client/screenrecording/CanRecordScreen.html#startRecordingScreen-T-) |
|[Python](https://github.com/appium/python-client/releases/latest)| All | [appium.github.io](https://appium.github.io/python-client-sphinx/webdriver.extensions.html#webdriver.extensions.screen_record.ScreenRecord.start_recording_screen) |
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3412) |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [Android](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Android/Device#start_recording_screen-instance_method) [iOS](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Ios/Xcuitest/Device#start_recording_screen-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/recording-screen/start-recording-screen.yml)
@@ -116,7 +107,7 @@ driver.StartRecordingScreen(
| options.method | `string` | The http multipart upload method name. The 'PUT' one is used by default. |
| options.forceRestart | `boolean` | Whether to try to catch and upload/return the currently running screen recording (`false`, the default setting on server) or ignore the result of it and start a new recording immediately (`true`). |
| options.timeLimit | `string` | Recording time. 180 seconds is by default. |
| options.videoType | `string` | (iOS Only) The format of the screen capture to be recorded. Available formats are the output of `ffmpeg -codecs` such as `libx264` and `mpeg4`. Defaults to `mpeg4`. |
| options.videoType | `string` | (iOS Only) The format of the screen capture to be recorded. Available formats are the output of `ffmpeg -codecs` such as `libx264` and `mpeg4`. Defaults to `mjpeg`. |
| options.videoQuality | `string` | (iOS Only) The video encoding quality (low, medium, high, photo - defaults to medium). |
| options.videoFps | `string` | (iOS Only) The Frames Per Second rate of the recorded video. Change this value if the resulting video is too slow or too fast. Defaults to 10. This can decrease the resulting file size. |
| options.videoScale | `string` | (iOS Only) The scaling value to apply. Read https://trac.ffmpeg.org/wiki/Scaling for possible values. Example value of 720p scaling is '1280:720'. This can decrease/increase the resulting file size. No scale is applied by default. |
@@ -132,4 +123,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/recording-screen/start-recording-screen.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L370)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L381)
@@ -40,12 +40,6 @@ stop_recording_screen remote_path: 'https://example.com', user: 'example', pass:
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
driver.StopRecordingScreen();
@@ -80,7 +74,6 @@ driver.StopRecordingScreen();
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3398) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#stop_recording_screen-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/recording-screen/stop-recording-screen.yml)
@@ -114,4 +107,4 @@ Base64 encoded string. If remote_path is set, the response is empty string. (`st
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/recording-screen/stop-recording-screen.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L373)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L384)
@@ -37,12 +37,6 @@ toggle_touch_id_enrollment
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
// TODO C# sample
@@ -55,6 +49,8 @@ toggle_touch_id_enrollment
To enable this feature, the `allowTouchIdEnroll` desired capability must be set to true. When `allowTouchIdEnroll` is set to true
the Simulator will be enrolled by default, and the 'Toggle Touch ID Enrollment' changes the enrollment state.
Another way to enable touch id is by using `mobile: enrollBiometric`. More info [here](https://github.com/appium/appium-xcuitest-driver#mobile-enrollbiometric).
This call will only work if the Appium process or its parent application (e.g., Terminal.app or Appium.app) has access to Mac OS accessibility in System Preferences > Security & Privacy > Privacy > Accessibility list
@@ -85,7 +81,6 @@ This call will only work if the Appium process or its parent application (e.g.,
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3150) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Ios/Device#toggle_touch_id_enrollment-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/simulator/toggle-touch-id-enrollment.yml)
@@ -118,4 +113,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/simulator/toggle-touch-id-enrollment.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L544)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L555)
@@ -43,12 +43,6 @@ touch_id(true)
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
driver.PerformTouchID(false); // Simulates a failed touch
@@ -97,7 +91,6 @@ Finger Print by Android is [here](http://appium.io/docs/en/commands/device/authe
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3133) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Ios/Device#touch_id-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/iOS/IOSDriver.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/simulator/touch-id.yml)
@@ -130,5 +123,5 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/simulator/touch-id.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L541)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L552)
* [Appium Docs](https://github.com/appium/appium-xcuitest-driver/blob/master/docs/touch-id.md)
@@ -35,10 +35,6 @@ get_device_density
```
```php
// Not supported
```
```csharp
// Not supported
```
@@ -71,7 +67,6 @@ get_device_density
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| None | |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Android/Device#get_display_density-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/display-density.yml)
@@ -102,4 +97,4 @@ The device density(dpi) of the Android device (`number`)
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/display-density.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L538)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L549)
@@ -37,12 +37,6 @@ open_notifications();
```
```php
# PHP
$driver->openNotifications();
```
```csharp
// C#
// TODO
@@ -77,7 +71,6 @@ $driver->openNotifications();
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3004) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#open_notifications-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/open-notifications.yml)
@@ -108,4 +101,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/open-notifications.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L522)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L533)
@@ -35,12 +35,6 @@ get_system_bars
```
```php
# PHP
// TODO
```
```csharp
// C#
// TODO
@@ -75,7 +69,6 @@ get_system_bars
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| None | |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#get_system_bars-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-bars.yml)
@@ -106,4 +99,4 @@ Information about visibility and bounds of status and navigation bar (`array<obj
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-bars.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L535)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L546)
@@ -40,12 +40,6 @@ device_time
```
```php
# PHP
$time = $driver->getDeviceTime();
```
```csharp
// C#
string result = driver.DeviceTime;
@@ -80,7 +74,6 @@ string result = driver.DeviceTime;
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L3119) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#device_time-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
@@ -111,4 +104,4 @@ Time on the device (`string`)
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/system/system-time.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L357)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L368)
@@ -39,12 +39,6 @@ find_element(:accessibility_id, "SomeAccessibilityID").clear
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
var element = driver.FindElementByAccessibilityId("SomeAccessibilityID");
@@ -80,7 +74,6 @@ element.Clear();
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1780) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element:clear) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/SeleniumHQ/selenium/blob/master/dotnet/src/webdriver/Remote/RemoteWebElement.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/actions/clear.yml)
@@ -40,12 +40,6 @@ find_element(:accessibility_id, 'SomeId').click
```
```php
# PHP
$driver->byAccessibilityId('SomeId')->click();
```
```csharp
// C#
MobileElement el = driver.FindElement(MobileByAccessibilityID("Some ID");
@@ -91,7 +85,6 @@ Not all drivers automatically scroll the element into view and may need to be sc
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1672) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element#click-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/actions/click.yml)
@@ -39,13 +39,6 @@ find_element(:accessibility_id, "SomeAccessibilityID").send_keys("Hello World!")
```
```php
# PHP
$el = $this->byAccessibilityId('SomeAccessibilityID');
$el->setText('Hello world!');
```
```csharp
// C#
MobileElement el = driver.FindElement(MobileByAccessibilityID("Some ID");
@@ -91,7 +84,6 @@ Any UTF-8 character may be specified, however, if the server does not support na
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1700) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element#send_keys-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/actions/send-keys.yml)
@@ -39,13 +39,6 @@ find_element(:accessibility_id, 'SomeAccessibilityID').attribute("content-desc")
```
```php
# PHP
$el = $this->byAccessibilityId('SomeAccessibilityID');
$name = $el->attribute('name');
```
```csharp
// C#
var element = driver.FindElementByAccessibilityId("SomeAccessibilityID");
@@ -81,7 +74,6 @@ string tagName = element.GetAttribute("content-desc");
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1350) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FElement:attribute) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumWebElement.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/attribute.yml)
@@ -39,12 +39,6 @@ find_element(:id, 'SomeId').css_value
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
var element = driver.FindElementById("SomeId");
@@ -87,7 +81,6 @@ This command only applies to webview contexts
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1447) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element:css_value) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumWebElement.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/css-property.yml)
@@ -39,13 +39,6 @@ find_element(:accessibility_id, "SomeAccessibilityID").displayed?
```
```php
# PHP
$el = $this->byAccessibilityId('SomeAccessibilityID');
$isDisplayed = $el->displayed();
```
```csharp
// C#
var element = driver.FindElementByAccessibilityId("SomeAccessibilityID");
@@ -81,7 +74,6 @@ bool isDisplayed = element.Displayed;
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1370) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium%2FWebDriver%2FElement:displayed%3F) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumWebElement.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/displayed.yml)
@@ -39,12 +39,6 @@ find_element(:accessibility_id, "SomeAccessibilityID").enabled?
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
var element = driver.FindElementByAccessibilityId("SomeAccessibilityID");
@@ -80,7 +74,6 @@ bool isEnabled = element.Enabled;
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1386) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element#enabled%3F-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumWebElement.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/enabled.yml)
@@ -33,10 +33,6 @@ let location = await element.getLocationInView();
# Not supported
```
```php
// Not supported
```
```csharp
// Not supported
```
@@ -69,7 +65,6 @@ let location = await element.getLocationInView();
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2189) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location-in-view.yml)
@@ -39,13 +39,6 @@ find_element(:accessibility_id, 'SomeAccessibilityID').location
```
```php
# PHP
$el = $this->byAccessibilityId('SomeAccessibilityID');
$location = $el->location();
```
```csharp
// C#
var element = driver.FindElementByAccessibilityId("SomeAccessibilityID");
@@ -85,7 +78,6 @@ The point (0, 0) refers to the upper-left corner of the page. The element's coor
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2175) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element:location) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumWebElement.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/location.yml)
@@ -39,12 +39,6 @@ find_element(:accessibility_id, 'SomeAccessibilityID').tag_name
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
var element = driver.FindElementByAccessibilityId("SomeAccessibilityID");
@@ -80,7 +74,6 @@ string tagName = element.TagName;
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1336) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element#tag_name-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumWebElement.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/name.yml)
@@ -35,12 +35,6 @@ driver.getPageIndex()
# Not supported
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
// TODO C# sample
@@ -75,7 +69,6 @@ driver.getPageIndex()
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1336) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element#tag_name-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/page-index.yml)
@@ -107,4 +100,4 @@ The tag name of the element (`string`)
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/page-index.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L338)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L349)
@@ -43,12 +43,6 @@ element.rect
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
var element = driver.FindElementByAccessibilityId("SomeAccessibilityID");
@@ -84,7 +78,6 @@ Rectangle rect = element.Rect;
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element#rect-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumWebElement.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/rect.yml)
@@ -40,12 +40,6 @@ element = @driver.find_element :accessibility_id, "SomeAccessibilityID"
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
// TODO C# sample
@@ -85,7 +79,6 @@ Replace the value to element directly.
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1832) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#replace_value-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/replace-value.yml)
@@ -120,4 +113,4 @@ null
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/replace-value.yml)
## See Also
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L576)
* [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L587)
@@ -39,12 +39,6 @@ find_element(:accessibility_id, "SomeAccessibilityID").selected?
```
```php
# PHP
// TODO PHP sample
```
```csharp
// C#
var element = driver.FindElementByAccessibilityId("SomeAccessibilityID");
@@ -80,7 +74,6 @@ bool isSelected = element.Selected;
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L1402) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Element#selected%3F-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/AppiumWebElement.cs) |
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/element/attributes/selected.yml)

Some files were not shown because too many files have changed in this diff Show More