Skip to content

Commit 4f71c9b

Browse files
author
Vasil Hristov
authored
Add ability to run tests on different emulators api levels. (#344)
1 parent 682d040 commit 4f71c9b

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

core/settings/Settings.py

+18-1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,20 @@ class IOS(object):
156156
DEBUG_PORT = 41000
157157

158158

159+
def resolve_default_emulator(environment_variable, default_value):
160+
avd_value = os.environ.get(environment_variable, default_value.avd)
161+
emulator_switcher = {
162+
"Api19": Emulators.EMU_API_19,
163+
"Api23": Emulators.EMU_API_23,
164+
"Api24": Emulators.EMU_API_24,
165+
"Api26": Emulators.EMU_API_26,
166+
"Api28": Emulators.EMU_API_28,
167+
"Api29": Emulators.EMU_API_29,
168+
"Api23-64": Emulators.EMU_API_23_64,
169+
}
170+
return emulator_switcher.get(avd_value, default_value)
171+
172+
159173
class Emulators(object):
160174
EMU_API_19 = EmulatorInfo(avd=os.environ.get('EMU_API_19', 'Emulator-Api19-Default'), os_version=4.4, port='5560',
161175
emu_id='emulator-5560')
@@ -172,7 +186,10 @@ class Emulators(object):
172186
EMU_API_23_64 = EmulatorInfo(avd=os.environ.get('EMU_API_23_64', 'Emulator-Api23-64'), os_version=6.0, port='5570',
173187
emu_id='emulator-5570')
174188

175-
DEFAULT = EMU_API_23
189+
DEFAULT = ""
190+
191+
192+
Emulators.DEFAULT = resolve_default_emulator("EMULATOR_API_VERSION", Emulators.EMU_API_23)
176193

177194

178195
class Simulators(object):

0 commit comments

Comments
 (0)