Skip to content

Commit

Permalink
Merge pull request #2291 from selenide/merge-selenide-appium
Browse files Browse the repository at this point in the history
Merge selenide appium
  • Loading branch information
asolntsev committed May 23, 2023
2 parents f775d17 + 765be5d commit e71efbe
Show file tree
Hide file tree
Showing 99 changed files with 4,164 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 136

# Markdown files
[*.yml]
indent_size = 2

[*.bat]
end_of_line = crlf

[*.md]
trim_trailing_whitespace = false
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ If necessary, describe the problem you have been experiencing in more detail.
## Tell us about your environment
* **Selenide Version**:
* **Chrome\Firefox\IE Version**:
* **Browser Driver Version**:
* **Browser Driver Version**:
* **Selenide-Appium Version**:
* **IOS\Android\WEB version**:
* **Selenium Version**:
* **OS Version**:

Expand Down
145 changes: 144 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,153 @@ jobs:
**/build/reports
**/build/test-results
run-android-tests:
runs-on: macOS-12
env:
APPIUM_TEST_SERVER_PORT: 4723
APPIUM_TEST_SERVER_HOST: 127.0.0.1
APPIUM_STARTUP_TIMEOUT_SEC: 30
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
cache: 'gradle'
java-version: '11'
- uses: actions/cache@v3
with:
path: build/apps
key: ${{ runner.os }}-android-tests-${{ hashFiles('**/*.zip*') }}
restore-keys: |
${{ runner.os }}-android-tests-
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Appium
run: |
npm install -g appium@next
npm install -g appium-doctor
- name: Start Appium server
run: |
cwd=$(pwd)
pushd "$cwd"
cd ~
appium driver install uiautomator2
appium-doctor
nohup appium \
--base-path /wd/hub \
--relaxed-security \
2>&1 > "$cwd/appium.log" &
popd
- name: Wait for Appium server startup
run: |
seconds_started=$(date +%s)
while ! nc -z $APPIUM_TEST_SERVER_HOST $APPIUM_TEST_SERVER_PORT; do
sleep 0.1
seconds_elapsed=$(( $(date +%s) - seconds_started ))
if [[ $seconds_elapsed -gt $APPIUM_STARTUP_TIMEOUT_SEC ]]; then
echo "Appium server was unable to start within $APPIUM_STARTUP_TIMEOUT_SEC seconds timeout"
exit 1
fi
done
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 28
profile: pixel_3_xl
disable-animations: true
emulator-options: -no-snapshot -no-window -no-boot-anim -camera-back emulated -camera-front emulated -gpu swiftshader_indirect
script: ./gradlew clean android --info
- uses: actions/upload-artifact@v3
if: failure()
with:
name: test-report-android
path: |
build/reports/
appium.log
run-ios-tests:
runs-on: macOS-12
env:
APPIUM_TEST_SERVER_PORT: 4723
APPIUM_TEST_SERVER_HOST: 127.0.0.1
APPIUM_STARTUP_TIMEOUT_SEC: 30
steps:
- uses: actions/checkout@v3
- name: Setup iOS simulator
uses: futureware-tech/simulator-action@v2
with:
model: 'iPhone 14'
os: 'iOS'
os_version: '16.2'
- uses: actions/cache@v3
with:
path: build/apps
key: ${{ runner.os }}-ios-tests-${{ hashFiles('**/*.zip*') }}
restore-keys: |
${{ runner.os }}-ios-tests-
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Appium
run: |
npm install -g appium@next
npm install -g appium-doctor
- name: Log Xcode Version
run: xcodebuild -version
- name: Log Installed Simulators
run: xcrun simctl list
- name: Log Runtimes
run: xcrun simctl list runtimes
- name: Start Appium server
run: |
cwd=$(pwd)
pushd "$cwd"
cd ~
appium driver install xcuitest
appium driver install safari
appium-doctor
nohup appium \
--base-path /wd/hub \
--relaxed-security \
2>&1 > "$cwd/appium.log" &
popd
- name: Wait for Appium server startup
run: |
seconds_started=$(date +%s)
while ! nc -z $APPIUM_TEST_SERVER_HOST $APPIUM_TEST_SERVER_PORT; do
sleep 0.1
seconds_elapsed=$(( $(date +%s) - seconds_started ))
if [[ $seconds_elapsed -gt $APPIUM_STARTUP_TIMEOUT_SEC ]]; then
echo "Appium server was unable to start within $APPIUM_STARTUP_TIMEOUT_SEC seconds timeout"
exit 1
fi
done
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
cache: 'gradle'
java-version: '11'
- name: Run iOS tests
run: ./gradlew ios --no-daemon --console=plain -i
- uses: actions/upload-artifact@v3
if: failure()
with:
name: test-report-ios
path: |
build/reports/
appium.log
auto-merge-dependabot:
name: 🤖 Auto merge dependabot PR
timeout-minutes: 10
needs: [run-tests-on-linux, run-tests-on-windows]
needs: [run-tests-on-linux, run-tests-on-windows, run-android-tests, run-ios-tests]
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
permissions:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build
hs_err_pid*
!.idea
.idea/*
!/.idea/icon.svg
Expand All @@ -16,4 +17,4 @@ classes

# Ignore all binary files
modules/*/bin
statics/bin
statics/bin
19 changes: 19 additions & 0 deletions .run/android tests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="android tests" type="JUnit" factoryName="JUnit">
<module name="selenide.modules.appium.test" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="it.mobile.android.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="it.mobile.android" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
19 changes: 19 additions & 0 deletions .run/ios tests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="ios tests" type="JUnit" factoryName="JUnit">
<module name="selenide.modules.appium.test" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="it.mobile.ios.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="it.mobile.ios" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="package" />
<option name="WORKING_DIRECTORY" value="$MODULE_DIR$" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void login() {
Look for [detailed comparison of Selenide and Selenium WebDriver API](https://github.com/selenide/selenide/wiki/Selenide-vs-Selenium).

#### Selenide for mobile apps
You can use Selenide for testing mobile applications. See plugin [selenide-appium](https://github.com/selenide/selenide-appium).
You can use Selenide for testing mobile applications. See plugin [selenide-appium](https://github.com/selenide/selenide/tree/main/modules/selenide-appium).

#### Selenide with Selenoid
You can use Selenide for running tests in Selenoid containers. See plugin [selenide-selenoid](https://github.com/selenide/selenide-selenoid).
Expand Down

0 comments on commit e71efbe

Please sign in to comment.