Commit Graph

1133 Commits

Author SHA1 Message Date
Christopher Hiller d31aaf9916 chore: update TS configuration
This pulls in some recommended settings from `@tsconfig/node14` (a proper TS target configuration for Node.js v14; ours wasn't _wrong_ per se, but this is better) and allows us more flexible use of `ts-node`.  Use of this module is recommended by `ts-node` (which we need to run tests).

`ts-node`'s behavior changes _depending on the directory in which it's run_--and this can cause some really nonsensical bugs--so the changes here ensure that it will act the same regardless of if you're running tests from a package directory or the monorepo root.

Also:

- Ensure various `clean` scripts don't fail if they've been run before `build`
- Enable `strict` mode in `@appium/types` cause we can
- Fix a type issue found in `@appium/support`; this does not appear to have been a traditional bug but rather a type disagreement surfaced by the new config

# Conflicts:
#	package-lock.json
#	packages/typedoc-plugin-appium/tsconfig.json
2022-12-06 18:08:15 -08:00
Christopher Hiller 3c32112c20 chore: use tsc for compilation across the board
- `@appium/gulp-plugins` does not use `tsc` and continues to use...whatever it uses.
- `@appium/doctor` now has generated declarations, though I didn't bother to do anything with the types
- rewrote swaths of build scripts:
  - removed the `fix` and `lint` scripts from each workspace (package) since I don't think they get used and they are of limited value
  - for tests and autoinstallation of extensions, added `ts-node` for on-the-fly compilation
  - workspaces _can_ define their own `build` and `clean` scripts (both should be required if either is used).  these do not currently get run when running `npm run dev`, but they do occur on a bare `npm install` from the monorepo root or a `npm run reinstall`.
  - `npm run rebuild` does a fresh rebuild, but does not clean any `node_modules` dirs nor does it reinstall anything.
  - removed `prepublishOnly` since `preversion` does the same thing
  - `npm test` now runs `build`/`lint` in parallel
- postinstall script of `appium` ("autoinstall") script now must call `npm run build` if in a fresh dev environment. this is because a) lifecycle scripts of packages run before lifecycle scripts in the monorepo root, and b) `postinstall` runs before `prepare`. so there's really no way around it; even using `ts-node` fails because other modules depend on `@appium/support/index.js` which expects the pkg to be built.

Closes #17746
Closes #17807
2022-12-06 11:21:05 -08:00
Christopher Hiller 882a5f4d5e chore: unify test setup fixture
Moved the stuff in `test/setup-babel` into `test/setup` and then removed some cruft in the `test:*` scripts of each package referencing `test/setup-babel`
2022-04-14 14:30:00 -07: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 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
Christopher Hiller ee00285b38 chore: global chai
This PR makes `chai` and `should()` _globals_ when using Mocha:

- `chai` is configured with `chai-as-promised`
- A `.mocharc.js` requires `./test/setup.js` _from the monorepo root_.
- Updated the ESLint config to recognize the globals.
- Updated Wallaby config

All instances of `import chai...` and the like have been removed from all test files.
2021-08-13 10:40:52 -07:00
Christopher Hiller a945cfcde0 chore: create appium monorepo; closes #14441
This PR supersedes PR #14562.

This is my first attempt at making this repo a monorepo and moving appium-proper into `packages/appium`.

I had tried to make this work with npm's "workspaces", but it seems lifecycle scripts don't run as you'd expect them to upon install.  Instead, I'm using Lerna, which provides more features for monorepos.

Changes include:

- The root `package.json` is now a package named `appium-monorepo`, which is `private`.  The monorepo should not be published.
- All dev dependencies remain in the root `package.json`.
- `gulpfile.js` _moved_ into `packages/appium/gulpfile.js`, but this should be **temporary**--`appium-gulp-plugins` makes certain assumptions which a monorepo violates, and I was unable to get it working without patching `appium-gulp-plugins`.
- Most of the `package.json` `scripts` moved into `packages/appium/package.json` due to the above.  This too should be considered **temporary**.
- Adds a root `postinstall` lifecycle script which calls `lerna bootstrap` to install/link packages.  I don't see a `package-lock.json` in `packages/appium/`; this needs investigating.
- Adds a root `test` lifecycle script which executes `npm run test` in all packages.  The tests do not pass, but I don't know if this is my fault.
- The `clean` script will purge all `node_modules` folders in each package, as well.
- I removed `scripts/release*.sh`, since it seems they would fail anyway--`lerna` should be used for releases instead
- The shrinkwrap-related stuff is untested.
- Renamed `tags` prop in `packages/appium/package.json` to `keywords`.  I don't know if `tags` is supported.
2021-05-17 14:17:39 -07:00
Jonathan Lipps c10c243760 feat: add ability for drivers to update server and add method maps like plugins
also ensure that each session gets its own plugin instances so plugins for different sessions can't share state
2021-02-23 14:41:09 -08:00
Kazuaki Matsuo 25d97de8f2 fix: update tests and parsing logic to handle new basedriver w3c reqs 2021-01-19 16:30:43 -08:00
Jonathan Lipps b57833556e test: fix test that relied on old fakedriver screenshot 2021-01-19 16:30:43 -08:00
Jonathan Lipps 648d62e715 chore: require node v12 2021-01-19 16:30:43 -08:00
Jonathan Lipps 7bd8f15c39 Merge branch 'master' into 2.0, most importantly by applying argparse 2.x updates 2020-11-17 16:16:51 -08:00
Jonathan Lipps 1f50580fdc chore: use appium2 version of base driver (#14772) 2020-10-02 09:45:06 -07:00
dependabot-preview[bot] 163b34dc2f chore(deps): bump argparse from 1.0.10 to 2.0.1 (#14687)
Bumps [argparse](https://github.com/nodeca/argparse) from 1.0.10 to 2.0.1.
- [Release notes](https://github.com/nodeca/argparse/releases)
- [Changelog](https://github.com/nodeca/argparse/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/argparse/compare/1.0.10...2.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Mykola Mokhnach <mokhnach@gmail.com>
2020-09-02 22:01:20 +02:00
Jonathan Lipps 38ea7752ce chore: merge main branch 2020-08-31 13:35:46 -07:00
Jonathan Lipps 70c886fe8c test: since we update FakeDriver prototype, update the one required by extension config 2020-08-31 13:30:49 -07:00
Jonathan Lipps 8bb644d874 feat: allow use of --plugins=all to activate all plugins, and show helpful startup text 2020-08-31 13:30:49 -07:00
Jonathan Lipps ce165a1b92 feat: restrict plugin activation to plugins enabled using --plugins=p1,p2 flag 2020-08-31 13:30:49 -07:00
Jonathan Lipps 3dd63175c5 feat: allow installed plugins to modify server, method map, and act as command handlers 2020-08-31 13:30:49 -07:00
Jonathan Lipps 2f56309f77 feat: add plugin CLI subcommands 2020-08-31 13:30:49 -07:00
Jonathan Lipps 6eafdf63a6 refactor: generalize DriverConfig into ExtensionConfig and make DriverConfig a special case of it 2020-08-31 13:30:49 -07:00
Mykola Mokhnach 93004b75c4 fix: Only strip known prefixes from capability names (#14492) 2020-06-30 07:57:25 +02:00
Jonathan Lipps da521fbf76 feat: add driver update cli command 2020-06-29 09:29:18 -07:00
Jonathan Lipps e1e23a77a6 refactor: move all cli related functionality into a cli dir 2020-06-11 12:52:24 -07:00
Jonathan Lipps 7f6cd84723 test: add e2e tests for driver cli 2020-06-10 07:16:38 -07:00
Jonathan Lipps ae19b5133e refactor: separate parser logic and cli args more clearly 2020-06-10 07:16:38 -07:00
Jonathan Lipps bf54851f51 fix: fix broken e2e tests 2020-06-10 07:16:38 -07:00
Jonathan Lipps 0410572573 refactor: move various driver cli bits into classes 2020-06-10 07:16:38 -07:00
Jonathan Lipps ec763d5718 fix lint warnings and use reduce 2020-06-10 07:16:38 -07:00
Jonathan Lipps 7294f9d8b4 feat: add --appium-home (alias --home, -ah) to allow setting location of appium dir
fix: install and require driver modules from appium home dir instead of appium node package

refactor: use toPairs instead of Object.keys wherever possible

refactor: move driver data validation to a better

refactor: make a server-parser file to mirror driver-parser

feat: change install source arg to --source. Also add unit tests for driver parser

feat: use yaml for driver manifest format instead of json

feat: add schema version to yaml format
2020-06-10 07:16:38 -07:00
Jonathan Lipps bb0313ce1a breaking change: do not depend directly on drivers anymore
instead look for a reference to them in a drivers json file which will be
managed by the appium driver cli tool. this is a WIP and tests are not yet fixed

(breaking change)

feat: add driver CLI and subcommands; start to implement them beginning with list

feat: enable showing possible updates during 'driver list'

feat: enable installation of drivers via 'driver install'

feat: enable installation of drivers via local, git, and github specs

fix: lint and unit test updates to get everything passing

fix: make sure travis installs fakedriver

refactor: move cli helpers into own file and clean up driver json validation
2020-06-10 07:16:38 -07:00
Mykola Mokhnach da83532ba0 chore: Replace requests usage with axios (#14269) 2020-05-05 10:05:37 +02:00
Mykola Mokhnach 3a41f32e42 chore: Tune handling of default capabilities (#13887) 2020-01-29 17:07:42 +01:00
Mykola Mokhnach 563dc542df feat: Bump base driver to version 5 (#13635) 2019-11-26 07:30:24 +01:00
Isaac A. Murchie 2aa4e33db5 tests: fix the build (#13553) 2019-11-07 08:45:50 -05:00
Mykola Mokhnach d3081ca46b fix: Update the expected error code (#13371) 2019-10-07 08:14:00 +02:00
Jonathan Lipps ecac10a3e1 add --allow-insecure and --deny-insecure server flags 2019-06-19 15:02:50 -07:00
Dan Graham bc9718899f Set UiAutomator2 as default Android driver (#12621) 2019-05-10 08:40:40 -07:00
Mykola Mokhnach 3d5ce43e58 Add a possibility to parse initial values for Appium settings from capabilities (#12440) 2019-04-07 19:59:34 +02:00
Isaac A. Murchie 048e25a6e3 Allow 'appium' automationName and particular platformName (#12415) 2019-03-29 14:33:13 -04:00
Isaac A. Murchie 8e5ec38d3f Add function names (#12370) 2019-03-22 15:13:02 -04:00
Isaac A. Murchie 60fc87ea2d Lazy load drivers upon request (#12127)
* Lazy load drivers upon request

* Handle different cases in aUtOmAtIoNnAmE
2019-02-07 08:27:10 -08:00
Isaac A. Murchie 97fbb1942e Update node version checks (#11996) 2019-01-15 12:06:00 -05:00
greenkeeper[bot] 10753839a9 Update eslint-config-appium to the latest version 🚀 (#11952)
* chore(package): update eslint-config-appium to version 4.0.1

* chore: fix linting

* chore: rebase and done
2019-01-08 07:43:50 -06:00
Isaac A. Murchie 29922f8931 Store built bundle in github not bintray (#11893) 2018-12-21 16:47:44 -05:00
Isaac A. Murchie 5229607571 Make sure xcuitest driver is built when bundling (#11871)
* Make sure xcuitest driver is built when bundling

* Test documentation generation on PRs too

* Run docs gen testing on Linux
2018-12-19 16:22:13 -05:00
Dan Graham 9c2c455a30 Fix never-ending test (#11789) 2018-12-06 06:31:28 -08:00
Isaac A. Murchie 102f5ed0f3 Update winston logger (#11583) 2018-10-26 13:39:38 -04:00
Mykola Mokhnach bfcca7243b Do not use Github API fallback by default (#11506) 2018-10-10 18:41:33 +02:00
Isaac A. Murchie 7f3f136557 Update appium-gulp-plugins (#11461) 2018-10-03 09:39:25 -04:00