Compare commits

..
Author SHA1 Message Date
sebv e5e3a56626 bumping beta 2015-06-19 23:59:09 +08:00
sebv ba93e78521 running shrinkwrap against production packages only 2015-06-19 23:58:31 +08:00
sebv 6b1995f92a moved shrinkwrap to publish 2015-06-19 23:34:22 +08:00
Jonathan Lipps 114b3b31db bump to 1.4.5, since npm-shrinkwrap seems to work 2015-06-18 18:00:33 -07:00
Jonathan Lipps 564d4b6f63 changelog and bump to 1.4.5-beta to test if this new shrinkwrap works 2015-06-18 17:48:09 -07:00
Jonathan Lipps cd67dd6fef change shrinkwrap to be generated by npm-shrinkwrap, seems to actually work 2015-06-18 17:48:06 -07:00
Jonathan Lipps 5e072e99b4 stack-trace is not a dev dep, it's an actual dep 2015-06-18 17:48:00 -07:00
Jonathan Lipps 5f76497b94 changelog and bump to 1.4.4, also use npm shrinkwrap as we should have been doing all along 2015-06-18 16:59:09 -07:00
Jonathan Lipps aa8df18bd4 don't rely on async functions returning Promise objects; just use .then 2015-06-18 16:53:48 -07:00
Jonathan Lipps a357c7fa73 also update appium-instruments submodule since we do that still 2015-06-09 10:27:07 -07:00
Jonathan Lipps 44474700f4 update appium-instruments with subdep fix, bump to 1.4.3 and changelog 2015-06-09 10:27:03 -07:00
Jonathan Lipps fb5df00a6a bump version to 1.4.2 2015-06-08 17:23:02 -07:00
Jonathan Lipps 2da504e68f changelog for 1.4.1 and 1.4.2 2015-06-08 14:27:17 -07:00
Jonathan Lipps 6d0143439c upgrade es6 deps to fix babel/regenerator issue 2015-06-08 14:23:18 -07:00
Isaac Murchie 0923f50830 Keep track of the correct app id for safari webview 2015-06-08 14:23:12 -07:00
moizjv aa64ac7383 Fixing sendKeys and clear text for real samsung devices 2015-05-26 15:13:47 -07:00
moizjv ce62208290 Bumping to 1.4.1 for patch release 2015-05-19 08:49:41 -07:00
Jonathan Lipps e7cad78f2d appium-chromedriver now manages and builds chromedriver binaries, so remove all logic that has to do with building and finding them in appium itself (fix #5095) 2015-05-19 08:45:45 -07:00
moizjv 8f63e2f91e Bump to 1.4.0 to publish 2015-05-08 13:56:28 -07:00
moizjv a89066c6c4 Fixing broken link for UiAutomation 2015-05-08 13:49:41 -07:00
moizjv 7c3437fb46 Adding chromeOptions to documentation 2015-05-06 19:45:03 -07:00
Jonathan Lipps 4caad14ba7 final 1.4 changelog update 2015-05-06 14:32:05 -07:00
Isaac Murchie 393c37eba7 Fix Android keys by finding focused element 2015-05-06 14:32:05 -07:00
moizjv 20bed5e41d Fixing extractStrings method 2015-05-06 14:32:05 -07:00
Jonah Stiennon d62cf6de1f fix #5061, execute_async on Safari Real Device 2015-05-06 14:31:57 -07:00
Jonathan Lipps dc6a500287 update 1.4 changelog 2015-05-05 14:18:18 -07:00
moizjv 7e804db96c Adding supress-adb-kill-server to changelog 2015-05-05 14:18:18 -07:00
moizjv 36fc3fec0e Fixing location settings for iOS 2015-05-05 14:18:18 -07:00
Jonathan Lipps 94fe13693b add troubleshooting note about accessibility status for custom controls 2015-05-05 14:18:18 -07:00
sebv f8890302a8 bumping io.appium.gappium.sampleapp 2015-05-05 08:01:05 -07:00
sebv 26471c5386 android test fix 2015-05-05 08:01:00 -07:00
Jonathan Lipps 7257b1f8d7 node version deprecation warning should go after the show-config branch, otherwise it'll mess up JSON 2015-05-04 16:10:26 -07:00
Jonathan Lipps dea97f6844 update 1.4 changelog 2015-05-04 15:21:27 -07:00
Jonathan Lipps a7becef815 add an es6 Promise polyfill so node 0.10 still works (fix #5046) 2015-05-04 14:54:17 -07:00
Jonathan Lipps 15c6906cf4 deprecate node 0.10 2015-05-04 14:54:17 -07:00
Isaac Murchie 6f4f3bcdeb Update android ApiDemos app submodule 2015-05-04 14:54:17 -07:00
Isaac Murchie 6729fdd0eb Update unicode ime submodule 2015-05-04 14:54:16 -07:00
Jonathan Lipps 1c871e054d update appium-instruments/appium-xcode with another trailing slash fix 2015-05-04 11:23:02 -07:00
Jonathan Lipps 44faa8db0e update appium-instruments with appium-xcode path fix (fix #5018) 2015-05-01 14:50:59 -07:00
Jonathan Lipps fdbe71473b add more logging and error handling for extracting android strings, to prevent a crash (fix #4759, fix #4630) 2015-05-01 14:50:55 -07:00
Jonathan Lipps 80a285627e fix remote debugger so it doesn't use console.log, and truncate logs displayed 2015-05-01 14:50:48 -07:00
Jonathan Lipps 3efec0b073 update xcode deprecation to allow Xcode6.0.1+iOS8.0, and update 1.4 beta changelog 2015-04-30 21:05:55 -05:00
moizjv effe14b6ab Fixing perform touch with release action 2015-04-30 21:05:49 -05:00
Jonah Stiennon 437b7bed17 Safari Launcher updated to use Instruments to press a button to launch safari. Fixes Safari tests on real devices iOS 8.0 and up 2015-04-30 21:05:39 -05:00
Jonah Stiennon 045ec45ab9 fix a bug in finding ios real device id 2015-04-30 21:05:31 -05:00
Jonathan Lipps 0b30bd1cb4 fix issue with chromedriver not returning sessionId for override (fix #5013) 2015-04-29 12:15:10 -05:00
Isaac Murchie 4d4c8a2ba0 Update to allow safari on a 7.1 sim above xcode 5 2015-04-29 11:55:27 -05:00
Jonathan Lipps 60ce2c302e it's ok for the url to be about:blank when starting an older version of safari 2015-04-28 18:07:19 -05:00
Jonathan Lipps aa2e40fe40 update appium-xcode with trailing path fix (fix #5005) 2015-04-28 16:14:33 -05:00
moizjv a9e1b78f00 Fixing chrome driver to use correct ADB path 2015-04-28 15:37:17 -05:00
Jonathan Lipps 8f4eaa7745 fix incorrect .bind() causing an undefined crash when prelaunching sim (cc @Jonahss) 2015-04-28 15:07:45 -05:00
Jonathan Lipps 5bc053be9a update appium-xcode with ios6.1/xcrun fix 2015-04-28 12:49:06 -05:00
Jonathan Lipps 13420f8093 deprecate iOS < 7 and xcode < 6.3 (resolve #4996) 2015-04-28 12:49:00 -05:00
moizjv a1def6633b Fixing actual android capability 2015-04-28 12:48:56 -05:00
moizjv df21a5390c Fixing headings for documentation 2015-04-28 12:48:53 -05:00
Jonathan Lipps 2ba44979a3 don't use the 'center' fenced code block because jekyll doesn't like it in the docs build for appium.io 2015-04-28 12:48:46 -05:00
Jonathan Lipps f19e0fdbee update publish.sh so it checks for node 0.12 and removes antiquted xcode check 2015-04-28 12:48:29 -05:00
1408 changed files with 53344 additions and 135252 deletions
-13
View File
@@ -1,13 +0,0 @@
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
-54
View File
@@ -1,54 +0,0 @@
# Generated by FOSSA CLI (https://github.com/fossas/fossa-cli)
# Visit https://fossa.com to learn more
version: 3
project:
id: appium
name: appium
paths:
exclude:
- ./sample-code
- '**/fixtures/**'
- '**/demo/**'
- '**/example/**'
- '**/examples/**'
targets:
only:
- type: npm
path: .
- type: npm
path: ./packages/appium
- type: npm
path: ./packages/base-driver
- type: npm
path: ./packages/eslint-config-appium-ts
- type: npm
path: ./packages/fake-driver
- type: npm
path: ./packages/support
- type: npm
path: ./packages/test-support
- type: npm
path: ./packages/types
- type: npm
path: ./packages/schema
- type: npm
path: ./packages/universal-xmlplugin
- type: npm
path: ./packages/opencv
- type: npm
path: ./packages/images-plugin
- type: npm
path: ./packages/base-plugin
- type: npm
path: ./packages/relaxed-caps-plugin
- type: npm
path: ./packages/fake-plugin
- type: npm
path: ./packages/docutils
revision:
branch: master
-4
View File
@@ -1,4 +0,0 @@
* text=auto eol=lf
# Handle as a text file but merge as binary.
package-lock.json merge=binary
-111
View File
@@ -1,111 +0,0 @@
name: 🐞 Bug Report
description: Create a new bug report.
title: '🐞 bug: <title>'
labels: [Bug, Needs Triage]
body:
- type: markdown
attributes:
value: ':stop_sign: _Make sure you are reporting an issue. For general questions, please use [http://discuss.appium.io](http://discuss.appium.io)._'
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: 'Please [search :mag: the issues](https://github.com/appium/appium/issues) to check if this bug has already been reported.'
options:
- label: I have searched the existing issues
required: true
- type: input
attributes:
label: Appium Version
description: What Appium server version are you running?
placeholder: Output of `appium --version`
validations:
required: true
- type: dropdown
attributes:
label: Appium Host Type
description: |
How is your Appium server being hosted? For options other than "Command Line", please add more details under "Further Information".
options:
- Command Line
- Virtual Machine/Docker
- Cloud Provider (e.g. BrowserStack/Sauce Labs)
- Other
validations:
required: true
- type: input
attributes:
label: Are you using Appium components not maintained by the Appium team?
description: Refer to the [Appium Ecosystem](http://appium.io/docs/en/latest/ecosystem/) page for officially-supported components.
placeholder: Please provide the names of any third-party components.
- type: checkboxes
attributes:
label: Is this issue reproducible using the latest components?
description: |
You can retrieve the latest server/driver/plugin version number by running `npm info <package-name> version`. If you are not up to date, please try to reproduce your issue after updating all affected components.
options:
- label: I confirm the issue is still reproducible with the latest component versions
- type: textarea
attributes:
label: Current Behavior
description: Describe the problem you are experiencing. **Please do not paste your logs here.** Screenshots are welcome.
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: Describe what you expect to happen instead.
validations:
required: true
- type: input
attributes:
label: Appium Log
description: |
Please create a [Gist](https://gist.github.com) with your _full_ Appium server log and link it here. Alternatively, you can directly attach your logfile in the "Further Information" field below.
:warning: _Remember to redact or remove any sensitive information!_
placeholder: 'https://gist.github.com/...'
- type: textarea
attributes:
label: Environment Details
description: |
Please provide additional information about your environment; feel free to remove any items which are not relevant.
:warning: _Remember to redact or remove any sensitive information!_
value: |
- Debug details (`appium --show-debug-info`):
- Last component version(s) which did _not_ exhibit the problem:
- Platform and version of device under test:
- Real device or emulator/simulator:
- type: textarea
attributes:
label: Minimal Reproducible Example
description: |
Please provide [the smallest, complete code snippet](https://stackoverflow.com/help/minimal-reproducible-example) that Appium's maintainers can run to reproduce the issue. An easy way to get started is to copy [sample code](https://github.com/appium/appium/tree/master/packages/appium/sample-code) and modify it accordingly. Failing this, any sort of reproduction steps are better than nothing!
If the result is more than a screenful of text _or_ requires multiple files, please:
- _Attach_ (do not paste) it to this textarea, _or_
- Put it in a [Gist](https://gist.github.com) and paste the link, _or_
- Provide a link to a new or existing public repository exhibiting the issue
validations:
required: true
- type: textarea
attributes:
label: Further Information
description: If needed, please provide additional information about your issue (attachments, links, references, etc.).
- type: markdown
attributes:
value: ':stop_sign: _Make sure you are reporting an issue. For general questions, please use [http://discuss.appium.io](http://discuss.appium.io)._'
-5
View File
@@ -1,5 +0,0 @@
blank_issues_enabled: true
contact_links:
- name: ❓ Question
url: https://discuss.appium.io/
about: Please use the Appium forum for any questions.
@@ -1,33 +0,0 @@
name: 💡 Feature Request
description: Suggest an idea for this project.
title: "💡 feat: <title>"
labels: [Enhancement]
body:
- type: textarea
attributes:
label: Is your feature request related to a problem?
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...].
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like.
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered.
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
validations:
required: false
-28
View File
@@ -1,28 +0,0 @@
## Proposed changes
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
## Types of changes
What types of changes does your code introduce to Appium?
_Put an `x` in the boxes that apply_
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation Update (if none of the other choices apply)
## Checklist
_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
- [ ] I have read the [Contributing Guide](https://appium.io/docs/en/latest/contributing/)
- [ ] I have signed the CLA
- [ ] Lint and unit tests pass locally with my changes
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added the necessary documentation (if appropriate)
- [ ] Any dependent changes have been merged and published in downstream modules
## Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...
-41
View File
@@ -1,41 +0,0 @@
name: Setup Node, Install, Build
description: |
Common setup for Appium CI jobs: checkout, setup Node, install deps, optional build, optional V8 cache clear.
inputs:
node-version:
description: Node.js version to setup
required: true
install-command:
description: npm install command
required: false
default: npm ci --foreground-scripts
run-build:
description: Whether to run npm run build
required: false
default: 'true'
runs:
using: composite
steps:
- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ inputs.node-version }}
cache: npm
- name: SocketDev Security Check
uses: SocketDev/action@v1
with:
mode: firewall-free
- name: Install dependencies
shell: bash
run: |
# Replace npm with sfw npm in the install command
install_cmd="${{ inputs.install-command }}"
install_cmd="${install_cmd//npm /sfw npm }"
$install_cmd
- name: Build packages
if: ${{ inputs.run-build == 'true' }}
shell: bash
run: npm run build
-149
View File
@@ -1,149 +0,0 @@
version: v1
labels:
- label: 'Enhancement'
sync: true
matcher:
commits: '^feat.*?:'
title: '^feat.*?:'
- label: 'Bug'
sync: true
matcher:
commits: '^fix.*?:'
title: '^fix.*?:'
- label: 'Documentation'
sync: true
matcher:
commits: '^docs.*?:'
title: '^docs.*?:'
files: ['packages/docutils/**', 'packages/appium/docs/**', '**/*.md']
- label: 'chore'
sync: true
matcher:
commits: '^chore.*?:'
title: '^chore.*?:'
files: ['.github/**', '.husky/**', '.vscode/**', './.*', './*.js', '**/test/**']
- label: 'SemVer:Breaking'
sync: true
matcher:
commits: '(^(.+?)!:)|(BREAKING CHANGE:)'
- label: 'Dependencies'
sync: true
matcher:
files: ['**/package.json', 'package-lock.json', '**/requirements.txt']
author: 'renovate'
- label: 'appium core'
sync: true
matcher:
files: ['packages/appium/**']
- label: '@appium/base-driver'
sync: true
matcher:
files: ['packages/base-driver/**']
- label: '@appium/base-plugin'
sync: true
matcher:
files: ['packages/base-plugin/**']
- label: '@appium/storage-plugin'
sync: true
matcher:
files: ['packages/storage-plugin/**']
- label: '@appium/docutils'
sync: true
matcher:
files: ['packages/docutils/**']
- label: '@appium/driver-test-support'
sync: true
matcher:
files: ['packages/driver-test-support/**']
- label: '@appium/eslint-config-appium-ts'
sync: true
matcher:
files: ['packages/eslint-config-appium-ts/**']
- label: '@appium/execute-driver-plugin'
sync: true
matcher:
files: ['packages/execute-driver-plugin/**']
- label: '@appium/fake-driver'
sync: true
matcher:
files: ['packages/fake-driver/**']
- label: '@appium/fake-plugin'
sync: true
matcher:
files: ['packages/fake-plugin/**']
- label: '@appium/images-plugin'
sync: true
matcher:
files: ['packages/images-plugin/**']
- label: '@appium/logger'
sync: true
matcher:
files: ['packages/logger/**']
- label: '@appium/opencv'
sync: true
matcher:
files: ['packages/opencv/**']
- label: '@appium/plugin-test-support'
sync: true
matcher:
files: ['packages/plugin-test-support/**']
- label: '@appium/relaxed-caps-plugin'
sync: true
matcher:
files: ['packages/relaxed-caps-plugin/**']
- label: '@appium/schema'
sync: true
matcher:
files: ['packages/schema/**']
- label: '@appium/support'
sync: true
matcher:
files: ['packages/support/**']
- label: '@appium/strongbox'
sync: true
matcher:
files: ['packages/strongbox/**']
- label: '@appium/test-support'
sync: true
matcher:
files: ['packages/test-support/**']
- label: '@appium/tsconfig'
sync: true
matcher:
files: ['packages/tsconfig/**']
- label: '@appium/types'
sync: true
matcher:
files: ['packages/types/**']
- label: '@appium/universal-xml-plugin'
sync: true
matcher:
files: ['packages/universal-xml-plugin/**']
-26
View File
@@ -1,26 +0,0 @@
# Configuration for Lock Threads - https://github.com/dessant/lock-threads
# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 365
# Skip issues and pull requests created before a given timestamp. Timestamp must
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
skipCreatedBefore: false
# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
exemptLabels: []
# Label to add before locking, such as `outdated`. Set to `false` to disable
lockLabel: false
# Comment to post before locking. Set to `false` to disable
lockComment: >
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.
# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: false
# Limit to only `issues` or `pulls`
only: issues
-16
View File
@@ -1,16 +0,0 @@
name: Labeler
on:
pull_request_target:
types: [opened, synchronize]
branches: [master]
permissions: read-all
jobs:
labeler:
permissions:
pull-requests: write
name: Auto-Label PRs
runs-on: ubuntu-latest
steps:
- uses: fuxingloh/multi-labeler@v4
-199
View File
@@ -1,199 +0,0 @@
name: Appium Build
on:
push:
branches:
- master
# this list of paths could potentially impact the build
paths:
- '**/tsconfig*.json'
- 'packages/base-driver/static/**/*'
- 'packages/*/test/**'
- 'packages/*/bin'
- 'packages/**/*.ts'
- 'packages/**/*.json'
- 'packages/**/*.js'
- 'package*.json'
- 'lerna.json'
- '.npmrc'
- '.mocharc.js'
- '.github/workflows/build.yml' # this file
- '.eslintrc'
- '.eslintignore'
- '!**/sample-code/**'
- '!packages/*/docs/**'
pull_request:
branches:
- master
paths:
- '**/tsconfig*.json'
- 'packages/base-driver/static/**/*'
- 'packages/*/test/**'
- 'packages/*/bin'
- 'packages/**/*.ts'
- 'packages/**/*.json'
- 'packages/**/*.js'
- 'package*.json'
- 'lerna.json'
- '.npmrc'
- '.mocharc.js'
- '.github/workflows/build.yml' # this file
- '.eslintrc'
- '.eslintignore'
- '!**/sample-code/**'
- '!packages/*/docs/**'
env:
CI: true
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
prepare_matrix:
uses: appium/appium-workflows/.github/workflows/node-lts-matrix.yml@main
prepare_e2e_packages:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.discover-packages.outputs.packages }}
steps:
- uses: actions/checkout@v6
- name: Discover packages with e2e tests
id: discover-packages
run: |
packages=()
for package_dir in packages/*/; do
package_json="${package_dir}package.json"
if [[ -f "$package_json" ]]; then
# Check if package.json has test:e2e script and it's not a no-op
has_e2e=$(node -e "
try {
const pkg = require('./$package_json');
const script = pkg.scripts && pkg.scripts['test:e2e'];
if (script && !script.includes('echo') && !script.includes('No e2e tests')) {
console.log('true');
}
} catch(e) {
// Ignore errors
}
")
if [[ "$has_e2e" == "true" ]]; then
# Use the directory path without packages/ prefix (remove trailing slash)
package_name="${package_dir%/}"
package_name="${package_name#packages/}"
packages+=("$package_name")
fi
fi
done
# Convert array to JSON array for GitHub Actions matrix
if [[ ${#packages[@]} -eq 0 ]]; then
echo "No packages with e2e tests found"
packages_json="[]"
else
# Use jq to create a compact single-line JSON array
packages_json=$(printf '%s\n' "${packages[@]}" | jq -R '.' | jq -s '.' | jq -c '.')
fi
echo "packages=$packages_json" >> $GITHUB_OUTPUT
echo "Found packages with e2e tests:"
echo "$packages_json" | jq -r '.[]' | sed 's/^/ - /'
test-smoke:
needs:
- prepare_matrix
name: Smoke Tests
strategy:
matrix:
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup, install and build
uses: ./.github/actions/setup-build
with:
node-version: ${{ matrix.node-version }}
install-command: npm ci --foreground-scripts
run-build: 'true'
- name: Run smoke tests
run: npm run test:smoke
test-unit:
needs:
- prepare_matrix
name: Unit Tests
strategy:
matrix:
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup, install and build
uses: ./.github/actions/setup-build
with:
node-version: ${{ matrix.node-version }}
install-command: npm ci --foreground-scripts
run-build: 'true'
- name: Run unit tests
run: npm run test:unit
test-types:
needs:
- prepare_matrix
name: Type Tests
strategy:
matrix:
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup, install and build
uses: ./.github/actions/setup-build
with:
node-version: ${{ matrix.node-version }}
install-command: npm ci --foreground-scripts
run-build: 'true'
- name: Run type tests
run: npm run test:types
test-e2e:
needs:
- prepare_matrix
- prepare_e2e_packages
name: E2E Tests - ${{ matrix.package_dir }} (Node ${{ matrix.node-version }})
if: ${{ github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
package_dir: ${{ fromJSON(needs.prepare_e2e_packages.outputs.packages) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup, install and build
uses: ./.github/actions/setup-build
with:
node-version: ${{ matrix.node-version }}
install-command: npm ci --foreground-scripts
run-build: 'true'
- name: Run E2E tests for ${{ matrix.package_dir }}
run: |
set -o pipefail
cd "packages/${{ matrix.package_dir }}"
npm run test:e2e
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup and install (no build)
uses: ./.github/actions/setup-build
with:
node-version: lts/*
install-command: npm ci
run-build: 'false'
- name: ESLint
run: npm run lint:ci
-36
View File
@@ -1,36 +0,0 @@
name: Cache Cleanup
# from https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
on:
pull_request:
types:
- closed
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache keys"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-44
View File
@@ -1,44 +0,0 @@
# Collects translation statistics from Crowdin for the last calendar month
# and posts them to Slack grouped by project, language, and translator
name: Crowdin Translation Statistics
on:
workflow_dispatch:
schedule:
# Run on the first day of each month at 9:00 AM UTC
- cron: 0 9 1 * *
jobs:
collect-stats:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- project_id_var: CROWDIN_DOCS_PROJECT_ID
project_name: appium-documentation
- project_id_var: CROWDIN_INSPECTOR_PROJECT_ID
project_name: appium-inspector
steps:
- uses: actions/checkout@v6
- name: Use Node.js LTS
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Collect Crowdin Stats for ${{ matrix.project_name }}
id: crowdin-stats
run: node ./scripts/crowdin-stats.mjs > crowdin-stats-${{ matrix.project_name }}.json
env:
CROWDIN_PROJECT_ID: ${{ vars[matrix.project_id_var] }}
CROWDIN_TOKEN: ${{ secrets.CROWDIN_DOCS_TOKEN }}
- name: Post to Slack for ${{ matrix.project_name }}
uses: slackapi/slack-github-action@v3.0.2
with:
errors: true
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload-file-path: crowdin-stats-${{ matrix.project_name }}.json
@@ -1,38 +0,0 @@
# Retrieves non-English translations from Crowdin and creates a PR with new changes
name: Sync Crowdin Docs Translations
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * *
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Use Node.js LTS
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Crowdin Sync
run: npm run crowdin-sync-docs-translations
env:
# appium-documentation
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_DOCS_PROJECT_ID }}
CROWDIN_TOKEN: ${{ secrets.CROWDIN_DOCS_TOKEN }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8.1.1
with:
token: ${{ github.token }}
commit-message: 'docs(appium): Update documentation translations'
title: 'docs(appium): Update documentation translations'
branch: crowdin-sync-${{ github.run_id }}
body: 'Automated Update of Documentation Translations: https://crowdin.com/project/appium-documentation'
@@ -1,31 +0,0 @@
# Updates Crowdin with any changes in document files in English
name: Update Crowdin English Docs
on:
push:
branches: [master]
paths:
- 'packages/appium/docs/en/**.md'
- 'packages/appium/docs/mkdocs-en.yml'
- '.github/workflows/crowdin-update-docs-resources.yml' # this file
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js LTS
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Crowdin Update
run: npm run crowdin-update-docs
env:
# appium-documentation
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_DOCS_PROJECT_ID }}
CROWDIN_TOKEN: ${{ secrets.CROWDIN_DOCS_TOKEN }}
-68
View File
@@ -1,68 +0,0 @@
name: Appium Deploy
on:
push:
tags:
- master
workflow_dispatch:
permissions:
contents: read
jobs:
prepare_matrix:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.generate-matrix.outputs.lts }}
steps:
- name: Select all current LTS versions of Node.js
id: generate-matrix
uses: msimerson/node-lts-versions@v2
check:
needs:
- prepare_matrix
name: Check
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Install Appium
run: |
if [[ "$GITHUB_REF_TYPE" == tag ]]; then
npm i --location=global $GITHUB_REF_NAME
else
npm i --location=global appium
fi
shell: bash
- name: Install drivers and plugins
run: |
if grep -q macos <<< ${{ matrix.os }}; then
appium driver install xcuitest
fi
appium driver install uiautomator2
appium plugin install images
shell: bash
- name: Verify installation
run: |
installed_drivers=$(appium driver list --installed 2>&1)
if grep -q macos <<< ${{ matrix.os }}; then
grep -q xcuitest <<< $installed_drivers
fi
grep -q uiautomator2 <<< $installed_drivers
installed_plugins=$(appium plugin list --installed 2>&1)
grep -q images <<< $installed_plugins
shell: bash
- name: Verify Appium could be executed
run: |
appium --use-plugins=images &
pid=$(echo $!)
sleep 5
ps -p $pid || exit 1
kill -2 $pid
shell: bash
-53
View File
@@ -1,53 +0,0 @@
name: Build Docs
on:
pull_request:
branches:
- master
paths:
- '**/tsconfig*.json'
- '**/package*.json'
- '**/*mkdocs*.ya?ml'
- 'packages/docutils/requirements.txt'
- 'packages/*/README.md'
- 'packages/*/docs/**'
- 'packages/*/**/*.ts'
- 'packages/*/**/*.js'
- '.github/workflows/docs.yml' # this file
- '!**/test/**'
- '!**/sample-code/**'
push:
branches:
- master
paths:
- '**/tsconfig*.json'
- '**/package*.json'
- '**/*mkdocs*.ya?ml'
- 'packages/docutils/requirements.txt'
- 'packages/*/README.md'
- 'packages/*/docs/**'
- 'packages/*/**/*.ts'
- 'packages/*/**/*.js'
- '.github/workflows/docs.yml' # this file
- '!**/test/**'
- '!**/sample-code/**'
jobs:
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install dependencies (Node.js)
uses: bahmutov/npm-install@v1.12.1
with:
useRollingCache: true
install-command: npm ci
- name: Install dependencies (Python)
run: PIP_BREAK_SYSTEM_PACKAGES=1 pip install -r packages/docutils/requirements.txt
- name: Configure Git User
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Build Docs
run: npm run docs:preview
-31
View File
@@ -1,31 +0,0 @@
name: License Checks
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
fossa-check:
name: Run FOSSA Analysis
runs-on: ubuntu-latest
env:
FOSSA_API_KEY: ${{secrets.FOSSA_API_KEY}}
steps:
- uses: actions/checkout@v6
with:
ref: master
- name: Install dependencies
uses: bahmutov/npm-install@v1.12.1
- name: Install fossa-cli
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
- name: Run FOSSA analysis
run: |
if [ -n "$FOSSA_API_KEY" ]; then
fossa analyze
fossa test
else
echo "License checks did not run. FOSSA_API_KEY is not defined for this fork."
fi
@@ -1,37 +0,0 @@
# Collects GitHub contribution statistics from the Appium organization for the last calendar month
# and posts it to Slack
name: GitHub Contribution Statistics
on:
workflow_dispatch:
schedule:
# Run on the first day of each month at 09:00 AM UTC
- cron: 0 9 1 * *
jobs:
collect-contrib-stats:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Use Node.js LTS
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Collect GitHub Contribution Stats
id: github-stats
run: node ./scripts/github-contrib-stats.mjs > github-contrib-stats.json
env:
# GITHUB_TOKEN is optional - if not provided, uses unauthenticated requests (rate limited)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Post to Slack
uses: slackapi/slack-github-action@v3.0.2
with:
errors: true
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload-file-path: github-contrib-stats.json
-55
View File
@@ -1,55 +0,0 @@
name: Appium Server Release
on:
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (no publishing or tagging)'
required: true
type: boolean
default: true
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && contains(fromJSON('["mykola-mokhnach", "jlipps", "eglitise", "KazuCocoa"]'), github.actor)
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Configure git user
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Setup Node and install deps (LTS)
uses: ./.github/actions/setup-build
with:
node-version: lts/*
install-command: npm ci
run-build: 'true'
- name: Run Lerna publish
env:
# for lerna createRelease
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRY_RUN: ${{ inputs.dry_run }}
run: |
set -euo pipefail
if [ "$DRY_RUN" = "true" ]; then
echo "Running lerna publish in dry-run mode"
printf "n\n" | npx lerna version --exact --no-git-tag-version --no-push
else
echo "Running lerna publish for real"
npm run release -- --yes
fi
-15
View File
@@ -1,15 +0,0 @@
name: Disallow "On Hold" PRs
on:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]
branches: [master]
jobs:
label-check:
runs-on: ubuntu-latest
steps:
- name: Check for "On Hold" label
uses: egmacke/action-check-label@v4
with:
label: On Hold
state: absent
-10
View File
@@ -1,10 +0,0 @@
name: Conventional Commits
on:
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
lint:
uses: appium/appium-workflows/.github/workflows/pr-title.yml@main
with:
config-preset: angular
-32
View File
@@ -1,32 +0,0 @@
name: Publish docs
on:
workflow_dispatch:
workflow_run:
workflows: ["Appium Server Release"]
types:
- completed
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Setup Node and install deps (LTS)
uses: ./.github/actions/setup-build
with:
node-version: lts/*
install-command: npm ci
run-build: 'true'
- name: Install dependencies (Python)
run: npm run install-docs-deps
- name: Fetch gh-pages
run: |
git fetch origin gh-pages:gh-pages || true
- name: Publish docs
run: |
npm run docs:publish
-30
View File
@@ -1,30 +0,0 @@
name: Validate Renovate Configs
on:
push:
branches:
- master
paths:
- '.github/workflows/renovate.yml' # this file
- '.renovaterc.json'
- 'renovate/default.json'
pull_request:
branches:
- master
paths:
- '.github/workflows/renovate.yml' # this file
- '.renovaterc.json'
- 'renovate/default.json'
permissions:
contents: read
jobs:
renovate:
name: Check Renovate Configs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Validate Renovate Config
uses: rinchsan/renovate-config-validator@v0.2.1
with:
pattern: '{.renovaterc.json,renovate/default.json}'
+6 -40
View File
@@ -2,20 +2,19 @@
*.swp
.DS_Store
node_modules
sample-code
*.trace
xcuserdata
*.sublime-*
test/functional/_joined
*.iml
!examples/java/*.iml
*.autosave
.idea/
!examples/java/.idea/
*.log
*.t
artifacts
input
./output
output
lib/devices/android/bootstrap/bin/*
lib/devices/android/bootstrap/local.properties
lib/devices/android/bootstrap/project.properties
@@ -24,45 +23,12 @@ lib/devices/android/bootstrap/target/
.*~
*~
org.eclipse.ltk.core.refactoring.prefs
/selendroid
.appiumconfig*
build/
.idea
lib/devices/ios/uiauto/lib/status.js
lib/devices/ios/uiauto/appium/xpath.js
*DerivedData
__pycache__
certificate.cert
certificate.key
# csharp
*.pyc
*.pdb
.vs
#vscode
.history
old
.tern-project
coverage
docs/mkdocs.yml
examples/javascript-wd/node_modules
examples/php/vendor
examples/php/composer.lock
examples/java/out/
examples/ruby/Gemfile.lock
examples/python/test/results/
examples/python/test/input
examples/python/.pytest_cache/
examples/csharp/test/bin
examples/csharp/test/obj
examples/csharp/test/bin
examples/csharp/packages
appium.zip
.vscode/settings.json
.nyc_output
*.lerna_backup
**/build-fixtures/**
*.tsbuildinfo
packages/*/LICENSE
\!packages/*/LICENSE
local_appium_home
*.tgz
npm-shrinkwrap.json
+55
View File
@@ -0,0 +1,55 @@
[submodule "submodules/instruments-without-delay"]
path = submodules/instruments-without-delay
url = https://github.com/facebook/instruments-without-delay.git
[submodule "submodules/ApiDemos"]
path = submodules/ApiDemos
url = https://github.com/appium/android-apidemos.git
[submodule "submodules/appium.io"]
path = submodules/appium.io
url = https://github.com/appium/appium.io.git
[submodule "submodules/selendroid"]
path = submodules/selendroid
url = https://github.com/selendroid/selendroid.git
[submodule "submodules/io.appium.gappium.sampleapp"]
path = submodules/io.appium.gappium.sampleapp
url = https://github.com/appium/io.appium.gappium.sampleapp.git
[submodule "submodules/unlock_apk"]
path = submodules/unlock_apk
url = https://github.com/appium/unlock_apk.git
[submodule "submodules/libimobiledevice-macosx"]
path = submodules/libimobiledevice-macosx
url = https://github.com/benvium/libimobiledevice-macosx.git
[submodule "submodules/ForceQuitUnresponsiveApps"]
path = submodules/ForceQuitUnresponsiveApps
url = https://github.com/appium/ForceQuitUnresponsiveApps.git
[submodule "submodules/appium-atoms"]
path = submodules/appium-atoms
url = https://github.com/appium/appium-atoms.git
branch = published
[submodule "submodules/appium-instruments"]
path = submodules/appium-instruments
url = https://github.com/appium/appium-instruments.git
branch = published
[submodule "submodules/appium-uiauto"]
path = submodules/appium-uiauto
url = https://github.com/appium/appium-uiauto.git
branch = published
[submodule "submodules/appium-adb"]
path = submodules/appium-adb
url = https://github.com/appium/appium-adb.git
[submodule "submodules/io.appium.android.ime"]
path = submodules/io.appium.android.ime
url = https://github.com/appium/io.appium.android.ime.git
[submodule "submodules/io.appium.settings"]
path = submodules/io.appium.settings
url = https://github.com/appium/io.appium.settings.git
[submodule "submodules/sample-code"]
path = submodules/sample-code
url = https://github.com/appium/sample-code
[submodule "submodules/deviceconsole"]
path = submodules/deviceconsole
url = https://github.com/rpetrich/deviceconsole.git
[submodule "submodules/appium-ci-gulper"]
path = submodules/appium-ci-gulper
url = https://github.com/appium/appium-ci-gulper.git
branch = master
+13
View File
@@ -0,0 +1,13 @@
{
"excludeFiles": ["submodules/**", "node_modules/**",
"./lib/server/static/**", "./lib/devices/firefoxos/atoms/*.js",
"./sample-code/**", "/Users/baba/Work/appium/ci/standalone-tools/node_modules/**"],
"requireCurlyBraces": ["for", "while", "do", "try", "catch"],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch",
"return", "try", "catch", "function"],
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
}
}
+5
View File
@@ -0,0 +1,5 @@
submodules
node_modules
lib/server/static
lib/devices/firefoxos/atoms
/Users/baba/Work/appium/ci/standalone-tools/node_modules
+11
View File
@@ -0,0 +1,11 @@
{
"laxcomma": true,
"strict": true,
"undef": true,
"unused": true,
"node": true,
"eqeqeq": true,
"trailing": true,
"indent": 2,
"shelljs": false
}
-11
View File
@@ -1,11 +0,0 @@
// @ts-check
'use strict';
module.exports = {
require: ['ts-node/register'],
// forbids use of .only() in CI
forbidOnly: Boolean(process.env.CI),
color: true,
timeout: '5s',
};
+26
View File
@@ -0,0 +1,26 @@
assets/
submodules/
bin/publish.sh
reset.sh
reset.bat
bin/test.sh
sample-code/
test/
lib/devices/android/bootstrap/bin/
lib/devices/android/bootstrap/target/
lib/devices/android/bootstrap/local.properties
lib/devices/android/bootstrap/project.properties
lib/devices/android/bootstrap/.classpath
_vimrc_local.vim
*.swp
*.swo
*~
.*~
.DS_Store
.travis.yml
*.log
*.trace
*.sublime-
*.prefs
.jshintrc
./.npmignore
-4
View File
@@ -1,4 +0,0 @@
# Do not disable package-lock. Disabling package-lock also disables npm-shrinkwrap
package-lock=true
save-exact=true
foreground-scripts=true
-15
View File
@@ -1,15 +0,0 @@
**/node_modules/**
**/build/**
**/fixtures/**
**/*.min.*
**/*.md
package-lock.json
package.json
**/.vscode/**
**/*.html
**/generated/**
# generated
packages/types/lib/appium-config.ts
**/*.hbs
/.nx/workspace-data
-9
View File
@@ -1,9 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>appium/appium//renovate/default"],
"schedule": [
"after 10pm",
"before 5:00am"
],
"timezone": "America/Vancouver"
}
-5
View File
@@ -1,5 +0,0 @@
{
"recommendations": [
"stateful.runme"
]
}
-50
View File
@@ -1,50 +0,0 @@
{
"configurations": [
{
"args": [
"--log-level=debug"
],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"env": {
"_FORCE_LOGS": "1"
},
"internalConsoleOptions": "openOnSessionStart",
"name": "Run Appium",
"program": "${workspaceFolder}/node_modules/.bin/appium",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"sourceMaps": true,
"type": "node"
},
{
"args": [
"--colors",
"--no-timeout",
"${file}"
],
"autoAttachChildProcesses": true,
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"internalConsoleOptions": "openOnSessionStart",
"name": "Test Current File w/ Mocha",
"program": "${workspaceFolder}/node_modules/.bin/mocha",
"request": "launch",
"runtimeArgs": [
"--require",
"ts-node/register"
],
"skipFiles": [
"<node_internals>/**",
"**/node_modules/mocha/**",
"**/node_modules/lodash/**",
"**/node_modules/ts-node/**"
],
"sourceMaps": true,
"type": "node"
}
],
"version": "0.2.0"
}
-19
View File
@@ -1,19 +0,0 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "dev",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$tsc-watch"
],
"label": "npm: dev",
"detail": "npm run dev",
"isBackground": true
}
]
}
-1
View File
@@ -14,7 +14,6 @@ Robin Keller <robinthekeller@gmail.com>
Adam Christian <adam.christian@gmail.com>
Jonathan Lipps <jlipps@gmail.com>
Sebastian Tiedtke <sebastiantiedtke@gmail.com>
Christian Bromann <mail@christian-bromann.com>
Jeremy Avnet <>
Bernard Kobos <bkobos@extensa.pl>
Santiago Suarez Ordoñez <santiycr@gmail.com>
+1856 -38
View File
File diff suppressed because it is too large Load Diff
+12
View File
@@ -0,0 +1,12 @@
# Contributing to Appium
Fork the project, make a change, and send a pull request! Please have a look at our
[Style Guide](/docs/en/contributing-to-appium/style-guide.md) before getting to work.
Please make sure the unit and functional tests pass before sending a pull request; for more
information on how to run tests, keep reading!
Make sure you read and follow the setup instructions in the README first.
### Running Appium from Source and doing dev on Appium
This is all detailed in our [running from source doc](/docs/en/contributing-to-appium/appium-from-source.md)
-189
View File
@@ -1,189 +0,0 @@
# Appium Project Governance
The Appium Project wants as much as possible to operate using procedures that
are fair, open, inviting, and ultimately good for the community. For that
reason we find it valuable to codify some of the ways that the Project goes
about its day-to-day business. We want to make sure that no matter who you are,
you have the opportunity to contribute to Appium. We want to make sure that no
one corporation can exert undue influence on the community or hold the Project
hostage. And likewise we want to make sure that corporations which benefit from
Appium are also incentivized to give back.
### The Technical Committee
The project is officially led by a Technical Committee (TC), currently
consisting of:
* [@jlipps](https://github.com/jlipps)
* [@mykola-mokhnach](https://github.com/mykola-mokhnach)
* [@eglitise](https://github.com/eglitise)
* [@KazuCocoa](https://github.com/KazuCocoa)
They all represent different companies and different types of contribution to
the Appium Project. The TC is responsible for high-level decisions (like
establishing a feature roadmap, accepting sponsorship, organizing conferences,
etc...), adjudicating conflicts between members of the community, and making
changes to the project's governance processes.
* Membership in the TC is granted by unanimous vote of current TC members.
* TC members can step down at any time.
* No more than 1/3 (or 2, whichever is higher) of TC members may belong to the same company.
* Changes to project governance require unanimous vote of the TC.
### Project Committers
Most of the project maintenance is handled by committers, community members who
have been granted commit access to the Appium organization on GitHub. The
responsibilities of committers include: reviewing and merging pull requests,
walking through changes with developers, weighing in on architectural issues,
and so on.
* Any two TC members can decide to make someone a project committer, providing that person has shown an appropriate understanding of the Appium codebase through prior contributions of code.
* In general any committer can review and merge a PR. In general committers should only merge code they are qualified to review, which might entail pinging another committer who has greater ownership over a specific code area.
* Debates between committers about whether code should be merged should happen in GitHub pull requests.
* Proposals for large changes to the project's code (architectural changes, etc...) should be brought forward as a GitHub issue (with the label `Proposal`), and all committers should be pinged so they can weigh in on the discussion if desired. Substantial changes, whether in proposal stage or in pull request stage should be signed off on by 1 TC member and at least 2 other committers. To assist in the discussion, a small proof of concept can be undertaken on a subset of the Appium ecosystem and raised as a strawman PR, to give flesh to the proposal and make discussion more helpfully concrete.
* In general disputes about code should be resolved by discussion, not votes. If there is substantial disagreement, aim for consensus. If that is not possible, committers can bring the dispute to the TC for a vote, with the outcome determined by a majority.
* Any committer can decide to close a PR or issue if they determine the change doesn't suit the project.
* Appium has a large ecosystem of repositories. Some are 'core' in the sense of being central subpackages with a lot of traffic like `appium/appium` or `appium/appium-ios-driver`. Others are 'peripheral' in the sense of receiving few changes, being maintained by 1 person or no one, etc..., like `appium/ruby_lib` or `appium/appium_thor` For 'core' repos, committers should not merge their own code straightaway. Like all contributors they should open a PR and get a +1 from another committer. For 'peripheral' repos for which they are the sole maintainer or for which they have a good understanding, it is obtuse to insist on another contributor's +1 and this rule should be relaxed in that case. In sum: use good judgment and don't ram code through without a review when you can help it.
The current committers are (along with their primary areas(s) of ownership or maintenance):
* [@dan-maor](https://github.com/Dan-Maor) - XCUITest driver and iOS internals
* [@dor-bl](https://github.com/Dor-bl) - DotNet client
* [@Delta456](https://github.com/Delta456) - appium-mcp, iOS support libraries
* [@eglitise](https://github.com/eglitise) - Appium server, Inspector
* [@harsha509](https://github.com/harsha509) - appium-ios-tuntap
* [@jlipps](https://github.com/jlipps) - Appium server, Inspector
* [@kazucocoa](https://github.com/KazuCocoa) - all Appium projects
* [@laolubenson](https://github.com/laolubenson) - DotNet client
* [@mwakizaka](https://github.com/mwakizaka) - XCUITest driver
* [@mykola-mokhnach](https://github.com/mykola-mokhnach) - all Appium projects
* [@navin772](https://github.com/navin772) - appium-mcp, iOS support libraries
* [@rerorero](https://github.com/rerorero) - XCUITest/UIA2 driver
* [@saikrishna321](https://github.com/saikrishna321) - Java client
* [@srinivasantarget](https://github.com/SrinivasanTarget) - Java client
* [@tomriddly](https://github.com/tomriddly) - appium-ios-device
* [@valfirst](https://github.com/valfirst) - Java client
See [Emeritus Contributors](#emeritus-contributors) below for a list of people who formerly made
significant contributions to the project but are no longer actively committing.
### Other Contributors
Other, less formal, kinds of contribution are outlined in our [Contributing Guide](https://appium.io/docs/en/latest/contributing/).
We also very much appreciate those who spend their valuable time assisting with the [Appium forums](https://discuss.appium.io).
Current high-level forum contributors and mods include:
* [aleksei](https://discuss.appium.io/u/aleksei/summary)
* [wreed](https://discuss.appium.io/u/wreed/summary)
### Sponsorship
The Appium project welcomes the sponsorship of individuals and organizations. There are two types
of sponsorship: those related to contributions of Appium maintenance and leadership, and those
related to contributions of funds. Both are extremely important to the ongoing health of the
project. Financial sponsorship is mediated through our [OpenCollective page](https://opencollective.com/appium).
Sponsorship tiers and benefits are described below:
- **Development Partners**: The primary need of any open source project is for sustained maintenance and contributorship. Companies that officially sponsor such development with dedicated employee time are recognized as Development Partners, and receive the same benefits as the highest tier of financial sponsorship. To be considered a Development Partner, a company must devote at least 50% of a full-time employee's time to Appium maintenance. This means that the contributors designated by the company must have been appointed as "committers" in good standing of one or more core Appium repositories. (See above for a description of how to become a committer).
- **Strategic Partners**: Representing the highest tier of ongoing financial support for the project, Strategic Partners are what make our compensation scheme for contributors possible, and we thank them for their significant investment into the project! More than financial contribution, Strategic Partners help elevate Appium's position in the industry through marketing and evangelism efforts, and partner with the Appium team to help make Appium better. Along with the Development Partners, Strategic Partners have their logos displayed prominently on our website, and have the ability to link to their Appium-related products in a few relevant places in our documentation.
- **Gold, Silver, and Bronze Sponsors**: these sponsorship levels correspond to different amounts of recurring financial contribution that generously support our contributor compensation scheme. Sponsors at these levels also have the opportunity to display their logo on our website.
- **Backers**: individuals who benefit from the Appium project can also donate on a one-time or recurring basis, at any amount, and will be recognized as Backers for their contribution!
To become a sponsor at one of these levels, follow the process indicated at the [OpenCollective
page](https://opencollective.com/appium).
### Compensation Scheme
With funds received through sponsorship, the Appium project wants to incentivize contributions of
code, documentation efforts, maintenance, and project leadership. We have developed a scheme
(inspired by one developed at the [WebdriverIO](https://github.com/webdriverio/webdriverio)
project) for disbursing funds on a monthly basis to those who contribute to the project, as well as
some other "upstream" open source projects.
Each month, 15% of sponsorship funds received will be donated to upstream projects, based on the
discretion of the current TC. At this point, no attempt will be made to formalize quantitative
notions of relevance. If you manage a project upstream of Appium and would like to be considered as
part of this donation group, give us a shout!
Of the remaining 85% of sponsorship funds, 70% (roughly 60% of the original total) will go to
project Committers (i.e., those in a role of maintenance), and 30% (roughly 25% of the original
total) will go to Contributors (i.e., those making one-off or periodic contributions). The way that
Committers and Contributors are paid for their efforts differs.
For Committers, each Committer will keep a monthly time sheet of hours contributed to the project.
At the end of each month, the hours tracked from all Committers will be totalled, and then the
Committer-allocated funds will be disbursed (via OpenCollective) on a pro rata basis. Within this
scheme, Committers agree not to submit hours worked as part of their employment with a Development
Partner (since this is part of the "sponsorship" contribution of the Development Partner).
For Contributors, when they make contributions which are successfully merged into the project,
a Committer can discretionarily assign a "value tier" to the contribution. The "value tiers" and
corresponding payouts are as follows:
- XS: a trivial change (e.g. a typo change or applying of an automatically suggested security
patch). \$0.
- S: a small but useful change. \$25.
- M: a medium-small or slightly more complex change. \$50.
- L: a very valuable or sizable change. \$100.
- XL: a massive change or set of changes. \$500.
At the end of each month, Committers will total up the number of changes receiving potential
payout. If the total amount of funds allocated for Contributor payout exceeds the total amount to
be paid, then each Contributor will receive an OpenCollective link to claim their funds. If not
enough funds exist to cover all payouts, then the payout amounts will be scaled down in a pro rata
fashion.
The scope for Committer or Contributor payouts is work completed within any "core" Appium
repository (i.e., those officially maintained by the Appium team, residing within the Appium
organization on GitHub, under `https://github.com/appium`).
Some disclaimers: Payments will happen exclusively via OpenCollective. Recipients of funds are
responsible for maintaining their OpenCollective account in a fashion where funds can be disbursed,
and are responsible for any and all tax, financial, or legal consequences of receiving money in
this way. Receipt of funds from this scheme holds the Appium project and the OpenJS Foundation free
of any claim or obligation. While this document exists to clearly and publicly lay out the terms
under which payments are generally made, the TC retains the right to grant or withhold funding on
a discretionary of special basis. Basically, this scheme is run at the project's discretion, and is
not a public service. Making contributions to the project under this scheme does not obligate the
project to pay you for such work, or otherwise compensate you in any way.
### Raising Issues Related to Governance
This governance model necessarily leaves many situations unspecified. If
questions arise as to how a given situation should proceed according to the
overall goals of the project, the best thing to do is to open a GitHub issue
and ping the TC members.
### Emeritus Contributors
* [@aluedeke](https://github.com/aluedeke)
* [@astro03](https://github.com/Astro03)
* [@bayandin](https://github.com/bayandin)
* [@boneskull](https://github.com/boneskull)
* [@bootstraponline](https://github.com/bootstraponline)
* [@dandoveralba](https://github.com/dandoveralba)
* [@ddkjin](https://github.com/ddkjin)
* [@drpy](https://github.com/drpy)
* [@dylanLacey](https://github.com/DylanLacey)
* [@filmaj](https://github.com/filmaj)
* [@gempesaw](https://github.com/gempesaw)
* [@hugs](https://github.com/hugs)
* [@imurchie](https://github.com/imurchie)
* [@jamieEdge](https://github.com/JamieEdge)
* [@jdeff](https://github.com/jdeff)
* [@jonahss](https://github.com/Jonahss)
* [@maudineormsby](https://github.com/maudineormsby)
* [@moizjv](https://github.com/moizjv)
* [@peepa](https://github.com/peepa)
* [@penguinho](https://github.com/penguinho)
* [@sbonebrake](https://github.com/sbonebrake)
* [@scottdixon](https://github.com/scottdixon)
* [@sebv](https://github.com/sebv)
* [@sravanmedarapu](https://github.com/sravanmedarapu)
* [@stuartbrussell-intuit](https://github.com/stuartbrussell-intuit)
* [@tikhomirovSergey](https://github.com/TikhomirovSergey)
* [@titusfortner](https://github.com/titusfortner)
* [@vgrigoruk](https://github.com/vgrigoruk)
* [@vmaxim](https://github.com/vmaxim)
+127
View File
@@ -0,0 +1,127 @@
"use strict";
var path = require('path')
, gruntHelpers = require('./grunt-helpers.js')
, authorize = gruntHelpers.authorize
, tail = gruntHelpers.tail
, buildApp = gruntHelpers.buildApp
, buildSafariLauncherApp = gruntHelpers.buildSafariLauncherApp
, signApp = gruntHelpers.signApp
, setupAndroidBootstrap = gruntHelpers.setupAndroidBootstrap
, setupAndroidApp = gruntHelpers.setupAndroidApp
, buildAndroidBootstrap = gruntHelpers.buildAndroidBootstrap
, buildSelendroidServer = gruntHelpers.buildSelendroidServer
, buildAndroidApp = gruntHelpers.buildAndroidApp
, buildSelendroidAndroidApp = gruntHelpers.buildSelendroidAndroidApp
, fixSelendroidAndroidManifest = gruntHelpers.fixSelendroidAndroidManifest
, installAndroidApp = gruntHelpers.installAndroidApp
, generateServerDocs = gruntHelpers.generateServerDocs
, generateAppiumIo = gruntHelpers.generateAppiumIo
, setDeviceConfigVer = gruntHelpers.setDeviceConfigVer
, setBuildTime = gruntHelpers.setBuildTime
, getSampleCode = gruntHelpers.getSampleCode
, setGitRev = gruntHelpers.setGitRev
, getGitRev = require('./lib/helpers').getGitRev;
var GULP_BIN = 'node_modules/.bin/gulp';
module.exports = function (grunt) {
grunt.initConfig({
mochaTest: {
appiumutils: ['test/functional/appium/appiumutils.js']
}
, mochaTestConfig: {
options: {
timeout: 60000,
reporter: 'spec'
}
}
, maxBuffer: 2000 * 1024
, exec: {
'gulp-test-unit': GULP_BIN + ' test-unit --color',
'gulp-jshint': GULP_BIN + ' jshint --color',
'gulp-jscs': GULP_BIN + ' jscs --color',
'gulp-lint': GULP_BIN + ' lint --color'
},
});
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-exec');
grunt.registerTask('jshint', 'exec:gulp-jshint');
grunt.registerTask('jscs', 'exec:gulp-jscs');
grunt.registerTask('lint', 'exec:gulp-lint');
grunt.registerTask('test', 'exec:gulp-test-unit');
grunt.registerTask('unit', 'exec:gulp-test-unit');
grunt.registerTask('default', ['test']);
grunt.registerTask('travis', ['jshint','jscs', 'unit']);
grunt.registerTask('buildApp', "Build the test app", function (appDir, sdk) {
buildApp(appDir, this.async(), sdk);
});
grunt.registerTask('buildSafariLauncherApp', "Build the SafariLauncher app", function (sdk, xcconfig) {
buildSafariLauncherApp(this.async(), sdk, xcconfig);
});
grunt.registerTask('signApp', "Sign the test app", function (certName) {
signApp("TestApp", certName, this.async());
});
grunt.registerTask('authorize', "Authorize developer", function (insecure) {
authorize(grunt, insecure, this.async());
});
grunt.registerTask('log', "Tail appium.log", function () {
tail(grunt, path.resolve(__dirname, "appium.log"), this.async());
});
grunt.registerTask('configAndroidBootstrap', function () {
setupAndroidBootstrap(grunt, this.async());
});
grunt.registerTask('buildAndroidBootstrap', function () {
buildAndroidBootstrap(grunt, this.async());
});
grunt.registerTask('buildSelendroidServer', function () {
buildSelendroidServer(this.async());
});
grunt.registerTask('fixSelendroidAndroidManifest', function () {
var destDir = path.resolve(__dirname, "build", "selendroid");
var dstManifest = path.resolve(destDir, "AndroidManifest.xml");
fixSelendroidAndroidManifest(dstManifest, this.async());
});
grunt.registerTask('configAndroidApp', function (appName) {
setupAndroidApp(grunt, appName, this.async());
});
grunt.registerTask('buildAndroidApp', function (appName) {
buildAndroidApp(grunt, appName, this.async());
});
grunt.registerTask('buildSelendroidAndroidApp', function (appName) {
buildSelendroidAndroidApp(grunt, appName, this.async());
});
grunt.registerTask('installAndroidApp', function (appName) {
installAndroidApp(grunt, appName, this.async());
});
grunt.registerTask('docs', function () {
generateServerDocs(grunt, this.async());
});
grunt.registerTask('generateAppiumIo', function () {
generateAppiumIo(grunt, this.async());
});
grunt.registerTask('setConfigVer', function (device) {
setDeviceConfigVer(grunt, device, this.async());
});
grunt.registerTask('setBuildTime', function () {
setBuildTime(grunt, this.async());
});
grunt.registerTask('getSampleCode', function (hardcore) {
if (typeof hardcore !== "undefined" && hardcore === "hardcore") {
hardcore = true;
}
getSampleCode(grunt, hardcore, this.async());
});
grunt.registerTask('setGitRev', function (rev) {
var done = this.async();
if (typeof rev === "undefined") {
getGitRev(function (err, rev) {
if (err) throw err;
setGitRev(grunt, rev, done);
});
} else {
setGitRev(grunt, rev, done);
}
});
};
+1 -189
View File
@@ -1,192 +1,4 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright OpenJS Foundation and other contributors, https://openjsf.org/
Copyright 2012-2013 Appium Committers
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
+126 -194
View File
@@ -1,221 +1,153 @@
<p align="center">
<a href="https://appium.io/">
<img alt="Appium" src="https://raw.githubusercontent.com/appium/appium/master/packages/appium/docs/overrides/assets/images/appium-logo-horiz.png" width="500">
</a>
</p>
<p align="center">
Cross-platform test automation for native, hybrid, mobile web and desktop apps.
</p>
<div align="center">
## Appium
[![NPM version](https://badge.fury.io/js/appium.svg)](https://npmjs.org/package/appium)
[![Dependency Status](https://david-dm.org/appium/appium.svg)](https://david-dm.org/appium/appium)
[![devDependency Status](https://david-dm.org/appium/appium/dev-status.svg)](https://david-dm.org/appium/appium#info=devDependencies)
[![Monthly Downloads](https://img.shields.io/npm/dm/appium.svg)](https://npmjs.org/package/appium)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fappium%2Fappium.svg?type=shield)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fappium%2Fappium?ref=badge_shield)
[![StandWithUkraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://github.com/vshymanskyy/StandWithUkraine/)
[![CeasefireInGaza](https://img.shields.io/badge/Ceasefire_Now-%F0%9F%87%B5%F0%9F%87%B8-red?style=flat)](https://www.unrwa.org/)
[![Pull Requests](http://issuestats.com/github/appium/appium/badge/pr?style=flat)](http://issuestats.com/github/appium/appium)
[![Issues Closed](http://issuestats.com/github/appium/appium/badge/issue?style=flat)](http://issuestats.com/github/appium/appium)
</div>
[![Build Status](https://team-appium.ci.cloudbees.com/job/Appium/badge/icon)](https://team-appium.ci.cloudbees.com/job/Appium/)
***
Appium is an open source, cross-platform test automation tool for native, hybrid and mobile web apps, tested on simulators (iOS, FirefoxOS), emulators (Android), and real devices (iOS, Android, FirefoxOS).
<p align="center"><b>
<a href="https://appium.io">Documentation</a> |
<a href="https://appium.io/docs/en/latest/intro/">Get Started</a> |
<a href="https://appium.io/docs/en/latest/ecosystem/">Ecosystem</a> |
<a href="https://github.com/appium/appium/blob/master/packages/appium/CHANGELOG.md">Changelog</a> |
<a href="https://appium.io/docs/en/latest/contributing/">Contributing Guide</a> |
<a href="https://discuss.appium.io">Discussion Forum</a>
</b></p>
**Note:** we have just recently released Appium 1.0. If you already have a bunch of Appium tests, you might want to check out the [Migrating to 1.0](/docs/en/advanced-concepts/migrating-to-1-0.md) doc!
***
### Supported Platforms
Appium is an open-source automation framework that provides
[WebDriver](https://www.w3.org/TR/webdriver/)-based automation possibilities for a wide range of
different mobile, desktop and IoT platforms. Appium is modular and extensible, and supports multiple
programming languages, which means there is an entire ecosystem of related software:
* [__Drivers__](#drivers) add support for automating specific platforms
* [__Clients__](#clients) allow writing Appium tests in your programming language of choice
* [__Plugins__](#plugins) allow to further extend Appium functionality
* iOS
* Android
* FirefoxOS
## Upgrading From Older Versions
See the [platform support doc](/docs/en/appium-setup/platform-support.md) for more detailed information.
The Appium team only provides support for the most recent version of Appium. If you wish to upgrade from
an older major Appium version, please refer to the migration guides:
### Why Appium?
* [Appium v2 to v3](https://appium.io/docs/en/latest/guides/migrating-2-to-3/)
* [Appium v1 to v2](https://appium.io/docs/en/latest/guides/migrating-1-to-2/)
## Installation
Appium can be installed using `npm` (other package managers are not currently supported). Please
check the [installation docs](http://appium.io/docs/en/latest/quickstart/install/) for the
system requirements and further information.
If upgrading from Appium 1, make sure Appium 1 is fully uninstalled (`npm uninstall -g appium`).
Unexpected errors might appear if this has not been done.
```bash
npm i -g appium
```
Note that this will only install the core Appium server, which cannot automate anything on its own.
Please install [drivers](#drivers) for your target platforms in order to automate them.
## Drivers
Appium supports app automation across a variety of platforms, like iOS, Android, macOS, Windows,
and more. Each platform is supported by one or more "drivers", which know how to automate that
particular platform. You can find a full list of officially-supported and third-party drivers in
[Appium Ecosystem's Drivers page](http://appium.io/docs/en/latest/ecosystem/drivers/).
Driver management is done using [Appium's Extension command-line interface](http://appium.io/docs/en/latest/cli/extensions/):
```bash
# Install an official driver from npm (see documentation for a list of such drivers)
appium driver install <driver-name>
# Install any driver from npm
appium driver install --source=npm <driver-name>
# See documentation for installation from other sources
# List already installed drivers
appium driver list --installed
# Update a driver (it must be already installed)
# This will NOT update the major version, in order to prevent breaking changes
appium driver update <driver-name>
# Update a driver to the most recent version (may include breaking changes)
appium driver update <driver-name> --unsafe
# Uninstall a driver (it won't last forever, will it?)
appium driver uninstall <driver-name>
```
## Clients
Client libraries enable writing Appium tests in different programming languages. There are
officially-supported clients for Java, Python, Ruby, and .NET C#, as well as third-party clients
for other languages. You can find a full list of clients in
[Appium Ecosystem's Clients page](http://appium.io/docs/en/latest/ecosystem/clients/).
## Plugins
Plugins allow you to extend server functionality without changing the server code. The main
difference between drivers and plugins is that the latter must be explicitly enabled on
Appium server startup (all installed drivers are enabled by default):
```bash
appium --use-plugins=<plugin-name>
```
You can find a full list of officially-supported and third-party plugins in
[Appium Ecosystem's Plugins page](http://appium.io/docs/en/latest/ecosystem/plugins/).
Similarly to drivers, plugin management is also done using
[Appium's Extension command-line interface](http://appium.io/docs/en/latest/cli/extensions/):
```bash
# Install an official plugin from npm (see documentation for a list of such plugins)
appium plugin install <plugin-name>
# Install any plugin from npm
appium plugin install --source=npm <plugin-name>
# See documentation for installation from other sources
# List already installed plugins
appium plugin list --installed
# Update a plugin (it must be already installed)
# This will NOT update the major version, in order to prevent breaking changes
appium plugin update <plugin-name>
# Update a plugin to the most recent version (may include breaking changes)
appium plugin update <plugin-name> --unsafe
# Uninstall a plugin
appium plugin uninstall <plugin-name>
```
## Server Command Line Interface
In order to start sending commands to the Appium server, it must be running on the URL and port
where your client library expects it to listen. [Appium's command-line interface](http://appium.io/docs/en/latest/cli/server/)
is used to launch and configure the server:
```bash
# Start the server on the default host (0.0.0.0) and port (4723)
appium server
# You can also omit the 'server' subcommand
appium
# Start the server on the given host, port and use a custom base path prefix (the default prefix is '/')
appium --address 127.0.0.1 --port 9000 --base-path /wd/hub
```
Appium supports execution of parallel server processes, as well as parallel driver sessions within a
single server process. Refer the corresponding driver documentations regarding which mode is optimal
for the particular driver or whether it supports parallel sessions.
## Why Appium?
1. You usually don't have to recompile your app or modify it in any way, due to the use of standard
automation APIs on all platforms.
2. You can write tests with your favorite dev tools using any WebDriver-compatible language such as
Java, Python, Ruby and C#. There are also third party client implementations for other languages.
1. You don't have to recompile your app or modify it in any way, due
to use of standard automation APIs on all platforms.
2. You can write tests with your favorite dev tools using any [WebDriver](https://code.google.com/p/selenium/wiki/JsonWireProtocol)-compatible
language such as Java, [Objective-C](https://github.com/appium/selenium-objective-c),
JavaScript with Node.js (in [promise, callback](https://github.com/admc/wd) or [generator](https://github.com/jlipps/yiewd) flavors),
PHP, Python, [Ruby](https://github.com/appium/ruby_lib), C#, Clojure, or Perl
with the Selenium WebDriver API and language-specific client libraries.
3. You can use any testing framework.
4. Some drivers like `xcuitest` and `uiautomator2` have built-in mobile web and hybrid app support.
Within the same script, you can switch seamlessly between native app automation and webview
automation, all using the WebDriver model that's already the standard for web automation.
5. You can run your automated tests locally and in a cloud. There are multiple cloud providers that
support various Appium drivers (mostly targeting iOS and Android mobile automation).
6. [Appium Inspector](https://github.com/appium/appium-inspector) can be used to visually inspect
the page source of applications across different platforms, facilitating easier test development.
Investing in the [WebDriver](https://w3c.github.io/webdriver/webdriver-spec.html) protocol means you
are betting on a single, free, and open protocol for testing that has become a web standard. Don't
lock yourself into a proprietary stack.
Investing in the [WebDriver](https://code.google.com/p/selenium/wiki/JsonWireProtocol) protocol means you are betting on a single, free and open protocol for testing that has become a defacto standard. Don't lock yourself into a proprietary stack.
For example, if you use Apple's XCUITest library without Appium, you can only write tests using
Obj-C/Swift, and you can only run tests through Xcode. Similarly, with Google's UiAutomator or
Espresso, you can only write tests in Java/Kotlin. Appium opens up the possibility of true
cross-platform native app automation, for mobile and beyond!
If you use Apple's UIAutomation library without Appium you can only write tests
using JavaScript and you can only run tests through the Instruments application.
Similarly, with Google's UiAutomator you can only write tests in Java. Appium
opens up the possibility of true cross-platform native mobile automation. Finally!
If you are looking for a more comprehensive description of what this is all about, please read our
documentation on [How Does Appium Work?](https://appium.io/docs/en/latest/intro/appium/).
### I don't get it yet...
## Sponsors
If you're new to Appium, or want a fuller description of what this is all about, please read our [Introduction to Appium Concepts](/docs/en/about-appium/intro.md).
Appium has a [Sponsorship Program](GOVERNANCE.md#sponsorship)! If you or your company uses Appium
and wants to give back financially to the project, we use these funds to [encourage development and
contributions](GOVERNANCE.md#compensation-scheme), as well as support other open source projects we
rely on. [Become a sponsor](https://opencollective.com/appium) via our OpenCollective page.
### Requirements
### Development and Strategic Partners
Your environment needs to be setup for the particular mobile platforms that you
want to run tests on. See below for particular platform requirements.
Appium is incredibly grateful to our Development and Strategic Partners for their sustained
contribution of project development and leadership!
If you want to run Appium via an `npm install`, hack with or contribute to Appium, you will need
[node.js and npm](http://nodejs.org) 0.10 or greater (use [n](https://github.com/visionmedia/n) or
`brew install node` to install Node.js. Make sure you have not installed Node or Appium with `sudo`,
otherwise you'll run into problems). We recommend the latest stable version.
<p align="center">
<a href="https://www.browserstack.com/browserstack-appium?utm_campaigncode=701OW00000AoUTQYA3&utm_medium=partnered&utm_source=appium">
<picture>
<source srcset="packages/appium/docs/overrides/assets/images/sponsor-logo-browserstack-dark.png" media="(prefers-color-scheme: dark)"/>
<source srcset="packages/appium/docs/overrides/assets/images/sponsor-logo-browserstack-light.png" media="(prefers-color-scheme: light)"/>
<img src="packages/appium/docs/overrides/assets/images/sponsor-logo-browserstack-dark.png" width="300" alt="Browserstack"/>
</picture>
</a>
</p>
To verify that all of Appium's dependencies are met you can use `appium-doctor`.
Run `appium-doctor` and supply the `--ios` or `--android` flags to verify that all
of the dependencies are set up correctly. If running from source, you may have to use
`./bin/appium-doctor.js` or `node bin/appium-doctor.js`.
<p align="center">
<a href="https://www.testmuai.com">
<picture>
<source srcset="packages/appium/docs/overrides/assets/images/sponsor-logo-testmuai-dark.png" media="(prefers-color-scheme: dark)"/>
<source srcset="packages/appium/docs/overrides/assets/images/sponsor-logo-testmuai-light.png" media="(prefers-color-scheme: light)"/>
<img src="packages/appium/docs/overrides/assets/images/sponsor-logo-testmuai-dark.png" width="300" alt="TestMu AI (formerly LambdaTest)"/>
</picture>
</a>
</p>
You also need to download the Appium client for your language so you can write tests. The Appium clients are simple extensions to the WebDriver clients. You can see the list of clients and links to download instructions at the [Appium clients list](/docs/en/about-appium/appium-clients.md).
### Other Sponsors
#### iOS Requirements
A full list of sponsors is available at our [Sponsors page](https://appium.io/docs/en/latest/sponsors/).
* Mac OS X 10.7 or higher, 10.9.2 recommended
* XCode &gt;= 4.6.3, 5.1.1 recommended
* Apple Developer Tools (iPhone simulator SDK, command line tools)
* [Ensure you read our documentation on setting yourself up for iOS testing!](/docs/en/appium-setup/running-on-osx.md)
## License
#### Android Requirements
[Apache-2.0](./LICENSE)
* [Android SDK](http://developer.android.com) API &gt;= 17 (Additional features require 18/19)
* Appium supports Android on OS X, Linux and Windows. Make sure you follow the
directions for setting up your environment properly for testing on different OSes:
* [linux](/docs/en/appium-setup/running-on-linux.md)
* [osx](/docs/en/appium-setup/running-on-osx.md)
* [windows](/docs/en/appium-setup/running-on-windows.md)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fappium%2Fappium.svg?type=large)](https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fappium%2Fappium?ref=badge_large)
#### FirefoxOS Requirements
`@appium/logger` package is under [ISC](./packages/logger/LICENSE) License.
* [Firefox OS Simulator](https://developer.mozilla.org/en/docs/Tools/Firefox_OS_Simulator)
### Quick Start
Kick up an Appium server, and then run a test written in your favorite [WebDriver](https://code.google.com/p/selenium/wiki/JsonWireProtocol)-compatible language!
You can run an Appium server using node.js or using the application, see below.
#### Using Node.js
```
$ npm install -g appium
$ appium &
```
#### Using the App
* [Download the Appium app](https://github.com/appium/appium/releases)
* Run it!
### Writing Tests for Appium
The main guide for getting started writing and running tests is [the running tests](/docs/en/writing-running-appium/running-tests.md) doc, which includes explanations for iOS, Android, and Android older devices. If you're interested in testing on physical hardware, you might be interested in our [real devices guide](/docs/en/appium-setup/real-devices.md).
Essentially, we support a subset of the [Selenium WebDriver JSON Wire Protocol](https://code.google.com/p/selenium/wiki/JsonWireProtocol), and extend it so that you can specify mobile-targeted [desired capabilities](/docs/en/writing-running-appium/caps.md) to run your test through Appium.
You find elements by using a subset of WebDriver's element-finding strategies.
See [finding elements](/docs/en/writing-running-appium/finding-elements.md) for detailed information. We also have several extensions to the JSON Wire Protocol for [automating mobile gestures](/docs/en/writing-running-appium/touch-actions.md) like tap, flick, and swipe.
You can also automate web views in hybrid apps! See the [hybrid app guide](/docs/en/advanced-concepts/hybrid.md)
This repository contains [many examples of tests in a variety of different languages](https://github.com/appium/sample-code)!
For the full list of Appium doc pages, visit [this directory](/docs/en/).
### How It Works
Appium drives various native automation frameworks and provides an API based on
Selenium's [WebDriver JSON wire protocol](https://code.google.com/p/selenium/wiki/JsonWireProtocol).
Appium drives Apple's UIAutomation library for iOS support, which is based on
[Dan Cuellar's](http://github.com/penguinho) work on iOS Auto.
Android support uses the UiAutomator framework for newer platforms and
[Selendroid](http://github.com/DominikDary/selendroid) for older Android platforms.
FirefoxOS support leverages [Marionette](https://developer.mozilla.org/en-US/docs/Marionette),
an automation driver that is compatible with WebDriver and is used to automate
Gecko-based platforms.
### Contributing
Please take a look at our [contribution documentation](CONTRIBUTING.md)
for instructions on how to build, test and run Appium from source.
### Project Credits & Inspiration
[Credits](/docs/en/contributing-to-appium/credits.md)
### Mailing List
Announcements and debates often take place on the [Discussion Group](https://discuss.appium.io), be sure to sign up!
### Troubleshooting
We put together a [troubleshooting guide](/docs/en/appium-setup/troubleshooting.md).
Please have a look here first if you run into any problems. It contains instructions for checking a lot
of common errors and how to get in touch with the community if you're stumped.
### Using Robots
Using Appium with [Tapster](https://github.com/hugs/tapsterbot) and other robots is possible,
check out the [Appium Robots](https://github.com/appium/robots) project!
-30
View File
@@ -1,30 +0,0 @@
# Roadmap
This is not a traditional roadmap. We don't have a typical product team with a typical product
manager. The fact that the items below exist on a roadmap is no indication that we will ever have
the opportunity to work on them. Instead this is more like a wishlist of outcomes that the project
thinks would be valuable. If and when we get additional contributions of development work, this is
a set of items that would be great for someone to work on! Ideally, interested devs would find
something on this list and own it from start to finish! Let anyone on the project know if you're
interested and we can help get you going.
### Core projects
- **WebDriver BiDi support in the Appium server**: the WebDriver BiDi spec is underway, which details a different method for communicating with drivers. We should implement handling for these methods in our server so that Appium drivers can take advantage of the BiDi spec without additional work on their part.
- **Redevelop automatically generated command docs**: due to changing TypeDoc support and the departure of one of our team, we were forced to remove our TypeDoc-based automatic docs generation tool. It would be nice to bring this back in a more maintainable form!
### Driver/platform-specific projects
- **Better maintenance for our Android drivers**: we're looking for Android specialists to help maintain our Android drivers (UiAutomator2 and Espresso)
- **Better maintenance for our iOS driver**: we're looking for iOS specialists to help maintain our XCUITest driver
- **Better maintenance for [appium-ios-device](https://github.com/appium/appium-ios-device)**: this project is using outdated approaches and libraries. If it could be improved it would have a big impact on the performance of the XCUITest driver
### Client library projects
- **Selenium compatibility client updates**: we'd like to rearchitect our flagship Appium clients to extend rather than wrap Selenium clients, reducing the overall surface area of the Appium clients and making them work more closely with existing Selenium client functionality.
### Appium Inspector projects
- **Full support for web inspection**: currently the Appium Inspector has poor to no support for inspecing web pages (either mobile browsers or web content embedded in webviews). It's a common requirement to inspect web elements as part of writing Appium tests, and at the present time users are required to leave the Inspector and open up a browser's devtools.
- **Record/Playback**: we have a basic record-to-code feature already. It would be nice to be able to save recorded steps and play them back with a little player/editor.
- **Support for more platforms**: currently there is a fair bit of specialized handling for iOS and Android in the Appium inspector. Other platforms either work poorly or not at all with the Inspector. It would be great to establish a way for drivers to report all the information about how they work to the Inspector, so it can support any platform without needing special-cased code for it.
- **Locator analysis and comparison**: it would be nice for users to get more information about the relative suitability of using different locators to find elements, as poor locator performance is a leading cause of Appium test instability.
- **Dark theme**: for true hackers!
- **Export/import of saved gestures**: it's currently not possible to port your saved gestures to other instances of the Inspector (i.e., to share with team members).
- **Bulk export/import saved sessions**: would be nice to take your sessions and capabilities with you or to share with colleagues.
-3
View File
@@ -1,3 +0,0 @@
# Sponsors & Backers
Please check [Sponsors & Backers](https://appium.io/docs/en/latest/sponsors/)
Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+109
View File
@@ -0,0 +1,109 @@
#!/usr/bin/env node
"use strict";
var IOSChecker = require('../lib/doctor/ios.js').IOSChecker
, AndroidChecker = require('../lib/doctor/android.js').AndroidChecker
, DevChecker = require('../lib/doctor/dev.js').DevChecker
, common = require("../lib/doctor/common.js")
, eol = require('os').EOL
, async = require('async')
, isMac = process.platform === 'darwin';
// , isWindows = process.platform === 'win32';
var argv = process.argv
, doAndroid = argv.indexOf('--android') > -1
, doIOS = argv.indexOf('--ios') > -1
, doDev = argv.indexOf('--dev') > -1
// , verbose = argv.indexOf('--verbose') > -1
, broadcast = argv.indexOf('--port') > -1
, port = null;
if (broadcast) {
port = argv[argv.indexOf("--port") + 1];
}
if (!doIOS && !doAndroid) {
doIOS = isMac;
doAndroid = true;
}
var log = new common.Log(port);
var runiOSChecks = function (cb) {
if (doIOS) {
if (!isMac) {
log.fail("iOS Checks cannot be run on Windows.");
log.exitDoctor();
}
var iosChecker = new IOSChecker(log);
log.comment("Running iOS Checks");
iosChecker.runAllChecks(function (err) {
if (!err) {
log.pass("iOS Checks were successful." + eol);
cb();
} else {
log.exitDoctor();
}
});
} else {
cb();
}
};
var runAndroidChecks = function (cb) {
if (doAndroid) {
var androidChecker = new AndroidChecker(log);
log.comment("Running Android Checks");
androidChecker.runAllChecks(function (err) {
if (!err) {
log.pass("Android Checks were successful." + eol);
cb();
} else {
log.exitDoctor();
}
});
} else {
cb();
}
};
var runDevChecks = function (cb) {
if (doDev) {
var devChecker = new DevChecker(log);
log.comment("Running Dev Checks");
devChecker.runAllChecks(function (err) {
if (!err) {
log.pass("Dev Checks were successful." + eol);
cb();
} else {
log.exitDoctor();
}
});
} else {
cb();
}
};
if (require.main === module) {
var mainMethod = function () {
async.series([
runiOSChecks,
runAndroidChecks,
runDevChecks
], function (err) {
if (!err) {
log.pass("All Checks were successful");
log.stopBroadcast();
} else {
log.exitDoctor();
}
});
};
if (log.broadcast) {
log.startBroadcast(mainMethod);
} else {
mainMethod();
}
}
Executable
+58
View File
@@ -0,0 +1,58 @@
#!/usr/bin/env node
"use strict";
var net = require('net')
, repl = require('repl')
, logFactory = require('../lib/server/logger.js')
, parser = require('../lib/server/parser.js');
require('colors');
var args = parser().parseArgs();
logFactory.init(args);
var appium = require('../lib/server/main.js');
var startRepl = function () {
var help = function () {
console.log("\nWelcome to the Appium CLI".cyan);
console.log(" - Access the appium object via the object: 'appium'".grey);
console.log(" - appium.run is the function to start the server".grey);
console.log(" - args is the default params data structure".grey);
console.log(" - set args.app then run appium.run(args);\n".grey);
return 'Thanks for asking';
};
help();
var r = repl.start('(appium): ');
r.context.appium = appium;
r.context.parser = parser();
r.context.help = help;
r.context.args = {
app: '/path/to/test/app'
, udid: null
, address: '127.0.0.1'
, port: 4723
};
var connections = 0;
var server = net.createServer(function (socket) {
connections += 1;
socket.setTimeout(5 * 60 * 1000, function () {
socket.destroy();
});
repl.start("(appium): ", socket);
}).listen(process.platform === "win32" ? "\\\\.\\pipe\\node-repl-sock-" + process.pid : "/tmp/node-repl-sock-" + process.pid);
r.on('exit', function () {
server.close();
process.exit();
});
};
if (process.argv[2] && process.argv[2].trim() === "--shell") {
startRepl();
} else {
appium.run(args, function () { /* console.log('Rock and roll.'.grey); */ });
}
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env node
"use strict";
var authorize = require('../grunt-helpers.js').authorize;
var gruntMock = {
fatal: function (msg) {
console.error(msg);
process.exit(0);
},
log: {
writeln: function (msg) {
console.log(msg);
}
}
};
if (require.main === module) {
authorize(gruntMock, false, function (err) {
if (err) throw err;
console.log("Authorization successful");
});
}
+60
View File
@@ -0,0 +1,60 @@
#!/usr/bin/env node
/*
* Small tool, launching and monitoring ios-web-kit-proxy, and relauching
* on predefined errors.
*
* Usage:
* ./bin/ios-webkit-debug-proxy-launcher.js [args]
* args: ios-webkit-debug-proxy args (they will be passed over)
*
* Example:
* ./bin/ios-webkit-debug-proxy-launcher.js -c <UDID>:27753 -d
*
* Note:
* For iOS8.1 try this first:
* brew install --HEAD ideviceinstaller
*/
"use strict";
var spawn = require('child_process').spawn,
_ = require('underscore');
var args = process.argv.slice(2);
var RESTART_ON_MESSAGES = [
'Invalid message _rpc_applicationUpdated',
'Invalid message _rpc_applicationSentListing'];
var PROXY_CMD = 'ios_webkit_debug_proxy';
function startProxy() {
console.log('RUNNING:', PROXY_CMD, args.join(' '));
var proxy = spawn(PROXY_CMD, args);
proxy.stdout.on('data', function (data) {
console.log('stdout: ' + data);
});
proxy.stderr.on('data', function (data) {
console.log('stderr: ' + data);
var restartMessage = _(RESTART_ON_MESSAGES).find(function (message) {
return ('' + data).indexOf(message) >= 0;
});
if (restartMessage) {
console.log('Detected error message:', restartMessage);
console.log('Killing proxy!');
proxy.kill('SIGTERM');
process.nextTick(startProxy);
}
});
proxy.on('close', function (code) {
console.log('child process exited with code ' + code);
});
}
startProxy();
Executable
+76
View File
@@ -0,0 +1,76 @@
#!/bin/bash
ACTION='usage'
ALL_PACKAGES=(
'appium-atoms'
'appium-instruments'
'appium-uiauto'
'appium-adb'
)
PACKAGES=()
for i in "$@"
do
case $i in
-l|--link)
ACTION='link'
shift
;;
-u|--unlink)
ACTION='unlink'
shift
;;
-m|--master)
MASTER=true
shift
;;
*)
PACKAGES+=($i)
shift
;;
esac
done
if [[ ${#PACKAGES[*]} == 0 ]]; then
PACKAGES=("${ALL_PACKAGES[@]}")
fi
function npmlink {
git submodule update --init submodules/$1
pushd submodules/$1
if [[ $MASTER ]]; then
git checkout master
fi
npm link
popd
npm link $1
}
if [[ $ACTION == 'usage' ]]; then
echo 'Usage:'
echo ' link all: dev.sh --link [--master]'
echo ' unlink all: dev.sh --unlink'
echo ' link specific packages: dev.sh --link [--master] <pkg1> <pkg2>...'
echo ' unlink specific packages: dev.sh --unlink <pkg1> <pkg2>...'
echo 'Short verion:'
echo ' link all: dev.sh -l [-m]'
echo ' unlink all: dev.sh -u'
echo ' link specific packages: dev.sh -l [-m] <pkg1> <pkg2>...'
echo ' unlink specific packages: dev.sh -u <pkg1> <pkg2>...'
fi
if [[ $ACTION == 'link' ]]; then
for i in "${PACKAGES[@]}"
do
npmlink $i
done
fi
if [[ $ACTION == 'unlink' ]]; then
for i in "${PACKAGES[@]}"
do
npm unlink $i
done
fi
Executable
+58
View File
@@ -0,0 +1,58 @@
#!/bin/bash
set +e
if [[ "$1" = "" ]]; then
branch="master"
else
branch="$1"
fi
node --version | grep "v0.12" >/dev/null
if [ $? -gt 0 ]; then
echo "You need to publish Appium using Node 0.12.x, not $(node --version)"
exit 1;
else
echo "Node version OK"
fi
git remote | grep "upstream" >/dev/null
if [ $? -gt 0 ]; then
echo "You need to have an 'upstream' remote to pull from / push tags to"
exit 1
else
echo "Git remote OK"
fi
git status | grep -E "nothing to commit.+working directory clean" >/dev/null
if [ $? -gt 0 ]; then
echo "Working directory isn't clean, commit/clean then publish"
exit 1
else
echo "Working directory clean"
fi
git status | grep "Your branch is ahead" >/dev/null
if [ $? -eq 0 ]; then
echo "Your branch isn't in sync with origin"
exit 1
else
echo "In sync with origin"
fi
set -e
echo "Getting latest from upstream:$branch"
git pull upstream $branch
echo "Resetting"
./reset.sh --no-npmlink --hardcore --chromedriver-install-all --chromedriver-version 2.15
rm -rf node_modules npm-shrinkwrap.json
npm install --production && npm shrinkwrap
version=$(cat package.json | $(npm bin)/underscore extract version | sed 's/\"//g')
echo "Clearing npm cache"
npm cache clear appium
echo "Publishing on npm"
if [[ "$version" =~ "beta" ]]; then
npm publish --tag beta
else
npm publish
fi
echo "Git tagging"
git tag -a "v$version" -m "tag appium@$version for npm publish"
git push --tags upstream $branch
+15
View File
@@ -0,0 +1,15 @@
param([string]$mochaArgs = "", [switch]$android, [switch]$selendroid)
$all = !($android -or $selendroid)
$appiumMocha="mocha --recursive -t 90000 -R spec $mochaArgs "
if ($android -or $all){
"RUNNING ANDROID TESTS"
"---------------------"
Invoke-Expression ($appiumMocha + "test\functional\android test\functional\common -g '@skip-android-all' -i")
}
if ($selendroid -or $all){
"RUNNING SELENDROID TESTS"
"------------------------"
Invoke-Expression ($appiumMocha + "test\functional\selendroid -g '@skip-selendroid-all' -i")
}
Executable
+165
View File
@@ -0,0 +1,165 @@
#!/bin/sh
set -e
mocha_args=""
ios_only=false
ios6_only=false
ios7_only=false
ios71_only=false
ios8_only=false
ios81_only=false
ios82_only=false
ios83_only=false
ios84_only=false
android_only=false
android_chrome=false
selendroid_only=false
gappium_only=false
real_device=false
all_tests=true
for arg in "$@"; do
if [ "$arg" = "--ios" ]; then
ios_only=true
all_tests=false
elif [ "$arg" = "--android" ]; then
android_only=true
all_tests=false
elif [ "$arg" = "--android-chrome" ]; then
android_chrome=true
all_tests=false
elif [ "$arg" = "--selendroid" ]; then
selendroid_only=true
all_tests=false
elif [ "$arg" = "--gappium" ]; then
gappium_only=true
all_tests=false
elif [ "$arg" = "--ios6" ]; then
ios6_only=true
all_tests=false
elif [ "$arg" = "--ios7" ]; then
ios7_only=true
all_tests=false
elif [ "$arg" = "--ios71" ]; then
ios71_only=true
all_tests=false
elif [ "$arg" = "--ios8" ]; then
ios8_only=true
all_tests=false
elif [ "$arg" = "--ios81" ]; then
ios81_only=true
all_tests=false
elif [ "$arg" = "--ios82" ]; then
ios82_only=true
all_tests=false
elif [ "$arg" = "--ios83" ]; then
ios83_only=true
all_tests=false
elif [ "$arg" = "--ios84" ]; then
ios84_only=true
all_tests=false
elif [ "$arg" = "--real-device" ]; then
real_device=true
elif [ "$arg" =~ " " ]; then
mocha_args="$mocha_args \"$arg\""
else
mocha_args="$mocha_args $arg"
fi
done
appium_mocha="./node_modules/.bin/mocha --recursive $mocha_args"
run_ios_tests() {
echo "RUNNING IOS $1 TESTS"
echo "---------------------"
DEVICE=$2 time $appium_mocha -g $3 -i \
test/functional/common \
test/functional/ios
}
if $ios6_only || $ios_only || $all_tests; then
run_ios_tests "6.1" "ios6" "@skip-ios6|@skip-ios-all"
fi
if $ios7_only || $all_tests; then
run_ios_tests "7.0" "ios7" "@skip-ios7|@skip-ios-all"
fi
if $ios71_only || $all_tests; then
run_ios_tests "7.1" "ios71" "@skip-ios71|@skip-ios7|@skip-ios-all|@skip-ios7up"
fi
if $ios8_only || $all_tests; then
run_ios_tests "8.0" "ios8" "@skip-ios8|@skip-ios-all|@skip-ios7up"
fi
if $ios81_only || $all_tests; then
run_ios_tests "8.1" "ios81" "@skip-ios81|@skip-ios8|@skip-ios-all|@skip-ios7up"
fi
if $ios82_only || $all_tests; then
run_ios_tests "8.2" "ios82" "@skip-ios82|@skip-ios81|@skip-ios8|@skip-ios-all|@skip-ios7up"
fi
if $ios83_only || $all_tests; then
run_ios_tests "8.3" "ios83" "@skip-ios83|@skip-ios82|@skip-ios81|@skip-ios8|@skip-ios-all|@skip-ios7up"
fi
if $ios84_only || $all_tests; then
run_ios_tests "8.4" "ios84" "@skip-ios84|@skip-ios82|@skip-ios81|@skip-ios8|@skip-ios-all|@skip-ios7up"
fi
if $android_only || $all_tests; then
echo "RUNNING ANDROID TESTS"
echo "---------------------"
if $real_device; then
DEVICE=android REAL_DEVICE=true time $appium_mocha \
-g '@skip-android-all|@android-arm-only|@skip-real-device' -i \
test/functional/common \
test/functional/android
else
DEVICE=android time $appium_mocha \
-g '@skip-android-all|@android-arm-only' -i \
test/functional/common \
test/functional/android
fi
fi
if $android_chrome; then
echo "RUNNING ANDROID CHROME TESTS"
echo "---------------------"
if $real_device; then
DEVICE=android REAL_DEVICE=true time $appium_mocha \
-g '@skip-chrome|@skip-android-all' -i \
test/functional/android/chrome
else
DEVICE=android time $appium_mocha \
-g '@skip-chrome|@skip-android-all' -i \
test/functional/android/chrome
fi
fi
if $selendroid_only || $all_tests; then
echo "RUNNING SELENDROID TESTS"
echo "---------------------"
DEVICE=selendroid time $appium_mocha -g '@skip-selendroid-all' -i \
test/functional/selendroid
fi
if $gappium_only || $all_tests; then
echo "RUNNING GAPPIUM TESTS"
echo "---------------------"
DEVICE=ios81 time $appium_mocha test/functional/gappium
# disabling, ios6 not working yet xcode 6
#DEVICE=ios6 time $appium_mocha test/functional/gappium
echo "Start the android emulator api 19 and press Enter."
read
DEVICE=android time $appium_mocha test/functional/gappium
# disabling gappium test, see https://github.com/selendroid/selendroid/issues/658
#echo "Start the android emulator api 16 and press Enter."
#read
#DEVICE=selendroid time $appium_mocha test/functional/gappium
fi
Executable
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
{ set -e; } 2>/dev/null
{ set -x; } 2>/dev/null
# Loading appium-ci-gulper submodule
export APPIUM_ROOT="$(pwd)"
git submodule update --remote --init submodules/appium-ci-gulper
pushd submodules/appium-ci-gulper
git pull origin master
{ set +x; } 2>/dev/null
# Running appium-ci-gulper submodule
# This sets up node etc...
source ./setup
{ set -x; } 2>/dev/null
+9 -4
View File
@@ -1,6 +1,11 @@
# Docs moved
# docs
The old Appium 1.x docs used to be in this directory. Now, they are available only on the [1.x
branch](https://github.com/appium/appium/tree/1.x/docs).
##doc site
Current Appium docs are located in [packages/appium/docs](../packages/appium/docs) in this repo.
Formatted doc is [here](http://appium.io/documentation.html?lang=en).
##doc translation
At the moment we are focusing on improving the english documentation. When it
is done we are planning to setup proper i18n l10n processes so that it is
easier for people to help in translating the documentation.
+140
View File
@@ -0,0 +1,140 @@
## Appium
[![NPM version](https://badge.fury.io/js/appium.png)](https://npmjs.org/package/appium)
[![Dependency Status](https://david-dm.org/appium/appium.svg)](https://david-dm.org/appium/appium)
[![devDependency Status](https://david-dm.org/appium/appium/dev-status.svg)](https://david-dm.org/appium/appium#info=devDependencies)
[![Build Status](https://team-appium.ci.cloudbees.com/job/appium-master/badge/icon)](https://team-appium.ci.cloudbees.com/job/appium-master/)
Appium 是一个开源的,跨平台的自动化测试工具。
它支持模拟器(iOS,FirefoxOS,Android)和真机(iOS, Android, FirefoxOS)上的原生应用,混合应用和移动 web 应用。
**Note:** 我们最近发布了Appium 1.0。如果已有 Appium 测试脚本,你可以参考这个文件[迁移到 1.0](advanced-concepts/migrating-to-1-0.cn.md)!
### 支持平台
* iOS
* Android
* FirefoxOS
### 详细请参见[文档网站](http://appium.io/documentation.html?lang=zh)
### 为什么选择appium ?
1. 因为 Appium 在所有平台上都使用了标准的自动化接口,
所以你不需要以重新编译或者修改你的 app。
2. 你可以用你喜欢的开发工具,使用任何 [WebDriver](https://code.google.com/p/selenium/wiki/JsonWireProtocol) 兼容的语言来编写测试用例。比如
Java, [Objective-C](https://github.com/appium/selenium-objective-c),
JavaScript with Node.js (in both [callback](https://github.com/admc/wd) and [yield-based](https://github.com/jlipps/yiewd) flavours),
PHP, Python, [Ruby](https://github.com/appium/ruby_lib), C#, Clojure, 或者 Perl。
可以使用标准的Selenium WebDriver API和特定语言的客户端库。
3. 你可以使用任何测试框架。
投资 [WebDriver](https://code.google.com/p/selenium/wiki/JsonWireProtocol) 意味着你可以押宝在一个已经成为标准的独立,自由和开放的协议。你不会被任何专利限制。
如果没有 Appium,你就只能用 Javascript 来写 Apple 的 UIAutomation 脚本,并且只能通过Instruments 应用来运行你的测试。同样的,在 Google 的UiAutomator体系下,你只能用 Java 写你的测试案例。Appium 最终开启了跨平台原生移动自动化的可能。
### 我还是不太明白……
如果你第一次接触 Appium 或者想要一个完整的描述,请通读我们的 [Introduction to Appium Concepts](about-appium/intro.cn.md)。
### 依赖
为了运行测试,针对不同的移动平台,你需要配置下环境,下面列出相关的依赖平台的需求。
如果你想通过 `npm install` 安装的 appium 来运行 Appium 或者研究 Appium 或者为 Appium 贡献力量。你需要安装 [node.js 和 npm](http://nodejs.org) 0.10 或者更高版本 (使用 [n](https://github.com/visionmedia/n)或者`brew install node`来安装 Nodejs,确保安装过程中,你没有使用任何 sudo,否则你会遇到很多问题)。我们推荐最新的稳定版本。
你可以使用 `appium-doctor` 来验证 Appium 的所有依赖。运行 `appium-doctor`,然后提供 `--ios` 或者 `--android` 参数来验证两个平台的依赖是否配置正确。如果从源代码运行,你可以使用 `bin/appium-doctor.js` 或者 `node bin/appium-doctor.js`
#### iOS 需求
* Mac OS X 10.7 或者更高,推荐 10.9.2
* XCode &gt;= 4.6.3,推荐 5.1.1
* Apple Developer Tools (iPhone simulator SDK, command line tools)
* [确保你已经读了我们写的如何配置 iOS 测试环境的文档](appium-setup/running-on-osx.cn.md)
#### Android 需求
* [Android SDK](http://developer.android.com) API &gt;= 17 (额外的特性需要 18/19)
* Appium 支持OS X,Linux,Windows 上的 Android,确保你是按照如下文档的指示来配置不同的测试环境的。
* [linux](appium-setup/running-on-linux.cn.md)
* [osx](appium-setup/running-on-osx.cn.md)
* [windows](appium-setup/running-on-windows.cn.md)
#### FirefoxOS 需求
* [Firefox OS Simulator](https://developer.mozilla.org/en/docs/Tools/Firefox_OS_Simulator)
### 快速开始
启动 Appium server,并运行用你喜欢的 [WebDriver](https://code.google.com/p/selenium/wiki/JsonWireProtocol) 兼容的语言编写的测试用例。
你可以用 node.js 或者下面的应用程序来运行 Appium
#### 使用 Node.js
```center
$ npm install -g appium
$ appium &
```
#### 使用 app
* [下载 Appium app](https://github.com/appium/appium/releases)
* 运行它!
### 为Appium编写测试
如何开始写测试用例,运行测试用例,可以看[the running tests](writing-running-appium/running-tests.cn.md),这个文档描述了iOS,Android 和老版本的 Android 机器的情况。如果你想在实体机上运行测试的话,
你可能会对[真机指南](appium-setup/real-devices.cn.md)感兴趣。
我们支持 [Selenium WebDriver JSON Wire Protocol](https://github.com/appium/appium/wiki/JSON-Wire-Protocol:-Supported-Methods) 的一个子集,而且在此之上扩展了移动平台相关的特性。所以你可以
指定特定移动平台[desired capabilities](writing-running-appium/caps.cn.md) 来运行你的测试。
你可以通过 [WebDriver](https://code.google.com/p/selenium/wiki/JsonWireProtocol) 元素定位策略的子集来定位元素。更多信息请参考 [finding elements](writing-running-appium/finding-elements.cn.md)
为了支持移动手势[automating mobile gestures](writing-running-appium/touch-actions.cn.md),比如
tap,flick 和 swipe,我们扩展了JSON Wire Protocolor。
你也可以对混合应用中的webview进行自动化 [hybrid app guide](advanced-concepts/hybrid.cn.md)
该代码库有 [很多不同语言的测试例子](https://github.com/appium/sample-code)!
### 工作原理
Appium 可以驱动多种原生自动化框架,同时也提供基于 Selenium 的 [WebDriver JSON wire protocol](https://code.google.com/p/selenium/wiki/JsonWireProtocol) api。
基于[Dan Cuellar's](http://github.com/penguinho) 在 iOS 自动化上的成果,Appium 通过驱动 Apple 的 UIAutomation 库来提供 iOS 支持。
而在新版本的 Android 上,我们使用 Uiautomator 框架,老版本的 Android,则使用了
[Selendroid](http://github.com/DominikDary/selendroid)
FirefoxOS 的支持依赖一个基于 Gecko 平台并且兼容 WebDriver 的自动化驱动[Marionette](https://developer.mozilla.org/en-US/docs/Marionette)。
### 如何贡献代码
可以看下我们的文档 [contribution documentation](../../CONTRIBUTING.md)
以了解如何从源代码中进行编译,测试和运行
## 其他项目的授权和灵感来源
[Credits](contributing-to-appium/credits.cn.md)
### 邮件列表
声明和公告经常放到讨论组 [Discussion Group](https://groups.google.com/d/forum/appium-discuss), 需要注册
### 问题定位
我们增加了一个 [问题定位指南](appium-setup/troubleshooting.cn.md)。
如果你遇到一些问题,请看下这个问的那个。它包含了一些常见的错误说明,以及在无法解决的情况如何和社区联系。
### 使用Robots扩展
可以使用 appium 的一些 robots 扩展。或者其他的 robots。想了解更多可以看看 [Appium Robots](https://github.com/appium/robots)
### 翻译工作
文档翻译工作由[testerhome](http://testerhome.com)在推动, 我们会不断补充更多的文档和测试用例.
欢迎对 Appium 感兴趣的同学加入我们, 为开源社区贡献中国人的力量.
+19
View File
@@ -0,0 +1,19 @@
## 客户端类库列表及Appium服务端支持
这些类库封装了标准Selenium客户端类库,为用户提供所有常见的[JSON](https://code.google.com/p/selenium/wiki/JsonWireProtocol) 格式selenium命令以及额外的移动设备控制相关的命令,如多点**触控手势**和**屏幕朝向**。
Appium客户端类库实现了[Mobile JSON Wire Protocol](https://code.google.com/p/selenium/source/browse/spec-draft.md?repo=mobile)(一个标准协议的官方扩展草稿)和[W3C Webdriver spec](https://dvcs.w3.org/hg/webdriver/raw-file/default/webdriver-spec.html)(一个传输不可预知的自动化协议,该协议定义了MultiAction 接口)的元素。
Appium 服务端定义了官方协议的扩展,为Appium 用户提供了方便的接口来执行各种设备动作,例如在测试过程中安装/卸载app。这就是为什么我们需要Appium 特定的客户端,而不是通用的Selenium 客户端。当然,Appium 客户端类库只是增加了一些功能,而实际上这些功能就是简单的扩展了Selenium 客户端,所以他们仍然可以用来运行通用的selenium会话。
语言/框架 | Github版本库以及安装指南 |
----- | ----- |
Ruby | [https://github.com/appium/ruby_lib](https://github.com/appium/ruby_lib)
Python | [https://github.com/appium/python-client](https://github.com/appium/python-client)
Java | [https://github.com/appium/java-client](https://github.com/appium/java-client)
JavaScript (Node.js) | [https://github.com/admc/wd](https://github.com/admc/wd)
Objective C | [https://github.com/appium/selenium-objective-c](https://github.com/appium/selenium-objective-c)
PHP | [https://github.com/appium/php-client](https://github.com/appium/php-client)
C# (.NET) | [https://github.com/appium/appium-dotnet-driver](https://github.com/appium/appium-dotnet-driver)
RobotFramework | [https://github.com/jollychang/robotframework-appiumlibrary](https://github.com/jollychang/robotframework-appiumlibrary)
+64
View File
@@ -0,0 +1,64 @@
# Appium 介绍
Appium 是一个自动化测试开源工具,支持 iOS 平台和 Android 平台上的原生应用,web 应用和混合应用。
所谓的“移动原生应用”是指那些用 iOS 或者 Android SDK 写的应用。所谓的“移动 web 应用”是指使用移动浏览器访问的应用(Appium 支持 iOS 上的 Safari 和 Android 上的 Chrome)。所谓的“混合应用”是指原生代码封装网页视图——原生代码和 web 内容交互。比如,像 [Phonegap](http://phonegap.com/),可以帮助开发者使用网页技术开发应用,然后用原生代码封装,这些就是混合应用。
重要的是,Appium 是一个跨平台的工具:它允许测试人员在不同的平台(iOS,Android)使用同一套API来写自动化测试脚本,这样大大增加了 iOS 和 Android 测试套件间代码的复用性。
想知道 Appium 如何支持平台,版本和自动化形态的详细信息,请参见[platform support doc](/docs/cn/appium-setup/platform-support.cn.md)。
## Appium 的理念
为了满足移动自动化需求,Appium 遵循着一种哲学,重点体现于以下4个需求:
1. 你无需为了自动化,而重新编译或者修改你的应用。
2. 你不必局限于某种语言或者框架来写和运行测试脚本。
3. 一个移动自动化的框架不应该在接口上重复造轮子。(移动自动化的接口应该统一)
4. 无论是精神上,还是名义上,都必须开源。
## Appium 设计
那么 Appium 架构是如何实现这个哲学呢?为了满足第一条,Appium 真正的工作引擎其实是第三方自动化框架。这样,我们就不需在你的应用里植入 Appium 相关或者第三方的代码。这意味着你测试使用的应用与最终发布的应用并无二致。我们使用以下的第三方框架:
* iOS: 苹果的 [UIAutomation](https://developer.apple.com/library/ios/documentation/DeveloperTools/Reference/UIAutomationRef)
* Android 4.2+: Google's [UiAutomator](http://developer.android.com/tools/help/uiautomator/index.html)
* Android 2.3+: Google's [Instrumentation](http://developer.android.com/reference/android/app/Instrumentation.html). (Instrumentation由单独的项目[Selendroid](http://selendroid.io)提供支持 )
为了满足第二点,我们把这些第三方框架封装成一套 API,[WebDriver](http://docs.seleniumhq.org/projects/webdriver/) API.WebDriver(也就是 "Selenium WebDriver") 指定了客户端到服务端的协议。
(参见 [JSON Wire Protocol](https://code.google.com/p/selenium/wiki/JsonWireProtocol))。使用这种客户端-服务端的架构,我们可以使用任何语言来编写客户端,向服务端发送恰当的 HTTP 请求。
目前已经实现了大多数流行语言版本的客户端,这意味着你可以使用任何测试套件或者测试框架。客户端库就是简单的HTTP 客户,可以以任何你喜欢的方式潜入你的代码。换句话说,Appium 和 WebDriver 客户端不是技术意义上的“测试框架”,而是“自动化库”。你可以在你的测试环境中随意使用这些自动化库!
事实上 WebDriver 已经成为 web 浏览器自动化的标准,也成了 W3C 的标准 —— [W3C Working Draft](https://dvcs.w3.org/hg/webdriver/raw-file/tip/webdriver-spec.html)。我们又何必为移动做一个完全不同的呢?所以我们扩充了[WebDriver 的协议](https://code.google.com/p/selenium/source/browse/spec-draft.md?repo=mobile),在原有的基础上添加移动自动化相关的 API 方法,这也满足了第三条理念。
第四条就不用说了,[Appium 是开源的](https://github.com/appium/appium)。
## Appium 概念
**C/S 架构**<br/>
Appium 的核心是一个 web 服务器,它提供了一套 REST 的接口。它收到客户端的连接,监听到命令,接着在移动设备上执行这些命令,然后将执行结果放在 HTTP响应中返还给客户端。事实上,这种客户端/服务端的架构给予了许多的可能性:比如我们可以使用任何实现了该客户端的语言来写我们的测试代码。比如我们可以把服务端放在不同
的机器上。比如我们可以只写测试代码,然后使用像 [Sauce Labs](https://saucelabs.com/mobile) 这样的云服务来解释命令。
**Session**<br/>
自动化始终围绕一个session进行,客户端初始化一个seesion(会话)来与服务端交互,不同的语言有不同的实现方式,但是他们最终都是发送为一个POST请求给服务端,请求中包含一个JSON对象,被称作“desired capabilities”。此时,服务端就会开启一个自动化的 session,然后返回一个 session ID,session ID将会被用户发送后续的命令。
**Desired Capabilities**<br/>
Desired capabilities 是一些键值对的集合 (比如,一个 map 或者 hash),客户端将这些键值对发给服务端,告诉服务端我们想要怎么测试。比如,我们可以把`platformName` capability 设置为 `iOS`,告诉 Appium 服务端,我们想要一个iOS 的 session,而不是一个 Android 的。我们也可以设置 `safariAllowPopups` capability 为 `true`,确保在 Safari 自动化 session 中,我们可以使用 javascript 来打开新窗口。参见 [capabilities 文档](/docs/cn/writing-running-appium/caps.cn.md),查看完整的 capabilities 列表。
**Appium Server**<br/>
Appium server 是用 Node.js 写的。我们可以用源码编译或者从 NPM 直接安装。
**Appium 服务端**<br/>
Appium 服务端有很多语言库 Java, Ruby, Python, PHP, JavaScript 和 C#,这些库都实现了
Appium 对 WebDriver 协议的扩展。当使用 Appium 的时候,你只需使用这些库代替常规的 WebDriver 库就可以了。
你可以从[这里](appium-clients.cn.md)看到所有的库的列表。
**[Appium.app](https://github.com/appium/appium-dot-app), [Appium.exe](https://github.com/appium/appium-dot-exe)**<br/>
我们提供了 GUI 封装的 Appium 服务端下载,它封装了运行 Appium服务端的所有依赖,而不需要担心怎样安装Node.js。其中还包括一个Inspector工具,可以帮助你检查应用的界面层级,这样写测试用例时更方便。
## Getting Started
恭喜!你现在有足够的知识来使用 Appium 了。 来我们回到 [getting started doc](/docs/cn/README.md) 继续了解更加
细节的需求和指南。
+47
View File
@@ -0,0 +1,47 @@
# Selenium Grid
使用 <b>"--nodeconfig"</b> 服务器参数,你可以在本地 selenium grid 里注册你的 appium 服务器。
```bash
> node . -V --nodeconfig /path/to/nodeconfig.json
```
在 node 的配置文件里,你需要定义 <b>"browserName"</b>,<b>"version"</b> 和 <b>"platform"</b>。
基于这些参数,selenium grid 会将你的测试定向到正确的设备上去。你还需要配置你的 <b>host</b> 详细信息和
<b>selenium grid</b> 的详细信息。你可以在 <a href="http://code.google.com/p/selenium/source/browse/java/server/src/org/openqa/grid/common/defaults/GridParameters.properties">这里</a> 找到详细的参数列表和描述信息。
一旦你启动了 appium 服务器并且在 grid 里注册了信息,你会在 grid 控制台发现你的设备:
"http://<b>\<grid-ip-adress\></b>:<b>\<grid-port\></b>/grid/console"
## Grid 配置文件例子
```xml
{
"capabilities":
[
{
"browserName": "<e.g._iPhone5_or_iPad4>",
"version":"<version_of_iOS_e.g._6.1>",
"maxInstances": 1,
"platform":"<platform_e.g._MAC_or_ANDROID>"
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://<host_name_appium_server_or_ip-address_appium_server>:<appium_port>/wd/hub",
"maxSession": 1,
"register": true,
"registerCycle": 5000,
"hubPort": <grid_port>,
"hubHost": "<Grid_host_name_or_grid_ip-address>"
}
}
```
可以在 <a href="http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/Platform.html">这里</a>查看有效的 platform 参数。
如果没有给出url、host和 port,配置会自动指向本地:whatever-port-Appium-started-on。
如果你的Appium服务和Selenium Grid服务没有运行在同一台机器上,为确保Selenium Grid连接正常,请在你的host & url docs上使用外部其它名称或IP地址,而非localhost 和 127.0.0.1
+202
View File
@@ -0,0 +1,202 @@
# 自动化混合应用
Appium 其中一个理念就是你不能为了测试应用而修改应用。为了符合这个方法学,我们可以使用 Selenium 测试传统 web 应用的方法来测试混合 web 应用 (比如,iOS 应用里的元素 "UIWebView" ),这是有可能的。这里会有一些技术性的复杂,Appium 需要知道你是想测试原生部分呢还是web部分。幸运的是,我们还能遵守 WebDriver 的协议。
* [混合 iOS 应用](hybrid.cn.md)
* [混合 Android 应用](hybrid.cn.md)
## 自动化混合 iOS 应用
在你的 Appium 测试里,你需要以下几步来和 web 页面交涉:
1. 前往到应用里 web 视图激活的部分。
1. 调用 [GET session/:sessionId/window_handles](http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/window_handles)
1. 这会返回一个我们能访问的 web 视图的 id 的列表。
1. 使用你想访问的这个 web 视图的 id 作为参数,调用 [POST session/:sessionId/window](http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/window)
1. (这会将你的 Appium session 放入一个模式, 在这个模式下,所有的命令都会被解释成自动化web视图而不是原生的部分。比如,当你运行 getElementByTagName,它会在 web 视图的 DOM 上操作,而不是返回 UIAElements。当然,一个 Webdriver 的方法只能在一个上下文中有意义,所以如果在错误的上下文,你会收到错误信息。)
1. 如果你想停止 web 视图的自动化,回到原生部分,你可以简单地使用 `execute_script` 调用 `"mobile: leaveWebView"` 方法来离开 web 层。
## 在 iOS 真机上运行
appium 使用一个远程调试器建立连接来实现和 web 视图的交互。当在模拟器上执行下面例子的时候,我们可以直接建立连接,因为模拟器和 appium 服务器在同一台机器上。
当在真机上运行用例时,appium 无法直接访问 web 视图,所以我们需要通过 USB 线缆来建立连接。我们使用 [ios-webkit-debugger-proxy](https://github.com/google/ios-webkit-debug-proxy)建立连接。
使用 brew 安装最新的 ios-webkit-debug-proxy。在终端运行一下命令:
``` bash
# 如果你没有安装 brew 的话,先安装 brew。
> ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
> brew update
> brew install ios-webkit-debug-proxy
```
你也可以通过 git 克隆项目来自己安装最新版本:
``` bash
# Please be aware that this will install the proxy with the latest code (and not a tagged version).
> git clone https://github.com/google/ios-webkit-debug-proxy.git
> cd ios-webkit-debug-proxy
> ./autogen.sh
> ./configure
> make
> sudo make install
```
一旦安装好了, 你就可以启动代理:
``` bash
# 将udid替换成你的设备的udid。确保端口 27753 没有被占用
# remote-debugger 将会使用这个端口。
> ios_webkit_debug_proxy -c 0e4b2f612b65e98c1d07d22ee08678130d345429:27753 -d
```
<b>注意:</b> 这个 ios-webkit-debug-proxy 需要 <b>"web inspector"</b> 打开着以便建立连接。在 <b> settings > safari > advanced </b> 里打开它。请注意 web inspector <b>在 iOS6 时候加入的</b> 以前的版本没有。
## Wd.js Code example
```js
// 假设我们已经有一个初始化好了的 `driver` 对象。
driver.elementByName('Web, Use of UIWebView', function(err, el) { // 找到按钮,打开 web 视图
el.click(function(err) { // 引导到 UIWebView
driver.windowHandles(function(err, handles) { // 得到能访问的视图列表。
driver.window(handles[0], function(err) { // 因为只有一个,所以选择第一个。
driver.elementsByCss('.some-class', function(err, els) { // 通过 css 拿到元素。
els.length.should.be.above(0); // 肯定有元素。
els[0].text(function(elText) { // 得到第一个元素的文本。
elText.should.eql("My very own text"); // 比较匹配文本。
driver.execute("mobile: leaveWebView", function(err) { // 离开web视图上下文。
// 如果你想的话,做一些原生应用的操作。
driver.quit(); // 退出。
});
});
});
});
});
});
});
```
* 想看到具体的上下文,请看[该node 的例子](/sample-code/examples/node/hybrid.js)
* *我们正在完善 web 视图下面的方法。[加入我们!](http://appium.io/get-involved.html)
## Wd.java 代码例子
```java
//配置 webdriver 并启动 webview 应用。
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("device", "iPhone Simulator");
desiredCapabilities.setCapability("app", "http://appium.s3.amazonaws.com/WebViewApp6.0.app.zip");
URL url = new URL("http://127.0.0.1:4723/wd/hub");
RemoteWebDriver remoteWebDriver = new RemoteWebDriver(url, desiredCapabilities);
// 切换到最新的web视图
for(String winHandle : remoteWebDriver.getWindowHandles()){
remoteWebDriver.switchTo().window(winHandle);
}
//在 guinea-pig 页面用 id 和 元素交互。
WebElement div = remoteWebDriver.findElement(By.id("i_am_an_id"));
Assert.assertEquals("I am a div", div.getText()); //验证得到的文本是否正确。
remoteWebDriver.findElement(By.id("comments")).sendKeys("My comment"); //填写评论。
//离开 webview,回到原生应用。
remoteWebDriver.executeScript("mobile: leaveWebView");
//关闭应用。
remoteWebDriver.quit();
```
## Wd.rb cucumber 的例子
```ruby
TEST_NAME = "Example Ruby Test"
SERVER_URL = "http://127.0.0.1:4723/wd/hub"
APP_PATH = "https://dl.dropboxusercontent.com/s/123456789101112/ts_ios.zip"
capabilities =
{
'browserName' => 'iOS 6.0',
'platform' => 'Mac 10.8',
'device' => 'iPhone Simulator',
'app' => APP_PATH,
'name' => TEST_NAME
}
@driver = Selenium::WebDriver.for(:remote, :desired_capabilities => capabilities, :url => SERVER_URL)
## 这里切换到最近一个窗口是因为在我们的例子里这个窗口一直是 webview。其他的用例里,你需要自己指定。
## 运行 @driver.window_handles,查看 appium 的日志,找出到底哪个窗口是你要的,然后找出相关的数字。
## 然后用 @driver.switch_to_window(number),切换过去。
Given(/^I switch to webview$/) do
webview = @driver.window_handles.last
@driver.switch_to.window(webview)
end
Given(/^I switch out of webview$/) do
@driver.execute_script("mobile: leaveWebView")
end
# 你可以使用 CSS 选择器在你的 webview 里来选择元素
And(/^I click a webview button $/) do
@driver.find_element(:css, ".green_button").click
end
```
### 用 ruby 调试 web 视图:
我在我的帮助类里创建了一个快速方法来定位web元素,无论它在哪一个窗口视图。
(这非常有帮助,特别是你的 webview 的 id 变化或者你用同一份代码来测试 Android 和 iOS。)
https://gist.github.com/feelobot/7309729
## 自动化混合 Android 应用
Appium 通过 Chromedriver 内建混合应用支持。Appium 也可以使用 Selendroid 做为 4.4 之前的设备对 webview 支持的背部引擎。(你需要在 desired capability 里指定 `"device": "selendroid"`)。然后:
1. 前往你应用里 web 视图激活的部分。
1. 用 "WEBVIEW" 做窗口句柄调用 [POST session/:sessionId/window](http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/window) , 比如 `driver.window("WEBVIEW")`。
1. (这会将你的 Appium session 放入一个模式, 在这个模式下,所有的命令都会被解释成自动化web视图而不是原生的部分。比如,当你运行 getElementByTagName,它会在 web 视图的 DOM 上操作,而不是返回 UIAElements。当然,一个 Webdriver 的方法只能在一个上下文中有意义,所以如果在错误的上下文,你会收到错误信息。)
1. 如果要停止web上下文里的自动化,回到原生部分的自动化,简单地使用 "NATIVE_APP" 调用 `window` 方法。比如 `driver.window("NATIVE_APP")`。
注意:我们可以像上面说的,使用同样的策略。然而,Selendroid 使用 `WEBVIEW`/`NATIVE_APP` 窗口设置策略。 Appium 常规的混合支持也使用这种策略。
## Wd.js 代码例子
```js
// 假设我们已经初始化了一个 `driver` 实例。
driver.window("WEBVIEW", function(err) { // 选择唯一的 WebView
driver.elementsByCss('.some-class', function(err, els) { // 通过 CSS 取得元素
els.length.should.be.above(0); // 验证元素存在
els[0].text(function(elText) { // 得到第一个元素的文本
elText.should.eql("My very own text"); // 验证文本内容
driver.window("NATIVE_APP", function(err) { // 离开 webview 上下文
// 可以做些原生应用的测试
driver.quit(); // 关闭 webdriver
});
});
});
});
```
## Wd.java 代码例子
```java
//配置 webdriver 并启动 webview 应用。
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("device", "Selendroid");
desiredCapabilities.setCapability("app", "/path/to/some.apk");
URL url = new URL("http://127.0.0.1:4723/wd/hub");
RemoteWebDriver remoteWebDriver = new RemoteWebDriver(url, desiredCapabilities);
// 切换到最新的web视图
remoteWebDriver.switchTo().window("WEBVIEW");
//在 guinea-pig 页面用 id 和 元素交互。
WebElement div = remoteWebDriver.findElement(By.id("i_am_an_id"));
Assert.assertEquals("I am a div", div.getText()); //验证得到的文本是否正确。
remoteWebDriver.findElement(By.id("comments")).sendKeys("My comment"); //填写评论。
//离开 webview,回到原生应用。
remoteWebDriver.switchTo().window("NATIVE_APP");
//关闭应用。
remoteWebDriver.quit();
```
@@ -0,0 +1,109 @@
# 把appium 0.18.x上的测试用例集迁移到appium1.x上
Appium 1.0 已经从先前的版本中移除了一部分过时的特性, 这个指导文档会帮助你了解使用Appium 1.0需要做的具体改变.
## 新的客户端库
你需要关注的最大的改变是利用新的appium的client libraries来替换原生的WebDriver ciients. 访问[Appium client list](appium-clients.md) 去寻找符合你自己编程语言的客户端库吧. 在每个客户端的网站上都可以找到用于集成到你代码中的依赖库相关介绍和下载
基本上, 你需要做如下的改变(以Python作为例子)
用
```
from appium import webdriver
```
替换原来的:
```
from selenium import webdriver
```
## 新的适配参数
下面的适配参数将不再使用
* `device`
* `version`
取而代之的是利用下面的配置参数
* `platformName` ("iOS" 或者 "Android")
* `platformVersion` (你希望测试的os版本)
* `deviceName` (你想用的设备, 比如 "iPhone Simulator")
* `automationName` ("Selendroid" 如果你想使用Selendroid的话, 否则可以省略)
`app` 配置参数保持不变, 但是特指非浏览器的app, 如果你想使用类似Safari或者Chrome这样的浏览器, 你需要设置`browserName`. 这代表`app`和`browserName`是互斥的.
我们把appium的配置参数都规范为驼峰拼写法(camelCase), 这代表着原来的`app-package`或者`app-wait-activity`现在会变成`appPackage`和`appWaitActivity`. 当然目前android的app package和activity都已经是自动探测了, 大部分情况下你可以省略这两个配置项.
## 新的定位方式
我们已经移除了下面的定位方式
* `name`
* `tag name`
我们增加了`accessibility_id`定位方法去做过去`name`做的事情. 具体的细节还得跟你使用的Appium客户端库有关.
`tag name`已经被替换为`class name`. 所以想通过UI的类型来定位某个元素, 你需要使用class name定位方式
关于`class name`和`xpath`的定位方式: 现在需要使用完整的全类名, 这意味着如果你有一个如下的定位用的xpath
```
//table/cell/button
```
现在需要改成
```
//UIATableView/UIATableCell/UIAButton
```
如果是android的话, `button`需要改变成`android.widget.Button`
我们也增加了如下的定位方式
* `-ios uiautomation`
* `-android uiautomator`
根据你使用的客户端去相应的使用新的定位方式
## 使用xml, 不再是json了
App source方法先前返回JSON, 现在修改成返回XML. 所以如果你有代码是依赖解析app source的, 那么就需要更新
## 通过context支持混合应用, 不再是window了
以前混合app的切换支持是通过"windows"
* `window_handles`
* `window`
* `switch_to.window`
现在Appium支持"context" 概念了, 要获得当前环境下所有的上下文(contexts), 或者特定的context, 你可以用
```python
driver.contexts
current = driver.context
```
在这些context之间切换, 可以使用
```python
driver.switch_to.context("WEBVIEW")
```
## 没有了`execute_script("mobile: xxx")`
所有的`mobile:`方法都已经被移除, 并且被替换为appium client libraries的原生方法. 这意味着如果一个方法调用原来的方式是
`driver.execute("mobile: lock", [5])`
现在需要更新为
`driver.lock(5)`
在这个地方`lock`已经变成了原生的客户端方法. 当然具体的调用细节在不同的客户端库中的实现可能会有所差别.
特别需要注意的是, 手势(gesture)方法已经被替换为TouchAction / MultiAction API, 它允许更强大通用的组合手势的自动化. 可以参考你的客户端库的具体用法.
这就是全部啦, 祝迁移愉快
(文档由testerhome.com翻译, 欢迎更多热爱技术的同学加入到翻译中来, We Love Appium)
+40
View File
@@ -0,0 +1,40 @@
## Settings
Settings 是 Appium 引入的一个新的概念。 它目前还没有被纳入 Mobile JSON Wire Protocol 及 Webdriver 标准之中。
Settings 是一种用来配置 Appium 服务器的方式。
Settings 有以下特点:
- 可变的,它在同一会话中是可以被修改的。
- 唯一的,它在被测应用会话中是唯一的。 它在每创建一个新会话时会被重置。
- 可控的,它在自动化测试过程中控制着 Appium 服务器的运行。 它们不会被用来控制被测应用或被测终端。
在 Android 环境中 以 `ignoreUnimportantViews` 设置举例,该参数在 Android 环境中可以被设置成忽略所有与当前视图无关的元素,它将使测试过程更加有效率。 然而当我们希望能够访问被忽略的元素时,我们必须在将 `ignoreUnimportantViews` 设置成 *true* 后,重新修改成 *false* 。
另外也可以通过 Settings 配置让 Appium 忽略所有当前不可见的元素。
Settings 可以通过以下 API 方法进行配置:
**POST** /session/:sessionId/appium/settings
>以 JSON 格式提交 key:value 键值对形式的Settings配置。
```
{
settings: {
ignoreUnimportantViews : true
}
}
```
**GET** /session/:sessionId/appium/settings
>以 JSON 格式返回当前所有 Settings 配置。
```
{
ignoreUnimportantViews : true
}
```
### 其它 Settings 配置参考
**"ignoreUnimportantViews"** -该参数值为 *true* 或 *false*。 如果你希望能够尽量减少测试过程的交互确认过程,或希望测试脚本能更快的执行,可以在 Android 终端环境下使用 `setCompressedLayoutHeirarchy()` 参数。它将忽略所有被标记为 IMPORTANT_FOR_ACCESSIBILITY_NO 或 IMPORTANT_FOR_ACCESSIBILITY_AUTO(以及那些被认为不是很重要的系统元素)的元素。
@@ -0,0 +1,11 @@
# Intel® 硬件加速器管理
如果你发现android模拟器太慢, 并且你的系统运行在Intel® 的cpu上. 那么你可以尝试下HAXM, HAXM能够让你充分利用硬件虚拟化技术来加速android模拟器。
* 要安装HAXM, 你可以打开Android SDK Manager, 你可以在Extras中发现这个安装选项;
* 你可以在[Intel官方网站][1]找到所有相关的文档;
* 这将需要x86的模拟镜像;
* 利用Intel的包来安装HAXM; Android SDK Manager有时候会安装不成功,这主要取决于你安装的版本是否兼容。
[1]: http://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager/ "Hax"
[2]: http://software.intel.com/en-us/search/site/language/en?query=Intel%20Hardware%20Accelerated%20Execution%20Manager%20%28HAXM%29 "Hax all"
+38
View File
@@ -0,0 +1,38 @@
## Android Setup
使用前,你需要安装node.js(版本大于等于0.10)。 请参照 [instructions for your flavor of linux](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager)。
当node.js安装成功后,请安装 [Android SDK](http://developer.android.com/sdk/index.html)。
运行'android' tool(位于SDK,tool文件目录下)。
运行'android' tool 来安装大于等于Level 17的API。
(如果你想从Appium的源码来运行,可在真机或者模拟器上用 [Apache Ant](http://ant.apache.org/) 来编译bootstrap jar包)。
最后,将环境变量`$ANDROID_HOME`设置为 Android SDK 的路径。例如,如果你将Android SDK 解压到 /usr/local/adt/,你需要把这个路径加到你的shell环境变量中去:
export ANDROID_HOME="/usr/local/adt/sdk"
现在就可以启动Appium了!如果你在源码中运行Appium请运行
`./reset.sh --android` 版本从Appium checkout会安装所有的依赖。
### 老版本的额外安装
当android的版本是2.3到4.1的时候,appium用的是selendroid。 当它检测到时低版本时,它会自动应用Selendroid。但是需要配置一些额外的设置如果从source运行。
* 已经安装 [Maven 3.1.1](http://maven.apache.org/download.cgi) 或更新 (`mvn`)
* 运行 `./reset.sh --selendroid` 从checkout的Appium源码
### (运行Appium Android 测试)
在Linux上运行,启动一个API大于等于level17的AVD。 在源文件目录下运行 (`appium`) 在安装好 NPM, 或者 `node`。如果你选择的是从源代码方式运行。
参照 [server documentation](/docs/cn/writing-running-appium/server-args.cn.md) 来了解所有命令和参数。
### 注意
* Android 加速模拟器需要存在,它有自己的局限性,如果想了解更多,请看这里
[page](/docs/cn/appium-setup/android-hax-emulator.cn.md)。
* 如果你想运行任何Appium的测试,或者任何强大的命令,确保你的 `hw.battery=yes` 在 AVD's `config.ini`文件中。
* Selendroid 需要你APP中的如下权限:
`<uses-permission android:name="android.**permission.INTERNET"/>`,
如果你在使用selendroid或者低版本的android(如版本2.3到4.1),请确保你的App已设置internet权限。
+72
View File
@@ -0,0 +1,72 @@
# 部署iOS app 到手机上
准备在真机上执行appium测试, 需要如下准备:
1. 用特殊的设备参数来构建app
1. 使用 [fruitstrap](https://github.com/ghughes/fruitstrap), 这是一个第三方程序,可以用来部署你构建的app到手机上
## Xcodebuild 命令的参数:
新的参数运行指定设置. 参考 [developer.apple.com](https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html):
```
xcodebuild [-project projectname] [-target targetname ...]
[-configuration configurationname] [-sdk [sdkfullpath | sdkname]]
[buildaction ...] [setting=value ...] [-userdefault=value ...]
```
这有一个资料来参考可用的[设置](https://developer.apple.com/library/mac/#documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html#//apple_ref/doc/uid/TP40003931-CH3-DontLinkElementID_10)
```
CODE_SIGN_IDENTITY (Code Signing Identity)
介绍: 标识符,指定一个签名。
例如: iPhone Developer
```
PROVISIONING_PROFILE 已经从可用的的命令中消失了,但还是有必要设置的。
在xcodebuild命令中设置 "CODE_SIGN_IDENTITY" & "PROVISIONING_PROFILE":
```
xcodebuild -sdk <iphoneos> -target <target_name> -configuration <Debug> CODE_SIGN_IDENTITY="iPhone Developer: Mister Smith" PROVISIONING_PROFILE="XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX"
```
成功的话, app会构建到如下目录 ```<app_dir>/build/<configuration>-iphoneos/<app_name>.app```
## 用Fruitstrap进行部署
clone一个fruitstrap的fork版本在[ghughes version](https://github.com/ghughes/fruitstrap) ,这个已经不再维护. 已确认该fork可用[unprompted fork](https://github.com/unprompted/fruitstrap), 但是其它的据说也可用。
clone成功的话, 执行 ``make fruitstrap``
然后, 然后复制生成的 ``fruitstrap``到app的所在的目录或上级目录下。
运行fruitstrap 通过输入以下命令 (命令是否可用依赖于你fork的 fruitstrap):
```
./fruitstrap -d -b <PATH_TO_APP> -i <Device_UDID>
```
如果是为了持续集成,你可以发现很有用的方法来记录fruitstrap命令行和日志文件中的记录, 像这样:
```
./fruitstrap -d -b <PATH_TO_APP> -i <Device_UDID> 2>&1 | tee fruit.out
```
在node服务启动前fruitstrap进行需要被结束, 一个方法是扫描fruitstrap的输出来得知app完成启动。 有一个有效的方法是通过一个Rakefile 和一个 ``go_device.sh`` 脚本:
```
bundle exec rake ci:fruit_deploy_app | while read line ; do
echo "$line" | grep "text to identify successful launch"
if [ $? = 0 ]
then
# Actions
echo "App finished launching: $line"
sleep 5
kill -9 `ps -aef | grep fruitstrap | grep -v grep | awk '{print $2}'`
fi
done
```
一旦fruitstrap的进程被结束, node 服务就可以启动并且appium测试可以被执行!
下一步:
[在真机上运行appium](real-devices.cn.md)
+31
View File
@@ -0,0 +1,31 @@
## Android并发测试
Appium提供了在一台设备上启动多个Android会话的方案,而这个方案需要你输入不同的指令来启动多个Appium服务来实现。
启动多个Android会话的重要指令包括:
- `-p` Appium的主要端口
- `-U` 设备id
- `-bp` Appium bootstrap端口
- `--chromedriver-port` chromedriver端口(当使用了webviews或者chrome)
- `--selendroid-port` selendroid端口(当使用了selendroid)
更多参数的解释详见 [here](../writing-running-appium/caps.cn.md)。
如果我们有两台设备,设备ID分别为43364和32456,我们应该用下面的命令启动来两个不同的Appium服务:
`node . -p 4492 -bp 2251 -U 32456`
`node . -p 4491 -bp 2252 -U 43364`
只要你的Appium和Appium bootstrap端口介于0和65536即可,并且保证是两个不同的端口以便两个Appium服务不会监听相同的端口。确认你的-u参数绑定正确的设备ID。这可以让Appium知道连接哪台设备,所以参数一定要准确。
如果你用了chromedriver或selendroid,不同的服务要设置不同的端口。
### iOS并发测试
不幸的是,IOS不能进行本地并发测试。跟Android不一样,IOS在同一时间只能启动一个版本的模拟器来运行多个测试。
如果你想在IOS上进行并发测试,你需要用到Sauce。只需上传你的Appium测试脚本到Sauce,它就可以按照你的设置执行多个IOS或Android的并发测试。在Sauce上执行测试的更多信息,详见[here](https://docs.saucelabs.com/tutorials/appium/)。
@@ -0,0 +1,36 @@
# Appium支持的平台
Appium支持很多的运行平台和测试方式(包括原生、混合应用、内嵌浏览器、真机、模拟器等)。这篇文档主要用来让大家明确在使用
Appimu的时候支持的平台版本和上述测试方式的必备条件。
## iOS平台支持
请移步到[Running on OS X: iOS](running-on-osx.cn.md) 。这里介绍了在iOS系统下使用Appium的必备条件和安装说明。
* 版本号:6.1,7.0,以及7.1。
* 支持设备:iPhone模拟器,iPad模拟器以及iPhones和iPads真机。
* 是否支持原生应用:支持。同时支持模拟器中调试应用版本和正确签名的真机ipa。其他相关支持由苹果的[UIAutomation](https://developer.apple.com/library/ios/documentation/DeveloperTools/Reference/UIAutomationRef/)框架提供。
* 是否支持内置移动浏览器:支持。Safari浏览器已经通过测试。对于真机,则需要安装调试工具ios-webkit-remote-debugger。很遗憾,对于Safari的原生界面的自动化是不支持的。更多信息请移步至[mobile web doc](/docs/cn/writing-running-appium/mobile-web.cn.md) 。
* 是否支持混合应用:支持。同样对于真机需要安装调试工具ios-webkit-remote-debugger,更多详情请移步至[hybrid doc](/docs/cn/advanced-concepts/hybrid.cn.md) 查看详情。
* 是否支持在同一个session中执行多个应用的自动化:不支持。
* 是否支持同时再多个设备上执行自动化:不支持。
* 是否支持第三方提供应用:只支持在模拟器上有限的第三方应用(例如:喜好设置、地图等)。
* 是否支持自定义的、非标准UI控件的自动化:仅支持很少一部分。最好对控件添加可识别信息,以方便对元素进行一些基础的自动化操作。
## Android平台支持
请移步至 [Running on OS X: Android](running-on-osx.cn.md),[Running on Windows](running-on-windows.cn.md),或者[Running on Linux](running-on-linux.cn.md) 获得在不同操作系统下android平台对appium的支持和安装配置文档。
* 支持版本:android 2.3平台及以上。
* android 4.2平台及以上通过Appium自有的[UiAutomator](http://developer.android.com/tools/help/uiautomator/index.html)类库支持。默认在自动化后台。
* 从android 2.3到4.3平台,Appium是通过绑定[Selendroid](http://selendroid.io),实现自动化测试的,你可以到android开发社区的[Instrumentation](http://developer.android.com/reference/android/app/Instrumentation.html)。(仪表盘)中查看相关介绍。Selendroid拥有一套不同的命令行和不同的profile文件(这部分差距正在逐步缩小)。要获得在后台运行自动化的权限,需要配置`automationName` 组件的值为 `Selendroid`。
* 支持的设备:Android模拟器和Android真机。
* 是否支持原生应用:支持。
* 是否支持内置移动浏览器:支持(除了使用Selendroid后台运行的情况)。通过代理方式绑定到[Chromedriver](https://code.google.com/p/selenium/wiki/ChromeDriver)来运行自动化测试。在android4.2和4.3版本中,只有在官方版本的谷歌浏览器或者Chromium下才能运行自动化测试。伴随着android 4.4+版本的出现。自动化测试则可以运行在内置浏览器的应用程序。但是需要在测试设备环境下安装Chrome/Chromium/浏览器。请移步至[mobile web doc](/docs/cn/writing-running-appium/mobile-web.cn.md) 获取更多详情。
* 是否支持混合应用: 支持。请移步至[hybrid doc](/docs/cn/advanced-concepts/hybrid.cn.md)参考相关文档。
* 通过默认的Appium的后台支持android 4.4以上的版本。
* 通过Selendroid的后台支持android 2.3以上的版本。
* 是否支持在同一个session中执行多个应用的自动化:支持(但是不支持使用Selendroid后台的场景)。
* 是否支持同时再多个设备上执行自动化:支持,。尽管Appium必须要启动另一个端口即通过添加参数的方式运行命令行,例如`--port`,`--bootstrap-port`(或者`--selendroid-port`)或者`--chromedriver-port`。更多详情请移步至[server args doc](/docs/cn/writing-running-appium/server-args.cn.md)。
* 是否支持第三方应用自动化:支持(但是不支持Selendroid后台运行的场景)。
* 是否支持自定义的、非标准UI控件的自动化:不支持。
+38
View File
@@ -0,0 +1,38 @@
# Appium在真机上
Appium已经初步支持真机测试。
如果要在真机上执行测试,你将要做如下准备:
1.一个苹果的开发者ID和有效的开发者对应的配置文件和签名文件
2.一台iPad或者iPhone
3. 你要测试的应用的源码
4. 一台安装了XCode和XCode Command Line Developer Tools的Mac机器
## Provisioning Profile
要在真机上测试就需要一个有效的iOS开发者的Distribution Certificate and Provisioning Profile。你可以在这个上面找到配置这些的相关信息[Apple documentation](http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/YourFirstAppStoreSubmission/TestYourApponManyDevicesandiOSVersions/TestYourApponManyDevicesandiOSVersions.html)
同样的,你还需要对你的应用签名,更多的信息可以查看[sign your app](http://developer.apple.com/library/ios/#documentation/ToolsLanguages/Conceptual/YourFirstAppStoreSubmission/ProvisionYourDevicesforDevelopment/ProvisionYourDevicesforDevelopment.html#//apple_ref/doc/uid/TP40011375-CH4-SW1).
你必须使用Xcode的执行按钮来安装你的应用
## 使用Appium运行你的测试
一旦你的设备和应用设置好了之后,你就能够用如下的命令在你的机器上执行测试:
```
node . -U <UDID> --app <bundle_id>
```
这将会启动Appium并且开始在真机上测试应用。
## 疑问解答思路
0. 确认UDID已经正确的在xcode organizar或itunes中设置了。很长的字符串(20多个字符串)
0.确认你测试代码中的测试对象设备的设置
0. 再次确认你从instruments启动你的自动化测试
0. 确认instruments已经关闭
@@ -0,0 +1,32 @@
# 在 Linux 上运行 Appium
### 限制
如果你在 Linux 上使用 Appium, 那么你没法使用已经构建好的 '.app',那是为 OS X 准备的。 另外由于 Appium 在测试 iOS 应用时 依赖 OS X 特有的库, 所以你也没有办法测试在 Linux 上测试 iOS 应用。
## 配置
首先,安装版本高于或等于 0.8 的 nodejs。可以根据 [instructions for your flavor of linux](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) 进行安装。
安装好了 node.js 之后,安装 [Android SDK](http://developer.android.com/sdk/index.html)。 你会需要运行 `android` `adb` 等工具,这些工具都在 SDK 里包含了, 你要做的是配置环境变量。当然你要确保你的 API level 大于等于 17。 你也需要使用 Ant 来构建 bootstrap jar 以便 Appium 使用它来测试 Android 应用。
最后, 设置 `$ANDROID_HOME` 为你的 Android SDK 的路径。比如, 你将 Android SDK 解压在 `/usr/local/adt/`, 那你就要将如下添加到你的 `.bashrc` 或 `.zshrc` 或 `.bash_profile` 等 shell 配置文件中去:
export ANDROID_HOME="/usr/local/adt/sdk
现在你可以运行 Appium 了, 在你 checkout 出来的 Appium 目录里, 运行 `.reset.sh --android`, 它会帮助你安装好所有的依赖。
## 运行 Appium
运行测试前, 你需要启动一个 API Level 大于等于 17 的 Android 模拟器或者连接一个系统是 4.1 以上的 Android 真机。然后在 Appium 目录运行
node .
你可以在 [server documentation](server-args.cn.md) 找到所有的命令行参数。
## 备注
* There exists a hardware accelerated emulator for android, it has it's own
limitations. For more information you can check out this
Android 有一些硬件加速的模拟器,这些模拟器有自己的限制。你可以在 [page](android-hax-emulator.cn.md) 找到更多的信息。
* 确保你使用的 AVD 里面的 `config.ini` 有这条指令 `hw.battery=yes`。
+28
View File
@@ -0,0 +1,28 @@
# 在 Mac OS X 上使用 Appium
在 OS X 上, Appium 支持 iOS 和 Android 测试
## 系统配置 (iOS)
* Appium 需要 Mac OS X 10.7, 推荐 10.8。 (经过测试, 10.9 也能工作。)
* 确保 Xcode 和 iOS SDK 都已经安装好了。 (当前 Appium 支持 Xcode 4.6.3/iOS 6.1 和 Xcode 5/iOS 7.0。 注意不推荐在基于 Xcode 5 下且低于 7.0 的 iOS 版本进行测试。 参照下篇可以获取更多信息)
* 你需要授权 iOS 模拟器的使用。如果你是通过 NPM 安装的 Appium,那么你可以运行 `sudo authorize_ios` (`authorize_ios`)是来自 Appium npm 包里的一个二进制执行文件。如果你是从源代码运行 Appium,那么你可以简单的使用 `sudo grunt authorize`。如果你使用[Appium.app](https://github.com/appium/appium-dot-app), 那你只要用界面来操作。
* 如果你使用的是Xcode 6,在启动Appium之前,你需要打开模拟器,并且在你需要进行输入文字的操作之前,必须先将输入法提前调出。你可以通过点击输入区域或通过快捷键`command-K`来将软键盘唤出。
* Xcode 6中,有一个Devices的模块(command-shift-2可唤出)。你必须确保Appium 的capabilities参数中,所使用到的deviceName要存在于Devices里。换句话说,如果capabilities中的deviceName为"iPhone 5s",platformVersion为"8.0",那么你必须确保Devices中要存在那么一个设备是"iOS8系统的iPhone5s",否则Appium将不知道使用哪一个设备进行测试。
* 在iOS8设置中的开发者选项里面,你可以打开或关闭UIAutomation。如果你的是iOS8设备,请在运行Appium之前,确保UIAutomation是打开状态的。
## 使用多种 iOS SDK 进行测试
Appium 使用苹果提供的 `instruments` 来启动 iOS 模拟器,默认它会使用当前安装的 Xcode 和该 Xcode 下安装好的最高版本的 iOS SDK。这就意味着如果你想测试 iOS 6.1, 但是你安装了 iOS 7.0, 那么 Appium 会强制使用 7.0 的模拟器。 唯一的方法就是安装多个Xcode,然后在安装不同的 SDK。然后在启动 Appium 前,切换到你要测试的特定的版本。
另外,我们发现 Xcode 5 上的 iOS 6.1 测试,会很慢而且不稳定。所以我们推荐,如果要在 6.1 及 6.1 以下版本的 iOS 上进行测试,请使用 Xcode 4.6.3。如果要在 iOS 7.0 上测试,请使用 Xcode 5。假设我们的 Xcode 5 在 `/Applications/Xcode.app`, Xcode 4.6 在 `/Applications/Xcode-4.6.app`,我们就可以用下面的命令来切换到 Xcode 4.6 来为 iOS 6.1 测试做准备。
sudo xcode-select -switch /Applications/Xcode-4.6.app/Contents/Developer/
如果要回到 Xcode 5 的话,我们再运行一次:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
## 系统配置 (Android)
* 在Mac OSX 上运行Android项目所需要的配置,与Linux的配置方法是一致的,请参考 [Android setup docs](/docs/cn/appium-setup/android-setup.cn.md)。
@@ -0,0 +1,58 @@
# 在Windows上运行Appium
### 局限性
如果你在windows上安装appium,你没法使用预编译专用于OS X的.app文件,你也将不能测试IOS apps,因为appium依赖OS X专用的库来支持IOS测试。这意味着你只能通过在mac上来运行IOS的app测试。这点限制挺大。
## 开始安装
1. 安装[nodejs](http://nodejs.org/download/) 0.8版本及以上, 通过官方的安装程序来安装。
2. 安装android的sdk包,(http://developer.android.com/sdk/index.html), 运行依赖sdk中的'android'工具。并确保你安装了Level17或以上的版本api。设置`ANDROID_HOME`系统变量为你的Android SDK路径,并把tools platform-tools两个目录加入到系统的Path路径里。因为这里面包含有一些执行命令
3. 安装java的JDK,并设置`JAVA_HOME` 变量为你的JDK目录。
4. 安装[Apache Ant](http://ant.apache.org/bindownload.cgi)
或者直接使用Android Windows SDK自带的ant,地址在eclipse\plugins目录,你需要把这个目录加到你的系统PATH变量中
5. 安装[Apache Maven](http://maven.apache.org/download.cgi). 并且设置M2HOME和M2环境变量,把M2环境变量添加到你的系统PATH变量中。
6. 安装[Git](http://git-scm.com/download/win). 确保你安装了windows下的Git,以便可以运行常用的command命令
现在,你已经下载安装了所有的依赖,开始运行
reset.bat
### 运行Appium
要在windows上运行测试用例,你需要先启动Android模拟器或者连接上一个API Level17以上的android真机。然后在命令行运行`appium`。
如果你是使用源码运行Appium的,请在你所安装的appium目录下执行node.js命令:
```center
node .
```
### 备注
* 在windows系统下运行appium.app时,需要使用管理员权限;当你通过源码的形式运行Appium时,也需要使用管理员权限启动CMD。
* 在windows系统下运行Android项目时,启动Appium时请带上`--no-reset`或`--full-reset`命令。
* 有一个硬件加速模拟器用于android,但是它有自己的一些限制,如果你想了解更多,请参考[页面](android-hax-emulator.cn.md)
* 确保在你的AVD的`config.ini`中有一个配置项为`hw.battery=yes`
### 最简略的安装方式
出于对官方文档的尊重,我按照原文翻译,如下介绍我的安装心得。官方提到的一些工具,其实并不需要安装。
下面介绍我已经测试过的安装和使用过程
### 安装appium
1. 安装nodejs
2. 使用npm安装appium,npm install -g appium
### 运行appium
启动appium,直接运行appium 即可。
### 更新appium
通过`npm install -g appium` 来更新appium即可
如果有任何疑问,欢迎到testerhome.com来交流
@@ -0,0 +1,96 @@
## Appium 故障排除
当你遇到问题时,请不要急着将问题提交到Github,也不用急着发到[appium-discuss discussion group](https://discuss.appium.io),也许你可以在本文中找到答案。
### 常见问题解决办法
* 确保你的每一个步骤都是遵循 [入门指南](/docs/cn/README.cn.md) 来做的。
* 确保你的系统配置正确。(例如:Xcode是否升级到了最新版本,Android SDK是否有设置到环境变量`ANDROID_HOME`中去。)
* 确保你的应用存放路径没有错误。
### Appium.app运行出现问题的解决办法
* 升级Appium.app后重新打开即可解决。如果提示你不能升级,则需要重新下载Appium.app,下载地址:[appium.io](http://appium.io)
### 通过源码启用Appium出现问题的解决办法
* 使用`git pull`拉取最新源码,确保运行的代码是当前最新版本。
* 针对你所自动化的平台,运行`reset.sh`命令:
|命令 | 说明 |
|-------------------------|-------------|
|./reset.sh | # all |
|./reset.sh --ios | # ios-only |
|./reset.sh --android | # android-only |
|./reset.sh --selendroid | # selendroid-only |
* 当你需要下载以及构建测试应用时,运行`reset.sh`时你需要用到`--dev`指令。
* 你也可以使用`appium-doctor`来自动检测你的环境依赖都是否正常。如果你是使用源码运行,则需要使用到`bin/appium-doctor.js`或`node bin/appium-doctor.js`。
* 当你将Android SDK升级到22后,可能出现如下错误:
`{ANDROID_HOME}/tools/ant/uibuild.xml:155: SDK does not have any Build Tools installed.`
这是因为在Android SDK 22中,platform 和 build 工具被分拆到他们各自的SDK管理包中去了。你需要确保你的机器上正确安装了build-tools 和 platform-tools。
### Android常见问题解决办法
* 确保 Android 模拟器启动并运行着。
* 出现设备连接问题时,运行`adb kill-server && adb devices`是非常有效的。它能够帮助重置和连接Android设备。
* 请确保环境变量 ANDROID_HOME 指向的是正确的Android SDK的路径。
### IOS常见问题解决方案
* 确保Instruments.app是关闭的。
* 如果你是使用模拟器运行的,请不要将真机设备连接电脑。
* 确保模拟器或真机中,设置里面的accessibility辅助功能是关闭状态的。
* 确保App是编译在当前运行的模拟器上。
* 确保App是编译在合适的模拟器(或真机)上,不然会出现`posix spawn`的报错。(比如:运行在debug模式下的模拟器)
* 如果你曾经用 sudo 运行过 Appium, 你需要先删除/tmp/instruments_sock, 执行`sudo rm /tmp/instruments_sock`。然后在不适用SUDO的情况下再次启动Appium即可。
* 第一次运行Appium时,需要对Instruments进行授权。不然的话会经常弹出对话框要求你输入密码。如果你从源代码运行 Appium,你只需在主分支上运行`sudo grunt authorize`来回避该弹窗。如果用 npm 安装的话,运行 `sudo authorize_ios` 即可。注意,当你每次安装了新版本的xcode,你都需要重复以上操作。
* 如果检查路径正确,但仍然报 `iOS Simulator failed to install the application.`的错误的时候,请尝试重启你的电脑。
### Webview/Hybrid/Safari 应用支持
* 确保真机上的'Web Inspector'为打开状态。
* 确保打开了Safari的开发模式。(Safari - Advance Preferences- Developer menu for
simulators)
* 确保由client library提供的Appium命令-`context`能够正常得对contexts进行切换。
* 当你尝试打开代理的时候,出现如下错误:select_port() failed,请参考[discussion](https://groups.google.com/forum/#!topic/appium-discuss/tw2GaSN8WX0)
### FirefoxOS常见问题解决办法
* 确保 Boot-to-Gecko 模拟器启动并运行着。
* 确保模拟器的屏幕是亮着并无锁屏的(可能需要重启 B2G).
### 到社区寻求帮助
若通过上述方法你的问题依然没有得到解决,你可以:
如果你的 Appium 无法正常工作,然后错误信息不够清晰,欢迎加入 [discussion group](https://discuss.appium.io)中发表你的问题,你的问题需要包括以下内容:
* 你是如何运行Appium的?(Appium.app, npm, source)
* 你使用的是什么操作系统?
* 你使用的是什么设备?版本是什么? (i.e. Android 4.4, or iOS 7.1)
* 你使用的是真机还是模拟器?
* 给出你得到的客户端和服务端的出错日志 (比如,"我的Python代码中报了如下错误:balabala,在Appium server中的输出内容如链接中所示")
* 除了上述, 贴出 Appium 服务器端的输出也非常重要,特别是运行在 verbose 模式。这样我们可以分析诊断问题在哪里。
如果你确信你发现的是一个BUG,请到[issue tracker](https://github.com/appium/appium/issues)中提交一个issue,并将BUG的内容描述清楚。
### 已知问题
* 如果你从 Node 官网安装的 Node,那需要你使用 sudo 运行 `npm`。 但这么做并不是非常理想。请尝试从
[n](https://github.com/visionmedia/n) 获取node 或运行`brew install node`来安装 。
* Webview通过代理可以支持iOS真机设备,请参考[discussion](https://groups.google.com/d/msg/appium-discuss/u1ropm4OEbY/uJ3y422a5_kJ)
* 有时候, iOS 的 UI 元素在定位到之后几毫秒会突然变得无效。这会导致一个类似(null) cannot be tapped的错误。唯一的解决方法就是把finding-and-acting的代码放到 retry 块里。
* 如果你是通过MacPorts安装了Node和Npm,你必须确保MacPorts的bin文件夹已经被添加到环境变量`PATH`中去,不然Appium会出现难以找到可执行`node`的情况。
### 特定的错误
|Action|Error|Resolution|
|------|-----|----------|
|Running reset.sh|xcodebuild: error: SDK "iphonesimulator6.1" cannot be located|安装 iPhone 6.1 SDK 或者 使用单独的 SDK 构建 待测应用 比如: `grunt buildApp:UICatalog:iphonesimulator5.1`|
|Running reset.sh|Warning: Task "setGitRev" not found. Use --force to continue.|使用`git submodule update --init`更新模块并再次运行`reset.sh`|
|Running reset.sh|`[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project selendroid-server: Compilation failure [ERROR] Failure executing javac, but could not parse the error: [ERROR] [ERROR] [ERROR] The system is out of resources. [ERROR] Consult the following stack trace for details. [ERROR] java.lang.StackOverflowError `|`export MAVEN_OPTS="-Xms1024m -Xmx2048m -Xss2048k"`|
|Running ios test|`[INST STDERR] posix spawn failure; aborting launch`|你的应用没有正确编译在模拟器或真机上。|
|Running mobile safari test|`error: Could not prepare mobile safari with version '7.1'`|你可能需要在此运行授权脚本以保证使iOS SDK文件为可写状态。 E.g., `sudo authorize_ios`|
@@ -0,0 +1,179 @@
##从源码运行Appium
你想要从源码运行 Appium 并帮助修复 bug 和添加新的特性么?很好! fork 这个项目,做一点更改,并且发送一个请求吧!
另外,在工作之前请先看下我们的[代码风格指南](style-guide.cn.md)。请在发送请求前,确保单元测试与功能测试都测试通过;
关于如何运行测试的更多信息,请继续阅读!
首先确保你阅读并遵循 README 中的安装说明。
###从源码配置Appium
Appium 的安装,包含在你的测试代码与设备/模拟器之间来回发送消息的 Appium 服务端,和一个用任何存在且兼容Appium的语言编写的测试脚本。
运行一个 Appium 服务器实例,然后进行你的测试。
快速开始的方式:
```center
$ git clone https://github.com/appium/appium.git
$ cd appium
$ ./reset.sh
$ sudo ./bin/authorize-ios.js # for ios only
$ node .
```
### Appium 开发环境搭建
确保你安装了 ant,maven,adb 并且将他们加入到了系统环境变量 PATH 中,与此同时你还需要安装 android-16 sdk(Selendroid) 和android-19 sdk。
从你本地仓库的命令行提示,使用下边的命令安装如下包(如果你没有使用homebrew包管理器安装 `node`,则你可能不得不使用 sudo 权限运行npm):
```center
npm install -g mocha
npm install -g grunt-cli
node bin/appium-doctor.js --dev
./reset.sh --dev
```
前两个命令安装测试和构建工具(如果你已经通过 Homebrew 包管理器安装了 node.js 就不需要 `sudo` 了)。
第三个命令验证所有的依赖关系是否设置正确(由于依赖关系构建 Appium 不同于简单的运行 Appium ),
第四个命令安装所有程序依赖关系和构建支持二进制文件和测试应用程序。
`reset.sh` 也是建议先从 master 上 pull 下改变后的内容再执行命令。
运行 `reset.sh` 加上 `--dev` 标志同时安装 git hooks 以确保代码质量在提交时是被保存过的。
此时,你可以启动 Appium 服务:
```center
node .
```
查看完整的服务文档参数列表[the server documentation](/docs/cn/writing-running-appium/server-args.cn.md)
想要实现任务自动化,请检出[Appium Grunt tasks](/docs/cn/contributing-to-appium/grunt.cn.md)来构建应用程序,安装程序,生成文档,等等。
#### 搭建iOS运行环境
为了避免启动 iOS apps 时弹出安全警告,你可以通过以下两种方法修改 /etc/authorization 文件:
1. 手动将 `/etc/authorization` 文件中 `<key>system.privilege.taskport<key/>` 下紧跟 `<allow-root>` 的元素改成 `<true/>`。
2. 运行以下grunt命令来自动修改 `/etc/authorization` 文件:
```center
sudo ./bin/authorize-ios.js
```
然后再运行以下命令:
```center
./reset.sh --ios --dev
```
现在你的 appium 实例已经准备就绪,运行 `node .` 来启动 appium server.
#### 搭建android运行环境
Bootstrap 通过运行以下命令来启动 android:
```center
./reset.sh --android --dev
```
如果你想运行[Selendroid](http://github.com/DominikDary/selendroid) 来支持2.3这样的旧的android平台,运行以下命令:
```center
./reset.sh --selendroid --dev
```
确保你有且只有一个 Android 模拟器或者真机在运行,举个例子,在其它的设备上运行此命令(假设 `emulator` 命令已经在你的 path 中了)需执行:
```center
emulator -avd <MyAvdName>
```
现在你可以通过 `node .` 启动 Appium server 了。
#### 确保更新到最新版本
由于 Appium 使用一些包的开发版本,所以经常安装新的 `npm` 包和升级不同的包是很有必要的。以下命令可以将所有平台上的包进行更新( `--dev` 标志会获取 npm dev 依赖和 Appium 测试套件中用到的应用程序)。当Appium提示版本更新时,你也可以用以下命令来更新:
```center
./reset.sh --dev
```
或者你可以只更新指定的平台:
```center
./reset.sh --ios --dev
./reset.sh --android --dev
./reset.sh --selendroid --dev
```
### 运行测试集
首先,看看我们的文档[普通情况下执行测试](/docs/cn/writing-running-appium/running-tests.cn.md) ,
然后确保你的环境在对应的平台上已经搭建好了且与你所期望的那样。
当你的环境搭建好了之后并且你的代码是最新的,你可以通过以下的方式来运行单元测试:
```center
grunt unit
```
你可以在所支持的平台上运行一些功能测试(确保后 Appium 用 `node .` 在另外一个窗口中运行):
```center
bin/test.sh
```
或者你可以通过运行 `test.sh` 来对指定的平台环境进行测试:
```center
bin/test.sh --android
bin/test.sh --ios
bin/test.sh --ios7
bin/test.sh --ios71
```
在提交代码时,请运行 `grunt` 执行一些基本的测试和核对代码质量标准的更改,请注意,这可能会自动发生的,
如果你已经运行 `reset.sh --dev` ,这于你预先提交代码的操作所关联起来的。
```center
grunt lint
> Running "newer:jshint" (newer) task
>
> Running "newer:jshint:files" (newer) task
> No newer files to process.
>
> Running "newer:jshint:test" (newer) task
> No newer files to process.
>
> Running "newer:jshint:examples" (newer) task
> No newer files to process.
>
> Running "jscs:files" (jscs) task
> >> 303 files without code style errors.
```
#### 运行单独的测试
如果你有一个 Appium 服务监听,你可以通过 Mocha 来运行单独的测试文件,例如:
```center
DEVICE=ios71 mocha -t 60000 -R spec test/functional/ios/testapp/simple.js
```
或者单独的测试集(例如,测试名称中的单词 "alert" )
```center
DEVICE=ios6 mocha -t 60000 -R spec --grep "alert" test/functional/ios/uicatalog
```
对于 windows 操作系统,你可以用 `set DEVICE=android` 在 cmd 命令行的方式中运行以上所有测试集,例如:
```center
set DEVICE=android
mocha -t 60000 -R spec test/functional/android/apidemos/alerts-specs.js
```
注意:对于安卓系统,你将需要一个屏幕大小为4.0(400x800)的模拟器/设备(emulator/device),有些测试集在不同的屏幕大小下可能会失败。
`DEVICE` 必须设置为一个有效的值:`ios71`, `ios6`, `android`, `selendroid`
@@ -0,0 +1,179 @@
##从源码运行Appium
你想要从源码运行 Appium 并帮助修复 bug 和添加新的特性么?很好! fork 这个项目,做一点更改,并且发送一个请求吧!
另外,在工作之前请先看下我们的[代码风格指南](style-guide.cn.md)。请在发送请求前,确保单元测试与功能测试都测试通过;
关于如何运行测试的更多信息,请继续阅读!
首先确保你阅读并遵循 README 中的安装说明。
###从源码配置Appium
Appium 的安装,包含在你的测试代码与设备/模拟器之间来回发送消息的 Appium 服务端,和一个用任何存在且兼容Appium的语言编写的测试脚本。
运行一个 Appium 服务器实例,然后进行你的测试。
快速开始的方式:
```center
$ git clone https://github.com/appium/appium.git
$ cd appium
$ ./reset.sh
$ sudo ./bin/authorize-ios.js # for ios only
$ node .
```
### Appium 开发环境搭建
确保你安装了 ant,maven,adb 并且将他们加入到了系统环境变量 PATH 中,与此同时你还需要安装 android-16 sdk(Selendroid) 和android-19 sdk。
从你本地仓库的命令行提示,使用下边的命令安装如下包(如果你没有使用homebrew包管理器安装 `node`,则你可能不得不使用 sudo 权限运行npm):
```center
npm install -g mocha
npm install -g grunt-cli
node bin/appium-doctor.js --dev
./reset.sh --dev
```
前两个命令安装测试和构建工具(如果你已经通过 Homebrew 包管理器安装了 node.js 就不需要 `sudo` 了)。
第三个命令验证所有的依赖关系是否设置正确(由于依赖关系构建 Appium 不同于简单的运行 Appium ),
第四个命令安装所有程序依赖关系和构建支持二进制文件和测试应用程序。
`reset.sh` 也是建议先从 master 上 pull 下改变后的内容再执行命令。
运行 `reset.sh` 加上 `--dev` 标志同时安装 git hooks 以确保代码质量在提交时是被保存过的。
此时,你可以启动 Appium 服务:
```center
node .
```
查看完整的服务文档参数列表[the server documentation](/docs/cn/writing-running-appium/server-args.cn.md)
想要实现任务自动化,请检出[Appium Grunt tasks](/docs/cn/contributing-to-appium/grunt.cn.md)来构建应用程序,安装程序,生成文档,等等。
#### 搭建iOS运行环境
为了避免启动 iOS apps 时弹出安全警告,你可以通过以下两种方法修改 /etc/authorization 文件:
1. 手动将 `/etc/authorization` 文件中 `<key>system.privilege.taskport<key/>` 下紧跟 `<allow-root>` 的元素改成 `<true/>`。
2. 运行以下grunt命令来自动修改 `/etc/authorization` 文件:
```center
sudo ./bin/authorize-ios.js
```
然后再运行以下命令:
```center
./reset.sh --ios --dev
```
现在你的 appium 实例已经准备就绪,运行 `node .` 来启动 appium server.
#### 搭建android运行环境
Bootstrap 通过运行以下命令来启动 android:
```center
./reset.sh --android --dev
```
如果你想运行[Selendroid](http://github.com/DominikDary/selendroid) 来支持2.3这样的旧的android平台,运行以下命令:
```center
./reset.sh --selendroid --dev
```
确保你有且只有一个 Android 模拟器或者真机在运行,举个例子,在其它的设备上运行此命令(假设 `emulator` 命令已经在你的 path 中了)需执行:
```center
emulator -avd <MyAvdName>
```
现在你可以通过 `node .` 启动 Appium server 了。
#### 确保更新到最新版本
由于 Appium 使用一些包的开发版本,所以经常安装新的 `npm` 包和升级不同的包是很有必要的。以下命令可以将所有平台上的包进行更新( `--dev` 标志会获取 npm dev 依赖和 Appium 测试套件中用到的应用程序)。当Appium提示版本更新时,你也可以用以下命令来更新:
```center
./reset.sh --dev
```
或者你可以只更新指定的平台:
```center
./reset.sh --ios --dev
./reset.sh --android --dev
./reset.sh --selendroid --dev
```
### 运行测试集
首先,看看我们的文档[普通情况下执行测试](/docs/cn/writing-running-appium/running-tests.cn.md) ,
然后确保你的环境在对应的平台上已经搭建好了且与你所期望的那样。
当你的环境搭建好了之后并且你的代码是最新的,你可以通过以下的方式来运行单元测试:
```center
grunt unit
```
你可以在所支持的平台上运行一些功能测试(确保后 Appium 用 `node .` 在另外一个窗口中运行):
```center
bin/test.sh
```
或者你可以通过运行 `test.sh` 来对指定的平台环境进行测试:
```center
bin/test.sh --android
bin/test.sh --ios
bin/test.sh --ios7
bin/test.sh --ios71
```
在提交代码时,请运行 `grunt` 执行一些基本的测试和核对代码质量标准的更改,请注意,这可能会自动发生的,
如果你已经运行 `reset.sh --dev` ,这于你预先提交代码的操作所关联起来的。
```center
grunt lint
> Running "newer:jshint" (newer) task
>
> Running "newer:jshint:files" (newer) task
> No newer files to process.
>
> Running "newer:jshint:test" (newer) task
> No newer files to process.
>
> Running "newer:jshint:examples" (newer) task
> No newer files to process.
>
> Running "jscs:files" (jscs) task
> >> 303 files without code style errors.
```
#### 运行单独的测试
如果你有一个 Appium 服务监听,你可以通过 Mocha 来运行单独的测试文件,例如:
```center
DEVICE=ios71 mocha -t 60000 -R spec test/functional/ios/testapp/simple.js
```
或者单独的测试集(例如,测试名称中的单词 "alert" )
```center
DEVICE=ios6 mocha -t 60000 -R spec --grep "alert" test/functional/ios/uicatalog
```
对于 windows 操作系统,你可以用 `set DEVICE=android` 在 cmd 命令行的方式中运行以上所有测试集,例如:
```center
set DEVICE=android
mocha -t 60000 -R spec test/functional/android/apidemos/alerts-specs.js
```
注意:对于安卓系统,你将需要一个屏幕大小为4.0(400x800)的模拟器/设备(emulator/device),有些测试集在不同的屏幕大小下可能会失败。
`DEVICE` 必须设置为一个有效的值:`ios71`, `ios6`, `android`, `selendroid`
@@ -0,0 +1,15 @@
# 名单
### 以下这些项目,鼓舞了我们,成就了 Appium。
* [Apple UIAutomation](http://developer.apple.com/library/ios/#documentation/DeveloperTools/Reference/UIAutomationRef/_index.html)
* [GhostDriver](https://github.com/detro/ghostdriver)
* [IOS Auto](https://github.com/penguinho/applecart)
* [IOS Driver](https://github.com/ios-driver/ios-driver)
* [Mechanic.js](https://github.com/jaykz52/mechanic)
* [node-webkit](https://github.com/rogerwang/node-webkit)
* [Remote Debug](https://github.com/leftlogic/remote-debug)
* [Selenium Project](http://code.google.com/p/selenium/)
* [ios-webkit-debug-proxy](https://github.com/google/ios-webkit-debug-proxy)
* [instruments-without-delay](https://github.com/facebook/instruments-without-delay)
* [deviceconsole](https://github.com/rpetrich/deviceconsole)
@@ -0,0 +1,35 @@
# Appium grunt 命令
[Grunt](http://gruntjs.com) 是 Node.js 的 Make! 我们用它来自动化所有的 appium 开发任务。 下面就是你能做的:
|任务|描述|
|----|-----------|
|grunt lint|运行 JSLint|
|grunt test|运行所有的测试|
|grunt functional|运行整个功能测试集|
|grunt ios|运行 iOS 功能测试集|
|grunt android|运行 Android 功能测试集|
|grunt selendroid|运行 selendroid 功能测试集|
|grunt firefoxos|运行 firefoxos 功能测试集|
|grunt unit|运行所有的单元测试|
|grunt getSampleCode|下载示例代码和示例app. 接受`:hardcore` 参数
|grunt buildApp:&lt;AppName&gt;:&lt;SDK&gt;|构建一个用于 iPhone 模拟器的 iOS 应用。 我们预计这个应用的路径是 `sample-code/apps/<AppName>/build/Release-iphonesimulator/<AppName>.app`. 默认的 SDK 是 'iphonesimulator7.1'|
|grunt signApp:&lt;certName&gt;|使用开发证书的绝对路径,签名测试应用。|
|grunt authorize|授权模拟器,使它不需要弹框请求权限。|
|grunt log|打印 appium.log (运行测试的时候很有用)|
|grunt configAndroidBootstrap|配置使用 ant 构建 Android 的 bootstrap.jar|
|grunt buildAndroidBootstrap|使用 ant 构建 bootstrap.jar|
|grunt buildSelendroidServer|构建 selendroid 服务器|
|grunt configAndroidApp:&lt;AppName&gt;|配置使用 ant 构建 android 测试应用。 我们期待有一个 `sample-code/apps/<AppName>` 的 Android 项目|
|grunt buildAndroidApp:&lt;AppName&gt;|使用 ant 构建项目. 会在 `sample-code/apps/<AppName>` 下生成应用。|
|grunt installAndroidApp:&lt;AppName&gt;|将安卓应用安装到模拟器和设备中去|
|grunt docs|生成文档|
|grunt generateAppiumIo|将 README.md 转成 appium.io 的 getting-started.html|
|grunt setConfigVer:&lt;device&gt;|将 package.json 里面 appium 的版本号和对应设备写入 `.appiumconfig.json` 文件|
## 其他
`grunt buildApp` 默认使用 iPhone 6.1 模拟器的 SDK 来构建应用。你可以传其他的 SDK 给 grunt 命令。
(用 `xcodebuild -showsdks` 找出你所有的 sdk):
> grunt buildApp:UICatalog:iphonesimulator6.0
@@ -0,0 +1,58 @@
## 如何去写文档
`##` 被用于写第二级标题。每个文档必须以第二级标题开头。
这是为了支持appium.io文档的生成,不要使用下划线`---`的方式来创建标题。
不要使用第一级标题或者 `===` 底线方式来创建标题(其中文件夹名字被用于第一级标题)
### 小标题
`###` 用于小标题。
### 普通标题
`####` 用于不会出现在目录中的标题。
不要使用第五级标题 `#####`, 或者第六级标题 `######`。
### 分隔线
不要使用分隔线例如 `--` 或者 `---`。 这会使 Slate 混乱。
### 链接
链接到 readme:
`[readme](../../README.md)`
链接到 contributing:
`[contributing](../../CONTRIBUTING.md)`
链接到其他文档:
`[link text](filename.md)`
链接到文档的内部, 使用 `#` 来标记 Slate 链接。
`[go direct to json](filename.md#json-wire-protocol-server-extensions)`
需要注意的是当标题改变时,哈希链接会损坏。所以链接到文档的开头是最好的( `other.md` 替换 `other.md#something` )。
### appium.io兼容性
#### 在appium.io中心对齐代码
Appium.io中文档使用 [slate](https://github.com/tripit/slate) 来作为文档标准
如果在文件中的代码段不是特定语言或如果你想要代码片段保持与文本中心对齐在 appium.io 文档中,请把代码块放在中心位置
例子:
```中心
代码片段放在这里
```
#### 发布
发布文档请在appium.io中查看 [api-docs](https://github.com/appium/api-docs) 和
在 [appium.io](https://github.com/appium/appium.io) 中查看。
@@ -0,0 +1,263 @@
# 贡献者的代码风格指南
感谢你们对 Appium 的贡献! 这些是我们书写 javascript 代码时使用的基本原则。
请遵守这些,避免风格的来回修改,以便我们可以合并你的 pull 请求。
基本原则就是:*让你的代码看起来和周围的代码一致*。
## 衍合(Rebasing)
每个 pull 请求中的提交(commits)必须包括 [logical changes](https://github.com/appium/appium/pull/920#issuecomment-21588553)。
如果有多个作者,确认每个作者有自己的提交。最好不要修改作者信息。
合并(merge)提交必须从 pull 请求中 rebase 。
## 检错(Linting)
所有的代码 (除了 `bootstrap.js` 的代码,它使用了 Apple 的私有方法) 必须通过 JSLint。
为了检查你的代码,你可以在 Appium 存储目录下,简单地运行 `grunt lint`。
如果你已创建一个新的 .js 文件,请确认它在 `grunt.js` 中被通配符覆盖,或者被专门添加。
边输入边检错你的代码是容易实现的,使得整个进程更加顺利。
我们喜欢 [jshint](http://www.jshint.com), 因为它有与许多源代码编辑器的集成。
文件 `.jshintrc` 加入到仓库中,它的内容是:
```json
{
"laxcomma": true,
"strict": true,
"undef": true,
"unused": true,
"trailing": true,
"node": true,
"es5": true,
"white": true,
"indent": 2
}
```
因为jshint不再执行代码风格,我们也使用 [jscs](https://github.com/mdevils/node-jscs),它其中也存在许多源代码编辑器的集成。配置文件是:
```json
{
"excludeFiles": ["submodules/**", "node_modules/**",
"./lib/server/static/**", "./lib/devices/firefoxos/atoms/*.js",
"./test/harmony/**/*.js", "./sample-code/examples/node/**/*-yiewd.js",
"./sample-code/apps/**", "./sample-code/examples/php/vendor/**"],
"requireCurlyBraces": ["for", "while", "do", "try", "catch"],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch",
"return", "try", "catch", "function"],
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
}
}
```
你将在你喜欢的编辑器中看到这些在配置文件中定义的警告类型,查看[this page for jshint](http://www.jshint.com/platforms/) 和
[this page for jscs](https://github.com/mdevils/node-jscs#friendly-packages),编辑器和平台列表,找到使你的编辑器自动化检错的设置方法。
## 风格注意点
* 使用两个空格来缩进, *不要使用 tabs*
* 在运算符两边,分别添加一个空格:
```js
var x = 1;
```
而不是
```js
var x=1;
```
* 在 lists, objects, function calls 等中,逗号和冒号后面需要添加一个空格:
```js
var x = myFunc("lol", {foo: bar, baz: boo});
```
而不是
```js
var x = myFunc("lol",{foo:bar,baz:boo});
```
* 代码语句一般以分号结尾
* 以逗号开头:
```js
var x = {
foo: 'bar'
, baz: 'boo'
, wuz: 'foz'
};
```
* 左花括号应该和 `function`, `if` 等 写在同一行, `else` 被夹在两个花括号中间:
```js
if (foo === bar) {
// do something
} else {
// do something else
}
```
* `if`, `for`, 和 `function` 之后需要添加空格:
```js
if (foo === bar) {
```
```js
for (var i = 0; i < 10; i ++) {
```
```js
var lol = function (foo) {
```
而不是
```js
if(foo === bar) {
```
```js
for(var i = 0; i < 10; i ++) {
```
```js
var lol = function(foo) {
```
* 只有一行代码时,花括号也应该添加上:
```js
if (foo === bar) {
foo++;
}
```
而不是
```js
if (foo === bar)
foo++;
```
* 一般情况下,使用 `===`, 而不是 `==`; 使用 `!==`, 而不是 `!=`
* 单行长度不应超过79个字符
* 截断长字符串,方法如下:
```js
myFunc("This is a really long string that's longer " +
"than 79 characters so I broke it up, woo");
```
* 注释需要和上一行代码左对齐:
```js
if (foo === 5) {
myFunc(foo);
// foo++;
}
```
而不是
```js
if (foo === 5) {
myFunc(foo);
//foo++;
}
```
除了出错后直接调用回调函数(callback)处理错误(error)的语句
```javascript
if (err) return cb(err);
```
* 通过拓展原型,来创建子类:
```js
var _ = require('underscore');
var SuperClass = function () {
this.init();
};
SuperClass.prototype.init = function () {
// initialize
};
// Create a subclass
var SubClass = function () {
this.init();
};
_.extend(SubClass.prototype, SuperClass.prototype);
```
* 函数定义中,最后使用回调函数:
```js
var foo = function (arg1, arg2, cb) {
...
};
```
* 使用变量来定义函数:
```js
var myFunc = function (a, b, c) {};
```
而不是
```js
function myFunc (a, b, c) {}
```
* 变量名应该是驼峰式大小写风格:
```js
var myVariable = 42;
```
而不是
```js
var my_variable = 42;
```
* 检查是否有未定义的变量:
```js
typeof myVariable === "undefined"
```
而不是
```js
myVariable === undefined
```
## 试验风格:
在代码语义通顺和长度许可下,可以保持在同一行:
样例:
```js
driver.elementByTagName('el1').should.become("123")
.nodeify(done);
driver
.elementsByTagName('el1').should.eventually.have.length(0)
.nodeify(done);
```
或者使用缩进来提高代码的可读性:
```js
h.driver
.elementById('comments')
.clear()
.click()
.keys("hello world")
.getValue()
.should.become("hello world")
.elementById('comments')
.getValue().should.become("hello world")
.nodeify(done);
h.driver
.execute("'nan'--")
.should.be.rejectedWith("status: 13")
.nodeify(done);
```
File diff suppressed because it is too large Load Diff
+85
View File
@@ -0,0 +1,85 @@
## Appium 服务关键字
<expand_table>
|关键字|描述|实例|
|----|-----------|-------|
|`automationName`|你想使用的自动化测试引擎|`Appium` (默认) 或 `Selendroid`|
|`platformName`|你要测试的手机操作系统|`iOS`, `Android`, 或 `FirefoxOS`|
|`platformVersion`|手机操作系统版本|例如: `7.1`, `4.4`|
|`deviceName`|使用的手机类型或模拟器类型|`iPhone Simulator`, `iPad Simulator`, `iPhone Retina 4-inch`, `Android Emulator`, `Galaxy S4`, 等。在 iOS 上,这个关键字的值必须是使用 `instruments -s devices` 得到的可使用的设备名称之一。在 Android 上,这个关键字目前不起作用。|
|`app`|`.ipa` or `.apk`文件所在的本地绝对路径或者远程路径,也可以是一个包括两者之一的`.zip`。 Appium会先尝试安装路径对应的应用在适当的真机或模拟器上。针对Android系统,如果你指定`app-package`和`app-activity`(具体见下面)的话,那么就可以不指定`app`。 **会与 `browserName` 冲突** |比如`/abs/path/to/my.apk`或`http://myapp.com/app.ipa`|
|`browserName`|需要进行自动化测试的手机 web 浏览器名称。如果是对应用进行自动化测试,这个关键字的值应为空。|iOS 系统上可以用 'Safari' ,Android 系统上可以用 'Chrome', 'Chromium', 或 'Browser'。|
|`newCommandTimeout`|设置命令超时时间,单位:秒。达到超时时间仍未接收到新的命令时 Appium 会假设客户端退出然后自动结束会话。|比如 `60`
|`autoLaunch`|Appium是否需要自动安装和启动应用。默认值`true`|`true`, `false`|
|`language`| (Sim/Emu-only) 设定模拟器 ( simulator / emulator ) 的语言。|如: `fr`|
|`locale`| (Sim/Emu-only) 设定模拟器 ( simulator / emulator ) 的区域设置。|如: `fr_CA`|
|`udid`| 连接的物理设备的唯一设备标识|如: `1ae203187fc012g`|
|`orientation`| (Sim/Emu-only) 在一个设定的方向模式中开始测试|`LANDSCAPE` (横向) 或 `PORTRAIT` (纵向) |
|`autoWebview`| 直接转换到 WebView 上下文。 默认值 `false`、|`true`, `false`|
|`noReset`|不要在会话前重置应用状态。默认值`false`。|`true`, `false`|
|`fullReset`|(iOS) 删除整个模拟器目录。(Android) 通过卸载——而不是清空数据——来重置应用状态。在 Android 上,这也会在会话结束后自动清除被测应用。默认值 `false`|`true`, `false`|
### Android特有
<expand_table>
|关键字|描述|实例|
|----|-----------|-------|
|`appActivity`| 你要从你的应用包中启动的 Android Activity 名称。它通常需要在前面添加 `.` (如:使用`.MainActivity` 而不是 `MainActivity`) |`MainActivity`, `.Settings`|
|`appPackage`| 你想运行的Android应用的包名|比如`com.example.android.myApp`, `com.android.settings`|
|`appWaitActivity`| 你想要等待启动的 Android Activity 名称|`SplashActivity`|
|`deviceReadyTimeout`| 设置等待一个模拟器或真机准备就绪的超时时间|`5`|
|`androidCoverage`| 用于执行测试的 instrumentation 类。作为命令 `adb shell am instrument -e coverage true -w` 的 `-w` 参数。| `com.my.Pkg/com.my.Pkg.instrumentation.MyInstrumentation`|
|`enablePerformanceLogging`| (仅适用于 Chrome 和 webview) 开启 Chromedriver 的性能日志。 (默认 `false`) | `true`, `false`|
|`androidDeviceReadyTimeout`|等待设备在启动应用后准备就绪的超时时间。以秒为单位。|如 `30`|
|`androidDeviceSocket`|开发工具的 socket 名称。只有在被测应用是一个使用 Chromium 内核的浏览器时需要。 socket 会被浏览器打开,然后 Chromedriver 把它作为开发者工具来进行连接。|如 `chrome_devtools_remote`|
|`avd`| 需要启动的 AVD (安卓虚拟设备) 名称。|如 `api19`|
|`avdLaunchTimeout`| 以毫秒为单位,等待 AVD 启动并连接到 ADB 的超时时间。(默认值 `120000`)| `300000`|
|`avdReadyTimeout`| 以毫秒为单位,等待 AVD 完成启动动画的超时时间。(默认值 `120000`)| `300000`|
|`avdArgs`| 启动 AVD 时需要加入的额外的参数。|如 `-netfast`|
|`useKeystore`| 使用一个自定义的 keystore 来对 apk 进行重签名。默认值 `false`|`true` or `false`|
|`keystorePath`| 自定义 keystore 的路径。默认: ~/.android/debug.keystore|如 `/path/to.keystore`|
|`keystorePassword`| 自定义 keystore 的密码。|如 `foo`|
|`keyAlias`| key 的别名 |如 `androiddebugkey`|
|`keyPassword`| key 的密码 |如 `foo`|
|`chromedriverExecutable`| webdriver 可执行文件的绝对路径 (如果 Chromium 核心提供了对应的 webdriver, 应该用它代替 Appium 自带的 webdriver) |`/abs/path/to/webdriver`|
|`autoWebviewTimeout`| 以毫秒为单位,等待 Webview 上下文激活的时间。默认值 `2000`| 如 `4`|
|`intentAction`| 用于启动 activity 的 intent action。 (默认值 `android.intent.action.MAIN`)| 如 `android.intent.action.MAIN`, `android.intent.action.VIEW`|
|`intentCategory`| 用于启动 activity 的 intent category。 (默认值 `android.intent.category.LAUNCHER`) | 如 `android.intent.category.LAUNCHER`, `android.intent.category.APP_CONTACTS`
|`intentFlags`| 用于启动 activity 的标识 ( flags ) (默认值 `0x10200000`) | 如 `0x10200000`
|`optionalIntentArguments`| 用于启动 activity 的额外 intent 参数。请查看 [Intent 参数](http://developer.android.com/tools/help/adb.html#IntentSpec) | 如 `--esn <EXTRA_KEY>`, `--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE>`
|`stopAppOnReset`| 在使用 adb 启动应用前停止被测应用的进程 ( process ) 。如果被测应用是被另一个应用创建的,当这个参数被设定为 false 时,允许另一个应用的进程在使用 adb 启动被测应用时继续存活。默认值 `true`| `true` 或 `false`|
|`unicodeKeyboard`| 使用 Unicode 输入法。默认值 `false`| `true` 或 `false`|
|`resetKeyboard`| 在设定了 `unicodeKeyboard` 关键字的 Unicode 测试结束后,重置输入法到原有状态。如果单独使用,将会被忽略。默认值 `false`| `true` 或 `false`|
|`noSign`| 跳过检查和对应用进行 debug 签名的步骤。只能在使用 UiAutomator 时使用,使用 selendroid 是不行。默认值 `false` | `true` 或 `false`|
|`ignoreUnimportantViews`| 调用 uiautomator 的函数 `setCompressedLayoutHierarchy()`。由于 Accessibility 命令在忽略部分元素的情况下执行速度会加快,这个关键字能加快测试执行的速度。被忽略的元素将不能够被找到,因此这个关键字同时也被实现成可以随时改变的 *设置 ( settings ) * 。默认值 `false` | `true` 或 `false`
### iOS特有
<expand_table>
|关键字|描述|实例|
|----|-----------|-------|
|`calendarFormat`| (Sim-only) 为iOS的模拟器设置日历格式|如 `gregorian` (公历) |
|`bundleId`| 被测应用的 bundle ID 。用于在真实设备中启动测试,也用于使用其他需要 bundle ID 的关键字启动测试。在使用 bundle ID 在真实设备上执行测试时,你可以不提供 `app` 关键字,但你必须提供 `udid` 。|如 `io.appium.TestApp`|
|`udid`| 连接的真实设备的唯一设备编号 ( Unique device identifier ) |如 `1ae203187fc012g`|
|`launchTimeout`| 以毫秒为单位,在 Appium 运行失败之前设置一个等待 instruments 的时间 |比如: `20000`|
|`locationServicesEnabled`| (Sim-only) 强制打开或关闭定位服务。默认值是保持当前模拟器的设定|`true` 或 `false`|
|`locationServicesAuthorized`| (Sim-only) 通过修改 plist 文件设定是否允许应用使用定位服务,从而避免定位服务的警告出现。默认值是保持当前模拟器的设定。请注意在使用这个关键字时,你同时需要使用 `bundleId` 关键字来发送你的应用的 bundle ID。|`true` 或者 `false`|
|`autoAcceptAlerts`| 当 iOS 的个人信息访问警告 (如 位置、联系人、图片) 出现时,自动选择接受( Accept )。默认值 `false`。|`true` 或者 `false`|
|`autoDismissAlerts`| 当 iOS 的个人信息访问警告 (如 位置、联系人、图片) 出现时,自动选择不接受( Dismiss )。默认值 `false`。|`true` 或者 `false`|
|`nativeInstrumentsLib`| 使用原生 intruments 库 (即关闭 instruments-without-delay ) |`true` 或者 `false`|
|`nativeWebTap`| (Sim-only) 在Safari中允许"真实的",非基于 javascript 的 web 点击 (tap) 。 默认值: `false`。注意:取决于 viewport 大小/比例, 点击操作不一定能精确地点中对应的元素。|`true` 或者 `false`|
|`safariInitialUrl`| (Sim-only) (>= 8.1) 初始化 safari 的时使用的地址。默认是一个本地的欢迎页面 | 如 `https://www.github.com` |
|`safariAllowPopups`| (Sim-only) 允许 javascript 在 Safari 中创建新窗口。默认保持模拟器当前设置。|`true` 或者 `false`|
|`safariIgnoreFraudWarning`| (Sim-only) 阻止 Safari 显示此网站可能存在风险的警告。默认保持浏览器当前设置。|`true` 或者 `false`|
|`safariOpenLinksInBackground`| (Sim-only) Safari 是否允许链接在新窗口打开。默认保持浏览器当前设置。|`true` 或者 `false`|
|`keepKeyChains`| (Sim-only) 当 Appium 会话开始/结束时是否保留存放密码存放记录 (keychains) (库(Library)/钥匙串(Keychains)) |`true` 或者 `false`|
|`localizableStringsDir`| 从哪里查找本地化字符串。默认值 `en.lproj`|`en.lproj`|
|`processArguments`| 通过 instruments 传递到 AUT 的参数 |如 `-myflag`|
|`interKeyDelay`| 以毫秒为单位,按下每一个按键之间的延迟时间。|如 `100`|
|`showIOSLog`| 是否在 Appium 的日志中显示设备的日志。默认值 `false`|`true` 或者 `false`|
|`sendKeyStrategy`| 输入文字到文字框的策略。模拟器默认值:`oneByOne` (一个接着一个) 。真实设备默认值:`grouped` (分组输入) |`oneByOne`, `grouped` 或 `setValue`|
|`screenshotWaitTimeout`| 以秒为单位,生成屏幕截图的最长等待时间。默认值: 10。 |如 `5`|
|`waitForAppScript`| 用于判断 "应用是否被启动” 的 iOS 自动化脚本代码。默认情况下系统等待直到页面内容非空。结果必须是布尔类型。 |例如 `true;`, `target.elements().length > 0;`, `$.delay(5000); true;` |

Some files were not shown because too many files have changed in this diff Show More