Skip to content

Commit 03fa0a5

Browse files
authored
test: check with geo (#661)
* tune up a bit * test: check with geo * revert the workaround
1 parent 87eabe4 commit 03fa0a5

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

.github/workflows/functional-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
- run: |
9090
appium plugin install images
9191
appium plugin install execute-driver
92-
# Workaround to keep symlink to global appium
92+
# Workaround to keep symlink to global appium with plugins
9393
appium driver install xcuitest
9494
nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium.log &
9595
@@ -166,7 +166,7 @@ jobs:
166166
- run: |
167167
appium plugin install images
168168
appium plugin install execute-driver
169-
# Workaround to keep symlink to global appium
169+
# Workaround to keep symlink to global appium with plugins
170170
appium driver install xcuitest
171171
nohup appium --use-plugins=images,execute-driver --relaxed-security --log-timestamp --log-no-colors 2>&1 > appium.log &
172172

test/functional/android/webdriver/device_test.rb

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,34 @@ def test_page_source
5757
end
5858

5959
def test_location
60-
latitude = 100
61-
longitude = 100
60+
latitude = 80
61+
longitude = -80
6262
altitude = 75
6363
@driver.set_location(latitude, longitude, altitude)
6464

6565
return if ci?
6666

67-
# Here has been improved in Appium 1.14.0, but it is still unstable on Emulator...
6867
loc = @@core.wait { @driver.location } # check the location
69-
assert_equal 100, loc.latitude
70-
assert_equal 100, loc.longitude
68+
assert_equal 80, loc.latitude
69+
assert_equal(-80, loc.longitude)
7170
assert_equal 75, loc.altitude
7271
end
7372

73+
def test_location_with_mobile_ext
74+
latitude = 80
75+
longitude = -80
76+
altitude = 75
77+
@driver.execute_script(
78+
'mobile: setGeolocation',
79+
{ latitude: latitude, longitude: longitude, altitude: altitude }
80+
)
81+
82+
loc = @@core.wait { @driver.execute_script 'mobile: getGeolocation' } # check the location
83+
assert_equal 80, loc['latitude']
84+
assert_equal(-80, loc['longitude'])
85+
assert_equal 75, loc['altitude']
86+
end
87+
7488
def test_accept_alert
7589
@@core.wait { @driver.find_element :accessibility_id, 'App' }.click
7690
@@core.wait { @driver.find_element :accessibility_id, 'Alert Dialogs' }.click

0 commit comments

Comments
 (0)