Skip to content

Commit eff252c

Browse files
committed
e2e: added smoke tests for android 12 and 13
1 parent ab12c8a commit eff252c

File tree

2 files changed

+46
-10
lines changed

2 files changed

+46
-10
lines changed

test/appium/tests/base_test_case.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ def get_lambda_test_capabilities_real_device():
4949
return options
5050

5151

52-
def get_lambda_test_capabilities_emulator():
52+
def get_lambda_test_capabilities_emulator(platform_version: int = 14, device_name: str = "Pixel 6"):
5353
capabilities = {
5454
"lt:options": {
5555
"w3c": True,
5656
"platformName": "android",
57-
"deviceName": "Pixel 6",
57+
"deviceName": device_name,
5858
"appiumVersion": "2.1.3",
59-
"platformVersion": "14",
59+
"platformVersion": str(platform_version),
6060
"app": pytest_config_global['lt_apk_url'],
6161
"devicelog": True,
6262
"visual": True,
@@ -179,18 +179,19 @@ def verify_no_errors(self):
179179
pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
180180

181181

182-
def create_shared_drivers(quantity):
182+
def create_shared_drivers(quantity: int, platform_version: int = 14, device_name: str = "Pixel 6"):
183183
drivers = dict()
184184
loop = asyncio.new_event_loop()
185185
asyncio.set_event_loop(loop)
186186
print('LT Executor: %s' % executor_lambda_test)
187187
try:
188-
drivers = loop.run_until_complete(start_threads(test_suite_data.current_test.name,
189-
quantity,
190-
Driver,
191-
drivers,
192-
command_executor=executor_lambda_test,
193-
options=get_lambda_test_capabilities_emulator()))
188+
drivers = loop.run_until_complete(
189+
start_threads(test_suite_data.current_test.name,
190+
quantity,
191+
Driver,
192+
drivers,
193+
command_executor=executor_lambda_test,
194+
options=get_lambda_test_capabilities_emulator(platform_version, device_name)))
194195
if len(drivers) < quantity:
195196
test_suite_data.current_test.testruns[-1].error = "Not all %s drivers are created" % quantity
196197

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import pytest
2+
3+
from base_test_case import MultipleSharedDeviceTestCase, create_shared_drivers
4+
from tests import marks
5+
from views.sign_in_view import SignInView
6+
7+
8+
def _check_account_creation(driver):
9+
sign_in_view = SignInView(driver)
10+
home_view = sign_in_view.create_user()
11+
home_view.profile_button.wait_for_visibility_of_element()
12+
13+
14+
@pytest.mark.xdist_group(name="new_seven_3")
15+
@marks.nightly
16+
class TestAndroid12(MultipleSharedDeviceTestCase):
17+
18+
def prepare_devices(self):
19+
self.drivers, self.loop = create_shared_drivers(quantity=1, platform_version=12, device_name="Pixel 5")
20+
21+
@marks.testrail_id(741806)
22+
def test_create_account_android_12(self):
23+
_check_account_creation(self.drivers[0])
24+
25+
26+
@pytest.mark.xdist_group(name="new_seven_3")
27+
@marks.nightly
28+
class TestAndroid13(MultipleSharedDeviceTestCase):
29+
30+
def prepare_devices(self):
31+
self.drivers, self.loop = create_shared_drivers(quantity=1, platform_version=13)
32+
33+
@marks.testrail_id(741807)
34+
def test_create_account_android_13(self):
35+
_check_account_creation(self.drivers[0])

0 commit comments

Comments
 (0)