Skip to content

Commit

Permalink
chore: add print espresso path as a command (#854)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored Feb 4, 2023
1 parent 3fc42f1 commit 5402b5f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ On top of standard Appium requirements Espresso driver also expects the followin
- The package under test must not have mangled class names (e.g. [Proguard](https://developer.android.com/studio/build/shrink-code) must not be enabled for it)


## Scripts

- `appium driver run print-espresso-path` prints the path to the Appium Espresso server root. You can modify the gradle file directly if [Espresso Build Config](#espresso-build-config) was not sufficient.

## Capabilities

### General
Expand Down Expand Up @@ -206,7 +210,7 @@ In order to change between subdrivers use the [driver](#settings-api) setting. S
- click, isDisplayed, isEnabled, clear, getText, sendKeys, getElementRect, getValue, isSelected: These commands should properly support compose elements.
- getAttribute: Accepts and returns Compose-specific element attributes. See [Compose Element Attributes](#compose-element-attributes) for the full list of supported Compose element attributes.
- getElementScreenshot: Fetches a screenshot of the given Compose element. Available since driver version *2.14.0*
- `mobile: swipe`: Performs swipe gesture on the given element in the given direction.
- `mobile: swipe`: Performs swipe gesture on the given element in the given direction.
The `swiper` argument is not supported in Compose mode. Available since driver version *2.15.0*

Calling other driver element-specific APIs not listed above would most likely throw an exception as Compose and Espresso elements are being stored in completely separated internal caches and must not be mixed.
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
"platformNames": [
"Android"
],
"mainClass": "EspressoDriver"
"mainClass": "EspressoDriver",
"scripts": {
"print-espresso-path": "./scripts/print-espresso-path.js"
}
},
"main": "./build/index.js",
"bin": {},
Expand Down
8 changes: 8 additions & 0 deletions scripts/print-espresso-path.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const path = require('path');

function printEspressoServerPath () {
const dstPath = path.resolve(__dirname, '..', 'espresso-server');
console.log(dstPath); // eslint-disable-line no-console
}

printEspressoServerPath();

0 comments on commit 5402b5f

Please sign in to comment.