Skip to content

Commit 99b7f29

Browse files
committed
Reduce timeouts in emulate tests
1 parent 71c1ce2 commit 99b7f29

File tree

1 file changed

+23
-34
lines changed

1 file changed

+23
-34
lines changed

tests/emulator/emulate_test.py

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ def setUpClass(cls):
3131
Emulator.ensure_available()
3232
Folder.cleanup('./' + cls.app_name)
3333
Tns.create_app(cls.app_name, update_modules=True)
34-
Tns.platform_add_android(attributes={"--path": cls.app_name,
35-
"--frameworkPath": ANDROID_RUNTIME_PATH
36-
})
34+
Tns.platform_add_android(attributes={"--path": cls.app_name, "--frameworkPath": ANDROID_RUNTIME_PATH})
3735

3836
def setUp(self):
3937
BaseClass.setUp(self)
@@ -50,29 +48,27 @@ def tearDownClass(cls):
5048

5149
def test_001_emulate_android_in_running_emulator(self):
5250
output = Tns.run_tns_command("emulate android", attributes={"--path": self.app_name,
53-
"--timeout": "600",
51+
"--timeout": "240",
5452
"--justlaunch": ""
55-
}, timeout=660)
53+
}, timeout=300)
5654
assert successfully_prepared in output
5755
assert successfully_built in output
5856
assert installed_on_device.format(EMULATOR_ID) in output
5957
assert "Starting Android emulator with image" not in output
6058
Device.is_running(app_id=app_identifier, device_id=EMULATOR_ID), \
61-
"Application is not running on {0}".format(EMULATOR_ID)
59+
"Application is not running on {0}".format(EMULATOR_ID)
6260

6361
def test_002_emulate_android_release(self):
64-
output = Tns.run_tns_command("emulate android", attributes={ # "--device": EMULATOR_NAME,
65-
"--keyStorePath": ANDROID_KEYSTORE_PATH,
66-
"--keyStorePassword": ANDROID_KEYSTORE_PASS,
67-
"--keyStoreAlias": ANDROID_KEYSTORE_ALIAS,
68-
"--keyStoreAliasPassword":
69-
ANDROID_KEYSTORE_ALIAS_PASS,
70-
"--release": "",
71-
"--path": self.app_name,
72-
"--timeout": "600",
73-
"--justlaunch": ""
74-
},
75-
timeout=660)
62+
output = Tns.run_tns_command("emulate android", attributes={"--keyStorePath": ANDROID_KEYSTORE_PATH,
63+
"--keyStorePassword": ANDROID_KEYSTORE_PASS,
64+
"--keyStoreAlias": ANDROID_KEYSTORE_ALIAS,
65+
"--keyStoreAliasPassword":
66+
ANDROID_KEYSTORE_ALIAS_PASS,
67+
"--release": "",
68+
"--path": self.app_name,
69+
"--timeout": "240",
70+
"--justlaunch": ""
71+
}, timeout=300)
7672
assert successfully_prepared in output
7773
assert successfully_built in output
7874
assert "Starting Android emulator with image" not in output
@@ -82,11 +78,8 @@ def test_002_emulate_android_release(self):
8278
def test_200_emulate_android_inside_project(self):
8379
current_dir = os.getcwd()
8480
os.chdir(os.path.join(current_dir, self.app_name))
85-
output = Tns.run_tns_command("emulate android", attributes={ # "--device": EMULATOR_NAME,
86-
"--timeout": "600",
87-
"--justlaunch": ""
88-
},
89-
tns_path=os.path.join("..", TNS_PATH), timeout=660)
81+
output = Tns.run_tns_command("emulate android", attributes={"--timeout": "240", "--justlaunch": ""},
82+
tns_path=os.path.join("..", TNS_PATH), timeout=300)
9083
os.chdir(current_dir)
9184
assert successfully_prepared in output
9285
assert successfully_built in output
@@ -96,8 +89,8 @@ def test_200_emulate_android_inside_project(self):
9689

9790
def test_300_emulate_android_platform_not_added(self):
9891
Tns.create_app(self.app_name_noplatform)
99-
output = Tns.run_tns_command("emulate android", attributes={"--timeout": "720", "--justlaunch": "",
100-
"--path": self.app_name_noplatform}, timeout=750)
92+
output = Tns.run_tns_command("emulate android", attributes={"--timeout": "240", "--justlaunch": "",
93+
"--path": self.app_name_noplatform}, timeout=300)
10194
assert copy_template_files in output
10295
assert successfully_created in output
10396
assert successfully_prepared in output
@@ -107,19 +100,15 @@ def test_300_emulate_android_platform_not_added(self):
107100
assert started_on_device in output
108101

109102
def test_400_emulate_invalid_platform(self):
110-
output = Tns.run_tns_command("emulate invalidPlatform", attributes={"--path": self.app_name,
111-
"--timeout": "30",
112-
"--justlaunch": ""
113-
})
103+
output = Tns.run_tns_command("emulate invalidPlatform", attributes={"--path": self.app_name, "--timeout": "30",
104+
"--justlaunch": ""})
114105
assert invalid_input.format("emulate") in output
115106
assert "Usage" in output
116107

117108
def test_401_emulate_invalid_avd(self):
118-
output = Tns.run_tns_command("emulate android", attributes={"--path": self.app_name,
119-
"--device": invalid,
120-
"--timeout": "30",
121-
"--justlaunch": ""
122-
})
109+
output = Tns.run_tns_command("emulate android",
110+
attributes={"--path": self.app_name, "--device": invalid, "--timeout": "30",
111+
"--justlaunch": ""})
123112
assert 'Cannot resolve the specified connected device by the provided index or identifier' or \
124113
'Cannot find device with name' in output
125114
assert "Usage" in output

0 commit comments

Comments
 (0)