Skip to content

Commit 6e8328f

Browse files
author
Nataliya Hristova
committed
fix: test for Google Analytics message - cli#3536 (#114)
* fix: test for Google Analytics message - cli#3536 * fix: Move tests. * add test for local paths in Analytics
1 parent d061ff1 commit 6e8328f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/build/common/usage_reporting_tests.py

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Test for usage-reporting command
33
"""
4+
import os
45

56
from core.base_class.BaseClass import BaseClass
67
from core.settings.strings import *
@@ -21,13 +22,29 @@ def test_001_usage_reporting_enable(self):
2122
output = Tns.run_tns_command("usage-reporting enable")
2223
assert enabled.format(usage_reporting, "now ") in output
2324

25+
# Check there is message for tracking in Google Analytics
26+
output = Tns.run_tns_command("doctor", timeout=180, log_trace=True)
27+
assert "Will send the following information to Google Analytics" in output
28+
2429
output = Tns.run_tns_command("usage-reporting status")
2530
assert enabled.format(usage_reporting, "") in output
2631

32+
# https://github.com/NativeScript/nativescript-cli/issues/3595
33+
output = Tns.create_app(self.app_name,
34+
attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
35+
log_trace=True,
36+
force_clean=False, update_modules=True)
37+
assert "label: 'data/apps/livesync-hello-world.tgz'" not in output
38+
assert "label: 'localTemplate_tns-template-hello-world'" in output
39+
2740
def test_002_usage_reporting_disable(self):
2841
output = Tns.run_tns_command("usage-reporting disable")
2942
assert disabled.format(usage_reporting, "now ") in output
3043

44+
# Check there is no any message for tracking in Google Analytics
45+
output = Tns.run_tns_command("doctor", timeout=180, log_trace=True)
46+
assert "Will send the following information to Google Analytics" not in output
47+
3148
output = Tns.run_tns_command("usage-reporting status")
3249
assert disabled.format(usage_reporting, "") in output
3350

0 commit comments

Comments
 (0)