Commit Graph

97 Commits

Author SHA1 Message Date
Jonathan Lipps 45cc948671 fix(schema): edit a comment in order to trigger a publish 2024-06-11 12:05:50 -07:00
Jonathan Lipps def655cb39 docs(appium): add strategic partner browserstack (#20232)
* docs(appium): add strategic partner browserstack

* Partner announce (#20237)

* docs: move assets to override dir

* docs: remove copy-assets script

* docs: fix browserstack color-specific logo

---------

Co-authored-by: Edgars Eglītis <edgars.eglitis@outlook.com>

---------

Co-authored-by: Edgars Eglītis <edgars.eglitis@outlook.com>
2024-06-10 08:05:51 -07:00
Sudharsan Selvaraj 7492c3357e fix(universal-xml-plugin): add checks to disable the plguin in webview (#20179)
* fix(universal-xml-plugin): add checks to prevent transforming elements in webview

* Add missing tests

* Make context check to short circuit after selector validation
2024-06-06 10:25:29 -07:00
Jonathan Lipps 2b21e66891 feat: add webdriver bidi support 2023-12-21 12:32:15 -08:00
Edgars Eglītis 7528fcf890 fix(docutils): remove @appium/typedoc-plugin-appium and all other uses of typedoc (#19465) 2023-12-05 08:46:07 +01:00
Christopher Hiller 78c6a0b991 chore: remove jsdoc vestiges 2023-03-22 11:59:20 -07:00
Jonathan Lipps aeb322fc96 docs(appium): update docs and reference integration 2022-12-13 15:35:30 -08:00
Christopher Hiller e5eefbf9aa chore(): only ignore root "output" folder
this is currently unused, but we have an `output` folder now which should be under vcs
2022-11-22 14:32:10 -08:00
Christopher Hiller 4746080e54 feat(): experimental support for typedoc generation
Run `npm run typedoc` to generate docs in `typedoc-docs` dir.

I thought I'd take a few mins and set this up.  It was _mostly_ straightforward, except:

1. Figuring out the "entry point" for each package was difficult until I realized `.js` entry points are assumed to be compiled, and thus require a `sourceMappingUrl` reference. IMO this is probably a bug in TypeDoc
2. The `sourceMappingUrl` must reference an external sourcemap file; not an inline source map.  If it's an inline source map, the system tries to `fs.open` a large data-url.
3. The babel config does not control whether external sourcemaps are created; `@babel/cli` does. So I needed to change those.
4. Practically speaking, I don't see any drawback to external sourcemaps _yet_
5. TypeDoc has poor support for cross-package type references in monorepos, and I had to add a plugin which implements a workaround
6. Per some suggestions in the docs, I modified the order of references in the root `tsconfig.json` to start with "the biggest one first"

I didn't modify any types or docstrings anywhere.
2022-11-22 14:32:10 -08:00
Christopher Hiller 8bde0703ad chore: commit package-lock.json
Because it’s now under VCS, we shouldn’t remove it when cleaning, since that will probably result in a dirty working copy.

changed the `reinstall` script to call `npm ci`, which a) expects `package-lock.json` to exist, and b) removes `node_modules` before it installs stuff.
2022-06-16 11:30:13 -07:00
Christopher Hiller 485239d599 chore(ci): run smoke test in all packages
This uses the [boneskull/nodejs-production-test-action](https://github.com/boneskull/nodejs-production-test-action) GH action to run a smoke test across all packages.

The action does the following:

1. Runs `npm pack` on each package, writing the tarball to a temp dir. This tarball contains the package as a user would `npm install` it.
2. Changes into the temp dir and runs `npm install <tarball>` on each
3. Runs a specified script (in our case, `test:smoke`) in each installed package's dir in `<tmp_dir>/node_modules`

Because `devDependencies` will not be present, this should avoid a class of issues where production deps are miscategorized as dev deps.

The action should probably use a separate temp dir for each--in the case of a dependency being present but only because some other package depends on it--but it's not smart enough to figure out peer dependencies yet.
2022-06-13 16:08:17 -07:00
Jonathan Lipps 69663229fa docs(appium): create new docs generator for appium 2 2022-04-18 10:55:24 -07:00
Christopher Hiller 5b54017054 chore: relocated plugins
- left some necessary config in packages/plugins-temp which will get removed after full integration

# Conflicts:
#	packages/appium-plugins/.github/workflows/main.yml
#	packages/appium-plugins/packages/base/package-lock.json
#	packages/appium-plugins/packages/base/package.json
#	packages/appium-plugins/packages/fake/package-lock.json
#	packages/appium-plugins/packages/images/package-lock.json
#	packages/appium-plugins/packages/images/package.json
#	packages/appium-plugins/packages/relaxed-caps/package-lock.json
#	packages/appium-plugins/packages/relaxed-caps/package.json
#	packages/appium-plugins/packages/universal-xml/package-lock.json
#	packages/fake-plugin/lib/logger.js
#	packages/fake-plugin/lib/scripts/fake-error.js
#	packages/fake-plugin/lib/scripts/fake-success.js
#	packages/fake-plugin/package.json
#	packages/universal-xml-plugin/package.json
2022-04-14 14:30:00 -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
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
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
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 76d147aba1 chore: configure FOSSA
FOSSA was giving us a bunch of warnings about copyleft licenses, but these licenses are only present in our examples.  This configuration file will tell FOSSA to ignore that stuff.

FOSSA recognizes `examples/` as something it should skip, but not `sample-code`.  It's easier to rename the dir than it is to negotiate a PR with FOSSA.  Why they don't allow the config file to just ignore directories is beyond me...
2021-08-18 12:25:13 -07:00
Christopher Hiller 6c769a2b7c chore: housecleaning
Just a bunch of random (mostly path-related) fixes.

## Monorepo

- Make `npm run clean` work cross-platform
- Sort root `package.json`
- Update Babel configs to suppress warning about `@babel/plugin-proposal-private-property-in-object`
- Add `.nyc_output` and `*.lerna_backup` to `.gitignore`
- Replace references to `appium-support`
- Sync `package.json` fields
- Add a [Wallaby](https://wallabyjs.com) configuration file

## appium

- `lib/config`: `package.json` resolution
- split some tests out of `config-specs.js` and into `config-e2e-specs.js` since they are very clearly not unit tests
- Improve `PROJECT_ROOT` resolution, which is still a hack
- Copy fixtures & fix paths to fixtures in tests

## @appium/base-driver

- `lib/basedriver/driver`: `package.json` resolution
- Fix broken tests when run in isolation (`chai.should()`)

## @appium/doctor

- `lib/doctor`: `package.json` resolution
- `lib/utils`: `package.json` resolution & exposed `resetLog()` which undoes what `configureBinaryLog()` does (for testing purposes)
- `utils-specs.js`: clean up after `onLogMessage` test
- copy fixtures into `build` upon transpile
- Upgrade `@appium/gulp-plugins`

## @appium/gulp-plugins

- Ensure `postTranspile` is run when `transpile` is run before tests
- Fix `.babelrc` like `babel.config.json`

## @appium/support

- Fixture resolution
- Fix broken tests when run in isolation (`chai-as-promised`)
- Copy fixtures when transpiling
2021-08-10 11:52:57 -07:00
Christopher Hiller c3bbab1239 chore: add vscode settings to .gitignore 2021-05-18 12:36:08 -07:00
Jonathan Lipps ec763d5718 fix lint warnings and use reduce 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
Isaac A. Murchie 1422473a5c feat: Remove Selendroid driver (#12964) 2019-07-25 10:26:24 -04:00
Isaac A. Murchie eb4ddafc36 Update python sample code (#12681) 2019-05-23 09:37:40 -04:00
Kazuaki Matsuo 783c5e3c2e ignore .lock file in ruby sample code (#12034) 2019-01-19 15:19:51 +09:00
Kazuaki Matsuo c503f08574 Add csharp sample (#11255)
* add git ignore

* add csharp sample tests

* update readme

* remove comments
2018-08-28 09:21:14 -04:00
Kazuaki Matsuo cd12ed9a51 Add python sample code (#11208)
* add initial python sample

* add all of ios and android tests

* apply formatter

* add >=0.28 to avoid version error

* tweak versions of default OS

* convert some tests to unittest based ones

* use single quote mainly

* use {} format style for string

* use format syntax

* apply format and tweak assertions

* use is None

* use assert raise

* speficy a number of elements

* tweak exception

* move app path to helper

* tweak assertion conditions

* remove .close since with open() close file automatically
2018-08-22 11:48:58 -07:00
dan@saucelabs.com bb4517024e Add a zip command 2018-06-21 20:55:31 -07:00
Isaac A. Murchie 04f6543561 Bring Sample Code into master (#10880)
* Sample code stub (#9887)

* WD tests

* WD sample code (#9918)

* WebdriverIO sample code (#10166)

* Ruby sample code (#10331)

* PHP Sample Code (#10209)

* Basic Android java test

* Java sample code (#10427)

* Sample code (#10834)

* Sample code stub (#9887)

* WD tests

* WD sample code (#9918)

* WebdriverIO sample code (#10166)

* Ruby sample code (#10331)

* PHP Sample Code (#10209)

* Basic Android java test

* Java sample code (#10427)

* fixed WDIO test

* Update .npmignore
2018-06-15 08:23:42 -04:00
Dan Graham 36cc935fc5 Revert "Create session and basic interactions samples (#9907)" (#9915)
This reverts commit 061e264800.
2018-01-04 13:52:30 -08:00
Dan Graham 061e264800 Create session and basic interactions samples (#9907)
* Add apps; add create session test
* Android create session tests
* iOS basic interactions test
* Basic web session tests (iOS and Android)
2018-01-04 13:48:24 -08:00
Isaac A. Murchie 524cee0796 Add e2e-tests to travis config (#9841) 2017-12-27 07:34:08 -05:00
Dan Graham 2610c14aac Move sitemap from appium.io to docs (#9220)
* So that we don't have to maintain the sitemap in a separate repo from the main doc repo
* Also, ignore mkdocs.yml, it's an artifcat of the site building process
2017-09-15 13:04:04 -07:00
Isaac A. Murchie 94635edeac Update linting (#9123)
* Update linting

* Move minimum node version to 5

* Remove coverage for now

* Fix docs for node version

* Fail for node 4 and below
2017-08-31 07:49:43 -04:00
Isaac Murchie c1fb7a8d9a Fix python swipe docs 2016-03-02 16:04:19 -08:00
Jonathan Lipps 3da51d05cf move all old code out of git 2015-05-21 20:50:36 -07:00
Jonathan Lipps 963eac555b get rid of old xpath/uiauto dirs now that we have appium-uiauto 2015-05-12 12:11:02 -07:00
sebv fb3e4daab6 ci fix 2015-02-28 20:39:46 +08:00
sebv 230fde79c4 typo 2015-02-27 21:26:12 +08:00
sebv 375098ec95 ci changes, moving code to appium-ci-gulper and using gulp more 2015-02-27 20:31:13 +08:00
sebv b0c8b983dc adds prepare-tap tool 2015-02-09 02:11:23 +08:00
Isaac Murchie 3cb2c426a2 Figure out location of adb earlier 2015-01-14 10:40:40 -08:00
Jonah Stiennon 1d6d6237ca all sample-code in gitignore 2014-08-13 16:26:35 -07:00
Jonathan Lipps 0483952a0e move sample code and apps out of main repo
and add a grunt task that brings them in for use in dev
2014-08-12 17:58:42 -07:00
Isaac Murchie 5b9145af02 Update Python samples 2014-06-09 19:34:59 -07:00
bootstraponline 04ca54f094 Update Ruby sample code 2014-05-17 17:04:44 -04:00
Dan Doveralba b07e1b633c Add Location & Contacts Alerts
* reqest access to location and contacts in our sample app
2014-03-14 18:26:31 -07:00
Isaac Murchie c7910936fd Ignore maven/surefire byproducts 2014-03-06 09:48:45 -08:00
bootstraponline cce7ee0126 Android longClick x, y, and duration support
Ruby examples:

mobile :longClick, element: el.ref

mobile :longClick, element: el.ref, duration: 3000

mobile :longClick, x: 400, y: 297, duration: 3000

mobile :longClick, x: 0.5, y: 0.244
2014-02-27 16:18:05 -05:00
jonahss cd411874a4 changed .appiumconfig to .apapiumconfig.json so we can load it with require() and have it cached 2014-02-25 15:53:55 -08:00