Skip to content

Commit 9ce6b70

Browse files
add asserts for analytics check (#190)
* add asserts for analytics check * fix
1 parent bc6b195 commit 9ce6b70

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/build/common/usage_reporting_tests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
import os
55

66
from core.base_class.BaseClass import BaseClass
7+
from core.osutils.file import File
8+
from core.settings.settings import TEST_RUN_HOME
79
from core.settings.strings import *
810
from core.tns.tns import Tns
911

1012

1113
class UsageReportingTests(BaseClass):
14+
config = os.path.join(TEST_RUN_HOME, 'node_modules', 'nativescript', 'config', 'config.json')
1215

1316
@classmethod
1417
def setUpClass(cls):
@@ -21,6 +24,8 @@ def tearDownClass(cls):
2124
def test_001_usage_reporting_enable(self):
2225
output = Tns.run_tns_command("usage-reporting enable")
2326
assert enabled.format(usage_reporting, "now ") in output
27+
assert "GA_TRACKING_ID" in File.read(self.config)
28+
assert "UA-111455-44" in File.read(self.config)
2429

2530
# Check there is message for tracking in Google Analytics
2631
output = Tns.run_tns_command("doctor", timeout=180, log_trace=True)
@@ -40,6 +45,8 @@ def test_001_usage_reporting_enable(self):
4045
def test_002_usage_reporting_disable(self):
4146
output = Tns.run_tns_command("usage-reporting disable")
4247
assert disabled.format(usage_reporting, "now ") in output
48+
assert "GA_TRACKING_ID" in File.read(self.config)
49+
assert "UA-111455-44" in File.read(self.config)
4350

4451
# Check there is no any message for tracking in Google Analytics
4552
output = Tns.run_tns_command("doctor", timeout=180, log_trace=True)

0 commit comments

Comments
 (0)