Commit Graph
343 Commits
Author SHA1 Message Date
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
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 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 06a8fe467c chore(gulp-plugins): update dependency node-notifier to v10.0.1 2022-03-17 16:38:06 +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 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 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 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 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