-
-
Notifications
You must be signed in to change notification settings - Fork 10
62 lines (59 loc) · 1.67 KB
/
functional-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Functional Tests
on:
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
env:
CI: true
APPIUM_TEST_SERVER_PORT: 4567
APPIUM_TEST_SERVER_HOST: 127.0.0.1
APPIUM_STARTUP_TIMEOUT_SEC: 30
_FORCE_LOGS: 1
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
check-latest: true
- run: |
npm install -g appium
npm install
name: Install dev dependencies
- run: |
cwd=$(pwd)
pushd "$cwd"
cd ~
appium driver install --source=local "$cwd"
nohup appium server \
--port=$APPIUM_TEST_SERVER_PORT \
--address=$APPIUM_TEST_SERVER_HOST \
--relaxed-security \
2>&1 > "$cwd/appium.log" &
popd
name: Start Appium server
- 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: Wait for Appium server startup
- run: npm run e2e-test
name: Run functional tests
- name: Save server output
if: ${{ always() }}
uses: actions/upload-artifact@master
with:
name: appium.log
path: appium.log