Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Docs

on:
pull_request:
branches:
- master
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'gradle/docs.gradle'
- '.github/workflows/docs.yml'
# Publishes the `dev` version of the docs
push:
branches:
- master
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'gradle/docs.gradle'
- '.github/workflows/docs.yml'
workflow_dispatch:
inputs:
version:
description: 'Docs version to publish (e.g. dev, 12.0)'
required: true
default: 'dev'
alias:
description: 'Optional alias for the version (e.g. latest)'
required: false
# Called by release.yml to publish the docs of a release
workflow_call:
inputs:
version:
description: 'Docs version to publish (e.g. 12.0)'
required: true
type: string
alias:
description: 'Optional alias for the version (e.g. latest)'
required: false
type: string
default: ''
ref:
description: 'Git ref to build the docs from (default: the triggering ref)'
required: false
type: string
default: ''

permissions:
contents: read

jobs:
check:
runs-on: ubuntu-latest
concurrency:
group: docs-check-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
- uses: actions/setup-java@v6
with:
java-version: '17'
distribution: 'zulu'
- uses: astral-sh/setup-uv@v10.4.1
- uses: gradle/actions/setup-gradle@v6.4.1
- name: Build docs (strict)
run: ./gradlew docsCheck

deploy:
# Never from pull requests or other branches
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
needs: check
runs-on: ubuntu-latest
# One deploy at a time: they all push to the same branch
concurrency:
group: docs-deploy
cancel-in-progress: false
permissions:
contents: write
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
- uses: actions/setup-java@v6
with:
java-version: '17'
distribution: 'zulu'
- uses: astral-sh/setup-uv@v10.4.1
- uses: gradle/actions/setup-gradle@v6.4.1
- name: Configure git identity for mike
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Deploy docs version
env:
DOCS_VERSION: ${{ inputs.version || 'dev' }}
DOCS_ALIAS: ${{ inputs.alias }}
run: |
args=(-PdocsVersion="$DOCS_VERSION")
if [ -n "$DOCS_ALIAS" ]; then args+=(-PdocsAlias="$DOCS_ALIAS"); fi
./gradlew docsDeploy "${args[@]}"
# The site root redirects to the latest release
if [ "$DOCS_ALIAS" = "latest" ]; then ./gradlew docsSetDefault -PdocsDefault=latest; fi
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ concurrency:

jobs:
release:
outputs:
version: ${{ steps.result.outputs.version }}
docs_version: ${{ steps.result.outputs.docs_version }}
# Appium TC members (GOVERNANCE.md in appium/appium) and the java-client reviewers (CODEOWNERS);
# keep in sync with them
if: >-
Expand Down Expand Up @@ -60,6 +63,8 @@ jobs:
cp build/release/notes.md "$RUNNER_TEMP/release-notes.md"
echo "notes=$RUNNER_TEMP/release-notes.md" >> "$GITHUB_OUTPUT"
echo "version=$(cat build/release/version.txt)" >> "$GITHUB_OUTPUT"
# <major>.<minor>: patch releases update the same docs version
echo "docs_version=$(cut -d. -f1,2 build/release/version.txt)" >> "$GITHUB_OUTPUT"
{ echo "## Release v$(cat build/release/version.txt)"; cat build/release/notes.md; } >> "$GITHUB_STEP_SUMMARY"
else
echo "Nothing to release" >> "$GITHUB_STEP_SUMMARY"
Expand Down Expand Up @@ -95,3 +100,16 @@ jobs:
gh release create "v${{ steps.result.outputs.version }}" \
--title "v${{ steps.result.outputs.version }}" \
--notes-file "${{ steps.result.outputs.notes }}" --verify-tag

# Only after the tag is pushed and the artifacts are published (the job is skipped if `release` fails);
# a failed run can be repeated with "Re-run failed jobs"
docs:
needs: release
if: needs.release.outputs.version != '' && !inputs.dry_run
uses: ./.github/workflows/docs.yml
permissions:
contents: write
with:
version: ${{ needs.release.outputs.docs_version }}
alias: latest
ref: refs/tags/v${{ needs.release.outputs.version }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ classes/
.classpath
.project
.vscode

# MkDocs / mike scratch output
/site/
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ tasks.withType(JacocoReport).configureEach {
jacocoTestReport.dependsOn test

apply plugin: 'checkstyle'
apply from: 'gradle/docs.gradle'

checkstyle {
toolVersion = '10.23.1'
Expand Down
6 changes: 3 additions & 3 deletions docs/Advanced-By.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ to learn more about the general concept.

## Android's Predicate String and Class Chain Queries

Available when using [AndroidBy](AndroidBy) and [AndroidFindBy](AndroidFindBy) with
Available when using [AndroidBy](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/pagefactory/AndroidBy.java) and [AndroidFindBy](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/pagefactory/AndroidFindBy.java) with
[appium-uiautomator2-driver](https://github.com/appium/appium-uiautomator2-driver) 10.1.0 (class chain)
and 10.2.0 (predicate string) or newer. They are evaluated directly on the accessibility tree, are about as fast as
`UiSelector` and faster than XPath, and replace the deprecated [uiAutomator](#androids-uiautomator-string) strategy.
`UiSelector` and faster than XPath, and replace the deprecated [uiAutomator](#androids-uiautomator-string-deprecated) strategy.
Read the [Class Chain Locator Strategy](https://appium.github.io/appium-uiautomator2-driver/latest/guides/android-class-chain/)
guide for the syntax.

Expand All @@ -136,7 +136,7 @@ this strategy is going to stop working. Use the predicate string and class chain
[Migrating from UiScrollable and UiSelector](https://appium.github.io/appium-uiautomator2-driver/latest/guides/migrating-from-uiscrollable/)
for the equivalents.

Available when using [AndroidBy](AndroidBy) and [AndroidFindBy](AndroidFindBy) with
Available when using [AndroidBy](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/pagefactory/AndroidBy.java) and [AndroidFindBy](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/pagefactory/AndroidFindBy.java) with
[appium-uiautomator2-server](https://github.com/appium/appium-uiautomator2-server). This
string will be used by the server to construct a UiSelector or UiScrollable object.

Expand Down
15 changes: 14 additions & 1 deletion docs/Note-for-developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,17 @@ It is needed to go to the directory where `java_client` is located. You can do i

`gradle check`. If everything is ok then all checks should be passed. Otherwise you can open reports at `JAVA_CLIENT_DIRECTORY/build/reports`

**The adding of new tests is required when new feature is added or some bug is fixed.**
**The adding of new tests is required when new feature is added or some bug is fixed.**

# Documentation

The documentation site is built with [Zensical](https://zensical.org) from the `docs` folder and the `mkdocs.yml`
config (Zensical reads the MkDocs format). Versions are published with the Zensical-compatible `mike` fork. Only
[uv](https://docs.astral.sh/uv/) and git are required; uv installs the tools pinned in `docs/requirements.txt` into its
cache (and fetches Python if needed), so there is no virtual environment to manage.

- `./gradlew docsServe` serves the site with live reload at <http://127.0.0.1:8000>.
- `./gradlew docsCheck` builds the site in strict mode; broken links, anchors and pages missing from the `nav` fail it.
Pull requests that touch the docs run this check.
- Use `-PdocsPython=3.13` (or a path) to pick the Python interpreter, `-PdocsUv=/path/to/uv` if `uv` is not on the PATH.
- Link to sources and other repository files with absolute `https://github.com/appium/java-client/blob/master/...` URLs.
2 changes: 1 addition & 1 deletion docs/The-event_firing.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ This proxy is not tied to WebDriver descendants and could be used to any classes
**public** constructors. It also allows to intercept exceptions thrown by **public** class methods and/or
change/replace the original methods behavior. It is important to know that callbacks are **not** invoked
for methods derived from the standard `Object` class, like `toString` or `equals`.
Check [unit tests](../src/test/java/io/appium/java_client/proxy/ProxyHelpersTest.java) for more examples.
Check [unit tests](https://github.com/appium/java-client/blob/master/src/test/java/io/appium/java_client/proxy/ProxyHelpersTest.java) for more examples.

#### ElementAwareWebDriverListener

Expand Down
14 changes: 14 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Appium Java Client

Java language bindings for writing [Appium](https://appium.io) tests that conform to the
[WebDriver protocol](https://w3c.github.io/webdriver/).

- Installation, compatibility matrix and quick start: see the
[README](https://github.com/appium/java-client#readme).
- API reference: [Javadoc](https://www.javadoc.io/doc/io.appium/java-client).
- Upgrading between major versions: see the **Migration** section.
- Changes between versions: [CHANGELOG](https://github.com/appium/java-client/blob/master/CHANGELOG.md).

!!! note
This site is being rebuilt. Most pages are carried over from the repository's `docs` folder and
will be rewritten.
21 changes: 14 additions & 7 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Its target auditory is project maintainers.

## Release Steps

The release is one run of the [Release](../.github/workflows/release.yml) workflow
The release is one run of the [Release](https://github.com/appium/java-client/blob/master/.github/workflows/release.yml) workflow
(Actions > Release > Run workflow, branch `master`). Only Appium TC members and the java-client reviewers
(see `CODEOWNERS`) can run it; for anyone else the job is skipped. The list is in the workflow file, update it
when the TC or the reviewers change.
Expand All @@ -18,11 +18,14 @@ when the TC or the reviewers change.
bumps are listed under `DEPENDENCY CHANGE`, but a release is not created for them (or for `ci`, `test` and
`build` commits) alone.
1. Run the workflow again with `dry_run` disabled. It then:
1. updates `appiumClient.version` in [gradle.properties](../gradle.properties) and adds the notes to the
[Changelog](../CHANGELOG.md),
1. updates `appiumClient.version` in [gradle.properties](https://github.com/appium/java-client/blob/master/gradle.properties) and adds the notes to the
[Changelog](https://github.com/appium/java-client/blob/master/CHANGELOG.md),
1. commits `chore: release <version>` and pushes it to `master` together with the `v<version>` tag,
1. publishes the artifacts to Maven Central,
1. creates the GitHub release with the same notes.
1. creates the GitHub release with the same notes,
1. publishes the documentation of the released `<major>.<minor>` version to the
[site](https://appium.github.io/java-client/) as `latest` (the [Docs](https://github.com/appium/java-client/blob/master/.github/workflows/docs.yml) workflow,
see [Development notes](Note-for-developers.md#documentation)).
1. Open [Maven Central Repository](https://central.sonatype.com/) and log in using the credentials stored in
1Password (contact the Appium maintainers for access). Under `Publish` > `Deployments` the new deployment
goes through the `publishing` state, which sometimes takes a while but eventually completes.
Expand Down Expand Up @@ -55,7 +58,7 @@ when the TC or the reviewers change.
- After the push, when the artifacts were not published (the publishing step failed or never started): create the
GitHub release for the `v<version>` tag by hand (web UI, or `gh release create v<version> --notes-file ...`, the
notes are in `CHANGELOG.md`). That alone starts the
[Publish package](../.github/workflows/publish.yml) workflow (`release: published`, so saving a draft is not enough, publish it); do not also run it manually and
[Publish package](https://github.com/appium/java-client/blob/master/.github/workflows/publish.yml) workflow (`release: published`, so saving a draft is not enough, publish it); do not also run it manually and
do not run the Release workflow again, the version is already tagged.
- If Maven Central already accepted the deployment and only the GitHub release step failed: wait until both
`https://repo1.maven.org/maven2/io/appium/java-client/<version>/java-client-<version>.pom` and
Expand All @@ -66,10 +69,14 @@ when the TC or the reviewers change.
the version again. To re-publish a version that is not on Central yet, start Publish package manually with the
tag, without creating a release.

- If only the `docs` job of the Release run failed, the release itself is complete: use "Re-run failed jobs" on the
run. Docs of a release are built from its `v<version>` tag. The `dev` version is published from `master` on
every change to `docs/**`, so it needs no release step.

### Manual release (fallback)

1. Update the [Changelog](../CHANGELOG.md) for the given version based on previous commits.
1. Bump the `appiumClient.version` number in [gradle.properties](../gradle.properties).
1. Update the [Changelog](https://github.com/appium/java-client/blob/master/CHANGELOG.md) for the given version based on previous commits.
1. Bump the `appiumClient.version` number in [gradle.properties](https://github.com/appium/java-client/blob/master/gradle.properties).
1. Create a pull request to approve the changelog and version bump and merge it.
1. Create and push the `v<major>.<minor>.<patch>` tag.
1. Create a [Release](https://github.com/appium/java-client/releases/new) in GitHub with the changelog in the
Expand Down
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
zensical==0.1.4
# Zensical-compatible fork of mike (tag 2.2.0+zensical-0.1.0), pinned by commit
mike @ git+https://github.com/squidfunk/mike.git@0f62791256ebeba60d20d2f1d8fe6ec3b7d1e2b3
2 changes: 1 addition & 1 deletion docs/v10-to-v11-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ classes that the client does not extend or expose anymore, and the usages of the
## Migration steps

1. Update the client to `11.x` and Selenium to `4.50.0` or newer. Selenium versions below 4.50.0 won't work with
Appium java client 11+. Check the [Compatibility Matrix](../README.md#compatibility-matrix) for more details.
Appium java client 11+. Check the [Compatibility Matrix](https://github.com/appium/java-client#compatibility-matrix) for more details.
Use Appium server 3 or newer and the drivers and plugins that are compatible with it, see
[the Appium server](#the-appium-server).
2. Declare the Selenium modules your own code uses. They are not brought by the client anymore:
Expand Down
16 changes: 8 additions & 8 deletions docs/v8-to-v9-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ with Java compilers below this version.
## The minimum supported Selenium version is set to 4.14.1

- Selenium versions below 4.14.1 won't work with Appium java client 9+.
Check the [Compatibility Matrix](../README.md#compatibility-matrix) for more
Check the [Compatibility Matrix](https://github.com/appium/java-client#compatibility-matrix) for more
details about versions compatibility.

## Removed previously deprecated items

- `MobileBy` class has been removed. Use
[AppiumBy](../src/main/java/io/appium/java_client/AppiumBy.java) instead
[AppiumBy](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/AppiumBy.java) instead
- `launchApp`, `resetApp` and `closeApp` methods along with their
`SupportsLegacyAppManagement` container.
Use [the corresponding extension methods](https://github.com/appium/appium/issues/15807) instead.
- `WindowsBy` class and related location strategies.
- `ByAll` class has been removed in favour of the same class from Selenium lib.
- `AndroidMobileCapabilityType` interface. Use
[UIAutomator2 driver options](../src/main/java/io/appium/java_client/android/options/UiAutomator2Options.java)
or [Espresso driver options](../src/main/java/io/appium/java_client/android/options/EspressoOptions.java) instead.
[UIAutomator2 driver options](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/android/options/UiAutomator2Options.java)
or [Espresso driver options](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/android/options/EspressoOptions.java) instead.
- `IOSMobileCapabilityType` interface. Use
[XCUITest driver options](../src/main/java/io/appium/java_client/ios/options/XCUITestOptions.java) instead.
[XCUITest driver options](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/ios/options/XCUITestOptions.java) instead.
- `MobileCapabilityType` interface. Use
[driver options](../src/main/java/io/appium/java_client/remote/options/BaseOptions.java) instead.
[driver options](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/remote/options/BaseOptions.java) instead.
- `MobileOptions` class. Use
[driver options](../src/main/java/io/appium/java_client/remote/options/BaseOptions.java) instead.
[driver options](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/remote/options/BaseOptions.java) instead.
- `YouiEngineCapabilityType` interface. Use
[driver options](../src/main/java/io/appium/java_client/remote/options/BaseOptions.java) instead.
[driver options](https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/remote/options/BaseOptions.java) instead.
- Several misspelled methods. Use properly spelled alternatives instead.
- `startActivity` method from AndroidDriver. Use
[mobile: startActivity](https://appium.github.io/appium-uiautomator2-driver/latest/reference/execute-methods/#mobile-startactivity)
Expand Down
2 changes: 1 addition & 1 deletion docs/v9-to-v10-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ existing automated tests codebase.
## The minimum supported Selenium version is set to 4.35.0

- Selenium versions below 4.35.0 won't work with Appium java client 10+.
Check the [Compatibility Matrix](../README.md#compatibility-matrix) for more
Check the [Compatibility Matrix](https://github.com/appium/java-client#compatibility-matrix) for more
details about versions compatibility.

## Removed previously deprecated items
Expand Down
Loading
Loading