Commit Graph

59 Commits

Author SHA1 Message Date
Kazuaki Matsuo 419661013b chore(appium): returns this.caps for /session/:sessionId/appium/capabilities (#20979)
* return the same value of getSession

* chore: update docs and implementation

* remove event stuff

* add type in return

* add AppiumSessionCapabilities type

* update the syntax

* rename

* add test in e2e

* remove unnecessary type

* use fake driver name
2025-02-14 08:08:42 -08:00
Kazuaki Matsuo 848f2b2396 chore(appium): handle getAppiumSessions as non session id commands (#20981) 2025-02-11 23:16:56 -08:00
Kazuaki Matsuo eeb59cab07 feat: add /appium/sessions, /session/:sessionId/appium/capabilities and deprecated marks will be removed in the future (#20936)
* feat: add /appium/sessions, /session/:sessionId/appium/capabilities and deprecated marks will be removed in the future

* add a dymmy implementation

* move entire deprecated endpoints in bottom of each section

* define GET_APPIUM_SESSION_CAPABILITIES and add it to isAppiumDriverCommand

* adds _COMMAND

* remove unnecessary method definition

* move deprecated endpoints

* add temporary implementation
2025-01-28 10:14:51 -08:00
Mykola Mokhnach a6b6077ecd feat: Add /appium/extensions API to list available extensions (#20931) 2025-01-25 17:02:41 +01:00
Mykola Mokhnach 2635dcb457 feat: Add BiDi commands to the listCommands API output (#20925) 2025-01-24 19:48:54 +01:00
Mykola Mokhnach 059f1cb698 feat(base-driver): Add an API to list commands (#20914) 2025-01-23 19:07:16 +01:00
Mykola Mokhnach 51acf54fe5 chore(appium): Move mixin BiDi-related methods into a separate module (#20852) 2024-12-21 11:02:36 +01:00
Mykola Mokhnach 64e768efb7 feat(appium): Add session.status BiDi command (#20839) 2024-12-14 19:41:12 +01:00
renovate[bot] 63cb664af1 fix(base-driver): update dependency path-to-regexp to v8 (#20520)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Mykola Mokhnach <mokhnach@gmail.com>
2024-09-04 18:47:07 +02:00
Kazuaki Matsuo 9eb65f7ad4 fix(base-driver): change required to option for setWindowRect to follow w3c (#20391) 2024-07-17 08:49:26 -07:00
Mykola Mokhnach f8819836b5 chore(base-driver): Improve the exception message (#20343) 2024-07-07 09:30:12 +02:00
Mykola Mokhnach ac912606e7 chore(base-driver): Optimize routeToCommandName logic (#20331) 2024-07-07 08:04:26 +02:00
Kazuaki Matsuo 0363aab8ba feat(appium): Add session signature to all logs (#20202) (#20214)
* feat(appium): Add session signature to all logs (#20202) (#20214)

* test(logger): add tests for unleakString (#20222)

---------

Co-authored-by: Mykola Mokhnach <mokhnach@gmail.com>
Co-authored-by: Edgars Eglītis <37242620+eglitise@users.noreply.github.com>
2024-06-07 13:13:39 -07:00
Kazuaki Matsuo 40def9dbdb fix(appium): Revert changes in 20203 and 20202 (#20209)
* Revert "feat(appium): Add session signature to all logs (#20202)"

This reverts commit b3f8a47c2d.

* Revert "feat(logger): Add the 'debug' level to the default logger (#20203)"

This reverts commit 7fd9d5f626.
2024-06-06 16:17:57 -07:00
Mykola Mokhnach b3f8a47c2d feat(appium): Add session signature to all logs (#20202) 2024-06-06 22:46:52 +02:00
Mykola Mokhnach d5af68ecdd chore(base-driver): Drop the obsolete es6-error import (#19974) 2024-04-06 10:20:30 +02:00
Jonathan Lipps 2b21e66891 feat: add webdriver bidi support 2023-12-21 12:32:15 -08:00
Jonathan Lipps b53c0b9674 chore: run prettier on some files (#19403)
Working on these files for the bidi implementation
And want a clean PR to review without all this junk
2023-11-10 15:27:13 +00:00
Kazuaki Matsuo b83bd04265 chore(base-driver): remove mobileRotation as no references (#19379)
* chore(base-driver): remove mobileRotation as no references

* docs: remove unused endpoint

* test: fix test
2023-11-06 23:12:11 -08:00
renovate[bot] 72a806bec7 fix(images-plugin): update dependency lru-cache to v10 (#19050) 2023-08-25 10:42:28 +02:00
Mykola Mokhnach 2f69e6db2a chore(base-driver): Improve bad parameters error message (#19002) 2023-08-19 08:27:31 +02:00
Christopher Hiller 2b351705d4 fix(base-driver): pass thru all type args to ExternalDriver
- `core` module is now TS
- `constants` module is now TS
- export missing `W3C_ELEMENT_KEY`
- `JWProxy.command` returns `Promise<unknown>`.  deal with it
- updated some type tests
2023-07-03 13:10:51 -07:00
Christopher Hiller 54a4a8da03 fix(base-driver): update def of findElOrEls and findElOrElsWithProcessing
- adds some types to the `Proxy` class
- make `isErrorType()` a proper type guard
2023-06-14 16:21:51 -07:00
Mykola Mokhnach 4f564ef7ad fix(base-driver): Ignore unknown script arguments (#18575) 2023-04-27 22:40:20 +02:00
Christopher Hiller 4974403661 fix: backwards-compatible fixes for TS v5.x
These will be issues when we upgrade
2023-03-27 17:07:51 -07:00
Mykola Mokhnach d3e91222c8 chore(base-driver): Check if a valid Error instance is thrown (#18369) 2023-03-22 07:20:32 +01:00
Jonathan Lipps 84abed920a feat(base-plugin): add ability for plugins to implement execute methods 2023-01-20 14:21:08 -08:00
Jonathan Lipps ad1dce5545 fix(base-driver): move setClipboard deprecation to correct place 2023-01-13 09:45:11 -08:00
Jonathan Lipps 7055a0b281 feat(base-driver): deprecate non-standard routes
and add deprecation warnings in the log when these routes are accessed
2023-01-12 10:11:08 -08:00
Jonathan Lipps d8588e107c docs: add ExternalDriver docstrings (#17985) 2023-01-10 14:36:48 -08:00
Kazuaki Matsuo 316ecca8b1 feat(base): add get computed role and label in W3C v2 (#17928)
* feat(base): add get computed role and label in W3C v2

* add command names

* chore: add type

* chore: use `?` instead of `| null`

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

* Revert "chore: use `?` instead of `| null`"

This reverts commit 62af5e80ac.

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>
2022-12-15 20:46:44 -08:00
Christopher Hiller 226cd018b4 fix(basedriver,types): fix type problems
These arose when attempting to generate docs

- Errors now all have optional params in constructors; normalized param name
- Validate `METHOD_MAP` against an actual `MethodMap`
- Set `cliArgs = {}` as default in `server()`
- Rename `SessionCommands` to `ISessionCommands`
- The "context" in `IFindCommands` is now a generic of any type
- Made various props in `ExternalDriver` optional; `ExternalDriver` now accepts generic `Constraints`
- `proxyCommand` accepts a generic return value
- Removed unnecessary second generic type param from `DriverClass`
2022-11-22 14:32:10 -08:00
Christopher Hiller f715bb4fd8 chore(base-driver,base-plugin,execute-driver-plugin,fake-driver,fake-plugin,images-plugin): update some types for typedoc 2022-11-22 14:32:10 -08:00
Jonathan Lipps 337ec3e7ba feat(base-driver,fake-driver,appium): add convenience methods for defining execute script overloads (#17321)
* feat(base-driver,fake-driver,appium): add convenience methods for defining execute script overloads

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

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

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

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

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

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

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

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

* review

* review

Co-authored-by: Christopher Hiller <boneskull@boneskull.com>
2022-08-09 20:47:47 -07:00
Christopher Hiller 70d88cb86f feat(appium,base-driver,base-plugin,test-support,types): move test fixtures into test-support
- `@appium/test-support` now exports the e2e setup for plugins, and e2e/unit suites for drivers from base-driver.  it also generates declarations.
- `appium` exports this as `appium/test`.
- The `capability.spec.js` unit test for basedriver now avoids spying on the "global" logger, due to test flake.  It now spies directly on the function which calls the global logger. (@mykola_mokhnach)
- removed homebrew ansi-stripping code from `test-support` and replaced with `@colors/colors`
- type fixes and refactors for `@appium/test-support`
- type fixes for `appium`
- simplify `lib/index.js` of `@appium/base-driver`
2022-07-18 15:58:21 -07:00
Christopher Hiller 0676cd27c3 chore(appium,support,opencv,docutils): assorted type fixes
- Some types in `appium` were renamed
- Others avoid errors
- Some are minor tweaks to `tsconfig.json` files

# Conflicts:
#	packages/appium/lib/extension/extension-config.js
#	packages/appium/types/extension-manifest.ts
#	packages/appium/types/extension.ts
#	packages/base-driver/lib/jsonwp-proxy/proxy.js
#	packages/support/lib/logging.js
#	packages/support/test/unit/logger/logger-force.spec.js
2022-05-12 12:32:57 -07:00
Christopher Hiller e5b21b5674 chore(base-driver): enable type checks
and a bunch of associated fixes

# Conflicts:
#	packages/base-driver/lib/basedriver/core.js
#	packages/base-driver/lib/basedriver/desired-caps.js
#	packages/base-driver/lib/basedriver/helpers.js
#	packages/base-driver/lib/express/server.js
2022-05-12 12:32:57 -07:00
Christopher Hiller 133db5355f chore: reformat everything
this reformats all `.js`, `.ts`, and `.d.ts` files.
2022-05-09 19:09:50 -07:00
Mykola Mokhnach 78a46375ae feat(base-driver): Add a route for new window creation (#16748)
* feat(base-driver): Add a route for new window creation

* Update param name

* Update types
2022-04-12 14:51:16 -07:00
Mykola Mokhnach d8a9b4da36 feat(base-driver): Add more shadow root-related W3C routes (#16700) 2022-03-31 17:46:44 +02: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 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
Kazuaki Matsuo 3ee93ba5bd fix: revert 15809 (#16621)
* fix: revert 15809

* change comment
2022-03-21 10:10:35 -07:00
Mykola Mokhnach 493c48d190 feat: Add a missing route for element shadow root (#16538) 2022-03-09 18:51:41 +01: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
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
Mykola Mokhnach 07887b7c18 refactor(base-driver): Always assume the returned responses are in W3C format (#16175) 2021-11-29 22:55:48 +01: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 5b9a4c2ffa chore(appium): some cosmetic improvements to session and proxy naming etc 2021-11-12 22:15:06 -05:00